public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/3] SPL: Add CONFIG_SPL_ABORT_ON_RAW_IMAGE
Date: Fri, 29 Apr 2016 00:44:55 +0200	[thread overview]
Message-ID: <1461883496-9674-2-git-send-email-marex@denx.de> (raw)
In-Reply-To: <1461883496-9674-1-git-send-email-marex@denx.de>

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>
---
 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

  reply	other threads:[~2016-04-28 22:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-28 22:44 [U-Boot] [PATCH 1/3] SPL: Let spl_parse_image_header() return value Marek Vasut
2016-04-28 22:44 ` Marek Vasut [this message]
2016-04-28 22:44 ` [U-Boot] [PATCH 3/3] ARM: mx6: Enable MMC and SATA extfs boot support Marek Vasut
2016-05-20 21:56 ` [U-Boot] [PATCH 1/3] SPL: Let spl_parse_image_header() return value Nishanth Menon
2016-05-21  0:22   ` Fabio Estevam
2016-05-23 15:57     ` Suman Anna

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1461883496-9674-2-git-send-email-marex@denx.de \
    --to=marex@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox