mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] ARM: bootm-fip: don't dereference a missing HW_CONFIG
@ 2026-11-25 17:28 Ahmad Fatoum
  0 siblings, 0 replies; only message in thread
From: Ahmad Fatoum @ 2026-11-25 17:28 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

A FIP without a HW_CONFIG entry has no loadable for it, but the jump to
BL33 dereferences its start address unconditionally. The STM32MP FIPs
always have one.

Let's pass 0 when there's none, as the verbose print above already
allows for.

Fixes: c33636a0f165 ("ARM: add support for chainloading barebox inside FIP images")
Signed-off-by: Ahmad Fatoum <a.fatoum@barebox.org>
---
 arch/arm/cpu/bootm-fip.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/arm/cpu/bootm-fip.c b/arch/arm/cpu/bootm-fip.c
index a4da4c538abe..beeae09f4066 100644
--- a/arch/arm/cpu/bootm-fip.c
+++ b/arch/arm/cpu/bootm-fip.c
@@ -194,6 +194,7 @@ static int do_bootm_fip(struct image_data *data)
 	struct fip_image_desc *loadables[IMAGE_COUNT] = {};
 	struct fip_image_desc *desc;
 	struct fip_state *fip;
+	phys_addr_t hw_config = 0;
 	int ret;
 
 	if (!data->os_file)
@@ -239,13 +240,16 @@ static int do_bootm_fip(struct image_data *data)
 		goto out;
 	}
 
+	if (loadables[IMAGE_HW_CONFIG])
+		hw_config = desc_get_res(loadables[IMAGE_HW_CONFIG])->start;
+
 	shutdown_barebox();
 
 	/* We don't actually expect NT FW to be a Linux image, but
 	 * we want to use the Linux boot calling convention
 	 */
 	jump_to_linux((void *)desc_get_res(loadables[IMAGE_BL33])->start,
-		      desc_get_res(loadables[IMAGE_HW_CONFIG])->start);
+		      hw_config);
 
 	ret = -EIO;
 out:
-- 
2.47.3




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-25 17:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-25 17:28 [PATCH] ARM: bootm-fip: don't dereference a missing HW_CONFIG Ahmad Fatoum

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