Skip to contentSkip to conversation

Allow disabling non-FIT image loading from SPL

PATCH New Andrew F. Davis 3 participants 12 messages Feb 16, 2017 – Mar 19, 2017 Arm i.MX and Layerscape

lore
Share & tools
lore
#0 lore raw

v6 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 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 at 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(-)
Signature · 1 line
2.11.0
#1 lore raw

PATCH v6 1/3 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 v6 1/3 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/20170217/bfd20b29/attachment.sig>
#3 lore raw

PATCH v6 1/3 spl: Convert CONFIG_SPL_ABORT_ON_RAW_IMAGE into a positive option

In reply to Andrew F. Davis
Quoted 6 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.

Quoted 7 lines
---
 Kconfig                                |  7 +++++++
 README                                 |  4 ----
 common/spl/spl.c                       | 10 ++++++----
 configs/apalis_imx6_defconfig          |  1 +
 configs/cgtqmx6eval_defconfig          |  1 +
#4 lore raw

PATCH v6 1/3 spl: Convert CONFIG_SPL_ABORT_ON_RAW_IMAGE into a positive option

In reply to Andrew F. Davis
Quoted 9 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.

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!

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/20170318/7c27e9d7/attachment.sig>
#5 lore raw

PATCH v6 2/3 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
#6 lore raw

PATCH v6 2/3 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/20170217/ec62626e/attachment.sig>
#7 lore raw

PATCH v6 2/3 spl: Add option to enable SPL Legacy image support

In reply to Andrew F. Davis
Quoted 7 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.

Applied to u-boot/master, 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/20170318/1506ef13/attachment.sig>
#8 lore raw

PATCH v6 3/3 Kconfig: Disable non-FIT SPL loading for TI secure devices

In reply to Andrew F. Davis

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 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Kconfig +2 -2
index 8504199493..e238b8076b 100644
@@ -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
Signature · 1 line
2.11.0
#9 lore raw

PATCH v6 3/3 Kconfig: Disable non-FIT SPL loading for TI secure devices

Quoted 5 lines · Andrew F. Davis

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.

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/20170217/ca819263/attachment.sig>
#11 lore raw

PATCH v6 3/3 Kconfig: Disable non-FIT SPL loading for TI secure devices

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

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.

Applied to u-boot/master, 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/20170318/e3c4139d/attachment.sig>