summaryrefslogtreecommitdiff
path: root/Platform/RaspberryPi/RPi3
diff options
context:
space:
mode:
authorAndrei Warkentin <andrey.warkentin@gmail.com>2020-04-30 12:19:00 -0700
committerArd Biesheuvel <ard.biesheuvel@arm.com>2020-05-01 12:22:39 +0200
commit90e73225b07a12b103431e35df646eda36f8fe1a (patch)
tree229e61cfe5181bdead41176dac71f31fbf518ffb /Platform/RaspberryPi/RPi3
parent40f2f135eb7c62735e3b01bd25a5444d7f61a0f5 (diff)
RPi3/RPi4: fix RPi 3 VPU-passed FDT handling by unifying with RPi4 implementation
A rev-up of start.elf VPU firmware meant that the previous scheme of loading the DTB over top of RPI_EFI.FD no longer works - the DT is now loaded way before the armstub, so any overlap means the DT is overridden. This change re-arranges a few items in the FD, allowing the DTB to loaded directly after the FD in physical memory. Unlike the Pi 4 implementation, we can't move the UEFI image down in memory, as that needs a TF-A changem so it just reduces the size by 0x10000. The same base address (0x1f0000) is used as on the Pi 4. The Pi 3 FDF can be further unified with Pi 4 after work on TF-A to move to a single BL32-based Pi 3 TF-A implementation. Tested: Pi 3A+, Pi 2B v1.2, Pi 4B (4GB). Signed-off-by: Andrei Warkentin <andrey.warkentin@gmail.com> Reviewed-by: Pete Batard <pete@akeo.ie>
Diffstat (limited to 'Platform/RaspberryPi/RPi3')
-rw-r--r--Platform/RaspberryPi/RPi3/RPi3.dsc9
-rw-r--r--Platform/RaspberryPi/RPi3/RPi3.fdf36
2 files changed, 26 insertions, 19 deletions
diff --git a/Platform/RaspberryPi/RPi3/RPi3.dsc b/Platform/RaspberryPi/RPi3/RPi3.dsc
index d4a3d49d..563fb891 100644
--- a/Platform/RaspberryPi/RPi3/RPi3.dsc
+++ b/Platform/RaspberryPi/RPi3/RPi3.dsc
@@ -387,8 +387,13 @@
# Size of the region used by UEFI in permanent memory (Reserved 64MB)
gArmPlatformTokenSpaceGuid.PcdSystemMemoryUefiRegionSize|0x04000000
#
- # This matches PcdFvBaseAddress, since everything less is ATF, and
- # will be reserved away.
+ # 0x00000000 - 0x001F0000 FD (PcdFdBaseAddress, PcdFdSize)
+ # 0x001F0000 - 0x00200000 DTB (PcdFdtBaseAddress, PcdFdtSize)
+ # 0x00200000 - 0x00400000 TFA (BL2 / BL31 / BL32 "secure SRAM")
+ # 0x00400000 - ... RAM (PcdSystemMemoryBase, PcdSystemMemorySize)
+ #
+ # This matches PcdFvBaseAddress, since everything less is FD + TF-A RAM,
+ # thus will be reserved away.
#
gArmTokenSpaceGuid.PcdSystemMemoryBase|0x00400000
gArmTokenSpaceGuid.PcdSystemMemorySize|0x3FC00000
diff --git a/Platform/RaspberryPi/RPi3/RPi3.fdf b/Platform/RaspberryPi/RPi3/RPi3.fdf
index d334d3be..daedc443 100644
--- a/Platform/RaspberryPi/RPi3/RPi3.fdf
+++ b/Platform/RaspberryPi/RPi3/RPi3.fdf
@@ -25,11 +25,11 @@
[FD.RPI_EFI]
BaseAddress = 0x00000000|gArmTokenSpaceGuid.PcdFdBaseAddress
-Size = 0x00200000|gArmTokenSpaceGuid.PcdFdSize
+Size = 0x001f0000|gArmTokenSpaceGuid.PcdFdSize
ErasePolarity = 1
BlockSize = 0x00001000|gRaspberryPiTokenSpaceGuid.PcdFirmwareBlockSize
-NumBlocks = 0x200
+NumBlocks = 0x1f0
################################################################################
#
@@ -54,12 +54,6 @@ NumBlocks = 0x200
FILE = $(TFA_BUILD_BL1)
#
-# DTB.
-#
-0x00010000|0x00010000
-DATA = { 0x00 }
-
-#
# ATF secondary boot image in FIP format (BL2 + BL31)
#
0x00020000|0x00010000
@@ -68,21 +62,21 @@ FILE = $(TFA_BUILD_FIP)
#
# UEFI image
#
-0x00030000|0x001b0000
+0x00030000|0x001a0000
gArmTokenSpaceGuid.PcdFvBaseAddress|gArmTokenSpaceGuid.PcdFvSize
FV = FVMAIN_COMPACT
#
# Variables (0x20000 overall).
#
-# 0x001e0000 - 0x001edfff EFI_FIRMWARE_VOLUME_HEADER
-# 0x001ee000 - 0x001eefff Event log
-# 0x001ef000 - 0x001effff EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER-
-# 0x001f0000 - 0x001fffff Data
+# 0x001d0000 - 0x001ddfff EFI_FIRMWARE_VOLUME_HEADER
+# 0x001de000 - 0x001defff Event log
+# 0x001df000 - 0x001dffff EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER-
+# 0x001e0000 - 0x001effff Data
#
# NV_VARIABLE_STORE
-0x001e0000|0x0000e000
+0x001d0000|0x0000e000
gRaspberryPiTokenSpaceGuid.PcdNvStorageVariableBase|gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize
DATA = {
@@ -125,11 +119,11 @@ DATA = {
}
# NV_EVENT_LOG
-0x001ee000|0x00001000
+0x001de000|0x00001000
gRaspberryPiTokenSpaceGuid.PcdNvStorageEventLogBase|gRaspberryPiTokenSpaceGuid.PcdNvStorageEventLogSize
# NV_FTW_WORKING header
-0x001ef000|0x00001000
+0x001df000|0x00001000
gRaspberryPiTokenSpaceGuid.PcdNvStorageFtwWorkingBase|gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize
DATA = {
@@ -144,9 +138,17 @@ DATA = {
}
# NV_FTW_WORKING data
-0x001f0000|0x00010000
+0x001e0000|0x00010000
gRaspberryPiTokenSpaceGuid.PcdNvStorageFtwSpareBase|gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize
+#
+# This is just for documentation purposes! The DTB reserved space is not part of the FD,
+# but this is exactly where it is expected to be.
+#
+# 0x001f0000|0x10000
+# gRaspberryPiTokenSpaceGuid.PcdFdtBaseAddress|gRaspberryPiTokenSpaceGuid.PcdFdtSize
+#
+
################################################################################
#
# FV Section