Skip to contentSkip to conversation

Allow disabling non-FIT image loading from SPL

PATCH Superseded Andrew F. Davis 2 participants 13 messages Feb 15, 2017 – Feb 16, 2017 Arm i.MX and Layerscape

v5 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

v5 cover 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 last 2 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 at lists.denx.de/msg219253.html

Changes from v4:
- Finish conversion of SPL_RAW_IMAGE_SUPPORT

Changes from v3:
- Add debug print as suggested by Simon

Andrew F. Davis (6):
spl: Convert CONFIG_SPL_ABORT_ON_RAW_IMAGE into a positive option
spl: Add option to enable SPL Legacy image support
ARM: AM335x: Disable non-FIT based image loading for HS devices
ARM: AM43xx: Disable non-FIT based image loading for HS devices
ARM: AM57xx: Disable non-FIT based image loading for HS devices
ARM: DRA7xx: Disable non-FIT based image loading for HS devices

 Kconfig                                | 15 +++++++++++++++
 README                                 |  4 ----
 common/spl/spl.c                       | 20 ++++++++++++++------
 configs/am335x_hs_evm_defconfig        |  2 ++
 configs/am43xx_hs_evm_defconfig        |  2 ++
 configs/am57xx_hs_evm_defconfig        |  2 ++
 configs/apalis_imx6_defconfig          |  1 +
 configs/cgtqmx6eval_defconfig          |  1 +
 configs/cm_fx6_defconfig               |  1 +
 configs/colibri_imx6_defconfig         |  1 +
 configs/dra7xx_hs_evm_defconfig        |  2 ++
 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 +-
 39 files changed, 67 insertions(+), 15 deletions(-)
Signature · 1 line
2.11.0
#1 lore raw

PATCH v5 1/6 spl: Convert CONFIG_SPL_ABORT_ON_RAW_IMAGE into a positive option

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.

---
 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(-)
Kconfig +7 -0
index 81b4226463..cfc8f929ee 100644
@@ -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
README +0 -4
index 4f0dbd4fca..a45c6b88bf 100644
@@ -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
common/spl/spl.c +6 -4
index 766fb3d6f4..da8f55eef6 100644
@@ -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;
 }
 
