From: Nikhil M Jain <n-jain1@ti.com>
Date: Tue, 18 Jul 2023 08:57:27 +0000 (+0530)
Subject: common: spl: spl: Update stack pointer address
X-Git-Tag: v2025.01-rc5-pxa1908~929^2~9
X-Git-Url: http://git.dujemihanovic.xyz/img/%22http:/www.sics.se/static/git-logo.png?a=commitdiff_plain;h=149fb05b8346e6ac37df594ef0427cecff09053c;p=u-boot.git

common: spl: spl: Update stack pointer address

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>
Reviewed-by: Tom Rini <trini@konsulko.com>
---

diff --git a/common/spl/spl.c b/common/spl/spl.c
index d74acec10b..d45dd1c923 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -992,6 +992,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)