Append the scp firmware recipe.
Signed-off-by: Pawel Zalewski pzalewski@thegoodpenguin.co.uk --- conf/machine/morello-bsp.conf | 5 ++ .../scp-firmware/scp-firmware_2.10.%.bbappend | 80 +++++++++++++++++++ 2 files changed, 85 insertions(+) create mode 100644 recipes-bsp/scp-firmware/scp-firmware_2.10.%.bbappend
diff --git a/conf/machine/morello-bsp.conf b/conf/machine/morello-bsp.conf index e5c8799..ee40190 100644 --- a/conf/machine/morello-bsp.conf +++ b/conf/machine/morello-bsp.conf @@ -1 +1,6 @@ require conf/machine/include/morello-common.inc + +PREFERRED_VERSION_scp-firmware ?= "2.10%" + + +TMPDIR = "${TOPDIR}/${TMPDIR_BSP}" \ No newline at end of file diff --git a/recipes-bsp/scp-firmware/scp-firmware_2.10.%.bbappend b/recipes-bsp/scp-firmware/scp-firmware_2.10.%.bbappend new file mode 100644 index 0000000..2c01711 --- /dev/null +++ b/recipes-bsp/scp-firmware/scp-firmware_2.10.%.bbappend @@ -0,0 +1,80 @@ +inherit cmake nopackages + +COMPATIBLE_MACHINE = "morello" +OUTPUTS_NAME = "scp-firmware" +SECTION = "firmware" + +DEPENDS += "virtual/board-firmware" + +PROVIDES += "virtual/${OUTPUTS_NAME}" + +SRC_URI = "gitsm://git.morello-project.org/morello/scp-firmware.git;protocol=https;branch=${SRCBRANCH}" +SRCREV = "${AUTOREV}" +PV = "2.10.0+git${SRCPV}" + +SRCBRANCH = "morello/master" + +SCP_PLATFORM = "morello" +SCP_LOG_LEVEL = "INFO" + +SENSOR = "${RECIPE_SYSROOT}/board-firmware/LIB/sensor.a" +B = "${WORKDIR}/build/morello" +S = "${WORKDIR}/git" +FILES:${PN} = "/${OUTPUTS_NAME}" +SYSROOT_DIRS += "/${OUTPUTS_NAME}" + +FW_TARGETS = "scp mcp" +FW_INSTALL = "ramfw_soc romfw" + +INHIBIT_DEFAULT_DEPS = "1" + +unset do_configure[noexec] +unset do_compile[cleandirs] +do_deploy[noexec] = "1" + +do_configure() { + + cd ${S} + + for FW in ${FW_TARGETS}; do + for TYPE in ${FW_INSTALL}; do + + local target="${FW}_${TYPE}" + + local extra_cmake="\ + -DSCP_ENABLE_DEBUGGER='0' \ + -DSCP_FIRMWARE_SOURCE_DIR:PATH='${SCP_PLATFORM}/${target}' \ + -DSCP_TOOLCHAIN:STRING='GNU' \ + -DDISABLE_CPPCHECK='1' \ + -DCMAKE_BUILD_TYPE=Release \ + " + + if [ "${target}" = "scp_ramfw_soc" ]; then + extra_cmake="${extra_cmake} -DSCP_MORELLO_SENSOR_LIB_PATH='${SENSOR}'" + fi + + local builddir="${B}/${target}" + cmake -S ${S} -B ${builddir} ${extra_cmake} + done + done +} + +do_compile() { + cd ${S} + for FW in ${FW_TARGETS}; do + for TYPE in ${FW_INSTALL}; do + local target="${FW}_${TYPE}" + cmake --build "${B}/${target}" + done + done +} + +do_install() { + install -d ${D}/firmware + for FW in ${FW_TARGETS}; do + for TYPE in ${FW_INSTALL}; do + local target="${FW}_${TYPE}" + cp -rf "${B}/${target}/bin/"*.bin "${D}/firmware/${target}.bin" + done + done +} \ No newline at end of file