From 6c121d0a5d0f6812d915e4323c24ac1ac5d5dec9 Mon Sep 17 00:00:00 2001 From: Nikita Shubin Date: Fri, 20 May 2022 14:41:17 +0300 Subject: [PATCH] riscv: cpu: set gp before board_init_f_init_reserve Restore global pointer before board_init_f_init_reserve call, as "a0" can be set in harts_early_init call and we end up with invalid global pointer. Signed-off-by: Nikita Shubin Reviewed-by: Leo Yu-Chi Liang --- arch/riscv/cpu/start.S | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/riscv/cpu/start.S b/arch/riscv/cpu/start.S index f2ef5564a1..ac81783a90 100644 --- a/arch/riscv/cpu/start.S +++ b/arch/riscv/cpu/start.S @@ -143,6 +143,7 @@ call_harts_early_init: bnez tp, secondary_hart_loop #endif + mv a0, s0 jal board_init_f_init_reserve SREG s1, GD_FIRMWARE_FDT_ADDR(gp) -- 2.39.5