Skip to content
Snippets Groups Projects
Commit 722a6b17 authored by Andrew F. Davis's avatar Andrew F. Davis Committed by Tom Rini
Browse files

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: default avatarAndrew F. Davis <afd@ti.com>
Reviewed-by: default avatarSimon Glass <sjg@chromium.org>
Reviewed-by: default avatarTom Rini <trini@konsulko.com>
[trini: Move to common/spl/Kconfig]
Signed-off-by: default avatarTom Rini <trini@konsulko.com>
parent 24eb39b5
No related branches found
No related tags found
No related merge requests found
...@@ -23,6 +23,14 @@ config SPL_RAW_IMAGE_SUPPORT ...@@ -23,6 +23,14 @@ config SPL_RAW_IMAGE_SUPPORT
is y. If this is not set, SPL will move on to other available is y. If this is not set, SPL will move on to other available
boot media to find a suitable image. 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 SPL_SYS_MALLOC_SIMPLE config SPL_SYS_MALLOC_SIMPLE
bool bool
depends on SPL depends on SPL
......
...@@ -93,9 +93,10 @@ void spl_set_header_raw_uboot(struct spl_image_info *spl_image) ...@@ -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, int spl_parse_image_header(struct spl_image_info *spl_image,
const struct image_header *header) const struct image_header *header)
{ {
u32 header_size = sizeof(struct image_header);
if (image_get_magic(header) == IH_MAGIC) { 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) { if (spl_image->flags & SPL_COPY_PAYLOAD_ONLY) {
/* /*
* On some system (e.g. powerpc), the load-address and * 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, ...@@ -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", debug("spl: payload image: %.*s load addr: 0x%lx size: %d\n",
(int)sizeof(spl_image->name), spl_image->name, (int)sizeof(spl_image->name), spl_image->name,
spl_image->load_addr, spl_image->size); 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 { } else {
#ifdef CONFIG_SPL_PANIC_ON_RAW_IMAGE #ifdef CONFIG_SPL_PANIC_ON_RAW_IMAGE
/* /*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment