Commit a4175950 authored by Cristian Marussi's avatar Cristian Marussi Committed by Sudeep Holla
Browse files

firmware: arm_scmi: Make SMC transport a standalone driver



Make SCMI SMC transport a standalone driver that can be optionally
loaded as a module.

CC: Peng Fan <peng.fan@nxp.com>
CC: Nikunj Kela <quic_nkela@quicinc.com>
Signed-off-by: default avatarCristian Marussi <cristian.marussi@arm.com>
Message-Id: <20240812173340.3912830-7-cristian.marussi@arm.com>
[sudeep.holla: moved Clang Thumb2 build fix to the new makefile]
Signed-off-by: default avatarSudeep Holla <sudeep.holla@arm.com>
parent b53515fa
Loading
Loading
Loading
Loading
+0 −26
Original line number Diff line number Diff line
@@ -84,32 +84,6 @@ config ARM_SCMI_TRANSPORT_OPTEE
	  If you want the ARM SCMI PROTOCOL stack to include support for a
	  transport based on OP-TEE SCMI service, answer Y.

config ARM_SCMI_TRANSPORT_SMC
	bool "SCMI transport based on SMC"
	depends on HAVE_ARM_SMCCC_DISCOVERY
	select ARM_SCMI_HAVE_TRANSPORT
	select ARM_SCMI_HAVE_SHMEM
	default y
	help
	  Enable SMC based transport for SCMI.

	  If you want the ARM SCMI PROTOCOL stack to include support for a
	  transport based on SMC, answer Y.

config ARM_SCMI_TRANSPORT_SMC_ATOMIC_ENABLE
	bool "Enable atomic mode support for SCMI SMC transport"
	depends on ARM_SCMI_TRANSPORT_SMC
	help
	  Enable support of atomic operation for SCMI SMC based transport.

	  If you want the SCMI SMC based transport to operate in atomic
	  mode, avoiding any kind of sleeping behaviour for selected
	  transactions on the TX path, answer Y.
	  Enabling atomic mode operations allows any SCMI driver using this
	  transport to optionally ask for atomic SCMI transactions and operate
	  in atomic context too, at the price of using a number of busy-waiting
	  primitives all over instead. If unsure say N.

config ARM_SCMI_TRANSPORT_VIRTIO
	bool "SCMI transport based on VirtIO"
	depends on VIRTIO=y || VIRTIO=ARM_SCMI_PROTOCOL
+0 −8
Original line number Diff line number Diff line
@@ -5,7 +5,6 @@ scmi-core-objs := $(scmi-bus-y)
scmi-driver-y = driver.o notify.o
scmi-driver-$(CONFIG_ARM_SCMI_RAW_MODE_SUPPORT) += raw_mode.o
scmi-transport-$(CONFIG_ARM_SCMI_HAVE_SHMEM) = shmem.o
scmi-transport-$(CONFIG_ARM_SCMI_TRANSPORT_SMC) += smc.o
scmi-transport-$(CONFIG_ARM_SCMI_HAVE_MSG) += msg.o
scmi-transport-$(CONFIG_ARM_SCMI_TRANSPORT_VIRTIO) += virtio.o
scmi-transport-$(CONFIG_ARM_SCMI_TRANSPORT_OPTEE) += optee.o
@@ -19,10 +18,3 @@ obj-$(CONFIG_ARM_SCMI_PROTOCOL) += scmi-core.o
obj-$(CONFIG_ARM_SCMI_PROTOCOL) += scmi-module.o

obj-$(CONFIG_ARM_SCMI_POWER_CONTROL) += scmi_power_control.o

ifeq ($(CONFIG_THUMB2_KERNEL)$(CONFIG_CC_IS_CLANG),yy)
# The use of R7 in the SMCCC conflicts with the compiler's use of R7 as a frame
# pointer in Thumb2 mode, which is forcibly enabled by Clang when profiling
# hooks are inserted via the -pg switch.
CFLAGS_REMOVE_smc.o += $(CC_FLAGS_FTRACE)
endif
+0 −3
Original line number Diff line number Diff line
@@ -286,9 +286,6 @@ int scmi_xfer_raw_inflight_register(const struct scmi_handle *handle,
int scmi_xfer_raw_wait_for_message_response(struct scmi_chan_info *cinfo,
					    struct scmi_xfer *xfer,
					    unsigned int timeout_ms);
#ifdef CONFIG_ARM_SCMI_TRANSPORT_SMC
extern const struct scmi_desc scmi_smc_desc;
#endif
#ifdef CONFIG_ARM_SCMI_TRANSPORT_VIRTIO
extern const struct scmi_desc scmi_virtio_desc;
#endif
+0 −5
Original line number Diff line number Diff line
@@ -3321,11 +3321,6 @@ static const struct of_device_id scmi_of_match[] = {
#ifdef CONFIG_ARM_SCMI_TRANSPORT_OPTEE
	{ .compatible = "linaro,scmi-optee", .data = &scmi_optee_desc },
#endif
#ifdef CONFIG_ARM_SCMI_TRANSPORT_SMC
	{ .compatible = "arm,scmi-smc", .data = &scmi_smc_desc},
	{ .compatible = "arm,scmi-smc-param", .data = &scmi_smc_desc},
	{ .compatible = "qcom,scmi-smc", .data = &scmi_smc_desc},
#endif
#ifdef CONFIG_ARM_SCMI_TRANSPORT_VIRTIO
	{ .compatible = "arm,scmi-virtio", .data = &scmi_virtio_desc},
#endif
+28 −0
Original line number Diff line number Diff line
@@ -34,4 +34,32 @@ config ARM_SCMI_TRANSPORT_MAILBOX
	  This driver can also be built as a module. If so, the module
	  will be called scmi_transport_mailbox.

config ARM_SCMI_TRANSPORT_SMC
	tristate "SCMI transport based on SMC"
	depends on HAVE_ARM_SMCCC_DISCOVERY
	select ARM_SCMI_HAVE_TRANSPORT
	select ARM_SCMI_HAVE_SHMEM
	default y
	help
	  Enable SMC based transport for SCMI.

	  If you want the ARM SCMI PROTOCOL stack to include support for a
	  transport based on SMC, answer Y.
	  This driver can also be built as a module. If so, the module
	  will be called scmi_transport_smc.

config ARM_SCMI_TRANSPORT_SMC_ATOMIC_ENABLE
	bool "Enable atomic mode support for SCMI SMC transport"
	depends on ARM_SCMI_TRANSPORT_SMC
	help
	  Enable support of atomic operation for SCMI SMC based transport.

	  If you want the SCMI SMC based transport to operate in atomic
	  mode, avoiding any kind of sleeping behaviour for selected
	  transactions on the TX path, answer Y.
	  Enabling atomic mode operations allows any SCMI driver using this
	  transport to optionally ask for atomic SCMI transactions and operate
	  in atomic context too, at the price of using a number of busy-waiting
	  primitives all over instead. If unsure say N.

endmenu
Loading