[meta-arm,2/7] arm-bsp/fip-image: Build TFA/UEFI for sgi575

Submitted by Prabin CA on Aug. 10, 2020, 5:32 p.m. | Patch ID: 175202

Details

Message ID 20200810173216.10411-2-prabin.ca@arm.com
State New
Headers show

Commit Message

Prabin CA Aug. 10, 2020, 5:32 p.m.
- Add bbappend recipe to build ARM-TF and UEFI firmware
          for SGI575.
        - Add machine conf to add image dependency
          for ARM-TF components.

Change-Id: I1f9dcc8877aa929c50bffd0b437e8f51527f3d45
Signed-off-by: Prabin CA <prabin.ca@arm.com>
---
 meta-arm-bsp/conf/machine/sgi575.conf          |  7 +++++++
 .../trusted-firmware-a-sgi575.inc              | 18 ++++++++++++++++++
 .../trusted-firmware-a_2.2.bbappend            |  1 +
 .../recipes-bsp/uefi/edk2-firmware-sgi575.inc  | 18 ++++++++++++++++++
 .../uefi/edk2-firmware_git.bbappend            |  1 +
 5 files changed, 45 insertions(+)
 create mode 100644 meta-arm-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a-sgi575.inc
 create mode 100644 meta-arm-bsp/recipes-bsp/uefi/edk2-firmware-sgi575.inc

Patch hide | download patch | download mbox

diff --git a/meta-arm-bsp/conf/machine/sgi575.conf b/meta-arm-bsp/conf/machine/sgi575.conf
index 04c4900..c77f3f5 100644
--- a/meta-arm-bsp/conf/machine/sgi575.conf
+++ b/meta-arm-bsp/conf/machine/sgi575.conf
@@ -9,3 +9,10 @@  TUNE_FEATURES = "aarch64"
 require conf/machine/include/arm/arch-armv8a.inc
 
 EXTRA_IMAGEDEPENDS += "virtual/control-processor-firmware"
+
+# Trusted firmware v2.2 version
+PREFERRED_PROVIDER_virtual/trusted-firmware-a ?= "trusted-firmware-a"
+PREFERRED_VERSION_trusted-firmware-a ?= "2.2%"
+
+EXTRA_IMAGEDEPENDS += "virtual/trusted-firmware-a"
+
diff --git a/meta-arm-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a-sgi575.inc b/meta-arm-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a-sgi575.inc
new file mode 100644
index 0000000..6d04fa3
--- /dev/null
+++ b/meta-arm-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a-sgi575.inc
@@ -0,0 +1,18 @@ 
+# SGI575 specific TFA support
+
+SRC_URI_append = " ${SRC_URI_MBEDTLS}"
+
+COMPATIBLE_MACHINE = "sgi575"
+TFA_PLATFORM       = "sgi575"
+TFA_BUILD_TARGET   = "all fip"
+TFA_INSTALL_TARGET = "bl1 fip"
+TFA_DEBUG          = "1"
+TFA_MBEDTLS        = "1"
+TFA_UBOOT          = "0"
+
+# Sgi575 needs the UEFI as bl33
+DEPENDS += "virtual/uefi-firmware"
+
+EXTRA_OEMAKE += "BL33=${RECIPE_SYSROOT}/firmware/uefi.bin"
+EXTRA_OEMAKE += "MBEDTLS_DIR=mbedtls TRUSTED_BOARD_BOOT=1 GENERATE_COT=1 ARM_ROTPK_LOCATION=devel_rsa \
+                     ROT_KEY=plat/arm/board/common/rotpk/arm_rotprivk_rsa.pem"
diff --git a/meta-arm-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.2.bbappend b/meta-arm-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.2.bbappend
index 6ede847..c6bd111 100644
--- a/meta-arm-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.2.bbappend
+++ b/meta-arm-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.2.bbappend
@@ -2,5 +2,6 @@ 
 
 MACHINE_TFA_REQUIRE ?= ""
 MACHINE_TFA_REQUIRE_fvp-base-arm32 = "trusted-firmware-a-fvp-arm32.inc"
+MACHINE_TFA_REQUIRE_sgi575 = "trusted-firmware-a-sgi575.inc"
 
 require ${MACHINE_TFA_REQUIRE}
diff --git a/meta-arm-bsp/recipes-bsp/uefi/edk2-firmware-sgi575.inc b/meta-arm-bsp/recipes-bsp/uefi/edk2-firmware-sgi575.inc
new file mode 100644
index 0000000..e27d617
--- /dev/null
+++ b/meta-arm-bsp/recipes-bsp/uefi/edk2-firmware-sgi575.inc
@@ -0,0 +1,18 @@ 
+SRC_URI = "\
+    gitsm://github.com/tianocore/edk2.git;name=edk2;destsuffix=${S}/edk2;nobranch=1 \
+    git://github.com/tianocore/edk2-platforms.git;name=edk2-platforms;destsuffix=${S}/edk2/edk2-platforms;nobranch=1 \
+"
+# TAGS and commit ID
+SRCREV_edk2           = "50528537b2fb0ebdf32c719a0525635c93b905c2"
+SRCREV_edk2-platforms = "b972f17b329a85e6aa4d69f240d459839ba8b47c"
+
+# SGI575 specific EDK2 configurations
+EDK2_BUILD_RELEASE = "0"
+EDK2_PLATFORM      = "Sgi575"
+EDK2_PLATFORM_DSC  = "SgiPkg/Sgi575/Sgi575.dsc"
+EDK2_BIN_NAME      = "BL33_AP_UEFI.fd"
+EDK2_ARCH          = "AARCH64"
+
+COMPATIBLE_MACHINE = "sgi575"
+
+PV ?= "202005+git${SRCPV}"
diff --git a/meta-arm-bsp/recipes-bsp/uefi/edk2-firmware_git.bbappend b/meta-arm-bsp/recipes-bsp/uefi/edk2-firmware_git.bbappend
index dfebd87..bef54b0 100644
--- a/meta-arm-bsp/recipes-bsp/uefi/edk2-firmware_git.bbappend
+++ b/meta-arm-bsp/recipes-bsp/uefi/edk2-firmware_git.bbappend
@@ -3,5 +3,6 @@ 
 MACHINE_EDK2_REQUIRE ?= ""
 
 MACHINE_EDK2_REQUIRE_n1sdp = "edk2-firmware-n1sdp.inc"
+MACHINE_EDK2_REQUIRE_sgi575 = "edk2-firmware-sgi575.inc"
 
 require ${MACHINE_EDK2_REQUIRE}