[PATCH] ARM: ARM32: Fix FIT image booting

Sascha Hauer s.hauer at pengutronix.de
Tue Jul 1 03:16:41 PDT 2025


Commit 8f71bf6146acc3 ("bootm: create generic FIT image handler")
introduced a generic FIT image handler. With this ARM32 FIT images can
no longer be booted. The ARM32 FIT image handler used to call
do_bootm_linux(), but with the generic FIT image handler we select the
boot handler based on the filetype of the Kernel image which is a zImage
and consequently we call do_bootz_linux(). do_bootz_linux() operates on
data->os_file which points to the original FIT image, so booting fails
with:

invalid magic 0x28341b01

As a workaround check if we are booting a FIT image in do_bootz_linux()
and call do_bootm_linux() in that case.

Fixes: 8f71bf6146ac ("bootm: create generic FIT image handler")
Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 arch/arm/lib32/bootm.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/lib32/bootm.c b/arch/arm/lib32/bootm.c
index 5849b55cc3..69ca6d31d6 100644
--- a/arch/arm/lib32/bootm.c
+++ b/arch/arm/lib32/bootm.c
@@ -462,6 +462,9 @@ static int do_bootz_linux(struct image_data *data)
 	unsigned long mem_free;
 	void *fdt = NULL;
 
+	if (data->os_fit)
+		return do_bootm_linux(data);
+
 	fd = open(data->os_file, O_RDONLY);
 	if (fd < 0) {
 		perror("open");
-- 
2.39.5




More information about the barebox mailing list