Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2222618imm; Sun, 9 Sep 2018 19:24:30 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdbxh+OZRuyKQkI9maELNbDzHqL02dyqVbtIysZg8eE6E9UEnXI4Unr1KW5s3Fk3L3u9ksYk X-Received: by 2002:a62:6f87:: with SMTP id k129-v6mr20939369pfc.26.1536546270749; Sun, 09 Sep 2018 19:24:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536546270; cv=none; d=google.com; s=arc-20160816; b=cTzKWEUv3YpR3d3IYbEQ9xhqC5GWV53rJ3jw7G+M7/I+Cy1QbVKj5qQcI7/iQm8FW0 jXQ8rQ7PcXgIwWxuLMGrGy1IcWxQbCdFVlHzOAonn3FN8jMar3WQw5Vj8rZz6wAq9JxH hR6k5yMEMmt/qK0mOt4qlqQV4pKxz7Iv/bibZ76XGyC5dRFQUaQ6t0yLntl/s/Emkgm0 uzAvkw5gqjws/pf71wdL5KCMSjoID3SDK9NhxQmXsEV19VDxiNg0SN36hU6N5SfHBlqu vX3V5qJTGJWCKh8wlBSMGtA05nPTIBLydg9nORo7hF94PBF1UPYo06X0nrLtkoG3cBLj O2VA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature:dkim-filter; bh=N+5foY4FYhCwfK45DpdtSxm1jxDyDeZh25ehdDTVoeg=; b=WdPWB8GN0kxQf/lYyR2UlNo0Vo3DNsFyy3hcq724XZJedD9v63cWBcyADCyXS9wQ/U Ufh55sfqtnAEA18gTn7+PlN1eotHY+cf8iax8mlg5nlUmYrb0NEcy1aMncI7E17a+n+J uTOovkpPFLhXWGy0EfqkFPDRqCev58Nn2lkXzRAq1p7uBWv9nm1cSyTedKlnC/R5x7rs kbnpTN+7QodASKsVGjncWUFsmSKxGZdtZn08EmjzAfwN+InBWfmX9y55VuifArytk3y2 sJ7wZE/n9hc31CGbu1yC6dLfZhI5O6CDc5DUmBaApo/XscnR+B8vLCsFVm/eBwwqigX6 EVfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=V9S70itt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m8-v6si5663206pll.102.2018.09.09.19.24.15; Sun, 09 Sep 2018 19:24:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=V9S70itt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726130AbeIJHOp (ORCPT + 99 others); Mon, 10 Sep 2018 03:14:45 -0400 Received: from condef-06.nifty.com ([202.248.20.71]:55945 "EHLO condef-06.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725889AbeIJHOo (ORCPT ); Mon, 10 Sep 2018 03:14:44 -0400 X-Greylist: delayed 328 seconds by postgrey-1.27 at vger.kernel.org; Mon, 10 Sep 2018 03:14:42 EDT Received: from conssluserg-01.nifty.com ([10.126.8.80])by condef-06.nifty.com with ESMTP id w89NSivr012518; Mon, 10 Sep 2018 08:28:44 +0900 Received: from mail-ua1-f54.google.com (mail-ua1-f54.google.com [209.85.222.54]) (authenticated) by conssluserg-01.nifty.com with ESMTP id w89NSG3C029781; Mon, 10 Sep 2018 08:28:17 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-01.nifty.com w89NSG3C029781 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1536535697; bh=N+5foY4FYhCwfK45DpdtSxm1jxDyDeZh25ehdDTVoeg=; h=In-Reply-To:References:From:Date:Subject:To:Cc:From; b=V9S70itt6538cyhhapUYPCVJQig+AEKzm1QicE2IAUz0M+UCxNZSl8dl77dNVrPl1 BlGIH3BfL4T+sh1DxhkwR9ECgoFOW72LgYb1ftVfPMd8VZsCD81jjTDjZYrg/yaE0Y 8S1NzLnuEaD4p858c2j8tSn00efty+LakXOik4N5U818lcXCzCFkWMKNXvGkVxwO0S N5GlKQvGoWN9SrzT8Wr5rJ3PWMzEaftVTs0/D1ZzjveFkpQ23dHgGay92iNNEva3Ep 1LncZWDnBNSLXO6W2hO9RvaAoKsH8YAa0H3vgc90L5fu4A1Nl6KZ6iBB4EQUpGs9JJ JAlGa3BXKjCtA== X-Nifty-SrcIP: [209.85.222.54] Received: by mail-ua1-f54.google.com with SMTP id 101-v6so15936215uav.7; Sun, 09 Sep 2018 16:28:17 -0700 (PDT) X-Gm-Message-State: APzg51BDXjB1uOdjtGP382e0n8QFmC2tA51hpgEbLHwhuI2t5jX1LATD oCKOL9axh6H8myVOeQGnd1754aGZjEiRD9pVEc0= X-Received: by 2002:ab0:6a6:: with SMTP id g35-v6mr6238843uag.16.1536535695985; Sun, 09 Sep 2018 16:28:15 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ab0:7111:0:0:0:0:0 with HTTP; Sun, 9 Sep 2018 16:27:35 -0700 (PDT) In-Reply-To: <20180905235327.5996-7-robh@kernel.org> References: <20180905235327.5996-1-robh@kernel.org> <20180905235327.5996-7-robh@kernel.org> From: Masahiro Yamada Date: Mon, 10 Sep 2018 08:27:35 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 6/9] kbuild: consolidate Devicetree dtb build rules To: Rob Herring Cc: DTML , Linux Kernel Mailing List , Michal Marek , Vineet Gupta , Russell King , Catalin Marinas , Will Deacon , Yoshinori Sato , Michal Simek , Ralf Baechle , Paul Burton , James Hogan , Ley Foon Tan , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Chris Zankel , Max Filippov , Linux Kbuild mailing list , arcml , linux-arm-kernel , "moderated list:H8/300 ARCHITECTURE" , Linux-MIPS , nios2-dev@lists.rocketboards.org, linuxppc-dev , linux-xtensa@linux-xtensa.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2018-09-06 8:53 GMT+09:00 Rob Herring : > There is nothing arch specific about building dtb files other than their > location under /arch/*/boot/dts/. Keeping each arch aligned is a pain. > The dependencies and supported targets are all slightly different. > Also, a cross-compiler for each arch is needed, but really the host > compiler preprocessor is perfectly fine for building dtbs. Move the > build rules to a common location and remove the arch specific ones. This > is done in a single step to avoid warnings about overriding rules. > > The build dependencies had been a mixture of 'scripts' and/or 'prepare'. > These pull in several dependencies some of which need a target compiler > (specifically devicetable-offsets.h) and aren't needed to build dtbs. > All that is really needed is dtc, so adjust the dependencies to only be > dtc. > > This change enables support 'dtbs_install' on some arches which were > missing the target. > > Cc: Masahiro Yamada > Cc: Michal Marek > Cc: Vineet Gupta > Cc: Russell King > Cc: Catalin Marinas > Cc: Will Deacon > Cc: Yoshinori Sato > Cc: Michal Simek > Cc: Ralf Baechle > Cc: Paul Burton > Cc: James Hogan > Cc: Ley Foon Tan > Cc: Benjamin Herrenschmidt > Cc: Paul Mackerras > Cc: Michael Ellerman > Cc: Chris Zankel > Cc: Max Filippov > Cc: linux-kbuild@vger.kernel.org > Cc: linux-snps-arc@lists.infradead.org > Cc: linux-arm-kernel@lists.infradead.org > Cc: uclinux-h8-devel@lists.sourceforge.jp > Cc: linux-mips@linux-mips.org > Cc: nios2-dev@lists.rocketboards.org > Cc: linuxppc-dev@lists.ozlabs.org > Cc: linux-xtensa@linux-xtensa.org > Signed-off-by: Rob Herring > --- > Please ack so I can take the whole series via the DT tree. > > v2: > - Fix $arch/boot/dts path check for out of tree builds > - Fix dtc dependency for building built-in dtbs > - Fix microblaze built-in dtb building > > Makefile | 32 +++++++++++++++++++++++++++++++ > arch/arc/Makefile | 6 ------ > arch/arm/Makefile | 20 +------------------ > arch/arm64/Makefile | 17 +--------------- > arch/c6x/Makefile | 2 -- > arch/h8300/Makefile | 11 +---------- > arch/microblaze/Makefile | 4 +--- > arch/microblaze/boot/dts/Makefile | 2 ++ > arch/mips/Makefile | 15 +-------------- > arch/nds32/Makefile | 2 +- > arch/nios2/Makefile | 7 ------- > arch/nios2/boot/Makefile | 4 ---- > arch/powerpc/Makefile | 3 --- > arch/xtensa/Makefile | 12 +----------- > scripts/Makefile.lib | 2 +- > 15 files changed, 42 insertions(+), 97 deletions(-) > > diff --git a/Makefile b/Makefile > index 2b458801ba74..bc18dbbc16c5 100644 > --- a/Makefile > +++ b/Makefile > @@ -1212,6 +1212,32 @@ kselftest-merge: > $(srctree)/tools/testing/selftests/*/config > +$(Q)$(MAKE) -f $(srctree)/Makefile olddefconfig > > +# --------------------------------------------------------------------------- > +# Devicetree files > + > +ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/boot/dts/),) > +dtstree := arch/$(SRCARCH)/boot/dts > +endif > + > +ifdef CONFIG_OF_EARLY_FLATTREE > + > +%.dtb %.dtb.S %.dtb.o: | dtc > + $(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@ Hmm, I was worried about '%.dtb.o: | dtc' but seems working. Compiling %.S -> %.o requires objtool for x86, but x86 does not support DT. If CONFIG_MODVERSIONS=y, scripts/genksyms/genksyms is required, %.dtb.S does not contain EXPORT_SYMBOL. BTW, 'dtc' should be a PHONY target. -- Best Regards Masahiro Yamada