From: Guenter Roeck <linux@roeck-us.net>
To: Tomer Maimon <tmaimon77@gmail.com>
Cc: mturquette@baylibre.com, sboyd@kernel.org,
p.zabel@pengutronix.de, robh+dt@kernel.org,
krzysztof.kozlowski+dt@linaro.org, tali.perry1@gmail.com,
joel@jms.id.au, venture@google.com, yuenn@google.com,
benjaminfair@google.com, openbmc@lists.ozlabs.org,
linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org,
devicetree@vger.kernel.org
Subject: Re: [PATCH v28 2/3] reset: npcm: register npcm8xx clock auxiliary bus device
Date: Mon, 17 Mar 2025 07:09:25 -0700 [thread overview]
Message-ID: <9a9de8bd-d864-4e29-89b2-91db8aea8ce5@roeck-us.net> (raw)
In-Reply-To: <CAP6Zq1ioebnqgJB1B8AqD9UtMZRy5CDT8+_dXF_aBZEjjj_B-A@mail.gmail.com>
Hi Tomer,
On 3/17/25 03:39, Tomer Maimon wrote:
> Hi Guenter,
>
> Yes, of course, it works in real hardware.
> The modification was made since the reset and clock share the same
> register memory region.
>
> To enable the clock change needs to be done in the device tree as
> follows (we are planning to send these change patches soon):
>
> diff -Naur a/arch/arm64/boot/dts/nuvoton/nuvoton-common-npcm8xx.dtsi
> b/arch/arm64/boot/dts/nuvoton/nuvoton-common-npcm8xx.dtsi
> --- a/arch/arm64/boot/dts/nuvoton/nuvoton-common-npcm8xx.dtsi
> 2025-02-26 16:20:39.000000000 +0200
> +++ b/arch/arm64/boot/dts/nuvoton/nuvoton-common-npcm8xx.dtsi
> 2025-03-17 12:29:17.876551537 +0200
> @@ -47,19 +47,16 @@
> interrupt-parent = <&gic>;
> ranges;
>
> - rstc: reset-controller@f0801000 {
> + clk: rstc: reset-controller@f0801000 {
> compatible = "nuvoton,npcm845-reset";
> - reg = <0x0 0xf0801000 0x0 0x78>;
> - #reset-cells = <2>;
> + reg = <0x0 0xf0801000 0x0 0xC4>;
> nuvoton,sysgcr = <&gcr>;
> - };
> -
> - clk: clock-controller@f0801000 {
> - compatible = "nuvoton,npcm845-clk";
> + #reset-cells = <2>;
> + clocks = <&refclk>;
> #clock-cells = <1>;
> - reg = <0x0 0xf0801000 0x0 0x1000>;
> };
>
> +
> apb {
> #address-cells = <1>;
> #size-cells = <1>;
> diff -Naur a/arch/arm64/boot/dts/nuvoton/nuvoton-npcm845-evb.dts
> b/arch/arm64/boot/dts/nuvoton/nuvoton-npcm845-evb.dts
> --- a/arch/arm64/boot/dts/nuvoton/nuvoton-npcm845-evb.dts
> 2025-02-26 16:20:39.000000000 +0200
> +++ b/arch/arm64/boot/dts/nuvoton/nuvoton-npcm845-evb.dts
> 2025-03-17 12:24:52.293171764 +0200
> @@ -19,6 +19,13 @@
> memory@0 {
> reg = <0x0 0x0 0x0 0x40000000>;
> };
> +
> + refclk: refclk-25mhz {
> + compatible = "fixed-clock";
> + clock-output-names = "ref";
> + clock-frequency = <25000000>;
> + #clock-cells = <0>;
> + };
> };
>
> &serial0 {
>
> Is it better to modify the reset driver with your suggestion or change
> the device tree?
>
My assumption was that the devicetree file is correct, and that it would match
the devicetree file in the actual devices. I since noticed that the file is
widely incomplete when comparing it with the various downstream versions,
so that was obviously wrong. Also, my change seemed odd, but then I did
not know how such situations are supposed to be handled.
Also, it looks like the devicetree file needs to be changed anyway unless something
else is wrong, because booting Linux still stalls later. Presumably that is because
the reference clock is missing in the upstream devicetree file (the serial port clock
frequency is reported as 0). Given this, fixing the devicetree files seems to be the
way to go.
Thanks,
Guenter
next prev parent reply other threads:[~2025-03-17 14:09 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-12 19:10 [PATCH v28 0/3] Introduce Nuvoton Arbel NPCM8XX BMC SoC Tomer Maimon
2024-09-12 19:10 ` [PATCH v28 1/3] dt-bindings: reset: npcm: add clock properties Tomer Maimon
2024-10-17 22:22 ` Stephen Boyd
2024-09-12 19:10 ` [PATCH v28 2/3] reset: npcm: register npcm8xx clock auxiliary bus device Tomer Maimon
2024-10-17 22:23 ` Stephen Boyd
2025-03-16 15:22 ` Guenter Roeck
2025-03-17 10:39 ` Tomer Maimon
2025-03-17 14:09 ` Guenter Roeck [this message]
2025-03-18 6:33 ` Tomer Maimon
2024-09-12 19:10 ` [PATCH v28 3/3] clk: npcm8xx: add clock controller Tomer Maimon
2024-10-17 22:23 ` Stephen Boyd
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=9a9de8bd-d864-4e29-89b2-91db8aea8ce5@roeck-us.net \
--to=linux@roeck-us.net \
--cc=benjaminfair@google.com \
--cc=devicetree@vger.kernel.org \
--cc=joel@jms.id.au \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=openbmc@lists.ozlabs.org \
--cc=p.zabel@pengutronix.de \
--cc=robh+dt@kernel.org \
--cc=sboyd@kernel.org \
--cc=tali.perry1@gmail.com \
--cc=tmaimon77@gmail.com \
--cc=venture@google.com \
--cc=yuenn@google.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®