public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-platforms][PATCH 1/1] Platform/RPi3: allow overriding TF-A binaries during build
@ 2020-04-30  8:49 Andrei Warkentin
  2020-04-30  9:01 ` Ard Biesheuvel
  0 siblings, 1 reply; 3+ messages in thread
From: Andrei Warkentin @ 2020-04-30  8:49 UTC (permalink / raw)
  To: devel; +Cc: ard.biesheuvel, leif, pete, philmd

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>
---
 Platform/RaspberryPi/RPi3/RPi3.dsc | 16 ++++++++++++++++
 Platform/RaspberryPi/RPi3/RPi3.fdf |  4 ++--
 2 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/Platform/RaspberryPi/RPi3/RPi3.dsc b/Platform/RaspberryPi/RPi3/RPi3.dsc
index 54ebfdfb..bb5e9b99 100644
--- a/Platform/RaspberryPi/RPi3/RPi3.dsc
+++ b/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.
diff --git a/Platform/RaspberryPi/RPi3/RPi3.fdf b/Platform/RaspberryPi/RPi3/RPi3.fdf
index e467b5cd..11e3f5a2 100644
--- a/Platform/RaspberryPi/RPi3/RPi3.fdf
+++ b/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
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [edk2-platforms][PATCH 1/1] Platform/RPi3: allow overriding TF-A binaries during build
  2020-04-30  8:49 [edk2-platforms][PATCH 1/1] Platform/RPi3: allow overriding TF-A binaries during build Andrei Warkentin
@ 2020-04-30  9:01 ` Ard Biesheuvel
  2020-04-30  9:07   ` [edk2-devel] " Andrei Warkentin
  0 siblings, 1 reply; 3+ messages in thread
From: Ard Biesheuvel @ 2020-04-30  9:01 UTC (permalink / raw)
  To: Andrei Warkentin, devel; +Cc: leif, pete, philmd

On 4/30/20 10:49 AM, Andrei Warkentin wrote:
> 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>

Pushed as ee999c857d283acb83d27d2b6edc8519badbfd29

Is it my fault that we are using bl1+fip on RPi3? I don't remember, but 
I suppose we could easily switch to BL31 only like we have on RPI4


> ---
>   Platform/RaspberryPi/RPi3/RPi3.dsc | 16 ++++++++++++++++
>   Platform/RaspberryPi/RPi3/RPi3.fdf |  4 ++--
>   2 files changed, 18 insertions(+), 2 deletions(-)
> 
> diff --git a/Platform/RaspberryPi/RPi3/RPi3.dsc b/Platform/RaspberryPi/RPi3/RPi3.dsc
> index 54ebfdfb..bb5e9b99 100644
> --- a/Platform/RaspberryPi/RPi3/RPi3.dsc
> +++ b/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.
> diff --git a/Platform/RaspberryPi/RPi3/RPi3.fdf b/Platform/RaspberryPi/RPi3/RPi3.fdf
> index e467b5cd..11e3f5a2 100644
> --- a/Platform/RaspberryPi/RPi3/RPi3.fdf
> +++ b/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
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [edk2-devel] [edk2-platforms][PATCH 1/1] Platform/RPi3: allow overriding TF-A binaries during build
  2020-04-30  9:01 ` Ard Biesheuvel
@ 2020-04-30  9:07   ` Andrei Warkentin
  0 siblings, 0 replies; 3+ messages in thread
From: Andrei Warkentin @ 2020-04-30  9:07 UTC (permalink / raw)
  To: Andrei Warkentin, devel@edk2.groups.io, ard.biesheuvel@arm.com
  Cc: leif@nuviainc.com, pete@akeo.ie, philmd@redhat.com

[-- Attachment #1: Type: text/plain, Size: 512 bytes --]

Hi Ard,

> Is it my fault that we are using bl1+fip on RPi3? I don't remember, but
> I suppose we could easily switch to BL31 only like we have on RPI4

AFAIK, Andre P. was looking at unifying the pi3 tf-a target with pi 4 long term. I might end up proposing something there because after I fix DT handling in RPi3 (in the same way it's fixed for Pi 4 now), we're going to end up with a fairly obtuse-looking memory map. A bl31-only TF-A will mean simpler (and unified) memory map handling for Pi3/4.

A

[-- Attachment #2: Type: text/html, Size: 1056 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-04-30  9:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-30  8:49 [edk2-platforms][PATCH 1/1] Platform/RPi3: allow overriding TF-A binaries during build Andrei Warkentin
2020-04-30  9:01 ` Ard Biesheuvel
2020-04-30  9:07   ` [edk2-devel] " Andrei Warkentin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox