Skip to content

Commit 8d62a38

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 (Bit 8) - ATTR_RISCV_TYPE_IO_W: Write access (Bit 9) - ATTR_RISCV_TYPE_IO_X: Execute access (Bit 10) 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 8d62a38

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
#define ATTR_RISCV_AMO_ARITHMETIC BIT(5)
2525
#define ATTR_RISCV_IO_IDEMPOTENT_READ BIT(6)
2626
#define ATTR_RISCV_IO_IDEMPOTENT_WRITE BIT(7)
27+
#define ATTR_RISCV_TYPE_IO_R BIT(8)
28+
#define ATTR_RISCV_TYPE_IO_W BIT(9)
29+
#define ATTR_RISCV_TYPE_IO_X 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,6 +36,9 @@
3336
#define DT_MEM_RISCV_AMO_ARITHMETIC DT_MEM_RISCV(ATTR_RISCV_AMO_ARITHMETIC)
3437
#define DT_MEM_RISCV_IO_IDEMPOTENT_READ DT_MEM_RISCV(ATTR_RISCV_IO_IDEMPOTENT_READ)
3538
#define DT_MEM_RISCV_IO_IDEMPOTENT_WRITE DT_MEM_RISCV(ATTR_RISCV_IO_IDEMPOTENT_WRITE)
39+
#define DT_MEM_RISCV_TYPE_IO_R DT_MEM_RISCV(ATTR_RISCV_TYPE_IO_R)
40+
#define DT_MEM_RISCV_TYPE_IO_W DT_MEM_RISCV(ATTR_RISCV_TYPE_IO_W)
41+
#define DT_MEM_RISCV_TYPE_IO_X DT_MEM_RISCV(ATTR_RISCV_TYPE_IO_X)
3642
#define DT_MEM_RISCV_UNKNOWN DT_MEM_ARCH_ATTR_UNKNOWN
3743

3844
#endif /* ZEPHYR_INCLUDE_DT_BINDINGS_MEM_ATTR_RISCV_H_ */

0 commit comments

Comments
 (0)