u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] [v1] scripts/Makefile.lib: increase detail for dtsi debug output
@ 2025-08-28  6:51 E Shattow
  2025-09-01  3:40 ` E Shattow
  0 siblings, 1 reply; 2+ messages in thread
From: E Shattow @ 2025-08-28  6:51 UTC (permalink / raw)
  To: Tom Rini; +Cc: u-boot, 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

Signed-off-by: E Shattow <e@freeshell.de>
---
 scripts/Makefile.lib | 29 ++++++++++++++++++++++++++---
 1 file changed, 26 insertions(+), 3 deletions(-)

diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 5db2fbc418a..3cbb20e6b9d 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -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
-- 
2.50.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v1] [v1] scripts/Makefile.lib: increase detail for dtsi debug output
  2025-08-28  6:51 [PATCH v1] [v1] scripts/Makefile.lib: increase detail for dtsi debug output E Shattow
@ 2025-09-01  3:40 ` E Shattow
  0 siblings, 0 replies; 2+ messages in thread
From: E Shattow @ 2025-09-01  3:40 UTC (permalink / raw)
  To: Tom Rini; +Cc: u-boot


On 8/27/25 23:51, E Shattow wrote:
> 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
> 
> Signed-off-by: E Shattow <e@freeshell.de>
> ---
>  scripts/Makefile.lib | 29 ++++++++++++++++++++++++++---
>  1 file changed, 26 insertions(+), 3 deletions(-)
> 
> diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
> index 5db2fbc418a..3cbb20e6b9d 100644
> --- a/scripts/Makefile.lib
> +++ b/scripts/Makefile.lib
> @@ -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

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-09-01  3:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-28  6:51 [PATCH v1] [v1] scripts/Makefile.lib: increase detail for dtsi debug output E Shattow
2025-09-01  3:40 ` E Shattow

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).