All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] dts: Makefile: add support to build dedicated devicetree
@ 2021-07-20  9:02 Kory Maincent
  0 siblings, 0 replies; only message in thread
From: Kory Maincent @ 2021-07-20  9:02 UTC (permalink / raw)
  To: u-boot; +Cc: thomas.petazzoni

The devicetree described by the DEVICE_TREE variable was not build.
It was only use to test if it has been built then, happen the right
devicetree to U-boot binary.

This patch add support to build the devicetree describe by the
DEVICE_TREE variable.
This avoid adding the devicetree declaration to the related Makefile.

The use case is to ease the management of external devicetree when U-boot
is built by a build system.

Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
---

Change since v1:
Use the DEVICE_TREE U-boot environment variable to select the devicetree
build rather than appending the devicetree as an option of the make
command.

 dts/Makefile | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/dts/Makefile b/dts/Makefile
index cb31113829..e3de63d847 100644
--- a/dts/Makefile
+++ b/dts/Makefile
@@ -10,9 +10,13 @@ ifeq ($(DEVICE_TREE),)
 DEVICE_TREE := unset
 endif
 
+BUILD_DTBS := arch-dtbs
 ifneq ($(EXT_DTB),)
 DTB := $(EXT_DTB)
 else
+ifneq ($(DEVICE_TREE),unset)
+BUILD_DTBS += target-dtb
+endif
 DTB := arch/$(ARCH)/dts/$(DEVICE_TREE).dtb
 endif
 
@@ -30,7 +34,7 @@ endif
 
 targets += dt.dtb
 
-$(DTB): arch-dtbs
+$(DTB): $(BUILD_DTBS)
 	$(Q)test -e $@ || (						\
 	echo >&2;							\
 	echo >&2 "Device Tree Source ($@) is not correctly specified.";	\
@@ -39,10 +43,13 @@ $(DTB): arch-dtbs
 	echo >&2;							\
 	/bin/false)
 
-PHONY += arch-dtbs
+PHONY += arch-dtbs target-dtb
 arch-dtbs:
 	$(Q)$(MAKE) $(build)=arch/$(ARCH)/dts dtbs
 
+target-dtb:
+	$(Q)$(MAKE) $(build)=arch/$(ARCH)/dts $(DTB)
+
 ifeq ($(CONFIG_SPL_BUILD),y)
 obj-$(CONFIG_OF_EMBED) := dt-spl.dtb.o
 # support "out-of-tree" build for dtb-spl
-- 
2.25.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-07-20  9:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-20  9:02 [PATCH v2] dts: Makefile: add support to build dedicated devicetree Kory Maincent

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.