diff mbox series

[v2,1/1] configs/zynqmp_kria_kv260_defconfig: use CONFIG_MULTI_DTB_FIT

Message ID 20221222063710.4324-1-neal.frager@amd.com
State Accepted
Headers show
Series [v2,1/1] configs/zynqmp_kria_kv260_defconfig: use CONFIG_MULTI_DTB_FIT | expand

Commit Message

Neal Frager Dec. 22, 2022, 6:37 a.m. UTC
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 <neal.frager@amd.com>
---
V1->V2:
  - Changed the uboot patch from a delay to a proper dependency wait
---
 board/zynqmp/kria/kv260/kv260.sh              |  2 +-
 ...-0001-makefile-add-multi_dtb_fit-dep.patch | 32 +++++++++++++++++++
 board/zynqmp/kria/uboot.fragment              |  1 +
 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

Comments

Luca Ceresoli Dec. 22, 2022, 1:27 p.m. UTC | #1
Hello Neal,

On Thu, 22 Dec 2022 06:37:10 +0000
Neal Frager <neal.frager@amd.com> wrote:

> 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/

And also approved by a maintainer, so

Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Peter Korsgaard Jan. 12, 2023, 4:32 p.m. UTC | #2
>>>>> "Neal" == Neal Frager <neal.frager@amd.com> writes:

 > 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 <neal.frager@amd.com>
 > ---
 V1-> V2:
 >   - Changed the uboot patch from a delay to a proper dependency wait

Committed, thanks.
Peter Korsgaard Jan. 15, 2023, 8:10 p.m. UTC | #3
>>>>> "Neal" == Neal Frager <neal.frager@amd.com> writes:

 > 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 <neal.frager@amd.com>

Committed to 2022.11.x, thanks.
diff mbox series

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/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 <neal.frager@amd.com>
+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 <neal.frager@amd.com>
+---
+ 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/board/zynqmp/kria/uboot.fragment b/board/zynqmp/kria/uboot.fragment
index 9e32edfb36..40709549dc 100644
--- a/board/zynqmp/kria/uboot.fragment
+++ b/board/zynqmp/kria/uboot.fragment
@@ -1,4 +1,5 @@ 
 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/configs/zynqmp_kria_kv260_defconfig b/configs/zynqmp_kria_kv260_defconfig
index 5c53122b46..3214d45fa9 100644
--- a/configs/zynqmp_kria_kv260_defconfig
+++ b/configs/zynqmp_kria_kv260_defconfig
@@ -38,3 +38,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"