summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorXiang W <[email protected]>2026-01-04 13:18:10 +0800
committerAnup Patel <[email protected]>2026-02-20 11:23:13 +0530
commitecdb6c90c83dfc89964e55d7c2a94a5c0f6bc437 (patch)
tree047981e153e6123c8f970d6b17f297062cafa7ee /include
parentb27ecec76b8acfece9c28078d02cbc6bc762135c (diff)
firmware: Initialize stack guard via Zkr
Try to initialize stack protection guard via the zkr extension. Signed-off-by: Xiang W <[email protected]> Reviewed-by: Anup Patel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Anup Patel <[email protected]>
Diffstat (limited to 'include')
-rw-r--r--include/sbi/riscv_encoding.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/sbi/riscv_encoding.h b/include/sbi/riscv_encoding.h
index b5a4ce81..3c1d5256 100644
--- a/include/sbi/riscv_encoding.h
+++ b/include/sbi/riscv_encoding.h
@@ -261,6 +261,16 @@
#define CSR_FRM 0x002
#define CSR_FCSR 0x003
+/* User entropy source */
+#define CSR_SEED 0x015
+#define SEED_OPTS_SHIFT 30
+#define SEED_OPTS_MASK (_UL(3) << SEED_OPTS_SHIFT)
+#define SEED_OPTS_BIST (_UL(0) << SEED_OPTS_SHIFT)
+#define SEED_OPTS_WAIT (_UL(1) << SEED_OPTS_SHIFT)
+#define SEED_OPTS_ES16 (_UL(2) << SEED_OPTS_SHIFT)
+#define SEED_OPTS_DEAD (_UL(3) << SEED_OPTS_SHIFT)
+#define SEED_ENTROPY_MASK 0xffff
+
/* User Counters/Timers */
#define CSR_CYCLE 0xc00
#define CSR_TIME 0xc01