From: Stephen Boyd <sboyd@kernel.org>
To: Chen Wang <unicorn_wang@outlook.com>,
Conor Dooley <conor+dt@kernel.org>,
Inochi Amaoto <inochiama@gmail.com>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Michael Turquette <mturquette@baylibre.com>,
Richard Cochran <richardcochran@gmail.com>,
Rob Herring <robh@kernel.org>
Cc: linux-clk@vger.kernel.org, devicetree@vger.kernel.org,
sophgo@lists.linux.dev, linux-kernel@vger.kernel.org,
netdev@vger.kernel.org, Yixun Lan <dlan@gentoo.org>,
Longbin Li <looong.bin@gmail.com>,
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Subject: Re: [PATCH v3 1/2] dt-bindings: clock: sophgo: add clock controller for SG2044
Date: Wed, 12 Mar 2025 16:43:51 -0700 [thread overview]
Message-ID: <b816b3d1f11b4cc2ac3fa563fe5f4784.sboyd@kernel.org> (raw)
In-Reply-To: <x43v3wn5rp2mkhmmmyjvdo7aov4l7hnus34wjw7snd2zbtzrbh@r5wrvn3kxxwv>
Quoting Inochi Amaoto (2025-03-12 16:29:43)
> On Wed, Mar 12, 2025 at 04:14:37PM -0700, Stephen Boyd wrote:
> > Quoting Inochi Amaoto (2025-03-11 16:31:29)
> > >
> > > > or if that syscon node should just have the #clock-cells property as
> > > > part of the node instead.
> > >
> > > This is not match the hardware I think. The pll area is on the middle
> > > of the syscon and is hard to be separated as a subdevice of the syscon
> > > or just add "#clock-cells" to the syscon device. It is better to handle
> > > them in one device/driver. So let the clock device reference it.
> >
> > This happens all the time. We don't need a syscon for that unless the
> > registers for the pll are both inside the syscon and in the register
> > space 0x50002000. Is that the case?
>
> Yes, the clock has two areas, one in the clk controller and one in
> the syscon, the vendor said this design is a heritage from other SoC.
My question is more if the PLL clk_ops need to access both the syscon
register range and the clk controller register range. What part of the
PLL clk_ops needs to access the clk controller at 0x50002000?
>
> > This looks like you want there to be one node for clks on the system
> > because logically that is clean, when the reality is that there is a
> > PLL block exposed in the syscon (someone forgot to put it in the clk
> > controller?) and a non-PLL block for the other clks.
>
> That is true, I prefer to keep clean and make less mistakes. Although
> the PLL is exposed in the syscon, the pll need to be tight with other
> clocks in the space 0x50002000 (especially between the PLL and mux).
> In this view, it is more like a mistake made by the hardware design.
> And I prefer not to add a subnode for the syscon.
Ok. You wouldn't add a subnode for the syscon. You would just have
#clock-cells in that syscon node and register an auxiliary device to
provide the PLL(s) from there. Then in drivers/clk we would have an
auxiliary driver that uses a regmap or gets an iomem pointer from the
parent device somehow so that we can logically put the PLL code in
drivers/clk while having one node in DT for the "miscellaneous register
area" where the hardware engineer had to expose the PLL control to
software.
next prev parent reply other threads:[~2025-03-12 23:43 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-26 23:23 [PATCH v3 0/2] clk: sophgo: add SG2044 clock controller support Inochi Amaoto
2025-02-26 23:23 ` [PATCH v3 1/2] dt-bindings: clock: sophgo: add clock controller for SG2044 Inochi Amaoto
2025-03-11 19:26 ` Stephen Boyd
2025-03-11 23:31 ` Inochi Amaoto
2025-03-12 23:14 ` Stephen Boyd
2025-03-12 23:29 ` Inochi Amaoto
2025-03-12 23:43 ` Stephen Boyd [this message]
2025-03-13 1:08 ` Inochi Amaoto
2025-03-13 20:22 ` Stephen Boyd
2025-03-13 22:46 ` Inochi Amaoto
2025-03-27 21:21 ` Stephen Boyd
2025-03-27 22:49 ` Inochi Amaoto
2025-02-26 23:23 ` [PATCH v3 2/2] clk: sophgo: Add clock controller support for SG2044 SoC Inochi Amaoto
2025-03-11 19:23 ` Stephen Boyd
2025-03-12 1:01 ` Inochi Amaoto
2025-03-13 19:38 ` Stephen Boyd
2025-03-13 22:39 ` Inochi Amaoto
2025-03-07 6:25 ` [PATCH v3 0/2] clk: sophgo: add SG2044 clock controller support Inochi Amaoto
2025-03-10 4:08 ` Inochi Amaoto
2025-03-10 4:24 ` Inochi Amaoto
2025-03-10 4:23 ` Inochi Amaoto
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=b816b3d1f11b4cc2ac3fa563fe5f4784.sboyd@kernel.org \
--to=sboyd@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dlan@gentoo.org \
--cc=inochiama@gmail.com \
--cc=krzk+dt@kernel.org \
--cc=krzysztof.kozlowski@linaro.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=looong.bin@gmail.com \
--cc=mturquette@baylibre.com \
--cc=netdev@vger.kernel.org \
--cc=richardcochran@gmail.com \
--cc=robh@kernel.org \
--cc=sophgo@lists.linux.dev \
--cc=unicorn_wang@outlook.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;
as well as URLs for NNTP newsgroup(s).