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: 4850061 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id BA4409F665 for ; Fri, 5 Sep 2014 06:50:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D3FF7201EF for ; Fri, 5 Sep 2014 06:50:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E3BD420266 for ; Fri, 5 Sep 2014 06:50:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755925AbaIEGs7 (ORCPT ); Fri, 5 Sep 2014 02:48:59 -0400 Received: from mail-we0-f170.google.com ([74.125.82.170]:49332 "EHLO mail-we0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755837AbaIEGs5 (ORCPT ); Fri, 5 Sep 2014 02:48:57 -0400 Received: by mail-we0-f170.google.com with SMTP id p10so11294512wes.1 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 Cc: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Robert Richter 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> Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Spam-Status: No, score=-8.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,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)