#include "hpm_common.h"
#include "hpm_soc_feature.h"
Go to the source code of this file.
◆ ADDR_MATCH_MODE_OFF
| #define ADDR_MATCH_MODE_OFF (0U) |
◆ ADDR_MATCH_NAPOT
| #define ADDR_MATCH_NAPOT (3U) |
◆ ADDR_MATCH_TOR
| #define ADDR_MATCH_TOR (1U) |
◆ AMO_DIS
◆ AMO_EN
◆ EXECUTE_DIS
◆ EXECUTE_EN
◆ MEM_TYPE_DEV_BUF
| #define MEM_TYPE_DEV_BUF (1U) |
◆ MEM_TYPE_DEV_NON_BUF
| #define MEM_TYPE_DEV_NON_BUF (0U) |
PMA Configuration definitions.
◆ MEM_TYPE_EMPTY_HOLE
| #define MEM_TYPE_EMPTY_HOLE (15U) |
◆ MEM_TYPE_MEM_NON_CACHE_BUF
| #define MEM_TYPE_MEM_NON_CACHE_BUF (3U) |
◆ MEM_TYPE_MEM_NON_CACHE_NON_BUF
| #define MEM_TYPE_MEM_NON_CACHE_NON_BUF (2U) |
◆ MEM_TYPE_MEM_WB_NO_ALLOC
| #define MEM_TYPE_MEM_WB_NO_ALLOC (8U) |
◆ MEM_TYPE_MEM_WB_READ_ALLOC
| #define MEM_TYPE_MEM_WB_READ_ALLOC (9U) |
◆ MEM_TYPE_MEM_WB_READ_WRITE_ALLOC
| #define MEM_TYPE_MEM_WB_READ_WRITE_ALLOC (11U) |
◆ MEM_TYPE_MEM_WB_WRITE_ALLOC
| #define MEM_TYPE_MEM_WB_WRITE_ALLOC (10U) |
◆ MEM_TYPE_MEM_WT_NO_ALLOC
| #define MEM_TYPE_MEM_WT_NO_ALLOC (4U) |
◆ MEM_TYPE_MEM_WT_READ_ALLOC
| #define MEM_TYPE_MEM_WT_READ_ALLOC (5U) |
◆ PMA_CFG
| #define PMA_CFG |
( |
|
m, |
|
|
|
t, |
|
|
|
n |
|
) |
| ((m) | ((t) << 2) | ((n) << 6)) |
PMA Configuration.
- Parameters
-
| m | - Entry address matching mode, valid value: ADDR_MATCH_MODE_OFF - This PMA entry is disabled ADDR_MATCH_NAPOT - Naturally aligned power-of-2 region, the granularity is 4K bytes |
| t | - Memory type attributes, valid value: MEM_TYPE_DEV_NON_BUF - Device, Non-bufferable MEM_TYPE_DEV_BUF - Device, bufferable MEM_TYPE_MEM_NON_CACHE_NON_BUF - Memory, Non-cacheable, Non-bufferable MEM_TYPE_MEM_NON_CACHE_BUF - Memory, Non-cacheable, bufferable MEM_TYPE_MEM_WT_NO_ALLOC - Memory, Write-through, No-allocate MEM_TYPE_MEM_WT_READ_ALLOC - Memory, Write-through, read-allocate MEM_TYPE_MEM_WB_NO_ALLOC - Memory, Write-back, No-allocate MEM_TYPE_MEM_WB_READ_ALLOC - Memory, Write-back, Read-allocate MEM_TYPE_MEM_WB_READ_WRITE_ALLOC - Memory, Write-back, Write-Allocate, Read-Allocate MEM_TYPE_EMPTY_HOLE - Empty hole, nothing exists |
| n | - Indicate Whether Atomic Memory Operation instructions are not supported in this region, valid value: AMO_EN - Atomic Memory Operations are supported AMO_DIS - Atomic Memory Operations are not supported |
◆ PMA_NAPOT_ADDR
| #define PMA_NAPOT_ADDR |
( |
|
x, |
|
|
|
n |
|
) |
| (((uint32_t)(x) >> 2) | ((((uint32_t)(n)-1U) >> 3))) |
Format PMA Natural Aligned Region.
- Parameters
-
| x | - start address |
| n | - power-of-2 aligned length |
◆ PMP_CFG
| #define PMP_CFG |
( |
|
r, |
|
|
|
w, |
|
|
|
x, |
|
|
|
m, |
|
|
|
l |
|
) |
| ((r) | ((w) << 1) | ((x) << 2) | ((m) << 3) | ((l) << 7)) |
PMP Configuration.
- Parameters
-
| r | - READ Access control, valid value: READ_EN, READ_DIS |
| w | - Write access control, valid value: WRITE_EN, WRITE_DIS |
| x | - Instruction Execution control, valid value: EXECUTE_EN, EXECUTE_DIS |
| m | - Address matching mode, valid value: ADDR_MATCH_MODE_OFF - Null region ADDR_MATCH_TOR - Top of range. For pmp_addr0, any address < pmp_addr0 matches, for other regions, any address which meets ( pmp_addr[i-1] <= addr < pmp_addr) matches. ADDR_MATCH_NAPOT - Naturally aligned power-of-2 region, minimal size must be 8 bytes |
| l | - Write lock and permission enforcement bit for Machine mode, valid value: REG_LOCK, REG_UNLOCK |
◆ PMP_NAPOT_ADDR
| #define PMP_NAPOT_ADDR |
( |
|
x, |
|
|
|
n |
|
) |
| (((uint32_t)(x) >> 2) | (((uint32_t)(n)-1U) >> 3)) |
Format PMP Natural Aligned Region.
- Parameters
-
| x | - start address |
| n | - power-of-2 aligned length |
◆ PMP_TOR_ADDR
| #define PMP_TOR_ADDR |
( |
|
addr | ) |
((addr) >> 2) |
Format Top Address Region.
◆ READ_DIS
◆ READ_EN
PMP Configuration definitions.
◆ REG_LOCK
◆ REG_UNLOCK
◆ WRITE_DIS
◆ WRITE_EN
◆ pmp_entry_t
◆ pmp_config()
Configure PMP and PMA based on the PMP entry list.
- Parameters
-
| entry | start of the PMP entry list |
| num_of_entries | Number of entries in the PMP entry list |
- Return values
-
| status_invalid_argument | Invalid Arguments were detected |
| status_success | Configuration completed without errors |
◆ pmp_config_entry()
Configure PMP and PMA for specified PMP/PMA entry.
- Parameters
-
| [in] | entry | PMP entry |
| entry_index | PMP/PMA entry index |
- Return values
-
| status_invalid_argument | Invalid Arguments were detected |
| status_success | Configuration completed without errors |
◆ pmp_disable()
| void pmp_disable |
( |
void |
| ) |
|
◆ read_pma_addr()
| uint32_t read_pma_addr |
( |
uint32_t |
idx | ) |
|
Read PMA address entry.
- Parameters
-
| idx | PMA address entry index, valid value is 0-15 |
- Returns
- PMA address
◆ read_pma_cfg()
| uint32_t read_pma_cfg |
( |
uint32_t |
idx | ) |
|
Read PMA configuration.
- Parameters
-
- Returns
- PMA configuration
◆ read_pmp_addr()
| uint32_t read_pmp_addr |
( |
uint32_t |
idx | ) |
|
Read PMP address entry.
- Parameters
-
| idx | PMP address entry index |
- Returns
- PMP address
◆ read_pmp_cfg()
| uint32_t read_pmp_cfg |
( |
uint32_t |
idx | ) |
|
Read PMP configuration.
- Parameters
-
- Returns
- PMP configuration
◆ write_pma_addr()
| void write_pma_addr |
( |
uint32_t |
value, |
|
|
uint32_t |
idx |
|
) |
| |
Write PMA address to corresponding PMA_ADDR register.
- Parameters
-
| value | PMA address |
| idx | PMA address entry index, valid value is 0-15 |
◆ write_pma_cfg()
| void write_pma_cfg |
( |
uint32_t |
value, |
|
|
uint32_t |
idx |
|
) |
| |
Write PMA Configuration to corresponding PMA_CFG register.
- Parameters
-
| value | PMA configuration |
| idx | PMA entry index, valid value is 0-15 |
◆ write_pmp_addr()
| void write_pmp_addr |
( |
uint32_t |
value, |
|
|
uint32_t |
idx |
|
) |
| |
Write PMP address to corresponding PMP_ADDR register.
- Parameters
-
| value | PMP address |
| idx | PMP address entry index, valid value is 0-15 |
◆ write_pmp_cfg()
| void write_pmp_cfg |
( |
uint32_t |
value, |
|
|
uint32_t |
idx |
|
) |
| |
Write PMP Configuration to corresponding PMP_CFG register.
- Parameters
-
| value | PMP configuration |
| idx | PMP entry index, valid value is 0-15 |