Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 60214C07E9B for ; Tue, 20 Jul 2021 09:02:41 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 120766120F for ; Tue, 20 Jul 2021 09:02:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 120766120F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bootlin.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de 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) 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 Content-Transfer-Encoding: 8bit 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 -- 2.25.1