Эх сурвалжийг харах

SPL: Add 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.
This is useful if the subsequent boot methods are much
more complex.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Tom Rini <trini@konsulko.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Peng Fan <van.freenix@gmail.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Marek Vasut 9 жил өмнө
parent
commit
e072751515
2 өөрчлөгдсөн 7 нэмэгдсэн , 0 устгасан
  1. 4 0
      README
  2. 3 0
      common/spl/spl.c

+ 4 - 0
README

@@ -3487,6 +3487,10 @@ FIT uImage format:
 		consider that a completely unreadable NAND block is bad,
 		consider that a completely unreadable NAND block is bad,
 		and thus should be skipped silently.
 		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
 		CONFIG_SPL_RELOC_STACK
 		Adress of the start of the stack SPL will use after
 		Adress of the start of the stack SPL will use after
 		relocation.  If unspecified, this is equal to
 		relocation.  If unspecified, this is equal to

+ 3 - 0
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.
 		 * is bad, and thus should be skipped silently.
 		 */
 		 */
 		panic("** no mkimage signature but raw image not supported");
 		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
 #else
 		/* Signature not found - assume u-boot.bin */
 		/* Signature not found - assume u-boot.bin */
 		debug("mkimage signature not found - ih_magic = %x\n",
 		debug("mkimage signature not found - ih_magic = %x\n",