diff mbox series

[V3,01/10] common: spl: spl: Update stack pointer address

Message ID 20230509103146.81969-2-n-jain1@ti.com
State Changes Requested
Delegated to: Tom Rini
Headers show
Series Enable SPL splash screen on AM62x | expand

Commit Message

Nikhil Jain May 9, 2023, 10:31 a.m. UTC
At SPL stage when stack is relocated, the stack pointer needs to be
updated, the stack pointer may point to stack in on chip memory even
though stack is relocated.

Signed-off-by: Nikhil M Jain <n-jain1@ti.com>
---
V3 (patch introduced):
- Update stackpointer after relocation.

 common/spl/spl.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/common/spl/spl.c b/common/spl/spl.c
index a630e79866..21a62521a9 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -977,6 +977,7 @@  ulong spl_relocate_stack_gd(void)
 #endif
 	/* Get stack position: use 8-byte alignment for ABI compliance */
 	ptr = CONFIG_SPL_STACK_R_ADDR - roundup(sizeof(gd_t),16);
+	gd->start_addr_sp = ptr;
 	new_gd = (gd_t *)ptr;
 	memcpy(new_gd, (void *)gd, sizeof(gd_t));
 #if CONFIG_IS_ENABLED(DM)