Browse Source

Platform/RPi3: allow overriding TF-A binaries during build

For PFTF developers working on the firmware, being able to use a
local TF-A build without extra extra copy operations ends up being
very helpful.

This can be accomplished via a TFA_BUILD_ARTIFACTS option passed
to the edk2 build tool.

If/when the Pi 3 and 4 DSC/FDFs become unified, this will be even
more important to trivially perform a full clean upstream build
for either platform, without having to worry about different TF-A
deliverables - Pi 4 uses bl31.bin, while Pi 3 uses fip.bin and bl1.bin.

This is like the Pi 4 patch that went in a month ago or so.

Signed-off-by: Andrei Warkentin <andrey.warkentin@gmail.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
Andrei Warkentin 4 years ago
parent
commit
ee999c857d
2 changed files with 18 additions and 2 deletions
  1. 16 0
      Platform/RaspberryPi/RPi3/RPi3.dsc
  2. 2 2
      Platform/RaspberryPi/RPi3/RPi3.fdf

+ 16 - 0
Platform/RaspberryPi/RPi3/RPi3.dsc

@@ -33,6 +33,22 @@
   DEFINE INCLUDE_TFTP_COMMAND    = FALSE
   DEFINE DEBUG_PRINT_ERROR_LEVEL = 0x8000004F
 
+!ifndef TFA_BUILD_ARTIFACTS
+  #
+  # Default TF-A binaries checked into edk2-non-osi.
+  #
+  DEFINE TFA_BUILD_BL1 = Platform/RaspberryPi/$(PLATFORM_NAME)/TrustedFirmware/bl1.bin
+  DEFINE TFA_BUILD_FIP = Platform/RaspberryPi/$(PLATFORM_NAME)/TrustedFirmware/fip.bin
+!else
+  #
+  # Usually we use the checked-in binaries, but for developers working
+  # on the firmware, being able to use a local TF-A build without extra copy
+  # operations ends up being very helpful.
+  #
+  DEFINE TFA_BUILD_BL1 = $(TFA_BUILD_ARTIFACTS)/bl1.bin
+  DEFINE TFA_BUILD_FIP = $(TFA_BUILD_ARTIFACTS)/fip.bin
+!endif
+
 ################################################################################
 #
 # Library Class section - list of all Library Classes needed by this Platform.

+ 2 - 2
Platform/RaspberryPi/RPi3/RPi3.fdf

@@ -51,7 +51,7 @@ NumBlocks     = 0x200
 # ATF primary boot image
 #
 0x00000000|0x00010000
-FILE = Platform/RaspberryPi/$(PLATFORM_NAME)/TrustedFirmware/bl1.bin
+FILE = $(TFA_BUILD_BL1)
 
 #
 # DTB.
@@ -63,7 +63,7 @@ DATA = { 0x00 }
 # ATF secondary boot image in FIP format (BL2 + BL31)
 #
 0x00020000|0x00010000
-FILE = Platform/RaspberryPi/$(PLATFORM_NAME)/TrustedFirmware/fip.bin
+FILE = $(TFA_BUILD_FIP)
 
 #
 # UEFI image