net: phy: Add Downshift, FLF2 drivers for Microsemi
Subsystems (4)
cover net: phy: Add Downshift, FLF2 drivers for Microsemi
From: Raju Lakkaraju <[email protected]>
This series adds support to the Speed downshift, Fast Link Failure 2, set drivers for Microsemi PHYs.
Patch 1/4: Link Speed downshift:
For operation in cabling environments that are incompatible with 1000BAST-T, VSC8531 device provides an automatic link speed downshift operation. When enabled, the device automatically changes its 1000BAST-T auto-negotiation to the next slower speed after a set number of failed attempts at 1000BAST-T.
This feature is useful in setting up in networks using older cable installations that include only pairs A and B, and not pairs C and D.
Patch 2/4: Fast Link Failure 2:
VSC8531 Fast Link Failure 2 feature enables the PHY to indicate the onset of a potential link failure in < 100 usec for 100BASE-TX operation. FLF2 is supported through the MDINT (active low) pin.
All these features tested on Beaglebone Black with VSC 8531 PHY.
Raju Lakkaraju (2):
net: phy: Add Speed downshift set driver for Microsemi PHYs.
net: phy: Add Fast Link Failure - 2 set driver for Microsemi PHYs.
.../devicetree/bindings/net/mscc-phy-vsc8531.txt | 12 +++ drivers/net/phy/mscc.c | 120 ++++++++++++++++++++- 2 files changed, 131 insertions(+), 1 deletion(-)
Signature · 1 line
2.7.4
PATCH 1/2 net: phy: Add Speed downshift set driver for Microsemi PHYs.
In reply to a message not in the archiveFrom: Raju Lakkaraju <Raju.Lakkaraju-dzo6w/[email protected]>
For operation in cabling environments that are incompatible with 1000BAST-T, VSC8531 device provides an automatic link speed downshift operation. When enabled, the device automatically changes its 1000BAST-T auto-negotiation to the next slower speed after a configured number of failed attempts at 1000BAST-T.
This feature is useful in setting up in networks using older cable installations that include only pairs A and B, and not pairs C and D.
--- .../devicetree/bindings/net/mscc-phy-vsc8531.txt | 6 ++ drivers/net/phy/mscc.c | 75 +++++++++++++++++++++- 2 files changed, 80 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/net/mscc-phy-vsc8531.txt +6 -0
@@ -27,6 +27,11 @@ Optional properties: 'vddmac'. Default value is 0%. Ref: Table:1 - Edge rate change (below). +- downshift-cnt : When enabled, the device automatically changes its + 1000BAST-T auto-negotiation to the next slower speed + after a 'downshift-cnt' of failed attempts at + 1000BAST-T. Allowed values: 0, 2, 3, 4, 5. + 0 is default and will disable downshifting. Table: 1 - Edge rate change ----------------------------------------------------------------|
@@ -60,4 +65,5 @@ Example: compatible = "ethernet-phy-id0007.0570"; vsc8531,vddmac = <3300>; vsc8531,edge-slowdown = <7>; + vsc8531,downshift-cnt = <3>; };
drivers/net/phy/mscc.c +74 -1
130 lines not on this page · raw message
Signature · 6 lines
2.7.4 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 2/2 net: phy: Add Fast Link Failure - 2 set driver for Microsemi PHYs.
In reply to Raju LakkarajuFrom: Raju Lakkaraju <[email protected]>
VSC8531 Fast Link Failure 2 feature enables the PHY to indicate the onset of a potential link failure in < 100 usec for 100BASE-TX operation. FLF2 is supported through the MDINT (active low) pin.
--- .../devicetree/bindings/net/mscc-phy-vsc8531.txt | 6 +++ drivers/net/phy/mscc.c | 45 ++++++++++++++++++++++ 2 files changed, 51 insertions(+)
Documentation/devicetree/bindings/net/mscc-phy-vsc8531.txt +6 -0
@@ -32,6 +32,11 @@ Optional properties: after a 'downshift-cnt' of failed attempts at 1000BAST-T. Allowed values: 0, 2, 3, 4, 5. 0 is default and will disable downshifting. +- flf2 : Fast Link Failure 2 (FLF2) feature enables the PHY + to indicate the onset of a potential link failure in + < 100 usec for 100BASE-TX operation. FLF2 is + supported through the MDINT (active low) pin. + Default will be disable flf2. Table: 1 - Edge rate change ----------------------------------------------------------------|
@@ -66,4 +71,5 @@ Example: vsc8531,vddmac = <3300>; vsc8531,edge-slowdown = <7>; vsc8531,downshift-cnt = <3>; + vsc8531,flf2; };
drivers/net/phy/mscc.c +45 -0
81 lines not on this page · raw message
Signature · 1 line
2.7.4
Andrew Lunn
maintainerRe: [PATCH net-next 2/2] net: phy: Add Fast Link Failure - 2 set driver for Microsemi PHYs.
Quoted 6 lines · Raju Lakkaraju
From: Raju Lakkaraju <[email protected]>
VSC8531 Fast Link Failure 2 feature enables the PHY to indicate the onset of a potential link failure in < 100 usec for 100BASE-TX operation. FLF2 is supported through the MDINT (active low) pin.
Is the MDINT pin specific to this feature, or a general interrupt pin?
Device tree is used to describe the hardware. It should not really describe software or configuration. But the borders are a bit fluffly. Signal edge rates is near to hardware. This is a lot more towards configuration. So i'm not sure a device tree property is the correct way to describe this.
This is also a feature i know other PHYs support. The Marvell PHY has a "Metro Ethernet" extension which allows it to report link failures for 1000BASE-T in 10, 20 or 40ms, instead of the usual 750ms. So we need a generic solution other PHYs can implement.
As with cable testing, i think it should be an ethtool option.
Andrew
Andrew Lunn
maintainerRe: [PATCH net-next 1/2] net: phy: Add Speed downshift set driver for Microsemi PHYs.
In reply to Raju LakkarajuQuoted 9 lines · Raju Lakkaraju
From: Raju Lakkaraju <[email protected]>
For operation in cabling environments that are incompatible with 1000BAST-T, VSC8531 device provides an automatic link speed downshift operation. When enabled, the device automatically changes its 1000BAST-T auto-negotiation to the next slower speed after a configured number of failed attempts at 1000BAST-T.
This feature is useful in setting up in networks using older cable installations that include only pairs A and B, and not pairs C and D.
Any reason not to just turn this on by default when auto-neg is enabled?
Andrew
Re: [PATCH net-next 1/2] net: phy: Add Speed downshift set driver for Microsemi PHYs.
Hi Andrew,
Thank you for code review and comments.
Quoted 14 lines · Andrew Lunn
EXTERNAL EMAIL
Quoted 9 lines · Raju Lakkaraju
From: Raju Lakkaraju <[email protected]>
For operation in cabling environments that are incompatible with 1000BAST-T, VSC8531 device provides an automatic link speed downshift operation. When enabled, the device automatically changes its 1000BAST-T auto-negotiation to the next slower speed after a configured number of failed attempts at 1000BAST-T.
This feature is useful in setting up in networks using older cable installations that include only pairs A and B, and not pairs C and D.
Quoted 3 lines
Any reason not to just turn this on by default when auto-neg is enabled?
Downshift can enable by default when auto-neg enabled. This is good idea. But we would like to provide option to customer can choose whether this feature need to enable or disable and also configure failure attempts.
Do you have any other suggestion how to configure failure attempts?
Quoted 1 line
Andrew
---
Thanks,
Raju.
Re: [PATCH net-next 2/2] net: phy: Add Fast Link Failure - 2 set driver for Microsemi PHYs.
In reply to Andrew LunnHi Andrew,
Thank you for code review and comments.
Quoted 12 lines · Andrew Lunn
EXTERNAL EMAIL
Quoted 6 lines · Raju Lakkaraju
From: Raju Lakkaraju <[email protected]>
VSC8531 Fast Link Failure 2 feature enables the PHY to indicate the onset of a potential link failure in < 100 usec for 100BASE-TX operation. FLF2 is supported through the MDINT (active low) pin.
Is the MDINT pin specific to this feature, or a general interrupt pin?
MDINT pin is general interrupt. MDINT pin share the interrupt with FLF2 along with another 13 interrupts.
Quoted 6 lines
Device tree is used to describe the hardware. It should not really describe software or configuration. But the borders are a bit fluffly. Signal edge rates is near to hardware. This is a lot more towards configuration. So i'm not sure a device tree property is the correct way to describe this.
Quoted 6 lines
This is also a feature i know other PHYs support. The Marvell PHY has a "Metro Ethernet" extension which allows it to report link failures for 1000BASE-T in 10, 20 or 40ms, instead of the usual 750ms. So we need a generic solution other PHYs can implement.
As with cable testing, i think it should be an ethtool option.
I agree with you.
I thought this is one time initialization either enable or disable. if customer need this feature, they can enable in DT.
Do you want me to implement through IOCTL instead of Device tree? Do you have any other suggestions?
Quoted 2 lines
Andrew
---
Thanks,
Raju.
Re: [PATCH net-next 1/2] net: phy: Add Speed downshift set driver for Microsemi PHYs.
In reply to Raju LakkarajuQuoted 23 lines · Raju Lakkaraju
Hi Andrew,
Thank you for code review and comments.
Quoted 13 lines · Andrew Lunn
EXTERNAL EMAIL
Quoted 9 lines · Raju Lakkaraju
From: Raju Lakkaraju <[email protected]>
For operation in cabling environments that are incompatible with 1000BAST-T, VSC8531 device provides an automatic link speed downshift operation. When enabled, the device automatically changes its 1000BAST-T auto-negotiation to the next slower speed after a configured number of failed attempts at 1000BAST-T. This feature is useful in setting up in networks using older cable installations that include only pairs A and B, and not pairs C and
D.
Quoted 4 lines
Any reason not to just turn this on by default when auto-neg is enabled?
Quoted 6 lines
Downshift can enable by default when auto-neg enabled. This is good idea.
But we would like to provide option to customer can choose whether this feature need to enable or disable and also configure failure attempts.Do you have any other suggestion how to configure failure attempts?
Is the speed downshift feature similar to what Intel and Broadcom refer to as wirespeed? I have seen cases with Broadcom PHYs where we had to turn such a feature on to allow auto-negotiation to complete with 4-wire cables, but this had the downside of impacting normal autoneg, so it is left disabled.
I would expect the number of customers using this feature to be fairly limited, so having a tunable to turn this downshift on/off may be acceptable. Ethtool supports a number of tunable parameters now (such as rx_copybreak), there may be room for using something similar for boolean flags like these.
Signature · 1 line
Florian
Re: [PATCH net-next 2/2] net: phy: Add Fast Link Failure - 2 set driver for Microsemi PHYs.
In reply to a message not in the archiveQuoted 33 lines · Raju Lakkaraju
Hi Andrew,
Thank you for code review and comments.
Quoted 11 lines · Andrew Lunn
EXTERNAL EMAIL
Quoted 6 lines · Raju Lakkaraju
From: Raju Lakkaraju <Raju.Lakkaraju-dzo6w/[email protected]>
VSC8531 Fast Link Failure 2 feature enables the PHY to indicate the onset of a potential link failure in < 100 usec for 100BASE-TX operation. FLF2 is supported through the MDINT (active low) pin.
Is the MDINT pin specific to this feature, or a general interrupt
pin?
Quoted 1 line
MDINT pin is general interrupt. MDINT pin share the interrupt with FLF2 along with another 13 interrupts.
Quoted 11 lines
Device tree is used to describe the hardware. It should not really describe software or configuration. But the borders are a bit fluffly. Signal edge rates is near to hardware. This is a lot more towards configuration. So i'm not sure a device tree property is the correct way to describe this.
This is also a feature i know other PHYs support. The Marvell PHY has a "Metro Ethernet" extension which allows it to report link failures for 1000BASE-T in 10, 20 or 40ms, instead of the usual 750ms. So we need a generic solution other PHYs can implement.
Quoted 7 lines
Quoted 1 line
As with cable testing, i think it should be an ethtool option.
I agree with you.
I thought this is one time initialization either enable or disable. if customer need this feature, they can enable in DT.
Do you want me to implement through IOCTL instead of Device tree? Do you have any other suggestions?
As indicated in the other email about speed downshift, we may want to utilize ethtool's ability to modify tunable parameters (small integer, boolean, values) and extend it to cover features offered by PHYs in a way that an user can dynamically turn these features on or off.
In fact, this looks a lot like netdev features (e.g: checksum offload), and there seems to be some commonality here between at least Marvell and Microsemi (for the faster link down reporting), so maybe we should start adding PHY features similar to netdev features?
Signature · 5 lines
Florian -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH net-next 2/2] net: phy: Add Fast Link Failure - 2 set driver for Microsemi PHYs.
In reply to a message not in the archiveHi Florian,
Thank you for review comments.
Quoted 45 lines · Florian Fainelli
EXTERNAL EMAIL
Quoted 33 lines · Raju Lakkaraju
Hi Andrew,
Thank you for code review and comments.
Quoted 11 lines · Andrew Lunn
EXTERNAL EMAIL
Quoted 6 lines · Raju Lakkaraju
From: Raju Lakkaraju <Raju.Lakkaraju-dzo6w/[email protected]>
VSC8531 Fast Link Failure 2 feature enables the PHY to indicate the onset of a potential link failure in < 100 usec for 100BASE-TX operation. FLF2 is supported through the MDINT (active low) pin.
Is the MDINT pin specific to this feature, or a general interrupt
pin?
Quoted 1 line
MDINT pin is general interrupt. MDINT pin share the interrupt with FLF2 along with another 13 interrupts.
Quoted 11 lines
Device tree is used to describe the hardware. It should not really describe software or configuration. But the borders are a bit fluffly. Signal edge rates is near to hardware. This is a lot more towards configuration. So i'm not sure a device tree property is the correct way to describe this.
This is also a feature i know other PHYs support. The Marvell PHY has a "Metro Ethernet" extension which allows it to report link failures for 1000BASE-T in 10, 20 or 40ms, instead of the usual 750ms. So we need a generic solution other PHYs can implement.
Quoted 7 lines
Quoted 1 line
As with cable testing, i think it should be an ethtool option.
I agree with you.
I thought this is one time initialization either enable or disable. if customer need this feature, they can enable in DT.
Do you want me to implement through IOCTL instead of Device tree? Do you have any other suggestions?
Quoted 4 lines
As indicated in the other email about speed downshift, we may want to utilize ethtool's ability to modify tunable parameters (small integer, boolean, values) and extend it to cover features offered by PHYs in a way that an user can dynamically turn these features on or off.
In fact, this looks a lot like netdev features (e.g: checksum offload), and there seems to be some commonality here between at least Marvell and Microsemi (for the faster link down reporting), so maybe we should start adding PHY features similar to netdev features?
Sure.
I would like add one flag in phy_device structure:
u64 phy_features;
In phy_driver structure, i would like to add 2 function pointer as
int (*phy_featues_set)(struct phy_device *phydev); int (*phy_featues_get)(struct phy_device *phydev);
All the PHY specific features i.e. Fast link failure -2, Downshift, Loopback etc are the case in feature_set/feature_get functions.
Is it ok?
Quoted 2 lines
--
Florian
---
Thanks,
Raju.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH net-next 1/2] net: phy: Add Speed downshift set driver for Microsemi PHYs.
In reply to Florian FainelliHi Florian,
Thank you for review comments.
Quoted 27 lines · Florian Fainelli
EXTERNAL EMAIL
Quoted 23 lines · Raju Lakkaraju
Hi Andrew,
Thank you for code review and comments.
Quoted 13 lines · Andrew Lunn
EXTERNAL EMAIL
Quoted 9 lines · Raju Lakkaraju
From: Raju Lakkaraju <[email protected]>
For operation in cabling environments that are incompatible with 1000BAST-T, VSC8531 device provides an automatic link speed downshift operation. When enabled, the device automatically changes its 1000BAST-T auto-negotiation to the next slower speed after a configured number of failed attempts at 1000BAST-T. This feature is useful in setting up in networks using older cable installations that include only pairs A and B, and not pairs C and
D.
Quoted 4 lines
Any reason not to just turn this on by default when auto-neg is enabled?
Quoted 9 lines
Quoted 6 lines
Downshift can enable by default when auto-neg enabled. This is good idea.
But we would like to provide option to customer can choose whether this feature need to enable or disable and also configure failure attempts.Do you have any other suggestion how to configure failure attempts?
Is the speed downshift feature similar to what Intel and Broadcom refer to as wirespeed? I have seen cases with Broadcom PHYs where we had to turn such a feature on to allow auto-negotiation to complete with 4-wire cables, but this had the downside of impacting normal autoneg, so it is left disabled.
Yes. I check the Broadcom wirespeed code. Downshift is similar to wirespeed. But Broadcom wirespeed configuration in Ethernet controller.
Quoted 2 lines
I would expect the number of customers using this feature to be fairly limited, so having a tunable to turn this downshift on/off may be acceptable. Ethtool supports a number of tunable parameters now (such as
rx_copybreak), there may be room for using something similar for boolean flags like these.
This implementation shows little bit specific to Ethernet controller. Do you have any PHY specific examples?
In another mail thread, you proposed similar to net device features. Shall i implement that suggestion here?
Quoted 2 lines
--
Florian
---
Thanks,
Raju.
Re: [PATCH net-next 2/2] net: phy: Add Fast Link Failure - 2 set driver for Microsemi PHYs.
In reply to a message not in the archiveQuoted 11 lines
Quoted 5 lines
In fact, this looks a lot like netdev features (e.g: checksum offload), and there seems to be some commonality here between at least Marvell and Microsemi (for the faster link down reporting), so maybe we should start adding PHY features similar to netdev features?
Sure.
I would like add one flag in
phy_devicestructure:
u64phy_features;
Quoted 7 lines
In
phy_driverstructure, i would like to add 2 function pointer asint (*phy_featues_set)(struct
phy_device*phydev); int (*phy_featues_get)(structphy_device*phydev);All the PHY specific features i.e. Fast link failure -2, Downshift, Loopback etc are the case in feature_set/feature_get functions.
Please follow how the ethertool features are implemented. So you need to extend net/core/ethtool.c to pass these call down, etc.
Andrew
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH net-next 2/2] net: phy: Add Fast Link Failure - 2 set driver for Microsemi PHYs.
Hi Andrew,
Quoted 16 lines · Andrew Lunn
EXTERNAL EMAIL
Quoted 13 lines
Quoted 5 lines
In fact, this looks a lot like netdev features (e.g: checksum offload), and there seems to be some commonality here between at least Marvell and Microsemi (for the faster link down reporting), so maybe we should start adding PHY features similar to netdev features?
Sure.
I would like add one flag in
phy_devicestructure:
u64phy_features;In
phy_driverstructure, i would like to add 2 function pointer as
Quoted 9 lines
Quoted 5 lines
int (*phy_featues_set)(struct
phy_device*phydev); int (*phy_featues_get)(structphy_device*phydev);All the PHY specific features i.e. Fast link failure -2, Downshift, Loopback etc are the case in feature_set/feature_get functions.
Please follow how the ethertool features are implemented. So you need to extend
net/core/ethtool.cto pass these call down, etc.
Sure. I will do.
Do i need to change Ethtool application and submit along with downshift driver patch (i.e. ethtool.c, phy.c, cpsw.c and mscc.c changes) ?
Quoted 1 line
Andrew
---
Thanks,
Raju.
Re: [PATCH net-next 2/2] net: phy: Add Fast Link Failure - 2 set driver for Microsemi PHYs.
In reply to a message not in the archiveQuoted 2 lines
Do i need to change Ethtool application and submit along with downshift driver patch (i.e.
ethtool.c,phy.c,cpsw.candmscc.cchanges) ?
Yes, please submit two patchset. One patchset for ethtool and its man page and a second patchset for all the kernel changes.
Thanks
Andrew
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH net-next 1/2] net: phy: Add Speed downshift set driver for Microsemi PHYs.
In reply to a message not in the archiveQuoted 22 lines · Raju Lakkaraju
From: Raju Lakkaraju <Raju.Lakkaraju-dzo6w/[email protected]>
For operation in cabling environments that are incompatible with 1000BAST-T, VSC8531 device provides an automatic link speed downshift operation. When enabled, the device automatically changes its 1000BAST-T auto-negotiation to the next slower speed after a configured number of failed attempts at 1000BAST-T.
This feature is useful in setting up in networks using older cable installations that include only pairs A and B, and not pairs C and D.Signed-off-by Raju Lakkaraju <Raju.Lakkaraju-dzo6w/[email protected]>Signed-off-by Allan W. Nielsen <allan.nielsen-dzo6w/[email protected]>--- .../devicetree/bindings/net/mscc-phy-vsc8531.txt | 6 ++ drivers/net/phy/mscc.c | 75 +++++++++++++++++++++- 2 files changed, 80 insertions(+), 1 deletion(-)Documentation/devicetree/bindings/net/mscc-phy-vsc8531.txt +0
-0
Documentation/devicetree/bindings/net/mscc-phy-vsc8531.txt Optional properties: · line 34
Quoted 8 lines
Documentation/devicetree/bindings/net/mscc-phy-vsc8531.txt +5
-0@@ -27,6 +27,11 @@ Optional properties: 'vddmac'. Default value is 0%. Ref: Table:1 - Edge rate change (below). +- downshift-cnt : When enabled, the device automatically changes its + 1000BAST-T auto-negotiation to the next slower speed + after a 'downshift-cnt' of failed attempts at + 1000BAST-T. Allowed values: 0, 2, 3, 4, 5. + 0 is default and will disable downshifting.
Not sure if you are dropping this based on the discussion. Is this end-user controlled or a board property? Only the latter should be in DT.
Documentation/devicetree/bindings/net/mscc-phy-vsc8531.txt Example: · line 68
Quoted 8 lines
Documentation/devicetree/bindings/net/mscc-phy-vsc8531.txt +1
-0Table: 1 - Edge rate change ----------------------------------------------------------------|@@ -60,4 +65,5 @@ Example: compatible = "ethernet-phy-id0007.0570"; vsc8531,vddmac = <3300>; vsc8531,edge-slowdown = <7>; + vsc8531,downshift-cnt = <3>;
This doesn't match the above. Also, 'vsc8531' should be the vendor prefix, not a part number. The existing properties are fine, but fix new ones.
Rob
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html