Linux kbuild/kconfig development
 help / color / mirror / Atom feed
* [RFC-PATCH] Makefile: dts: include directory makefile for DTC_FLAGS
@ 2022-09-07 23:03 Daniel Walker
  2022-09-08  7:08 ` Masahiro Yamada
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel Walker @ 2022-09-07 23:03 UTC (permalink / raw)
  To: Masahiro Yamada, Michal Marek, Nick Desaulniers
  Cc: xe-linux-external, linux-kbuild, linux-kernel

The current Makefile will drop the DTC_FLAGS depending on how you
build. For example,

make dtbs

includes correct DTC_FLAGS. However if you run,

make nvidia/tegra210-p2371-2180.dtb

The DTC_FLAGS are dropped. This appears to be caused by the top level
Makefile not including the Makefile from the directory where the dts lives.

This normally doesn't matter because most dts files have nothing added
from the Makefile. This changes when you have overlays, and the
DTC_FLAGS modifier is mandatory for the dtb to work correctly.

This change adds a -f argument which includes the Makefile from the
directory where the dts file reside. This change is also required for
dtbo files.

Cc: xe-linux-external@cisco.com
Signed-off-by: Daniel Walker <danielwa@cisco.com>
---
 Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index ac16bd92b156..bc245e2dc8d1 100644
--- a/Makefile
+++ b/Makefile
@@ -1460,10 +1460,10 @@ endif
 ifneq ($(dtstree),)
 
 %.dtb: dtbs_prepare
-	$(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@
+	$(Q)$(MAKE) -f $(srctree)/$(dtstree)/$(dir $@)Makefile $(build)=$(dtstree) $(dtstree)/$@
 
 %.dtbo: dtbs_prepare
-	$(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@
+	$(Q)$(MAKE) -f $(srctree)/$(dtstree)/$(dir $@)Makefile $(build)=$(dtstree) $(dtstree)/$@
 
 PHONY += dtbs dtbs_prepare dtbs_install dtbs_check
 dtbs: dtbs_prepare
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [RFC-PATCH] Makefile: dts: include directory makefile for DTC_FLAGS
  2022-09-07 23:03 [RFC-PATCH] Makefile: dts: include directory makefile for DTC_FLAGS Daniel Walker
@ 2022-09-08  7:08 ` Masahiro Yamada
  2022-09-08 14:38   ` Daniel Walker
  0 siblings, 1 reply; 4+ messages in thread
From: Masahiro Yamada @ 2022-09-08  7:08 UTC (permalink / raw)
  To: Daniel Walker
  Cc: Michal Marek, Nick Desaulniers, xe-linux-external,
	Linux Kbuild mailing list, Linux Kernel Mailing List

On Thu, Sep 8, 2022 at 8:03 AM Daniel Walker <danielwa@cisco.com> wrote:
>
> The current Makefile will drop the DTC_FLAGS depending on how you
> build. For example,
>
> make dtbs
>
> includes correct DTC_FLAGS. However if you run,
>
> make nvidia/tegra210-p2371-2180.dtb
>
> The DTC_FLAGS are dropped. This appears to be caused by the top level
> Makefile not including the Makefile from the directory where the dts lives.
>
> This normally doesn't matter because most dts files have nothing added
> from the Makefile. This changes when you have overlays, and the
> DTC_FLAGS modifier is mandatory for the dtb to work correctly.


I recently fixed another issue of single target builds.
https://patchwork.kernel.org/project/linux-kbuild/patch/20220906061313.1445810-2-masahiroy@kernel.org/


It fixed your issue as well.






>
> This change adds a -f argument which includes the Makefile from the
> directory where the dts file reside. This change is also required for
> dtbo files.
>
> Cc: xe-linux-external@cisco.com
> Signed-off-by: Daniel Walker <danielwa@cisco.com>
> ---
>  Makefile | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index ac16bd92b156..bc245e2dc8d1 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1460,10 +1460,10 @@ endif
>  ifneq ($(dtstree),)
>
>  %.dtb: dtbs_prepare
> -       $(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@
> +       $(Q)$(MAKE) -f $(srctree)/$(dtstree)/$(dir $@)Makefile $(build)=$(dtstree) $(dtstree)/$@
>
>  %.dtbo: dtbs_prepare
> -       $(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@
> +       $(Q)$(MAKE) -f $(srctree)/$(dtstree)/$(dir $@)Makefile $(build)=$(dtstree) $(dtstree)/$@
>
>  PHONY += dtbs dtbs_prepare dtbs_install dtbs_check
>  dtbs: dtbs_prepare
> --
> 2.25.1
>


-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC-PATCH] Makefile: dts: include directory makefile for DTC_FLAGS
  2022-09-08  7:08 ` Masahiro Yamada
