Zephyr Project API 4.0.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
nxp_mpu.h File Reference

Go to the source code of this file.

Data Structures

struct  nxp_mpu_region_attr
 
struct  k_mem_partition_attr_t
 
struct  nxp_mpu_region
 
struct  nxp_mpu_config
 

Macros

#define NXP_MPU_REGION_NUMBER   12
 
#define UM_READ   4
 
#define UM_WRITE   2
 
#define UM_EXEC   1
 
#define BM0_UM_SHIFT   0
 
#define BM1_UM_SHIFT   6
 
#define BM2_UM_SHIFT   12
 
#define BM3_UM_SHIFT   18
 
#define SM_RWX_ALLOW   0
 
#define SM_RX_ALLOW   1
 
#define SM_RW_ALLOW   2
 
#define SM_SAME_AS_UM   3
 
#define BM0_SM_SHIFT   3
 
#define BM1_SM_SHIFT   9
 
#define BM2_SM_SHIFT   15
 
#define BM3_SM_SHIFT   21
 
#define BM4_WE_SHIFT   24
 
#define BM4_RE_SHIFT   25
 
#define BM4_PERMISSIONS   0
 
#define MPU_REGION_READ
 
#define MPU_REGION_WRITE
 
#define MPU_REGION_EXEC
 
#define MPU_REGION_SU
 
#define MPU_REGION_SU_RX
 
#define MPU_REGION_SU_RW
 
#define MPU_REGION_SU_RWX
 
#define ENDADDR_ROUND(x)   (x - 0x1F)
 
#define REGION_USER_MODE_ATTR
 
#define REGION_RAM_ATTR
 
#define REGION_FLASH_ATTR
 
#define REGION_IO_ATTR
 
#define REGION_RO_ATTR   {(MPU_REGION_READ | MPU_REGION_SU)}
 
#define REGION_USER_RO_ATTR
 
#define REGION_DEBUGGER_AND_DEVICE_ATTR
 
#define REGION_DEBUG_ATTR   {MPU_REGION_SU}
 
#define REGION_BACKGROUND_ATTR   {MPU_REGION_SU_RW}
 
#define K_MEM_PARTITION_P_NA_U_NA
 
#define K_MEM_PARTITION_P_RW_U_RW
 
#define K_MEM_PARTITION_P_RW_U_RO
 
#define K_MEM_PARTITION_P_RW_U_NA
 
#define K_MEM_PARTITION_P_RO_U_RO
 
#define K_MEM_PARTITION_P_RO_U_NA
 
#define K_MEM_PARTITION_P_RWX_U_RWX
 
#define K_MEM_PARTITION_P_RWX_U_RX
 
#define K_MEM_PARTITION_P_RX_U_RX
 
#define K_MEM_PARTITION_IS_WRITABLE(attr)
 
#define K_MEM_PARTITION_IS_EXECUTABLE(attr)
 
#define MPU_REGION_ENTRY(_name, _base, _end, _attr)
 

Typedefs

typedef struct nxp_mpu_region_attr nxp_mpu_region_attr_t
 

Variables

const struct nxp_mpu_config mpu_config
 

Macro Definition Documentation

◆ BM0_SM_SHIFT

#define BM0_SM_SHIFT   3

◆ BM0_UM_SHIFT

#define BM0_UM_SHIFT   0

◆ BM1_SM_SHIFT

#define BM1_SM_SHIFT   9

◆ BM1_UM_SHIFT

#define BM1_UM_SHIFT   6

◆ BM2_SM_SHIFT

#define BM2_SM_SHIFT   15

◆ BM2_UM_SHIFT

#define BM2_UM_SHIFT   12

◆ BM3_SM_SHIFT

#define BM3_SM_SHIFT   21

◆ BM3_UM_SHIFT

#define BM3_UM_SHIFT   18

◆ BM4_PERMISSIONS

#define BM4_PERMISSIONS   0

◆ BM4_RE_SHIFT

#define BM4_RE_SHIFT   25

◆ BM4_WE_SHIFT

#define BM4_WE_SHIFT   24

◆ ENDADDR_ROUND

#define ENDADDR_ROUND (   x)    (x - 0x1F)

◆ K_MEM_PARTITION_IS_EXECUTABLE

#define K_MEM_PARTITION_IS_EXECUTABLE (   attr)
Value:
({ \
int __is_executable__; \
switch (attr.ap_attr) { \
__is_executable__ = 1; \
break; \
default: \
__is_executable__ = 0; \
} \
__is_executable__; \
})
#define MPU_REGION_SU_RX
Definition nxp_mpu.h:67
#define MPU_REGION_EXEC
Definition nxp_mpu.h:56

◆ K_MEM_PARTITION_IS_WRITABLE

#define K_MEM_PARTITION_IS_WRITABLE (   attr)
Value:
({ \
int __is_writable__; \
switch (attr.ap_attr) { \
__is_writable__ = 1; \
break; \
default: \
__is_writable__ = 0; \
} \
__is_writable__; \
})
#define MPU_REGION_WRITE
Definition nxp_mpu.h:50
#define MPU_REGION_SU_RW
Definition nxp_mpu.h:72

