Skip to content

Commit d1c6bb5

Browse files
CkovMkfabiobaltieri
authored andcommitted
imx8m: auto generate mmu_regions array from dt compatiable
Adopt the "MMU_REGION_DT_FLAT_ENTRY" macro to automatically generate elements in "mmu_regions" according to devicetree "compatible" and "status". Signed-off-by: Chekhov Ma <[email protected]>
1 parent 81c5a09 commit d1c6bb5

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

soc/arm64/nxp_imx/mimx8m/mmu_regions.c

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,25 +25,18 @@ static const struct arm_mmu_region mmu_regions[] = {
2525
DT_REG_SIZE(DT_NODELABEL(ccm)),
2626
MT_DEVICE_nGnRnE | MT_P_RW_U_NA | MT_NS),
2727

28-
MMU_REGION_FLAT_ENTRY("UART2",
29-
DT_REG_ADDR(DT_NODELABEL(uart2)),
30-
DT_REG_SIZE(DT_NODELABEL(uart2)),
31-
MT_DEVICE_nGnRnE | MT_P_RW_U_NA | MT_NS),
32-
3328
MMU_REGION_FLAT_ENTRY("ANA_PLL",
3429
DT_REG_ADDR(DT_NODELABEL(ana_pll)),
3530
DT_REG_SIZE(DT_NODELABEL(ana_pll)),
3631
MT_DEVICE_nGnRnE | MT_P_RW_U_NA | MT_NS),
3732

38-
MMU_REGION_FLAT_ENTRY("UART4",
39-
DT_REG_ADDR(DT_NODELABEL(uart4)),
40-
DT_REG_SIZE(DT_NODELABEL(uart4)),
41-
MT_DEVICE_nGnRnE | MT_P_RW_U_NA | MT_NS),
42-
4333
MMU_REGION_FLAT_ENTRY("IOMUXC",
4434
DT_REG_ADDR(DT_NODELABEL(iomuxc)),
4535
DT_REG_SIZE(DT_NODELABEL(iomuxc)),
4636
MT_DEVICE_nGnRnE | MT_P_RW_U_NA | MT_NS),
37+
38+
MMU_REGION_DT_COMPAT_FOREACH_FLAT_ENTRY(nxp_imx_iuart,
39+
(MT_DEVICE_nGnRnE | MT_P_RW_U_NA | MT_NS))
4740
};
4841

4942
const struct arm_mmu_config mmu_config = {

0 commit comments

Comments
 (0)