]> git.sur5r.net Git - u-boot/blobdiff - arch/arm/cpu/armv7m/mpu.c
mach-stm32: Use default memory map as background region
[u-boot] / arch / arm / cpu / armv7m / mpu.c
index 8e92a33fd4dd400f5949fdc8735a052932296e1f..e4d090e5de48683bf5b7e3db65ec99d448b4e40e 100644 (file)
 #include <asm/armv7m_mpu.h>
 #include <asm/io.h>
 
-#define V7M_MPU_CTRL_ENABLE            (1 << 0)
+#define V7M_MPU_CTRL_ENABLE            BIT(0)
 #define V7M_MPU_CTRL_DISABLE           (0 << 0)
-#define V7M_MPU_CTRL_HFNMIENA          (1 << 1)
-#define VALID_REGION                   (1 << 4)
+#define V7M_MPU_CTRL_HFNMIENA          BIT(1)
+#define V7M_MPU_CTRL_PRIVDEFENA                BIT(2)
+#define VALID_REGION                   BIT(4)
 
-#define ENABLE_REGION                  (1 << 0)
+#define ENABLE_REGION                  BIT(0)
 
 #define AP_SHIFT                       24
 #define XN_SHIFT                       28
@@ -36,7 +37,7 @@ void disable_mpu(void)
 
 void enable_mpu(void)
 {
-       writel(V7M_MPU_CTRL_ENABLE | V7M_MPU_CTRL_HFNMIENA, &V7M_MPU->ctrl);
+       writel(V7M_MPU_CTRL_ENABLE | V7M_MPU_CTRL_PRIVDEFENA, &V7M_MPU->ctrl);
 
        /* Make sure new mpu config is effective for next memory access */
        dsb();