summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorLukas Auer <lukas.auer@aisec.fraunhofer.de>2019-08-21 21:14:46 +0200
committerAndes <uboot@andestech.com>2019-08-26 16:07:42 +0800
commitc7e1effb965a3ec7e33d8e83925f04636771c91b (patch)
treee920dd7c9b36439ca6693967204d736040ac583b /common
parent8c59f2023cc8d4ab32b3988193ff2eb116df5995 (diff)
riscv: support SPL stack and global data relocation
To support relocation of the stack and global data on RISC-V, the secondary harts must be notified of the change using IPIs. We can reuse the hart relocation code for this purpose. It uses global data to store the new stack pointer and global data pointer for the secondary harts. This means that we cannot update the global data pointer of the main hart in spl_relocate_stack_gd(), because the secondary harts have not yet been relocated at this point. It is updated after the secondary harts have been notified. Signed-off-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Anup Patel <anup.patel@wdc.com>
Diffstat (limited to 'common')
-rw-r--r--common/spl/spl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/spl/spl.c b/common/spl/spl.c
index 8c9415bedf..082fa2bd94 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -781,7 +781,7 @@ ulong spl_relocate_stack_gd(void)
#if CONFIG_IS_ENABLED(DM)
dm_fixup_for_gd_move(new_gd);
#endif
-#if !defined(CONFIG_ARM)
+#if !defined(CONFIG_ARM) && !defined(CONFIG_RISCV)
gd = new_gd;
#endif
return ptr;