File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -1090,6 +1090,28 @@ static int xpcs_get_state_c37_1000basex(struct dw_xpcs *xpcs,
1090
1090
return 0 ;
1091
1091
}
1092
1092
1093
+ static int xpcs_get_state_2500basex (struct dw_xpcs * xpcs ,
1094
+ struct phylink_link_state * state )
1095
+ {
1096
+ int ret ;
1097
+
1098
+ ret = xpcs_read (xpcs , MDIO_MMD_VEND2 , DW_VR_MII_MMD_STS );
1099
+ if (ret < 0 ) {
1100
+ state -> link = 0 ;
1101
+ return ret ;
1102
+ }
1103
+
1104
+ state -> link = !!(ret & DW_VR_MII_MMD_STS_LINK_STS );
1105
+ if (!state -> link )
1106
+ return 0 ;
1107
+
1108
+ state -> speed = SPEED_2500 ;
1109
+ state -> pause |= MLO_PAUSE_TX | MLO_PAUSE_RX ;
1110
+ state -> duplex = DUPLEX_FULL ;
1111
+
1112
+ return 0 ;
1113
+ }
1114
+
1093
1115
static void xpcs_get_state (struct phylink_pcs * pcs ,
1094
1116
struct phylink_link_state * state )
1095
1117
{
@@ -1127,6 +1149,13 @@ static void xpcs_get_state(struct phylink_pcs *pcs,
1127
1149
ERR_PTR (ret ));
1128
1150
}
1129
1151
break ;
1152
+ case DW_2500BASEX :
1153
+ ret = xpcs_get_state_2500basex (xpcs , state );
1154
+ if (ret ) {
1155
+ pr_err ("xpcs_get_state_2500basex returned %pe\n" ,
1156
+ ERR_PTR (ret ));
1157
+ }
1158
+ break ;
1130
1159
default :
1131
1160
return ;
1132
1161
}
Original file line number Diff line number Diff line change 55
55
/* Clause 37 Defines */
56
56
/* VR MII MMD registers offsets */
57
57
#define DW_VR_MII_MMD_CTRL 0x0000
58
+ #define DW_VR_MII_MMD_STS 0x0001
59
+ #define DW_VR_MII_MMD_STS_LINK_STS BIT(2)
58
60
#define DW_VR_MII_DIG_CTRL1 0x8000
59
61
#define DW_VR_MII_AN_CTRL 0x8001
60
62
#define DW_VR_MII_AN_INTR_STS 0x8002
You can’t perform that action at this time.
0 commit comments