linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v20 0/6] Introduction of a remoteproc tee to load signed firmware
@ 2025-12-17 15:39 Arnaud Pouliquen
  2025-12-17 15:39 ` [PATCH v20 1/6] dt-bindings: firmware: Add TEE remoteproc service binding Arnaud Pouliquen
                   ` (5 more replies)
  0 siblings, 6 replies; 14+ messages in thread
From: Arnaud Pouliquen @ 2025-12-17 15:39 UTC (permalink / raw)
  To: Bjorn Andersson, Mathieu Poirier, Jens Wiklander, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Sumit Garg
  Cc: linux-stm32, linux-arm-kernel, linux-remoteproc, linux-kernel,
	op-tee, devicetree, Arnaud Pouliquen

Main updates from version V19[3]:
--------------------------------
The devicetree is now structured as follows:

	firmware {
		optee {
			compatible = "linaro,optee-tz";
			method = "smc";
			#address-cells = <1>;
			#size-cells = <0>;
			rproc-service@0 {
				compatible = "rproc-service-80a4c275-0a47-4905-8285-1486a9771a08";
				reg = <0>;
				#address-cells = <1>;
				#size-cells = <0>;
				status = "okay";
				m4: m4@0 {
					compatible = "st,stm32mp15-m4-tee";
					reg = <0>;
					mboxes = <&ipcc 0>, <&ipcc 1>, <&ipcc 2>;
					mbox-names = "vq0", "vq1", "shutdown";
					memory-region = <&vdev0vring0>,	<&m_ipc_shm>, <&mcuram2>,
							<&vdev0vring1>, <&vdev0buffer>, <&retram>;
					interrupt-parent = <&exti>;
					interrupts = <68 1>;
					status = "okay";
				};
			};
		};
	};

As a consequence, this version:

- Introduces a new stm32_rproc_tee.c remoteproc driver.

  Instead of further complicating the existing stm32_rproc.c driver, a
  dedicated TEE-based driver is added. Both drivers are intended to also
  support the STM32MP2x Cortex-M33 remote processor in a next step.

- Reworks the bindings:
  - Drop the st,stm32-rproc.yaml updates that were introduced in previous
    revisions.
  - Add remoteproc-tee.yaml for the
    "rproc-service-80a4c275-0a47-4905-8285-1486a9771a08" compatible.
  - Add st,stm32-rproc-tee.yaml for the "st,stm32mp15-m4-tee" compatible.

- Reworks the probing sequence:

  The m4@0 device is now probed by the remoteproc-tee driver, which itself
  is instantiated by the TEE (OP-TEE) bus.


Main updates from version V18[2]:
--------------------------------
- rework documentation for the release_fw ops 
- rework function documentation in remoteproc_tee.c
- replace spinlock by mutex and generalize usage in remoteproc_tee.c


Main updates from version V17[1]:
--------------------------------
- Fix:  warning: EXPORT_SYMBOL() is used, but #include <linux/export.h>
  is missing


More details are available in each patch commit message.

[1] https://lore.kernel.org/linux-remoteproc/20250613091650.2337411-1-arnaud.pouliquen@foss.st.com/
[2] https://lore.kernel.org/linux-remoteproc/20250616075530.4106090-1-arnaud.pouliquen@foss.st.com/
[3] https://lore.kernel.org/linux-devicetree/20250625094028.758016-1-arnaud.pouliquen@foss.st.com/


Tested-on:
---------
commit 7d0a66e4bb90 ("Linux 6.18")

Description of the feature:
--------------------------
This series proposes the implementation of a remoteproc tee driver to
communicate with a TEE trusted application responsible for authenticating
and loading the remoteproc firmware image in an Arm secure context.

1) Principle:

The remoteproc tee driver provides services to communicate with the OP-TEE
trusted application running on the Trusted Execution Context (TEE).
The trusted application in TEE manages the remote processor lifecycle:

- authenticating and loading firmware images,
- isolating and securing the remote processor memories,
- supporting multi-firmware (e.g., TF-M + Zephyr on a Cortex-M33),
- managing the start and stop of the firmware by the TEE.

2) Format of the signed image:

