[PATCH v4 01/11] spl: Use FIT data address as fallback when 'load' property is absent

Simon Glass sjg at chromium.org
Wed Apr 29 16:23:53 CEST 2026


Hi,

On Tue, 28 Apr 2026 at 08:06, Tom Rini <trini at konsulko.com> wrote:
>
> On Tue, Apr 28, 2026 at 04:26:31PM +0530, Beleswar Prasad Padhi wrote:
> > Hi Tom,
> >
> > On 28/04/26 01:24, Tom Rini wrote:
> > > On Sat, Apr 25, 2026 at 09:07:32AM +0530, Beleswar Padhi wrote:
> > >> In cases where the 'load' property is not defined in a FIT image node,
> > >> fallback to using the data address returned by `fit_image_get_data()`.
> > >> This enables FIT images to omit the 'load' property during FIT creation.
> > >>
> > >> Signed-off-by: Beleswar Padhi <b-padhi at ti.com>
> > >> ---
> > >> Cc: Simon Glass <sjg at chromium.org>
> > >>
> > >> v4: Changelog:
> > >> 1. None
> > >>
> > >> Link to v3:
> > >> https://lore.kernel.org/all/20251231173621.1069988-2-b-padhi@ti.com/
> > >>
> > >> v3: Changelog:
> > >> 1. None
> > >>
> > >> Link to v2:
> > >> https://lore.kernel.org/all/20250506104202.16741-3-b-padhi@ti.com/
> > >>
> > >> v2: Changelog:
> > >> 1. New patch. Add support to load images without 'load' property.
> > >>
> > >>  common/spl/spl_fit.c | 16 +++++++++++++++-
> > >>  1 file changed, 15 insertions(+), 1 deletion(-)
> > >>
> > >> diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c
> > >> index 46ebcabe56a..87d01b8b8e6 100644
> > >> --- a/common/spl/spl_fit.c
> > >> +++ b/common/spl/spl_fit.c
> > >> @@ -799,6 +799,8 @@ int spl_load_simple_fit(struct spl_image_info *spl_image,
> > >>  {
> > >>    struct spl_image_info image_info;
> > >>    struct spl_fit_info ctx;
> > >> +  const void *fit_image_loadaddr;
> > >> +  size_t fit_image_size;
> > >>    int node = -1;
> > >>    int ret;
> > >>    int index = 0;
> > >> @@ -889,7 +891,19 @@ int spl_load_simple_fit(struct spl_image_info *spl_image,
> > >>            if (firmware_node == node)
> > >>                    continue;
> > >>
> > >> -          image_info.load_addr = 0;
> > >> +          /*
> > >> +           * If the 'load' property is not present in the image node,
> > >> +           * use the FIT image's data address as the fallback load
> > >> +           * address. This allows flexibility in omitting the load address
> > >> +           * during FIT creation time.
> > >> +           */
> > >> +          ret = fit_image_get_data(ctx.fit, node,
> > >> +                                   &fit_image_loadaddr, &fit_image_size);
> > >> +          if (ret < 0)
> > >> +                  panic("Error accessing node = %d in FIT (%d)\n", node,
> > >> +                        ret);
> > >> +
> > >> +          image_info.load_addr = (ulong)fit_image_loadaddr;
> > >>            ret = load_simple_fit(info, offset, &ctx, node, &image_info);
> > >>            if (ret < 0 && ret != -EBADSLT) {
> > >>                    printf("%s: can't load image loadables index %d (ret = %d)\n",
> > > I guess the real question here is, does the spec allow this to be
> > > omitted like that?
> >
> >
> > Could you please point me to the spec? I could not find it.
>
> Sure: https://github.com/open-source-firmware/flat-image-tree/

It is mandatory for kernel and firmware images. Instead of allowing it
to be optional for 'kernel', we created 'kernel_noload' some years
back.

Which image type are you using in your case?

Regards,
Simon


More information about the U-Boot mailing list