2 * Copyright (C) 2017, STMicroelectronics - All Rights Reserved
3 * Author(s): Patrice Chotard, <patrice.chotard@st.com> for STMicroelectronics.
5 * SPDX-License-Identifier: GPL-2.0+
10 #include <asm/armv7m_mpu.h>
12 int arch_cpu_init(void)
16 struct mpu_region_config stm32_region_config[] = {
18 * Make SDRAM area cacheable & executable.
20 #if defined(CONFIG_STM32F4)
21 { 0x00000000, REGION_0, XN_DIS, PRIV_RW_USR_RW,
22 O_I_WB_RD_WR_ALLOC, REGION_16MB },
25 #if defined(CONFIG_STM32F7)
26 { 0xC0000000, REGION_0, XN_DIS, PRIV_RW_USR_RW,
27 O_I_WB_RD_WR_ALLOC, REGION_16MB },
30 #if defined(CONFIG_STM32H7)
31 { 0xD0000000, REGION_0, XN_DIS, PRIV_RW_USR_RW,
32 O_I_WB_RD_WR_ALLOC, REGION_32MB },
37 for (i = 0; i < ARRAY_SIZE(stm32_region_config); i++)
38 mpu_config(&stm32_region_config[i]);