diff mbox

[U-Boot] Ensure device tree DTS is compiled

Message ID 1489469893-23319-1-git-send-email-james@balean.com.au
State Superseded
Headers show

Commit Message

James Balean March 14, 2017, 5:38 a.m. UTC
Enables custom DTS files, or those not associated with a specific target, to be compiled into a boot image.

Signed-off-by: James Balean <james@balean.com.au>
---
 dts/Makefile | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

Comments

Andy Shevchenko March 14, 2017, 4:41 p.m. UTC | #1
On Tue, Mar 14, 2017 at 7:38 AM, James Balean <james@balean.com.au> wrote:
> Enables custom DTS files, or those not associated with a specific target, to be compiled into a boot image.

> +ARCH_PATH := arch/$(ARCH)/dts

> +DTB := $(ARCH_PATH)/dts/$(DEVICE_TREE).dtb

dts/dts ?

> +       $(Q)$(MAKE) $(build)=$(ARCH_PATH)/dts dtbs

Ditto.
James Balean March 15, 2017, 12:12 p.m. UTC | #2
On Wed, 15 Mar 2017 at 03:41, Andy Shevchenko <andy.shevchenko@gmail.com>
wrote:
> dts/dts ?

You're right. Thank you for identifying my clumsy commit error, Andy.

--
James Balean
diff mbox

Patch

diff --git a/dts/Makefile b/dts/Makefile
index c4ac153..6dfaf57 100644
--- a/dts/Makefile
+++ b/dts/Makefile
@@ -12,10 +12,14 @@  ifeq ($(DEVICE_TREE),)
 DEVICE_TREE := unset
 endif
 
+ARCH_PATH := arch/$(ARCH)/dts
+dtb_depends := arch-dtbs
+
 ifneq ($(EXT_DTB),)
 DTB := $(EXT_DTB)
 else
-DTB := arch/$(ARCH)/dts/$(DEVICE_TREE).dtb
+DTB := $(ARCH_PATH)/dts/$(DEVICE_TREE).dtb
+dtb_depends += $(DTB:.dtb=.dts)
 endif
 
 $(obj)/dt.dtb: $(DTB) FORCE
@@ -23,7 +27,10 @@  $(obj)/dt.dtb: $(DTB) FORCE
 
 targets += dt.dtb
 
-$(DTB): arch-dtbs
+$(DTB): $(dtb_depends)
+ifeq ($(EXT_DTB),)
+	$(Q)$(MAKE) $(build)=$(ARCH_PATH) $@
+endif
 	$(Q)test -e $@ || (						\
 	echo >&2;							\
 	echo >&2 "Device Tree Source is not correctly specified.";	\
@@ -33,7 +40,7 @@  $(DTB): arch-dtbs
 	/bin/false)
 
 arch-dtbs:
-	$(Q)$(MAKE) $(build)=arch/$(ARCH)/dts dtbs
+	$(Q)$(MAKE) $(build)=$(ARCH_PATH)/dts dtbs
 
 .SECONDARY: $(obj)/dt.dtb.S