[PATCHv7 3/3] memory: reserve from start_addr_sp to initial_relocaddr

Simon Glass sjg at chromium.org
Wed May 13 18:26:56 CEST 2026


Hi Randolph,

On 2026-05-13T01:56:06, Randolph Sapp <rs at ti.com> 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 <rs at ti.com>
>
> 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 <sjg at chromium.org>

Regards,
Simon


More information about the U-Boot mailing list