riscv: fix scratch register clearing in M-mode.

This patch fixes that the sscratch register clearing in M-mode. It cleared
sscratch register in M-mode, but it should clear mscratch register. That will
cause kernel trap if the CPU core doesn't support S-mode when trying to access
sscratch.

Fixes: 9e80635619b5 ("riscv: clear the instruction cache and all registers when booting")
Signed-off-by: Greentime Hu <greentime.hu@sifive.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Signed-off-by: Paul Walmsley <paul.walmsley@sifive.com>

authored by Greentime Hu and committed by Paul Walmsley d411cf02 0312a3d4

+1 -1
+1 -1
arch/riscv/kernel/head.S
··· 246 246 li t4, 0 247 247 li t5, 0 248 248 li t6, 0 249 - csrw sscratch, 0 249 + csrw CSR_SCRATCH, 0 250 250 251 251 #ifdef CONFIG_FPU 252 252 csrr t0, CSR_MISA