From: Conor Dooley <conor@kernel.org>
To: Changhuang Liang <changhuang.liang@starfivetech.com>
Cc: Michael Turquette <mturquette@baylibre.com>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Stephen Boyd <sboyd@kernel.org>,
Brian Masney <bmasney@redhat.com>, Paul Walmsley <pjw@kernel.org>,
Palmer Dabbelt <palmer@dabbelt.com>,
Albert Ou <aou@eecs.berkeley.edu>,
Alexandre Ghiti <alex@ghiti.fr>,
Philipp Zabel <p.zabel@pengutronix.de>,
Emil Renner Berthing <kernel@esmil.dk>,
Chen Wang <unicorn_wang@outlook.com>,
Inochi Amaoto <inochiama@gmail.com>,
Alexey Charkov <alchark@gmail.com>,
Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
Keguang Zhang <keguang.zhang@gmail.com>,
"linux-clk@vger.kernel.org" <linux-clk@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"linux-riscv@lists.infradead.org"
<linux-riscv@lists.infradead.org>
Subject: Re: [PATCH v4 7/8] soc: starfive: Add socinfo driver for JHB100 SoC
Date: Tue, 18 Aug 2026 17:55:39 +0100 [thread overview]
Message-ID: <20260818-recall-onion-3279fe070ccd@spud> (raw)
In-Reply-To: <ZQ4PR01MB1202BE1034795F1FBCF18076F2A72@ZQ4PR01MB1202.CHNPR01.prod.partner.outlook.cn>
[-- Attachment #1: Type: text/plain, Size: 5656 bytes --]
On Mon, Aug 17, 2026 at 01:27:08AM +0000, Changhuang Liang wrote:
> Hi, Conor
>
> Thanks for the review.
>
> > On Fri, Aug 14, 2026 at 01:13:38AM +0000, Changhuang Liang wrote:
> > > Hi,Conor
> > >
> > > Thanks for the review.
> > >
> > > > On Thu, Aug 13, 2026 at 08:10:12AM +0000, Changhuang Liang wrote:
> > > > > Hi ,Conor
> > > > >
> > > > > Thanks for the review.
> > > > >
> > > > > > On Wed, Aug 12, 2026 at 10:37:16AM +0000, Changhuang Liang
> > wrote:
> > > > > > > Hi, Conor
> > > > > > >
> > > > > > > Thanks for the review.
> > > > > > >
> > > > > > > > On Tue, Aug 11, 2026 at 05:36:19AM +0000, Changhuang Liang
> > wrote:
> > > > > > > >
> > > > > > > > > > On Sat, Aug 08, 2026 at 06:50:53PM -0700, Changhuang
> > > > > > > > > > Liang
> > > > wrote:
> > > > > > > >
> > > > > > > > > > > +static int __init starfive_socinfo_init(void) {
> > > > > > > > > > > + struct soc_device_attribute *attrs;
> > > > > > > > > > > + struct soc_device *soc_dev;
> > > > > > > > > > > + const char *machine = NULL;
> > > > > > > > > > > + struct device_node *np;
> > > > > > > > > > > + struct regmap *regmap;
> > > > > > > > > > > + char rev_char;
> > > > > > > > > > > + u32 rev_id;
> > > > > > > > > > > + int ret;
> > > > > > > > > > > +
> > > > > > > > > > > + np = of_find_compatible_node(NULL, NULL,
> > > > > > > > > > > +"starfive,jhb100-sys0-syscon");
> > > > > > > > > >
> > > > > > > > > > Remind me again why this is not just probed as an mfd
> > > > > > > > > > cell from the syscon driver?
> > > > > > > > > >
> > > > > > > > > > (Hint: please put this info in the commit message).
> > > > > > > > >
> > > > > > > > > The discussion result with Krzysztof at that time is recorded here:
> > > > > > > > > https://lore.kernel.org/all/20260405-strong-watchful-marmo
> > > > > > > > > t-fd
> > > > > > > > > fad6
> > > > > > > > > @quo
> > > > > > > > > ll/
> > > > > > > > >
> > > > > > > > > One register should not be treated as a separate device node.
> > > > > > > >
> > > > > > > > That's a different question. In the case of an mfd cell
> > > > > > > > probed from the syscon driver there would be no devicetree
> > > > > > > > modifications required compared to what you have now. e.g.
> > > > > > > > sg2044-topsys.c
> > > > > > >
> > > > > > > This seems feasible, and I can introduce this modification in
> > > > > > > the next
> > > > > > version.
> > > > > >
> > > > > >
> > > > > > In fact, you don't even need the mfd cell, because your driver
> > > > > > is going to be in drivers/soc/starfive anyway? You can just bind
> > > > > > directly to the
> > > > > > sys0 syscon I think.
> > > > >
> > > > > I suddenly realized that I missed one issue:
> > > > > starfive,jhb100-sys0-syscon is already bound to the PLL driver by
> > > > > default, I
> > > > can't use it to bind another device anymore.
> > > > >
> > > > > which is why I used
> > > > >
> > > > > np = of_find_compatible_node(NULL, NULL,
> > > > > "starfive,jhb100-sys0-syscon");
> > > > >
> > > > > in jhb100-socinfo.c.
> > > > >
> > > > > So it seems the MFD cell approach isn't really feasible either?
> > > >
> > > > You could, in that case, probe the clock driver using the mfd_cell
> > > > like sg2044-topsys. What else other than the pll controls and the
> > > > soc info register is in this register region?
> > >
> > > We don't have any other drivers right now in this register region.
> >
> > I'm not asking about what's got a driver right now though, I am wondering
> > what else the registers in this region are for.
>
> Here are some registers related to debug functionality.
So probably nothing else that linux will ever need?
> > > So does that mean I can revise it to the format below:
> > >
> > > static const struct mfd_cell jhb100_sys0_subdev[] = {
> > > {
> > > .name = "jhb100-sys0-pll",
> > > },
> >
> > > {
> > > .name = "jhb100-socinfo",
> >
> > Why would this be needed? The driver with the mfd_cell would be the same
> > one that provides the soc info, no?
>
> My understanding is that one driver can only bind to one device, so the PLL driver
> and the socinfo driver need these two devices respectively, and thus cannot share
> one?
Correct, but I am talking about the socinfo driver being the one that
calls devm_mfd_add_devices() to create a device for the pll so that in
the end there are a total of two drivers, rather than create something
identical to sg2044-topsys.c that does nothing other than initialise two
mfd cells.
May as well consolidate the mfd_cell definition and call to
devm_mfd_add_devices() in one file, since it would be in the same
directory as the socinfo driver anyway.
>
> >
> > > },
> > > };
> > >
> > > static const struct mfd_cell jhb100_per0_subdev[] = {
> > > {
> > > .name = "jhb100-per0-pll",
> >
> > Why do these other ones need to be modified?
>
> I was thinking, since sys0-pll has been adjusted, would it be better to also adjust per0-pll and per1-pll together in a unified way?
I wouldn't complicate them with things that they don't need, so it
depends on if these other syscon regions contain more than just PLLs
and if there'll ever be drivers for the other stuff in those regions.
>
> >
> > > },
> > > };
> > >
> > > static const struct mfd_cell jhb100_per1_subdev[] = {
> > > {
> > > .name = "jhb100-per1-pll",
> > > },
> > > };
> > >
> > > static const struct mfd_cell jhb100_ pcierp _subdev[] = {
> > > {
> > > .name = "jhb100-pcierp-reset",
> > > },
> > > };
>
> Best Regards,
> Changhuang
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2026-08-18 16:55 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-09 1:50 [PATCH v4 0/8] Add StarFive JHB100 syscon modules Changhuang Liang
2026-08-09 1:50 ` [PATCH v4 1/8] dt-bindings: soc: starfive: " Changhuang Liang
2026-08-09 1:50 ` [PATCH v4 2/8] clk: starfive: Add system-0 domain PLL clock driver Changhuang Liang
2026-08-10 16:22 ` Conor Dooley
2026-08-11 11:15 ` Changhuang Liang
2026-08-10 20:23 ` Brian Masney
2026-08-11 11:54 ` Changhuang Liang
2026-08-09 1:50 ` [PATCH v4 3/8] clk: starfive: Add peripheral-0 " Changhuang Liang
2026-08-09 1:50 ` [PATCH v4 4/8] clk: starfive: Add Peripheral-1 " Changhuang Liang
2026-08-09 1:50 ` [PATCH v4 5/8] reset: starfive: Introduce active_low Changhuang Liang
2026-08-10 16:22 ` Conor Dooley
2026-08-09 1:50 ` [PATCH v4 6/8] reset: starfive: Add syscon reset driver support Changhuang Liang
2026-08-09 1:50 ` [PATCH v4 7/8] soc: starfive: Add socinfo driver for JHB100 SoC Changhuang Liang
2026-08-10 16:05 ` Conor Dooley
[not found] ` <ZQ4PR01MB120276A1DA91FAC19C852F14F2DD2@ZQ4PR01MB1202.CHNPR01.prod.partner.outlook.cn>
2026-08-11 17:00 ` Conor Dooley
2026-08-12 10:37 ` Changhuang Liang
2026-08-12 15:59 ` Conor Dooley
2026-08-13 8:10 ` Changhuang Liang
2026-08-13 16:46 ` Conor Dooley
2026-08-14 1:13 ` Changhuang Liang
2026-08-14 13:38 ` Conor Dooley
2026-08-17 1:27 ` Changhuang Liang
2026-08-18 16:55 ` Conor Dooley [this message]
2026-08-19 9:29 ` Changhuang Liang
2026-08-09 1:50 ` [PATCH v4 8/8] riscv: dts: starfive: jhb100: Add syscon nodes Changhuang Liang
2026-08-10 16:21 ` Conor Dooley
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=20260818-recall-onion-3279fe070ccd@spud \
--to=conor@kernel.org \
--cc=alchark@gmail.com \
--cc=alex@ghiti.fr \
--cc=aou@eecs.berkeley.edu \
--cc=bmasney@redhat.com \
--cc=changhuang.liang@starfivetech.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=inochiama@gmail.com \
--cc=keguang.zhang@gmail.com \
--cc=kernel@esmil.dk \
--cc=krzk+dt@kernel.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=mturquette@baylibre.com \
--cc=p.zabel@pengutronix.de \
--cc=palmer@dabbelt.com \
--cc=pjw@kernel.org \
--cc=robh@kernel.org \
--cc=sboyd@kernel.org \
--cc=tsbogend@alpha.franken.de \
--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