Thread (8 messages) 8 messages, 3 authors, 2019-12-18

Re: [PATCH v2 1/4] micrel: fix config_aneg for ksz886x

From: Florian Fainelli <f.fainelli@gmail.com>
Date: 2019-12-18 20:11:55

On 12/18/19 12:08 PM, Michael Grzeschik wrote:
The third port of the ksz886x is fixed to be connected to the
cpu. This port has no possibility to do auto negotiation.
Then this may not the PHY driver you would want to use, but rather use a
fixed-link which would use the Generic PHY driver and take care of
setting the appropriate speed/duplex/pause settings the way you defined
them in Device Tree.
quoted hunk ↗ jump to hunk
Signed-off-by: Michael Grzeschik <redacted>
---
 drivers/net/phy/micrel.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
index 63dedec0433de..913a8b68da350 100644
--- a/drivers/net/phy/micrel.c
+++ b/drivers/net/phy/micrel.c
@@ -841,6 +841,16 @@ static int ksz8873mll_config_aneg(struct phy_device *phydev)
 	return 0;
 }
 
+static int ksz886x_config_aneg(struct phy_device *phydev)
+{
+	if (phydev->mdio.addr == 3) {
+		phydev->autoneg = AUTONEG_DISABLE;
+		genphy_read_status(phydev);
+	}
+
+	return genphy_config_aneg(phydev);
+}
+
 static int kszphy_get_sset_count(struct phy_device *phydev)
 {
 	return ARRAY_SIZE(kszphy_hw_stats);
@@ -1171,6 +1181,7 @@ static struct phy_driver ksphy_driver[] = {
 	.name		= "Micrel KSZ886X Switch",
 	/* PHY_BASIC_FEATURES */
 	.config_init	= kszphy_config_init,
+	.config_aneg	= ksz886x_config_aneg,
 	.suspend	= genphy_suspend,
 	.resume		= genphy_resume,
 }, {

-- 
Florian
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help