From: Jie Luo <quic_luoj@quicinc.com>
To: "Russell King (Oracle)" <linux@armlinux.org.uk>
Cc: Andrew Lunn <andrew@lunn.ch>,
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
<davem@davemloft.net>, <edumazet@google.com>, <kuba@kernel.org>,
<pabeni@redhat.com>, <robh+dt@kernel.org>,
<krzysztof.kozlowski+dt@linaro.org>, <conor+dt@kernel.org>,
<hkallweit1@gmail.com>, <corbet@lwn.net>,
<p.zabel@pengutronix.de>, <f.fainelli@gmail.com>,
<netdev@vger.kernel.org>, <devicetree@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <linux-doc@vger.kernel.org>
Subject: Re: [PATCH v8 14/14] dt-bindings: net: ar803x: add qca8084 PHY properties
Date: Sat, 16 Dec 2023 15:57:57 +0800 [thread overview]
Message-ID: <3a40570b-40bf-4609-b1f4-a0a6974accea@quicinc.com> (raw)
In-Reply-To: <ZXxXzm8hP68KrXYs@shell.armlinux.org.uk>
On 12/15/2023 9:42 PM, Russell King (Oracle) wrote:
> On Fri, Dec 15, 2023 at 08:16:53PM +0800, Jie Luo wrote:
>> On 12/15/2023 7:25 PM, Andrew Lunn wrote:
>>>> The "maxItems: 1" of the property resets is defined in ethernet-phy.yaml
>>>> that is referenced by qca,ar803x.yaml, but i have 11 reset instances
>>>> used for qca8084 PHY
>>>
>>> 11!?!?? Really? Why?
>>>
>>> I assume the order and timer matters, otherwise why would you need
>>> 11? So the PHY driver needs to handle this, not phylib framework. So
>>> you will be adding vendor properties to describe all 11 of them. So
>>> ethernet-phy.yaml does not matter.
>>>
>>> Andrew
>>
>> Since these resets need to be configured in the special sequence, and
>> these clocks need to be configured with different clock rate.
>>
>> But the clock instance get, the property name is fixed to "clock-names"
>> according to the function of_parse_clkspec, and the reset property name
>> is also fixed to "reset-names" from function __of_reset_control_get.
>
> I think you need to give more details about this.
>
> Where are these 11 resets located? What is the sequence? Why does the
> PHY driver need to deal with each individual reset?
All these resets and clocks are located in qca8084 chip that includes
the GCC module registered as the clock provider, all these clocks and
resets are from qca8084 clock provider driver, the clock and reset name
prefix with PCS or EPHY is for the individual MDIO device, others are
the qca8084 level, but these clocks and resets need to be initialized
completely, then the PHY probe function can be initialized correctly
with the PHY capabilities acquired after the qca8084 chip level GPIO
reset.
The sequence code is realized in the function qca8084_clock_config of
the patch <net: phy: at803x: add qca808x initial config sequence>, this
function is doing as below.
1. set the Ethernet system clock tree as 25M clock rate.
2. reset and enable PCS system clocks.
3. reset and enable the PHY system clocks.
4. loading the efuse, which is not related the clock and reset.
>
> IMHO, a PHY driver should _not_ be dealing with the resets outside of
> the PHY device itself, and I find it hard to imagine that qca8084
> would have 11 external resets.
Indeed, these resets are not for a PHY device, some are the chip level
resets, and each PHY has the individual resets.
>
> If these are 11 internal resets (to qca8084) then why are you using the
> reset subsystem, and why do you need to describe them in DT? Surely if
> they are internal to the PHY, that can be encapsulated within the PHY
> driver?
These resets and clocks are realized by the qca8k clock controller
driver, and i use the clock consumer APIs to initialize these clocks and
resets,
when qca8084 works on the PHY mode, there are only PHY driver
and PCS driver needed to be enabled to make PHY working, and these
clocks and resets need to be initialized before the PHY probe function
finished correctly, where the phy capabilities is read during the probe
function.
>
> This is an example of why it is useful to have an _example_ of the use
> of this binding, because it would answer some of the above questions.
>
Yes, Russell, i will add an example in the DT doc in the next patch set.
The following is the device node used for the current qca8084 PHY
code design.
mdio: mdio@90000 {
ethernet-phy@0 {
compatible = "ethernet-phy-id004d.d180";
reg = <1>;
qcom,phy-addr-fixup = <1 2 3 4 5 6 7>;
qcom,phy-work-mode = <2>;
clocks = <&qca8k_nsscc NSS_CC_APB_BRIDGE_CLK>,
<&qca8k_nsscc NSS_CC_AHB_CLK>,
<&qca8k_nsscc NSS_CC_SEC_CTRL_AHB_CLK>,
<&qca8k_nsscc NSS_CC_TLMM_CLK>,
<&qca8k_nsscc NSS_CC_TLMM_AHB_CLK>,
<&qca8k_nsscc NSS_CC_CNOC_AHB_CLK>,
<&qca8k_nsscc NSS_CC_MDIO_AHB_CLK>,
<&qca8k_nsscc NSS_CC_MDIO_MASTER_AHB_CLK>,
<&qca8k_nsscc NSS_CC_SRDS0_SYS_CLK>,
<&qca8k_nsscc NSS_CC_SRDS1_SYS_CLK>,
<&qca8k_nsscc NSS_CC_GEPHY0_SYS_CLK>,
<&qca8k_nsscc NSS_CC_GEPHY1_SYS_CLK>,
<&qca8k_nsscc NSS_CC_GEPHY2_SYS_CLK>,
<&qca8k_nsscc NSS_CC_GEPHY3_SYS_CLK>;
clock-names = "apb_bridge",
"ahb",
"sec_ctrl_ahb",
"tlmm",
"tlmm_ahb",
"cnoc_ahb",
"mdio_ahb",
"mdio_master_ahb",
"srds0_sys",
"srds1_sys",
"gephy0_sys",
"gephy1_sys",
"gephy2_sys",
"gephy3_sys";
resets = <&qca8k_nsscc NSS_CC_SRDS0_SYS_ARES>,
<&qca8k_nsscc NSS_CC_SRDS1_SYS_ARES>,
<&qca8k_nsscc NSS_CC_GEPHY0_SYS_ARES>,
<&qca8k_nsscc NSS_CC_GEPHY1_SYS_ARES>,
<&qca8k_nsscc NSS_CC_GEPHY2_SYS_ARES>,
<&qca8k_nsscc NSS_CC_GEPHY3_SYS_ARES>,
<&qca8k_nsscc NSS_CC_GEPHY0_ARES>,
<&qca8k_nsscc NSS_CC_GEPHY1_ARES>,
<&qca8k_nsscc NSS_CC_GEPHY2_ARES>,
<&qca8k_nsscc NSS_CC_GEPHY3_ARES>,
<&qca8k_nsscc NSS_CC_DSP_ARES>;
reset-names = "srds0_sys",
"srds1_sys",
"gephy0_sys",
"gephy1_sys",
"gephy2_sys",
"gephy3_sys",
"gephy0_soft",
"gephy1_soft",
"gephy2_soft",
"gephy3_soft",
"gephy_dsp";
};
ethernet-phy@1 {
compatible = "ethernet-phy-id004d.d180";
reg = <2>;
};
ethernet-phy@2 {
compatible = "ethernet-phy-id004d.d180";
reg = <3>;
};
ethernet-phy@3 {
compatible = "ethernet-phy-id004d.d180";
reg = <4>;
};
};
Thanks.
next prev parent reply other threads:[~2023-12-16 7:58 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-15 7:39 [PATCH v8 00/14] add qca8084 ethernet phy driver Luo Jie
2023-12-15 7:39 ` [PATCH v8 01/14] net: phy: introduce core support for phy-mode = "10g-qxgmii" Luo Jie
2023-12-15 7:39 ` [PATCH v8 02/14] dt-bindings: net: ethernet-controller: add 10g-qxgmii mode Luo Jie
2023-12-15 7:39 ` [PATCH v8 03/14] net: phy: at803x: add QCA8084 ethernet phy support Luo Jie
2023-12-15 7:39 ` [PATCH v8 04/14] net: phy: at803x: add the function phydev_id_is_qca808x Luo Jie
2023-12-15 7:39 ` [PATCH v8 05/14] net: phy: at803x: Add qca8084_config_init function Luo Jie
2023-12-15 7:39 ` [PATCH v8 06/14] net: phy: at803x: add qca8084_link_change_notify Luo Jie
2023-12-15 7:39 ` [PATCH v8 07/14] net: phy: at803x: add the possible_interfaces Luo Jie
2023-12-15 7:39 ` [PATCH v8 08/14] net: phy: at803x: add qca8084 switch registe access Luo Jie
2023-12-15 7:39 ` [PATCH v8 09/14] net: phy: at803x: set MDIO address of qca8084 PHY Luo Jie
2023-12-15 7:40 ` [PATCH v8 10/14] net: phy: at803x: parse qca8084 clocks and resets Luo Jie
2023-12-15 7:40 ` [PATCH v8 11/14] net: phy: at803x: add qca808x initial config sequence Luo Jie
2023-12-15 7:40 ` [PATCH v8 12/14] net: phy: at803x: configure qca8084 common clocks Luo Jie
2023-12-15 7:40 ` [PATCH v8 13/14] net: phy: at803x: configure qca8084 work mode Luo Jie
2023-12-17 13:02 ` Simon Horman
2023-12-18 3:33 ` Jie Luo
2023-12-15 7:40 ` [PATCH v8 14/14] dt-bindings: net: ar803x: add qca8084 PHY properties Luo Jie
2023-12-15 8:22 ` Krzysztof Kozlowski
2023-12-15 10:16 ` Jie Luo
2023-12-15 11:25 ` Andrew Lunn
2023-12-15 12:16 ` Jie Luo
2023-12-15 13:42 ` Russell King (Oracle)
2023-12-16 7:57 ` Jie Luo [this message]
2023-12-16 17:17 ` Andrew Lunn
2023-12-18 4:53 ` Jie Luo
2023-12-18 9:34 ` Andrew Lunn
2023-12-19 8:52 ` Jie Luo
2023-12-15 12:12 ` Andrew Lunn
2023-12-15 12:33 ` Jie Luo
2023-12-15 13:31 ` Andrew Lunn
2023-12-16 7:37 ` Jie Luo
2023-12-16 10:21 ` Andrew Lunn
2023-12-16 13:25 ` Jie Luo
2023-12-16 13:51 ` Russell King (Oracle)
2023-12-16 14:41 ` Jie Luo
2023-12-16 16:01 ` Christian Marangi
2023-12-18 5:22 ` Jie Luo
2023-12-16 16:09 ` Russell King (Oracle)
2023-12-18 3:01 ` Jie Luo
2024-01-02 9:57 ` Russell King (Oracle)
2024-01-02 10:08 ` Christian Marangi
2024-01-03 13:27 ` Jie Luo
2024-01-03 14:22 ` Andrew Lunn
2024-01-04 9:53 ` Jie Luo
2024-01-04 13:57 ` Andrew Lunn
2024-01-05 10:26 ` Jie Luo
2024-01-05 13:37 ` Andrew Lunn
2024-01-08 8:27 ` Jie Luo
2023-12-16 17:30 ` Andrew Lunn
2023-12-16 19:08 ` Russell King (Oracle)
2023-12-18 3:31 ` Jie Luo
2023-12-18 3:27 ` Jie Luo
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=3a40570b-40bf-4609-b1f4-a0a6974accea@quicinc.com \
--to=quic_luoj@quicinc.com \
--cc=andrew@lunn.ch \
--cc=conor+dt@kernel.org \
--cc=corbet@lwn.net \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@google.com \
--cc=f.fainelli@gmail.com \
--cc=hkallweit1@gmail.com \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=krzysztof.kozlowski@linaro.org \
--cc=kuba@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=p.zabel@pengutronix.de \
--cc=pabeni@redhat.com \
--cc=robh+dt@kernel.org \
/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®