[U-Boot] [PATCH v6 0/3] Allow disabling non-FIT image loading from SPL

Hello all,
To address a needed feature brought up by Andreas[0], we need a way to disable SPL from loading non-FIT images.
The function spl_parse_image_header is common to all SPL loading paths (common/spl/spl_(nand|net|nor|etc..)) so we add the check here.
This version of the series is a bit different than the first few due to suggestions by Simon, instead of a negative option disabling non-FIT images, we allow the other image format's support to be toggled off, and do that on HS boards.
Thanks, Andrew
[0] https://www.mail-archive.com/u-boot@lists.denx.de/msg219253.html
Changes from v5: - Set the default to y only on non-HS boards
Changes from v4: - Finish conversion of SPL_RAW_IMAGE_SUPPORT
Changes from v3: - Add debug print as suggested by Simon
Andrew F. Davis (3): spl: Convert CONFIG_SPL_ABORT_ON_RAW_IMAGE into a positive option spl: Add option to enable SPL Legacy image support Kconfig: Disable non-FIT SPL loading for TI secure devices
Kconfig | 15 +++++++++++++++ README | 4 ---- common/spl/spl.c | 20 ++++++++++++++------ configs/apalis_imx6_defconfig | 1 + configs/cgtqmx6eval_defconfig | 1 + configs/cm_fx6_defconfig | 1 + configs/colibri_imx6_defconfig | 1 + configs/gwventana_defconfig | 1 + configs/imx6dl_icore_mmc_defconfig | 1 + configs/imx6dl_icore_rqs_mmc_defconfig | 1 + configs/imx6q_icore_mmc_defconfig | 1 + configs/imx6q_icore_rqs_mmc_defconfig | 1 + configs/imx6ul_geam_mmc_defconfig | 1 + configs/liteboard_defconfig | 1 + configs/mccmon6_sd_defconfig | 1 + configs/mx6cuboxi_defconfig | 1 + configs/mx6sabresd_spl_defconfig | 1 + configs/mx6slevk_spl_defconfig | 1 + configs/mx6sxsabresd_spl_defconfig | 1 + configs/mx6ul_14x14_evk_defconfig | 1 + configs/mx6ul_9x9_evk_defconfig | 1 + configs/novena_defconfig | 1 + configs/pcm058_defconfig | 1 + configs/platinum_picon_defconfig | 1 + configs/platinum_titanium_defconfig | 1 + configs/socfpga_de1_soc_defconfig | 1 + configs/udoo_defconfig | 1 + configs/udoo_neo_defconfig | 1 + configs/wandboard_defconfig | 1 + configs/xpress_spl_defconfig | 1 + configs/zc5202_defconfig | 1 + configs/zc5601_defconfig | 1 + include/configs/imx6_spl.h | 2 -- include/configs/socfpga_de1_soc.h | 2 -- include/spl.h | 2 +- 35 files changed, 59 insertions(+), 15 deletions(-)

