[RFC] Makefile.lib: find capsule ESL dtsi file when CONFIG_OF_UPSTREAM=y

Jonathan Humphreys j-humphreys at ti.com
Wed Mar 27 03:34:51 CET 2024


When CONFIG_OF_UPSTREAM is enabled, DTS files are in SOC subdirectories (vs the
top level dts directory), but when CONFIG_EFI_CAPSULE_AUTHENTICATE is enabled,
the dynamically created dtsi file containing the capsule ESL DT node is in the
parent directory.  This results in a build failure because the #include inserted
in the DTS file is local to the current directory.  Update Makefile to have the
DT preprocessing of #includes search in the parent (dts top level) directory
too.

I'm not sure if this is the best solution.

I was also tempted to just manually include the capsule-key property in the
board dts, and avoid the Makefile implicit inclusion trickery.  I would actually
prefer this approach as everything is more explicit.  But this isn't an option
because if CONFIG_EFI_CAPSULE_AUTHENTICATE is enabled, the implicit inclusion of
the dtsi file happens.  It would be better, IMO, if we only included the
generated dtsi file if CONFIG_EFI_CAPSULE_ESL_FILE is defined.  Was only
supporting the implicit inclusiong approach an intentional design choice?

Thanks
Jon

Signed-off-by: Jonathan Humphreys <j-humphreys at ti.com>
---
 scripts/Makefile.lib | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 12857316c58..62f87517c09 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -334,7 +334,7 @@ cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \
 	(cat $< > $(pre-tmp)); \
 	$(foreach f,$(subst $(quote),,$(dtsi_include_list)), \
 	  echo '$(pound)include "$(f)"' >> $(pre-tmp);) \
-	$(HOSTCC) -E $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $(pre-tmp) ; \
+	$(HOSTCC) -E $(dtc_cpp_flags) -I$(obj) -x assembler-with-cpp -o $(dtc-tmp) $(pre-tmp) ; \
 	$(DTC) -O dtb -o $@ -b 0 \
 		-i $(dir $<) -i $(u_boot_dtsi_loc) $(DTC_FLAGS) \
 		-d $(depfile).dtc.tmp $(dtc-tmp) || \
-- 
2.34.1



More information about the U-Boot mailing list