From d5e5afae9249da312b417bc4f5f45ac164404846 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Wed, 30 Oct 2024 16:23:15 +0200 Subject: smp on visionfive2 'works' --- arch/riscv64/kernel/core_bringup.S | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'arch/riscv64/kernel/core_bringup.S') 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) -- cgit v1.3