From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D01E7C433E0 for ; Thu, 11 Feb 2021 18:43:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9283264E5F for ; Thu, 11 Feb 2021 18:43:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230414AbhBKSbY (ORCPT ); Thu, 11 Feb 2021 13:31:24 -0500 Received: from conssluserg-04.nifty.com ([210.131.2.83]:37872 "EHLO conssluserg-04.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229707AbhBKS3K (ORCPT ); Thu, 11 Feb 2021 13:29:10 -0500 Received: from mail-pg1-f180.google.com (mail-pg1-f180.google.com [209.85.215.180]) (authenticated) by conssluserg-04.nifty.com with ESMTP id 11BIS0xX020916; Fri, 12 Feb 2021 03:28:00 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-04.nifty.com 11BIS0xX020916 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1613068081; bh=Hbd1jHEJ4+0Y3UNlpXUZ2xllNrQK93rgVJKBwvGVmL4=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=miTs4Pey9xkNLrJ2iWuNzoQNU9S2BxtyRuYzf27ztbI74N7hG/hA+9Qa2Qrq5yh1C BAk/UXxEmqOmtrClLGUsX8y7LRuEIPEb8UbheNKhWYwkGa84s17uaRQQgfYn0mMeTj +b4mWiPASD6moydGDqYozZQ0mShu+fLUH6l1/Z5mxucS+QOpKFPo+cwy82OJHdvGNb bO+swK3Y9h7P6FtJDAbNYLgyj7wSZgS3QhaVcuXueLO73E56hYhMRYyvrYjVmJ5hQT UMNMv3uC1aT64x3AKbGl92VtJkgBrJtZ5dvtVDod2KqsM0nGIMPmPK7yc6a2ueIcq3 X48yrgMOs8jww== X-Nifty-SrcIP: [209.85.215.180] Received: by mail-pg1-f180.google.com with SMTP id j5so4478477pgb.11; Thu, 11 Feb 2021 10:28:00 -0800 (PST) X-Gm-Message-State: AOAM530wA1hfMI9DvO2M325NlPo1oVeWEH7ZLv3xIWjauuOQIW9PfJyB YqGSVM6g9/Yzj9qPfZf+Sgt64BbYaXMnggzazAg= X-Google-Smtp-Source: ABdhPJySHBd6FtH0OZ1WIyS/vX7OAJIXGGAN3M0cbxk7sYoN2HS/yMkjc3bsSAuUa15koo8k803PqJbDR5RWBtdAKms= X-Received: by 2002:a62:b416:0:b029:1e4:fb5a:55bb with SMTP id h22-20020a62b4160000b02901e4fb5a55bbmr8972253pfn.80.1613068079796; Thu, 11 Feb 2021 10:27:59 -0800 (PST) MIME-Version: 1.0 References: <44dad578df8a848fc378cd358f03b071f44c9a5b.1612955268.git.viresh.kumar@linaro.org> In-Reply-To: <44dad578df8a848fc378cd358f03b071f44c9a5b.1612955268.git.viresh.kumar@linaro.org> From: Masahiro Yamada Date: Fri, 12 Feb 2021 03:27:23 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH V7 1/3] kbuild: Add generic rule to apply fdtoverlay To: Viresh Kumar Cc: Frank Rowand , Rob Herring , Pantelis Antoniou , Michal Marek , Vincent Guittot , linux-arm-kernel , Linux Kernel Mailing List , Anmar Oueja , Bill Mills , David Gibson , DTML , Linux Kbuild mailing list , Geert Uytterhoeven , Michal Simek , Rob Herring Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 10, 2021 at 8:13 PM Viresh Kumar wrote: > > From: Rob Herring > > Add a generic rule to apply fdtoverlay in Makefile.lib, so every > platform doesn't need to carry the complex rule. > > The platform's Makefile only needs to have this now: > > DTC_FLAGS_foo_base += -@ > foo-dtbs := foo_base.dtb foo_overlay1.dtbo foo_overlay2.dtbo > overlay-y := foo.dtb Please reuse dtb-y instead of introducing the new overlay-y syntax, that is, foo-dtbs := foo_base.dtb foo_overlay1.dtbo foo_overlay2.dtbo dtb-y := foo.dtb This resembles to composite modules. foo-objs := foo1.o foo2.o foo3.o obj-m := foo.o > Rearrange Makefile.lib to keep DT specific stuff together. > > The files from overlay-y (i.e. files generated by fdtoverlay) aren't > added to dtb-y here, as dtb-y is later used to generate .dt.yaml files > and the files in overlay-y don't have a corresponding dts file and make > dtbs_check fails for them. > > Signed-off-by: Rob Herring > [ Viresh: Add commit log and replace dtb-y with overlay-y, handle > CONFIG_OF_ALL_DTBS case, rearrange Makefile, don't add > overlay-y to dtb-y to skip dtbs_check for them. ] > Signed-off-by: Viresh Kumar > --- > scripts/Makefile.lib | 39 +++++++++++++++++++++++++++------------ > 1 file changed, 27 insertions(+), 12 deletions(-) > > diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib > index b00855b247e0..a6e79e3be527 100644 > --- a/scripts/Makefile.lib > +++ b/scripts/Makefile.lib > @@ -66,23 +66,16 @@ multi-used := $(multi-used-y) $(multi-used-m) > real-obj-y := $(foreach m, $(obj-y), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-))),$($(m:.o=-objs)) $($(m:.o=-y)),$(m))) > real-obj-m := $(foreach m, $(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m)) $($(m:.o=-))),$($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m)),$(m))) > > -always-y += $(always-m) > - > -# hostprogs-always-y += foo > -# ... is a shorthand for > -# hostprogs += foo > -# always-y += foo > -hostprogs += $(hostprogs-always-y) $(hostprogs-always-m) > -always-y += $(hostprogs-always-y) $(hostprogs-always-m) > - > -# userprogs-always-y is likewise. > -userprogs += $(userprogs-always-y) $(userprogs-always-m) > -always-y += $(userprogs-always-y) $(userprogs-always-m) > +# Add base dtb and overlay dtbo > +dtb-y += $(foreach m,$(overlay-y), $(if $(strip $($(m:.dtb=-dtbs))),$($(m:.dtb=-dtbs)),)) > +dtb-$(CONFIG_OF_ALL_DTBS) += $(foreach m,$(overlay-), $(if $(strip $($(m:.dtb=-dtbs))),$($(m:.dtb=-dtbs)),)) > > # DTB > # If CONFIG_OF_ALL_DTBS is enabled, all DT blobs are built > extra-y += $(dtb-y) > +extra-y += $(overlay-y) > extra-$(CONFIG_OF_ALL_DTBS) += $(dtb-) > +extra-$(CONFIG_OF_ALL_DTBS) += $(overlay-) > > ifneq ($(CHECK_DTBS),) > extra-y += $(patsubst %.dtb,%.dt.yaml, $(dtb-y)) > @@ -91,6 +84,19 @@ extra-$(CONFIG_OF_ALL_DTBS) += $(patsubst %.dtb,%.dt.yaml, $(dtb-)) > extra-$(CONFIG_OF_ALL_DTBS) += $(patsubst %.dtbo,%.dt.yaml, $(dtb-)) > endif > > +always-y += $(always-m) > + > +# hostprogs-always-y += foo > +# ... is a shorthand for > +# hostprogs += foo > +# always-y += foo > +hostprogs += $(hostprogs-always-y) $(hostprogs-always-m) > +always-y += $(hostprogs-always-y) $(hostprogs-always-m) > + > +# userprogs-always-y is likewise. > +userprogs += $(userprogs-always-y) $(userprogs-always-m) > +always-y += $(userprogs-always-y) $(userprogs-always-m) > + > # Add subdir path > > extra-y := $(addprefix $(obj)/,$(extra-y)) > @@ -332,6 +338,15 @@ $(obj)/%.dtb: $(src)/%.dts $(DTC) FORCE > $(obj)/%.dtbo: $(src)/%.dts $(DTC) FORCE > $(call if_changed_dep,dtc) > > + > +quiet_cmd_fdtoverlay = DTOVL $@ > + cmd_fdtoverlay = $(objtree)/scripts/dtc/fdtoverlay -o $@ -i $(real-prereqs) > + > +.SECONDEXPANSION: > + > +$(obj)/%.dtb: $$(addprefix $$(obj)/,$$(%-dtbs)) FORCE > + $(call if_changed,fdtoverlay) > + Please do not use .SECONDEXPANSION. This will parse the Makefile twice in _all_ directories, while only a few directories use the overlay-y syntax. Use the multi_depend macro. > DT_CHECKER ?= dt-validate > DT_BINDING_DIR := Documentation/devicetree/bindings > # DT_TMP_SCHEMA may be overridden from Documentation/devicetree/bindings/Makefile > -- > 2.25.0.rc1.19.g042ed3e048af > -- Best Regards Masahiro Yamada From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7C89CC433E0 for ; Thu, 11 Feb 2021 18:30:16 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 27F1364E15 for ; Thu, 11 Feb 2021 18:30:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 27F1364E15 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=olUHc7el4aDouVE0sb25kkyWUVX/t1xiCBU3axjSLNE=; b=w4FCnl8AmRSQgskmbG7SsVWYV 6WZGkLBPb4NzBkVju7cgnjDRhnhP2ygz6fCKqxltw+Qrag7ac77ksDwLTjIBVo7YEUoHKJ6DIQMbf hCIbvM0l8U7CaB2CHdgQH4gAbXMhx5PdMWnvfKXNcOi0aCFVWXBm3rBzZcTmwf4p1zX9A/bYGtyZx eGJbbKN2FqywudEx0k2ETFVVG5lv5y7Bf6eKUTkGpY/xHEfpbKYJ5zj7sv323ofbr3IoYnYr9FE2D WpezFMCKINUODjCmtD0NnY1aLnUl+a3hq7sdOyQl58obBCDP8+ek4gYRMVmfKos6qb6LFzIKaX5QY C0ZYEBJFg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lAGhg-0002b8-Ci; Thu, 11 Feb 2021 18:28:36 +0000 Received: from conssluserg-06.nifty.com ([210.131.2.91]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1lAGhd-0002aA-6x for linux-arm-kernel@lists.infradead.org; Thu, 11 Feb 2021 18:28:34 +0000 Received: from mail-pg1-f180.google.com (mail-pg1-f180.google.com [209.85.215.180]) (authenticated) by conssluserg-06.nifty.com with ESMTP id 11BIS0MN015314 for ; Fri, 12 Feb 2021 03:28:00 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-06.nifty.com 11BIS0MN015314 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1613068080; bh=Hbd1jHEJ4+0Y3UNlpXUZ2xllNrQK93rgVJKBwvGVmL4=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=DSyGvuPBD8zMoeemk2bKG6iYkXGKPQihmzYFkOfC56+28SUGS09f+nDbs/99MnNAi ub5ZE2MfWyz9SqVVWxGvZ6UMal3I/0n1p2n7cXFe7//uE3sebuekD+t01zDFX/wgYx tYY0BzqQB3jakfhg7KMpBvKQlpRIxH88r6TZ1wVLEt5RsQJmf1MRNWweX8Zdm12acz P70PwqXMF4jveb/BBqqNzH3rgqLpYwA4jDnB0ltPsBe/pTLn8mjkZkKt2udJ8yfugl tTukbAu0HKX3GIaDRJnVMwIyFumRgnPEk413Gcw3zEs5sy4HjZdSBzgdcsRYwV+BdW C47Hf1DFHZISA== X-Nifty-SrcIP: [209.85.215.180] Received: by mail-pg1-f180.google.com with SMTP id o21so4480056pgn.12 for ; Thu, 11 Feb 2021 10:28:00 -0800 (PST) X-Gm-Message-State: AOAM530nrVHtysTHMprjkSu3jUkwN/Qyqo31Yh43nv/X/y5RcN3ybkYy Lp4nVhTrx3Iw/e+VmjNdZ8xK9ITwavMlpfS7YAY= X-Google-Smtp-Source: ABdhPJySHBd6FtH0OZ1WIyS/vX7OAJIXGGAN3M0cbxk7sYoN2HS/yMkjc3bsSAuUa15koo8k803PqJbDR5RWBtdAKms= X-Received: by 2002:a62:b416:0:b029:1e4:fb5a:55bb with SMTP id h22-20020a62b4160000b02901e4fb5a55bbmr8972253pfn.80.1613068079796; Thu, 11 Feb 2021 10:27:59 -0800 (PST) MIME-Version: 1.0 References: <44dad578df8a848fc378cd358f03b071f44c9a5b.1612955268.git.viresh.kumar@linaro.org> In-Reply-To: <44dad578df8a848fc378cd358f03b071f44c9a5b.1612955268.git.viresh.kumar@linaro.org> From: Masahiro Yamada Date: Fri, 12 Feb 2021 03:27:23 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH V7 1/3] kbuild: Add generic rule to apply fdtoverlay To: Viresh Kumar X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210211_132833_585598_D7890947 X-CRM114-Status: GOOD ( 24.21 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: DTML , Michal Marek , Vincent Guittot , Linux Kbuild mailing list , Bill Mills , Pantelis Antoniou , Linux Kernel Mailing List , Michal Simek , Anmar Oueja , Rob Herring , Geert Uytterhoeven , Frank Rowand , Rob Herring , linux-arm-kernel , David Gibson Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Feb 10, 2021 at 8:13 PM Viresh Kumar wrote: > > From: Rob Herring > > Add a generic rule to apply fdtoverlay in Makefile.lib, so every > platform doesn't need to carry the complex rule. > > The platform's Makefile only needs to have this now: > > DTC_FLAGS_foo_base += -@ > foo-dtbs := foo_base.dtb foo_overlay1.dtbo foo_overlay2.dtbo > overlay-y := foo.dtb Please reuse dtb-y instead of introducing the new overlay-y syntax, that is, foo-dtbs := foo_base.dtb foo_overlay1.dtbo foo_overlay2.dtbo dtb-y := foo.dtb This resembles to composite modules. foo-objs := foo1.o foo2.o foo3.o obj-m := foo.o > Rearrange Makefile.lib to keep DT specific stuff together. > > The files from overlay-y (i.e. files generated by fdtoverlay) aren't > added to dtb-y here, as dtb-y is later used to generate .dt.yaml files > and the files in overlay-y don't have a corresponding dts file and make > dtbs_check fails for them. > > Signed-off-by: Rob Herring > [ Viresh: Add commit log and replace dtb-y with overlay-y, handle > CONFIG_OF_ALL_DTBS case, rearrange Makefile, don't add > overlay-y to dtb-y to skip dtbs_check for them. ] > Signed-off-by: Viresh Kumar > --- > scripts/Makefile.lib | 39 +++++++++++++++++++++++++++------------ > 1 file changed, 27 insertions(+), 12 deletions(-) > > diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib > index b00855b247e0..a6e79e3be527 100644 > --- a/scripts/Makefile.lib > +++ b/scripts/Makefile.lib > @@ -66,23 +66,16 @@ multi-used := $(multi-used-y) $(multi-used-m) > real-obj-y := $(foreach m, $(obj-y), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-))),$($(m:.o=-objs)) $($(m:.o=-y)),$(m))) > real-obj-m := $(foreach m, $(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m)) $($(m:.o=-))),$($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m)),$(m))) > > -always-y += $(always-m) > - > -# hostprogs-always-y += foo > -# ... is a shorthand for > -# hostprogs += foo > -# always-y += foo > -hostprogs += $(hostprogs-always-y) $(hostprogs-always-m) > -always-y += $(hostprogs-always-y) $(hostprogs-always-m) > - > -# userprogs-always-y is likewise. > -userprogs += $(userprogs-always-y) $(userprogs-always-m) > -always-y += $(userprogs-always-y) $(userprogs-always-m) > +# Add base dtb and overlay dtbo > +dtb-y += $(foreach m,$(overlay-y), $(if $(strip $($(m:.dtb=-dtbs))),$($(m:.dtb=-dtbs)),)) > +dtb-$(CONFIG_OF_ALL_DTBS) += $(foreach m,$(overlay-), $(if $(strip $($(m:.dtb=-dtbs))),$($(m:.dtb=-dtbs)),)) > > # DTB > # If CONFIG_OF_ALL_DTBS is enabled, all DT blobs are built > extra-y += $(dtb-y) > +extra-y += $(overlay-y) > extra-$(CONFIG_OF_ALL_DTBS) += $(dtb-) > +extra-$(CONFIG_OF_ALL_DTBS) += $(overlay-) > > ifneq ($(CHECK_DTBS),) > extra-y += $(patsubst %.dtb,%.dt.yaml, $(dtb-y)) > @@ -91,6 +84,19 @@ extra-$(CONFIG_OF_ALL_DTBS) += $(patsubst %.dtb,%.dt.yaml, $(dtb-)) > extra-$(CONFIG_OF_ALL_DTBS) += $(patsubst %.dtbo,%.dt.yaml, $(dtb-)) > endif > > +always-y += $(always-m) > + > +# hostprogs-always-y += foo > +# ... is a shorthand for > +# hostprogs += foo > +# always-y += foo > +hostprogs += $(hostprogs-always-y) $(hostprogs-always-m) > +always-y += $(hostprogs-always-y) $(hostprogs-always-m) > + > +# userprogs-always-y is likewise. > +userprogs += $(userprogs-always-y) $(userprogs-always-m) > +always-y += $(userprogs-always-y) $(userprogs-always-m) > + > # Add subdir path > > extra-y := $(addprefix $(obj)/,$(extra-y)) > @@ -332,6 +338,15 @@ $(obj)/%.dtb: $(src)/%.dts $(DTC) FORCE > $(obj)/%.dtbo: $(src)/%.dts $(DTC) FORCE > $(call if_changed_dep,dtc) > > + > +quiet_cmd_fdtoverlay = DTOVL $@ > + cmd_fdtoverlay = $(objtree)/scripts/dtc/fdtoverlay -o $@ -i $(real-prereqs) > + > +.SECONDEXPANSION: > + > +$(obj)/%.dtb: $$(addprefix $$(obj)/,$$(%-dtbs)) FORCE > + $(call if_changed,fdtoverlay) > + Please do not use .SECONDEXPANSION. This will parse the Makefile twice in _all_ directories, while only a few directories use the overlay-y syntax. Use the multi_depend macro. > DT_CHECKER ?= dt-validate > DT_BINDING_DIR := Documentation/devicetree/bindings > # DT_TMP_SCHEMA may be overridden from Documentation/devicetree/bindings/Makefile > -- > 2.25.0.rc1.19.g042ed3e048af > -- Best Regards Masahiro Yamada _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel