From e806e443f90c2c5778f6c3acd73b2e3fae190aef Mon Sep 17 00:00:00 2001 From: Neal Frager Date: Thu, 22 Dec 2022 06:37:10 +0000 Subject: [PATCH] configs/zynqmp_kria_kv260_defconfig: use CONFIG_MULTI_DTB_FIT When using the buildroot compiler, it builds the u-boot.itb immediately after building the fit-dtb.blob. This causes a build failure when using the CONFIG_MULTI_DTB_FIT build configuration. This patch adds the necessary dependency to guarantee that the fit-dtb.blob has finished building before trying to build the u-boot.itb. Fixes: https://gitlab.com/buildroot.org/buildroot/-/jobs/3310463281 This patch has been submitted to u-boot mainline: https://lore.kernel.org/all/20221221075446.47141-1-neal.frager@amd.com/ Signed-off-by: Neal Frager Reviewed-by: Luca Ceresoli Signed-off-by: Peter Korsgaard (cherry picked from commit 250d7df53acdccdb3c65c941ad426f6cc0502996) Signed-off-by: Peter Korsgaard --- board/zynqmp/kria/kv260/kv260.sh | 2 +- board/zynqmp/kria/kv260/uboot.fragment | 1 + ...-0001-makefile-add-multi_dtb_fit-dep.patch | 32 +++++++++++++++++++ configs/zynqmp_kria_kv260_defconfig | 1 + 4 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 board/zynqmp/kria/patches/uboot/v1-0001-makefile-add-multi_dtb_fit-dep.patch diff --git a/board/zynqmp/kria/kv260/kv260.sh b/board/zynqmp/kria/kv260/kv260.sh index e891852009..e3467f3068 100755 --- a/board/zynqmp/kria/kv260/kv260.sh +++ b/board/zynqmp/kria/kv260/kv260.sh @@ -8,5 +8,5 @@ UBOOT_DIR=$4 -fdtoverlay -o ${UBOOT_DIR}/arch/arm/dts/zynqmp-smk-k26-revA.dtb -i ${UBOOT_DIR}/arch/arm/dts/zynqmp-smk-k26-revA.dtb ${UBOOT_DIR}/arch/arm/dts/zynqmp-sck-kv-g-revB.dtbo +fdtoverlay -o ${UBOOT_DIR}/fit-dtb.blob -i ${UBOOT_DIR}/arch/arm/dts/zynqmp-smk-k26-revA.dtb ${UBOOT_DIR}/arch/arm/dts/zynqmp-sck-kv-g-revB.dtbo ${UBOOT_DIR}/tools/mkimage -E -f ${UBOOT_DIR}/u-boot.its -B 0x8 ${BINARIES_DIR}/u-boot.itb diff --git a/board/zynqmp/kria/kv260/uboot.fragment b/board/zynqmp/kria/kv260/uboot.fragment index 0ed560c411..e9da24ef9a 100644 --- a/board/zynqmp/kria/kv260/uboot.fragment +++ b/board/zynqmp/kria/kv260/uboot.fragment @@ -1,5 +1,6 @@ CONFIG_DEFAULT_DEVICE_TREE="zynqmp-smk-k26-revA" CONFIG_SYS_SPI_U_BOOT_OFFS=0xF80000 +CONFIG_MULTI_DTB_FIT=y CONFIG_DTB_RESELECT=y CONFIG_DMA=y CONFIG_XILINX_DPDMA=y diff --git a/board/zynqmp/kria/patches/uboot/v1-0001-makefile-add-multi_dtb_fit-dep.patch b/board/zynqmp/kria/patches/uboot/v1-0001-makefile-add-multi_dtb_fit-dep.patch new file mode 100644 index 0000000000..ddc04cacac --- /dev/null +++ b/board/zynqmp/kria/patches/uboot/v1-0001-makefile-add-multi_dtb_fit-dep.patch @@ -0,0 +1,32 @@ +From 8b181bf582c17cf709a62cf499f9709c94f49d33 Mon Sep 17 00:00:00 2001 +From: Neal Frager +Date: Wed, 21 Dec 2022 07:51:42 +0000 +Subject: [PATCH v1 1/1] makefile: add multi_dtb_fit dep + +With certain gcc compilers, the u-boot.itb is built immediately after dtb +generation. If CONFIG_MULTI_DTB_FIT is used, it is possible that the +fit-dtb.blob is not finished in time. + +This patch adds a necessary dependency to guarantee that the fit-dtb.blob +is built before attempting to build the u-boot.itb. + +Signed-off-by: Neal Frager +--- + Makefile | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/Makefile b/Makefile +index b96e2ffa15..682a5d94fd 100644 +--- a/Makefile ++++ b/Makefile +@@ -1425,6 +1425,7 @@ MKIMAGEFLAGS_u-boot.itb += -B 0x8 + ifdef U_BOOT_ITS + u-boot.itb: u-boot-nodtb.bin \ + $(if $(CONFIG_OF_SEPARATE)$(CONFIG_OF_EMBED)$(CONFIG_SANDBOX),dts/dt.dtb) \ ++ $(if $(CONFIG_MULTI_DTB_FIT),$(FINAL_DTB_CONTAINER)) \ + $(U_BOOT_ITS) FORCE + $(call if_changed,mkfitimage) + $(BOARD_SIZE_CHECK) +-- +2.17.1 + diff --git a/configs/zynqmp_kria_kv260_defconfig b/configs/zynqmp_kria_kv260_defconfig index e5b92fa031..7afc7748b0 100644 --- a/configs/zynqmp_kria_kv260_defconfig +++ b/configs/zynqmp_kria_kv260_defconfig @@ -37,3 +37,4 @@ BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y BR2_PACKAGE_HOST_DOSFSTOOLS=y BR2_PACKAGE_HOST_GENIMAGE=y BR2_PACKAGE_HOST_MTOOLS=y +BR2_GLOBAL_PATCH_DIR="board/zynqmp/kria/patches"