mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] ARM: ARM32: Fix FIT image booting
@ 2025-07-01 10:16 Sascha Hauer
  2025-07-02 11:48 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Sascha Hauer @ 2025-07-01 10:16 UTC (permalink / raw)
  To: Barebox List

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@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




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

end of thread, other threads:[~2025-07-02 12:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-07-01 10:16 [PATCH] ARM: ARM32: Fix FIT image booting Sascha Hauer
2025-07-02 11:48 ` Sascha Hauer

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