From: Andrew F. Davis <afd@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 2/6] spl: Add option to enable SPL Legacy image support
Date: Wed, 8 Feb 2017 11:21:56 -0600 [thread overview]
Message-ID: <20170208172200.13640-3-afd@ti.com> (raw)
In-Reply-To: <20170208172200.13640-1-afd@ti.com>
Add a Kconfig option that enables Legacy image support, this allows
boards to explicitly disable this, for instance when needed for
security reasons.
Signed-off-by: Andrew F. Davis <afd@ti.com>
---
Kconfig | 8 ++++++++
common/spl/spl.c | 9 +++++++--
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/Kconfig b/Kconfig
index 8ce2d8c3bb..62fa667b7f 100644
--- a/Kconfig
+++ b/Kconfig
@@ -299,6 +299,14 @@ config SPL_RAW_IMAGE_SUPPORT
is y. If this is not set, SPL will move on to other available
boot media to find a suitable image.
+config SPL_LEGACY_IMAGE_SUPPORT
+ bool "Support SPL loading and booting of Legacy images"
+ default y
+ help
+ SPL will support loading and booting Legacy images 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
int "CPU clock frequency"
diff --git a/common/spl/spl.c b/common/spl/spl.c
index d564d4d2a2..ccea4aa55f 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -93,9 +93,10 @@ void spl_set_header_raw_uboot(struct spl_image_info *spl_image)
int spl_parse_image_header(struct spl_image_info *spl_image,
const struct image_header *header)
{
- u32 header_size = sizeof(struct image_header);
-
if (image_get_magic(header) == IH_MAGIC) {
+#ifdef CONFIG_SPL_LEGACY_IMAGE_SUPPORT
+ u32 header_size = sizeof(struct image_header);
+
if (spl_image->flags & SPL_COPY_PAYLOAD_ONLY) {
/*
* On some system (e.g. powerpc), the load-address and
@@ -118,6 +119,10 @@ int spl_parse_image_header(struct spl_image_info *spl_image,
debug("spl: payload image: %.*s load addr: 0x%lx size: %d\n",
(int)sizeof(spl_image->name), spl_image->name,
spl_image->load_addr, spl_image->size);
+#else
+ /* LEGACY image not supported */
+ return -EINVAL;
+#endif
} else {
#ifdef CONFIG_SPL_PANIC_ON_RAW_IMAGE
/*
--
2.11.0
next prev parent reply other threads:[~2017-02-08 17:21 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-08 17:21 [U-Boot] [PATCH v3 0/6] Allow disabling non-FIT image loading from SPL Andrew F. Davis
2017-02-08 17:21 ` [U-Boot] [PATCH v3 1/6] spl: Convert CONFIG_SPL_ABORT_ON_RAW_IMAGE into a positive option Andrew F. Davis
2017-02-09 4:21 ` Lokesh Vutla
2017-02-10 18:38 ` Simon Glass
2017-02-10 19:58 ` Andrew F. Davis
2017-02-14 5:23 ` Simon Glass
2017-02-08 17:21 ` Andrew F. Davis [this message]
2017-02-09 4:22 ` [U-Boot] [PATCH v3 2/6] spl: Add option to enable SPL Legacy image support Lokesh Vutla
2017-02-09 14:52 ` Andrew F. Davis
2017-02-10 18:38 ` Simon Glass
2017-02-08 17:21 ` [U-Boot] [PATCH v3 3/6] ARM: AM335x: Disable non-FIT based image loading for HS devices Andrew F. Davis
2017-02-10 18:39 ` Simon Glass
2017-02-08 17:21 ` [U-Boot] [PATCH v3 4/6] ARM: AM43xx: " Andrew F. Davis
2017-02-10 18:39 ` Simon Glass
2017-02-08 17:21 ` [U-Boot] [PATCH v3 5/6] ARM: AM57xx: " Andrew F. Davis
2017-02-10 18:39 ` Simon Glass
2017-02-08 17:22 ` [U-Boot] [PATCH v3 6/6] ARM: DRA7xx: " Andrew F. Davis
2017-02-10 18:39 ` Simon Glass
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=20170208172200.13640-3-afd@ti.com \
--to=afd@ti.com \
--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