Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: phy: dp83867: Set FORCE_LINK_GOOD to default after reset

According to the Datasheet this bit should be 0 (Normal operation) in
default. With the FORCE_LINK_GOOD bit set, it is not possible to get a
link. This patch sets FORCE_LINK_GOOD to the default value after
resetting the phy.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Michael Grzeschik and committed by
David S. Miller
86ffe920 49edd6a2

+7 -1
+7 -1
drivers/net/phy/dp83867.c
··· 97 97 #define DP83867_PHYCR_FIFO_DEPTH_MAX 0x03 98 98 #define DP83867_PHYCR_FIFO_DEPTH_MASK GENMASK(15, 14) 99 99 #define DP83867_PHYCR_RESERVED_MASK BIT(11) 100 + #define DP83867_PHYCR_FORCE_LINK_GOOD BIT(10) 100 101 101 102 /* RGMIIDCTL bits */ 102 103 #define DP83867_RGMII_TX_CLK_DELAY_MAX 0xf ··· 600 599 601 600 usleep_range(10, 20); 602 601 603 - return 0; 602 + /* After reset FORCE_LINK_GOOD bit is set. Although the 603 + * default value should be unset. Disable FORCE_LINK_GOOD 604 + * for the phy to work properly. 605 + */ 606 + return phy_modify(phydev, MII_DP83867_PHYCTRL, 607 + DP83867_PHYCR_FORCE_LINK_GOOD, 0); 604 608 } 605 609 606 610 static struct phy_driver dp83867_driver[] = {