Refer to:
https://github.com/OP-TEE/optee_os/blob/master/ta/remoteproc/src/remoteproc_core.c#L18-L57

3) OP-TEE trusted application API:

Refer to:
https://github.com/OP-TEE/optee_os/blob/master/ta/remoteproc/include/ta_remoteproc.h

4) OP-TEE signature script

Refer to:
https://github.com/OP-TEE/optee_os/blob/master/scripts/sign_rproc_fw.py

Example of usage:
sign_rproc_fw.py --in <fw1.elf> --in <fw2.elf> --out <signed_fw.sign> --key ${OP-TEE_PATH}/keys/default.pem


5) Impact on User space Application

No sysfs impact. The user only needs to provide the signed firmware image
instead of the ELF image.


For more information about the implementation, a presentation is available here
(note that the format of the signed image has evolved between the presentation
and the integration in OP-TEE).

https://resources.linaro.org/en/resource/6c5bGvZwUAjX56fvxthxds

Arnaud Pouliquen (6):
  dt-bindings: firmware: Add TEE remoteproc service binding
  dt-bindings: remoteproc: Add STM32 TEE-controlled rproc binding
  remoteproc: core: Introduce rproc_pa_to_va helper
  remoteproc: Introduce optional release_fw operation
  remoteproc: Add TEE support
  remoteproc: stm32: Add TEE-controlled STM32 driver

 .../arm/firmware/linaro,optee-tz.yaml         |   6 +
 .../bindings/remoteproc/remoteproc-tee.yaml   |  47 ++
 .../remoteproc/st,stm32-rproc-tee.yaml        | 100 +++
 drivers/remoteproc/Kconfig                    |  10 +
 drivers/remoteproc/Makefile                   |   3 +-
 drivers/remoteproc/remoteproc_core.c          |  52 ++
 drivers/remoteproc/remoteproc_internal.h      |   6 +
 drivers/remoteproc/remoteproc_tee.c           | 771 ++++++++++++++++++
 drivers/remoteproc/stm32_rproc_tee.c          | 526 ++++++++++++
 include/linux/remoteproc.h                    |   6 +
 include/linux/remoteproc_tee.h                |  89 ++
 11 files changed, 1615 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/remoteproc/remoteproc-tee.yaml
 create mode 100644 Documentation/devicetree/bindings/remoteproc/st,stm32-rproc-tee.yaml
 create mode 100644 drivers/remoteproc/remoteproc_tee.c
 create mode 100644 drivers/remoteproc/stm32_rproc_tee.c
 create mode 100644 include/linux/remoteproc_tee.h


base-commit: 7d0a66e4bb9081d75c82ec4957c50034cb0ea449
-- 
2.43.0



^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2026-01-05  8:34 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-17 15:39 [PATCH v20 0/6] Introduction of a remoteproc tee to load signed firmware Arnaud Pouliquen
2025-12-17 15:39 ` [PATCH v20 1/6] dt-bindings: firmware: Add TEE remoteproc service binding Arnaud Pouliquen
2025-12-29  5:39   ` Sumit Garg
2025-12-29 23:25   ` Rob Herring
2025-12-30 11:10     ` Sumit Garg
2026-01-02 22:17       ` Rob Herring
2026-01-05  7:37         ` Sumit Garg
2025-12-17 15:39 ` [PATCH v20 2/6] dt-bindings: remoteproc: Add STM32 TEE-controlled rproc binding Arnaud Pouliquen
2025-12-17 15:39 ` [PATCH v20 3/6] remoteproc: core: Introduce rproc_pa_to_va helper Arnaud Pouliquen
2025-12-17 15:39 ` [PATCH v20 4/6] remoteproc: Introduce optional release_fw operation Arnaud Pouliquen
2025-12-17 15:39 ` [PATCH v20 5/6] remoteproc: Add TEE support Arnaud Pouliquen
2025-12-29  5:50   ` Sumit Garg
2026-01-05  8:33     ` Arnaud POULIQUEN
2025-12-17 15:39 ` [PATCH v20 6/6] remoteproc: stm32: Add TEE-controlled STM32 driver Arnaud Pouliquen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).