net: phy: bcm7xxx 40nm PHY fixes
Subsystems (4)
cover net: phy: bcm7xxx 40nm PHY fixes
Hi David,
Here is a collection of fixes for the 40nm Ethernet PHY supported by the 7xxx PHY driver, please also queue these fixes for stable.
Let me know if you think patch 4 is too much of a cleanup to be taken as a fix.
Thanks!
Florian Fainelli (4):
net: phy: bcm7xxx: Fix shadow mode 2 disabling
net: phy: bcm7xxx: Fix 40nm EPHY features
net: phy: bcm7xxx: Fix bcm7xxx_config_init() check
net: phy: bcm7xxx: Make MII_BCM7XX_64CLK_MDIO naming consistent
drivers/net/phy/bcm7xxx.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-)
Signature · 1 line
2.1.0
PATCH 1/4 net: phy: bcm7xxx: Fix shadow mode 2 disabling
The clear and set masks in the call to phy_set_clr_bits() called from bcm7xxx_config_init() are inverted. We need to fix this by swapping the two arguments, that is, set 0 bits, but clear the shade mode 2 enable bit.
--- drivers/net/phy/bcm7xxx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/phy/bcm7xxx.c +1 -1
@@ -270,7 +270,7 @@ static int bcm7xxx_config_init(struct phy_device *phydev)phy_write (phydev,MII_BCM7XXX_100TX_FALSE_CAR ,0x7555 );/* reset shadow mode 2 */ - ret =phy_set_clr_bits (phydev,MII_BCM7XXX_TEST ,MII_BCM7XXX_SHD_MODE_2 ,0 ); + ret =phy_set_clr_bits (phydev,MII_BCM7XXX_TEST ,0 ,MII_BCM7XXX_SHD_MODE_2 );if (ret <0 )return ret;
Signature · 1 line
2.1.0
PATCH 2/4 net: phy: bcm7xxx: Fix 40nm EPHY features
In reply to Florian FainelliThe PHY entries for BCM7425/29/35 declare the 40nm Ethernet PHY as being 10/100/1000 capable, while this is just a 10/100 capable PHY device, fix that.
--- drivers/net/phy/bcm7xxx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/phy/bcm7xxx.c +3 -3
@@ -337,7 +337,7 @@ static struct phy_driver bcm7xxx_driver[] = { .phy_id = PHY_ID_BCM7425, .phy_id_mask = 0xfffffff0, .name = "Broadcom BCM7425", - .features =PHY_GBIT_FEATURES | + .features =PHY_BASIC_FEATURES | SUPPORTED_Pause | SUPPORTED_Asym_Pause, .flags = PHY_IS_INTERNAL, .config_init = bcm7xxx_config_init,
@@ -349,7 +349,7 @@ static struct phy_driver bcm7xxx_driver[] = { .phy_id = PHY_ID_BCM7429, .phy_id_mask = 0xfffffff0, .name = "Broadcom BCM7429", - .features =PHY_GBIT_FEATURES | + .features =PHY_BASIC_FEATURES | SUPPORTED_Pause | SUPPORTED_Asym_Pause, .flags = PHY_IS_INTERNAL, .config_init = bcm7xxx_config_init,
@@ -361,7 +361,7 @@ static struct phy_driver bcm7xxx_driver[] = { .phy_id = PHY_ID_BCM7435, .phy_id_mask = 0xfffffff0, .name = "Broadcom BCM7435", - .features =PHY_GBIT_FEATURES | + .features =PHY_BASIC_FEATURES | SUPPORTED_Pause | SUPPORTED_Asym_Pause, .flags = PHY_IS_INTERNAL, .config_init = bcm7xxx_config_init,
Signature · 1 line
2.1.0
PATCH 3/4 net: phy: bcm7xxx: Fix bcm7xxx_config_init() check
In reply to Florian FainelliSince we were wrongly advertising gigabit features for these 10/100 only Ethernet PHYs, bcm7xxx_config_init() which is supposed to apply workaround would have not run since the check would be true, now that we have fixed the PHY features, remove that check since it has no reasoning to be there anymore.
--- drivers/net/phy/bcm7xxx.c | 4 ---- 1 file changed, 4 deletions(-)
drivers/net/phy/bcm7xxx.c +0 -4
@@ -250,10 +250,6 @@ static int bcm7xxx_config_init(struct phy_device *phydev)phy_write (phydev,MII_BCM7XXX_AUX_MODE ,MII_BCM7XX_64CLK_MDIO );phy_read (phydev,MII_BCM7XXX_AUX_MODE ); -/* Workaround only required for 100Mbits/sec capable PHYs */ -if (phydev->supported &PHY_GBIT_FEATURES ) -return 0 ; -/* set shadow mode 2 */ ret =phy_set_clr_bits (phydev,MII_BCM7XXX_TEST ,MII_BCM7XXX_SHD_MODE_2 ,MII_BCM7XXX_SHD_MODE_2 );
Signature · 1 line
2.1.0
PATCH 4/4 net: phy: bcm7xxx: Make MII_BCM7XX_64CLK_MDIO naming consistent
In reply to Florian FainelliThe driver is BCM7xxx, we were missing an additional X in the constant naming, fix that to be consistent.
--- drivers/net/phy/bcm7xxx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/phy/bcm7xxx.c +2 -2
@@ -24,7 +24,7 @@#define MII_BCM7XXX_100TX_FALSE_CAR 0x13#define MII_BCM7XXX_100TX_DISC 0x14#define MII_BCM7XXX_AUX_MODE 0x1d -#define MII_BCM7XX_64CLK_MDIO BIT(12) +#define MII_BCM7XXX_64CLK_MDIO BIT(12)#define MII_BCM7XXX_TEST 0x1f#define MII_BCM7XXX_SHD_MODE_2 BIT(2)
@@ -247,7 +247,7 @@ static int bcm7xxx_config_init(struct phy_device *phydev)int ret;/* Enable 64 clock MDIO */ -phy_write (phydev,MII_BCM7XXX_AUX_MODE ,MII_BCM7XX_64CLK_MDIO ); +phy_write (phydev,MII_BCM7XXX_AUX_MODE ,MII_BCM7XXX_64CLK_MDIO );phy_read (phydev,MII_BCM7XXX_AUX_MODE );/* set shadow mode 2 */
Signature · 1 line
2.1.0
Quoted 7 lines · Florian Fainelli
Hi David,
Here is a collection of fixes for the 40nm Ethernet PHY supported by the 7xxx PHY driver, please also queue these fixes for stable.
Let me know if you think patch 4 is too much of a cleanup to be taken as a fix.
David, if you have not applied these yet (patchwork says they are under review), I have another fix coming your way, and patch 4 should probably be targetted at net-next, and bundled with another cleanup.
Let me know what's the outcome and I will re-submit where appropriate, thanks!
Signature · 1 line
Florian
David Miller
maintainerFrom: Florian Fainelli <[email protected]>
Date: Fri, 5 Feb 2016 17:25:50 -0800
Quoted 9 lines · Florian Fainelli
Quoted 7 lines
Hi David,
Here is a collection of fixes for the 40nm Ethernet PHY supported by the 7xxx PHY driver, please also queue these fixes for stable.
Let me know if you think patch 4 is too much of a cleanup to be taken as a fix.
Quoted 6 lines
David, if you have not applied these yet (patchwork says they are under review), I have another fix coming your way, and patch 4 should probably be targetted at net-next, and bundled with another cleanup.
Let me know what's the outcome and I will re-submit where appropriate, thanks!
I haven't applied any of this so please feel free to resubmit updated versions as needed.
Thanks.