All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] kbuild: Pass -Eno-node_name_not_empty to DTC if supported
@ 2026-10-04  6:17 Marek Vasut
  2026-10-04  6:17 ` [PATCH 2/2] kbuild: Do not pass -Wno-graph_child_address to DTC unless supported Marek Vasut
  2026-10-05  6:44 ` [PATCH 1/2] kbuild: Pass -Eno-node_name_not_empty to DTC if supported Rasmus Villemoes
  0 siblings, 2 replies; 4+ messages in thread
From: Marek Vasut @ 2026-10-04  6:17 UTC (permalink / raw)
  To: u-boot
  Cc: Marek Vasut, David Gibson, Héctor Orón Martínez,
	Mattia Maldini, Rasmus Villemoes, Simon Glass, Tom Rini,
	Vagrant Cascadian

Since DTC 7c78c8542d73 ("Added empty node name check") , U-Boot binman
use of placeholder node names such as @fdt-SEQ and @config-SEQ triggers
DTC ERROR (node_name_not_empty). Inhibit the error, as these placeholder
nodes are updated by binman and replaced by proper nodes, the encoding
in DTB is temporary. Since -Eno-node_name_not_empty is only available in
DTC 1.8.0 and newer, introduce "dtc-option" make function which is very
similar to "cc-option" and other such Kbuild functions, and add the DTC
option conditionally.

This can be triggered on e.g. Debian Testing (as of 2026-09-07) when
using system DTC to build a DT which include binman placeholder nodes:

$ export DTC=/usr/bin/dtc
$ $DTC --version
Version: DTC 1.8.1
$ r8a779g3_sparrowhawk_defconfig
$ make -j$(nproc)
...
./arch/arm/dts/r8a779g0-u-boot.dtsi:61.16-70.9: ERROR (node_name_not_empty): /binman/section/u-boot/fit/images/@fdt-SEQ: Empty node name
./arch/arm/dts/r8a779g0-u-boot.dtsi:76.19-80.9: ERROR (node_name_not_empty): /binman/section/u-boot/fit/configurations/@config-SEQ: Empty node name
ERROR: Input tree has errors, aborting (use -f to force output)
Check /path/to/dts/upstream/src/arm64/renesas/.r8a779g3-sparrow-hawk.dtb.pre.tmp for errors

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
---
Cc: David Gibson <david@gibson.dropbear.id.au>
Cc: Héctor Orón Martínez <zumbi@debian.org>
Cc: Mattia Maldini <mattia512maldini@gmail.com>
Cc: Rasmus Villemoes <rv@rasmusvillemoes.dk>
Cc: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>
Cc: Vagrant Cascadian <vagrant@debian.org>
Cc: u-boot@lists.u-boot-project.org
---
 scripts/Makefile.lib | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 122c8e78204..330ab3892e9 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -378,6 +378,19 @@ DTC_FLAGS += $(DTC_FLAGS_$(basetarget))
 # Set -@ if the target is a base DTB that overlay is applied onto
 DTC_FLAGS += $(if $(filter $(patsubst $(obj)/%,%,$@), $(base-dtb-y)), -@)
 
+# dtc-option
+# Usage: DTC_FLAGS += $(call dtc-option,-Eno-node_name_not_empty)
+dtc-option = $(call try-run,\
+	printf '/dts-v1/; / {};' | $(DTC) $(1) -I dts -O dtb -o /dev/null,$(1),$(2))
+
+# Since DTC 7c78c8542d73 ("Added empty node name check") , U-Boot binman
+# use of placeholder node names such as @fdt-SEQ and @config-SEQ triggers
+# DTC ERROR (node_name_not_empty). Inhibit the error, as these placeholder
+# nodes are updated by binman and replaced by proper nodes, the encoding
+# in DTB is temporary. Since -Eno-node_name_not_empty is only available in
+# DTC 1.8.0 and newer, add the option conditionally.
+DTC_FLAGS += $(call dtc-option, -Eno-node_name_not_empty)
+
 # Generate an assembly file to wrap the output of the device tree compiler
 quiet_cmd_dt_S_dtb= DTBS    $@
 # Modified for U-Boot
