include: sbi: Add macro definitions for mseccfg CSR
authorHimanshu Chauhan <hchauhan@ventanamicro.com>
Wed, 12 Jul 2023 04:34:27 +0000 (10:04 +0530)
committerAnup Patel <anup@brainfault.org>
Thu, 13 Jul 2023 06:39:34 +0000 (12:09 +0530)
- Add macros for Machine Security Configuration (mseccfg) CSR
- Add macros to access/manipulate bits in msecfg CSR

Signed-off-by: Himanshu Chauhan <hchauhan@ventanamicro.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
include/sbi/riscv_encoding.h

index 4ebed97ab0a0607cae52f777da4f38463e424fac..50071ad3e12e04dd4f4cdaac5d2bd4cbd054f551 100644 (file)
 #define CSR_MHPMEVENT30H               0x73e
 #define CSR_MHPMEVENT31H               0x73f
 
+/* Machine Security Configuration CSR (mseccfg) */
+#define CSR_MSECCFG_LOWER              0x747
+#define CSR_MSECCFG_UPPER              0x757
+#define CSR_MSECCFG                    (CSR_MSECCFG_LOWER)
+
+#define MSECCFG_MML_SHIFT              (0)
+#define MSECCFG_MML                    (_UL(1) << MSECCFG_MML_SHIFT)
+#define MSECCFG_MMWP_SHIFT             (1)
+#define MSECCFG_MMWP                   (_UL(1) << MSECCFG_MMWP_SHIFT)
+#define MSECCFG_RLB_SHIFT              (2)
+#define MSECCFG_RLB                    (_UL(1) << MSECCFG_RLB_SHIFT)
+
 /* Counter Overflow CSR */
 #define CSR_SCOUNTOVF                  0xda0