From f36666eb635cd4e40a7904080a930a7536c480b1 Mon Sep 17 00:00:00 2001 From: Khasim Mohammed Date: Tue, 2 Jun 2020 17:52:44 +0100 Subject: [PATCH] meta-arm: Add SCP MCP build support SCP-firmware provides a software reference implementation for the System Control Processor (SCP) and Manageability Control Processor (MCP) components found in several Arm Compute Sub-Systems. This patch set adds support to fetch and build SCP and MCP firmware binaries Issue-Id: PLATFORMS-3134 Change-Id: Ic7259bb430c9e7e9711c9c8bc3283aafaacdf707 Signed-off-by: Patrik Berglund Signed-off-by: Khasim Syed Mohammed Signed-off-by: Jon Mason --- .../recipes-bsp/scp-firmware/scp-firmware.inc | 71 +++++++++++++++++++ .../scp-firmware/scp-firmware_git.bb | 20 ++++++ 2 files changed, 91 insertions(+) create mode 100644 meta-arm/recipes-bsp/scp-firmware/scp-firmware.inc create mode 100644 meta-arm/recipes-bsp/scp-firmware/scp-firmware_git.bb diff --git a/meta-arm/recipes-bsp/scp-firmware/scp-firmware.inc b/meta-arm/recipes-bsp/scp-firmware/scp-firmware.inc new file mode 100644 index 00000000..18738481 --- /dev/null +++ b/meta-arm/recipes-bsp/scp-firmware/scp-firmware.inc @@ -0,0 +1,71 @@ +SUMMARY = "SCP and MCP Firmware" + +PROVIDES += "virtual/control-processor-firmware" + +SCP_BUILD_RELEASE ?= "1" +SCP_COMPILE_VERBOSE ?= "0" +SCP_PLATFORM ?= "invalid" +SCP_COMPILER ?= "arm-none-eabi" + +DEPENDS += "virtual/arm-none-eabi-gcc-native" + +SCP_BUILD_STR = "${@bb.utils.contains('SCP_BUILD_RELEASE', '1', 'release', 'debug', d)}" +SCP_COMP_STR = "${@bb.utils.contains('SCP_COMPILE_VERBOSE', '0', '', 'V=1', d)}" + +inherit python3native +inherit deploy + +B = "${WORKDIR}/build" +S = "${WORKDIR}/src" + +# Allow platform specific copying of only scp or both scp & mcp, default to both +FW_TARGETS ?= "scp mcp" + +COMPATIBLE_MACHINE ?= "invalid" + +LDFLAGS[unexport] = "1" + +# The gcc-arm-none-eabi version does not support -fmacro-prefix-max +DEBUG_PREFIX_MAP_pn-scp = "\ + -fdebug-prefix-map=${WORKDIR}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR} \ + -fdebug-prefix-map=${STAGING_DIR_HOST}= \ + -fdebug-prefix-map=${STAGING_DIR_NATIVE}= \ +" + +# No configure +do_configure[noexec] = "1" + +EXTRA_OEMAKE = "${SCP_COMP_STR} \ + BUILD_PATH='${B}' \ + PRODUCT='${SCP_PLATFORM}' \ + MODE='${SCP_BUILD_STR}' \ + CC='${SCP_COMPILER}-gcc' \ + AR='${SCP_COMPILER}-ar' \ + SIZE='${SCP_COMPILER}-size' \ + OBJCOPY='${SCP_COMPILER}-objcopy' \ + " + +do_compile() { + oe_runmake -C "${S}" ${EXTRA_OEMAKE} +} +do_compile[cleandirs] += "${B}" + +do_install() { + install -d ${D}/firmware + for FW in ${FW_TARGETS}; do + for TYPE in ramfw romfw; do + install -D "${B}/product/${SCP_PLATFORM}/${FW}_${TYPE}/release/bin/${FW}_${TYPE}.bin" "${D}/firmware/" + done + done +} + +FILES_${PN} = "/firmware" +SYSROOT_DIRS += "/firmware" +# Skip QA check for relocations in .text of elf binaries +INSANE_SKIP_${PN} = "textrel" + +do_deploy() { + # Copy the images to deploy directory + cp -rf ${D}/firmware/* ${DEPLOYDIR}/ +} +addtask deploy after do_install diff --git a/meta-arm/recipes-bsp/scp-firmware/scp-firmware_git.bb b/meta-arm/recipes-bsp/scp-firmware/scp-firmware_git.bb new file mode 100644 index 00000000..5ff58591 --- /dev/null +++ b/meta-arm/recipes-bsp/scp-firmware/scp-firmware_git.bb @@ -0,0 +1,20 @@ +DESCRIPTION = "Firmware for SCP and MCP software reference implementation" +HOMEPAGE = "https://github.com/ARM-software/SCP-firmware" + +LICENSE = "BSD-3-Clause & Apache-2.0" + +# SCP +LIC_FILES_CHKSUM = "file://license.md;beginline=5;md5=9db9e3d2fb8d9300a6c3d15101b19731" +# CMSIS +LIC_FILES_CHKSUM += "file://cmsis/LICENSE.txt;md5=e3fc50a88d0a364313df4b21ef20c29e" + +SRC_URI = "\ + git://github.com/ARM-software/SCP-firmware.git;protocol=https;name=scp;destsuffix=src;nobranch=1 \ + git://github.com/ARM-software/CMSIS_5.git;protocol=https;name=cmsis;destsuffix=src/cmsis;lfs=0;nobranch=1 \ +" + +SRCREV_scp = "db19910aca6d1032eb0329e5fbb70a92b997f6f2" +SRCREV_cmsis = "refs/tags/5.2.0" +SRCREV_FORMAT = "scp_cmsis" + +require scp-firmware.inc