@ 2022-09-08 14:38   ` Daniel Walker
  2022-09-08 15:01     ` Masahiro Yamada
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel Walker @ 2022-09-08 14:38 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Michal Marek, Nick Desaulniers, xe-linux-external,
	Linux Kbuild mailing list, Linux Kernel Mailing List

On Thu, Sep 08, 2022 at 04:08:06PM +0900, Masahiro Yamada wrote:
> On Thu, Sep 8, 2022 at 8:03 AM Daniel Walker <danielwa@cisco.com> wrote:
> >
> > The current Makefile will drop the DTC_FLAGS depending on how you
> > build. For example,
> >
> > make dtbs
> >
> > includes correct DTC_FLAGS. However if you run,
> >
> > make nvidia/tegra210-p2371-2180.dtb
> >
> > The DTC_FLAGS are dropped. This appears to be caused by the top level
> > Makefile not including the Makefile from the directory where the dts lives.
> >
> > This normally doesn't matter because most dts files have nothing added
> > from the Makefile. This changes when you have overlays, and the
> > DTC_FLAGS modifier is mandatory for the dtb to work correctly.
> 
> 
> I recently fixed another issue of single target builds.
> https://patchwork.kernel.org/project/linux-kbuild/patch/20220906061313.1445810-2-masahiroy@kernel.org/
> 
> 
> It fixed your issue as well.
> 
> 

Yeah, it fixes the issue I was seeing. Are you planning to resubmit this or is
the v2 the final version ?

Daniel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC-PATCH] Makefile: dts: include directory makefile for DTC_FLAGS
  2022-09-08 14:38   ` Daniel Walker
@ 2022-09-08 15:01     ` Masahiro Yamada
  0 siblings, 0 replies; 4+ messages in thread
From: Masahiro Yamada @ 2022-09-08 15:01 UTC (permalink / raw)
  To: Daniel Walker
  Cc: Michal Marek, Nick Desaulniers, xe-linux-external,
	Linux Kbuild mailing list, Linux Kernel Mailing List

On Thu, Sep 8, 2022 at 11:39 PM Daniel Walker <danielwa@cisco.com> wrote:
>
> On Thu, Sep 08, 2022 at 04:08:06PM +0900, Masahiro Yamada wrote:
> > On Thu, Sep 8, 2022 at 8:03 AM Daniel Walker <danielwa@cisco.com> wrote:
> > >
> > > The current Makefile will drop the DTC_FLAGS depending on how you
> > > build. For example,
> > >
> > > make dtbs
> > >
> > > includes correct DTC_FLAGS. However if you run,
> > >
> > > make nvidia/tegra210-p2371-2180.dtb
> > >
> > > The DTC_FLAGS are dropped. This appears to be caused by the top level
> > > Makefile not including the Makefile from the directory where the dts lives.
> > >
> > > This normally doesn't matter because most dts files have nothing added
> > > from the Makefile. This changes when you have overlays, and the
> > > DTC_FLAGS modifier is mandatory for the dtb to work correctly.
> >
> >
> > I recently fixed another issue of single target builds.
> > https://patchwork.kernel.org/project/linux-kbuild/patch/20220906061313.1445810-2-masahiroy@kernel.org/
> >
> >
> > It fixed your issue as well.
> >
> >
>
> Yeah, it fixes the issue I was seeing. Are you planning to resubmit this or is
> the v2 the final version ?
>
> Daniel


I do not have a plan to submit v3
(unless a new issue comes up)



-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-09-08 15:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-07 23:03 [RFC-PATCH] Makefile: dts: include directory makefile for DTC_FLAGS Daniel Walker
2022-09-08  7:08 ` Masahiro Yamada
2022-09-08 14:38   ` Daniel Walker
2022-09-08 15:01     ` Masahiro Yamada

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox