Skip to contentSkip to conversation

net: phy: bcm7xxx 40nm PHY fixes

PATCH In review Florian Fainelli 2 participants 6 messages Feb 6, 2016 – Feb 16, 2016

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

v2 cover net: phy: bcm7xxx 40nm PHY fixes

From: Florian Fainelli <[email protected]>

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.

Changes in v2:

- dropped the cleanup patch, not appropriate
- added another patch removing bogus wildcard entries

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: Remove wildcard entries

 drivers/net/phy/bcm7xxx.c |   43 ++++---------------------------------------
 1 files changed, 4 insertions(+), 39 deletions(-)
#1 lore raw

PATCH v2 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.

Fixes b560a58c45c66 ("net: phy: add Broadcom BCM7xxx internal PHY driver")
---
 drivers/net/phy/bcm7xxx.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/phy/bcm7xxx.c +1 -1
index bf241a3..234a285 100644
@@ -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
1.7.1
#2 lore raw

PATCH v2 2/4 net: phy: bcm7xxx: Fix 40nm EPHY features

In reply to Florian Fainelli

The 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.

Fixes d068b02cfdfc2 ("net: phy: add BCM7425 and BCM7429 PHYs")
Fixes 9458ceab4917 ("net: phy: bcm7xxx: Add entry for BCM7435")
---
 drivers/net/phy/bcm7xxx.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/phy/bcm7xxx.c +3 -3
index 234a285..524806d 100644
@@ -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
1.7.1
#3 lore raw

PATCH v2 3/4 net: phy: bcm7xxx: Fix bcm7xxx_config_init() check

In reply to Florian Fainelli

Since 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.

Fixes e18556ee3bd83 ("net: phy: bcm7xxx: do not use PHY_BRCM_100MBPS_WAR")
---
 drivers/net/phy/bcm7xxx.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)
drivers/net/phy/bcm7xxx.c +0 -4
index 524806d..568768a 100644
@@ -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
1.7.1
#4 lore raw

PATCH v2 4/4 net: phy: bcm7xxx: Remove wildcard entries

In reply to Florian Fainelli

Remove the two wildcard entries, they serve no purpose and will match way too many devices, some of them being covered by the driver in drivers/net/phy/broadcom.c. Remove the now unused bcm7xxx_dummy_config_init() function which would produce a warning.

Fixes b560a58c45c6 ("net: phy: add Broadcom BCM7xxx internal PHY driver")
---
 drivers/net/phy/bcm7xxx.c |   31 -------------------------------
 1 files changed, 0 insertions(+), 31 deletions(-)
drivers/net/phy/bcm7xxx.c +0 -31
index 568768a..db507e3 100644
@@ -303,11 +303,6 @@ static int bcm7xxx_suspend(struct phy_device *phydev)
 	return 0;
 }
 
-static int bcm7xxx_dummy_config_init(struct phy_device *phydev)
-{
-	return 0;
-}
-
 #define BCM7XXX_28NM_GPHY(_oui, _name)					\
 {									\
 	.phy_id		= (_oui),					\
@@ -365,30 +360,6 @@ static struct phy_driver bcm7xxx_driver[] = {
 	.read_status    = genphy_read_status,
 	.suspend        = bcm7xxx_suspend,
 	.resume         = bcm7xxx_config_init,
-}, {
-	.phy_id		= PHY_BCM_OUI_4,
-	.phy_id_mask	= 0xffff0000,
-	.name		= "Broadcom BCM7XXX 40nm",
-	.features	= PHY_GBIT_FEATURES |
-			  SUPPORTED_Pause | SUPPORTED_Asym_Pause,
-	.flags		= PHY_IS_INTERNAL,
-	.config_init	= bcm7xxx_config_init,
-	.config_aneg	= genphy_config_aneg,
-	.read_status	= genphy_read_status,
-	.suspend	= bcm7xxx_suspend,
-	.resume		= bcm7xxx_config_init,
-}, {
-	.phy_id		= PHY_BCM_OUI_5,
-	.phy_id_mask	= 0xffffff00,
-	.name		= "Broadcom BCM7XXX 65nm",
-	.features	= PHY_BASIC_FEATURES |
-			  SUPPORTED_Pause | SUPPORTED_Asym_Pause,
-	.flags		= PHY_IS_INTERNAL,
-	.config_init	= bcm7xxx_dummy_config_init,
-	.config_aneg	= genphy_config_aneg,
-	.read_status	= genphy_read_status,
-	.suspend	= bcm7xxx_suspend,
-	.resume		= bcm7xxx_config_init,
 } };
 
 static struct mdio_device_id __maybe_unused bcm7xxx_tbl[] = {
@@ -400,8 +371,6 @@ static struct mdio_device_id __maybe_unused bcm7xxx_tbl[] = {
 	{ PHY_ID_BCM7439, 0xfffffff0, },
 	{ PHY_ID_BCM7435, 0xfffffff0, },
 	{ PHY_ID_BCM7445, 0xfffffff0, },
-	{ PHY_BCM_OUI_4, 0xffff0000 },
-	{ PHY_BCM_OUI_5, 0xffffff00 },
 	{ }
 };
 
Signature · 1 line
1.7.1
maintainer
#5 lore raw
In reply to Florian Fainelli

From: Florian Fainelli <[email protected]>
Date: Sat, 6 Feb 2016 12:58:47 -0800

Quoted 7 lines

Here is a collection of fixes for the 40nm Ethernet PHY supported by the 7xxx PHY driver, please also queue these fixes for stable.

Changes in v2:

- dropped the cleanup patch, not appropriate
- added another patch removing bogus wildcard entries

Series applied, thanks Florian.