Linux kbuild/kconfig development
 help / color / mirror / Atom feed
From: Daniel Walker <danielwa@cisco.com>
To: Masahiro Yamada <masahiroy@kernel.org>,
	Michal Marek <michal.lkml@markovi.net>,
	Nick Desaulniers <ndesaulniers@google.com>
Cc: xe-linux-external@cisco.com, linux-kbuild@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [RFC-PATCH] Makefile: dts: include directory makefile for DTC_FLAGS
Date: Wed,  7 Sep 2022 16:03:38 -0700	[thread overview]
Message-ID: <20220907230339.271633-1-danielwa@cisco.com> (raw)

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


             reply	other threads:[~2022-09-07 23:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-07 23:03 Daniel Walker [this message]
2022-09-08  7:08 ` [RFC-PATCH] Makefile: dts: include directory makefile for DTC_FLAGS Masahiro Yamada
2022-09-08 14:38   ` Daniel Walker
2022-09-08 15:01     ` Masahiro Yamada

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220907230339.271633-1-danielwa@cisco.com \
    --to=danielwa@cisco.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=michal.lkml@markovi.net \
    --cc=ndesaulniers@google.com \
    --cc=xe-linux-external@cisco.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox