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

firmware: arm_scmi: Make VirtIO transport a standalone driver



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

CC: Michael S. Tsirkin <mst@redhat.com>
CC: Igor Skalkin <igor.skalkin@opensynergy.com>
CC: Peter Hilber <peter.hilber@opensynergy.com>
Signed-off-by: default avatarCristian Marussi <cristian.marussi@arm.com>
Message-Id: <20240812173340.3912830-9-cristian.marussi@arm.com>
Signed-off-by: default avatarSudeep Holla <sudeep.holla@arm.com>
parent db9cc5e6
Loading
Loading
Loading
Loading
+0 −41
Original line number Diff line number Diff line
@@ -71,47 +71,6 @@ config ARM_SCMI_DEBUG_COUNTERS

source "drivers/firmware/arm_scmi/transports/Kconfig"

config ARM_SCMI_TRANSPORT_VIRTIO
	bool "SCMI transport based on VirtIO"
	depends on VIRTIO=y || VIRTIO=ARM_SCMI_PROTOCOL
	select ARM_SCMI_HAVE_TRANSPORT
	select ARM_SCMI_HAVE_MSG
	help
	  This enables the virtio based transport for SCMI.

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

config ARM_SCMI_TRANSPORT_VIRTIO_VERSION1_COMPLIANCE
	bool "SCMI VirtIO transport Version 1 compliance"
	depends on ARM_SCMI_TRANSPORT_VIRTIO
	default y
	help
	  This enforces strict compliance with VirtIO Version 1 specification.

	  If you want the ARM SCMI VirtIO transport layer to refuse to work
	  with Legacy VirtIO backends and instead support only VirtIO Version 1
	  devices (or above), answer Y.

	  If you want instead to support also old Legacy VirtIO backends (like
	  the ones implemented by kvmtool) and let the core Kernel VirtIO layer
	  take care of the needed conversions, say N.

config ARM_SCMI_TRANSPORT_VIRTIO_ATOMIC_ENABLE
	bool "Enable atomic mode for SCMI VirtIO transport"
	depends on ARM_SCMI_TRANSPORT_VIRTIO
	help
	  Enable support of atomic operation for SCMI VirtIO based transport.

	  If you want the SCMI VirtIO 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.

endif #ARM_SCMI_PROTOCOL

config ARM_SCMI_POWER_CONTROL
+0 −1
Original line number Diff line number Diff line
@@ -6,7 +6,6 @@ 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_HAVE_MSG) += msg.o
scmi-transport-$(CONFIG_ARM_SCMI_TRANSPORT_VIRTIO) += virtio.o
scmi-protocols-y := base.o clock.o perf.o power.o reset.o sensors.o system.o voltage.o powercap.o
scmi-protocols-y += pinctrl.o
scmi-module-objs := $(scmi-driver-y) $(scmi-protocols-y) $(scmi-transport-y)
+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_VIRTIO
extern const struct scmi_desc scmi_virtio_desc;
#endif

void scmi_rx_callback(struct scmi_chan_info *cinfo, u32 msg_hdr, void *priv);

+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_VIRTIO
	{ .compatible = "arm,scmi-virtio", .data = &scmi_virtio_desc},
#endif
	{ /* Sentinel */ },
};

+43 −0
Original line number Diff line number Diff line
@@ -77,4 +77,47 @@ config ARM_SCMI_TRANSPORT_OPTEE
	  This driver can also be built as a module. If so, the module
	  will be called scmi_transport_optee.

config ARM_SCMI_TRANSPORT_VIRTIO
	tristate "SCMI transport based on VirtIO"
	depends on VIRTIO
	select ARM_SCMI_HAVE_TRANSPORT
	select ARM_SCMI_HAVE_MSG
	help
	  This enables the virtio based transport for SCMI.

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

config ARM_SCMI_TRANSPORT_VIRTIO_VERSION1_COMPLIANCE
	bool "SCMI VirtIO transport Version 1 compliance"
	depends on ARM_SCMI_TRANSPORT_VIRTIO
	default y
	help
	  This enforces strict compliance with VirtIO Version 1 specification.

	  If you want the ARM SCMI VirtIO transport layer to refuse to work
	  with Legacy VirtIO backends and instead support only VirtIO Version 1
	  devices (or above), answer Y.

	  If you want instead to support also old Legacy VirtIO backends (like
	  the ones implemented by kvmtool) and let the core Kernel VirtIO layer
	  take care of the needed conversions, say N.

config ARM_SCMI_TRANSPORT_VIRTIO_ATOMIC_ENABLE
	bool "Enable atomic mode for SCMI VirtIO transport"
	depends on ARM_SCMI_TRANSPORT_VIRTIO
	help
	  Enable support of atomic operation for SCMI VirtIO based transport.

	  If you want the SCMI VirtIO 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