Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2868676imm; Mon, 10 Sep 2018 07:37:55 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYkNfCnNvZ2pJjzcnNbdQxarOyWhMYzvx3PiiXV/wGR1umN6AuDrhpb1BwtmCK9dCp6SJyg X-Received: by 2002:a17:902:654b:: with SMTP id d11-v6mr22384864pln.8.1536590275495; Mon, 10 Sep 2018 07:37:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536590275; cv=none; d=google.com; s=arc-20160816; b=nTmEVgYvY2f1ovFegS1fP1t5lQOmymPa85MbTNcCF2c8iCfoOs/zI056vCxy02ynri gusHxTs1VqBTe+c4RyWDn6QlAvigLQKbmn6PheoZWhR76X6hrxbVb/wl/NsOhQEYud6Q 8hHIFYsd99yZnRwnh0Yov+ogDG6HI1YfFSgvig8PEXBZzSo4Z4h5DPKO7aPVXRz5jwRP fC1it3q8e89ly5EyBAnPyuMECM09aPxnJ073oZOtdhnL6Ja/BSapaqIKC3JWqcqSx+qF ASldCXI+0JkMQipSy1FDelIwJiZYaXFUGhdDDy4ezWvFZa9GIhuR/MMGV9kBjv4RUxlW 5RBA== 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 :in-reply-to:references:mime-version:dkim-signature; bh=vzjA4vRVkEQZcTqA8QBKYx0m7nzZOd7jKZWAVZ8/1VQ=; b=n8NZLXqdtS4oktP2H5ZdSs3CHRY/E97wocf2MS56W3lLxS5QGtyAS5zkerpGKN4jF0 wlVw/uR3Vl8TA3wZ8m/THecNFqL/cImLlurrkaqrIiEC1M3bMeJXj7x0YEsWQ98Cz2Jb bl3PgoLEneMYOgnFfLkd+Sg7zzvslcMCX83j8q5g3KaCvzC62v7p8aIjwq1W84fPWrpA 0FdNcA5C1DJBJ5Iis3msJvfpsqHWQiytm18XlcYLG+DLgFXagqvOyXS6l7ddf5kmbdqK 9dhei1n3EFDPsUZMkLFuBLAKlMF5akvStYa44/7RDwmiMC8hSuoseqZNx29jFMxRDapw VrMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=aU+sqIj6; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bj7-v6si15659614plb.320.2018.09.10.07.37.39; Mon, 10 Sep 2018 07:37:55 -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=@kernel.org header.s=default header.b=aU+sqIj6; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728636AbeIJTaF (ORCPT + 99 others); Mon, 10 Sep 2018 15:30:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:34168 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728127AbeIJTaF (ORCPT ); Mon, 10 Sep 2018 15:30:05 -0400 Received: from mail-qt0-f179.google.com (mail-qt0-f179.google.com [209.85.216.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 568942089C; Mon, 10 Sep 2018 14:35:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1536590142; bh=VwD4VB4mc463qlRBNmS4+JtAy54cv2VmaVAhFmBiNm8=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=aU+sqIj6voqeU/ldmscAB/w6c0sWp1jhCtw49nmHA10GUpQKSfBJX2IIgz8hK9wzZ vGGlY31+nUPkVrEjqc9J+qm2i9oUCWGtkkq15J91my+29eyISMVNlG0tYLC73WY8CD z8ulXWkztozM5rCFoaqwVjyq4cNajJAHB9GHG+8o= Received: by mail-qt0-f179.google.com with SMTP id o15-v6so24344673qtk.6; Mon, 10 Sep 2018 07:35:42 -0700 (PDT) X-Gm-Message-State: APzg51B4q0EDKthAN9m0v7/Quvtx1k1n3zNqOTxESxJIGCVT8/CYqS/f +iDmL/QOFz4abWkjgntS8DZD74wFhNYnInRwGQ== X-Received: by 2002:ac8:46d3:: with SMTP id h19-v6mr16113770qto.188.1536590141286; Mon, 10 Sep 2018 07:35:41 -0700 (PDT) MIME-Version: 1.0 References: <20180905235327.5996-1-robh@kernel.org> <20180905235327.5996-7-robh@kernel.org> In-Reply-To: From: Rob Herring Date: Mon, 10 Sep 2018 09:35:29 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 6/9] kbuild: consolidate Devicetree dtb build rules To: Masahiro Yamada Cc: devicetree@vger.kernel.org, "linux-kernel@vger.kernel.org" , 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 , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , "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 On Sun, Sep 9, 2018 at 6:28 PM Masahiro Yamada wrote: > > 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. Well, x86 does support DT to some extent. There's 2 platforms and the DT unittests build and run on x86. Actually, we can remove "%.dtb.S %.dtb.o" because we don't need those as top-level build targets. Must have been a copy-n-paste relic from before having common rules. > > If CONFIG_MODVERSIONS=y, scripts/genksyms/genksyms is required, > %.dtb.S does not contain EXPORT_SYMBOL. Okay, but that shouldn't affect any of this. We only build *.dtb.S when doing built-in dtbs. > BTW, 'dtc' should be a PHONY target. Right, I found that too. Rob