[PATCH] Makefile: depend on all OF_LIST dtbs when building fit-dtb.blob

liulhong617 at 163.com liulhong617 at 163.com
Thu Jul 2 15:20:51 CEST 2026


From: lianghong617 <liulhong617 at 163.com>

When CONFIG_MULTI_DTB_FIT is enabled, fit-dtb.blob is produced by
mkimage with one "-b <dtb>" argument for every entry in
CONFIG_OF_LIST.  The make rule, however, only listed dts/dt.dtb
(i.e. the CONFIG_DEFAULT_DEVICE_TREE blob) as a prerequisite:

  fit-dtb.blob: dts/dt.dtb FORCE
      $(call if_changed,mkimage)

Because FORCE is PHONY, if_changed ignores it and rebuilds only when
any-prereq or arg-check is non-empty.  Editing a non-default dts in
OF_LIST rebuilds its .dtb (that dependency is tracked correctly via
fixdep), but that .dtb is not a prerequisite of fit-dtb.blob, so $?
stays empty; the mkimage command line is unchanged too, so arg-check
is empty as well.  if_changed therefore skips mkimage and fit-dtb.blob
keeps the stale dtbs.  u-boot.bin, which appends fit-dtb.blob, then
ships the old device tree and the dts change does not take effect.

The usual workaround is to wipe the whole build directory and rebuild
from scratch.

Add every OF_LIST dtb as a prerequisite, mirroring the -b arguments
built for MKIMAGEFLAGS_fit-dtb.blob, so that any rebuilt dtb triggers
mkimage via any-prereq.

This changes incremental build behaviour only; a clean build is
unaffected.

Fixes: 6f59fb07f497 ("Makefile: Build additional binaries for dtb FIT blobs appended to U-boot")
Signed-off-by: lianghong617 <liulhong617 at 163.com>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 503ac59e65..5b074fb17d 100644
--- a/Makefile
+++ b/Makefile
@@ -1475,7 +1475,7 @@ fit-dtb.blob.gz: fit-dtb.blob
 fit-dtb.blob.lzo: fit-dtb.blob
 	@lzop -f9 $< > $@
 
-fit-dtb.blob: dts/dt.dtb FORCE
+fit-dtb.blob: dts/dt.dtb $(patsubst %,arch/$(ARCH)/dts/%.dtb,$(subst ",,$(CONFIG_OF_LIST))) FORCE
 	$(call if_changed,mkimage)
 ifneq ($(SOURCE_DATE_EPOCH),)
 	touch -d @$(SOURCE_DATE_EPOCH) fit-dtb.blob
-- 
2.34.1



More information about the U-Boot mailing list