Skip to content

Commit 81be43e

Browse files
authored
Merge pull request torvalds#224 from vamrs-feng/linux-5.10-gen-rkr4.1
Changes: * Disable RTL8211F EEE Signed-off-by: Stephen Chen <[email protected]>
2 parents f19a444 + e5d16d8 commit 81be43e

File tree

1 file changed

+26
-3
lines changed

1 file changed

+26
-3
lines changed

drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@
5757
#define STMMAC_ALIGN(x) ALIGN(ALIGN(x, SMP_CACHE_BYTES), 16)
5858
#define TSO_MAX_BUFF_SIZE (SZ_16K - 1)
5959

60-
#define RTL8211F_PHY_ID 0x001cc916
61-
#define RTL8211F_PHY_ID_MASK 0x001fffff
60+
#define RTL8211F_PHY_UID 0x001cc800
61+
#define RTL8211F_PHY_UID_MASK 0x001ffc00
6262
#define RTL8211F_PAGE_SELECT 0x1f
6363
#define RTL8211F_LCR_ADDR 0x10
6464
#define RTL8211F_EEELCR_ADDR 0x11
@@ -5014,6 +5014,22 @@ static int phy_rtl8211f_led_fixup(struct phy_device *phydev)
50145014
return 0;
50155015
}
50165016

5017+
static int phy_rtl8211f_eee_fixup(struct phy_device *phydev)
5018+
{
5019+
phy_write(phydev, 31, 0x0000);
5020+
phy_write(phydev, 0, 0x8000);
5021+
mdelay(20);
5022+
phy_write(phydev, 31, 0x0a4b);
5023+
phy_write(phydev, 17, 0x1110);
5024+
phy_write(phydev, 31, 0x0000);
5025+
phy_write(phydev, 13, 0x0007);
5026+
phy_write(phydev, 14, 0x003c);
5027+
phy_write(phydev, 13, 0x4007);
5028+
phy_write(phydev, 14, 0x0000);
5029+
5030+
return 0;
5031+
}
5032+
50175033
/**
50185034
* stmmac_dvr_probe
50195035
* @device: device pointer
@@ -5251,11 +5267,18 @@ int stmmac_dvr_probe(struct device *device,
52515267
stmmac_init_fs(ndev);
52525268
#endif
52535269

5254-
ret = phy_register_fixup_for_uid(RTL8211F_PHY_ID, RTL8211F_PHY_ID_MASK, phy_rtl8211f_led_fixup);
5270+
/* Register fixup for PHY RTL8211F */
5271+
ret = phy_register_fixup_for_uid(RTL8211F_PHY_UID, RTL8211F_PHY_UID_MASK, phy_rtl8211f_led_fixup);
52555272
if (ret) {
52565273
dev_warn(priv->device, "Failed to register fixup for PHY RTL8211F.\n");
52575274
}
52585275

5276+
/* Register fixup for PHY RTL8211F disabling EEE */
5277+
ret = phy_register_fixup_for_uid(RTL8211F_PHY_UID, RTL8211F_PHY_UID_MASK, phy_rtl8211f_eee_fixup);
5278+
if (ret) {
5279+
dev_warn(priv->device, "Failed to register fixup for PHY RTL8211F disabling EEE.\n");
5280+
}
5281+
52595282
/* Let pm_runtime_put() disable the clocks.
52605283
* If CONFIG_PM is not enabled, the clocks will stay powered.
52615284
*/

0 commit comments

Comments
 (0)