U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [BUG] silent hangup when debugging lib/fdtdec.c
@ 2025-11-25 16:14 Alexander Feilke
  2025-11-25 16:35 ` Tom Rini
  0 siblings, 1 reply; 10+ messages in thread
From: Alexander Feilke @ 2025-11-25 16:14 UTC (permalink / raw)
  To: Simon Glass, Tom Rini; +Cc: u-boot, u-boot, Alexander Feilke

From: Alexander Feilke <alexander.feilke@ew.tq-group.com>

Description: U-Boot hangs silently during boot when enabling DEBUG in
lib/fdtdec.c

Not sure if its really a bug or rather a configuration issue on my side.

Minimal steps to reproduce: <see patch>

The hang is caused by `panic("FDT overlap");` later inside the if block.
(see `lib/fdtdec.c:1279` in `fdt_find_separate(void)`)

Additionally, no boot log can be seen because serial is initialized after
loading the devicetree in this boot stage (see `common/board_r.c:665` in
`initcall_run_r(void)`)

Tested on i.MX6 with configs for tqma6d_mba6 and other tq boards that aren't,
mainlined yet (tqma6ulx_mba6ul and tqma7d_mba7).

Any idea what to look for to fix this on our side?

Thanks in advance,
Alexander
---
 lib/fdtdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index c38738b48c7..0f2f7c948cd 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -1257,7 +1257,7 @@ static void *fdt_find_separate(void)
 	/* FDT is at end of image */
 	fdt_blob = (ulong *)_end;
 
-	if (_DEBUG && !fdtdec_prepare_fdt(fdt_blob)) {
+	if (1 && !fdtdec_prepare_fdt(fdt_blob)) {
 		int stack_ptr;
 		const void *top = fdt_blob + fdt_totalsize(fdt_blob);
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread
* Re: [BUG] silent hangup when debugging  lib/fdtdec.c
@ 2025-11-27 15:50 alexander.feilke
  2025-12-10  8:33 ` alexander.feilke
  2026-01-13  8:52 ` alexander.feilke
  0 siblings, 2 replies; 10+ messages in thread
From: alexander.feilke @ 2025-11-27 15:50 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: Tom Rini, Simon Glass, u-boot, u-boot

On Thursday, November 27, 2025 15:02 CET, Fabio Estevam <festevam@gmail.com> wrote:
> On Thu, Nov 27, 2025 at 9:33 AM alexander.feilke@ew.tq-group.com
> <alexander.feilke@ew.tq-group.com> wrote:
> 
> > I also have a mx7dsabresd but I cannot bring it to boot with a master build unfortunately.
> 
> Just tested booting the top-of-tree U-Boot on a mx7dsabresd and it boots:
> 

Thanks! When using 0ae3dc6809ff like you I can boot and reproduce the hangup issue on mx7dsabresd:

<debug_uart>
FDT 8787da38 gd 0091de20
top 87887538 sp 87800000
sys_init_sp_addr 0091ff10
gbl_data_size 000000f0
FDT overlap
resetting ...
System reset not supported on this platform
### ERROR ### Please RESET the board ###

This is the patch that enables debug uart and demonstrates the issue:

From 9ee6e3244f15c8a1d9cb86130186cc9f221721c6 Mon Sep 17 00:00:00 2001
From: Alexander Feilke <alexander.feilke@ew.tq-group.com>
Date: Thu, 27 Nov 2025 16:47:23 +0100

Signed-off-by: Alexander Feilke <alexander.feilke@ew.tq-group.com>
---
 board/freescale/mx7dsabresd/mx7dsabresd.c | 6 ++++++
 configs/mx7dsabresd_defconfig             | 5 +++++
 lib/fdtdec.c                              | 5 +++++
 3 files changed, 16 insertions(+)

diff --git a/board/freescale/mx7dsabresd/mx7dsabresd.c b/board/freescale/mx7dsabresd/mx7dsabresd.c
index bef4f901ff7..1fdd39d437c 100644
--- a/board/freescale/mx7dsabresd/mx7dsabresd.c
+++ b/board/freescale/mx7dsabresd/mx7dsabresd.c
@@ -25,6 +25,7 @@
 #include <i2c.h>
 #include <asm/mach-imx/mxc_i2c.h>
 #include <asm/arch/crm_regs.h>
+#include <linux/delay.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -233,6 +234,11 @@ int board_early_init_f(void)
 	return 0;
 }
 
+void board_debug_uart_init(void)
+{
+	setup_iomux_uart();
+}
+
 int board_init(void)
 {
 	/* address of boot parameters */
diff --git a/configs/mx7dsabresd_defconfig b/configs/mx7dsabresd_defconfig
index a5a562af0c0..9f0631fe868 100644
--- a/configs/mx7dsabresd_defconfig
+++ b/configs/mx7dsabresd_defconfig
@@ -10,6 +10,11 @@ CONFIG_TARGET_MX7DSABRESD=y
 # CONFIG_ARMV7_VIRT is not set
 CONFIG_IMX_RDC=y
 CONFIG_IMX_BOOTAUX=y
+CONFIG_DEBUG_UART_BASE=0x30860000
+CONFIG_DEBUG_UART_CLOCK=24000000
+CONFIG_DEBUG_UART=y
+CONFIG_DEBUG_UART_ANNOUNCE=y
+CONFIG_DEBUG_UART_BOARD_INIT=y
 CONFIG_IMX_HAB=y
 CONFIG_SYS_MEMTEST_START=0x80000000
 CONFIG_SYS_MEMTEST_END=0xa0000000
diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index c38738b48c7..dff471228d6 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -9,6 +9,7 @@
 #ifndef USE_HOSTCC
 
 #define LOG_CATEGORY	LOGC_DT
+#define DEBUG
 
 #include <bloblist.h>
 #include <boot_fit.h>
@@ -35,6 +36,7 @@
 #include <linux/ctype.h>
 #include <linux/lzo.h>
 #include <linux/ioport.h>
+#include <system-constants.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -1276,6 +1278,9 @@ static void *fdt_find_separate(void)
 		 */
 		if (top > (void *)gd || top > (void *)&stack_ptr) {
 			printf("FDT %p gd %p\n", fdt_blob, gd);
+			printf("top %p sp %p\n", top, stack_ptr);
+			printf("sys_init_sp_addr %p\n", SYS_INIT_SP_ADDR);
+			printf("gbl_data_size %p\n", GENERATED_GBL_DATA_SIZE);
 			panic("FDT overlap");
 		}
 	}
-- 
2.34.1


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

end of thread, other threads:[~2026-01-15 18:50 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-25 16:14 [BUG] silent hangup when debugging lib/fdtdec.c Alexander Feilke
2025-11-25 16:35 ` Tom Rini
2025-11-26 10:41   ` alexander.feilke
2025-11-26 14:56     ` Tom Rini
2025-11-27 12:32       ` alexander.feilke
2025-11-27 14:02         ` Fabio Estevam
  -- strict thread matches above, loose matches on Subject: below --
2025-11-27 15:50 alexander.feilke
2025-12-10  8:33 ` alexander.feilke
2026-01-13  8:52 ` alexander.feilke
2026-01-15 18:50   ` Tom Rini

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