On Mon, Aug 05, 2019 at 11:43:56AM +0200, Jean-Jacques Hiblot wrote:
> When u-boot.img is a FIT image generated automatically by mkimage, the
> configuration node has the following structure:
> conf-1 {
>    description = "k3-am654-base-board";
>    firmware = "firmware-1";
>    loadables = "firmware-1";
>    fdt = "fdt-1";
> };
> 
> The firmware is referenced twice. Once by the 'firmware' property and
> once by the 'loadables' property. Currently this result in the firmware
> being loaded twice. This is not a big problem but has an impact on the
> boot time.
> Fixing it by not loading a loadable image if it is also the firmware image.
> 
> Signed-off-by: Jean-Jacques Hiblot <jjhib...@ti.com>
> ---


Tested-by: Andreas Dannenberg <dannenb...@ti.com>


I was working on getting UART boot to work on TI's AM654x devices and
just ran into this very issue (took a while to root cause). Unlike when
booting from MMC it's not just redundant to load the same image (U-Boot
proper in my case) twice -- it simply won't work.

--
Andreas Dannenberg
Texas Instruments Inc



> 
> Changes in v4: New
> 
>  common/spl/spl_fit.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c
> index 969f7775c1..0de18e3975 100644
> --- a/common/spl/spl_fit.c
> +++ b/common/spl/spl_fit.c
> @@ -361,6 +361,7 @@ int spl_load_simple_fit(struct spl_image_info *spl_image,
>       int images, ret;
>       int base_offset, hsize, align_len = ARCH_DMA_MINALIGN - 1;
>       int index = 0;
> +     int firmware_node;
>  
>       /*
>        * For FIT with external data, figure out where the external images
> @@ -490,6 +491,7 @@ int spl_load_simple_fit(struct spl_image_info *spl_image,
>               spl_fit_append_fdt(spl_image, info, sector, fit,
>                                  images, base_offset);
>  
> +     firmware_node = node;
>       /* Now check if there are more images for us to load */
>       for (; ; index++) {
>               uint8_t os_type = IH_OS_INVALID;
> @@ -498,6 +500,14 @@ int spl_load_simple_fit(struct spl_image_info *spl_image,
>               if (node < 0)
>                       break;
>  
> +             /*
> +              * if the firmware is also a loadable, skip it because
> +              * it already has been loaded. This is typically the case with
> +              * u-boot.img generated by mkimage.
> +              */
> +             if (firmware_node == node)
> +                     continue;
> +
>               ret = spl_load_fit_image(info, sector, fit, base_offset, node,
>                                        &image_info);
>               if (ret < 0)
> -- 
> 2.17.1
> 
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot

Reply via email to