From: Conor Dooley <conor.dooley@microchip.com>
To: Changhuang Liang <changhuang.liang@starfivetech.com>
Cc: Conor Dooley <conor@kernel.org>, Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Emil Renner Berthing <kernel@esmil.dk>,
Paul Walmsley <paul.walmsley@sifive.com>,
Palmer Dabbelt <palmer@dabbelt.com>,
Albert Ou <aou@eecs.berkeley.edu>,
Walker Chen <walker.chen@starfivetech.com>,
Hal Feng <hal.feng@starfivetech.com>,
<devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linux-riscv@lists.infradead.org>, <vkoul@kernel.org>,
<linux-phy@lists.infradead.org>
Subject: Re: [RESEND v2 1/6] dt-bindings: power: Add JH7110 AON PMU support
Date: Tue, 25 Apr 2023 07:59:44 +0100 [thread overview]
Message-ID: <20230425-unquote-eligible-09f743d81981@wendy> (raw)
In-Reply-To: <d685a1d4-c07d-7dfa-f1fb-b35ceb2aa0eb@starfivetech.com>
[-- Attachment #1.1: Type: text/plain, Size: 5547 bytes --]
On Tue, Apr 25, 2023 at 11:41:38AM +0800, Changhuang Liang wrote:
> On 2023/4/25 0:52, Conor Dooley wrote:
> > On Thu, Apr 20, 2023 at 03:00:10PM +0800, Changhuang Liang wrote:
> >> On 2023/4/20 2:29, Conor Dooley wrote:
> >>> On Tue, Apr 18, 2023 at 08:56:41PM -0700, Changhuang Liang wrote:
> >>>> Add AON PMU for StarFive JH7110 SoC, it can be used to turn on/off DPHY
> >>>> rx/tx power switch, and it don't need the properties of reg and
> >>>> interrupts.
> >>>
> >>> Putting this here since the DT guys are more likely to see it this way..
> >>> Given how the implementation of the code driving this new
> >>> power-controller and the code driving the existing one are rather
> >>> different (you've basically re-written the entire driver in this series),
> >>> should the dphy driver implement its own power-controller?
> >>>
> >>> I know originally Changuang had tried something along those lines:
> >>> https://lore.kernel.org/linux-riscv/5dc4ddc2-9d15-ebb2-38bc-8a544ca67e0d@starfivetech.com/
> >>>
> >>> I see that that was shut down pretty much, partly due to the
> >>> non-standard property, hence this series adding the dphy power domain to
> >>> the existing driver.
> >>>
> >>> If it was done by looking up the pmu with a
> >>> of_find_compatible_node(NULL, "power-controller", "starfive,jh7110-aon-pmu")
> >>> type thing, would that make sense? Although, maybe that is not a
> >>> question for you, and this series may actually have been better entirely
> >>> bundled with the dphy series so the whole thing can be reviewed as a
> >>> unit. I've added
> >>>
> >>> IOW, don't change this patch, or the dts patch, but move all of the
> >>> code back into the phy driver..
> >>>
> >>
> >> Maybe this way can not do that? power domain is binding before driver probe,
> >> if I use "of_find_compatible_node" it phy(DPHY rx) probe. Maybe I can only operate
> >> this power switch in my phy(DPHY rx) driver, so the all patch of this series isn't
> >> make sense.
> >
> > I'm a wee bit lost here, as I unfortunately know little about how Linux
> > handles this power-domain stuff. If the DPHY tries to probe and some
> > pre-requisite does not yet exist, you can return -EPROBE_DEFER right?
> >
> > But I don't think that's what you are asking, as using
> > of_find_compatible_node() doesn't depend on there being a driver AFAIU.
> >
> >> In my opinion, We will also submit DPHY TX module later which use this series.
> >> Maybe this series should independent?
> >
> > Is the DPHY tx module a different driver to the rx one?> If yes, does it have a different bit you must set in the syscon?
> >
>
> Yes, DPHY tx module is a different driver to the DPHY rx. And I have do a
> different bit in PATCH 1:
>
> #define JH7110_PD_DPHY_TX 0
> #define JH7110_PD_DPHY_RX 1
>
> also in PATCH 5:
>
> static const struct jh71xx_domain_info jh7110_aon_power_domains[] = {
> [JH7110_PD_DPHY_TX] = {
> .name = "DPHY-TX",
> .bit = 30,
> },
> [JH7110_PD_DPHY_RX] = {
> .name = "DPHY-RX",
> .bit = 31,
> },
> };
>
> > +CC Walker, do you have a register map for the jh7110? My TRM only says
> > what the registers are, but not the bits in them. Would make life easier
> > if I had that info.
> >
> > I'm fine with taking this code, I just want to make sure that the soc
> > driver doing this is the right thing to do.
> > I was kinda hoping that combining with the DPHY-rx series might allow
> > the PHY folk to spot if you are doing something here with the power
> > domains that doesn't make sense.
> >
>
> I asked about our soc colleagues. This syscon register,
> offset 0x00:
> bit[31] ---> dphy rx power switch
> bit[30] ---> dphy tx power switch
> other bits ---> Reserved
Okay. Unless someone explicitly disagrees, I'm fine with doing this
stand-alone from the DPHY drivers.
> >>> Sorry for not asking this sooner Changhuang,
> >>> Conor.
> >>>
> >>> (hopefully this didn't get sent twice, mutt complained of a bad email
> >>> addr during sending the first time)
> >>>
> >>
> >> I'm sorry for that, I will notice later.
> >
> > No, this was my mail client doing things that I was unsure of. You
> > didn't do anything wrong.
> >
> [...]
> >>>> - Walker Chen <walker.chen@starfivetech.com>
> >>>> + - Changhuang Liang <changhuang.liang@starfivetech.com>
> >>>>
> >>>> description: |
> >>>> StarFive JH7110 SoC includes support for multiple power domains which can be
> >>>> @@ -17,6 +18,7 @@ properties:
> >>>> compatible:
> >>>> enum:
> >>>> - starfive,jh7110-pmu
> >>>> + - starfive,jh7110-aon-pmu
> >
> > I was speaking to Rob about this over the weekend, he asked:
> > 'Why isn't "starfive,jh7110-aon-syscon" just the power-domain provider
> > itself?'
>
> Maybe not, this syscon only offset "0x00" configure power switch.
> other offset configure other functions, maybe not power, so this
> "starfive,jh7110-aon-syscon" not the power-domain itself.
>
> > Do we actually need to add a new binding for this at all?
> >
> > Cheers,
> > Conor.
> >
>
> Maybe this patch do that.
> https://lore.kernel.org/all/20230414024157.53203-6-xingyu.wu@starfivetech.com/
This makes it a child-node right? I think Rob already said no to that in
and earlier revision of this series. What he meant the other day was
making the syscon itself a power domain controller, since the child node
has no meaningful properties (reg, interrupts etc).
Cheers,
Conor.
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
[-- Attachment #2: Type: text/plain, Size: 112 bytes --]
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
next prev parent reply other threads:[~2023-04-25 7:00 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20230419035646.43702-1-changhuang.liang@starfivetech.com>
[not found] ` <20230419035646.43702-2-changhuang.liang@starfivetech.com>
2023-04-19 18:29 ` [RESEND v2 1/6] dt-bindings: power: Add JH7110 AON PMU support Conor Dooley
2023-04-20 7:00 ` Changhuang Liang
2023-04-24 16:52 ` Conor Dooley
2023-04-25 3:41 ` Changhuang Liang
2023-04-25 6:59 ` Conor Dooley [this message]
2023-04-25 7:57 ` Changhuang Liang
2023-04-25 8:19 ` Krzysztof Kozlowski
2023-04-25 9:18 ` Changhuang Liang
2023-04-25 9:35 ` Conor Dooley
2023-04-25 12:26 ` Changhuang Liang
2023-04-25 16:56 ` Conor Dooley
2023-04-26 2:11 ` Changhuang Liang
2023-05-04 1:34 ` Changhuang Liang
2023-05-04 6:13 ` Krzysztof Kozlowski
2023-05-04 6:53 ` Changhuang Liang
2023-05-04 7:04 ` Krzysztof Kozlowski
2023-05-04 7:20 ` Changhuang Liang
2023-05-04 7:26 ` Krzysztof Kozlowski
2023-05-04 8:43 ` Changhuang Liang
2023-05-04 9:36 ` Krzysztof Kozlowski
2023-05-04 9:48 ` Changhuang Liang
2023-05-04 9:57 ` Conor Dooley
2023-05-05 1:29 ` Changhuang Liang
2023-05-05 12:38 ` Conor Dooley
2023-05-06 1:45 ` Changhuang Liang
2023-05-06 6:31 ` Krzysztof Kozlowski
2023-05-06 7:00 ` Changhuang Liang
2023-05-06 10:17 ` Conor Dooley
2023-05-06 12:26 ` Changhuang Liang
2023-05-06 12:29 ` Conor Dooley
2023-05-07 4:00 ` Changhuang Liang
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=20230425-unquote-eligible-09f743d81981@wendy \
--to=conor.dooley@microchip.com \
--cc=aou@eecs.berkeley.edu \
--cc=changhuang.liang@starfivetech.com \
--cc=conor@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=hal.feng@starfivetech.com \
--cc=kernel@esmil.dk \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-phy@lists.infradead.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=robh+dt@kernel.org \
--cc=vkoul@kernel.org \
--cc=walker.chen@starfivetech.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