Skip to content

Commit 3d8a43c

Browse files
etienne-lmsfourmone
authored andcommitted
firmware: arm_scmi: new optee transport layer
Add a new transport channel to the SCMI firmware interface driver for SCMI message exchange based on OP-TEE transport channel that leverage OP-TEE secure threaded context for processing of SCMI messages. The current proposal uses a statically defined physical memory area to be used as shared memory SCMI endpoints. The location is extracted from the FDT upon property "shmem". Entry in OP-TEE threaded context is realized by invoking a service PTA (Pseudo TA) in OP-TEE OS. Each invocation carries a agent numerical identifier for which a message is pending in the shared memory. The OP-TEE service provides means to get the agent identifier value for a given shared memory location. OPTEE transport driver depends on CONFIG_OPTEE and probes from SCMI compatible identifier "arm,scmi-optee". Change-Id: Iedae882abfbbd5d1b6706ea0502fc867fce6cee0 Signed-off-by: Etienne Carriere <[email protected]>
1 parent 3e6ebdf commit 3d8a43c

File tree

5 files changed

+411
-1
lines changed

5 files changed

+411
-1
lines changed

drivers/firmware/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ source "drivers/firmware/arm_scmi/Kconfig"
1111
config ARM_SCPI_PROTOCOL
1212
tristate "ARM System Control and Power Interface (SCPI) Message Protocol"
1313
depends on ARM || ARM64 || COMPILE_TEST
14-
depends on MAILBOX
14+
depends on MAILBOX || HAVE_ARM_SMCCC || OPTEE
1515
help
1616
System Control and Power Interface (SCPI) Message Protocol is
1717
defined for the purpose of communication between the Application

drivers/firmware/arm_scmi/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ scmi-transport-$(CONFIG_ARM_SCMI_TRANSPORT_MAILBOX) += mailbox.o
66
scmi-transport-$(CONFIG_ARM_SCMI_TRANSPORT_SMC) += smc.o
77
scmi-transport-$(CONFIG_ARM_SCMI_HAVE_MSG) += msg.o
88
scmi-transport-$(CONFIG_ARM_SCMI_TRANSPORT_VIRTIO) += virtio.o
9+
scmi-transport-$(CONFIG_OPTEE) += optee.o
910
scmi-protocols-y = base.o clock.o perf.o power.o reset.o sensors.o system.o voltage.o
1011
scmi-module-objs := $(scmi-bus-y) $(scmi-driver-y) $(scmi-protocols-y) \
1112
$(scmi-transport-y)

drivers/firmware/arm_scmi/common.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,9 @@ extern const struct scmi_desc scmi_smc_desc;
421421
#ifdef CONFIG_ARM_SCMI_TRANSPORT_VIRTIO
422422
extern const struct scmi_desc scmi_virtio_desc;
423423
#endif
424+
#ifdef CONFIG_OPTEE
425+
extern const struct scmi_desc scmi_optee_desc;
426+
#endif
424427

425428
void scmi_rx_callback(struct scmi_chan_info *cinfo, u32 msg_hdr, void *priv);
426429
void scmi_free_channel(struct scmi_chan_info *cinfo, struct idr *idr, int id);

drivers/firmware/arm_scmi/driver.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1997,6 +1997,9 @@ static const struct of_device_id scmi_of_match[] = {
19971997
#ifdef CONFIG_ARM_SCMI_TRANSPORT_SMC
19981998
{ .compatible = "arm,scmi-smc", .data = &scmi_smc_desc},
19991999
#endif
2000+
#ifdef CONFIG_OPTEE
2001+
{ .compatible = "linaro,scmi-optee", .data = &scmi_optee_desc },
2002+
#endif
20002003
#ifdef CONFIG_ARM_SCMI_TRANSPORT_VIRTIO
20012004
{ .compatible = "arm,scmi-virtio", .data = &scmi_virtio_desc},
20022005
#endif

0 commit comments

Comments
 (0)