[PATCH v4 02/11] arm: mach-k3: Use FIT image data addr as fallback if 'load' prop is missing

Simon Glass sjg at chromium.org
Thu Apr 30 01:48:38 CEST 2026


Hi Beleswar,

On 2026-04-25T03:37:39, Padhi, Beleswar <b-padhi at ti.com> wrote:
> arm: mach-k3: Use FIT image data addr as fallback if 'load' prop is missing
>
> It is possible for FIT Images to skip mentioning the pre-defined 'load'
> address property. In those cases, SPL uses the actual address of the FIT
> Image data as the fallback load address. Use this FIT data address for
> referencing the image when the 'load' property is missing.
>
> Signed-off-by: Beleswar Padhi <b-padhi at ti.com>
>
> arch/arm/mach-k3/r5/common.c | 23 +++++++++++++++++++++--
>  1 file changed, 21 insertions(+), 2 deletions(-)

> diff --git a/arch/arm/mach-k3/r5/common.c b/arch/arm/mach-k3/r5/common.c
> @@ -342,6 +345,22 @@ void board_fit_image_post_process(const void *fit, int node, void **p_image,
> +                     if (load_addr == -1) {
> +                             ret = fit_image_get_data(fit, node,
> +                                                      &fit_image_loadaddr,
> +                                                      &fit_image_size);
> +                             if (ret < 0)
> +                                     panic("Error accessing node os = %s in FIT (%d)\n",
> +                                           os, ret);
> +                             fit_image_info[i].load = (ulong)fit_image_loadaddr;

We might need a spec change to deal with the 'load' address being omitted.

By the time board_fit_image_post_process() runs, *p_image already
points at the in-memory FIT data (it's the 'src' that patch 1 reads
via fit_image_get_data() and feeds in here). Re-resolving it with a
second fit_image_get_data() (and adding a panic() path for the
failure!) does the same work that has just succeeded one frame up. How
about just using (ulong)*p_image here and then drop the local
fit_image_loadaddr/fit_image_size/ret ?

Reviewed-by: Simon Glass <sjg at chromium.org>

Regards,
Simon


More information about the U-Boot mailing list