Re: [U-Boot] [PATCH v5 1/6] spl: Convert CONFIG_SPL_ABORT_ON_RAW_IMAGE into a positive option

2017-02-15 Thread Tom Rini
On Wed, Feb 15, 2017 at 01:45:46PM -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 

Reviewed-by: Tom Rini 

-- 
Tom


signature.asc
Description: Digital signature
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v5 1/6] spl: Convert CONFIG_SPL_ABORT_ON_RAW_IMAGE into a positive option

2017-02-15 Thread 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.

Signed-off-by: Andrew F. Davis 
---
 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"
+#