1
0
mirror of https://git.yoctoproject.org/meta-arm synced 2026-05-31 00:39:57 +00:00

arm-bsp/scp-firmware: Migrate SCP firmware recipes from Makefile to Cmake

Signed-off-by: Rupinderjit Singh <rupinderjit.singh@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
This commit is contained in:
Rupinderjit Singh
2022-06-20 16:59:31 +01:00
committed by Jon Mason
parent 391ba0be67
commit 5cb7b14e03
2 changed files with 54 additions and 21 deletions
@@ -5,3 +5,12 @@ COMPATIBLE_MACHINE = "juno"
SCP_PLATFORM = "juno" SCP_PLATFORM = "juno"
FW_TARGETS = "scp" FW_TARGETS = "scp"
FW_INSTALL:append = " romfw_bypass" FW_INSTALL:append = " romfw_bypass"
do_install:append() {
for TYPE in ${FW_INSTALL}; do
if [ "$TYPE" = "romfw_bypass" ]; then
install -D "${B}/${TYPE}/${FW_TARGETS}/bin/${SCP_PLATFORM}-bl1-bypass.bin" "${D}/firmware/${FW}_${TYPE}.bin"
install -D "${B}/${TYPE}/${FW_TARGETS}/bin/${SCP_PLATFORM}-bl1-bypass" "${D}/firmware/${FW}_${TYPE}.elf"
fi
done
}
@@ -16,9 +16,14 @@ SCP_BUILD_RELEASE ?= "1"
SCP_PLATFORM ?= "invalid" SCP_PLATFORM ?= "invalid"
SCP_COMPILER ?= "arm-none-eabi" SCP_COMPILER ?= "arm-none-eabi"
SCP_LOG_LEVEL ?= "WARN" SCP_LOG_LEVEL ?= "WARN"
SCP_PLATFORM_FEATURE_SET ?= "0"
INHIBIT_DEFAULT_DEPS = "1" INHIBIT_DEFAULT_DEPS = "1"
DEPENDS = "virtual/arm-none-eabi-gcc-native" 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 # For now we only build with GCC, so stop meta-clang trying to get involved
TOOLCHAIN = "gcc" TOOLCHAIN = "gcc"
@@ -32,37 +37,56 @@ S = "${WORKDIR}/git"
# Allow platform specific copying of only scp or both scp & mcp, default to both # Allow platform specific copying of only scp or both scp & mcp, default to both
FW_TARGETS ?= "scp mcp" FW_TARGETS ?= "scp mcp"
FW_INSTALL ?= "ramfw romfw" FW_INSTALL ?= "ramfw romfw"
PACKAGE_ARCH = "${MACHINE_ARCH}" PACKAGE_ARCH = "${MACHINE_ARCH}"
COMPATIBLE_MACHINE ?= "invalid" COMPATIBLE_MACHINE ?= "invalid"
LDFLAGS[unexport] = "1" LDFLAGS[unexport] = "1"
CFLAGS[unexport] = "1"
# No configure EXTRA_OECMAKE = "-D CMAKE_BUILD_TYPE=${SCP_BUILD_STR} \
do_configure[noexec] = "1" -D SCP_LOG_LEVEL=${SCP_LOG_LEVEL} \
-D SCP_PLATFORM_FEATURE_SET=${SCP_PLATFORM_FEATURE_SET} \
EXTRA_OEMAKE = "V=1 \
BUILD_PATH='${B}' \
PRODUCT='${SCP_PLATFORM}' \
MODE='${SCP_BUILD_STR}' \
LOG_LEVEL='${SCP_LOG_LEVEL}' \
CC='${SCP_COMPILER}-gcc' \
AR='${SCP_COMPILER}-ar' \
SIZE='${SCP_COMPILER}-size' \
OBJCOPY='${SCP_COMPILER}-objcopy' \
" "
do_compile() { do_configure() {
oe_runmake -C "${S}" 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
cmake --build ${B}/${TYPE}/${FW} --target all
done
done
} }
do_compile[cleandirs] += "${B}"
do_install() { do_install() {
install -d ${D}/firmware install -d ${D}/firmware
for FW in ${FW_TARGETS}; do for TYPE in ${FW_INSTALL}; do
for TYPE in ${FW_INSTALL}; do for FW in ${FW_TARGETS}; do
install -D "${B}/product/${SCP_PLATFORM}/${FW}_${TYPE}/${SCP_BUILD_STR}/bin/${FW}_${TYPE}.bin" "${D}/firmware/" if [ "$TYPE" = "romfw" ]; then
install -D "${B}/product/${SCP_PLATFORM}/${FW}_${TYPE}/${SCP_BUILD_STR}/bin/${FW}_${TYPE}.elf" "${D}/firmware/" 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" "${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" "${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" "${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" "${D}/firmware/${FW}_${TYPE}.elf"
fi
fi
done done
done done
} }