configs/apalis_imx6_defconfig +1 -0
index 6b2daa9b47..d76b828c7d 100644
@@ -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
configs/cgtqmx6eval_defconfig +1 -0
index 2e4ed36cc1..7c73ac185a 100644
@@ -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
configs/cm_fx6_defconfig +1 -0
index dc7544a17f..01ba6a7029 100644
@@ -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
configs/colibri_imx6_defconfig +1 -0
index ba06a55a26..4d12443f6c 100644
@@ -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
configs/gwventana_defconfig +1 -0
index 6cc58970cd..ab115c15e0 100644
@@ -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
configs/imx6dl_icore_mmc_defconfig +1 -0
index a74ae8bb55..af6e239af2 100644
@@ -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
configs/imx6dl_icore_rqs_mmc_defconfig +1 -0
index d9d4a0e155..4aa3cafcfe 100644
@@ -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
configs/imx6q_icore_mmc_defconfig +1 -0
index 9957e928ff..ac04c1bbdb 100644
@@ -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
configs/imx6q_icore_rqs_mmc_defconfig +1 -0
index 480a2a3495..ce78a3d166 100644
@@ -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
configs/imx6ul_geam_mmc_defconfig +1 -0
index 1d224607f6..5032095676 100644
@@ -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
configs/liteboard_defconfig +1 -0
index f09647132d..89956a8716 100644
@@ -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
configs/mccmon6_sd_defconfig +1 -0
index 23f0a31685..d3e154effa 100644
@@ -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
configs/mx6cuboxi_defconfig +1 -0
index 0b37be9b79..5f8dc3a71a 100644
@@ -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
configs/mx6sabresd_spl_defconfig +1 -0
index a488979285..a732a0e624 100644
@@ -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
configs/mx6slevk_spl_defconfig +1 -0
index 29e179da7c..59902b6e99 100644
@@ -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
configs/mx6sxsabresd_spl_defconfig +1 -0
index f7cbc25cfd..a2238108de 100644
@@ -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
configs/mx6ul_14x14_evk_defconfig +1 -0
index 9f972c4e52..55eb4a92b5 100644
@@ -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
configs/mx6ul_9x9_evk_defconfig +1 -0
index 7663709db9..cb5ba39e1a 100644
@@ -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
configs/novena_defconfig +1 -0
index 641928d811..f7a25b20c7 100644
@@ -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
configs/pcm058_defconfig +1 -0
index b15e25e6cd..555624729e 100644
@@ -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
configs/platinum_picon_defconfig +1 -0
index 186c489882..a7ab826b1e 100644
@@ -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
configs/platinum_titanium_defconfig +1 -0
index d84e02ae68..93dfc07f47 100644
@@ -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
configs/socfpga_de1_soc_defconfig +1 -0
index 032deef497..154ba726dd 100644
@@ -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
configs/udoo_defconfig +1 -0
index a74bd901bb..1cc76045cb 100644
@@ -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
configs/udoo_neo_defconfig +1 -0
index f9b1337cb7..87edd68406 100644
@@ -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
configs/wandboard_defconfig +1 -0
index ccf8250d0a..46030ed65d 100644
@@ -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
configs/xpress_spl_defconfig +1 -0
index be7c87a352..719896750e 100644
@@ -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
configs/zc5202_defconfig +1 -0
index c1da56cca3..d52aaec3fe 100644
@@ -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
configs/zc5601_defconfig +1 -0
index d48fcf158c..120d790b05 100644
@@ -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
include/configs/imx6_spl.h +0 -2
index c5a035fccf..3a389ede4b 100644
@@ -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 */
include/configs/socfpga_de1_soc.h +0 -2
index 2278357fc6..c6e8d81be6 100644
@@ -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__ */
include/spl.h +1 -1
index bde44374ea..270798c988 100644
@@ -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.
  *
Signature · 1 line
2.11.0
#2 lore raw

PATCH v5 1/6 spl: Convert CONFIG_SPL_ABORT_ON_RAW_IMAGE into a positive option

Quoted 7 lines · Andrew F. Davis

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.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170215/89a6e15e/attachment.sig>
#3 lore raw

PATCH v5 2/6 spl: Add option to enable SPL Legacy image support

In reply to Andrew F. Davis

Add a Kconfig option that enables Legacy image support, this allows boards to explicitly disable this, for instance when needed for security reasons.

---
 Kconfig          |  8 ++++++++
 common/spl/spl.c | 10 ++++++++--
 2 files changed, 16 insertions(+), 2 deletions(-)
