Skip to content

Commit 22c1bbe

Browse files
committed
dt-bindings: riscv: Add fine-grained IO memory PMP attributes
Introduce new macros to define bitfields for RISC-V Physical Memory Protection (PMP) attributes, specifically for specifying Read, Write, and Execute permissions for IO memory regions in device tree bindings. The following macros are added: - ATTR_RISCV_TYPE_IO_R: Read access - ATTR_RISCV_TYPE_IO_W: Write access - ATTR_RISCV_TYPE_IO_X: Execute access Corresponding macros for device tree usage are also added: - DT_MEM_RISCV_TYPE_IO_R - DT_MEM_RISCV_TYPE_IO_W - DT_MEM_RISCV_TYPE_IO_X These macros allow device tree source files to precisely describe the intended access permissions for memory-mapped IO regions, enhancing the system's memory protection configuration. Signed-off-by: Firas Sammoura <[email protected]>
1 parent 9ada047 commit 22c1bbe

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

include/zephyr/dt-bindings/memory-attr/memory-attr-riscv.h

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,21 @@
1818

1919
#define ATTR_RISCV_TYPE_MAIN BIT(0)
2020
#define ATTR_RISCV_TYPE_IO BIT(1)
21-
#define ATTR_RISCV_TYPE_EMPTY BIT(2)
22-
#define ATTR_RISCV_AMO_SWAP BIT(3)
23-
#define ATTR_RISCV_AMO_LOGICAL BIT(4)
24-
#define ATTR_RISCV_AMO_ARITHMETIC BIT(5)
25-
#define ATTR_RISCV_IO_IDEMPOTENT_READ BIT(6)
26-
#define ATTR_RISCV_IO_IDEMPOTENT_WRITE BIT(7)
21+
#define ATTR_RISCV_TYPE_IO_R BIT(2)
22+
#define ATTR_RISCV_TYPE_IO_W BIT(3)
23+
#define ATTR_RISCV_TYPE_IO_X BIT(4)
24+
#define ATTR_RISCV_TYPE_EMPTY BIT(5)
25+
#define ATTR_RISCV_AMO_SWAP BIT(6)
26+
#define ATTR_RISCV_AMO_LOGICAL BIT(7)
27+
#define ATTR_RISCV_AMO_ARITHMETIC BIT(8)
28+
#define ATTR_RISCV_IO_IDEMPOTENT_READ BIT(9)
29+
#define ATTR_RISCV_IO_IDEMPOTENT_WRITE BIT(10)
2730

2831
#define DT_MEM_RISCV_TYPE_MAIN DT_MEM_RISCV(ATTR_RISCV_TYPE_MAIN)
2932
#define DT_MEM_RISCV_TYPE_IO DT_MEM_RISCV(ATTR_RISCV_TYPE_IO)
33+
#define DT_MEM_RISCV_TYPE_IO_R DT_MEM_RISCV(ATTR_RISCV_TYPE_IO_R)
34+
#define DT_MEM_RISCV_TYPE_IO_W DT_MEM_RISCV(ATTR_RISCV_TYPE_IO_W)
35+
#define DT_MEM_RISCV_TYPE_IO_X DT_MEM_RISCV(ATTR_RISCV_TYPE_IO_X)
3036
#define DT_MEM_RISCV_TYPE_EMPTY DT_MEM_RISCV(ATTR_RISCV_TYPE_EMPTY)
3137
#define DT_MEM_RISCV_AMO_SWAP DT_MEM_RISCV(ATTR_RISCV_AMO_SWAP)
3238
#define DT_MEM_RISCV_AMO_LOGICAL DT_MEM_RISCV(ATTR_RISCV_AMO_LOGICAL)

0 commit comments

Comments
 (0)