1 // SPDX-License-Identifier: GPL-2.0+
4 * Author(s): Giulio Benetti <giulio.benetti@benettiengineering.com>
10 #include <asm/armv7_mpu.h>
11 #include <asm/mach-imx/sys_proto.h>
12 #include <linux/bitops.h>
14 int arch_cpu_init(void)
18 struct mpu_region_config imxrt_region_config[] = {
19 { 0x00000000, REGION_0, XN_DIS, PRIV_RW_USR_RW,
20 STRONG_ORDER, REGION_4GB },
21 { PHYS_SDRAM, REGION_1, XN_DIS, PRIV_RW_USR_RW,
22 O_I_WB_RD_WR_ALLOC, (ffs(PHYS_SDRAM_SIZE) - 2) },
24 REGION_2, XN_DIS, PRIV_RW_USR_RW,
25 STRONG_ORDER, (ffs(DMAMEM_SZ_ALL) - 2) },
29 * Configure the memory protection unit (MPU) to allow full access to
30 * the whole 4GB address space.
33 for (i = 0; i < ARRAY_SIZE(imxrt_region_config); i++)
34 mpu_config(&imxrt_region_config[i]);
42 #if defined(CONFIG_IMXRT1020)
43 return MXC_CPU_IMXRT1020 << 12;
44 #elif defined(CONFIG_IMXRT1050)
45 return MXC_CPU_IMXRT1050 << 12;
46 #elif defined(CONFIG_IMXRT1170)
47 return MXC_CPU_IMXRT1170 << 12;
49 #error This IMXRT SoC is not supported