1 /*
2  * Copyright 2022 NXP
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #include <zephyr/linker/linker-defs.h>
8 #include <zephyr/arch/arm/mpu/arm_mpu.h>
9 
10 #define DEVICE_REGION_START 0x40000000UL
11 #define DEVICE_REGION_END   0x76FFFFFFUL
12 
13 static const struct arm_mpu_region mpu_regions[] = {
14 	MPU_REGION_ENTRY("vector",
15 			 (uintptr_t)_vector_start,
16 			 REGION_RAM_TEXT_ATTR((uintptr_t)_vector_end)),
17 
18 	MPU_REGION_ENTRY("SRAM_TEXT",
19 			 (uintptr_t)__text_region_start,
20 			 REGION_RAM_TEXT_ATTR((uintptr_t)__rodata_region_start)),
21 
22 	MPU_REGION_ENTRY("SRAM_RODATA",
23 			 (uintptr_t)__rodata_region_start,
24 			 REGION_RAM_RO_ATTR((uintptr_t)__rodata_region_end)),
25 
26 	MPU_REGION_ENTRY("SRAM_DATA",
27 			 (uintptr_t)__rom_region_end,
28 			 REGION_RAM_ATTR((uintptr_t)__kernel_ram_end)),
29 
30 	MPU_REGION_ENTRY("DEVICE",
31 			 DEVICE_REGION_START,
32 			 REGION_DEVICE_ATTR(DEVICE_REGION_END)),
33 };
34 
35 const struct arm_mpu_config mpu_config = {
36 	.num_regions = ARRAY_SIZE(mpu_regions),
37 	.mpu_regions = mpu_regions,
38 };
39