Skip to content

Commit b6c5d91

Browse files
ibirnbaumcfriedt
authored andcommitted
soc: xlnx: zynqmp: fix vectors and SRAM MPU region priority order
Place the 'vectors' region configuration behind the 'sram' and 'rom_region' configurations so that the MPU region for the vectors takes precedence over the 'sram' region due to higher region index = higher priority when resolving memory properties / permissions for overlapping regions. This is required for the vectors to work properly if the SRAM base address is also at 0x0. Fixes #96688. Signed-off-by: Immo Birnbaum <[email protected]>
1 parent e438b57 commit b6c5d91

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

soc/xlnx/zynqmp/arm_mpu_regions.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,6 @@ extern const uint32_t __rom_region_start;
1111
extern const uint32_t __rom_region_mpu_size_bits;
1212

1313
static const struct arm_mpu_region mpu_regions[] = {
14-
/*
15-
* The address of the vectors is determined by arch/arm/core/cortex_a_r/prep_c.c
16-
* -> for v7-R, there's no other option than 0x0, HIVECS always gets cleared
17-
*/
18-
MPU_REGION_ENTRY(
19-
"vectors",
20-
0x00000000,
21-
REGION_64B,
22-
{.rasr = P_RO_U_NA_Msk |
23-
NORMAL_OUTER_INNER_NON_CACHEABLE_NON_SHAREABLE}),
2414
/* Basic SRAM mapping is all data, R/W + XN */
2515
MPU_REGION_ENTRY(
2616
"sram",
@@ -71,6 +61,16 @@ static const struct arm_mpu_region mpu_regions[] = {
7161
STRONGLY_ORDERED_SHAREABLE |
7262
NOT_EXEC}),
7363
#endif
64+
/*
65+
* The address of the vectors is determined by arch/arm/core/cortex_a_r/prep_c.c
66+
* -> for v7-R, there's no other option than 0x0, HIVECS always gets cleared
67+
*/
68+
MPU_REGION_ENTRY(
69+
"vectors",
70+
0x00000000,
71+
REGION_64B,
72+
{.rasr = P_RO_U_NA_Msk |
73+
NORMAL_OUTER_INNER_NON_CACHEABLE_NON_SHAREABLE}),
7474
};
7575

7676
const struct arm_mpu_config mpu_config = {

0 commit comments

Comments
 (0)