mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>,
	Holger Assmann <h.assmann@pengutronix.de>,
	Fabian Pflug <f.pflug@pengutronix.de>
Subject: [PATCH] ARM: i.MX8M: atf: add debug messages just before TF-A jump
Date: Fri, 16 Jan 2026 14:49:46 +0100	[thread overview]
Message-ID: <20260116134948.3931720-1-a.fatoum@pengutronix.de> (raw)

The handoff to TF-A has been a frequent source of hangs during board
bringup in the past for various reasons.
Add a debug print just before branching to TF-A and add a comment
explaining some possible issues to aid with future debugging.

Cc: Holger Assmann <h.assmann@pengutronix.de>
Cc: Fabian Pflug <f.pflug@pengutronix.de>
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 arch/arm/mach-imx/atf.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/arch/arm/mach-imx/atf.c b/arch/arm/mach-imx/atf.c
index 5a8a7a7fd541..773ebfad0be3 100644
--- a/arch/arm/mach-imx/atf.c
+++ b/arch/arm/mach-imx/atf.c
@@ -53,8 +53,23 @@ static __noreturn void imx8m_tfa_start_bl31(const void *tfa_bin, size_t tfa_size
 			pr_debug("CAAM early init successful\n");
 	}
 
+	pr_debug("Loading BL31 to %p ", tfa_bin);
+
 	memcpy(bl31, tfa_bin, tfa_size);
 
+	/*
+	 * If all works fine (and TF-A has debug output enabled), the next
+	 * serial output should start with:
+	 *
+	 *   NOTICE:  BL31:
+	 *
+	 * If not, set IMX_BOOT_UART_BASE=auto when building TF-A if supported,
+	 * check if DRAM configuration is correct and that the PMIC correctly
+	 * configured the DRAM rails. For very old TF-A versions, also compare
+	 * barebox tfa_dest against whatever value your TF-A hardcodes.
+	 */
+	pr_debug("and jumping with SP: %p\n", tfa_dest - 16);
+
 	asm volatile("msr sp_el2, %0" : :
 		     "r" (tfa_dest - 16) :
 		     "cc");
-- 
2.47.3




             reply	other threads:[~2026-01-16 13:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-16 13:49 Ahmad Fatoum [this message]
2026-01-16 15:25 ` Marco Felsch
2026-01-19  7:44 ` 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=20260116134948.3931720-1-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=f.pflug@pengutronix.de \
    --cc=h.assmann@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