diff mbox

[U-Boot,v2,3/3] spl: Rework image header parse to allow abort on raw image and os boot

Message ID 20160824180442.11598-3-contact@paulk.fr
State Accepted
Commit 85a3772973a3cab5322f2c385a5c827260c3bc8b
Delegated to: Tom Rini
Headers show

Commit Message

Paul Kocialkowski Aug. 24, 2016, 6:04 p.m. UTC
This reworks spl_set_header_raw_uboot to allow having both os boot
(which comes with a valid header) and aborting when no valid header is
found (thus excluding raw u-boot.bin images).

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
---
 common/spl/spl.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

Comments

Tom Rini Aug. 26, 2016, 9:27 p.m. UTC | #1
On Wed, Aug 24, 2016 at 08:04:42PM +0200, Paul Kocialkowski wrote:

> This reworks spl_set_header_raw_uboot to allow having both os boot
> (which comes with a valid header) and aborting when no valid header is
> found (thus excluding raw u-boot.bin images).
> 
> Signed-off-by: Paul Kocialkowski <contact@paulk.fr>

Reviewed-by: Tom Rini <trini@konsulko.com>
diff mbox

Patch

diff --git a/common/spl/spl.c b/common/spl/spl.c
index b7ec333..e14ec80 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -129,10 +129,8 @@  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
+#endif
+
 #ifdef CONFIG_SPL_OS_BOOT
 		ulong start, end;
 
@@ -147,6 +145,11 @@  int spl_parse_image_header(const struct image_header *header)
 			return 0;
 		}
 #endif
+
+#ifdef 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",
 			header->ih_magic);