bsp: r5: modified Init_MPU for the case when starting DDR>2GB
This patch modifies mpu settings in Init_MPU to truncate the DDR size to 2Gb when DDR located at 0x0 is greater than 2GB in the hdf Signed-off-by: Kinjal Pravinbhai Patel <patelki@xilinx.com> Acked-by: Anirudha Sarangi <anirudh@xilinx.com>
This commit is contained in:
parent
ed9789b2a9
commit
20f9a33b64
1 changed files with 10 additions and 5 deletions
|
@ -130,12 +130,17 @@ void Init_MPU(void)
|
||||||
#ifdef XPAR_PSU_R5_DDR_0_S_AXI_BASEADDR
|
#ifdef XPAR_PSU_R5_DDR_0_S_AXI_BASEADDR
|
||||||
/* If the DDR is present, configure region as per DDR size */
|
/* If the DDR is present, configure region as per DDR size */
|
||||||
size = (XPAR_PSU_R5_DDR_0_S_AXI_HIGHADDR - XPAR_PSU_R5_DDR_0_S_AXI_BASEADDR) + 1;
|
size = (XPAR_PSU_R5_DDR_0_S_AXI_HIGHADDR - XPAR_PSU_R5_DDR_0_S_AXI_BASEADDR) + 1;
|
||||||
/* Lookup the size. */
|
if (size < 0x80000000) {
|
||||||
for (i = 0; i < sizeof region_size / sizeof region_size[0]; i++) {
|
/* Lookup the size. */
|
||||||
if (size <= region_size[i].size) {
|
for (i = 0; i < sizeof region_size / sizeof region_size[0]; i++) {
|
||||||
RegSize = region_size[i].encoding;
|
if (size <= region_size[i].size) {
|
||||||
break;
|
RegSize = region_size[i].encoding;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
/* if the DDR size is > 2GB, truncate it to 2GB */
|
||||||
|
RegSize = REGION_2G;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
/* For DDRless system, configure region for TCM */
|
/* For DDRless system, configure region for TCM */
|
||||||
|
|
Loading…
Add table
Reference in a new issue