1 /* SPDX-License-Identifier: GPL-2.0 */
7 #define MPUIR_DREGION 8
8 #define MPUIR_IREGION 16
9 #define MPUIR_DREGION_SZMASK (0xFF << MPUIR_DREGION)
10 #define MPUIR_IREGION_SZMASK (0xFF << MPUIR_IREGION)
12 /* ID_MMFR0 data relevant to MPU */
13 #define MMFR0_PMSA (0xF << 4)
14 #define MMFR0_PMSAv7 (3 << 4)
16 /* MPU D/I Size Register fields */
21 /* Number of subregions (SD) */
22 #define MPU_NR_SUBREGS 8
23 #define MPU_MIN_SUBREG_SIZE 256
25 /* The D/I RSR value for an enabled region spanning the whole of memory */
26 #define MPU_RSR_ALL_MEM 63
28 /* Individual bits in the DR/IR ACR */
29 #define MPU_ACR_XN (1 << 12)
30 #define MPU_ACR_SHARED (1 << 2)
32 /* C, B and TEX[2:0] bits only have semantic meanings when grouped */
33 #define MPU_RGN_CACHEABLE 0xB
34 #define MPU_RGN_SHARED_CACHEABLE (MPU_RGN_CACHEABLE | MPU_ACR_SHARED)
35 #define MPU_RGN_STRONGLY_ORDERED 0
37 /* Main region should only be shared for SMP */
39 #define MPU_RGN_NORMAL (MPU_RGN_CACHEABLE | MPU_ACR_SHARED)
41 #define MPU_RGN_NORMAL MPU_RGN_CACHEABLE
44 /* Access permission bits of ACR (only define those that we use)*/
45 #define MPU_AP_PL1RO_PL0NA (0x5 << 8)
46 #define MPU_AP_PL1RW_PL0RW (0x3 << 8)
47 #define MPU_AP_PL1RW_PL0R0 (0x2 << 8)
48 #define MPU_AP_PL1RW_PL0NA (0x1 << 8)
50 /* For minimal static MPU region configurations */
51 #define MPU_PROBE_REGION 0
52 #define MPU_BG_REGION 1
53 #define MPU_RAM_REGION 2
54 #define MPU_ROM_REGION 3
56 /* Maximum number of regions Linux is interested in */
57 #define MPU_MAX_REGIONS 16
59 #define MPU_DATA_SIDE 0
60 #define MPU_INSTR_SIDE 1
65 /* Assume same attributes for d/i-side */
73 struct mpu_rgn rgns
[MPU_MAX_REGIONS
];
75 extern struct mpu_rgn_info mpu_rgn_info
;
79 extern void __init
adjust_lowmem_bounds_mpu(void);
80 extern void __init
mpu_setup(void);
84 static inline void adjust_lowmem_bounds_mpu(void) {}
85 static inline void mpu_setup(void) {}
87 #endif /* !CONFIG_ARM_MPU */
89 #endif /* __ASSEMBLY__ */