From: Marco Felsch <m.felsch@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH] ARM: atf: document BL32 FDT argument
Date: Fri, 24 Oct 2025 18:41:27 +0200 [thread overview]
Message-ID: <20251024164133.1937633-1-m.felsch@pengutronix.de> (raw)
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
reply other threads:[~2025-10-24 16:42 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251024164133.1937633-1-m.felsch@pengutronix.de \
--to=m.felsch@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox