mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] ARM: i.MX: atf: pass scratch fdt if configured
@ 2026-03-16  8:58 Fabian Pflug
  2026-03-20  7:04 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Fabian Pflug @ 2026-03-16  8:58 UTC (permalink / raw)
  To: Marco Felsch, BAREBOX; +Cc: Fabian Pflug

If a scratch space is configured for fdt on i.MX devices, then there is
a space for OP-TEE to put its overlay fragments if configured with
CFG_GENERATE_DTB_OVERLAY. These fragements can then be applied to the
devicetree in barebox. There is no need to pass the fdt to OP-TEE, if
OP-TEE is already configured correctly for the specific device.

Signed-off-by: Fabian Pflug <f.pflug@pengutronix.de>
---
 arch/arm/mach-imx/atf.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-imx/atf.c b/arch/arm/mach-imx/atf.c
index 34893c3a04..745f10a0df 100644
--- a/arch/arm/mach-imx/atf.c
+++ b/arch/arm/mach-imx/atf.c
@@ -68,18 +68,19 @@ static __noreturn void start_bl31_via_bl_params(void *bl31, void *bl32,
 	int error;
 	u8 *buf;
 
-	if (!fdt)
-		bl31_via_bl_params(bl31, bl32, bl33, NULL);
-
 	buf = imx_scratch_get_fdt(&bufsz);
 	if (IS_ERR_OR_NULL(buf)) {
-		if (!buf)
+		if (!buf && fdt)
 			pr_debug("No FDT scratch mem configured, continue without FDT\n");
-		else
+		else if (fdt)
 			pr_warn("Failed to get FDT scratch mem, continue without FDT\n");
 		bl31_via_bl_params(bl31, bl32, bl33, NULL);
 	}
 
+	if (!fdt)
+		bl31_via_bl_params(bl31, bl32, bl33, buf);
+
+
 	error = pbl_load_fdt(fdt, buf, bufsz);
 	if (error) {
 		pr_warn("Failed to load FDT, continue without FDT\n");

---
base-commit: ab82fbd7dcc6c862c7cf281ad515097ffb654499
change-id: 20260316-v2026-03-0-topic-atf_scatch_fdt-3e3cfba4fbbb

Best regards,
-- 
Fabian Pflug <f.pflug@pengutronix.de>




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

end of thread, other threads:[~2026-03-20  7:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-03-16  8:58 [PATCH] ARM: i.MX: atf: pass scratch fdt if configured Fabian Pflug
2026-03-20  7:04 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox