aboutsummaryrefslogtreecommitdiff
path: root/arch/riscv64/kernel/core_bringup.S
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2024-10-30 16:23:15 +0200
committerKimplul <kimi.h.kuparinen@gmail.com>2024-11-01 10:27:51 +0200
commitd5e5afae9249da312b417bc4f5f45ac164404846 (patch)
tree91c486085c6e9618ae4acd1e18aae5d4fe627d04 /arch/riscv64/kernel/core_bringup.S
parentdc71f4f38f49ed3a3b67098b7926a0731e9ce225 (diff)
downloadkmi-d5e5afae9249da312b417bc4f5f45ac164404846.tar.gz
kmi-d5e5afae9249da312b417bc4f5f45ac164404846.zip
smp on visionfive2 'works'
Diffstat (limited to 'arch/riscv64/kernel/core_bringup.S')
-rw-r--r--arch/riscv64/kernel/core_bringup.S4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/riscv64/kernel/core_bringup.S b/arch/riscv64/kernel/core_bringup.S
index 8a5a6f5..db68dce 100644
--- a/arch/riscv64/kernel/core_bringup.S
+++ b/arch/riscv64/kernel/core_bringup.S
@@ -1,3 +1,4 @@
+#include "../kernel/csr.h"
#include "asm.h"
/* pic forces core_bringup to be placed in .got that we can access both from
@@ -11,6 +12,9 @@ riscv_bringup:
csrw satp, a1
sfence.vma
+ /* set scratch to zero in case we crash */
+ csrw CSR_SSCRATCH, x0
+
/* fetch the stack allocated to us at our hart index in smp_init_stacks */
lui t0, %hi(smp_init_stacks)
addi t0, t0, %lo(smp_init_stacks)