From: Alexandru Gagniuc <hidden> Date: 2016-11-12 23:48:29
With RGMII, we need a 1.5 to 2ns skew between clock and data lines. The
VSC8601 can handle this internally. While the VSC8601 can set more
fine-grained delays, the standard skew settings work out of the box.
The same heuristic is used to determine when this skew should be enabled
as in vsc824x_config_init().
Tested on custom board with AM3352 SOC and VSC801 PHY.
Signed-off-by: Alexandru Gagniuc <redacted>
---
drivers/net/phy/vitesse.c | 31 ++++++++++++++++++++++++++++++-
1 file changed, 30 insertions(+), 1 deletion(-)
From: Alexandru Gagniuc <redacted>
Date: Sat, 12 Nov 2016 15:32:13 -0800
quoted
+ if (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID)
+ ret = vsc8601_add_skew(phydev);
I think you should use phy_interface_is_rgmii() here.
This would include all RGMII modes, here I think the intent is to check
for PHY_INTERFACE_MODE_RGMII_ID and PHY_INTERFACE_MODE_RGMII_TXID (or
RXID), Alexandru, what direction does the skew settings apply to?
--
Florian
From: Alexandru Gagniuc <hidden> Date: 2016-11-16 10:36:27
With RGMII, we need a 1.5 to 2ns skew between clock and data lines. The
VSC8601 can handle this internally. While the VSC8601 can set more
fine-grained delays, the standard skew settings work out of the box.
The same heuristic is used to determine when this skew should be enabled
as in vsc824x_config_init().
Tested on custom board with AM3352 SOC and VSC801 PHY.
Signed-off-by: Alexandru Gagniuc <redacted>
---
Changes since v1:
* Added comment detailing applicability to different RGMII interfaces.
drivers/net/phy/vitesse.c | 34 +++++++++++++++++++++++++++++++++-
1 file changed, 33 insertions(+), 1 deletion(-)
@@ -111,6 +115,34 @@ static int vsc824x_config_init(struct phy_device *phydev)returnerr;}+/* This adds a skew for both TX and RX clocks, so the skew should only be+*appliedto"rgmii-id"interfaces.Itmaynotworkasexpected+*on"rgmii-txid","rgmii-rxid"or"rgmii"interfaces.*/+staticintvsc8601_add_skew(structphy_device*phydev)+{+intret;++ret=phy_read(phydev,MII_VSC8601_EPHY_CTL);+if(ret<0)+returnret;++ret|=MII_VSC8601_EPHY_CTL_RGMII_SKEW;+returnphy_write(phydev,MII_VSC8601_EPHY_CTL,ret);+}++staticintvsc8601_config_init(structphy_device*phydev)+{+intret=0;++if(phydev->interface==PHY_INTERFACE_MODE_RGMII_ID)+ret=vsc8601_add_skew(phydev);++if(ret<0)+returnret;++returngenphy_config_init(phydev);+}+staticintvsc824x_ack_interrupt(structphy_device*phydev){interr=0;
From: Andrew Lunn <andrew@lunn.ch> Date: 2016-11-16 13:51:00
On Wed, Nov 16, 2016 at 01:02:33AM -0800, Alexandru Gagniuc wrote:
quoted hunk
With RGMII, we need a 1.5 to 2ns skew between clock and data lines. The
VSC8601 can handle this internally. While the VSC8601 can set more
fine-grained delays, the standard skew settings work out of the box.
The same heuristic is used to determine when this skew should be enabled
as in vsc824x_config_init().
Tested on custom board with AM3352 SOC and VSC801 PHY.
Signed-off-by: Alexandru Gagniuc <redacted>
---
Changes since v1:
* Added comment detailing applicability to different RGMII interfaces.
drivers/net/phy/vitesse.c | 34 +++++++++++++++++++++++++++++++++-
1 file changed, 33 insertions(+), 1 deletion(-)
@@ -111,6 +115,34 @@ static int vsc824x_config_init(struct phy_device *phydev)returnerr;}+/* This adds a skew for both TX and RX clocks, so the skew should only be+*appliedto"rgmii-id"interfaces.Itmaynotworkasexpected+*on"rgmii-txid","rgmii-rxid"or"rgmii"interfaces.*/
Hi Alexandru
You should be able to make "rgmii" work as expected. If that is the
phy mode, disable the skew.
Andrew
On Wed, Nov 16, 2016 at 01:02:33AM -0800, Alexandru Gagniuc wrote:
quoted
With RGMII, we need a 1.5 to 2ns skew between clock and data lines. The
VSC8601 can handle this internally. While the VSC8601 can set more
fine-grained delays, the standard skew settings work out of the box.
The same heuristic is used to determine when this skew should be enabled
as in vsc824x_config_init().
+/* This adds a skew for both TX and RX clocks, so the skew should only be
+ * applied to "rgmii-id" interfaces. It may not work as expected
+ * on "rgmii-txid", "rgmii-rxid" or "rgmii" interfaces. */
Hi Alexandru
You should be able to make "rgmii" work as expected. If that is the
phy mode, disable the skew.
And that's exactly the implemented behavior. See vsc8601_config_init()
below.
Alex
From: Andrew Lunn <andrew@lunn.ch> Date: 2016-11-16 16:54:42
On Wed, Nov 16, 2016 at 08:44:30AM -0800, Alex wrote:
On 11/16/2016 05:50 AM, Andrew Lunn wrote:
quoted
On Wed, Nov 16, 2016 at 01:02:33AM -0800, Alexandru Gagniuc wrote:
quoted
With RGMII, we need a 1.5 to 2ns skew between clock and data lines. The
VSC8601 can handle this internally. While the VSC8601 can set more
fine-grained delays, the standard skew settings work out of the box.
The same heuristic is used to determine when this skew should be enabled
as in vsc824x_config_init().
+/* This adds a skew for both TX and RX clocks, so the skew should only be
+ * applied to "rgmii-id" interfaces. It may not work as expected
+ * on "rgmii-txid", "rgmii-rxid" or "rgmii" interfaces. */
Hi Alexandru
You should be able to make "rgmii" work as expected. If that is the
phy mode, disable the skew.
And that's exactly the implemented behavior. See
vsc8601_config_init() below.
I don't think so. vsc8601_config_init() will not cause the skew to be
cleared if the phy-mode is "rgmii" and something else like the
bootloader could of set the skew. So saying that "rgmii" might not
work as expected is true. But with a minor change, you can make it
work as expected.
Andrew
On Wed, Nov 16, 2016 at 08:44:30AM -0800, Alex wrote:
quoted
On 11/16/2016 05:50 AM, Andrew Lunn wrote:
quoted
On Wed, Nov 16, 2016 at 01:02:33AM -0800, Alexandru Gagniuc wrote:
quoted
With RGMII, we need a 1.5 to 2ns skew between clock and data lines. The
VSC8601 can handle this internally. While the VSC8601 can set more
fine-grained delays, the standard skew settings work out of the box.
The same heuristic is used to determine when this skew should be enabled
as in vsc824x_config_init().
+/* This adds a skew for both TX and RX clocks, so the skew should only be
+ * applied to "rgmii-id" interfaces. It may not work as expected
+ * on "rgmii-txid", "rgmii-rxid" or "rgmii" interfaces. */
Hi Alexandru
You should be able to make "rgmii" work as expected. If that is the
phy mode, disable the skew.
And that's exactly the implemented behavior. See
vsc8601_config_init() below.
I don't think so. vsc8601_config_init() will not cause the skew to be
cleared if the phy-mode is "rgmii" and something else like the
bootloader could of set the skew. So saying that "rgmii" might not
work as expected is true. But with a minor change, you can make it
work as expected.
That's not within the scope of this change. The scope is to make
rgmii-id work. Any additional changes would be untested.
Alex
From: David Miller <davem@davemloft.net> Date: 2016-11-16 22:54:26
From: Alexandru Gagniuc <redacted>
Date: Wed, 16 Nov 2016 01:02:33 -0800
With RGMII, we need a 1.5 to 2ns skew between clock and data lines. The
VSC8601 can handle this internally. While the VSC8601 can set more
fine-grained delays, the standard skew settings work out of the box.
The same heuristic is used to determine when this skew should be enabled
as in vsc824x_config_init().
Tested on custom board with AM3352 SOC and VSC801 PHY.
Signed-off-by: Alexandru Gagniuc <redacted>
---
Changes since v1:
* Added comment detailing applicability to different RGMII interfaces.