From 45db18727813b50b8f16a04830f82f7280f55591 Mon Sep 17 00:00:00 2001 From: Maxim Paymushkin Date: Mon, 27 Feb 2023 21:26:44 +0100 Subject: u-boot-imx: deploy multiple boot images for i.MX 8M if env UBOOT_CONFIG contains multiple U-boot configurations, then "do_deploy_append_mx8m" always returns an error due to installing the same dtb-file defined in env UBOOT_DTB_NAME. Even env UBOOT_DTB_NAME contains the same dtb-name for all U-boot configs it can not be used without an extra suffix (U-boot config) because different U-boot configs can generate different dtb files based on the same dts file. In case different UBOOT_DTB_NAMEs are used in U-boot configurations, then the same flags for env UBOOT_DTB_NAME must be used in the machine configuration as in U-boot configurations. UBOOT_CONFIG = "a b" UBOOT_DTB_NAME[a] = "a.dtb" UBOOT_DTB_NAME[b] = "b.dtb" See PR #1439 and #1642 Signed-off-by: Maxim Paymushkin Signed-off-by: Daiane Angolini --- recipes-bsp/u-boot/u-boot-imx_2023.04.bb | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/recipes-bsp/u-boot/u-boot-imx_2023.04.bb b/recipes-bsp/u-boot/u-boot-imx_2023.04.bb index 3d588564..14c226f7 100644 --- a/recipes-bsp/u-boot/u-boot-imx_2023.04.bb +++ b/recipes-bsp/u-boot/u-boot-imx_2023.04.bb @@ -27,8 +27,27 @@ do_deploy:append:mx8m-generic-bsp() { if [ $j -eq $i ] then install -d ${DEPLOYDIR}/${BOOT_TOOLS} - install -m 0644 ${B}/${config}/arch/arm/dts/${UBOOT_DTB_NAME} ${DEPLOYDIR}/${BOOT_TOOLS} - install -m 0644 ${B}/${config}/u-boot-nodtb.bin ${DEPLOYDIR}/${BOOT_TOOLS}/u-boot-nodtb.bin-${MACHINE}-${type} + install -m 0644 ${B}/${config}/u-boot-nodtb.bin ${DEPLOYDIR}/${BOOT_TOOLS}/u-boot-nodtb.bin-${MACHINE}-${type} + UBOOT_DTB_NAME_FLAGS="${type}:${UBOOT_DTB_NAME}" + for key_value in ${UBOOT_DTB_NAME_FLAGS}; do + local type_key="${key_value%%:*}" + local dtb_name="${key_value#*:}" + if [ "$type_key" = "$type" ] + then + bbnote "UBOOT_CONFIG = $type, UBOOT_DTB_NAME = $dtb_name" + # There is only one ${dtb_name}, the first one. All the other are with the type appended + if [ ! -f "${DEPLOYDIR}/${BOOT_TOOLS}/${dtb_name}" ]; then + install -m 0644 ${B}/${config}/arch/arm/dts/${dtb_name} ${DEPLOYDIR}/${BOOT_TOOLS}/${dtb_name} + else + bbwarn "Use custom wks.in for $dtb_name = $type" + fi + install -m 0644 ${B}/${config}/arch/arm/dts/${dtb_name} ${DEPLOYDIR}/${BOOT_TOOLS}/${dtb_name}-${type} + fi + unset type_key + unset dtb_name + done + + unset UBOOT_DTB_NAME_FLAGS fi done unset j -- cgit v1.2.3-54-g00ecf