summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorBryan Brattlof <bb@ti.com>2024-03-04 17:42:57 +0530
committerTom Rini <trini@konsulko.com>2024-03-04 09:01:27 -0500
commitbdbbf1d7b55434973402c390a822490ce6e14994 (patch)
treee40849f5c0b8c449fb750a25c17793cb3a3689b6 /scripts
parentb9f5620a477a9e4290aeeddeed50898d49f7a792 (diff)
downloadu-boot-bdbbf1d7b55434973402c390a822490ce6e14994.tar.gz
u-boot-bdbbf1d7b55434973402c390a822490ce6e14994.tar.bz2
u-boot-bdbbf1d7b55434973402c390a822490ce6e14994.zip
Makefile: remove hardcoded device tree source directory
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> Signed-off-by: Sumit Garg <sumit.garg@linaro.org> Tested-by: Fabio Estevam <festevam@gmail.com>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Makefile.spl17
1 files changed, 13 insertions, 4 deletions
diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl
index 407fc52376..d074ba2350 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)