[RFC PATCH 5/7] spl: Convert net to spl_load

Stefan Roese sr at denx.de
Wed Apr 6 07:32:50 CEST 2022


On 4/1/22 21:04, Sean Anderson wrote:
> This converts the net load method to use spl_load. As a result, it also
> adds support for LOAD_FIT_FULL and IMX images.
> 
> Signed-off-by: Sean Anderson <sean.anderson at seco.com>

Reviewed-by: Stefan Roese <sr at denx.de>

Thanks,
Stefan

> ---
> 
>   common/spl/spl_net.c | 24 +++++-------------------
>   1 file changed, 5 insertions(+), 19 deletions(-)
> 
> diff --git a/common/spl/spl_net.c b/common/spl/spl_net.c
> index a853e6aead..3b4374add6 100644
> --- a/common/spl/spl_net.c
> +++ b/common/spl/spl_net.c
> @@ -29,6 +29,10 @@ static int spl_net_load_image(struct spl_image_info *spl_image,
>   			      struct spl_boot_device *bootdev)
>   {
>   	struct image_header *header = (struct image_header *)image_load_addr;
> +	struct spl_load_info load = {
> +		.bl_len = 1,
> +		.read = spl_net_load_read,
> +	};
>   	int rv;
>   
>   	env_init();
> @@ -47,25 +51,7 @@ static int spl_net_load_image(struct spl_image_info *spl_image,
>   		return rv;
>   	}
>   
> -	if (IS_ENABLED(CONFIG_SPL_LOAD_FIT) &&
> -	    image_get_magic(header) == FDT_MAGIC) {
> -		struct spl_load_info load;
> -
> -		debug("Found FIT\n");
> -		load.bl_len = 1;
> -		load.read = spl_net_load_read;
> -		rv = spl_load_simple_fit(spl_image, &load, 0, header);
> -	} else {
> -		debug("Legacy image\n");
> -
> -		rv = spl_parse_image_header(spl_image, bootdev, header);
> -		if (rv)
> -			return rv;
> -
> -		memcpy((void *)spl_image->load_addr, header, spl_image->size);
> -	}
> -
> -	return rv;
> +	return spl_load(spl_image, bootdev, &load, header, 0, 0);
>   }
>   #endif
>   

Viele Grüße,
Stefan Roese

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de


More information about the U-Boot mailing list