All of lore.kernel.org
 help / color / mirror / Atom feed
From: E Shattow <e@freeshell.de>
To: Heinrich Schuchardt <xypron.glpk@gmx.de>,
	Hal Feng <hal.feng@starfivetech.com>,
	Minda Chen <minda.chen@starfivetech.com>
Cc: U-Boot Mailing List <u-boot@lists.denx.de>, E Shattow <e@freeshell.de>
Subject: Re: Fwd: [RFC][PATCH] kbuild: Produce diff between base DT and U-Boot augmented DT if DEVICE_TREE_DEBUG=1
Date: Fri, 7 Nov 2025 02:21:35 -0800	[thread overview]
Message-ID: <6bacfc20-965d-4750-afd1-8421f4db0d8a@freeshell.de> (raw)
In-Reply-To: <dd079318-795e-46a9-8123-2e8b7c5758fd@gmx.de>

On 11/7/25 01:00, Heinrich Schuchardt wrote:
> 
> Hello Hal, hello Minda,
> 
> Marek created the patch below, to find differences between Linux device-
> tree and what U-Boot uses.
> 
> For all JH7110 boards I find these differences which are due to arch/
> riscv/dts/starfive-visionfive2-u-boot.dtsi. Could you, please, check if
> these are still intended:
> 
> @@ -533,7 +617,7 @@
>              #clock-cells = <0x1>;
>              #reset-cells = <0x1>;
>              assigned-clock-parents = <0x28 0x0 0x28 0x2 0x28 0x2 0x3
> 0x59>;
> -            assigned-clock-rates = <0x0 0x0 0x0 0x0 0x1dcd6500
> 0x59682f00>;
> +            assigned-clock-rates = <0x0>;
>              assigned-clocks = <0x3 0x0 0x3 0x5 0x3 0x4 0x3 0x5a 0x3 0x1
> 0x28 0x0>;
>              bootph-pre-ram;
>              clock-names = "osc", "gmac1_rmii_refin",
> "gmac1_rgmii_rxin", "i2stx_bclk_ext", "i2stx_lrck_ext",
> "i2srx_bclk_ext", "i2srx_lrck_ext", "tdm_ext", "mclk_ext", "pll0_out",
> "pll1_out", "pll2_out";
> @@ -996,6 +1080,7 @@
> 
>          memory-controller@15700000 {
>              bootph-pre-ram;
> +            clock-frequency = <0x855>; // 2133 MHz
>              clock-names = "pll";
>              clocks = <0x3 0x1>;
>              compatible = "starfive,jh7110-dmc";
> 
> Best regards
> 
> Heinrich
> 
> 
> -------- Forwarded Message --------
> Subject: [RFC][PATCH] kbuild: Produce diff between base DT and U-Boot
> augmented DT if DEVICE_TREE_DEBUG=1
> Date: Thu,  6 Nov 2025 22:08:18 +0100
> From: Marek Vasut <marek.vasut+renesas@mailbox.org>
> To: u-boot@lists.denx.de
> CC: Marek Vasut <marek.vasut+renesas@mailbox.org>, Adriano Cordova
> <adrianox@gmail.com>, Heinrich Schuchardt <xypron.glpk@gmx.de>, Ilias
> Apalodimas <ilias.apalodimas@linaro.org>, Peter Robinson
> <pbrobinson@gmail.com>, Sam Edwards <cfsworks@gmail.com>, Tom Rini
> <trini@konsulko.com>
> 
> In case DEVICE_TREE_DEBUG is set, produce a diff between the base DT and
> DT with U-Boot extras, to show how much does the U-Boot DT differ from
> the base DT. This is particularly useful together with OF_UPSTREAM, to
> minimize the diff between upstream DTs and U-Boot DTs.
> 
> Example usage:
> $ make r8a779g3_sparrowhawk_defconfig && make DEVICE_TREE_DEBUG=1
> $ cat ./dts/upstream/src/arm64/renesas/r8a779g3-sparrow-hawk.dtb.diff
> 
> This still has a downside. Even 'dtc -I dts -O dts ...' applied on
> base DT and U-Boot augmented DT can produce different phandle IDs
> for the same node in those two DTs, which results in a lot of noise
> in the resulting diff. The only way I can think of is to patch DTC
> to emit full paths in those phandles instead, something like a
> phandle = <&{/full/path/to/remote/end} ...>;
> 
> Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
> ---
> Cc: Adriano Cordova <adrianox@gmail.com>
> Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
> Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>
> Cc: Peter Robinson <pbrobinson@gmail.com>
> Cc: Sam Edwards <cfsworks@gmail.com>
> Cc: Tom Rini <trini@konsulko.com>
> Cc: u-boot@lists.denx.de
> ---
>  scripts/Makefile.lib | 24 +++++++++++++++++++++++-
>  1 file changed, 23 insertions(+), 1 deletion(-)
> 
> diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
> index 5db2fbc418a..2d8bf3c04f4 100644
> --- a/scripts/Makefile.lib
> +++ b/scripts/Makefile.lib
> @@ -386,10 +386,31 @@ ifeq ($(CONFIG_OF_LIBFDT_OVERLAY),y)
>  DTC_FLAGS += -@
>  endif
>  +# In case DEVICE_TREE_DEBUG is set, produce a diff between the base DT
> and
> +# DT with U-Boot extras, to show how much does the U-Boot DT differ from
> +# the base DT. This is particularly useful together with OF_UPSTREAM, to
> +# minimize the diff between upstream DTs and U-Boot DTs.
> +ifdef DEVICE_TREE_DEBUG
> +cmd_dtc_diff = \
> +    $(HOSTCC) -E $(dtc_cpp_flags) -I$(obj) -x assembler-with-cpp -o
> $(dtn-tmp) $< ; \
> +    $(DTC) -s -O dts -o $@.clean.dts -b 0 \
> +        -i $(dir $<) $(DTC_FLAGS) $(dtn-tmp) || \
> +        (echo "Check $(shell pwd)/$< for errors" && false); \
> +    $(DTC) -s -O dts -o $@.full.dts -b 0 \
> +        -i $(dir $<) -i $(u_boot_dtsi_loc) $(DTC_FLAGS) $(dtc-tmp) || \
> +        (echo "Check $(shell pwd)/$(pre-tmp) for errors" && false); \
> +    (diff -Naru $@.clean.dts $@.full.dts > $@.diff || true)
> +
> +dtn-tmp = $(subst $(comma),_,$(dot-target).dtn.tmp)
> +else
> +cmd_dtc_diff =
> +endif
> +
>  quiet_cmd_dtc = DTC     $@
>  # Modified for U-Boot
>  # Bring in any U-Boot-specific include at the end of the file
>  # And finally any custom .dtsi fragments specified with
> CONFIG_DEVICE_TREE_INCLUDES
> +
>  cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \
>      (cat $< > $(pre-tmp)); \
>      $(foreach f,$(subst $(quote),,$(dtsi_include_list)
> $(CONFIG_DEVICE_TREE_INCLUDES)), \
> @@ -400,7 +421,8 @@ cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \
>          -d $(depfile).dtc.tmp $(dtc-tmp) || \
>          (echo "Check $(shell pwd)/$(pre-tmp) for errors" && false) \
>          ; \
> -    sed "s:$(pre-tmp):$(<):" $(depfile).pre.tmp $(depfile).dtc.tmp >
> $(depfile)
> +    sed "s:$(pre-tmp):$(<):" $(depfile).pre.tmp $(depfile).dtc.tmp >
> $(depfile) ; \
> +    $(cmd_dtc_diff)
>   dtsi_include_list_deps := $(addprefix $(u_boot_dtsi_loc),$(subst
> $(quote),,$(dtsi_include_list)))
>  -- 2.51.0
> 

Neither property is valid and should be removed, but the drivers need to
be fixed/implemented. For both matters please refer to discussion at:

https://lore.kernel.org/u-boot/ZQ2PR01MB13075C0C6A214EC48174F248E6F32@ZQ2PR01MB1307.CHNPR01.prod.partner.outlook.cn/

-E

  reply	other threads:[~2025-11-07 10:21 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-06 21:08 [RFC][PATCH] kbuild: Produce diff between base DT and U-Boot augmented DT if DEVICE_TREE_DEBUG=1 Marek Vasut
2025-11-07  9:00 ` Fwd: " Heinrich Schuchardt
2025-11-07 10:21   ` E Shattow [this message]
2025-11-07  9:12 ` Heinrich Schuchardt
2025-11-07 14:06   ` Marek Vasut
2025-11-07 15:56     ` Tom Rini
2025-11-07 16:44       ` Marek Vasut
2025-11-09 23:44         ` Marek Vasut
2025-11-10 16:47           ` Tom Rini
2025-11-11  3:21             ` Marek Vasut
2025-11-11 12:38         ` Simon Glass
2025-11-11 13:50           ` Marek Vasut
2025-11-14 13:46             ` Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6bacfc20-965d-4750-afd1-8421f4db0d8a@freeshell.de \
    --to=e@freeshell.de \
    --cc=hal.feng@starfivetech.com \
    --cc=minda.chen@starfivetech.com \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.