You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
arch/riscv: Add API to control write permission for custom PMP entry
Introduce the `riscv_pmp_set_write_permission()` API to dynamically
control the write access to memory regions protected by the RISC-V
Physical Memory Protection (PMP) unit.
This function enables or disables the Write (W) bit in the PMP
configuration register (pmpcfg) for a specific region. The region
is identified by an index (`region_idx`) referencing the list of
memory regions defined in the Device Tree with the "zephyr,memattr"
property.
This API is particularly useful for security-sensitive applications,
such as protecting critical flash sections like firmware rollback
data from accidental or unauthorized writes, while allowing writes
only during specific, controlled operations.
The current implementation supports systems with up to 8 PMP slots
(CONFIG_PMP_SLOTS <= 8) due to the method used to access pmpcfg
registers.
Signed-off-by: Firas Sammoura <[email protected]>
0 commit comments