1 /*
2  * Copyright 2020 NXP
3  * Copyright 2022 HNU-ESNL
4  * Copyright 2022 openEuler SIG-Zephyr
5  *
6  * SPDX-License-Identifier: Apache-2.0
7  */
8 #include <zephyr/devicetree.h>
9 #include <zephyr/sys/util.h>
10 #include <zephyr/arch/arm64/arm_mmu.h>
11 
12 static const struct arm_mmu_region mmu_regions[] = {
13 
14 	MMU_REGION_FLAT_ENTRY("GIC",
15 			      DT_REG_ADDR_BY_IDX(DT_NODELABEL(gic), 0),
16 			      DT_REG_SIZE_BY_IDX(DT_NODELABEL(gic), 0),
17 			      MT_DEVICE_nGnRnE | MT_P_RW_U_RW | MT_NS),
18 
19 	MMU_REGION_FLAT_ENTRY("GIC",
20 			      DT_REG_ADDR_BY_IDX(DT_NODELABEL(gic), 1),
21 			      DT_REG_SIZE_BY_IDX(DT_NODELABEL(gic), 1),
22 			      MT_DEVICE_nGnRnE | MT_P_RW_U_RW | MT_NS),
23 
24 };
25 
26 const struct arm_mmu_config mmu_config = {
27 	.num_regions = ARRAY_SIZE(mmu_regions),
28 	.mmu_regions = mmu_regions,
29 };
30