This patch adds SBI SRST extension defines and sync-up with
OpenSBI sbi_ecall_interface.h header.
Signed-off-by: Anup Patel <
an...@brainfault.org>
---
arch/riscv/cpu/generic/include/riscv_sbi.h | 39 ++++++++++++++--------
1 file changed, 26 insertions(+), 13 deletions(-)
diff --git a/arch/riscv/cpu/generic/include/riscv_sbi.h b/arch/riscv/cpu/generic/include/riscv_sbi.h
index afc72df1..7dca352a 100644
--- a/arch/riscv/cpu/generic/include/riscv_sbi.h
+++ b/arch/riscv/cpu/generic/include/riscv_sbi.h
@@ -27,7 +27,7 @@
#include <vmm_const.h>
/* SBI Extension IDs */
-#define SBI_EXT_0_1_SET_TIMER 0x0
+#define SBI_EXT_0_1_SET_TIMER 0x0
#define SBI_EXT_0_1_CONSOLE_PUTCHAR 0x1
#define SBI_EXT_0_1_CONSOLE_GETCHAR 0x2
#define SBI_EXT_0_1_CLEAR_IPI 0x3
@@ -41,19 +41,16 @@
#define SBI_EXT_IPI 0x735049
#define SBI_EXT_RFENCE 0x52464E43
#define SBI_EXT_HSM 0x48534D
+#define SBI_EXT_SRST 0x53525354
/* SBI function IDs for BASE extension */
#define SBI_EXT_BASE_GET_SPEC_VERSION 0x0
#define SBI_EXT_BASE_GET_IMP_ID 0x1
-#define SBI_EXT_BASE_GET_IMP_VERSION 0x2
-#define SBI_EXT_BASE_PROBE_EXT 0x3
-#define SBI_EXT_BASE_GET_MVENDORID 0x4
-#define SBI_EXT_BASE_GET_MARCHID 0x5
-#define SBI_EXT_BASE_GET_MIMPID 0x6
-
-#define SBI_SPEC_VERSION_MAJOR_SHIFT 24
-#define SBI_SPEC_VERSION_MAJOR_MASK 0x7f
-#define SBI_SPEC_VERSION_MINOR_MASK 0xffffff
+#define SBI_EXT_BASE_GET_IMP_VERSION 0x2
+#define SBI_EXT_BASE_PROBE_EXT 0x3
+#define SBI_EXT_BASE_GET_MVENDORID 0x4
+#define SBI_EXT_BASE_GET_MARCHID 0x5
+#define SBI_EXT_BASE_GET_MIMPID 0x6
/* SBI function IDs for TIME extension */
#define SBI_EXT_TIME_SET_TIMER 0x0
@@ -62,7 +59,7 @@
#define SBI_EXT_IPI_SEND_IPI 0x0
/* SBI function IDs for RFENCE extension */
-#define SBI_EXT_RFENCE_REMOTE_FENCE_I 0x0
+#define SBI_EXT_RFENCE_REMOTE_FENCE_I 0x0
#define SBI_EXT_RFENCE_REMOTE_SFENCE_VMA 0x1
#define SBI_EXT_RFENCE_REMOTE_SFENCE_VMA_ASID 0x2
#define SBI_EXT_RFENCE_REMOTE_HFENCE_GVMA 0x3
@@ -77,11 +74,27 @@
#define SBI_HSM_HART_STATUS_STARTED 0x0
#define SBI_HSM_HART_STATUS_STOPPED 0x1
-#define SBI_HSM_HART_STATUS_START_PENDING 0x2
-#define SBI_HSM_HART_STATUS_STOP_PENDING 0x3
+#define SBI_HSM_HART_STATUS_START_PENDING 0x2
+#define SBI_HSM_HART_STATUS_STOP_PENDING 0x3
+
+/* SBI function IDs for SRST extension */
+#define SBI_EXT_SRST_RESET 0x0
+#define SBI_SRST_RESET_TYPE_SHUTDOWN 0x0
+#define SBI_SRST_RESET_TYPE_COLD_REBOOT 0x1
+#define SBI_SRST_RESET_TYPE_WARM_REBOOT 0x2
+#define SBI_SRST_RESET_TYPE_LAST SBI_SRST_RESET_TYPE_WARM_REBOOT
+
+#define SBI_SRST_RESET_REASON_NONE 0x0
+#define SBI_SRST_RESET_REASON_SYSFAIL 0x1
+
+#define SBI_SPEC_VERSION_MAJOR_SHIFT 24
+#define SBI_SPEC_VERSION_MAJOR_MASK 0x7f
+#define SBI_SPEC_VERSION_MINOR_MASK 0xffffff
#define SBI_EXT_VENDOR_START 0x09000000
#define SBI_EXT_VENDOR_END 0x09FFFFFF
+#define SBI_EXT_FIRMWARE_START 0x0A000000
+#define SBI_EXT_FIRMWARE_END 0x0AFFFFFF
/* SBI return error codes */
#define SBI_SUCCESS 0
--
2.25.1