From patchwork Tue Jul 20 09:02:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kory Maincent X-Patchwork-Id: 1507445 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GTXmK1HLdz9s1l for ; Tue, 20 Jul 2021 19:02:41 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id BC8C782C0D; Tue, 20 Jul 2021 11:02:37 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=bootlin.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id AA12782C0D; Tue, 20 Jul 2021 11:02:35 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 6E0BF82C2C for ; Tue, 20 Jul 2021 11:02:32 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=bootlin.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=kory.maincent@bootlin.com Received: (Authenticated sender: kory.maincent@bootlin.com) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id C910140009; Tue, 20 Jul 2021 09:02:31 +0000 (UTC) From: Kory Maincent To: u-boot@lists.denx.de Cc: thomas.petazzoni@bootlin.com Subject: [PATCH v2] dts: Makefile: add support to build dedicated devicetree Date: Tue, 20 Jul 2021 11:02:31 +0200 Message-Id: <20210720090231.1234215-1-kory.maincent@bootlin.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean 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 --- 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