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

firmware: arm_scmi: Make MBOX transport a standalone driver



Make SCMI mailbox transport a standalone driver that can be optionally
loaded as a module; while at it, create a dedicated subdirectory and
submenu for SCMI Transports.

Signed-off-by: default avatarCristian Marussi <cristian.marussi@arm.com>
Message-Id: <20240812173340.3912830-6-cristian.marussi@arm.com>
Signed-off-by: default avatarSudeep Holla <sudeep.holla@arm.com>
parent 8b76a8c9
Loading
Loading
Loading
Loading
+1 −30
Original line number Diff line number Diff line
@@ -69,36 +69,7 @@ config ARM_SCMI_DEBUG_COUNTERS
	  such useful debug counters. This can be helpful for debugging and
	  SCMI monitoring.

config ARM_SCMI_HAVE_TRANSPORT
	bool
	help
	  This declares whether at least one SCMI transport has been configured.
	  Used to trigger a build bug when trying to build SCMI without any
	  configured transport.

config ARM_SCMI_HAVE_SHMEM
	bool
	help
	  This declares whether a shared memory based transport for SCMI is
	  available.

config ARM_SCMI_HAVE_MSG
	bool
	help
	  This declares whether a message passing based transport for SCMI is
	  available.

config ARM_SCMI_TRANSPORT_MAILBOX
	bool "SCMI transport based on Mailbox"
	depends on MAILBOX
	select ARM_SCMI_HAVE_TRANSPORT
	select ARM_SCMI_HAVE_SHMEM
	default y
	help
	  Enable mailbox based transport for SCMI.

	  If you want the ARM SCMI PROTOCOL stack to include support for a
	  transport based on mailboxes, answer Y.
source "drivers/firmware/arm_scmi/transports/Kconfig"

config ARM_SCMI_TRANSPORT_OPTEE
	bool "SCMI transport based on OP-TEE service"
+2 −1
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_MAILBOX) += mailbox.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
@@ -14,6 +13,8 @@ scmi-protocols-y := base.o clock.o perf.o power.o reset.o sensors.o system.o vol
scmi-protocols-y += pinctrl.o
scmi-module-objs := $(scmi-driver-y) $(scmi-protocols-y) $(scmi-transport-y)

obj-$(CONFIG_ARM_SCMI_PROTOCOL) += transports/

obj-$(CONFIG_ARM_SCMI_PROTOCOL) += scmi-core.o
obj-$(CONFIG_ARM_SCMI_PROTOCOL) += scmi-module.o

+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_MAILBOX
extern const struct scmi_desc scmi_mailbox_desc;
#endif
#ifdef CONFIG_ARM_SCMI_TRANSPORT_SMC
extern const struct scmi_desc scmi_smc_desc;
#endif
+0 −3
Original line number Diff line number Diff line
@@ -3318,9 +3318,6 @@ ATTRIBUTE_GROUPS(versions);

/* Each compatible listed below must have descriptor associated with it */
static const struct of_device_id scmi_of_match[] = {
#ifdef CONFIG_ARM_SCMI_TRANSPORT_MAILBOX
	{ .compatible = "arm,scmi", .data = &scmi_mailbox_desc },
#endif
#ifdef CONFIG_ARM_SCMI_TRANSPORT_OPTEE
	{ .compatible = "linaro,scmi-optee", .data = &scmi_optee_desc },
#endif
+37 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0-only
menu "SCMI Transport Drivers"

config ARM_SCMI_HAVE_TRANSPORT
	bool
	help
	  This declares whether at least one SCMI transport has been configured.
	  Used to trigger a build bug when trying to build SCMI without any
	  configured transport.

config ARM_SCMI_HAVE_SHMEM
	bool
	help
	  This declares whether a shared memory based transport for SCMI is
	  available.

config ARM_SCMI_HAVE_MSG
	bool
	help
	  This declares whether a message passing based transport for SCMI is
	  available.

config ARM_SCMI_TRANSPORT_MAILBOX
	tristate "SCMI transport based on Mailbox"
	depends on MAILBOX
	select ARM_SCMI_HAVE_TRANSPORT
	select ARM_SCMI_HAVE_SHMEM
	default y
	help
	  Enable mailbox based transport for SCMI.

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

endmenu
Loading