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 <[email protected]>
Cc: Fabian Pflug <[email protected]>
Signed-off-by: Ahmad Fatoum <[email protected]>
---
 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 via email to