summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Auer <lukas.auer@aisec.fraunhofer.de>2019-03-17 19:28:40 +0100
committerAndes <uboot@andestech.com>2019-04-08 09:44:26 +0800
commit8ac39e2974d9f1395969a500e692f45717c4ccf2 (patch)
tree7e62620c73fe0967ed9f46f28bb4d2123e8cdce3
parente04324025275dee6e3e9a968c8d12e98c9b47567 (diff)
riscv: hang if relocation of secondary harts fails
Print an error message and hang if smp_call_function() returns an error, indicating that relocation of the secondary harts has failed. 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>
-rw-r--r--arch/riscv/cpu/start.S13
1 files changed, 12 insertions, 1 deletions
diff --git a/arch/riscv/cpu/start.S b/arch/riscv/cpu/start.S
index 5ac899b141..a4433fbd6b 100644
--- a/arch/riscv/cpu/start.S
+++ b/arch/riscv/cpu/start.S
@@ -33,6 +33,10 @@
#define SYM_SIZE 0x18
#endif
+.section .data
+secondary_harts_relocation_error:
+ .ascii "Relocation of secondary harts has failed, error %d\n"
+
.section .text
.globl _start
_start:
@@ -274,8 +278,15 @@ relocate_secondary_harts:
mv a2, s3
jal smp_call_function
+ /* hang if relocation of secondary harts has failed */
+ beqz a0, 1f
+ mv a1, a0
+ la a0, secondary_harts_relocation_error
+ jal printf
+ jal hang
+
/* restore relocation offset */
- mv t6, s5
+1: mv t6, s5
#endif
/*