89 MPU->CTRL = dw_mpu_enable ;
99 MPU->RNR = dw_region_num;
107 MPU->RASR &= 0xfffffffe;
118 MPU->RBAR = dw_region_base_addr;
119 MPU->RASR = dw_region_attr;
128 uint32_t dwRegionSize = 32;
129 uint32_t dwReturnValue = 4;
131 while( dwReturnValue < 31 ) {
132 if( dw_actual_size_in_bytes <= dwRegionSize ) {
140 return ( dwReturnValue << 1 );
149 void mpu_update_regions(uint32_t dw_region_num, uint32_t dw_region_base_addr, uint32_t dw_region_attr)
void mpu_update_regions(uint32_t dw_region_num, uint32_t dw_region_base_addr, uint32_t dw_region_attr)
Update MPU regions.
SAMV70/SAMV71/SAME70/SAMS70-XULTRA board mpu config.
static irqflags_t cpu_irq_save(void)
Get and clear the global interrupt flags.
void mpu_disable_region(void)
Disable the current active region.
void mpu_set_region(uint32_t dw_region_base_addr, uint32_t dw_region_attr)
Setup a memory region.
static void cpu_irq_restore(irqflags_t flags)
Restore global interrupt flags.
uint32_t mpu_cal_mpu_region_size(uint32_t dw_actual_size_in_bytes)
Calculate region size for the RASR.
void mpu_enable(uint32_t dw_mpu_enable)
Enables the MPU module.
void mpu_set_region_num(uint32_t dw_region_num)
Set active memory region.
uint32_t irqflags_t
Type used for holding state of interrupt flag.