On Wed, 1 Apr 2026 at 01:01, Marek Vasut <[email protected]> wrote: > > On 3/31/26 10:01 AM, Ilias Apalodimas wrote: > > [...] > > > @@ -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"); > > + ret = fdtdec_setup_ram_size(); > > + if (ret) { > > + debug("failed to calculate RAM size"); > > + gd->ram_top = old_top; > This changes ram_size , why is this restoring ram_top ?
Because the actions of calculating a ram_top and ram_size should be bundled together imho. You are effectively calculating how much ram i have available and where should i relocate. So if one fails, the other should be restored. > Should this also restore gd->ram_size ? fdtdec_setup_ram_size() already does that in case it fails. Cheers /Ilias

