[meta-arm,v2,7/9] arm-bsp/scp-firmware: adding scp support for corstone700 platform

Submitted by abdellatif.elkhlifi@arm.com on Aug. 13, 2020, 2:52 p.m. | Patch ID: 175306

Details

Message ID 20200813145230.22140-8-abdellatif.elkhlifi@arm.com
State New
Headers show

Commit Message

abdellatif.elkhlifi@arm.com Aug. 13, 2020, 2:52 p.m.
From: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>

Extend the scp recipe to support corstone700 plaform.

The scp runs on the boot processor (Secure Enclave).

Change-Id: I24289533a72367ebd2d2150c5230d9f435b4212f
Signed-off-by: Rui Miguel Silva <rui.silva@arm.com>
Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
---
 .../conf/machine/include/corstone700.inc      | 10 ++++-
 .../scp-firmware/scp-firmware-corstone700.inc | 37 +++++++++++++++++++
 .../scp-firmware/scp-firmware_%.bbappend      |  1 +
 3 files changed, 47 insertions(+), 1 deletion(-)
 create mode 100644 meta-arm-bsp/recipes-bsp/scp-firmware/scp-firmware-corstone700.inc

Patch hide | download patch | download mbox

diff --git a/meta-arm-bsp/conf/machine/include/corstone700.inc b/meta-arm-bsp/conf/machine/include/corstone700.inc
index 6b02415..91f290f 100644
--- a/meta-arm-bsp/conf/machine/include/corstone700.inc
+++ b/meta-arm-bsp/conf/machine/include/corstone700.inc
@@ -14,7 +14,15 @@  PREFERRED_VERSION_linux-stable ?= "5.6%"
 PREFERRED_PROVIDER_virtual/trusted-firmware-a ?= "trusted-firmware-a"
 PREFERRED_VERSION_trusted-firmware-a ?= "2.3%"
 
-EXTRA_IMAGEDEPENDS += "virtual/trusted-firmware-a external-system u-boot"
+PREFERRED_PROVIDER_virtual/control-processor-firmware ?= "scp-firmware"
+PREFERRED_VERSION_control-processor-firmware ?= "2.6.0"
+
+EXTRA_IMAGEDEPENDS += " \
+                      virtual/trusted-firmware-a          \
+                      external-system                     \
+                      u-boot                              \
+                      virtual/control-processor-firmware  \
+                      "
 
 WKS_FILE_DEPENDS_append = " ${EXTRA_IMAGEDEPENDS}"
 
diff --git a/meta-arm-bsp/recipes-bsp/scp-firmware/scp-firmware-corstone700.inc b/meta-arm-bsp/recipes-bsp/scp-firmware/scp-firmware-corstone700.inc
new file mode 100644
index 0000000..16437c5
--- /dev/null
+++ b/meta-arm-bsp/recipes-bsp/scp-firmware/scp-firmware-corstone700.inc
@@ -0,0 +1,37 @@ 
+# Corstone700 specific SCP configurations and build instructions
+
+SUMMARY = "Boot Processor firmware"
+DESCRIPTION = "Boot Processor firmware"
+DEPENDS += "virtual/trusted-firmware-a"
+
+LIC_FILES_CHKSUM = "file://license.md;md5=e44b2531cd6ffe9dece394dbe988d9a0 \
+                    file://cmsis/LICENSE.txt;md5=e3fc50a88d0a364313df4b21ef20c29e"
+
+COMPATIBLE_MACHINE = "(corstone700-*)"
+SCP_PLATFORM = "corstone-700"
+
+# boot-firmware project is a fork of scp-firmware
+SRC_URI = "gitsm://git.linaro.org/landing-teams/working/arm/boot-firmware.git;protocol=https;branch=master"
+SRCREV = "a4dd1b60218b5172a94e6f44c96384b84a77588c"
+PV = "0.1.0~git${SRCPV}"
+
+B = "${WORKDIR}/build"
+
+EXTRA_OEMAKE = "PRODUCT='${SCP_PLATFORM}' \
+                BUILD_PATH=${B} \
+                CROSS_COMPILE='arm-none-eabi-' \
+               "
+do_compile_append() {
+   oe_runmake -C ${S}/tools/spitoc CC=${BUILD_CC} clean all
+}
+
+do_install() {
+    install -D -p -m 0644 ${B}/product/${SCP_PLATFORM}/se_ramfw/release/bin/firmware.bin ${D}/firmware/se_ramfw.bin
+    install -D -p -m 0644 ${B}/product/${SCP_PLATFORM}/se_romfw/release/bin/firmware.bin ${D}/firmware/se_romfw.bin
+    ${S}/tools/spitoc/spitoc \
+    --seram ${D}/firmware/se_ramfw.bin \
+    --offset 1  \
+    --fip ${RECIPE_SYSROOT}/firmware/fip.bin-${TFA_PLATFORM} \
+    --offset  33 \
+    --out ${D}/firmware/spitoc.bin
+}
diff --git a/meta-arm-bsp/recipes-bsp/scp-firmware/scp-firmware_%.bbappend b/meta-arm-bsp/recipes-bsp/scp-firmware/scp-firmware_%.bbappend
index b760ba7..8a68704 100644
--- a/meta-arm-bsp/recipes-bsp/scp-firmware/scp-firmware_%.bbappend
+++ b/meta-arm-bsp/recipes-bsp/scp-firmware/scp-firmware_%.bbappend
@@ -6,5 +6,6 @@  MACHINE_SCP_REQUIRE_n1sdp = "scp-firmware-n1sdp.inc"
 MACHINE_SCP_REQUIRE_tc0 = "scp-firmware-tc0.inc"
 MACHINE_SCP_REQUIRE_juno = "scp-firmware-juno.inc"
 MACHINE_SCP_REQUIRE_sgi575 = "scp-firmware-sgi575.inc"
+MACHINE_SCP_REQUIRE_corstone700 = "scp-firmware-corstone700.inc"
 
 require ${MACHINE_SCP_REQUIRE}