From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH] ARM: ARM32: Fix FIT image booting
Date: Tue, 1 Jul 2025 12:16:41 +0200 [thread overview]
Message-ID: <20250701101641.549515-1-s.hauer@pengutronix.de> (raw)
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
next reply other threads:[~2025-07-01 10:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-01 10:16 Sascha Hauer [this message]
2025-07-02 11:48 ` Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250701101641.549515-1-s.hauer@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox