[PATCH v2 4/4] common: Allow relocations on the top of the last bank
Ilias Apalodimas
ilias.apalodimas at linaro.org
Wed Apr 1 12:44:38 CEST 2026
Hi Anshul
On Wed, 1 Apr 2026 at 13:25, Anshul Dalal <anshuld at ti.com> wrote:
>
> On Tue, 31 Mar 2026 11:01:14 +0300, Ilias Apalodimas <ilias.apalodimas at linaro.org> wrote:
> > diff --git a/common/board_f.c b/common/board_f.c
> > index df2b0dc899b..4270f368e65 100644
> > --- a/common/board_f.c
> > +++ b/common/board_f.c
> > @@ -321,6 +323,19 @@ __weak phys_addr_t board_get_usable_ram_top(phys_size_t total_size)
> > */
> > return 0;
> > #endif
> > + if (IS_ENABLED(CONFIG_RELOCATE_LAST_BANK)) {
> > + phys_addr_t old_top = gd->ram_top;
> > +
> > + ret = fdtdec_setup_mem_ram_top();
> > + if (ret)
> > + debug("failed to relocate to ram top");
>
> Should we not do an early exit here in case of failure?
We discussed this on the RFC and we decided to still boot and just
relocate to the old address
>
> > + ret = fdtdec_setup_ram_size();
> > + if (ret) {
> > + debug("failed to calculate RAM size");
> > + gd->ram_top = old_top;
>
> This should be redundant since fdtdec_setup_mem_ram_top already resets to
> old_top in case of failure and fdtdec_setup_ram_size only modifies gd->ram_size.
>
It's fdtdec_setup_ram_size() that fails here. We should reset ram_top.
Take a look at the email thread though. Jonas & I had a discussion and
I think I got a better idea for this patch
Cheers
/Ilias
> --
> Anshul Dalal <anshuld at ti.com>
More information about the U-Boot
mailing list