◆ K_MEM_PARTITION_P_NA_U_NA

#define K_MEM_PARTITION_P_NA_U_NA
Value:
#define MPU_REGION_SU
Definition nxp_mpu.h:62
Definition arm_mpu_v7m.h:160

◆ K_MEM_PARTITION_P_RO_U_NA

#define K_MEM_PARTITION_P_RO_U_NA

◆ K_MEM_PARTITION_P_RO_U_RO

#define K_MEM_PARTITION_P_RO_U_RO
Value:
#define MPU_REGION_READ
Definition nxp_mpu.h:44

◆ K_MEM_PARTITION_P_RW_U_NA

#define K_MEM_PARTITION_P_RW_U_NA

◆ K_MEM_PARTITION_P_RW_U_RO

#define K_MEM_PARTITION_P_RW_U_RO

◆ K_MEM_PARTITION_P_RW_U_RW

#define K_MEM_PARTITION_P_RW_U_RW

◆ K_MEM_PARTITION_P_RWX_U_RWX

#define K_MEM_PARTITION_P_RWX_U_RWX

◆ K_MEM_PARTITION_P_RWX_U_RX

#define K_MEM_PARTITION_P_RWX_U_RX
Value:
#define MPU_REGION_SU_RWX
Definition nxp_mpu.h:77

◆ K_MEM_PARTITION_P_RX_U_RX

#define K_MEM_PARTITION_P_RX_U_RX

◆ MPU_REGION_ENTRY

#define MPU_REGION_ENTRY (   _name,
  _base,
  _end,
  _attr 
)
Value:
{\
.name = _name, \
.base = _base, \
.end = _end, \
.attr = _attr, \
}

◆ MPU_REGION_EXEC

#define MPU_REGION_EXEC
Value:
#define BM3_UM_SHIFT
Definition nxp_mpu.h:21
#define BM2_UM_SHIFT
Definition nxp_mpu.h:20
#define BM0_UM_SHIFT
Definition nxp_mpu.h:18
#define BM1_UM_SHIFT
Definition nxp_mpu.h:19
#define UM_EXEC
Definition nxp_mpu.h:16

◆ MPU_REGION_READ

#define MPU_REGION_READ
Value:
#define UM_READ
Definition nxp_mpu.h:14

◆ MPU_REGION_SU

#define MPU_REGION_SU
Value:
#define BM2_SM_SHIFT
Definition nxp_mpu.h:31
#define BM0_SM_SHIFT
Definition nxp_mpu.h:29
#define SM_SAME_AS_UM
Definition nxp_mpu.h:27
#define BM1_SM_SHIFT
Definition nxp_mpu.h:30
#define BM3_SM_SHIFT
Definition nxp_mpu.h:32

◆ MPU_REGION_SU_RW

#define MPU_REGION_SU_RW
Value:
#define SM_RW_ALLOW
Definition nxp_mpu.h:26

◆ MPU_REGION_SU_RWX

#define MPU_REGION_SU_RWX
Value:
#define SM_RWX_ALLOW
Definition nxp_mpu.h:24

◆ MPU_REGION_SU_RX

#define MPU_REGION_SU_RX
Value:
#define SM_RX_ALLOW
Definition nxp_mpu.h:25

◆ MPU_REGION_WRITE

#define MPU_REGION_WRITE
Value:
#define UM_WRITE
Definition nxp_mpu.h:15

◆ NXP_MPU_REGION_NUMBER

#define NXP_MPU_REGION_NUMBER   12

◆ REGION_BACKGROUND_ATTR

#define REGION_BACKGROUND_ATTR   {MPU_REGION_SU_RW}

◆ REGION_DEBUG_ATTR

#define REGION_DEBUG_ATTR   {MPU_REGION_SU}

◆ REGION_DEBUGGER_AND_DEVICE_ATTR

#define REGION_DEBUGGER_AND_DEVICE_ATTR
Value:
{((MPU_REGION_SU) | \
#define BM4_PERMISSIONS
Definition nxp_mpu.h:40

◆ REGION_FLASH_ATTR

#define REGION_FLASH_ATTR

◆ REGION_IO_ATTR

#define REGION_IO_ATTR

◆ REGION_RAM_ATTR

#define REGION_RAM_ATTR

◆ REGION_RO_ATTR

#define REGION_RO_ATTR   {(MPU_REGION_READ | MPU_REGION_SU)}

◆ REGION_USER_MODE_ATTR

#define REGION_USER_MODE_ATTR

◆ REGION_USER_RO_ATTR

#define REGION_USER_RO_ATTR

◆ SM_RW_ALLOW

#define SM_RW_ALLOW   2

◆ SM_RWX_ALLOW

#define SM_RWX_ALLOW   0

◆ SM_RX_ALLOW

#define SM_RX_ALLOW   1

◆ SM_SAME_AS_UM

#define SM_SAME_AS_UM   3

◆ UM_EXEC

#define UM_EXEC   1

◆ UM_READ

#define UM_READ   4

◆ UM_WRITE

#define UM_WRITE   2

Typedef Documentation

◆ nxp_mpu_region_attr_t

Variable Documentation

◆ mpu_config

const struct nxp_mpu_config mpu_config
extern