* [PATCH] ARM: atf: document BL32 FDT argument
@ 2025-10-24 16:41 Marco Felsch
0 siblings, 0 replies; only message in thread
From: Marco Felsch @ 2025-10-24 16:41 UTC (permalink / raw)
To: barebox
Document the BL32 arg3 FDT passing to avoid confusions since OP-TEE
expects the FDT via arg2 and not arg3. That the TF-A is shifting the
arguments is not very obvious.
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
---
arch/arm/cpu/atf.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/arch/arm/cpu/atf.c b/arch/arm/cpu/atf.c
index d01e20508c7a..7abe43a2703e 100644
--- a/arch/arm/cpu/atf.c
+++ b/arch/arm/cpu/atf.c
@@ -158,6 +158,14 @@ struct bl2_to_bl31_params_mem_v2 *bl2_plat_get_bl31_params_v2(uintptr_t bl32_ent
p.bl33_ep_info.args.arg0 = 0xffff & read_mpidr();
p.bl33_ep_info.pc = bl33_entry;
+ /*
+ * The FDT address is passed via arg3 to the BL32. The BL31 which is in
+ * charge to start the BL32, adapts this information and passes the FDT
+ * via arg2 to the BL32 in case of OP-TEE since OP-TEE expects the FDT
+ * within arg2. The reason for this behaviour is the TF-A legacy code
+ * path which uses arg0 to specify the SPSR (AARCH32, AARCH64) state.
+ * Therefore all OP-TEE call arguments are shifted by one.
+ */
p.bl32_ep_info.args.arg3 = fdt_addr;
p.bl32_ep_info.pc = bl32_entry;
--
2.47.3
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-10-24 16:42 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-10-24 16:41 [PATCH] ARM: atf: document BL32 FDT argument Marco Felsch
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox