rpi: limit size of the RAM to the multiple of the MMU_SECTION_SIZE 06/252606/2 accepted/tizen/unified/20210207.235255 submit/tizen/20210205.105645
authorMarek Szyprowski <m.szyprowski@samsung.com>
Mon, 1 Feb 2021 10:53:07 +0000 (11:53 +0100)
committerMarek Szyprowski <m.szyprowski@samsung.com>
Mon, 1 Feb 2021 11:10:39 +0000 (12:10 +0100)
commitca4cb2926a852d3bd8f23dcc199ae989a943f288
treed1ef414e160900219ca01cabb4264f02818467d7
parent94e447a9b05e9c2ed1d82285fefdca9127843145
rpi: limit size of the RAM to the multiple of the MMU_SECTION_SIZE

When RPi4 is booted from USB Mass Storage, the firmware reports 947MiB of
the ARM memory (948 in case of the standard SD-card boot). This value is
not MMU_SECTION_SIZE aligned, so the dram_bank_mmu_setup() skips mapping
of the last 1MiB. This later causes u-boot in ARM 32bit mode to freeze,
because it relocated itself into that unmapped memory and fails to
execute.

Fix this by limiting the size of the first bank to the multiple of
MMU_SECTION_SIZE.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I9734e7a3a2b791afff211f57eb872f99bf6f2672
board/raspberrypi/rpi/rpi.c