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@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
This commit is contained in:
Randolph Sapp
2026-06-15 11:04:39 -06:00
committed by Tom Rini
parent de12fa4df8
commit 48412f8f29
4 changed files with 22 additions and 5 deletions
+8 -1
View File
@@ -330,6 +330,8 @@ __weak int arch_setup_dest_addr(void)
static int setup_dest_addr(void)
{
int ret;
debug("Monitor len: %08x\n", gd->mon_len);
/*
* Ram is setup, size stored in gd !!
@@ -356,7 +358,12 @@ static int setup_dest_addr(void)
gd->relocaddr = gd->ram_top;
debug("Ram top: %08llX\n", (unsigned long long)gd->ram_top);
return arch_setup_dest_addr();
ret = arch_setup_dest_addr();
if (ret)
return ret;
gd->initial_relocaddr = gd->relocaddr;
return 0;
}
#ifdef CFG_PRAM