From: tomas.melin@vaisala.com Date: Wed, 16 Nov 2016 10:54:39 +0000 (+0200) Subject: spl: add check for FIT-header when loading image X-Git-Url: http://git.dujemihanovic.xyz/img/sics.gif?a=commitdiff_plain;h=f72250e7e7e6c31bc21dc177f1ffe1dc8cc88e3f;p=u-boot.git 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 Acked-by: Lokesh Vutla Reviewed-by: Simon Glass --- diff --git a/common/spl/spl_spi.c b/common/spl/spl_spi.c index a3caafbd46..78b8cd16bb 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");