Skip to contentSkip to conversation

makefile: add multi_dtb_fit dep

PATCH Applied Neal Frager 3 participants 4 messages Dec 21, 2022 – Jan 11, 2023 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 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.

---
 Makefile | 1 +
 1 file changed, 1 insertion(+)
Makefile +1 -0
index b96e2ffa15..682a5d94fd 100644
@@ -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)
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#1 lore raw

Hi Neil,

Quoted 26 lines · Neal Frager

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.

---
 Makefile | 1 +
 1 file changed, 1 insertion(+)
Makefile +1 -1
index b96e2ffa15..682a5d94fd 100644
@@ -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)
--
Quoted 2 lines

2.17.1

I wonder if we should try to get this moved to binman?

Regards,
SImon

#2 lore raw

Hi Simon,

Quoted 26 lines

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.

---
 Makefile | 1 +
 1 file changed, 1 insertion(+)
Makefile +0 -0
index b96e2ffa15..682a5d94fd 100644
@@ -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)
Quoted 7 lines

--
2.17.1

I wonder if we should try to get this moved to binman?

Thank you for the review! Yes, the next step will be to move to binman.

Best regards,
Neal Frager
AMD

Applied
#3 lore raw
In reply to Neal Frager
Quoted 17 lines · Neal Frager

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.

---
  Makefile | 1 +
  1 file changed, 1 insertion(+)
Makefile +0 -0
index b96e2ffa15..682a5d94fd 100644

Makefile MKIMAGEFLAGS_u-boot.itb += -B 0x8 · line 1431

Quoted 7 lines
Makefile +1 -0
@@ -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)

Applied.
M