diff mbox series

[v3,12/13] stm32mp1: spl: Copy optee nodes to target FDT for OP-TEE payloads

Message ID 20211008195655.46046-13-mr.nuke.me@gmail.com
State Deferred
Delegated to: Tom Rini
Headers show
Series stm32mp1: Support falcon mode with OP-TEE payloads | expand

Commit Message

Alex G. Oct. 8, 2021, 7:56 p.m. UTC
OP-TEE does not take a devicetree for its own use. However, it does
pass the devicetree to the normal world OS. In most cases that will
be some other devicetree-bearing platform, such as linux.

OP-TEE is capable of patching the devicetree and adding the required
"/firmware" and "/reserved-memory" nodes. Not all OP-TEE
configurations do so, and it would need to be explicitly enabled
(CFG_DT=y). There is a measurable boot time penalty to enabling this
feature, and sometimes it is preferrable to do it in SPL for this
exact reason.

As such, there are cases where it is required to copy the optee nodes
to he target's FDT. Do this as part of spl_board_prepare_for_optee().

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
---
 arch/arm/mach-stm32mp/spl.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/arch/arm/mach-stm32mp/spl.c b/arch/arm/mach-stm32mp/spl.c
index d9fdc5926c..94fbb45cf9 100644
--- a/arch/arm/mach-stm32mp/spl.c
+++ b/arch/arm/mach-stm32mp/spl.c
@@ -19,6 +19,7 @@ 
 #include <asm/arch/sys_proto.h>
 #include <mach/tzc.h>
 #include <linux/libfdt.h>
+#include <tee/optee.h>
 
 u32 spl_boot_device(void)
 {
@@ -182,6 +183,7 @@  void stm32_init_tzc_for_optee(void)
 void spl_board_prepare_for_optee(void *fdt)
 {
 	stm32_fdt_setup_mac_addr(fdt);
+	optee_copy_fdt_nodes(fdt);
 	stm32_init_tzc_for_optee();
 }