Kconfig +8 -0
index cfc8f929ee..8504199493 100644
@@ -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"
common/spl/spl.c +8 -2
index da8f55eef6..3d6c0ecba1 100644
@@ -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
 		/*
Signature · 1 line
2.11.0
#4 lore raw

PATCH v5 2/6 spl: Add option to enable SPL Legacy image support

Quoted 6 lines · Andrew F. Davis

Add a Kconfig option that enables Legacy image support, this allows boards to explicitly disable this, for instance when needed for security reasons.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170215/65b8af4b/attachment.sig>
#5 lore raw

PATCH v5 3/6 ARM: AM335x: Disable non-FIT based image loading for HS devices

In reply to Andrew F. Davis

Disable support for loading non-FIT images for AM335x platforms using the high-security (HS) device variant.

---
 configs/am335x_hs_evm_defconfig | 2 ++
 1 file changed, 2 insertions(+)
configs/am335x_hs_evm_defconfig +2 -0
index f2f92f70f6..fbb8f18912 100644
@@ -14,6 +14,8 @@ CONFIG_FIT_IMAGE_POST_PROCESS=y
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_FIT_IMAGE_POST_PROCESS=y
 CONFIG_SYS_EXTRA_OPTIONS="NAND"
+# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
+# CONFIG_SPL_LEGACY_IMAGE_SUPPORT is not set
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_SPL=y
Signature · 1 line
2.11.0
#6 lore raw

PATCH v5 4/6 ARM: AM43xx: Disable non-FIT based image loading for HS devices

In reply to Andrew F. Davis

Disable support for loading non-FIT images for AM43xx platforms using the high-security (HS) device variant.

---
 configs/am43xx_hs_evm_defconfig | 2 ++
 1 file changed, 2 insertions(+)
configs/am43xx_hs_evm_defconfig +2 -0
index 8bb1b3535a..fabf876621 100644
@@ -10,6 +10,8 @@ CONFIG_FIT=y
 CONFIG_FIT_IMAGE_POST_PROCESS=y
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_FIT_IMAGE_POST_PROCESS=y
+# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
+# CONFIG_SPL_LEGACY_IMAGE_SUPPORT is not set
 CONFIG_SYS_EXTRA_OPTIONS="CONS_INDEX=1, NAND"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_VERSION_VARIABLE=y
Signature · 1 line
2.11.0
#7 lore raw

PATCH v5 5/6 ARM: AM57xx: Disable non-FIT based image loading for HS devices

In reply to Andrew F. Davis

Disable support for loading non-FIT images for AM57xx platforms using the high-security (HS) device variant.

---
 configs/am57xx_hs_evm_defconfig | 2 ++
 1 file changed, 2 insertions(+)
configs/am57xx_hs_evm_defconfig +2 -0
index 7e84ccddf3..4adbde427b 100644
@@ -14,6 +14,8 @@ CONFIG_FIT=y
 CONFIG_FIT_IMAGE_POST_PROCESS=y
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_FIT_IMAGE_POST_PROCESS=y
+# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
+# CONFIG_SPL_LEGACY_IMAGE_SUPPORT is not set
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_VERSION_VARIABLE=y
Signature · 1 line
2.11.0
#8 lore raw

PATCH v5 6/6 ARM: DRA7xx: Disable non-FIT based image loading for HS devices

In reply to Andrew F. Davis

Disable support for loading non-FIT images for DRA7xx platforms using the high-security (HS) device variant.

---
 configs/dra7xx_hs_evm_defconfig | 2 ++
 1 file changed, 2 insertions(+)
configs/dra7xx_hs_evm_defconfig +2 -0
index 244940cd6c..c5e7b16c8b 100644
@@ -15,6 +15,8 @@ CONFIG_FIT=y
 CONFIG_FIT_IMAGE_POST_PROCESS=y
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_FIT_IMAGE_POST_PROCESS=y
+# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
+# CONFIG_SPL_LEGACY_IMAGE_SUPPORT is not set
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_VERSION_VARIABLE=y
Signature · 1 line
2.11.0
#9 lore raw

v5 cover Allow disabling non-FIT image loading from SPL

In reply to Andrew F. Davis
Quoted 5 lines · Andrew F. Davis

Hello all,

To address a needed feature brought up by Andreas[0], we need a way to disable SPL from loading non-FIT images.

Quoted 7 lines

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 last 2 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.

I think this would be cleaner if we introduce the symbols to be default n if TI_SECURE_DEVICE and then we don't have to modify the defconfig files. That said, we should probably do that as a new patch #3 so it's clear in the commit history when we default it off. Thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170215/4aed6b34/attachment.sig>
#10 lore raw

v5 cover Allow disabling non-FIT image loading from SPL

Quoted 15 lines · Tom Rini
Quoted 5 lines · Andrew F. Davis

Hello all,

To address a needed feature brought up by Andreas[0], we need a way to disable SPL from loading non-FIT images.

Quoted 7 lines

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 last 2 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.

Quoted 5 lines

I think this would be cleaner if we introduce the symbols to be default n if TI_SECURE_DEVICE and then we don't have to modify the defconfig files. That said, we should probably do that as a new patch #3 so it's clear in the commit history when we default it off. Thanks!

Hmmm, I'm really not a fan of this, disabling these options is only needed on a couple boards and so should go in their defconfig, adding the per-board exceptions to the symbol definition itself will start to cause massive kconfig bloat.

If you strongly disagree, below is a patch #3, if you take this you can drop the defconfig patches from this series.

---

Author: Andrew F. Davis <[email protected]>
Date:   Thu Feb 16 08:36:08 2017 -0600

Kconfig: Disable non-FIT SPL loading for TI secure devices

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.

Kconfig +2 -2
index 70fd616cb1..3d42e8e06c 100644
@@ -295,7 +295,7 @@ config FIT_IMAGE_POST_PROCESS
 
 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
@@ -303,7 +303,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

#11 lore raw

v5 cover Allow disabling non-FIT image loading from SPL

Quoted 21 lines · Andrew F. Davis
Quoted 15 lines · Tom Rini
Quoted 5 lines · Andrew F. Davis

Hello all,

To address a needed feature brought up by Andreas[0], we need a way to disable SPL from loading non-FIT images.

Quoted 7 lines

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 last 2 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.

Quoted 4 lines

I think this would be cleaner if we introduce the symbols to be default n if TI_SECURE_DEVICE and then we don't have to modify the defconfig files. That said, we should probably do that as a new patch #3 so it's clear in the commit history when we default it off. Thanks!

Quoted 7 lines

Hmmm, I'm really not a fan of this, disabling these options is only needed on a couple boards and so should go in their defconfig, adding the per-board exceptions to the symbol definition itself will start to cause massive kconfig bloat.

If you strongly disagree, below is a patch #3, if you take this you can drop the defconfig patches from this series.

One thing that I feel is different in U-Boot from the Linux kernel is that I'm OK with putting more logic into the Kconfig files so that we get reasonable default output, even if it's only a "handful" of boards. I imagine that a follow up patch would change the logic to "default y if !TI_SECURE_DEVICES && !FSL_SIMILAR_SYMBOL" Or perhaps even doing another line of "default n if TI_SECURE_DEVICES || FSL_... || ..."

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170216/0a53dfe3/attachment.sig>
#12 lore raw

v5 cover Allow disabling non-FIT image loading from SPL

Quoted 30 lines · Tom Rini
Quoted 21 lines · Andrew F. Davis
Quoted 15 lines · Tom Rini
Quoted 5 lines · Andrew F. Davis

Hello all,

To address a needed feature brought up by Andreas[0], we need a way to disable SPL from loading non-FIT images.

Quoted 7 lines

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 last 2 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.

Quoted 4 lines

I think this would be cleaner if we introduce the symbols to be default n if TI_SECURE_DEVICE and then we don't have to modify the defconfig files. That said, we should probably do that as a new patch #3 so it's clear in the commit history when we default it off. Thanks!

Quoted 7 lines

Hmmm, I'm really not a fan of this, disabling these options is only needed on a couple boards and so should go in their defconfig, adding the per-board exceptions to the symbol definition itself will start to cause massive kconfig bloat.

If you strongly disagree, below is a patch #3, if you take this you can drop the defconfig patches from this series.

Quoted 7 lines

One thing that I feel is different in U-Boot from the Linux kernel is that I'm OK with putting more logic into the Kconfig files so that we get reasonable default output, even if it's only a "handful" of boards. I imagine that a follow up patch would change the logic to "default y if !TI_SECURE_DEVICES && !FSL_SIMILAR_SYMBOL" Or perhaps even doing another line of "default n if TI_SECURE_DEVICES || FSL_... || ..."

Okay, if that's your preference I'll post v6 with this change.

Thanks,
Andrew