diff options
author | tomas.melin@vaisala.com <tomas.melin@vaisala.com> | 2016-11-16 10:54:39 (GMT) |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2016-11-28 20:10:31 (GMT) |
commit | f72250e7e7e6c31bc21dc177f1ffe1dc8cc88e3f (patch) | |
tree | 93c23491468dfb0f8d5582f95f51a5b5bd7542d6 /common/spl | |
parent | 1deeecb6e41a42d0e24fec30d2bb74c56d7a0d9b (diff) | |
download | u-boot-f72250e7e7e6c31bc21dc177f1ffe1dc8cc88e3f.tar.xz |
spl: add check for FIT-header when loading image
Add check for FDT_MAGIC, otherwise also legacy images will be loaded as
a FIT. With this check in place, the loader works correct both
with legacy and FIT images.
Signed-off-by: Tomas Melin <tomas.melin@vaisala.com>
Acked-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common/spl')
-rw-r--r-- | common/spl/spl_spi.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/common/spl/spl_spi.c b/common/spl/spl_spi.c index a3caafb..78b8cd1 100644 --- a/common/spl/spl_spi.c +++ b/common/spl/spl_spi.c @@ -99,7 +99,8 @@ static int spl_spi_load_image(struct spl_image_info *spl_image, if (err) return err; - if (IS_ENABLED(CONFIG_SPL_LOAD_FIT)) { + if (IS_ENABLED(CONFIG_SPL_LOAD_FIT) && + image_get_magic(header) == FDT_MAGIC) { struct spl_load_info load; debug("Found FIT\n"); |