[PATCH v1 3/3] common: Allow relocations on the top of the last bank
Ilias Apalodimas
ilias.apalodimas at linaro.org
Fri Mar 27 13:23:38 CET 2026
[...]
> >
> > Add a Kconfig option and allow the common code to relocate U-Boot
> > to the top of the last discovered bank.
>
> The commit message should really clarify the current pitfalls of
> enabling this symbol, including the part where ethernet transfers above
> 4 GiB used to work because of the packet buffer built into U-Boot, and
> they will break because the buffer is now relocated above 4 GiB too.
Shall I just add your note from the RFC with a few adjustments? I.e
NOTE: This currently might break platforms. If the ethernet
controller cannot DMA above 4 GiB, and once U-Boot does
get relocated above 4 GiB, the packet buffer which is built
into the U-Boot binary is also relocated above 4 GiB.
>
> > Signed-off-by: Ilias Apalodimas <ilias.apalodimas at linaro.org>
> > ---
> > Changes since RFC:
> > - new patch
> > Kconfig | 7 +++++++
> > common/board_f.c | 2 ++
> > 2 files changed, 9 insertions(+)
> >
> > diff --git a/Kconfig b/Kconfig
> > index ce25ea24a60f..b9144878ce0b 100644
> > --- a/Kconfig
> > +++ b/Kconfig
> > @@ -474,6 +474,13 @@ config SKIP_RELOCATE
> > Skips relocation of U-Boot allowing for systems that have extremely
> > limited RAM to run U-Boot.
> >
> > +config RELOCATE_LAST_BANK
> > + bool "Relocate U-Boot to the top of the last memory bank"
>
> You may want to call this "Relocate to the topmost memory address" or
> something along those lines, since "last bank" is a bit opaque.
Ok
>
> > + help
> > + When U-Boot relocates, it chooses the end of the first memory bank.
> > + Enable this if you have multiple banks and want U-Boot to relocate
> > + to the top of the last available bank.
> > +
> > endif # EXPERT
> >
> > config PHYS_64BIT
> > diff --git a/common/board_f.c b/common/board_f.c
> > index df2b0dc899bf..7c3fbeab17ec 100644
> > --- a/common/board_f.c
> > +++ b/common/board_f.c
> > @@ -321,6 +321,8 @@ __weak phys_addr_t board_get_usable_ram_top(phys_size_t total_size)
> > */
> > return 0;
> > #endif
> > + if (IS_ENABLED(CONFIG_RELOCATE_LAST_BANK))
> > + fdtdec_setup_mem_ram_top();
> Return value may need checking ?
sure, but should we panic ? Or print a message and silently keep the
old reloc address?
Cheers
/Ilias
More information about the U-Boot
mailing list