Skip to contentSkip to conversation

scripts/Makefile.lib: increase detail for dtsi debug output

PATCH Superseded E Shattow 1 participant 2 messages Aug 28, 2025 – Sep 1, 2025 Kbuild

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

E Shattow

author
#0 lore raw

PATCH 1/1 scripts/Makefile.lib: increase detail for dtsi debug output

Detailed dtsi automatic selection debug output when DEVICE_TREE_DEBUG=1
- Indicate when key is undefined and skip undefined search pattern
- Indicate when search pattern is found or not found, and the pattern
- Show values of defined keys

---
 scripts/Makefile.lib | 29 ++++++++++++++++++++++++++---
 1 file changed, 26 insertions(+), 3 deletions(-)
scripts/Makefile.lib +26 -3
index 5db2fbc418a..3cbb20e6b9d 100644
@@ -203,13 +203,36 @@ u_boot_dtsi_options = $(strip $(wildcard $(u_boot_dtsi_loc)$(basename $(notdir $
 	$(wildcard $(u_boot_dtsi_loc)$(subst $\",,$(CONFIG_SYS_VENDOR))-u-boot.dtsi) \
 	$(wildcard $(u_boot_dtsi_loc)u-boot.dtsi))
 
-u_boot_dtsi_options_raw = $(warning Automatic .dtsi inclusion: options: \
+u_boot_dtsi_options_raw = $(warning Automatic inclusion \
+	$(or $(u_boot_dtsi_options),(undefined)) from search order: \
+	$$<=$(if \
+	$(<),$(<) $(if $(wildcard \
 	$(u_boot_dtsi_loc)$(basename $(notdir $<))-u-boot.dtsi \
+	),,not) found @ \
+	$(u_boot_dtsi_loc)$(basename $(notdir $<))-u-boot.dtsi \
+	,(undefined)) || \
+	$$CONFIG_SYS_SOC=$(if \
+	$(CONFIG_SYS_SOC),$(CONFIG_SYS_SOC) $(if $(wildcard \
+	$(u_boot_dtsi_loc)$(subst $\",,$(CONFIG_SYS_SOC))-u-boot.dtsi \
+	),,not) found @ \
 	$(u_boot_dtsi_loc)$(subst $\",,$(CONFIG_SYS_SOC))-u-boot.dtsi \
+	,(undefined)) || \
+	$$CONFIG_SYS_CPU=$(if \
+	$(CONFIG_SYS_CPU),$(CONFIG_SYS_CPU) $(if $(wildcard \
 	$(u_boot_dtsi_loc)$(subst $\",,$(CONFIG_SYS_CPU))-u-boot.dtsi \
+	),,not) found @ \
+	$(u_boot_dtsi_loc)$(subst $\",,$(CONFIG_SYS_CPU))-u-boot.dtsi \
+	,(undefined)) || \
+	$$CONFIG_SYS_VENDOR=$(if \
+	$(CONFIG_SYS_VENDOR),$(CONFIG_SYS_VENDOR) $(if $(wildcard \
+	$(u_boot_dtsi_loc)$(subst $\",,$(CONFIG_SYS_VENDOR))-u-boot.dtsi \
+	),,not) found @ \
 	$(u_boot_dtsi_loc)$(subst $\",,$(CONFIG_SYS_VENDOR))-u-boot.dtsi \
-	$(u_boot_dtsi_loc)u-boot.dtsi ... \
-	found: $(if $(u_boot_dtsi_options),"$(u_boot_dtsi_options)",nothing!))
+	,(undefined)) || \
+	"u-boot.dtsi" $(if $(wildcard \
+	$(u_boot_dtsi_loc)u-boot.dtsi \
+	),,not) found @ \
+	$(u_boot_dtsi_loc)u-boot.dtsi)
 
 # Uncomment for debugging
 # This shows all the files that were considered and the one that we chose.

base-commit: 3dc5e9a0108bb114175b6362f9cb22367402f624

Signature · 1 line
2.50.0
author
#1 lore raw
Quoted 55 lines · E Shattow

Detailed dtsi automatic selection debug output when DEVICE_TREE_DEBUG=1
- Indicate when key is undefined and skip undefined search pattern
- Indicate when search pattern is found or not found, and the pattern
- Show values of defined keys

---
 scripts/Makefile.lib | 29 ++++++++++++++++++++++++++---
 1 file changed, 26 insertions(+), 3 deletions(-)
scripts/Makefile.lib +26 -3
index 5db2fbc418a..3cbb20e6b9d 100644
@@ -203,13 +203,36 @@ u_boot_dtsi_options = $(strip $(wildcard $(u_boot_dtsi_loc)$(basename $(notdir $
 	$(wildcard $(u_boot_dtsi_loc)$(subst $\",,$(CONFIG_SYS_VENDOR))-u-boot.dtsi) \
 	$(wildcard $(u_boot_dtsi_loc)u-boot.dtsi))
 
-u_boot_dtsi_options_raw = $(warning Automatic .dtsi inclusion: options: \
+u_boot_dtsi_options_raw = $(warning Automatic inclusion \
+	$(or $(u_boot_dtsi_options),(undefined)) from search order: \
+	$$<=$(if \
+	$(<),$(<) $(if $(wildcard \
 	$(u_boot_dtsi_loc)$(basename $(notdir $<))-u-boot.dtsi \
+	),,not) found @ \
+	$(u_boot_dtsi_loc)$(basename $(notdir $<))-u-boot.dtsi \
+	,(undefined)) || \
+	$$CONFIG_SYS_SOC=$(if \
+	$(CONFIG_SYS_SOC),$(CONFIG_SYS_SOC) $(if $(wildcard \
+	$(u_boot_dtsi_loc)$(subst $\",,$(CONFIG_SYS_SOC))-u-boot.dtsi \
+	),,not) found @ \
 	$(u_boot_dtsi_loc)$(subst $\",,$(CONFIG_SYS_SOC))-u-boot.dtsi \
+	,(undefined)) || \
+	$$CONFIG_SYS_CPU=$(if \
+	$(CONFIG_SYS_CPU),$(CONFIG_SYS_CPU) $(if $(wildcard \
 	$(u_boot_dtsi_loc)$(subst $\",,$(CONFIG_SYS_CPU))-u-boot.dtsi \
+	),,not) found @ \
+	$(u_boot_dtsi_loc)$(subst $\",,$(CONFIG_SYS_CPU))-u-boot.dtsi \
+	,(undefined)) || \
+	$$CONFIG_SYS_VENDOR=$(if \
+	$(CONFIG_SYS_VENDOR),$(CONFIG_SYS_VENDOR) $(if $(wildcard \
+	$(u_boot_dtsi_loc)$(subst $\",,$(CONFIG_SYS_VENDOR))-u-boot.dtsi \
+	),,not) found @ \
 	$(u_boot_dtsi_loc)$(subst $\",,$(CONFIG_SYS_VENDOR))-u-boot.dtsi \
-	$(u_boot_dtsi_loc)u-boot.dtsi ... \
-	found: $(if $(u_boot_dtsi_options),"$(u_boot_dtsi_options)",nothing!))
+	,(undefined)) || \
+	"u-boot.dtsi" $(if $(wildcard \
+	$(u_boot_dtsi_loc)u-boot.dtsi \
+	),,not) found @ \
+	$(u_boot_dtsi_loc)u-boot.dtsi)
 
 # Uncomment for debugging
 # This shows all the files that were considered and the one that we chose.
Quoted 1 line

base-commit: 3dc5e9a0108bb114175b6362f9cb22367402f624

Postscript, this patch does what I want, but is worse to mantain.

I think I have something easier to understand with foreach(). Will send soon.

-E