
Hi Sumit!
On December 28, 2023 thus sayeth Sumit Garg:
Allow u-boot to build DTB from a different directory tree such that *-u-boot.dtsi files can be included from a common location. Currently that location is arch/$(ARCH)/dts/, so statically define that common location.
This is needed for platform owners to start building DTB files from devicetree-rebasing directory but still being able to include *-u-boot.dtsi files.
Reviewed-by: Tom Rini trini@konsulko.com Reviewed-by: Simon Glass sjg@chromium.org Reviewed-by: Ilias Apalodimas ilias.apalodimas@linaro.org Signed-off-by: Sumit Garg sumit.garg@linaro.org
...
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 27b9437027c..09330421856 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib
...
# Uncomment for debugging @@ -190,6 +192,7 @@ dtsi_include_list += $(CONFIG_DEVICE_TREE_INCLUDES) dtc_cpp_flags = -Wp,-MD,$(depfile).pre.tmp -nostdinc \ $(UBOOTINCLUDE) \ -I$(dir $<) \
-I$(srctree)/arch/$(ARCH)/dts/include \ -I$(srctree)/include \ -D__ASSEMBLY__ \-I$(u_boot_dtsi_loc) \
@@ -328,7 +331,7 @@ cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \ echo '$(pound)include "$(f)"' >> $(pre-tmp);) \ $(HOSTCC) -E $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $(pre-tmp) ; \ $(DTC) -O dtb -o $@ -b 0 \
-i $(dir $<) $(DTC_FLAGS) \
-d $(depfile).dtc.tmp $(dtc-tmp) || \ (echo "Check $(shell pwd)/$(pre-tmp) for errors" && false) \ ; \-i $(dir $<) -i $(u_boot_dtsi_loc) $(DTC_FLAGS) \
One of the issues I see with having a separate OF_UPSTREAM and U-Boot dt directory is when we have U-Boot board files that use dtsi files in the OF_UPSTREAM folder.
For example our reference boards uses the primary bootloader's dtb (eg: k3-am62a7-r5-sk.dts) which #includes the k3-am62a7-sk.dts that will be found in the OF_UPSTREAM directory and modifies it to give it the perspective of the micro-controller it will be running on during boot.
What do you think if we have both paths included regardless if OF_UPSTREAM is selected or not? IDK if this will break anyone else
~Bryan