Let the board specific dts files live in the board directory.

Signed-off-by: Troy Kisky <[email protected]>
---
 dts/Makefile         | 11 +++++++++--
 scripts/Makefile.lib |  1 +
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/dts/Makefile b/dts/Makefile
index cb311138295..09b46f9fcfd 100644
--- a/dts/Makefile
+++ b/dts/Makefile
@@ -13,7 +13,9 @@ endif
 ifneq ($(EXT_DTB),)
 DTB := $(EXT_DTB)
 else
-DTB := arch/$(ARCH)/dts/$(DEVICE_TREE).dtb
+ifneq "$(ARCH)" "arm64"
+DTB := $(patsubst $(srctree)/%.dts,%.dtb,$(shell find 
"$(srctree)/board/$(BOARDDIR)" $(srctree)/arch/$(ARCH)/dts/ -type f -name 
$(DEVICE_TREE).dts))
+endif
 endif
 
 $(obj)/dt-$(SPL_NAME).dtb: dts/dt.dtb $(objtree)/tools/fdtgrep FORCE
@@ -40,8 +42,13 @@ $(DTB): arch-dtbs
        /bin/false)
 
 PHONY += arch-dtbs
+ifneq "$(patsubst board/$(BOARDDIR)/%,,$(DTB))" ""
 arch-dtbs:
        $(Q)$(MAKE) $(build)=arch/$(ARCH)/dts dtbs
+else
+arch-dtbs:
+       $(Q)$(MAKE) $(build)="board/$(BOARDDIR)" dtbs
+endif
 
 ifeq ($(CONFIG_SPL_BUILD),y)
 obj-$(CONFIG_OF_EMBED) := dt-spl.dtb.o
@@ -63,4 +70,4 @@ spl_dtbs: $(obj)/dt-$(SPL_NAME).dtb
 clean-files := dt.dtb.S
 
 # Let clean descend into dts directories
-subdir- += ../arch/arm/dts ../arch/microblaze/dts ../arch/mips/dts 
../arch/sandbox/dts ../arch/x86/dts ../arch/powerpc/dts ../arch/riscv/dts
+subdir- += ../arch/arm/dts ../arch/microblaze/dts ../arch/mips/dts 
../arch/sandbox/dts ../arch/x86/dts ../arch/powerpc/dts ../arch/riscv/dts 
../$(patsubst $(srctree)/%/,%,$(dir $(shell find $(srctree)/board -type f -name 
"*.dtb")))
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 39f03398ed8..18fe42f378f 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -183,6 +183,7 @@ u_boot_dtsi = $(strip $(u_boot_dtsi_options_debug) \
 
 # Modified for U-Boot
 dtc_cpp_flags  = -Wp,-MD,$(depfile).pre.tmp -nostdinc                    \
+                -I$(srctree)/board/$(BOARDDIR)                          \
                 -I$(srctree)/arch/$(ARCH)/dts                           \
                 -I$(srctree)/arch/$(ARCH)/dts/include                   \
                 -Iinclude                                               \
-- 
2.32.0

Reply via email to