CONFIG_SPL_ABORT_ON_RAW_IMAGE causes SPL to abort and move on when it encounters RAW images, express this same functionality as a positive option enabling support for RAW images: CONFIG_SPL_RAW_IMAGE_SUPPORT
Also move uses of this to defconfigs.
Signed-off-by: Andrew F. Davis afd@ti.com --- Kconfig | 7 +++++++ README | 4 ---- common/spl/spl.c | 10 ++++++---- configs/apalis_imx6_defconfig | 1 + configs/cgtqmx6eval_defconfig | 1 + configs/cm_fx6_defconfig | 1 + configs/colibri_imx6_defconfig | 1 + configs/gwventana_defconfig | 1 + configs/imx6dl_icore_mmc_defconfig | 1 + configs/imx6dl_icore_rqs_mmc_defconfig | 1 + configs/imx6q_icore_mmc_defconfig | 1 + configs/imx6q_icore_rqs_mmc_defconfig | 1 + configs/imx6ul_geam_mmc_defconfig | 1 + configs/liteboard_defconfig | 1 + configs/mccmon6_sd_defconfig | 1 + configs/mx6cuboxi_defconfig | 1 + configs/mx6sabresd_spl_defconfig | 1 + configs/mx6slevk_spl_defconfig | 1 + configs/mx6sxsabresd_spl_defconfig | 1 + configs/mx6ul_14x14_evk_defconfig | 1 + configs/mx6ul_9x9_evk_defconfig | 1 + configs/novena_defconfig | 1 + configs/pcm058_defconfig | 1 + configs/platinum_picon_defconfig | 1 + configs/platinum_titanium_defconfig | 1 + configs/socfpga_de1_soc_defconfig | 1 + configs/udoo_defconfig | 1 + configs/udoo_neo_defconfig | 1 + configs/wandboard_defconfig | 1 + configs/xpress_spl_defconfig | 1 + configs/zc5202_defconfig | 1 + configs/zc5601_defconfig | 1 + include/configs/imx6_spl.h | 2 -- include/configs/socfpga_de1_soc.h | 2 -- include/spl.h | 2 +- 35 files changed, 43 insertions(+), 13 deletions(-)
diff --git a/Kconfig b/Kconfig index 81b4226463..cfc8f929ee 100644 --- a/Kconfig +++ b/Kconfig @@ -291,6 +291,13 @@ config SYS_TEXT_BASE help TODO: Move CONFIG_SYS_TEXT_BASE for all the architecture
+config SPL_RAW_IMAGE_SUPPORT + bool "Support SPL loading and booting of RAW images" + default y + help + SPL will support loading and booting a RAW image when this option + is y. If this is not set, SPL will move on to other available + boot media to find a suitable image.
config SYS_CLK_FREQ depends on ARC || ARCH_SUNXI diff --git a/README b/README index 4f0dbd4fca..a45c6b88bf 100644 --- a/README +++ b/README @@ -3279,10 +3279,6 @@ FIT uImage format: consider that a completely unreadable NAND block is bad, and thus should be skipped silently.
- CONFIG_SPL_ABORT_ON_RAW_IMAGE - When defined, SPL will proceed to another boot method - if the image it has loaded does not have a signature. - CONFIG_SPL_RELOC_STACK Adress of the start of the stack SPL will use after relocation. If unspecified, this is equal to diff --git a/common/spl/spl.c b/common/spl/spl.c index 766fb3d6f4..da8f55eef6 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -146,16 +146,18 @@ int spl_parse_image_header(struct spl_image_info *spl_image, } #endif
-#ifdef CONFIG_SPL_ABORT_ON_RAW_IMAGE - /* Signature not found, proceed to other boot methods. */ - return -EINVAL; -#else +#ifdef CONFIG_SPL_RAW_IMAGE_SUPPORT /* Signature not found - assume u-boot.bin */ debug("mkimage signature not found - ih_magic = %x\n", header->ih_magic); spl_set_header_raw_uboot(spl_image); +#else + /* RAW image not supported, proceed to other boot methods. */ + debug("Raw boot image support not enabled, proceeding to other boot methods"); + return -EINVAL; #endif } + return 0; }
diff --git a/configs/apalis_imx6_defconfig b/configs/apalis_imx6_defconfig index 6b2daa9b47..d76b828c7d 100644 --- a/configs/apalis_imx6_defconfig +++ b/configs/apalis_imx6_defconfig @@ -9,6 +9,7 @@ CONFIG_SPL_MMC_SUPPORT=y CONFIG_SPL_SERIAL_SUPPORT=y CONFIG_VIDEO=y CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/imx-common/spl_sd.cfg,MX6Q" +# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set CONFIG_BOOTDELAY=1 # CONFIG_CONSOLE_MUX is not set # CONFIG_DISPLAY_BOARDINFO is not set diff --git a/configs/cgtqmx6eval_defconfig b/configs/cgtqmx6eval_defconfig index 2e4ed36cc1..7c73ac185a 100644 --- a/configs/cgtqmx6eval_defconfig +++ b/configs/cgtqmx6eval_defconfig @@ -14,6 +14,7 @@ CONFIG_SPL_SPI_SUPPORT=y CONFIG_SPL_WATCHDOG_SUPPORT=y CONFIG_VIDEO=y CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/imx-common/spl_sd.cfg,SPL,MX6QDL" +# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set CONFIG_BOOTDELAY=3 # CONFIG_CONSOLE_MUX is not set CONFIG_SYS_CONSOLE_IS_IN_ENV=y diff --git a/configs/cm_fx6_defconfig b/configs/cm_fx6_defconfig index dc7544a17f..01ba6a7029 100644 --- a/configs/cm_fx6_defconfig +++ b/configs/cm_fx6_defconfig @@ -13,6 +13,7 @@ CONFIG_SPL_WATCHDOG_SUPPORT=y CONFIG_VIDEO=y CONFIG_OF_BOARD_SETUP=y CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/imx-common/spl_sd.cfg,MX6QDL,SPL" +# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set CONFIG_BOOTDELAY=3 CONFIG_SPL=y CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x80 diff --git a/configs/colibri_imx6_defconfig b/configs/colibri_imx6_defconfig index ba06a55a26..4d12443f6c 100644 --- a/configs/colibri_imx6_defconfig +++ b/configs/colibri_imx6_defconfig @@ -9,6 +9,7 @@ CONFIG_SPL_MMC_SUPPORT=y CONFIG_SPL_SERIAL_SUPPORT=y CONFIG_VIDEO=y CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/imx-common/spl_sd.cfg,MX6DL" +# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set CONFIG_BOOTDELAY=1 # CONFIG_CONSOLE_MUX is not set # CONFIG_DISPLAY_BOARDINFO is not set diff --git a/configs/gwventana_defconfig b/configs/gwventana_defconfig index 6cc58970cd..ab115c15e0 100644 --- a/configs/gwventana_defconfig +++ b/configs/gwventana_defconfig @@ -16,6 +16,7 @@ CONFIG_FIT=y CONFIG_FIT_VERBOSE=y CONFIG_OF_BOARD_SETUP=y CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/imx-common/spl_sd.cfg,MX6QDL" +# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set CONFIG_BOOTDELAY=3 # CONFIG_SYS_STDIO_DEREGISTER is not set # CONFIG_DISPLAY_BOARDINFO is not set diff --git a/configs/imx6dl_icore_mmc_defconfig b/configs/imx6dl_icore_mmc_defconfig index a74ae8bb55..af6e239af2 100644 --- a/configs/imx6dl_icore_mmc_defconfig +++ b/configs/imx6dl_icore_mmc_defconfig @@ -14,6 +14,7 @@ CONFIG_FIT=y CONFIG_FIT_SIGNATURE=y CONFIG_FIT_VERBOSE=y CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/imx-common/spl_sd.cfg,ENV_IS_IN_MMC" +# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set CONFIG_BOOTDELAY=3 CONFIG_DEFAULT_FDT_FILE="imx6dl-icore.dtb" CONFIG_SPL=y diff --git a/configs/imx6dl_icore_rqs_mmc_defconfig b/configs/imx6dl_icore_rqs_mmc_defconfig index d9d4a0e155..4aa3cafcfe 100644 --- a/configs/imx6dl_icore_rqs_mmc_defconfig +++ b/configs/imx6dl_icore_rqs_mmc_defconfig @@ -13,6 +13,7 @@ CONFIG_FIT=y CONFIG_FIT_SIGNATURE=y CONFIG_FIT_VERBOSE=y CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/imx-common/spl_sd.cfg,ENV_IS_IN_MMC" +# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set CONFIG_BOOTDELAY=3 CONFIG_DEFAULT_FDT_FILE="imx6dl-icore-rqs.dtb" CONFIG_SPL=y diff --git a/configs/imx6q_icore_mmc_defconfig b/configs/imx6q_icore_mmc_defconfig index 9957e928ff..ac04c1bbdb 100644 --- a/configs/imx6q_icore_mmc_defconfig +++ b/configs/imx6q_icore_mmc_defconfig @@ -14,6 +14,7 @@ CONFIG_FIT=y CONFIG_FIT_SIGNATURE=y CONFIG_FIT_VERBOSE=y CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/imx-common/spl_sd.cfg,ENV_IS_IN_MMC" +# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set CONFIG_BOOTDELAY=3 CONFIG_DEFAULT_FDT_FILE="imx6q-icore.dtb" CONFIG_SPL=y diff --git a/configs/imx6q_icore_rqs_mmc_defconfig b/configs/imx6q_icore_rqs_mmc_defconfig index 480a2a3495..ce78a3d166 100644 --- a/configs/imx6q_icore_rqs_mmc_defconfig +++ b/configs/imx6q_icore_rqs_mmc_defconfig @@ -13,6 +13,7 @@ CONFIG_FIT=y CONFIG_FIT_SIGNATURE=y CONFIG_FIT_VERBOSE=y CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/imx-common/spl_sd.cfg,ENV_IS_IN_MMC" +# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set CONFIG_BOOTDELAY=3 CONFIG_DEFAULT_FDT_FILE="imx6q-icore-rqs.dtb" CONFIG_SPL=y diff --git a/configs/imx6ul_geam_mmc_defconfig b/configs/imx6ul_geam_mmc_defconfig index 1d224607f6..5032095676 100644 --- a/configs/imx6ul_geam_mmc_defconfig +++ b/configs/imx6ul_geam_mmc_defconfig @@ -13,6 +13,7 @@ CONFIG_FIT=y CONFIG_FIT_SIGNATURE=y CONFIG_FIT_VERBOSE=y CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/imx-common/spl_sd.cfg,ENV_IS_IN_MMC" +# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set CONFIG_BOOTDELAY=3 CONFIG_DEFAULT_FDT_FILE="imx6ul-geam-kit.dtb" CONFIG_SPL=y diff --git a/configs/liteboard_defconfig b/configs/liteboard_defconfig index f09647132d..89956a8716 100644 --- a/configs/liteboard_defconfig +++ b/configs/liteboard_defconfig @@ -8,6 +8,7 @@ CONFIG_SPL_MMC_SUPPORT=y CONFIG_SPL_SERIAL_SUPPORT=y CONFIG_SPL_WATCHDOG_SUPPORT=y CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/imx-common/spl_sd.cfg" +# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set CONFIG_BOOTDELAY=1 CONFIG_DEFAULT_FDT_FILE="imx6ul-liteboard.dtb" CONFIG_BOARD_EARLY_INIT_F=y diff --git a/configs/mccmon6_sd_defconfig b/configs/mccmon6_sd_defconfig index 23f0a31685..d3e154effa 100644 --- a/configs/mccmon6_sd_defconfig +++ b/configs/mccmon6_sd_defconfig @@ -7,6 +7,7 @@ CONFIG_SPL_MMC_SUPPORT=y CONFIG_SPL_SERIAL_SUPPORT=y CONFIG_SPL_ENV_SUPPORT=y CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/liebherr/mccmon6/mon6_imximage_sd.cfg,MX6QDL" +# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set CONFIG_SPL=y CONFIG_SPL_NOR_SUPPORT=y CONFIG_HUSH_PARSER=y diff --git a/configs/mx6cuboxi_defconfig b/configs/mx6cuboxi_defconfig index 0b37be9b79..5f8dc3a71a 100644 --- a/configs/mx6cuboxi_defconfig +++ b/configs/mx6cuboxi_defconfig @@ -13,6 +13,7 @@ CONFIG_SPL_WATCHDOG_SUPPORT=y CONFIG_VIDEO=y CONFIG_DISTRO_DEFAULTS=y CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/imx-common/spl_sd.cfg,MX6QDL" +# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set # CONFIG_SYS_STDIO_DEREGISTER is not set CONFIG_BOARD_EARLY_INIT_F=y CONFIG_SPL=y diff --git a/configs/mx6sabresd_spl_defconfig b/configs/mx6sabresd_spl_defconfig index a488979285..a732a0e624 100644 --- a/configs/mx6sabresd_spl_defconfig +++ b/configs/mx6sabresd_spl_defconfig @@ -12,6 +12,7 @@ CONFIG_SPL_SERIAL_SUPPORT=y CONFIG_SPL_WATCHDOG_SUPPORT=y CONFIG_VIDEO=y CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/imx-common/spl_sd.cfg,SPL,MX6Q" +# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set CONFIG_BOOTDELAY=3 # CONFIG_CONSOLE_MUX is not set CONFIG_SYS_CONSOLE_IS_IN_ENV=y diff --git a/configs/mx6slevk_spl_defconfig b/configs/mx6slevk_spl_defconfig index 29e179da7c..59902b6e99 100644 --- a/configs/mx6slevk_spl_defconfig +++ b/configs/mx6slevk_spl_defconfig @@ -11,6 +11,7 @@ CONFIG_SPL_MMC_SUPPORT=y CONFIG_SPL_SERIAL_SUPPORT=y CONFIG_SPL_WATCHDOG_SUPPORT=y CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/imx-common/spl_sd.cfg,SPL,MX6SL" +# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set CONFIG_BOOTDELAY=3 CONFIG_BOARD_EARLY_INIT_F=y CONFIG_SPL=y diff --git a/configs/mx6sxsabresd_spl_defconfig b/configs/mx6sxsabresd_spl_defconfig index f7cbc25cfd..a2238108de 100644 --- a/configs/mx6sxsabresd_spl_defconfig +++ b/configs/mx6sxsabresd_spl_defconfig @@ -12,6 +12,7 @@ CONFIG_SPL_SERIAL_SUPPORT=y CONFIG_SPL_WATCHDOG_SUPPORT=y CONFIG_VIDEO=y CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/imx-common/spl_sd.cfg" +# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set CONFIG_BOOTDELAY=3 # CONFIG_CONSOLE_MUX is not set CONFIG_SYS_CONSOLE_IS_IN_ENV=y diff --git a/configs/mx6ul_14x14_evk_defconfig b/configs/mx6ul_14x14_evk_defconfig index 9f972c4e52..55eb4a92b5 100644 --- a/configs/mx6ul_14x14_evk_defconfig +++ b/configs/mx6ul_14x14_evk_defconfig @@ -12,6 +12,7 @@ CONFIG_SPL_SERIAL_SUPPORT=y CONFIG_SPL_WATCHDOG_SUPPORT=y CONFIG_VIDEO=y CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/imx-common/spl_sd.cfg" +# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set CONFIG_BOOTDELAY=3 # CONFIG_CONSOLE_MUX is not set CONFIG_SYS_CONSOLE_IS_IN_ENV=y diff --git a/configs/mx6ul_9x9_evk_defconfig b/configs/mx6ul_9x9_evk_defconfig index 7663709db9..cb5ba39e1a 100644 --- a/configs/mx6ul_9x9_evk_defconfig +++ b/configs/mx6ul_9x9_evk_defconfig @@ -12,6 +12,7 @@ CONFIG_SPL_SERIAL_SUPPORT=y CONFIG_SPL_WATCHDOG_SUPPORT=y CONFIG_VIDEO=y CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/imx-common/spl_sd.cfg" +# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set CONFIG_BOOTDELAY=3 # CONFIG_CONSOLE_MUX is not set CONFIG_SYS_CONSOLE_IS_IN_ENV=y diff --git a/configs/novena_defconfig b/configs/novena_defconfig index 641928d811..f7a25b20c7 100644 --- a/configs/novena_defconfig +++ b/configs/novena_defconfig @@ -16,6 +16,7 @@ CONFIG_VIDEO=y CONFIG_DISTRO_DEFAULTS=y CONFIG_FIT=y CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/imx-common/spl_sd.cfg,MX6Q" +# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set CONFIG_VERSION_VARIABLE=y CONFIG_BOARD_EARLY_INIT_F=y CONFIG_SPL=y diff --git a/configs/pcm058_defconfig b/configs/pcm058_defconfig index b15e25e6cd..555624729e 100644 --- a/configs/pcm058_defconfig +++ b/configs/pcm058_defconfig @@ -15,6 +15,7 @@ CONFIG_SPL_WATCHDOG_SUPPORT=y CONFIG_SPL_YMODEM_SUPPORT=y CONFIG_FIT=y CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/imx-common/spl_sd.cfg,MX6Q" +# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set CONFIG_BOOTDELAY=3 CONFIG_BOARD_EARLY_INIT_F=y CONFIG_SPL=y diff --git a/configs/platinum_picon_defconfig b/configs/platinum_picon_defconfig index 186c489882..a7ab826b1e 100644 --- a/configs/platinum_picon_defconfig +++ b/configs/platinum_picon_defconfig @@ -12,6 +12,7 @@ CONFIG_SPL_NAND_SUPPORT=y CONFIG_SPL_SERIAL_SUPPORT=y CONFIG_SPL_WATCHDOG_SUPPORT=y CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/imx-common/spl_sd.cfg,MX6DL" +# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set CONFIG_BOOTDELAY=3 CONFIG_BOARD_EARLY_INIT_F=y CONFIG_SPL=y diff --git a/configs/platinum_titanium_defconfig b/configs/platinum_titanium_defconfig index d84e02ae68..93dfc07f47 100644 --- a/configs/platinum_titanium_defconfig +++ b/configs/platinum_titanium_defconfig @@ -12,6 +12,7 @@ CONFIG_SPL_NAND_SUPPORT=y CONFIG_SPL_SERIAL_SUPPORT=y CONFIG_SPL_WATCHDOG_SUPPORT=y CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/imx-common/spl_sd.cfg,MX6Q" +# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set CONFIG_BOOTDELAY=3 CONFIG_BOARD_EARLY_INIT_F=y CONFIG_SPL=y diff --git a/configs/socfpga_de1_soc_defconfig b/configs/socfpga_de1_soc_defconfig index 032deef497..154ba726dd 100644 --- a/configs/socfpga_de1_soc_defconfig +++ b/configs/socfpga_de1_soc_defconfig @@ -7,6 +7,7 @@ CONFIG_SPL_STACK_R_ADDR=0x00800000 CONFIG_SPL_YMODEM_SUPPORT=y CONFIG_DEFAULT_DEVICE_TREE="socfpga_cyclone5_de1_soc" CONFIG_FIT=y +# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set CONFIG_SYS_CONSOLE_IS_IN_ENV=y CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y CONFIG_SYS_CONSOLE_ENV_OVERWRITE=y diff --git a/configs/udoo_defconfig b/configs/udoo_defconfig index a74bd901bb..1cc76045cb 100644 --- a/configs/udoo_defconfig +++ b/configs/udoo_defconfig @@ -11,6 +11,7 @@ CONFIG_SPL_MMC_SUPPORT=y CONFIG_SPL_SERIAL_SUPPORT=y CONFIG_SPL_WATCHDOG_SUPPORT=y CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/imx-common/spl_sd.cfg,MX6QDL" +# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set CONFIG_BOOTDELAY=3 CONFIG_BOARD_EARLY_INIT_F=y CONFIG_SPL=y diff --git a/configs/udoo_neo_defconfig b/configs/udoo_neo_defconfig index f9b1337cb7..87edd68406 100644 --- a/configs/udoo_neo_defconfig +++ b/configs/udoo_neo_defconfig @@ -11,6 +11,7 @@ CONFIG_SPL_SERIAL_SUPPORT=y CONFIG_SPL_ENV_SUPPORT=y CONFIG_SPL_WATCHDOG_SUPPORT=y CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/imx-common/spl_sd.cfg" +# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set CONFIG_BOARD_EARLY_INIT_F=y CONFIG_SPL=y CONFIG_HUSH_PARSER=y diff --git a/configs/wandboard_defconfig b/configs/wandboard_defconfig index ccf8250d0a..46030ed65d 100644 --- a/configs/wandboard_defconfig +++ b/configs/wandboard_defconfig @@ -13,6 +13,7 @@ CONFIG_SPL_WATCHDOG_SUPPORT=y CONFIG_VIDEO=y CONFIG_DISTRO_DEFAULTS=y CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/imx-common/spl_sd.cfg,MX6QDL" +# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set # CONFIG_CONSOLE_MUX is not set CONFIG_SYS_CONSOLE_IS_IN_ENV=y CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y diff --git a/configs/xpress_spl_defconfig b/configs/xpress_spl_defconfig index be7c87a352..719896750e 100644 --- a/configs/xpress_spl_defconfig +++ b/configs/xpress_spl_defconfig @@ -11,6 +11,7 @@ CONFIG_SPL_MMC_SUPPORT=y CONFIG_SPL_SERIAL_SUPPORT=y CONFIG_SPL_WATCHDOG_SUPPORT=y CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/imx-common/spl_sd.cfg" +# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set CONFIG_BOOTDELAY=3 CONFIG_SYS_CONSOLE_INFO_QUIET=y CONFIG_BOARD_EARLY_INIT_F=y diff --git a/configs/zc5202_defconfig b/configs/zc5202_defconfig index c1da56cca3..d52aaec3fe 100644 --- a/configs/zc5202_defconfig +++ b/configs/zc5202_defconfig @@ -14,6 +14,7 @@ CONFIG_SPL_SPI_SUPPORT=y CONFIG_SPL_WATCHDOG_SUPPORT=y CONFIG_DISTRO_DEFAULTS=y CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/imx-common/spl_sd.cfg,MX6Q" +# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set CONFIG_BOOTDELAY=3 CONFIG_DEFAULT_FDT_FILE="imx6q-zc5202.dtb" CONFIG_BOARD_EARLY_INIT_F=y diff --git a/configs/zc5601_defconfig b/configs/zc5601_defconfig index d48fcf158c..120d790b05 100644 --- a/configs/zc5601_defconfig +++ b/configs/zc5601_defconfig @@ -14,6 +14,7 @@ CONFIG_SPL_SPI_SUPPORT=y CONFIG_SPL_WATCHDOG_SUPPORT=y CONFIG_DISTRO_DEFAULTS=y CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/imx-common/spl_sd.cfg,MX6Q" +# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set CONFIG_BOOTDELAY=3 CONFIG_DEFAULT_FDT_FILE="imx6q-zc5601.dtb" CONFIG_BOARD_EARLY_INIT_F=y diff --git a/include/configs/imx6_spl.h b/include/configs/imx6_spl.h index c5a035fccf..3a389ede4b 100644 --- a/include/configs/imx6_spl.h +++ b/include/configs/imx6_spl.h @@ -45,14 +45,12 @@ #if defined(CONFIG_SPL_MMC_SUPPORT) #define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION 1 #define CONFIG_SYS_MONITOR_LEN 409600 /* 400 KB */ -#define CONFIG_SPL_ABORT_ON_RAW_IMAGE #endif
/* SATA support */ #if defined(CONFIG_SPL_SATA_SUPPORT) #define CONFIG_SPL_SATA_BOOT_DEVICE 0 #define CONFIG_SYS_SATA_FAT_BOOT_PARTITION 1 -#define CONFIG_SPL_ABORT_ON_RAW_IMAGE #endif
/* Define the payload for FAT/EXT support */ diff --git a/include/configs/socfpga_de1_soc.h b/include/configs/socfpga_de1_soc.h index 2278357fc6..c6e8d81be6 100644 --- a/include/configs/socfpga_de1_soc.h +++ b/include/configs/socfpga_de1_soc.h @@ -50,6 +50,4 @@ /* The rest of the configuration is shared */ #include <configs/socfpga_common.h>
-#define CONFIG_SPL_ABORT_ON_RAW_IMAGE - #endif /* __CONFIG_TERASIC_DE1_SOC_H__ */ diff --git a/include/spl.h b/include/spl.h index bde44374ea..270798c988 100644 --- a/include/spl.h +++ b/include/spl.h @@ -85,7 +85,7 @@ void spl_set_header_raw_uboot(struct spl_image_info *spl_image); * This parses the legacy image header information at @header and sets up * @spl_image according to what is found. If no image header is found, then * a raw image or bootz is assumed. If CONFIG_SPL_PANIC_ON_RAW_IMAGE is - * enabled, then this causes a panic. If CONFIG_SPL_ABORT_ON_RAW_IMAGE is + * enabled, then this causes a panic. If CONFIG_SPL_RAW_IMAGE_SUPPORT is not * enabled then U-Boot gives up. Otherwise U-Boot sets up the image using * spl_set_header_raw_uboot(), or possibly the bootz header. *

