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=-16.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,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 DE29DC433DB for ; Thu, 11 Feb 2021 20:12:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 97EAE64E15 for ; Thu, 11 Feb 2021 20:12:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231308AbhBKUMB (ORCPT ); Thu, 11 Feb 2021 15:12:01 -0500 Received: from mail.kernel.org ([198.145.29.99]:42478 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230315AbhBKUGe (ORCPT ); Thu, 11 Feb 2021 15:06:34 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6FD3A64E56; Thu, 11 Feb 2021 20:05:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1613073949; bh=J3OjsRR/EFCpgr5E1RGuPP8NVmShsvyMuey5Yd5flQo=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=vHIwuYixkcXmydjNAQ0ZbJgg4q7K4440VsMUpCH2URDxWrAWM7eWJvasHh4jv+WHU qpx7fuWFmUK3jehNOCX0vgUZOC6PlO3Q8dcbJstzRK75RcgnW27GOXCvD0LQJsNt18 UrRoPvGvKG3xdDjcOJld7W5Xvt9JI0cB8hJNsu9qKK3F+b2TcvzIupWJp+HXgbcp52 lSCrUT2d1Cy7uOaMWBXCSVpPs275f7xxjneCxfyhjRlbz29/2B2ciCN9ShpgPLXt9w FBWgT5AeAVYLwjS+qfcjxvgxkY7ce1+oGoCyZzTh/QlOKEMbRiHye1R5uAwjVXYnfv wjqTqOSrC941g== Received: by mail-ej1-f41.google.com with SMTP id a9so11966064ejr.2; Thu, 11 Feb 2021 12:05:49 -0800 (PST) X-Gm-Message-State: AOAM532ZQV4rnlhMHdPudEL9CZOSMaFp9mA6XqOsanLllJIYwEcK8but geIM1dO93XuPsbHcZ/FZRg7/67+B0ZTI/61S5A== X-Google-Smtp-Source: ABdhPJwTcXAsCnv7YzmD2LNO8xfdbS4rMuQuZymW1Aig86uNJ22BYrtXIHWbatqKKQkk2xi+AlLo1RmhClMHeseHQ/w= X-Received: by 2002:a17:906:57cd:: with SMTP id u13mr10134515ejr.341.1613073947801; Thu, 11 Feb 2021 12:05:47 -0800 (PST) MIME-Version: 1.0 References: <44dad578df8a848fc378cd358f03b071f44c9a5b.1612955268.git.viresh.kumar@linaro.org> In-Reply-To: From: Rob Herring Date: Thu, 11 Feb 2021 14:05:35 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH V7 1/3] kbuild: Add generic rule to apply fdtoverlay To: Masahiro Yamada , Viresh Kumar Cc: Frank Rowand , 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 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 11, 2021 at 12:28 PM Masahiro Yamada wrote: > > 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 That's what I had, but I believe Viresh changed this because we don't want to run schema checks on foo.dtb (as foo.dts doesn't exist). However, we should be able to filter those out using something similar to technique used for multi-used-y and real-obj-y. We just need to drop composite entries when creating the .dt.yaml list. > 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. Would be better if you do this in a separate patch or not at all. It was sorted more by the type of operation, than the target. Also, we also already have one conflict in linux-next with changing extra- to always-, let's not make it worse or this will be 5.13 for sure. > > 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. I knew you'd have a better way. Rob 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 40FAEC433DB for ; Thu, 11 Feb 2021 20:07:03 +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 DC55B64D9A for ; Thu, 11 Feb 2021 20:07:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DC55B64D9A 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=6f0kANHfOdpzJ5CRgEuCefHnBtlMp/z2gO4TGexUZCA=; b=c0oLphuAZ7/6SQXKUWLnlC7ew WBFvq4qd0qyH50cecLnTl7iPd5V06gK2bd8bLAMi39Pa+e+7kE5oiAH1GWg9bru2UJ2Kx2kZYhYK/ nRHzvi3JK0IfBRP8QfFKtZXUx1I8v0PGlam4BdfujBgtUUEBgQMF0P94/GYbK3zdhFLbwZZ90x0pN bXLNCcWOI7OWBtxRjvfJir9B7qAhi+XkxTY7rhyEugmIgPa60IW/F31FXpKqCDKLbU/ShH5pENITE rgA8RnnxPs3skgM6DO+E0xlH+q0pZh5/rslc0fhNIXAHiRa37pRRd5h/PsVnWo7n4j+LkpImb1GYy fIt+BGXng==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lAIDp-0007Z1-CU; Thu, 11 Feb 2021 20:05:53 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1lAIDn-0007YS-CS for linux-arm-kernel@lists.infradead.org; Thu, 11 Feb 2021 20:05:52 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7E52764E6F for ; Thu, 11 Feb 2021 20:05:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1613073949; bh=J3OjsRR/EFCpgr5E1RGuPP8NVmShsvyMuey5Yd5flQo=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=vHIwuYixkcXmydjNAQ0ZbJgg4q7K4440VsMUpCH2URDxWrAWM7eWJvasHh4jv+WHU qpx7fuWFmUK3jehNOCX0vgUZOC6PlO3Q8dcbJstzRK75RcgnW27GOXCvD0LQJsNt18 UrRoPvGvKG3xdDjcOJld7W5Xvt9JI0cB8hJNsu9qKK3F+b2TcvzIupWJp+HXgbcp52 lSCrUT2d1Cy7uOaMWBXCSVpPs275f7xxjneCxfyhjRlbz29/2B2ciCN9ShpgPLXt9w FBWgT5AeAVYLwjS+qfcjxvgxkY7ce1+oGoCyZzTh/QlOKEMbRiHye1R5uAwjVXYnfv wjqTqOSrC941g== Received: by mail-ej1-f54.google.com with SMTP id b9so11895775ejy.12 for ; Thu, 11 Feb 2021 12:05:49 -0800 (PST) X-Gm-Message-State: AOAM533GWhblzW1OZlNUIIMcvswZj+QpcT4iKangjVBYinfFyCE7juvV 6ijFPslouohVsOBKJtOUsc4FySHRdg57E0xxzQ== X-Google-Smtp-Source: ABdhPJwTcXAsCnv7YzmD2LNO8xfdbS4rMuQuZymW1Aig86uNJ22BYrtXIHWbatqKKQkk2xi+AlLo1RmhClMHeseHQ/w= X-Received: by 2002:a17:906:57cd:: with SMTP id u13mr10134515ejr.341.1613073947801; Thu, 11 Feb 2021 12:05:47 -0800 (PST) MIME-Version: 1.0 References: <44dad578df8a848fc378cd358f03b071f44c9a5b.1612955268.git.viresh.kumar@linaro.org> In-Reply-To: From: Rob Herring Date: Thu, 11 Feb 2021 14:05:35 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH V7 1/3] kbuild: Add generic rule to apply fdtoverlay To: Masahiro Yamada , Viresh Kumar X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210211_150551_569911_B450331F X-CRM114-Status: GOOD ( 29.88 ) 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 , Geert Uytterhoeven , Frank Rowand , 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 Thu, Feb 11, 2021 at 12:28 PM Masahiro Yamada wrote: > > 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 That's what I had, but I believe Viresh changed this because we don't want to run schema checks on foo.dtb (as foo.dts doesn't exist). However, we should be able to filter those out using something similar to technique used for multi-used-y and real-obj-y. We just need to drop composite entries when creating the .dt.yaml list. > 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. Would be better if you do this in a separate patch or not at all. It was sorted more by the type of operation, than the target. Also, we also already have one conflict in linux-next with changing extra- to always-, let's not make it worse or this will be 5.13 for sure. > > 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. I knew you'd have a better way. Rob _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel