On Tue, 9 Jan 2024 at 07:24, Bryan Brattlof <b...@ti.com> wrote: > > On January 8, 2024 thus sayeth Sumit Garg: > > Hi Bryan, > > > > On Sat, 6 Jan 2024 at 02:12, Bryan Brattlof <b...@ti.com> wrote: > > > > > > 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 <tr...@konsulko.com> > > > > Reviewed-by: Simon Glass <s...@chromium.org> > > > > Reviewed-by: Ilias Apalodimas <ilias.apalodi...@linaro.org> > > > > Signed-off-by: Sumit Garg <sumit.g...@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$(u_boot_dtsi_loc) > > > > \ > > > > -I$(srctree)/arch/$(ARCH)/dts/include \ > > > > -I$(srctree)/include \ > > > > -D__ASSEMBLY__ \ > > > > @@ -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) \ > > > > + -i $(dir $<) -i $(u_boot_dtsi_loc) $(DTC_FLAGS) \ > > > > -d $(depfile).dtc.tmp $(dtc-tmp) || \ > > > > (echo "Check $(shell pwd)/$(pre-tmp) for errors" && > > > > false) \ > > > > ; \ > > > > > > 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. > > > > Thanks for bringing this up. I have been playing with the idea to > > reuse DT includes from upstream. > > > > > > > > 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 > > > > Sure, we should be able to do that if we maintain the correct order of > > include paths as per following patch [1]. If this works for you let me > > know and I will include it for v4. > > > > This works beautifully. > > I did have to hack around to get Makefile.spl working but this is headed > in the right direction for me :)
Thanks for testing. I hope I can take that as a tested-by tag for this patch. -Sumit > > Thank you > ~Bryan