On Thu, Feb 16, 2017 at 11:18:38AM -0600, Andrew F. Davis wrote:
CONFIG_SPL_ABORT_ON_RAW_IMAGE causes SPL to abort and move on when it encounters RAW images, express this same functionality as a positive option enabling support for RAW images: CONFIG_SPL_RAW_IMAGE_SUPPORT
Also move uses of this to defconfigs.
Signed-off-by: Andrew F. Davis afd@ti.com
Reviewed-by: Tom Rini trini@konsulko.com

On 16 February 2017 at 10:18, Andrew F. Davis afd@ti.com wrote:
CONFIG_SPL_ABORT_ON_RAW_IMAGE causes SPL to abort and move on when it encounters RAW images, express this same functionality as a positive option enabling support for RAW images: CONFIG_SPL_RAW_IMAGE_SUPPORT
Also move uses of this to defconfigs.
Signed-off-by: Andrew F. Davis afd@ti.com
Kconfig | 7 +++++++ README | 4 ---- common/spl/spl.c | 10 ++++++---- configs/apalis_imx6_defconfig | 1 + configs/cgtqmx6eval_defconfig | 1 +
Reviewed-by: Simon Glass sjg@chromium.org

On Thu, Feb 16, 2017 at 11:18:38AM -0600, Andrew F. Davis wrote:
CONFIG_SPL_ABORT_ON_RAW_IMAGE causes SPL to abort and move on when it encounters RAW images, express this same functionality as a positive option enabling support for RAW images: CONFIG_SPL_RAW_IMAGE_SUPPORT
Also move uses of this to defconfigs.
Signed-off-by: Andrew F. Davis afd@ti.com Reviewed-by: Tom Rini trini@konsulko.com Reviewed-by: Simon Glass sjg@chromium.org
With a minor tweak to the Kconfig logic so we get the imx6 case right by default, and moved to common/spl/Kconfig, applied to u-boot/master, thanks!

