summaryrefslogtreecommitdiff
path: root/drivers/firmware/scmi/optee_agent.c
AgeCommit message (Collapse)Author
2026-02-26firmware: scmi: Validate device tree node before setup channelPeng Fan
SCMI base protocol device does not have a device tree, it should use and need to use the agent base channel. For scmi_base.[x], there is no real device tree node for it. ofnode_null() is assigned as the device tree node for scmi base protocol device: commit 7eb4eb541c14 ("firmware: scmi: install base protocol to SCMI agent") However with recent update in commit 0535e46d55d7 ("scripts/dtc: Update to upstream version v1.7.2-35-g52f07dcca47c"), SPL panic in fdt_check_node_offset_()->fdt_next_tag(), because offset is -1 and SPL_OF_LIBFDT_ASSUME_MASK is 0xFF. So add a check in x_get_channel() to validate the protocol devices' ofnode. Reported-by: Ye Li <[email protected]> Closes: https://lore.kernel.org/u-boot/[email protected]/ Signed-off-by: Peng Fan <[email protected]>
2024-05-20Restore patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"Tom Rini
As part of bringing the master branch back in to next, we need to allow for all of these changes to exist here. Reported-by: Jonas Karlman <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2024-05-19Revert "Merge patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet""Tom Rini
When bringing in the series 'arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"' I failed to notice that b4 noticed it was based on next and so took that as the base commit and merged that part of next to master. This reverts commit c8ffd1356d42223cbb8c86280a083cc3c93e6426, reversing changes made to 2ee6f3a5f7550de3599faef9704e166e5dcace35. Reported-by: Jonas Karlman <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2024-05-07firmware: Remove <common.h> and add needed includesTom Rini
Remove <common.h> from this driver directory and when needed add missing include files directly. Reviewed-by: Ilias Apalodimas <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2023-10-13firmware: scmi: Fix clearing variableFrancois Berder
The sess variable in open_channel was not entirely cleared to zero at the start of this function. This commit ensures that the entire struct is cleared. Signed-off-by: Francois Berder <[email protected]>
2023-10-13firmware: scmi: use a protocol's own channel if assignedAKASHI Takahiro
SCMI specification allows any protocol to have its own channel for the transport. While the current SCMI driver may assign its channel from a device tree, the core function, devm_scmi_process_msg(), doesn't use a protocol's channel, but always use an agent's channel. With this commit, devm_scmi_process_msg() tries to find and use a protocol's channel. If it doesn't exist, use an agent's. Signed-off-by: AKASHI Takahiro <[email protected]> Reviewed-by: Etienne Carriere <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2022-10-12firmware: scmi: fix the multi channel support with CCFPatrick Delaunay
When the CCF is activated, the dev->parent is not necessary the reference to SCMI transport and the function devm_scmi_of_get_channel failed for the registered SCMI clock, child for protocol@14, the channel is null and the SCMI clock driver crash for any operations. This patch changes the first parameter of the ops of_get_channel(), aligned with other process_msg() to pass directly the good reference, i.e. parent result of find_scmi_transport_device(dev) which return the reference of the scmi transport device. Fixes: 8e96801aa6a ("firmware: scmi: add multi-channel support") Signed-off-by: Patrick Delaunay <[email protected]>
2022-06-23firmware: scmi: use multi channel in mailbox, optee and smccc agentsEtienne Carriere
Updates .process_msg operators of the SCMI transport drivers that supports multi-channel to use it now that drivers do provide the reference through channel argument. These are the mailbox agent, the optee agent and the smccc agent. Signed-off-by: Etienne Carriere <[email protected]>
2022-06-23firmware: scmi: optee transport: implement multi-channelEtienne Carriere
Implements multi SCMI channel support in OP-TEE SCMI transport. An SCMI protocol may use a dedicated channel, specified by the DT. Signed-off-by: Etienne Carriere <[email protected]>
2022-06-23firmware: scmi: prepare uclass to pass channel referenceEtienne Carriere
Changes SCMI transport operator ::process_msg to pass the SCMI channel reference provided by caller SCMI protocol device. Signed-off-by: Etienne Carriere <[email protected]>
2022-06-23firmware: scmi: optee: fix inline description of PTA_SCMI_CMD_GET_CHANNELEtienne Carriere
Removes inaccurate inline description of OP-TEE SCMI PTA command PTA_SCMI_CMD_GET_CHANNEL. Signed-off-by: Etienne Carriere <[email protected]>
2022-06-23firmware: scmi: optee: use TEE shared memory for SCMI messagesEtienne Carriere
Changes implementation when using TEE dynamically allocated shared memory to synchronize with the Linux implementation where the legacy SMT protocol cannot be used with such memory since it is expected from device mapped memory whereas OP-TEE shared memory is cached and hence should not be accessed using memcpy_toio()/memcpy_fromio(). This change implements the MSG shared memory protocol introduced in Linux [1]. The protocol uses a simplified SMT header of 32bit named MSG_SMT to carry SCMI protocol information and uses side channel means to carry exchanged buffer size information, as TEE invocation API parameters when used in the SCMI OP-TEE transport. Link: [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f301bba0ca7392d16a6ea4f1d264a91f1fadea1a Signed-off-by: Etienne Carriere <[email protected]>
2021-11-23firmware: scmi: Add OP-TEE transportEtienne Carriere
This change implements an SCMI transport for agent interfacing the OP-TEE SCMI service. OP-TEE provides an SCMI PTA (Pseudo-TA) for non-secure world to send SCMI messages over an identified channel. The driver implemented here uses a SMT shared memory for passing messages between client and server. The implementation opens and releases channel resources for each passed SCMI message so that resources allocated (sessions) or registered (shared memory areas) in OP-TEE firmware are released for example before relocation as the driver will likely allocate/register them back when probed after relocation. The integration of the driver using dedicated config switch CONFIG_SCMI_AGENT_OPTEE is designed on the model posted to the U-Boot ML by Patrick Delaunay [1]. Link: [1] https://lore.kernel.org/all/20211028191222.v3.4.Ib2e58ee67f4d023823d8b5404332dc4d7e847277@changeid/ Cc: Patrick Delaunay <[email protected]> Cc: Wolfgang Denk <[email protected]> Signed-off-by: Etienne Carriere <[email protected]> Reviewed-by: Patrick Delaunay <[email protected]>