From patchwork Fri Sep 5 06:48:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Richter X-Patchwork-Id: 4850151 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 26D97C0338 for ; Fri, 5 Sep 2014 06:51:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 623AA20266 for ; Fri, 5 Sep 2014 06:51:34 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 814E5201EF for ; Fri, 5 Sep 2014 06:51:33 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XPnL7-00050E-5i; Fri, 05 Sep 2014 06:49:45 +0000 Received: from mail-we0-x22d.google.com ([2a00:1450:400c:c03::22d]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XPnKh-0004Yq-1f for linux-arm-kernel@lists.infradead.org; Fri, 05 Sep 2014 06:49:19 +0000 Received: by mail-we0-f173.google.com with SMTP id t60so11266255wes.4 for ; Thu, 04 Sep 2014 23:48:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=DVD/sTXEv5wUrsaq7d0sVlDfo+HLZk/6tnRK666Tc7U=; b=qY/FItIu2jiYG0livYDHtQcD2Zd0jw/abE5UJtYTk5UCbREBlLPwX4ymnMxkhVc1cC Ko7J68qs8kV0Gy6Lx3XNATucnPEzIafo8yc2DuAGJiOQkogzWxZEEy205OdGEDTgMV1t jLjYM0/BHMOytcvdgIOjOxezf8nww0b2UDtyhfOBqx9PdvwVpyL7x3wbdV3lMG9FK2PD VgUTRlc1mWsXOzn0P01UPuYRsDLzzJQLCRVg+PBi0FD2NdML3Qp/KDtsYu1rCyRdifUN uMeQpvc0JzViD03FNEVX84bbXWTRlz5FN/K7f4F5Lx2JZTpG+NmxtGN4r7slLL7gYTCF cfNA== X-Received: by 10.194.90.4 with SMTP id bs4mr12233994wjb.71.1409899735817; Thu, 04 Sep 2014 23:48:55 -0700 (PDT) Received: from rric.localhost (g224199072.adsl.alicedsl.de. [92.224.199.72]) by mx.google.com with ESMTPSA id au4sm403541wjc.15.2014.09.04.23.48.54 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 04 Sep 2014 23:48:55 -0700 (PDT) From: Robert Richter To: Olof Johansson , Rob Herring , Mark Rutland , Arnd Bergmann , Michal Marek Subject: [PATCH 4/6] dts, kbuild: Implement support for dtb vendor subdirs Date: Fri, 5 Sep 2014 08:48:10 +0200 Message-Id: <1409899692-1455-5-git-send-email-rric@kernel.org> X-Mailer: git-send-email 2.0.1 In-Reply-To: <1409899692-1455-1-git-send-email-rric@kernel.org> References: <1409899692-1455-1-git-send-email-rric@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140904_234919_252232_506736B3 X-CRM114-Status: GOOD ( 10.84 ) X-Spam-Score: -0.7 (/) Cc: Robert Richter , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kbuild@vger.kernel.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Robert Richter This patch adds support of vendor sub directories for dtb files. Subdirectories can be specified in $(dts-dirs). Kbuild traverses over all directories while building and installing dtb files. The directory tree is also reflected in the install path. Signed-off-by: Robert Richter --- arch/arm64/boot/dts/Makefile | 1 + scripts/Makefile.dtbinst | 23 ++++++++++++++++++----- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/arch/arm64/boot/dts/Makefile b/arch/arm64/boot/dts/Makefile index d116da5f2f20..9b8622532068 100644 --- a/arch/arm64/boot/dts/Makefile +++ b/arch/arm64/boot/dts/Makefile @@ -2,4 +2,5 @@ dtb-$(CONFIG_ARCH_VEXPRESS) += rtsm_ve-aemv8a.dtb foundation-v8.dtb dtb-$(CONFIG_ARCH_XGENE) += apm-mustang.dtb always := $(dtb-y) +subdir-y := $(dts-dirs) clean-files := *.dtb diff --git a/scripts/Makefile.dtbinst b/scripts/Makefile.dtbinst index 54286cccc289..909ed7a2ac61 100644 --- a/scripts/Makefile.dtbinst +++ b/scripts/Makefile.dtbinst @@ -6,6 +6,7 @@ # # $INSTALL_PATH/dtbs/$KERNELRELEASE # +# Traverse through subdirectories listed in $(dts-dirs). # ========================================================================== src := $(obj) @@ -13,26 +14,38 @@ src := $(obj) PHONY := __dtbs_install __dtbs_install: +export dtbinst-root ?= $(obj) + include include/config/auto.conf include scripts/Kbuild.include include $(srctree)/$(obj)/Makefile PHONY += __dtbs_install_prep __dtbs_install_prep: +ifeq ("$(dtbinst-root)", "$(obj)") $(Q)if [ -d $(INSTALL_DTBS_PATH).old ]; then rm -rf $(INSTALL_DTBS_PATH).old; fi $(Q)if [ -d $(INSTALL_DTBS_PATH) ]; then mv $(INSTALL_DTBS_PATH) $(INSTALL_DTBS_PATH).old; fi $(Q)mkdir -p $(INSTALL_DTBS_PATH) +endif dtbinst-files := $(dtb-y) +dtbinst-dirs := $(dts-dirs) # Helper targets for Installing DTBs into the boot directory quiet_cmd_dtb_install = INSTALL $< - cmd_dtb_install = cp $< $(2) + cmd_dtb_install = mkdir -p $(2); cp $< $(2) + +install-dir = $(patsubst $(dtbinst-root)%,$(INSTALL_DTBS_PATH)%,$(obj)) + +$(dtbinst-files) $(dtbinst-dirs): | __dtbs_install_prep + +$(dtbinst-files): %.dtb: $(obj)/%.dtb + $(call cmd,dtb_install,$(install-dir)) -$(dtbinst-files): %.dtb: $(obj)/%.dtb | __dtbs_install_prep - $(call cmd,dtb_install,$(INSTALL_DTBS_PATH)) +$(dtbinst-dirs): + $(Q)$(MAKE) $(dtbinst)=$(obj)/$@ -PHONY += $(dtbinst-files) -__dtbs_install: $(dtbinst-files) +PHONY += $(dtbinst-files) $(dtbinst-dirs) +__dtbs_install: $(dtbinst-files) $(dtbinst-dirs) .PHONY: $(PHONY)