Skip to contentSkip to conversation

spl: spl-nor: return error if no valid image was loaded

PATCH In review Mario Kicherer 2 participants 2 messages Jan 30, 2023 – Jun 20, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 spl: spl-nor: return error if no valid image was loaded

If only FIT images are enabled and loading the FIT image fails, spl_nor_load_image() should return an error instead of zero.

Without this patch:

Quoted 1 line
Quoted 1 line

SPL: board_init_r()

spl_init
Trying to boot from NOR
Unsupported OS image.. Jumping nevertheless..
image entry point: 0x0

With patch:

Quoted 1 line
Quoted 1 line

SPL: board_init_r()

spl_init
Trying to boot from NOR
SPL: failed to boot from all boot devices (err=-6) .### ERROR ### Please RESET the board ###

---
 common/spl/spl_nor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
common/spl/spl_nor.c +1 -1
index ffb3566d89..e75127b275 100644
@@ -120,6 +120,6 @@ static int spl_nor_load_image(struct spl_image_info *spl_image,
 					   &hdr);
 	}
 
-	return 0;
+	return -EINVAL;
 }
 SPL_LOAD_IMAGE_METHOD("NOR", 0, BOOT_DEVICE_NOR, spl_nor_load_image);
Signature · 1 line
2.34.1
#1 lore raw
Quoted 5 lines · Mario Kicherer

If only FIT images are enabled and loading the FIT image fails, spl_nor_load_image() should return an error instead of zero.

Without this patch:

Quoted 7 lines
Quoted 1 line
Quoted 1 line

SPL: board_init_r()

spl_init
Trying to boot from NOR
Unsupported OS image.. Jumping nevertheless..
image entry point: 0x0

[...]

Applied to u-boot/next, thanks!

Signature · 1 line
Tom