From: Andrey Zhizhikin Date: Fri, 11 Dec 2020 17:34:00 +0000 (+0000) Subject: imx-mkimage: allow to be used with mainline bsp for mx8m X-Git-Url: https://code.ossystems.io/gitweb?a=commitdiff_plain;h=6fc0971cb236284cd2ac325da677a87ca31723d8;p=meta-freescale.git imx-mkimage: allow to be used with mainline bsp for mx8m imx-boot provides a boot container, which is required for mx8m family of SOCs to execute a boot sequence. Allow the imx-boot to generate boot container for Mini, Nano and Plus SOCs by adding use-mainline-bsp to the list of compatible machines. In order to accommodate new boot container generation model, former SOC_TARGET variable has been renamed to IMX_BOOT_SOC_TARGET and should be explicitly defined in the target machine recipes. This is done to indicate that even if the mx8mm machine is finter out from MACHINEOVERRIDES by extender filter - this recipe picks up a proper target definition for boot container construction. Default ATF binary image is also now based on ATF_PLATFORM, which is explicitly defined in the machine configuration file. Current support includes only Mini, Nano and Plus SOCs from i.MX8M family, and additions of further machines would require the definition of ATF_PLATFORM and IMX_BOOT_SOC_TARGET to be moved out from imx-boot recipe to a machine configuration file. Signed-off-by: Andrey Zhizhikin --- diff --git a/conf/machine/imx8mmevk.conf b/conf/machine/imx8mmevk.conf index fcd78fb5..44e3781d 100644 --- a/conf/machine/imx8mmevk.conf +++ b/conf/machine/imx8mmevk.conf @@ -61,6 +61,7 @@ ATF_PLATFORM = "imx8mm" # Set imx-mkimage boot target IMXBOOT_TARGETS = "${@bb.utils.contains('UBOOT_CONFIG', 'fspi', 'flash_evk_flexspi', 'flash_evk', d)}" +IMX_BOOT_SOC_TARGET = "iMX8MM" # Set Serial console SERIAL_CONSOLES = "115200;ttymxc1" diff --git a/conf/machine/imx8mnevk.conf b/conf/machine/imx8mnevk.conf index fa0cb7b4..5d8f3001 100644 --- a/conf/machine/imx8mnevk.conf +++ b/conf/machine/imx8mnevk.conf @@ -49,6 +49,7 @@ ATF_PLATFORM = "imx8mn" # Set imx-mkimage boot target IMXBOOT_TARGETS = "${@bb.utils.contains('UBOOT_CONFIG', 'fspi', 'flash_ddr4_evk_flexspi', 'flash_ddr4_evk', d)}" +IMX_BOOT_SOC_TARGET = "iMX8MN" # Set Serial console SERIAL_CONSOLES = "115200;ttymxc1" diff --git a/conf/machine/imx8mpevk.conf b/conf/machine/imx8mpevk.conf index 9addae7d..1fbf0eef 100644 --- a/conf/machine/imx8mpevk.conf +++ b/conf/machine/imx8mpevk.conf @@ -56,6 +56,7 @@ ATF_PLATFORM = "imx8mp" # Set imx-mkimage boot target IMXBOOT_TARGETS = "${@bb.utils.contains('UBOOT_CONFIG', 'fspi', 'flash_evk_flexspi', 'flash_evk', d)}" +IMX_BOOT_SOC_TARGET = "iMX8MP" # Set Serial console SERIAL_CONSOLES = "115200;ttymxc1" diff --git a/recipes-bsp/imx-mkimage/imx-boot_1.0.bb b/recipes-bsp/imx-mkimage/imx-boot_1.0.bb index a54b439d..e73d3074 100644 --- a/recipes-bsp/imx-mkimage/imx-boot_1.0.bb +++ b/recipes-bsp/imx-mkimage/imx-boot_1.0.bb @@ -38,13 +38,10 @@ do_compile[depends] += " \ SC_FIRMWARE_NAME ?= "scfw_tcm.bin" -ATF_MACHINE_NAME ?= "bl31-imx8qm.bin" +ATF_MACHINE_NAME ?= "bl31-${ATF_PLATFORM}.bin" ATF_MACHINE_NAME_mx8qm = "bl31-imx8qm.bin" ATF_MACHINE_NAME_mx8x = "bl31-imx8qx.bin" ATF_MACHINE_NAME_mx8mq = "bl31-imx8mq.bin" -ATF_MACHINE_NAME_mx8mm = "bl31-imx8mm.bin" -ATF_MACHINE_NAME_mx8mn = "bl31-imx8mn.bin" -ATF_MACHINE_NAME_mx8mp = "bl31-imx8mp.bin" ATF_MACHINE_NAME_mx8phantomdxl = "bl31-imx8qx.bin" ATF_MACHINE_NAME_mx8dxl = "bl31-imx8dxl.bin" ATF_MACHINE_NAME_mx8dx = "bl31-imx8dx.bin" @@ -55,16 +52,13 @@ BOOT_CONFIG_MACHINE = "${BOOT_NAME}-${MACHINE}-${UBOOT_CONFIG}.bin" TOOLS_NAME ?= "mkimage_imx8" -SOC_TARGET ?= "INVALID" -SOC_TARGET_mx8qm = "iMX8QM" -SOC_TARGET_mx8x = "iMX8QX" -SOC_TARGET_mx8mq = "iMX8M" -SOC_TARGET_mx8mm = "iMX8MM" -SOC_TARGET_mx8mn = "iMX8MN" -SOC_TARGET_mx8mp = "iMX8MP" -SOC_TARGET_mx8dxl = "iMX8DXL" -SOC_TARGET_mx8phantomdxl = "iMX8QX" -SOC_TARGET_mx8dx = "iMX8DX" +IMX_BOOT_SOC_TARGET ?= "INVALID" +IMX_BOOT_SOC_TARGET_mx8qm = "iMX8QM" +IMX_BOOT_SOC_TARGET_mx8x = "iMX8QX" +IMX_BOOT_SOC_TARGET_mx8mq = "iMX8M" +IMX_BOOT_SOC_TARGET_mx8dxl = "iMX8DXL" +IMX_BOOT_SOC_TARGET_mx8phantomdxl = "iMX8QX" +IMX_BOOT_SOC_TARGET_mx8dx = "iMX8DX" DEPLOY_OPTEE = "${@bb.utils.contains('MACHINE_FEATURES', 'optee', 'true', 'false', d)}" @@ -73,7 +67,7 @@ IMXBOOT_TARGETS ?= \ bb.utils.contains('UBOOT_CONFIG', 'nand', 'flash_nand', \ 'flash_multi_cores flash_dcd', d), d)}" -BOOT_STAGING = "${S}/${SOC_TARGET}" +BOOT_STAGING = "${S}/${IMX_BOOT_SOC_TARGET}" BOOT_STAGING_mx8m = "${S}/iMX8M" BOOT_STAGING_mx8dx = "${S}/iMX8QX" @@ -135,11 +129,11 @@ do_compile() { compile_${SOC_FAMILY} if [ "$target" = "flash_linux_m4_no_v2x" ]; then # Special target build for i.MX 8DXL with V2X off - bbnote "building ${SOC_TARGET} - ${REV_OPTION} V2X=NO ${target}" - make SOC=${SOC_TARGET} ${REV_OPTION} V2X=NO dtbs=${UBOOT_DTB_NAME} flash_linux_m4 + bbnote "building ${IMX_BOOT_SOC_TARGET} - ${REV_OPTION} V2X=NO ${target}" + make SOC=${IMX_BOOT_SOC_TARGET} ${REV_OPTION} V2X=NO dtbs=${UBOOT_DTB_NAME} flash_linux_m4 else - bbnote "building ${SOC_TARGET} - ${REV_OPTION} ${target}" - make SOC=${SOC_TARGET} ${REV_OPTION} dtbs=${UBOOT_DTB_NAME} ${target} + bbnote "building ${IMX_BOOT_SOC_TARGET} - ${REV_OPTION} ${target}" + make SOC=${IMX_BOOT_SOC_TARGET} ${REV_OPTION} dtbs=${UBOOT_DTB_NAME} ${target} fi if [ -e "${BOOT_STAGING}/flash.bin" ]; then cp ${BOOT_STAGING}/flash.bin ${S}/${BOOT_CONFIG_MACHINE}-${target} @@ -215,4 +209,4 @@ addtask deploy before do_build after do_compile PACKAGE_ARCH = "${MACHINE_ARCH}" FILES_${PN} = "/boot" -COMPATIBLE_MACHINE = "(mx8)" +COMPATIBLE_MACHINE = "(mx8|use-mainline-bsp)"