mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Fabian Pflug <f.pflug@pengutronix.de>
To: Marco Felsch <mfe@pengutronix.de>,
	 BAREBOX <barebox@lists.infradead.org>
Cc: Fabian Pflug <f.pflug@pengutronix.de>
Subject: [PATCH] ARM: i.MX: atf: pass scratch fdt if configured
Date: Mon, 16 Mar 2026 09:58:03 +0100	[thread overview]
Message-ID: <20260316-v2026-03-0-topic-atf_scatch_fdt-v1-1-33cde8738bc4@pengutronix.de> (raw)

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>




             reply	other threads:[~2026-03-16  8:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-16  8:58 Fabian Pflug [this message]
2026-03-20  7:04 ` Sascha Hauer

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=20260316-v2026-03-0-topic-atf_scatch_fdt-v1-1-33cde8738bc4@pengutronix.de \
    --to=f.pflug@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=mfe@pengutronix.de \
    /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