From fd4b66ff12e00cf34317ef067b040d1b00fed51d Mon Sep 17 00:00:00 2001 From: Gedare Bloom Date: Tue, 3 Mar 2026 14:00:19 -0700 Subject: [PATCH] riscv/riscv: use shutdown SBI in s-mode Updates #3337 --- bsps/riscv/riscv/start/bsp_fatal_halt.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bsps/riscv/riscv/start/bsp_fatal_halt.c b/bsps/riscv/riscv/start/bsp_fatal_halt.c index a9df4bcf4a..86e19cafc0 100644 --- a/bsps/riscv/riscv/start/bsp_fatal_halt.c +++ b/bsps/riscv/riscv/start/bsp_fatal_halt.c @@ -33,6 +33,10 @@ #include +#ifdef RISCV_USE_S_MODE +#include +#endif + void bsp_reset( rtems_fatal_source source, rtems_fatal_code code ) { const char *fdt; @@ -55,6 +59,10 @@ void bsp_reset( rtems_fatal_source source, rtems_fatal_code code ) for(;;); #endif +#ifdef RISCV_USE_S_MODE + sbi_system_reset(SBI_SRST_TYPE_SHUTDOWN, SBI_SRST_REASON_NONE); +#endif + node = fdt_node_offset_by_compatible(fdt, -1, "sifive,test0"); sifive_test = riscv_fdt_get_address(fdt, node);