summaryrefslogtreecommitdiff
path: root/common/spl/spl.c
diff options
context:
space:
mode:
authorAndrew F. Davis <afd@ti.com>2017-02-16 17:18:39 (GMT)
committerTom Rini <trini@konsulko.com>2017-03-18 18:28:51 (GMT)
commit722a6b1741bacd4ba36fb89906dbb8bf696d70a7 (patch)
tree3c1a1707b3ab4bccde4c549a1acd712ce0b42395 /common/spl/spl.c
parent24eb39b575d5b077de92a8d7e7947a955adf5679 (diff)
downloadu-boot-722a6b1741bacd4ba36fb89906dbb8bf696d70a7.tar.xz
spl: Add option to enable SPL Legacy image support
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> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com> [trini: Move to common/spl/Kconfig] Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'common/spl/spl.c')
-rw-r--r--common/spl/spl.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/common/spl/spl.c b/common/spl/spl.c
index 586d75f..d98b9fc 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,11 @@ 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 */
+ debug("Legacy boot image support not enabled, proceeding to other boot methods");
+ return -EINVAL;
+#endif
} else {
#ifdef CONFIG_SPL_PANIC_ON_RAW_IMAGE
/*