Skip to content

[RFC] SCMI drivers: generic changes + Arm SMCCC transport + drafted OP-TEE transport#2

Open
etienne-lms wants to merge 15 commits intolinux-nextfrom
scmi-changes
Open

[RFC] SCMI drivers: generic changes + Arm SMCCC transport + drafted OP-TEE transport#2
etienne-lms wants to merge 15 commits intolinux-nextfrom
scmi-changes

Conversation

@etienne-lms
Copy link
Owner

Early review for a series of changes proposed in the SCMI drivers.

  • some generic changes ()
  • introduce Arm SMCCC transport channel (invoke SMCI server through an SMC instruction)
  • introduce OP-TEE transport channel: currently in draft version
  • proposal for reformatting SCMI drivers documentation

@etienne-lms etienne-lms changed the title SCMI drivers: generic changes + Arm SMCCC transport + drafted OP-TEE transport [RFC] SCMI drivers: generic changes + Arm SMCCC transport + drafted OP-TEE transport Apr 14, 2020
SCMI could use SMC/HVC as tranports. Since there is no
standardized id, we need to use vendor specific id. So
add into devicetree binding doc.

Also add arm,scmi-smc compatible string for smc/hvc transport

Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Take arm,smc-id as the 1st arg, leave the other args as zero for now.
There is no Rx, only Tx because of smc/hvc not support Rx.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Embed SCMI mailbox transport upon CONFIG_MAILBOX configuration switch.
Embed SCMI smc transport upon CONFIG_HAVE_ARM_SMCCC configuration switch.

Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Don't mandate res.a0 to be 0 for a valid invocation.
As per SMCCC specification, only value ~0 (sign extended -1) denoted
a non supported function ID.

Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Do not mandate to rely on arm_smccc_1_1_invoke() which depends on PSCI
support to dynamically provide the expected method. Allow FDT to define
the conduit method using property "method". If no property "method" is
defined in the FDT, invocation relies on arm_smccc_1_1_invoke().

Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Split binding properties description in 2 sections for clarity.

Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Add optional property "method" to define which of the Arm SMC or HVC
instruction is to be used to invoke the SCMI server in secure world.
This is needed when the platform do not provide a SMCCC 1.1 conduit
method driven from the PSCI driver.

Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Add missing header guards to local common.h.

Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
 transfer

Change scmi_do_xfer() to not report a timeout when transport
poll_done callback handler reports success even if timeout occurred.

This change prevent reporting of a timeout when poll operation
is delayed, i.e. due to thread reschedule, and return success
when timeout elapsed due to the executed thread being rescheduled.

Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Fix scmi_do_xfer() to test SCMI transport callback handler return
value this is expected to be 0 on success, not any positive value.

Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Remove transport callback handler chan_available that can be factorize
for all transports. Indeed SCMI child nodes defining each expected
SCMI protocol define expect protocol ID through FDT property "reg"
whereas SCMI device root node does not define such "reg" property.

This change replaces need for transport specific chan_available
handler with a common test on SCMI root node to determine if currently
probed device is the SCMI device which shall define the channel to be
used whereas SCMI child node only define target protocols.

This change updates mailbox transport driver accordingly.

Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
TODO: remove shmem from the bindings. Message buffer should be
      provided through a memref parameter to OP-TEE PTA invocation.

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".

Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>

# Conflicts:
#	drivers/firmware/arm_scmi/Makefile
#	drivers/firmware/arm_scmi/common.h
Introduce compatible "linaro,scmi-optee" for SCMI transport channel
based on an OP-TEE service invocation.

This device mandates an agent_id property to identify the SCMI agent
invoking the OP-TEE service. SCMI message is transmitted to the
OP-TEE using OP-TEE native shared buffer support.

Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
@etienne-lms
Copy link
Owner Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments