Hi Nikita,
On 2026-09-02T06:31:15, Nikita Shubin <[email protected]> wrote:
> spl: fit: Record loadables to spl_image->fdt_addr
>
> Record loadables to FDT passed to next boot stage.
>
> This is required for spl_invoke_opensbi(), for example, which requires
> u-boot/kernel load or entry address to fill opensbi_info.next_addr
> entry.
>
> spl_load_simple_fit() does it, make spl_load_fit_image() also capable of
> recording loadables into next stage.
>
> One limitation remains: if the FIT image does not contain an FDT blob,
> spl_load_fit_image() will not use gd->fdt_blob as a fallback,
> unlike spl_load_simple_fit() which does.
>
> Signed-off-by: Nikita Shubin <[email protected]>
>
> common/spl/spl_fit.c | 62
> ++++++++++++++++++++++++++++++++++++++--------------
> 1 file changed, 46 insertions(+), 16 deletions(-)
> diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c
> @@ -601,6 +601,17 @@ static int spl_fit_append_fdt(struct spl_image_info
> *spl_image,
> +static int fit_record_loadable(const void *fit, int node, int idx, const
> char *name,
> + ulong load_addr, ulong size, ulong entry_point,
> + void *fdt_blob)
This line is over 80 columns. So are the new fdt_shrink_to_minimum()
log_debug() line, the fit_image_get_entry() call and the last line of
the fit_record_loadable() call below. Please can you wrap them, and
add a short comment on the helper?
> diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c
> @@ -1104,17 +1118,33 @@ int spl_load_fit_image(struct spl_image_info
> *spl_image,
> + log_debug("record_loadable: %s entry addr: 0x%lx\n",
> + uname, entry_addr);
> +
> + ret = fit_record_loadable((const void *)header, noffset,
> + idx, uname, img_data, img_len,
> + entry_addr,
> spl_image->fdt_addr);
> + if (ret < 0)
> + log_debug("record_loadable: couldn't "
> + "record loadable: %s\n", uname);
log_debug() can show the function name, so please drop the
'record_loadable:' prefixes. Please also keep the second message on
one line so it can be grepped, and include ret in it, e.g. 'Couldn't
record loadable %s: %d\n'
Regards,
Simon