From: Bryan Brattlof <bb@ti.com>
To: Tom Rini <trini@konsulko.com>,
Vignesh Raghavendra <vigneshr@ti.com>,
Hari Nagalla <hnagalla@ti.com>
Cc: Lukasz Majewski <lukma@denx.de>,
Sean Anderson <seanga2@gmail.com>,
Jaehoon Chung <jh80.chung@samsung.com>,
Simon Glass <sjg@chromium.org>,
Sumit Garg <sumit.garg@linaro.org>, Nishanth Menon <nm@ti.com>,
Andrew Davis <afd@ti.com>, Neha Malcom Francis <n-francis@ti.com>,
UBoot Mailing List <u-boot@lists.denx.de>,
Bryan Brattlof <bb@ti.com>
Subject: [PATCH v2 11/13] Makefile: remove hardcoded device tree source directory
Date: Wed, 31 Jan 2024 21:06:47 -0600 [thread overview]
Message-ID: <20240201030634.1120963-28-bb@ti.com> (raw)
In-Reply-To: <20240201030634.1120963-16-bb@ti.com>
Some boards that choose to utilize the OF_UPSTREAM directory for their
device tree files will need to specify that directory instead of the
traditional arch/$(ARCH)/dts/* path.
Include the correct path to the board's dtbs depending on if OF_UPSTREAM
is selected or not.
Signed-off-by: Bryan Brattlof <bb@ti.com>
---
Makefile | 18 ++++++++++++++----
scripts/Makefile.spl | 17 +++++++++++++----
2 files changed, 27 insertions(+), 8 deletions(-)
diff --git a/Makefile b/Makefile
index 996a43c8624ae..f81d09c892b80 100644
--- a/Makefile
+++ b/Makefile
@@ -1184,6 +1184,16 @@ dt_binding_check: scripts_dtc
quiet_cmd_copy = COPY $@
cmd_copy = cp $< $@
+ifeq ($(CONFIG_OF_UPSTREAM),y)
+ifeq ($(CONFIG_ARM64),y)
+dt_dir := dts/upstream/src/arm64
+else
+dt_dir := dts/upstream/src/$(ARCH)
+endif
+else
+dt_dir := arch/$(ARCH)/dts
+endif
+
ifeq ($(CONFIG_MULTI_DTB_FIT),y)
ifeq ($(CONFIG_MULTI_DTB_FIT_LZO),y)
@@ -1209,7 +1219,7 @@ endif
MKIMAGEFLAGS_fit-dtb.blob = -f auto -A $(ARCH) -T firmware -C none -O u-boot \
-a 0 -e 0 -E \
- $(patsubst %,-b arch/$(ARCH)/dts/%.dtb,$(subst ",,$(CONFIG_OF_LIST))) -d /dev/null
+ $(patsubst %,-b $(dt_dir)/%.dtb,$(subst ",,$(CONFIG_OF_LIST))) -d /dev/null
MKIMAGEFLAGS_fit-dtb.blob += -B 0x8
@@ -1407,9 +1417,9 @@ MKIMAGEFLAGS_u-boot.img = -f auto -A $(ARCH) -T firmware -C none -O u-boot \
-a $(CONFIG_TEXT_BASE) -e $(CONFIG_SYS_UBOOT_START) \
-p $(CONFIG_FIT_EXTERNAL_OFFSET) \
-n "U-Boot $(UBOOTRELEASE) for $(BOARD) board" -E \
- $(patsubst %,-b arch/$(ARCH)/dts/%.dtb,$(subst ",,$(DEVICE_TREE))) \
- $(patsubst %,-b arch/$(ARCH)/dts/%.dtb,$(subst ",,$(CONFIG_OF_LIST))) \
- $(patsubst %,-b arch/$(ARCH)/dts/%.dtbo,$(subst ",,$(CONFIG_OF_OVERLAY_LIST)))
+ $(patsubst %,-b $(dt_dir)/%.dtb,$(subst ",,$(DEVICE_TREE))) \
+ $(patsubst %,-b $(dt_dir)/%.dtb,$(subst ",,$(CONFIG_OF_LIST))) \
+ $(patsubst %,-b $(dt_dir)/%.dtbo,$(subst ",,$(CONFIG_OF_OVERLAY_LIST)))
else
MKIMAGEFLAGS_u-boot.img = -A $(ARCH) -T firmware -C none -O u-boot \
-a $(CONFIG_TEXT_BASE) -e $(CONFIG_SYS_UBOOT_START) \
diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl
index 407fc52376a50..d074ba2350065 100644
--- a/scripts/Makefile.spl
+++ b/scripts/Makefile.spl
@@ -559,9 +559,15 @@ FORCE:
$(obj)/dts/dt-$(SPL_NAME).dtb: dts/dt.dtb
$(Q)$(MAKE) $(build)=$(obj)/dts spl_dtbs
-PHONY += dts_dir
-dts_dir:
- $(shell [ -d $(obj)/dts ] || mkdir -p $(obj)/dts)
+ifeq ($(CONFIG_OF_UPSTREAM),y)
+ifeq ($(CONFIG_ARM64),y)
+dt_dir := dts/upstream/src/arm64
+else
+dt_dir := dts/upstream/src/$(ARCH)
+endif
+else
+dt_dir := arch/$(ARCH)/dts
+endif
# Declare the contents of the .PHONY variable as phony. We keep that
# information in a variable so we can use it in if_changed and friends.
@@ -569,8 +575,11 @@ dts_dir:
SPL_OF_LIST_TARGETS = $(patsubst %,dts/%.dtb,$(subst ",,$(CONFIG_SPL_OF_LIST)))
SHRUNK_ARCH_DTB = $(addprefix $(obj)/,$(SPL_OF_LIST_TARGETS))
+$(dir $(SHRUNK_ARCH_DTB)):
+ $(shell [ -d $@ ] || mkdir -p $@)
+
.SECONDEXPANSION:
-$(SHRUNK_ARCH_DTB): $$(patsubst $(obj)/dts/%, arch/$(ARCH)/dts/%, $$@) dts_dir
+$(SHRUNK_ARCH_DTB): $$(patsubst $(obj)/dts/%, $(dt_dir)/%, $$@) $(dir $(SHRUNK_ARCH_DTB))
$(call if_changed,fdtgrep)
targets += $(SPL_OF_LIST_TARGETS)
--
2.43.0
next prev parent reply other threads:[~2024-02-01 3:08 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-01 3:06 [PATCH] arm: dts: k3-am62p5: enable the wkup i2c bus Bryan Brattlof
2024-02-01 3:06 ` [PATCH v2 00/13] Introduce basic support for TI's AM62Px SoC family Bryan Brattlof
2024-02-02 8:03 ` Sumit Garg
2024-02-02 16:36 ` Bryan Brattlof
2024-02-01 3:06 ` [PATCH v2 01/13] soc: add info to identify the am62p " Bryan Brattlof
2024-02-01 14:41 ` Igor Opaniuk
2024-02-01 3:06 ` [PATCH v2 02/13] power: domain: ti: use IS_ENABLED macro Bryan Brattlof
2024-02-01 14:46 ` Igor Opaniuk
2024-02-01 3:06 ` [PATCH v2 03/13] arm: mach-k3: am62px: introduce clock and device files for wkup spl Bryan Brattlof
2024-02-01 3:06 ` [PATCH v2 04/13] ram: k3-ddrss: enable the am62ax's DDR controller for am62px Bryan Brattlof
2024-02-01 3:06 ` [PATCH v2 05/13] arm: mach-k3: invert logic for split DM firmware config Bryan Brattlof
2024-02-02 16:44 ` Andrew Davis
2024-02-02 17:12 ` Bryan Brattlof
2024-02-01 3:06 ` [PATCH v2 06/13] arch: mach-k3: introduce basic files to support the am62px SoC family Bryan Brattlof
2024-02-01 3:06 ` [PATCH v2 07/13] board: ti: introduce basic board files for the am62px family Bryan Brattlof
2024-02-01 3:06 ` [PATCH v2 08/13] firmware: ti_sci_static_data: add static DMA channel data Bryan Brattlof
2024-02-01 3:06 ` [PATCH v2 09/13] dma: ti: k3-udma: Add DMA PSIL mappings for AM62P and J722S Bryan Brattlof
2024-02-01 3:06 ` [PATCH v2 10/13] arm: dts: introduce am62p5 uboot dts files Bryan Brattlof
2024-02-02 15:53 ` Andrew Davis
2024-02-02 16:28 ` Bryan Brattlof
2024-02-02 16:36 ` Andrew Davis
2024-02-02 17:06 ` Bryan Brattlof
2024-02-01 3:06 ` Bryan Brattlof [this message]
2024-02-02 7:57 ` [PATCH v2 11/13] Makefile: remove hardcoded device tree source directory Sumit Garg
2024-02-01 3:06 ` [PATCH v2 12/13] configs: introduce configs needed for the am62px Bryan Brattlof
2024-02-01 3:06 ` [PATCH v2 13/13] doc: board: ti: introduce am62px documentation Bryan Brattlof
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=20240201030634.1120963-28-bb@ti.com \
--to=bb@ti.com \
--cc=afd@ti.com \
--cc=hnagalla@ti.com \
--cc=jh80.chung@samsung.com \
--cc=lukma@denx.de \
--cc=n-francis@ti.com \
--cc=nm@ti.com \
--cc=seanga2@gmail.com \
--cc=sjg@chromium.org \
--cc=sumit.garg@linaro.org \
--cc=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
--cc=vigneshr@ti.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