diff options
author | Patrice Chotard <patrice.chotard@st.com> | 2018-02-28 17:15:00 +0100 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2018-03-13 21:45:37 -0400 |
commit | f5bd13ed57730fd6e0de274aa52e4faef79871e9 (patch) | |
tree | d70d6691602db2aca4f2f6c8aab3a6c855ff0f42 /arch/arm/cpu/armv7m | |
parent | 227cefe02c77d1aeebc9a4993635ff62d48a0f6f (diff) | |
download | u-boot-f5bd13ed57730fd6e0de274aa52e4faef79871e9.tar.gz u-boot-f5bd13ed57730fd6e0de274aa52e4faef79871e9.tar.bz2 u-boot-f5bd13ed57730fd6e0de274aa52e4faef79871e9.zip |
mach-stm32: Use default memory map as background region
On linux kernel side, on STM32F7 and STM32H7 SoCs, DMA requires
uncachable regions. These regions are defined in DT.
Since kernel linux v4.15, on ARMv7-M Cortex, kernel is able
to configure MPU regions depending on DT settings.
As kernel is able to configure MPU, this allows to remove
MPU region settings in bootloader.
On Cortex M processors, MPU allows to use a default memory map.
(see B3.5.4 MPU Control Register, MPU_CTRL in
https://developer.arm.com/products/architecture/m-profile/docs/ddi0403/latest/armv7-m-architecture-reference-manual)
Use the default memory map as background region for all STM32 SoCs
family with an additional MPU region corresponding to the SDRAM area.
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Diffstat (limited to 'arch/arm/cpu/armv7m')
-rw-r--r-- | arch/arm/cpu/armv7m/mpu.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/arch/arm/cpu/armv7m/mpu.c b/arch/arm/cpu/armv7m/mpu.c index 8e92a33fd4..e4d090e5de 100644 --- a/arch/arm/cpu/armv7m/mpu.c +++ b/arch/arm/cpu/armv7m/mpu.c @@ -10,12 +10,13 @@ #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(); |