Add a Kconfig option that enables Legacy image support, this allows boards to explicitly disable this, for instance when needed for security reasons.
Signed-off-by: Andrew F. Davis afd@ti.com Reviewed-by: Simon Glass sjg@chromium.org --- Kconfig | 8 ++++++++ common/spl/spl.c | 10 ++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/Kconfig b/Kconfig index cfc8f929ee..8504199493 100644 --- a/Kconfig +++ b/Kconfig @@ -299,6 +299,14 @@ config SPL_RAW_IMAGE_SUPPORT is y. If this is not set, SPL will move on to other available boot media to find a suitable image.
+config SPL_LEGACY_IMAGE_SUPPORT + bool "Support SPL loading and booting of Legacy images" + default y + help + SPL will support loading and booting Legacy images when this option + is y. If this is not set, SPL will move on to other available + boot media to find a suitable image. + config SYS_CLK_FREQ depends on ARC || ARCH_SUNXI int "CPU clock frequency" diff --git a/common/spl/spl.c b/common/spl/spl.c index da8f55eef6..3d6c0ecba1 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -93,9 +93,10 @@ void spl_set_header_raw_uboot(struct spl_image_info *spl_image) int spl_parse_image_header(struct spl_image_info *spl_image, const struct image_header *header) { - u32 header_size = sizeof(struct image_header); - if (image_get_magic(header) == IH_MAGIC) { +#ifdef CONFIG_SPL_LEGACY_IMAGE_SUPPORT + u32 header_size = sizeof(struct image_header); + if (spl_image->flags & SPL_COPY_PAYLOAD_ONLY) { /* * On some system (e.g. powerpc), the load-address and @@ -118,6 +119,11 @@ int spl_parse_image_header(struct spl_image_info *spl_image, debug("spl: payload image: %.*s load addr: 0x%lx size: %d\n", (int)sizeof(spl_image->name), spl_image->name, spl_image->load_addr, spl_image->size); +#else + /* LEGACY image not supported */ + debug("Legacy boot image support not enabled, proceeding to other boot methods"); + return -EINVAL; +#endif } else { #ifdef CONFIG_SPL_PANIC_ON_RAW_IMAGE /*

On Thu, Feb 16, 2017 at 11:18:39AM -0600, Andrew F. Davis wrote:
Add a Kconfig option that enables Legacy image support, this allows boards to explicitly disable this, for instance when needed for security reasons.
Signed-off-by: Andrew F. Davis afd@ti.com Reviewed-by: Simon Glass sjg@chromium.org
Reviewed-by: Tom Rini trini@konsulko.com

On Thu, Feb 16, 2017 at 11:18:39AM -0600, Andrew F. Davis wrote:
Add a Kconfig option that enables Legacy image support, this allows boards to explicitly disable this, for instance when needed for security reasons.
Signed-off-by: Andrew F. Davis afd@ti.com Reviewed-by: Simon Glass sjg@chromium.org Reviewed-by: Tom Rini trini@konsulko.com
Applied to u-boot/master, thanks!

Non-FIT SPL image loading support should be disabled for TI secure devices as the image handlers for those image types do not follow our secure boot flow.
Signed-off-by: Andrew F. Davis afd@ti.com --- Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Kconfig b/Kconfig index 8504199493..e238b8076b 100644 --- a/Kconfig +++ b/Kconfig @@ -293,7 +293,7 @@ config SYS_TEXT_BASE
config SPL_RAW_IMAGE_SUPPORT bool "Support SPL loading and booting of RAW images" - default y + default y if !TI_SECURE_DEVICE help SPL will support loading and booting a RAW image when this option is y. If this is not set, SPL will move on to other available @@ -301,7 +301,7 @@ config SPL_RAW_IMAGE_SUPPORT
config SPL_LEGACY_IMAGE_SUPPORT bool "Support SPL loading and booting of Legacy images" - default y + default y if !TI_SECURE_DEVICE help SPL will support loading and booting Legacy images when this option is y. If this is not set, SPL will move on to other available

On Thu, Feb 16, 2017 at 11:18:40AM -0600, Andrew F. Davis wrote:
Non-FIT SPL image loading support should be disabled for TI secure devices as the image handlers for those image types do not follow our secure boot flow.
Signed-off-by: Andrew F. Davis afd@ti.com
Reviewed-by: Tom Rini trini@konsulko.com

On 16 February 2017 at 10:18, Andrew F. Davis afd@ti.com wrote:
Non-FIT SPL image loading support should be disabled for TI secure devices as the image handlers for those image types do not follow our secure boot flow.
Signed-off-by: Andrew F. Davis afd@ti.com
Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Reviewed-by: Simon Glass sjg@chromium.org

On Thu, Feb 16, 2017 at 11:18:40AM -0600, Andrew F. Davis wrote:
Non-FIT SPL image loading support should be disabled for TI secure devices as the image handlers for those image types do not follow our secure boot flow.
Signed-off-by: Andrew F. Davis afd@ti.com Reviewed-by: Tom Rini trini@konsulko.com Reviewed-by: Simon Glass sjg@chromium.org
Applied to u-boot/master, thanks!
participants (3)
-
Andrew F. Davis
-
Simon Glass
-
Tom Rini