RISC-V PMP configuration options. More...
RISC-V PMP configuration options.
RISCV implementations using this peripheral must define the NUM_PMP_ENTRIES
NUM_PMP_ENTRIES
must be 16 or 64.
Definition in file pmp.h.
Go to the source code of this file.
Functions | |
static uint32_t | make_napot (uint32_t addr, uint32_t size) |
Create a NAPOT formatted address. | |
void | write_pmpcfg (uint8_t reg_num, uint32_t value) |
Writes a complete pmpcfg register. | |
uint32_t | read_pmpcfg (uint8_t reg_num) |
Read a complete pmpcfg register. | |
void | write_pmpaddr (uint8_t reg_num, uint32_t value) |
Writes a complete pmpaddr register. | |
uint32_t | read_pmpaddr (uint8_t reg_num) |
Read a complete pmpaddr register. | |
uint8_t | get_pmpcfg (uint8_t entry) |
Read a single pmpcfg sub-register. | |
void | set_pmpcfg (uint8_t entry, uint8_t value) |
Set's a single pmpcfg sub-register. | |
void | print_pmpcfg (uint8_t entry) |
Prints a single pmpcfg sub-register human readable. | |
Bit masks for the PMP configuration register | |
#define | PMP_NONE 0x00 |
No access allowed at all. | |
#define | PMP_R 0x01 |
Allow read access. | |
#define | PMP_W 0x02 |
Allow write access. | |
#define | PMP_X 0x04 |
Allow execution. | |
#define | PMP_A 0x18 |
Addressing mode mask. | |
#define | PMP_OFF 0x00 |
Disable this pmp entry. | |
#define | PMP_TOR 0x08 |
Top-of-range addressing mode. | |
#define | PMP_NA4 0x10 |
Naturally aligned four-byte region. | |
#define | PMP_NAPOT 0x18 |
Naturally aligned power-of-two region, ≥8 bytes. | |
#define | PMP_L 0x80 |
Lock; read-only config & applies to machine-mode. | |
#define PMP_L 0x80 |
#define PMP_NAPOT 0x18 |
uint8_t get_pmpcfg | ( | uint8_t | entry | ) |
Read a single pmpcfg sub-register.
[in] | entry | Sub-register number |
|
inlinestatic |
void print_pmpcfg | ( | uint8_t | entry | ) |
Prints a single pmpcfg sub-register human readable.
entry | Register number to print |
uint32_t read_pmpaddr | ( | uint8_t | reg_num | ) |
Read a complete pmpaddr register.
[in] | reg_num | Register number |
uint32_t read_pmpcfg | ( | uint8_t | reg_num | ) |
Read a complete pmpcfg register.
[in] | reg_num | Register number |
void set_pmpcfg | ( | uint8_t | entry, |
uint8_t | value | ||
) |
Set's a single pmpcfg sub-register.
entry | Sub-register number |
value | Value to write |
void write_pmpaddr | ( | uint8_t | reg_num, |
uint32_t | value | ||
) |
Writes a complete pmpaddr register.
reg_num | Register number |
value | Value to write |
void write_pmpcfg | ( | uint8_t | reg_num, |
uint32_t | value | ||
) |
Writes a complete pmpcfg register.
reg_num | Register number |
value | Value to write |