diff mbox series

[1/3] arm/scp-firmware: add recipe for 2.11

Message ID 20230405142355.1703355-1-ross.burton@arm.com
State New
Headers show
Series [1/3] arm/scp-firmware: add recipe for 2.11 | expand

Commit Message

Ross Burton April 5, 2023, 2:23 p.m. UTC
The install task is subtly different as the ELF binaries are named .elf
now, instead of having no extension.

Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 .../scp-firmware/scp-firmware_2.11.0.bb       | 111 ++++++++++++++++++
 1 file changed, 111 insertions(+)
 create mode 100644 meta-arm/recipes-bsp/scp-firmware/scp-firmware_2.11.0.bb

Comments

Jon Mason April 5, 2023, 10:08 p.m. UTC | #1
On Wed, 5 Apr 2023 15:23:53 +0100, Ross Burton wrote:
> The install task is subtly different as the ELF binaries are named .elf
> now, instead of having no extension.

Applied, thanks!

[1/3] arm/scp-firmware: add recipe for 2.11
      commit: 794c7bfd129abeb98fdb62d475e92700503079f5
[2/3] arm-bsp/scp-firmware: move all machines to SCP 2.11
      commit: 0e5f5ac81f198c7f8ea6fa6bc74aae750e873f99
[3/3] arm/scp-firmware: remove 2.10 recipe
      commit: 5a62ce85616befb4e6d61f9ee25e407e438a3392

Best regards,
diff mbox series

Patch

diff --git a/meta-arm/recipes-bsp/scp-firmware/scp-firmware_2.11.0.bb b/meta-arm/recipes-bsp/scp-firmware/scp-firmware_2.11.0.bb
new file mode 100644
index 00000000..d67e25d3
--- /dev/null
+++ b/meta-arm/recipes-bsp/scp-firmware/scp-firmware_2.11.0.bb
@@ -0,0 +1,111 @@ 
+SUMMARY = "SCP and MCP Firmware"
+DESCRIPTION = "Firmware for SCP and MCP software reference implementation"
+HOMEPAGE = "https://github.com/ARM-software/SCP-firmware"
+
+LICENSE = "BSD-3-Clause & Apache-2.0"
+LIC_FILES_CHKSUM = "file://license.md;beginline=5;md5=9db9e3d2fb8d9300a6c3d15101b19731 \
+                    file://contrib/cmsis/git/LICENSE.txt;md5=e3fc50a88d0a364313df4b21ef20c29e"
+
+SRC_URI_SCP_FIRMWARE ?= "gitsm://github.com/ARM-software/SCP-firmware.git;protocol=https"
+SRC_URI = "${SRC_URI_SCP_FIRMWARE};branch=${SRCBRANCH}"
+SRCBRANCH = "master"
+
+SRCREV  = "635697544170b78167ed698393a72d6e522032e1"
+
+PROVIDES += "virtual/control-processor-firmware"
+
+CMAKE_BUILD_TYPE    ?= "RelWithDebInfo"
+SCP_PLATFORM        ?= "invalid"
+SCP_COMPILER        ?= "arm-none-eabi"
+SCP_LOG_LEVEL       ?= "WARN"
+SCP_PLATFORM_FEATURE_SET ?= "0"
+
+INHIBIT_DEFAULT_DEPS = "1"
+DEPENDS = "virtual/arm-none-eabi-gcc-native \
+           cmake-native \
+           ninja-native \
+          "
+
+# For now we only build with GCC, so stop meta-clang trying to get involved
+TOOLCHAIN = "gcc"
+
+inherit deploy
+
+B = "${WORKDIR}/build"
+S = "${WORKDIR}/git"
+
+# Allow platform specific copying of only scp or both scp & mcp, default to both
+FW_TARGETS ?= "scp mcp"
+FW_INSTALL ?= "ramfw romfw"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+COMPATIBLE_MACHINE ?= "invalid"
+
+export CFLAGS = "${DEBUG_PREFIX_MAP}"
+export ASMFLAGS = "${DEBUG_PREFIX_MAP}"
+
+LDFLAGS[unexport] = "1"
+
+EXTRA_OECMAKE = "-D CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \
+                 -D SCP_LOG_LEVEL=${SCP_LOG_LEVEL} \
+                 -D SCP_PLATFORM_FEATURE_SET=${SCP_PLATFORM_FEATURE_SET} \
+                 -D DISABLE_CPPCHECK=1 \
+                "
+
+do_configure() {
+    for FW in ${FW_TARGETS}; do
+        for TYPE in ${FW_INSTALL}; do
+            cmake -GNinja ${EXTRA_OECMAKE} -S ${S} -B "${B}/${TYPE}/${FW}" -D SCP_FIRMWARE_SOURCE_DIR="${SCP_PLATFORM}/${FW}_${TYPE}"
+        done
+    done
+}
+
+do_configure[cleandirs] += "${B}"
+
+do_compile() {
+    for FW in ${FW_TARGETS}; do
+        for TYPE in ${FW_INSTALL}; do
+            VERBOSE=1 cmake --build ${B}/${TYPE}/${FW} --target all
+        done
+    done
+}
+
+do_install() {
+    install -d ${D}/firmware
+    for TYPE in ${FW_INSTALL}; do
+        for FW in ${FW_TARGETS}; do
+           if [ "$TYPE" = "romfw" ]; then
+               if [ "$FW" = "scp" ]; then
+                   install -D "${B}/${TYPE}/${FW}/bin/${SCP_PLATFORM}-bl1.bin" "${D}/firmware/${FW}_${TYPE}.bin"
+                   install -D "${B}/${TYPE}/${FW}/bin/${SCP_PLATFORM}-bl1.elf" "${D}/firmware/${FW}_${TYPE}.elf"
+               elif [ "$FW" = "mcp" ]; then
+                   install -D "${B}/${TYPE}/${FW}/bin/${SCP_PLATFORM}-mcp-bl1.bin" "${D}/firmware/${FW}_${TYPE}.bin"
+                   install -D "${B}/${TYPE}/${FW}/bin/${SCP_PLATFORM}-mcp-bl1.elf" "${D}/firmware/${FW}_${TYPE}.elf"
+               fi
+           elif [ "$TYPE" = "ramfw" ]; then
+               if [ "$FW" = "scp" ]; then
+                   install -D "${B}/${TYPE}/${FW}/bin/${SCP_PLATFORM}-bl2.bin" "${D}/firmware/${FW}_${TYPE}.bin"
+                   install -D "${B}/${TYPE}/${FW}/bin/${SCP_PLATFORM}-bl2.elf" "${D}/firmware/${FW}_${TYPE}.elf"
+               elif [ "$FW" = "mcp" ]; then
+                   install -D "${B}/${TYPE}/${FW}/bin/${SCP_PLATFORM}-mcp-bl2.bin" "${D}/firmware/${FW}_${TYPE}.bin"
+                   install -D "${B}/${TYPE}/${FW}/bin/${SCP_PLATFORM}-mcp-bl2.elf" "${D}/firmware/${FW}_${TYPE}.elf"
+               fi
+           fi
+       done
+    done
+}
+
+FILES:${PN} = "/firmware"
+SYSROOT_DIRS += "/firmware"
+
+FILES:${PN}-dbg += "/firmware/*.elf"
+# These binaries are specifically for 32-bit arm
+INSANE_SKIP:${PN}-dbg += "arch"
+INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
+INHIBIT_PACKAGE_STRIP = "1"
+
+do_deploy() {
+    # Copy the images to deploy directory
+    cp -rf ${D}/firmware/* ${DEPLOYDIR}/
+}
+addtask deploy after do_install