-- 
2.53.0


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

* [PATCH 2/2] kbuild: Do not pass -Wno-graph_child_address to DTC unless supported
  2026-10-04  6:17 [PATCH 1/2] kbuild: Pass -Eno-node_name_not_empty to DTC if supported Marek Vasut
@ 2026-10-04  6:17 ` Marek Vasut
  2026-10-05 20:59   ` Tom Rini
  2026-10-05  6:44 ` [PATCH 1/2] kbuild: Pass -Eno-node_name_not_empty to DTC if supported Rasmus Villemoes
  1 sibling, 1 reply; 4+ messages in thread
From: Marek Vasut @ 2026-10-04  6:17 UTC (permalink / raw)
  To: u-boot
  Cc: Marek Vasut, David Gibson, Héctor Orón Martínez,
	Niklas Söderlund, Rasmus Villemoes, Rob Herring (Arm),
	Simon Glass, Tom Rini, Vagrant Cascadian

DTC commit cba90ce82064 ("checks: Remove check for graph child addresses")
removed -Wno-graph_child_address command line parameter. Apply this option
only to DTC older than 1.8.0.

This can be triggered on e.g. Debian Testing (as of 2026-09-07) when
using system DTC:

$ export DTC=/usr/bin/dtc
$ $DTC --version
Version: DTC 1.8.1
$ r8a779g3_sparrowhawk_defconfig
$ make -j$(nproc)
...
FATAL ERROR: Unrecognized check name "graph_child_address"
Check /path/to/dts/upstream/src/arm64/renesas/.r8a779g3-sparrow-hawk.dtb.pre.tmp for errors

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
---
Cc: David Gibson <david@gibson.dropbear.id.au>
Cc: Héctor Orón Martínez <zumbi@debian.org>
Cc: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Cc: Rasmus Villemoes <rv@rasmusvillemoes.dk>
Cc: Rob Herring (Arm) <robh@kernel.org>
Cc: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>
Cc: Vagrant Cascadian <vagrant@debian.org>
Cc: u-boot@lists.u-boot-project.org
---
 scripts/Makefile.lib | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 330ab3892e9..3817115816b 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -357,7 +357,6 @@ DTC_FLAGS += -Wno-unit_address_vs_reg \
 	-Wno-unit_address_format \
 	-Wno-avoid_unnecessary_addr_size \
 	-Wno-alias_paths \
-	-Wno-graph_child_address \
 	-Wno-simple_bus_reg \
 	-Wno-unique_unit_address \
 	-Wno-pci_device_reg
@@ -391,6 +390,11 @@ dtc-option = $(call try-run,\
 # DTC 1.8.0 and newer, add the option conditionally.
 DTC_FLAGS += $(call dtc-option, -Eno-node_name_not_empty)
 
+# Since cba90ce82064 ("checks: Remove check for graph child addresses")
+# the -Wno-graph_child_address is no longer available. Apply the option
+# only to DTC older than 1.8.0.
+DTC_FLAGS += $(call dtc-option, -Wno-graph_child_address)
+
 # Generate an assembly file to wrap the output of the device tree compiler
 quiet_cmd_dt_S_dtb= DTBS    $@
 # Modified for U-Boot
-- 
2.53.0


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

* Re: [PATCH 1/2] kbuild: Pass -Eno-node_name_not_empty to DTC if supported
  2026-10-04  6:17 [PATCH 1/2] kbuild: Pass -Eno-node_name_not_empty to DTC if supported Marek Vasut
  2026-10-04  6:17 ` [PATCH 2/2] kbuild: Do not pass -Wno-graph_child_address to DTC unless supported Marek Vasut
