[PATCH 03/26] spl: fit: Fix entry point for SPL_LOAD_FIT_FULL

Simon Glass sjg at chromium.org
Thu Oct 12 05:41:23 CEST 2023


On Wed, 11 Oct 2023 at 18:56, Sean Anderson <seanga2 at gmail.com> wrote:
>
> The entry point is not always the same as the load address. Use the value
> of the entrypoint property if it exists and is nonzero (following the
> example of spl_load_simple_fit).
>
> Fixes: 8a9dc16e4d0 ("spl: Add full fitImage support")
> Signed-off-by: Sean Anderson <seanga2 at gmail.com>
> ---
>
>  common/spl/spl_fit.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

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

The check for 0 makes me uneasy, but I can't imagine it being valid in practice.


>
> diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c
> index ce6b8aa370a..e3cdf8e5c05 100644
> --- a/common/spl/spl_fit.c
> +++ b/common/spl/spl_fit.c
> @@ -884,8 +884,10 @@ int spl_load_fit_image(struct spl_image_info *spl_image,
>                 return ret;
>
>         spl_image->size = fw_len;
> -       spl_image->entry_point = fw_data;
>         spl_image->load_addr = fw_data;
> +       if (fit_image_get_entry(header, ret, &spl_image->entry_point) ||
> +           !spl_image->entry_point)
> +               spl_image->entry_point = fw_data;
>         if (fit_image_get_os(header, ret, &spl_image->os))
>                 spl_image->os = IH_OS_INVALID;
>         spl_image->name = genimg_get_os_name(spl_image->os);
> --
> 2.37.1
>


More information about the U-Boot mailing list