[PATCH] common: board_f: Move relocation address after framebuffer

Simon Glass sjg at chromium.org
Thu Aug 3 16:02:01 CEST 2023


+Bin Meng

Hi Devarsh,

On Tue, 1 Aug 2023 at 08:04, Devarsh Thakkar <devarsht at ti.com> wrote:
>
> When passing framebuffer address using bloblist, check
> that passed address is overlapping with current relocation
> address, if so move the relocation address after the framebuffer
> region to avoid overlap.
>
> Fixes: 5bc610a7d9d ("common: board_f: Pass frame buffer info from
> SPL to u-boot")
> Signed-off-by: Devarsh Thakkar <devarsht at ti.com>
> ---
>  common/board_f.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/common/board_f.c b/common/board_f.c
> index 7d2c380e91..20fa17207a 100644
> --- a/common/board_f.c
> +++ b/common/board_f.c
> @@ -419,7 +419,10 @@ static int reserve_video(void)
>                 if (!ho)
>                         return log_msg_ret("blf", -ENOENT);
>                 video_reserve_from_bloblist(ho);
> -               gd->relocaddr = ho->fb;
> +               /* Relocate after framebuffer area to avoid overlap */
> +               if (gd->relocaddr > (unsigned long)ho->fb)
> +                       gd->relocaddr = ho->fb;
> +
>         } else if (CONFIG_IS_ENABLED(VIDEO)) {
>                 ulong addr;
>                 int ret;
> --
> 2.34.1
>

Yes this happens to work with qemu-x86_64. However it depends on the
SPL frame buffer being below the current allocation area. Why would it
be below, in general? This seems like a land mine for others to trip
up on.

Anyway I am OK with this for now since it fixes my problems. I would
prefer something positive like the Kconfig I provided, since I still
think it is very weird to interrupt the U-Boot reservation process
like this.

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

Regards,
Simon


More information about the U-Boot mailing list