Skip to content

Commit cd6f12e

Browse files
oleremkuba-moo
authored andcommitted
net: phy: dp83tg720: wake up PHYs in managed mode
In case this PHY is bootstrapped for managed mode, we need to manually wake it. Otherwise no link will be detected. Cc: [email protected] Fixes: cb80ee2 ("net: phy: Add support for the DP83TG720S Ethernet PHY") Signed-off-by: Oleksij Rempel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent e2b447c commit cd6f12e

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

drivers/net/phy/dp83tg720.c

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@
1717
#define DP83TG720S_PHY_RESET 0x1f
1818
#define DP83TG720S_HW_RESET BIT(15)
1919

20+
#define DP83TG720S_LPS_CFG3 0x18c
21+
/* Power modes are documented as bit fields but used as values */
22+
/* Power Mode 0 is Normal mode */
23+
#define DP83TG720S_LPS_CFG3_PWR_MODE_0 BIT(0)
24+
2025
#define DP83TG720S_RGMII_DELAY_CTRL 0x602
2126
/* In RGMII mode, Enable or disable the internal delay for RXD */
2227
#define DP83TG720S_RGMII_RX_CLK_SEL BIT(1)
@@ -154,10 +159,17 @@ static int dp83tg720_config_init(struct phy_device *phydev)
154159
*/
155160
usleep_range(1000, 2000);
156161

157-
if (phy_interface_is_rgmii(phydev))
158-
return dp83tg720_config_rgmii_delay(phydev);
162+
if (phy_interface_is_rgmii(phydev)) {
163+
ret = dp83tg720_config_rgmii_delay(phydev);
164+
if (ret)
165+
return ret;
166+
}
159167

160-
return 0;
168+
/* In case the PHY is bootstrapped in managed mode, we need to
169+
* wake it.
170+
*/
171+
return phy_write_mmd(phydev, MDIO_MMD_VEND2, DP83TG720S_LPS_CFG3,
172+
DP83TG720S_LPS_CFG3_PWR_MODE_0);
161173
}
162174

163175
static struct phy_driver dp83tg720_driver[] = {

0 commit comments

Comments
 (0)