Commit 7bf83a8
committed
arch: riscv: Allow skipping default ROM PMP entry
The `z_riscv_pmp_init` function currently includes a standard PMP entry
to mark the ROM region (`__rom_region_start` to `__rom_region_size`)
as read-only and executable (PMP_R | PMP_X | PMP_L).
This change wraps the setup of this default ROM PMP entry with
`#ifndef CONFIG_CUSTOM_PMP_ENTRY`.
If `CONFIG_CUSTOM_PMP_ENTRY` is set, this default ROM entry configuration
is skipped. This allows projects, SoCs, or board configurations to
provide a completely custom PMP layout starting from the first entry
from the device tree based on `zephyr,memattr`. This might be necessary
for specialized memory protection schemes or to override the default
ROM region attributes.
Signed-off-by: Firas Sammoura <[email protected]>1 parent 8d2fdae commit 7bf83a8
1 file changed
+4
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
368 | 368 | | |
369 | 369 | | |
370 | 370 | | |
| 371 | + | |
| 372 | + | |
371 | 373 | | |
372 | 374 | | |
373 | 375 | | |
374 | 376 | | |
375 | 377 | | |
376 | 378 | | |
| 379 | + | |
| 380 | + | |
377 | 381 | | |
378 | 382 | | |
379 | 383 | | |
| |||
0 commit comments