Hi Randolph,
On 2026-05-13T01:56:06, Randolph Sapp <[email protected]> wrote:
> memory: reserve from start_addr_sp to initial_relocaddr
>
> Add a new global data struct member called initial_relocaddr. This
> stores the original value of relocaddr, directly from setup_dest_addr.
> This is specifically to avoid any adjustments made by other init
> functions.
>
> Reserve the memory from gd->start_addr_sp - CONFIG_STACK_SIZE to
> gd->initial_relocaddr instead of gd->ram_top. This allows platform
> specific relocation addresses to work without unnecessarily painting
> over a large range.
>
> Signed-off-by: Randolph Sapp <[email protected]>
>
> common/board_f.c | 9 ++++++++-
> include/asm-generic/global_data.h | 9 +++++++++
> lib/efi_loader/efi_memory.c | 2 +-
> lib/lmb.c | 7 ++++---
> 4 files changed, 22 insertions(+), 5 deletions(-)
> diff --git a/include/asm-generic/global_data.h
> b/include/asm-generic/global_data.h
> @@ -107,6 +107,15 @@ struct global_data {
> + /**
> + * @initial_relocaddr: top address of U-Boot in RAM
> + *
> + * This should be the original value of relocaddr before any other
> + * allocations or reservations shift it. This address will, depending on
> + * the platform, be equivilent to ram_top and should also be considered
> + * an exclusive address.
> + */
> + unsigned long initial_relocaddr;
Typo: equivilent -> equivalent.
How about: "...the value of relocaddr after setup_dest_addr()
completes, before reserve_pram() or any later init function adjusts
it"
Reviewed-by: Simon Glass <[email protected]>
Regards,
Simon