[U-Boot] [PATCH] spl: add check for FIT-header when loading image

Lokesh Vutla lokeshvutla at ti.com
Wed Nov 16 12:07:52 CET 2016



On Wednesday 16 November 2016 04:24 PM, Tomas Melin wrote:
> 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.
> 

Acked-by: Lokesh Vutla <lokeshvutla at ti.com>

Thanks and regards,
Lokesh

> Signed-off-by: Tomas Melin <tomas.melin at vaisala.com>
> ---
>  common/spl/spl_spi.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> 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");
> 


More information about the U-Boot mailing list