From 3fbd38ca46902eaf01e3850fad58b6e7daa2555f Mon Sep 17 00:00:00 2001 From: Gabriel Valcazar Date: Mon, 4 May 2020 17:31:43 +0200 Subject: [PATCH] imx-boot: build ccimx8x images for B0 and C0 silicon revisions Modify the imx-seco recipe so it deploys the B0 and C0 versions of the SECO firmware, Then, modify the imx-boot recipe so it builds every possible combination of: * RAM configuration * imx-boot target (with and without M4 demos) * Silicon revision https://jira.digi.com/browse/DEL-7069 Signed-off-by: Gabriel Valcazar --- .../conf/machine/include/ccimx8x.inc | 7 +++ .../imx-mkimage/imx-boot_1.0.bbappend | 48 +++++++++++-------- .../recipes-bsp/imx-seco/imx-seco.inc | 4 ++ 3 files changed, 38 insertions(+), 21 deletions(-) diff --git a/meta-digi-arm/conf/machine/include/ccimx8x.inc b/meta-digi-arm/conf/machine/include/ccimx8x.inc index da8569aea..7489684fa 100644 --- a/meta-digi-arm/conf/machine/include/ccimx8x.inc +++ b/meta-digi-arm/conf/machine/include/ccimx8x.inc @@ -26,6 +26,13 @@ SDIMG_BOOTLOADER = "${DEPLOY_DIR_IMAGE}/${BOOTABLE_FILENAME}" # Last one is the default (the one the symlinks point at) RAM_CONFIGS = "1.2GHz_512MB_16bit 1.2GHz_1GB_16bit 1.2GHz_1GB_32bit 1.2GHz_2GB_32bit" +# The original variable used by NXP to store the mkimage "REV" parameter, +# REV_OPTION, has a format of "REV=X0". Since we are interested in building +# images for multiple revisions and using the revision in the imx-boot filename, +# use a new variable for our redefined compile, install and deploy functions in +# the imx-boot recipe. +SOC_REVISIONS = "B0 C0" + # Linux kernel configuration KERNEL_DEFCONFIG ?= "arch/arm64/configs/ccimx8_defconfig" diff --git a/meta-digi-arm/recipes-bsp/imx-mkimage/imx-boot_1.0.bbappend b/meta-digi-arm/recipes-bsp/imx-mkimage/imx-boot_1.0.bbappend index 2e77ecced..547e7ef77 100644 --- a/meta-digi-arm/recipes-bsp/imx-mkimage/imx-boot_1.0.bbappend +++ b/meta-digi-arm/recipes-bsp/imx-mkimage/imx-boot_1.0.bbappend @@ -72,12 +72,14 @@ do_compile () { ln -sf ${SC_FIRMWARE_NAME}-${ramc} scfw_tcm.bin cd - for target in ${IMXBOOT_TARGETS}; do - bbnote "building ${SOC_TARGET} - ${ramc} - ${REV_OPTION} ${target}" - make SOC=${SOC_TARGET} dtbs=${UBOOT_DTB_NAME} ${REV_OPTION} ${target} - if [ -e "${BOOT_STAGING}/flash.bin" ]; then - cp ${BOOT_STAGING}/flash.bin ${S}/${UBOOT_PREFIX}-${MACHINE}-${ramc}.bin-${target} - fi - SCFWBUILT="yes" + for rev in ${SOC_REVISIONS}; do + bbnote "building ${SOC_TARGET} - ${ramc} - REV=${rev} ${target}" + make SOC=${SOC_TARGET} dtbs=${UBOOT_DTB_NAME} REV=${rev} ${target} + if [ -e "${BOOT_STAGING}/flash.bin" ]; then + cp ${BOOT_STAGING}/flash.bin ${S}/${UBOOT_PREFIX}-${MACHINE}-${rev}-${ramc}.bin-${target} + fi + SCFWBUILT="yes" + done done rm ${BOOT_STAGING}/scfw_tcm.bin rm ${BOOT_STAGING}/u-boot.bin @@ -122,7 +124,9 @@ do_install () { else for ramc in ${UBOOT_RAM_COMBINATIONS}; do for target in ${IMXBOOT_TARGETS}; do - install -m 0644 ${S}/${UBOOT_PREFIX}-${MACHINE}-${ramc}.bin-${target} ${D}/boot/ + for rev in ${SOC_REVISIONS}; do + install -m 0644 ${S}/${UBOOT_PREFIX}-${MACHINE}-${rev}-${ramc}.bin-${target} ${D}/boot/ + done done done fi @@ -156,21 +160,23 @@ do_deploy () { ln -sf mkimage-${IMAGE_IMXBOOT_TARGET}.log mkimage.log else for ramc in ${UBOOT_RAM_COMBINATIONS}; do - IMAGE_IMXBOOT_TARGET="" - for target in ${IMXBOOT_TARGETS}; do - # Use first "target" as IMAGE_IMXBOOT_TARGET - if [ "$IMAGE_IMXBOOT_TARGET" = "" ]; then - IMAGE_IMXBOOT_TARGET="$target" - echo "Set boot target as $IMAGE_IMXBOOT_TARGET" - fi - install -m 0644 ${S}/${UBOOT_PREFIX}-${MACHINE}-${ramc}.bin-${target} ${DEPLOYDIR} + for rev in ${SOC_REVISIONS}; do + IMAGE_IMXBOOT_TARGET="" + for target in ${IMXBOOT_TARGETS}; do + # Use first "target" as IMAGE_IMXBOOT_TARGET + if [ "$IMAGE_IMXBOOT_TARGET" = "" ]; then + IMAGE_IMXBOOT_TARGET="$target" + echo "Set boot target as $IMAGE_IMXBOOT_TARGET" + fi + install -m 0644 ${S}/${UBOOT_PREFIX}-${MACHINE}-${rev}-${ramc}.bin-${target} ${DEPLOYDIR} + done + cd ${DEPLOYDIR} + ln -sf ${UBOOT_PREFIX}-${MACHINE}-${rev}-${ramc}.bin-${IMAGE_IMXBOOT_TARGET} ${UBOOT_PREFIX}-${MACHINE}-${rev}-${ramc}.bin + # Link to default bootable U-Boot filename. It gets overwritten + # on every loop so the only last RAM_CONFIG will survive. + ln -sf ${UBOOT_PREFIX}-${MACHINE}-${rev}-${ramc}.bin-${IMAGE_IMXBOOT_TARGET} ${BOOTABLE_FILENAME} + cd - done - cd ${DEPLOYDIR} - ln -sf ${UBOOT_PREFIX}-${MACHINE}-${ramc}.bin-${IMAGE_IMXBOOT_TARGET} ${UBOOT_PREFIX}-${MACHINE}-${ramc}.bin - # Link to default bootable U-Boot filename. It gets overwritten - # on every loop so the only last RAM_CONFIG will survive. - ln -sf ${UBOOT_PREFIX}-${MACHINE}-${ramc}.bin-${IMAGE_IMXBOOT_TARGET} ${BOOTABLE_FILENAME} - cd - done fi diff --git a/meta-digi-arm/recipes-bsp/imx-seco/imx-seco.inc b/meta-digi-arm/recipes-bsp/imx-seco/imx-seco.inc index ab6b19724..4e7f1a665 100644 --- a/meta-digi-arm/recipes-bsp/imx-seco/imx-seco.inc +++ b/meta-digi-arm/recipes-bsp/imx-seco/imx-seco.inc @@ -4,3 +4,7 @@ SECO_FIRMWARE_NAME_mx8qxp = "mx8qxb0-ahab-container.img" SECO_FIRMWARE_NAME_mx8qxpc0 = "mx8qxc0-ahab-container.img" SECO_FIRMWARE_NAME_mx8phantomdxl = "mx8qxb0-ahab-container.img" SECO_FIRMWARE_NAME_mx8dxl = "mx8dxla0-ahab-container.img" + +# For the ccimx8x, we generate images for both the B0 and the C0 revisions of +# the i.MX8X silicon, so deploy both versions of the firmware. +SECO_FIRMWARE_NAME_ccimx8x = "mx8qx*0-ahab-container.img"