@@ -50,6 +50,15 @@ static void r8168g_phy_param(struct phy_device *phydev, u16 parm,
50
50
phy_restore_page (phydev , oldpage , 0 );
51
51
}
52
52
53
+ static void rtl8125_phy_param (struct phy_device * phydev , u16 parm ,
54
+ u16 mask , u16 val )
55
+ {
56
+ phy_lock_mdio_bus (phydev );
57
+ __phy_write_mmd (phydev , MDIO_MMD_VEND2 , 0xb87c , parm );
58
+ __phy_modify_mmd (phydev , MDIO_MMD_VEND2 , 0xb87e , mask , val );
59
+ phy_unlock_mdio_bus (phydev );
60
+ }
61
+
53
62
struct phy_reg {
54
63
u16 reg ;
55
64
u16 val ;
@@ -1004,12 +1013,8 @@ static void rtl8125a_2_hw_phy_config(struct rtl8169_private *tp,
1004
1013
phy_write_paged (phydev , 0xac5 , 0x16 , 0x01ff );
1005
1014
phy_modify_paged (phydev , 0xac8 , 0x15 , 0x00f0 , 0x0030 );
1006
1015
1007
- phy_write (phydev , 0x1f , 0x0b87 );
1008
- phy_write (phydev , 0x16 , 0x80a2 );
1009
- phy_write (phydev , 0x17 , 0x0153 );
1010
- phy_write (phydev , 0x16 , 0x809c );
1011
- phy_write (phydev , 0x17 , 0x0153 );
1012
- phy_write (phydev , 0x1f , 0x0000 );
1016
+ rtl8125_phy_param (phydev , 0x80a2 , 0xffff , 0x0153 );
1017
+ rtl8125_phy_param (phydev , 0x809c , 0xffff , 0x0153 );
1013
1018
1014
1019
phy_write (phydev , 0x1f , 0x0a43 );
1015
1020
phy_write (phydev , 0x13 , 0x81B3 );
@@ -1061,14 +1066,9 @@ static void rtl8125b_hw_phy_config(struct rtl8169_private *tp,
1061
1066
phy_modify_paged (phydev , 0xac4 , 0x13 , 0x00f0 , 0x0090 );
1062
1067
phy_modify_paged (phydev , 0xad3 , 0x10 , 0x0003 , 0x0001 );
1063
1068
1064
- phy_write (phydev , 0x1f , 0x0b87 );
1065
- phy_write (phydev , 0x16 , 0x80f5 );
1066
- phy_write (phydev , 0x17 , 0x760e );
1067
- phy_write (phydev , 0x16 , 0x8107 );
1068
- phy_write (phydev , 0x17 , 0x360e );
1069
- phy_write (phydev , 0x16 , 0x8551 );
1070
- phy_modify (phydev , 0x17 , 0xff00 , 0x0800 );
1071
- phy_write (phydev , 0x1f , 0x0000 );
1069
+ rtl8125_phy_param (phydev , 0x80f5 , 0xffff , 0x760e );
1070
+ rtl8125_phy_param (phydev , 0x8107 , 0xffff , 0x360e );
1071
+ rtl8125_phy_param (phydev , 0x8551 , 0xff00 , 0x0800 );
1072
1072
1073
1073
phy_modify_paged (phydev , 0xbf0 , 0x10 , 0xe000 , 0xa000 );
1074
1074
phy_modify_paged (phydev , 0xbf4 , 0x13 , 0x0f00 , 0x0300 );
@@ -1110,12 +1110,8 @@ static void rtl8125bp_hw_phy_config(struct rtl8169_private *tp,
1110
1110
1111
1111
r8168g_phy_param (phydev , 0x8010 , 0x0800 , 0x0000 );
1112
1112
1113
- phy_write (phydev , 0x1f , 0x0b87 );
1114
- phy_write (phydev , 0x16 , 0x8088 );
1115
- phy_modify (phydev , 0x17 , 0xff00 , 0x9000 );
1116
- phy_write (phydev , 0x16 , 0x808f );
1117
- phy_modify (phydev , 0x17 , 0xff00 , 0x9000 );
1118
- phy_write (phydev , 0x1f , 0x0000 );
1113
+ rtl8125_phy_param (phydev , 0x8088 , 0xff00 , 0x9000 );
1114
+ rtl8125_phy_param (phydev , 0x808f , 0xff00 , 0x9000 );
1119
1115
1120
1116
r8168g_phy_param (phydev , 0x8174 , 0x2000 , 0x1800 );
1121
1117
0 commit comments