Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

firmware: scmi: add base proto, scmi sample, smc/hvc transport and reset proto #78293

Closed
wants to merge 13 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions drivers/firmware/scmi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ zephyr_library()
zephyr_library_sources_ifdef(CONFIG_ARM_SCMI core.c)
zephyr_library_sources_ifdef(CONFIG_ARM_SCMI_MAILBOX_TRANSPORT mailbox.c)
zephyr_library_sources_ifdef(CONFIG_ARM_SCMI_SHMEM shmem.c)
zephyr_library_sources_ifdef(CONFIG_ARM_SCMI_SMC_TRANSPORT smc.c)

# SCMI protocol helper files
zephyr_library_sources_ifdef(CONFIG_ARM_SCMI_BASE_HELPERS base.c)
zephyr_library_sources_ifdef(CONFIG_ARM_SCMI_CLK_HELPERS clk.c)
zephyr_library_sources_ifdef(CONFIG_ARM_SCMI_PINCTRL_HELPERS pinctrl.c)
zephyr_library_sources_ifdef(CONFIG_ARM_SCMI_RESET_HELPERS reset.c)
42 changes: 28 additions & 14 deletions drivers/firmware/scmi/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,6 @@

if ARM_SCMI

config ARM_SCMI_CLK_HELPERS
bool "Helper functions for SCMI clock protocol"
default y
depends on DT_HAS_ARM_SCMI_CLOCK_ENABLED
help
Enable support for SCMI clock protocol helper functions.

config ARM_SCMI_MAILBOX_TRANSPORT
bool "SCMI transport based on shared memory and doorbells"
default y
Expand All @@ -20,13 +13,6 @@ config ARM_SCMI_MAILBOX_TRANSPORT
Enable support for SCMI transport based on shared memory
and doorbells.

config ARM_SCMI_PINCTRL_HELPERS
bool "Helper functions for SCMI pinctrl protocol"
default y
depends on DT_HAS_ARM_SCMI_PINCTRL_ENABLED
help
Enable support for SCMI pinctrl protocol helper functions.

config ARM_SCMI_SHMEM
bool "SCMI shared memory (SHMEM) driver"
default y
Expand Down Expand Up @@ -56,4 +42,32 @@ config ARM_SCMI_TRANSPORT_INIT_PRIORITY
help
SCMI transport driver device initialization priority.

config ARM_SCMI_SMC_TRANSPORT
bool
depends on ARM_SCMI_SHMEM
select ARM_SCMI_TRANSPORT_HAS_STATIC_CHANNELS
default y if DT_HAS_ARM_SCMI_SMC_ENABLED
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can probably simplify to default y if DT_HAS_ARM_SCMI_SMC_ENABLED||DT_HAS_ARM_SCMI_SMC_PARAM_ENABLED`

default y if DT_HAS_ARM_SCMI_SMC_PARAM_ENABLED
help
Enable support of SCMI compliant firmware with ARM SMC/HVC transport
with/without shmem address(4KB-page, offset) as parameters

choice ARM_SCMI_SMC_METHOD
bool "Select ARM SCMI SMC Calling Convention method"
depends on ARM_SCMI_SMC_TRANSPORT
default ARM_SCMI_SMC_METHOD_SMC

config ARM_SCMI_SMC_METHOD_SMC
bool "Use ARM SCMI Secure Monitor Call (SMC) method"
help
Use ARM Secure Monitor Call (SMC) method to access SCMI.

config ARM_SCMI_SMC_METHOD_HVC
bool "Use ARM SCMI Hypervisor Call (HVC) method"
help
Use ARM Hypervisor Call (HVC) method to access SCMI.
endchoice

rsource "Kconfig.proto"

endif # ARM_SCMI
47 changes: 47 additions & 0 deletions drivers/firmware/scmi/Kconfig.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Copyright 2024 NXP
# SPDX-License-Identifier: Apache-2.0

config ARM_SCMI_CLK_HELPERS
bool "Helper functions for SCMI clock protocol"
default y
depends on DT_HAS_ARM_SCMI_CLOCK_ENABLED
help
Enable support for SCMI clock protocol helper functions.

config ARM_SCMI_PINCTRL_HELPERS
bool "Helper functions for SCMI pinctrl protocol"
default y
depends on DT_HAS_ARM_SCMI_PINCTRL_ENABLED
help
Enable support for SCMI pinctrl protocol helper functions.

config ARM_SCMI_BASE_HELPERS
bool "Helper functions for SCMI base protocol"
default y
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should depend on one of the transports

help
Enable support for SCMI base protocol helper functions.

config ARM_SCMI_BASE_EXT_REV
bool "Select to report ARM SCMI base protocol extended revision"
depends on ARM_SCMI_BASE_HELPERS
default n
help
Enable report of ARM SCMI base extended revision information at boot time.

config ARM_SCMI_BASE_AGENT_HELPERS
bool "Helper functions for SCMI base protocol agents management"
depends on ARM_SCMI_BASE_EXT_REV
default n
help
Enable support for SCMI base protocol agents management helper functions.
It enables support for SCMI base protocol messages:
- BASE_DISCOVER_AGENT
- BASE_SET_DEVICE_PERMISSIONS
- BASE_RESET_AGENT_CONFIGURATION

config ARM_SCMI_RESET_HELPERS
bool "Helper functions for SCMI reset protocol"
default y
depends on DT_HAS_ARM_SCMI_RESET_ENABLED
help
Enable support for SCMI reset protocol helper functions.
Loading
Loading