From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ua1-f68.google.com (mail-ua1-f68.google.com [209.85.222.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 42B37G6TbjzF3Sb for ; Fri, 14 Sep 2018 01:52:10 +1000 (AEST) Received: by mail-ua1-f68.google.com with SMTP id h1-v6so5061498uao.8 for ; Thu, 13 Sep 2018 08:52:10 -0700 (PDT) MIME-Version: 1.0 References: <20180910150403.19476-1-robh@kernel.org> <20180910150403.19476-7-robh@kernel.org> In-Reply-To: From: Geert Uytterhoeven Date: Thu, 13 Sep 2018 17:51:55 +0200 Message-ID: Subject: Re: [PATCH v3 6/9] kbuild: consolidate Devicetree dtb build rules To: Masahiro Yamada Cc: Rob Herring , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Linux Kernel Mailing List , Frank Rowand , Michal Marek , Vineet Gupta , Russell King , Catalin Marinas , Yoshinori Sato , Michal Simek , Ralf Baechle , James Hogan , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Chris Zankel , Max Filippov , linux-kbuild , arcml , Linux ARM , "moderated list:H8/300 ARCHITECTURE" , Linux MIPS Mailing List , nios2-dev@lists.rocketboards.org, linuxppc-dev , linux-xtensa@linux-xtensa.org, Will Deacon , Paul Burton , ley.foon.tan@intel.com Content-Type: text/plain; charset="UTF-8" List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Hi Yamada-san, On Wed, Sep 12, 2018 at 3:02 AM Masahiro Yamada wrote: > 2018-09-12 0:40 GMT+09:00 Rob Herring : > > On Mon, Sep 10, 2018 at 10:04 AM Rob Herring wrote: > >> 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. > > > > [...] > > > >> @@ -1215,6 +1215,33 @@ 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 > > > > This can be true when dtstree is unset. So this line should be this > > instead to fix the 0-day reported error: > > > > ifneq ($(dtstree),) > > > >> + > >> +%.dtb : scripts_dtc > >> + $(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@ > >> + > >> +PHONY += dtbs dtbs_install > >> +dtbs: scripts_dtc > >> + $(Q)$(MAKE) $(build)=$(dtstree) > >> + > >> +dtbs_install: dtbs > >> + $(Q)$(MAKE) $(dtbinst)=$(dtstree) > >> + > >> +all: dtbs > >> + > >> +endif > > > Ah, right. > Even x86 can enable OF and OF_UNITTEST. > > > > Another solution might be, > guard it by 'depends on ARCH_SUPPORTS_OF'. > > > > This is actually what ACPI does. > > menuconfig ACPI > bool "ACPI (Advanced Configuration and Power Interface) Support" > depends on ARCH_SUPPORTS_ACPI > ... ACPI is a real platform feature, as it depends on firmware. CONFIG_OF can be enabled, and DT overlays can be loaded, on any platform, even if it has ACPI ;-) Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds