netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: "Michal Vokáč" <michal.vokac@ysoft.com>
Cc: Vinod Koul <vkoul@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	netdev@vger.kernel.org,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Florian Fainelli <f.fainelli@gmail.com>
Subject: Re: [RFC] net: dsa: qca8k: implement rgmii-id mode
Date: Fri, 15 Feb 2019 16:23:56 +0100	[thread overview]
Message-ID: <20190215152356.GP708@lunn.ch> (raw)
In-Reply-To: <0c7428dc-736e-c5c4-13e7-b42052c60cd7@ysoft.com>

On Fri, Feb 15, 2019 at 04:01:08PM +0100, Michal Vokáč wrote:
> Hi,
> 
> networking on my boards [1], which are currently in linux-next, suddently
> stopped working. I tracked it down to this commit 5ecdd77c61c8 ("net: dsa:
> qca8k: disable delay for RGMII mode") [2].
> 
> So I think the rgmii-id mode is obviously needed in my case.
> I was able to find a couple drivers that read tx/rx-delay or
> tx/rx-internal-delay from device tree. Namely:
> 
>   drivers/net/ethernet/apm/xgene/xgene_enet_main.c
>   drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
>   drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c
>   drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
>   drivers/net/phy/dp83867.c
> 
> I would appreciate any hints how to add similar function to qca8k driver
> if that is the correct way to go. Can I take some of the above mentioned
> drivers as a good example for that? How should the binding look like?
> 
> I would expect something like this:
> 
> 	switch@0 {
> 		compatible = "qca,qca8334";
> 		reg = <0>;
> 
> 		switch_ports: ports {
> 			#address-cells = <1>;
> 			#size-cells = <0>;
> 
> 			ethphy0: port@0 {
> 				reg = <0>;
> 				label = "cpu";
> 				phy-mode = "rgmii-id";
> 				qca,tx-delay = <3>;
> 				qca,rx-delay = <3>;
> 				ethernet = <&fec>;
> 		};

Hi Michal

Your submission used:

+				ethphy0: port@0 {
+					reg = <0>;
+					label = "cpu";
+					phy-mode = "rgmii";
+					ethernet = <&fec>;
+
+					fixed-link {
+						speed = <1000>;
+						full-duplex;
+					};
+				};

This is good. If you have a fixed-link you can pass a phy-mode.

The comment that was removed was:

-               /* According to the datasheet, RGMII delay is enabled through
-                * PORT5_PAD_CTRL for all ports, rather than individual port
-                * registers
-                */

Is it possible to enable delays per port? Ideally, you want to enable
delays for just selected ports. Add another case for
PHY_INTERFACE_MODE_RGMII_ID to enable the delays.

    Andrew

  reply	other threads:[~2019-02-15 15:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-15 15:01 [RFC] net: dsa: qca8k: implement rgmii-id mode Michal Vokáč
2019-02-15 15:23 ` Andrew Lunn [this message]
2019-02-18 10:45   ` Vinod Koul
2019-02-18 11:54     ` Michal Vokáč
2019-02-18 13:03       ` Vinod Koul
2019-02-18 13:31         ` Michal Vokáč

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=20190215152356.GP708@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.vokac@ysoft.com \
    --cc=netdev@vger.kernel.org \
    --cc=vkoul@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).