@ 2026-10-05  6:44 ` Rasmus Villemoes
  1 sibling, 0 replies; 4+ messages in thread
From: Rasmus Villemoes @ 2026-10-05  6:44 UTC (permalink / raw)
  To: Marek Vasut
  Cc: u-boot, David Gibson, Héctor Orón Martínez,
	Mattia Maldini, Simon Glass, Tom Rini, Vagrant Cascadian

On Sun, Oct 04 2026, Marek Vasut <marek.vasut+renesas@mailbox.org> wrote:

> Since DTC 7c78c8542d73 ("Added empty node name check") , U-Boot binman
> use of placeholder node names such as @fdt-SEQ and @config-SEQ triggers
> DTC ERROR (node_name_not_empty). Inhibit the error, as these placeholder
> nodes are updated by binman and replaced by proper nodes, the encoding
> in DTB is temporary. Since -Eno-node_name_not_empty is only available in
> DTC 1.8.0 and newer, introduce "dtc-option" make function which is very
> similar to "cc-option" and other such Kbuild functions, and add the DTC
> option conditionally.

Is this the best way to handle this? This also removes the error for
empty node names that might appear in the "real" part of the dtb, no?

I'm not really familiar with the binman magic, but is there any reason
those placeholder nodes cannot be binman@fdt-SEQ and binman@config-SEQ,
or anything like that? Sure, the binman code would need updating and
there would be some -u-boot.dtsi files to update, but I'm currently
counting less than 70 instances, about half in tests, so it would not be
a lot of churn, and changing it now would mean we avoid having to carry
around that dtc flag forever.

Rasmus

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

* Re: [PATCH 2/2] kbuild: Do not pass -Wno-graph_child_address to DTC unless supported
  2026-10-04  6:17 ` [PATCH 2/2] kbuild: Do not pass -Wno-graph_child_address to DTC unless supported Marek Vasut
@ 2026-10-05 20:59   ` Tom Rini
  0 siblings, 0 replies; 4+ messages in thread
From: Tom Rini @ 2026-10-05 20:59 UTC (permalink / raw)
  To: Marek Vasut
  Cc: u-boot, David Gibson, Héctor Orón Martínez,
	Niklas Söderlund, Rasmus Villemoes, Rob Herring (Arm),
	Simon Glass, Vagrant Cascadian

[-- Attachment #1: Type: text/plain, Size: 924 bytes --]

On Sun, Oct 04, 2026 at 08:17:43AM +0200, Marek Vasut wrote:

> DTC commit cba90ce82064 ("checks: Remove check for graph child addresses")
> removed -Wno-graph_child_address command line parameter. Apply this option
> only to DTC older than 1.8.0.
> 
> This can be triggered on e.g. Debian Testing (as of 2026-09-07) when
> using system DTC:
> 
> $ export DTC=/usr/bin/dtc
> $ $DTC --version
> Version: DTC 1.8.1
> $ r8a779g3_sparrowhawk_defconfig
> $ make -j$(nproc)
> ...
> FATAL ERROR: Unrecognized check name "graph_child_address"
> Check /path/to/dts/upstream/src/arm64/renesas/.r8a779g3-sparrow-hawk.dtb.pre.tmp for errors
> 
> Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
> ---

We should just drop it unconditionally, both to easier match up with
future kernel re-syncs and also because the DTC commit (as I read it)
says the check itself was flawed / not useful.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

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

end of thread, other threads:[~2026-10-05 21:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-04  6:17 [PATCH 1/2] kbuild: Pass -Eno-node_name_not_empty to DTC if supported Marek Vasut
2026-10-04  6:17 ` [PATCH 2/2] kbuild: Do not pass -Wno-graph_child_address to DTC unless supported Marek Vasut
2026-10-05 20:59   ` Tom Rini
2026-10-05  6:44 ` [PATCH 1/2] kbuild: Pass -Eno-node_name_not_empty to DTC if supported Rasmus Villemoes

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.