[Concept,18/24] arm: bootm: Fix a confusing message about ATAGs

Message ID 20250922180116.3088502-19-sjg@u-boot.org
State New
Headers
Series boot: efi: Various improvements to booting with the EFI app |

Commit Message

Simon Glass Sept. 22, 2025, 6:01 p.m. UTC
  From: Simon Glass <sjg@chromium.org>

When an FDT is not provided, U-Boot currently says:

   FDT and ATAGS support not compiled in

even if CONFIG_OF_LIBFDT and CONFIG_LMB are enabled. This can send
people on a wild goose chase. Add a separate message for a devicetree
not being present.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 arch/arm/lib/bootm.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
  

Patch

diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
index 7c650c3ab67..111c2132c6e 100644
--- a/arch/arm/lib/bootm.c
+++ b/arch/arm/lib/bootm.c
@@ -167,8 +167,9 @@  __weak void board_prep_linux(struct bootm_headers *images) { }
 static int boot_prep_linux(struct bootm_headers *images)
 {
 	char *commandline = env_get("bootargs");
+	bool use_fdt = CONFIG_IS_ENABLED(OF_LIBFDT) && IS_ENABLED(CONFIG_LMB);
 
-	if (CONFIG_IS_ENABLED(OF_LIBFDT) && IS_ENABLED(CONFIG_LMB) && images->ft_len) {
+	if (use_fdt && images->ft_len) {
 		debug("using: FDT\n");
 		if (image_setup_linux(images)) {
 			log_err("FDT creation failed!");
@@ -203,6 +204,9 @@  static int boot_prep_linux(struct bootm_headers *images)
 		}
 		setup_board_tags(&params);
 		setup_end_tag(gd->bd);
+	} else if (use_fdt && !images->ft_len) {
+		log_err("No FDT provided\n");
+		return -ENOENT;
 	} else {
 		panic("FDT and ATAGS support not compiled in\n");
 	}