devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Chukun Pan <amadeus@jmu.edu.cn>
Cc: heiko@sntech.de, alexandre.torgue@foss.st.com,
	davem@davemloft.net, david.wu@rock-chips.com,
	devicetree@vger.kernel.org, edumazet@google.com,
	joabreu@synopsys.com, krzysztof.kozlowski+dt@linaro.org,
	krzysztof.kozlowski@linaro.org, kuba@kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	pabeni@redhat.com, peppe.cavallaro@st.com, robh+dt@kernel.org
Subject: Re: Re: [PATCH 1/2] dt-bindings: net: rockchip-dwmac: add rk3568 xpcs compatible
Date: Sat, 3 Dec 2022 18:27:58 +0100	[thread overview]
Message-ID: <Y4uHHiLxSw1sMcTz@lunn.ch> (raw)
In-Reply-To: <20221203090015.16132-1-amadeus@jmu.edu.cn>

On Sat, Dec 03, 2022 at 05:00:15PM +0800, Chukun Pan wrote:
> > Actually looking deeper in the TRM, having these registers "just" written
> > to from the dwmac-glue-layer feels quite a bit like a hack.
> 
> > The "pcs" thingy referenced in patch2 actually looks more like a real device
> > with its own section in the TRM and own iomem area. This pcs device then
> > itself has some more settings stored in said pipe-grf.
> 
> > So this looks more like it wants to be an actual phy-driver.
> 
> > @Chukun Pan: plase take a look at something like
> > https://elixir.bootlin.com/linux/latest/source/drivers/phy/mscc/phy-ocelot-serdes.c#L398
> > on how phy-drivers for ethernets could look like.
> 
> > Aquiring such a phy from the dwmac-glue and calling phy_set_mode after
> > moving the xpcs_setup to a phy-driver shouldn't be too hard I think.
> 
> Thanks for pointing that out.
> The patch2 is come from the sdk kernel of rockchip.
> The sgmii-phy of RK3568 is designed on nanning combo phy.
> In the sdk kernel, if we want to use sgmii mode, we need
> to modify the device tree in the gmac section like this:
> 
> ```
> &gmac0 {
> 	power-domains = <&power RK3568_PD_PIPE>;
> 	phys = <&combphy1_usq PHY_TYPE_SGMII>;
> 	phy-handle = <&sgmii_phy>;
> 	phy-mode = "sgmii";

phy-mode tells you you are using SGMII. You can tell the generic PHY
driver this which will call the PHY drivers .set_mode().

As said above, there are plenty of examples of this, mvneta and its
comphy, various mscc drivers etc.

	Andrew

      reply	other threads:[~2022-12-03 17:29 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-29  7:27 [PATCH 1/2] dt-bindings: net: rockchip-dwmac: add rk3568 xpcs compatible Chukun Pan
2022-11-29  7:27 ` [PATCH 2/2] ethernet: stmicro: stmmac: Add SGMII/QSGMII support for RK3568 Chukun Pan
2022-11-29  8:53   ` Krzysztof Kozlowski
2022-11-29 18:31     ` Andrew Lunn
2022-11-29  8:49 ` [PATCH 1/2] dt-bindings: net: rockchip-dwmac: add rk3568 xpcs compatible Krzysztof Kozlowski
2022-11-29  8:51   ` Krzysztof Kozlowski
2022-11-29  9:56   ` Heiko Stübner
2022-11-29  9:59     ` Krzysztof Kozlowski
2022-11-29 10:22       ` Heiko Stübner
2022-12-01 23:22         ` Rob Herring
2022-12-03  9:00         ` Chukun Pan
2022-12-03 17:27           ` Andrew Lunn [this message]

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=Y4uHHiLxSw1sMcTz@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=alexandre.torgue@foss.st.com \
    --cc=amadeus@jmu.edu.cn \
    --cc=davem@davemloft.net \
    --cc=david.wu@rock-chips.com \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@google.com \
    --cc=heiko@sntech.de \
    --cc=joabreu@synopsys.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=peppe.cavallaro@st.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;
as well as URLs for NNTP newsgroup(s).