[U-Boot] [PATCH 2/3] SPL: Add CONFIG_SPL_ABORT_ON_RAW_IMAGE

Marek Vasut marex at denx.de
Fri Apr 29 00:44:55 CEST 2016


When defined, SPL will proceed to another boot method
if the image it has loaded does not have a signature.
This is useful if the subsequent boot methods are much
more complex.

Signed-off-by: Marek Vasut <marex at denx.de>
Cc: Tom Rini <trini at konsulko.com>
Cc: Stefano Babic <sbabic at denx.de>
Cc: Peng Fan <van.freenix at gmail.com>
Cc: Fabio Estevam <fabio.estevam at nxp.com>
---
 README           | 4 ++++
 common/spl/spl.c | 3 +++
 2 files changed, 7 insertions(+)

diff --git a/README b/README
index 88ff837..d881da2 100644
--- a/README
+++ b/README
@@ -3487,6 +3487,10 @@ 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 7259619..93f9bd1 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -111,6 +111,9 @@ int spl_parse_image_header(const struct image_header *header)
 		 * is bad, and thus should be skipped silently.
 		 */
 		panic("** no mkimage signature but raw image not supported");
+#elif defined(CONFIG_SPL_ABORT_ON_RAW_IMAGE)
+		/* Signature not found, proceed to other boot methods. */
+		return -EINVAL;
 #else
 		/* Signature not found - assume u-boot.bin */
 		debug("mkimage signature not found - ih_magic = %x\n",
-- 
2.7.0



More information about the U-Boot mailing list