[U-Boot] [PATCH 2/3] spl: ubi: Add support for loading simple fitImage

Tom Rini trini at konsulko.com
Fri Jul 12 18:31:04 UTC 2019


On Tue, May 28, 2019 at 03:49:14AM +0200, Marek Vasut wrote:

> Add code to load simple fitImage from the kernel volume, the args
> volume is unnecessary.
> 
> Signed-off-by: Marek Vasut <marex at denx.de>
> Cc: Ladislav Michl <ladis at linux-mips.org>
> Cc: Tom Rini <trini at konsulko.com>
> ---
>  common/spl/spl_ubi.c | 22 +++++++++++++++++++++-
>  1 file changed, 21 insertions(+), 1 deletion(-)
> 
> diff --git a/common/spl/spl_ubi.c b/common/spl/spl_ubi.c
> index 67e5fadd7c..6addd46ece 100644
> --- a/common/spl/spl_ubi.c
> +++ b/common/spl/spl_ubi.c
> @@ -11,6 +11,14 @@
>  #include <ubispl.h>
>  #include <spl.h>
>  
> +static ulong spl_ubi_load_read(struct spl_load_info *load, ulong sector,
> +			       ulong count, void *buf)
> +{
> +	if (buf != (void *)CONFIG_SPL_LOAD_FIT_ADDRESS + sector)
> +		memcpy(buf, (void *)(CONFIG_SYS_LOAD_ADDR + sector), count);
> +	return count;
> +}
> +
>  int spl_ubi_load_image(struct spl_image_info *spl_image,
>  		       struct spl_boot_device *bootdev)
>  {
> @@ -54,7 +62,19 @@ int spl_ubi_load_image(struct spl_image_info *spl_image,
>  		ret = ubispl_load_volumes(&info, volumes, 2);
>  		if (!ret) {
>  			header = (struct image_header *)volumes[0].load_addr;
> -			spl_parse_image_header(spl_image, header);
> +
> +			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_ubi_load_read;
> +				spl_load_simple_fit(spl_image, &load, 0, header);
> +			} else {
> +				spl_parse_image_header(spl_image, header);
> +			}
> +
>  			puts("Linux loaded.\n");
>  			goto out;
>  		}

This breaks building on igep00x0 and am335x_igep003x, sorry.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190712/4525bf96/attachment.sig>


More information about the U-Boot mailing list