summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bsps/riscv/riscv/start/start.S5
1 files changed, 4 insertions, 1 deletions
diff --git a/bsps/riscv/riscv/start/start.S b/bsps/riscv/riscv/start/start.S
index 290c95a166..feb07feedf 100644
--- a/bsps/riscv/riscv/start/start.S
+++ b/bsps/riscv/riscv/start/start.S
@@ -48,9 +48,12 @@ SYM(_start):
LADDR gp, __global_pointer$
.option pop
- /* Init FPU unit if it's there */
+ /* Init FPU */
+#ifdef __riscv_flen
li t0, MSTATUS_FS
csrs mstatus, t0
+ csrw fcsr, zero
+#endif
/* Set exception handler */
LADDR t0, _RISCV_Exception_handler