]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
spl: spl-nor: return error if no valid image was loaded
authorMario Kicherer <dev@kicherer.org>
Mon, 30 Jan 2023 09:21:43 +0000 (10:21 +0100)
committerTom Rini <trini@konsulko.com>
Tue, 20 Jun 2023 17:02:34 +0000 (13:02 -0400)
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:

>>SPL: board_init_r()
spl_init
Trying to boot from NOR
Unsupported OS image.. Jumping nevertheless..
image entry point: 0x0

With patch:

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

Signed-off-by: Mario Kicherer <dev@kicherer.org>
common/spl/spl_nor.c

index 1ef5e4126242353851ca0ef1db295acbc095dd76..5b65b96a77dbc8e13ff764aa74de1e86a180012c 100644 (file)
@@ -121,6 +121,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);