diff options
-rw-r--r-- | Kconfig | 18 | ||||
-rw-r--r-- | common/spl/spl_mmc.c | 9 |
2 files changed, 18 insertions, 9 deletions
@@ -284,6 +284,15 @@ config SPL_LOAD_FIT particular it can handle selecting from multiple device tree and passing the correct one to U-Boot. +config SPL_LOAD_FIT_ONLY + bool "Force SPL to on load images with FIT header" + depends on SPL_LOAD_FIT + help + Normally SPL falls back to assuming that loaded images are raw + U-Boot binaries, when no FIT header is present. This will cause + a crash when probing boot devices and touching one that does not + contain a valid image. + config SPL_FIT_IMAGE_POST_PROCESS bool "Enable post-processing of FIT artifacts after loading by the SPL" depends on SPL_LOAD_FIT && TI_SECURE_DEVICE @@ -298,15 +307,6 @@ config SPL_FIT_IMAGE_POST_PROCESS injected into the FIT creation (i.e. the blobs would have been pre- processed before being added to the FIT image). -config SPL_LOAD_FIT_ONLY - bool "Force SPL to on load images with FIT header" - depends on SPL_LOAD_FIT - help - Normally SPL falls back to assuming that loaded images are raw - U-Boot binaries, when no FIT header is present. This will cause - a crash when probing boot devices and touching one that does not - contain a valid image. - config SYS_CLK_FREQ depends on ARC || ARCH_SUNXI int "CPU clock frequency" diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c index 04b7540226..d7f0648d92 100644 --- a/common/spl/spl_mmc.c +++ b/common/spl/spl_mmc.c @@ -78,7 +78,16 @@ static int mmc_load_image_raw_sector(struct mmc *mmc, unsigned long sector) load.read = h_spl_load_read; ret = spl_load_simple_fit(&load, sector, header); } else { +#if !defined(CONFIG_SPL_LOAD_FIT_ONLY) ret = mmc_load_legacy(mmc, sector, header); +#else + /* legacy (raw binary) images must be disallowed when + * SPL_LOAD_FIT_ONLY is configured to support the + * probing of multiple boot-devices (where some might + * contain 'random' data and cause a crash). + */ + ret = -1; +#endif } end: |