From 99a72aa1899236a568c36a16c7254c6bf3d2d0dd Mon Sep 17 00:00:00 2001 From: Gabriel Valcazar Date: Wed, 22 Dec 2021 15:48:57 +0100 Subject: [PATCH] hardknott: imx-boot: explicitly set IMX_BOOT_SOC_TARGET and ATF_PLATFORM These variables were originally set in NXP's recipes, but they moved their definitions to each platform's configuration file. Set the appropriate values where needed. While at it, replace every mention of the SOC_TARGET variable with its new name, IMX_BOOT_SOC_TARGET. Signed-off-by: Gabriel Valcazar --- meta-digi-arm/conf/machine/ccimx8mm-dvk.conf | 2 ++ meta-digi-arm/conf/machine/ccimx8mn-dvk.conf | 2 ++ .../conf/machine/include/ccimx8x.inc | 2 ++ .../imx-mkimage/imx-boot_1.0.bbappend | 20 +++++++++++-------- 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/meta-digi-arm/conf/machine/ccimx8mm-dvk.conf b/meta-digi-arm/conf/machine/ccimx8mm-dvk.conf index 3b7c4ea4a..db7a6a179 100644 --- a/meta-digi-arm/conf/machine/ccimx8mm-dvk.conf +++ b/meta-digi-arm/conf/machine/ccimx8mm-dvk.conf @@ -19,6 +19,8 @@ SPL_BINARY = "spl/u-boot-spl.bin" # Set u-boot DTB UBOOT_DTB_NAME = "ccimx8mm-dvk.dtb" +ATF_PLATFORM = "imx8mm" + KERNEL_DEVICETREE ?= " \ digi/ccimx8mm-dvk.dtb \ digi/_ov_board_flexspi_ccimx8m-dvk.dtbo \ diff --git a/meta-digi-arm/conf/machine/ccimx8mn-dvk.conf b/meta-digi-arm/conf/machine/ccimx8mn-dvk.conf index 15cc06038..aeea53516 100644 --- a/meta-digi-arm/conf/machine/ccimx8mn-dvk.conf +++ b/meta-digi-arm/conf/machine/ccimx8mn-dvk.conf @@ -19,6 +19,8 @@ SPL_BINARY = "spl/u-boot-spl.bin" # Set u-boot DTB UBOOT_DTB_NAME = "ccimx8mn-dvk.dtb" +ATF_PLATFORM = "imx8mn" + KERNEL_DEVICETREE ?= " \ digi/ccimx8mn-dvk.dtb \ digi/_ov_board_flexspi_ccimx8m-dvk.dtbo \ diff --git a/meta-digi-arm/conf/machine/include/ccimx8x.inc b/meta-digi-arm/conf/machine/include/ccimx8x.inc index 8e23bc5da..2ca8e15c5 100644 --- a/meta-digi-arm/conf/machine/include/ccimx8x.inc +++ b/meta-digi-arm/conf/machine/include/ccimx8x.inc @@ -34,6 +34,8 @@ RAM_CONFIGS = "512MB_16bit 1GB_16bit 1GB_32bit 2GB_32bit" # the imx-boot recipe. SOC_REVISIONS = "B0 C0" +ATF_PLATFORM = "imx8qx" + # 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 f73362600..82a9d97c0 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 @@ -97,6 +97,10 @@ SRC_URI_append_ccimx8m = " file://0001-imx8m-soc.mak-preserve-dtbs-after-build.p IMX_EXTRA_FIRMWARE_ccimx8x = "digi-sc-firmware imx-seco" +IMX_BOOT_SOC_TARGET_mx8mm = "iMX8MM" +IMX_BOOT_SOC_TARGET_mx8mn = "iMX8MN" +IMX_BOOT_SOC_TARGET_mx8x = "iMX8QX" + DEPENDS_append_ccimx8x = " coreutils-native" DEPENDS_append_mx8 += "${@oe.utils.conditional('TRUSTFENCE_SIGN', '1', 'trustfence-sign-tools-native', '', d)}" @@ -179,7 +183,7 @@ do_compile () { fi # mkimage for i.MX8 for type in ${UBOOT_CONFIG}; do - if [ "${SOC_TARGET}" = "iMX8QX" ]; then + if [ "${IMX_BOOT_SOC_TARGET}" = "iMX8QX" ]; then RAM_SIZE="$(echo ${type} | sed -e 's,.*[a-z]\+\([0-9]\+[M|G]B\)$,\1,g')" for ramc in ${RAM_CONFIGS}; do if echo "${ramc}" | grep -qs "${RAM_SIZE}"; then @@ -190,8 +194,8 @@ do_compile () { cd - for target in ${IMXBOOT_TARGETS}; do 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} > ${S}/mkimage-${target}.log 2>&1 + bbnote "building ${IMX_BOOT_SOC_TARGET} - ${ramc} - REV=${rev} ${target}" + make SOC=${IMX_BOOT_SOC_TARGET} dtbs=${UBOOT_DTB_NAME} REV=${rev} ${target} > ${S}/mkimage-${target}.log 2>&1 if [ -e "${BOOT_STAGING}/flash.bin" ]; then cp ${BOOT_STAGING}/flash.bin ${S}/${UBOOT_PREFIX}-${MACHINE}-${rev}-${ramc}.bin-${target} fi @@ -208,21 +212,21 @@ do_compile () { else # mkimage for i.MX8M for target in ${IMXBOOT_TARGETS}; do - bbnote "building ${SOC_TARGET} - ${REV_OPTION} ${target}" - make SOC=${SOC_TARGET} dtbs=${UBOOT_DTB_NAME} ${REV_OPTION} ${target} > ${S}/mkimage-${target}.log 2>&1 + bbnote "building ${IMX_BOOT_SOC_TARGET} - ${REV_OPTION} ${target}" + make SOC=${IMX_BOOT_SOC_TARGET} dtbs=${UBOOT_DTB_NAME} ${REV_OPTION} ${target} > ${S}/mkimage-${target}.log 2>&1 if [ -e "${BOOT_STAGING}/flash.bin" ]; then cp ${BOOT_STAGING}/flash.bin ${S}/${UBOOT_PREFIX}-${MACHINE}.bin-${target} fi done # Log HAB FIT information - bbnote "building ${SOC_TARGET} - print_fit_hab" - make SOC=${SOC_TARGET} dtbs=${UBOOT_DTB_NAME} print_fit_hab > ${S}/mkimage-print_fit_hab.log 2>&1 + bbnote "building ${IMX_BOOT_SOC_TARGET} - print_fit_hab" + make SOC=${IMX_BOOT_SOC_TARGET} dtbs=${UBOOT_DTB_NAME} print_fit_hab > ${S}/mkimage-print_fit_hab.log 2>&1 fi done # Check that SCFW was built at least once - if [ "${SOC_TARGET}" = "iMX8QX" and "${SCFWBUILT}" != "yes" ]; then + if [ "${IMX_BOOT_SOC_TARGET}" = "iMX8QX" and "${SCFWBUILT}" != "yes" ]; then bbfatal "SCFW was not built!" fi }