aboutsummaryrefslogtreecommitdiff
path: root/plat/rpi3/rpi3_common.c
diff options
context:
space:
mode:
authorAntonio Nino Diaz <antonio.ninodiaz@arm.com>2018-10-19 00:57:16 +0100
committerAntonio Nino Diaz <antonio.ninodiaz@arm.com>2018-10-24 13:54:41 +0100
commit5341b42ec170021a4dcde3e1bd463bb8c92cdff7 (patch)
treed62d7a896090ddc59bfc1e6f47d1d574506aa258 /plat/rpi3/rpi3_common.c
parent799bbb1d8215d6b5f480dd093d18a0b71f2448e3 (diff)
rpi3: Add mem reserve region to DTB if present
When a device tree blob is present at a known address, instead of, for example, relying on the user modifying the Linux command line to warn about the memory reserved for the Trusted Firmware, pass it on the DTB. The current code deletes the memory reserved for the default bootstrap of the Raspberry Pi and adds the region used by the Trusted Firmware. This system replaces the previous one consisting on adding ``memmap=16M$256M`` to the Linux command line. It's also meant to be used by U-Boot and any other bootloader that understands DTB files. Change-Id: I13ee528475fb043d6e8d9e9f24228e37ac3ac436 Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Diffstat (limited to 'plat/rpi3/rpi3_common.c')
-rw-r--r--plat/rpi3/rpi3_common.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/plat/rpi3/rpi3_common.c b/plat/rpi3/rpi3_common.c
index 98cf534c..18ff1c82 100644
--- a/plat/rpi3/rpi3_common.c
+++ b/plat/rpi3/rpi3_common.c
@@ -23,7 +23,12 @@
#define MAP_SHARED_RAM MAP_REGION_FLAT(SHARED_RAM_BASE, \
SHARED_RAM_SIZE, \
- MT_DEVICE | MT_RW | MT_SECURE)
+ MT_DEVICE | MT_RW | MT_SECURE)
+
+#ifdef RPI3_PRELOADED_DTB_BASE
+#define MAP_NS_DTB MAP_REGION_FLAT(RPI3_PRELOADED_DTB_BASE, 0x10000, \
+ MT_MEMORY | MT_RW | MT_NS)
+#endif
#define MAP_NS_DRAM0 MAP_REGION_FLAT(NS_DRAM0_BASE, NS_DRAM0_SIZE, \
MT_MEMORY | MT_RW | MT_NS)
@@ -74,6 +79,9 @@ static const mmap_region_t plat_rpi3_mmap[] = {
static const mmap_region_t plat_rpi3_mmap[] = {
MAP_SHARED_RAM,
MAP_DEVICE0,
+#ifdef RPI3_PRELOADED_DTB_BASE
+ MAP_NS_DTB,
+#endif
#ifdef BL32_BASE
MAP_BL32_MEM,
#endif