[PATCH] ARM: i.MX: atf: pass scratch fdt if configured

Fabian Pflug f.pflug at pengutronix.de
Mon Mar 16 01:58:03 PDT 2026


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 at 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 at pengutronix.de>




More information about the barebox mailing list