@@ -274,7 +274,6 @@ struct mvebu_a3700_comphy_lane {
274
274
int submode ;
275
275
bool invert_tx ;
276
276
bool invert_rx ;
277
- bool needs_reset ;
278
277
};
279
278
280
279
struct gbe_phy_init_data_fix {
@@ -1097,40 +1096,12 @@ mvebu_a3700_comphy_pcie_power_off(struct mvebu_a3700_comphy_lane *lane)
1097
1096
0x0 , PU_PLL_BIT | PU_RX_BIT | PU_TX_BIT );
1098
1097
}
1099
1098
1100
- static int mvebu_a3700_comphy_reset (struct phy * phy )
1099
+ static void mvebu_a3700_comphy_usb3_power_off (struct mvebu_a3700_comphy_lane * lane )
1101
1100
{
1102
- struct mvebu_a3700_comphy_lane * lane = phy_get_drvdata (phy );
1103
- u16 mask , data ;
1104
-
1105
- dev_dbg (lane -> dev , "resetting lane %d\n" , lane -> id );
1106
-
1107
- /* COMPHY reset for internal logic */
1108
- comphy_lane_reg_set (lane , COMPHY_SFT_RESET ,
1109
- SFT_RST_NO_REG , SFT_RST_NO_REG );
1110
-
1111
- /* COMPHY register reset (cleared automatically) */
1112
- comphy_lane_reg_set (lane , COMPHY_SFT_RESET , SFT_RST , SFT_RST );
1113
-
1114
- /* PIPE soft and register reset */
1115
- data = PIPE_SOFT_RESET | PIPE_REG_RESET ;
1116
- mask = data ;
1117
- comphy_lane_reg_set (lane , COMPHY_PIPE_RST_CLK_CTRL , data , mask );
1118
-
1119
- /* Release PIPE register reset */
1120
- comphy_lane_reg_set (lane , COMPHY_PIPE_RST_CLK_CTRL ,
1121
- 0x0 , PIPE_REG_RESET );
1122
-
1123
- /* Reset SB configuration register (only for lanes 0 and 1) */
1124
- if (lane -> id == 0 || lane -> id == 1 ) {
1125
- u32 mask , data ;
1126
-
1127
- data = PIN_RESET_CORE_BIT | PIN_RESET_COMPHY_BIT |
1128
- PIN_PU_PLL_BIT | PIN_PU_RX_BIT | PIN_PU_TX_BIT ;
1129
- mask = data | PIN_PU_IVREF_BIT | PIN_TX_IDLE_BIT ;
1130
- comphy_periph_reg_set (lane , COMPHY_PHY_CFG1 , data , mask );
1131
- }
1132
-
1133
- return 0 ;
1101
+ /*
1102
+ * The USB3 MAC sets the USB3 PHY to low state, so we do not
1103
+ * need to power off USB3 PHY again.
1104
+ */
1134
1105
}
1135
1106
1136
1107
static bool mvebu_a3700_comphy_check_mode (int lane ,
@@ -1171,10 +1142,6 @@ static int mvebu_a3700_comphy_set_mode(struct phy *phy, enum phy_mode mode,
1171
1142
(lane -> mode != mode || lane -> submode != submode ))
1172
1143
return - EBUSY ;
1173
1144
1174
- /* If changing mode, ensure reset is called */
1175
- if (lane -> mode != PHY_MODE_INVALID && lane -> mode != mode )
1176
- lane -> needs_reset = true;
1177
-
1178
1145
/* Just remember the mode, ->power_on() will do the real setup */
1179
1146
lane -> mode = mode ;
1180
1147
lane -> submode = submode ;
@@ -1185,22 +1152,13 @@ static int mvebu_a3700_comphy_set_mode(struct phy *phy, enum phy_mode mode,
1185
1152
static int mvebu_a3700_comphy_power_on (struct phy * phy )
1186
1153
{
1187
1154
struct mvebu_a3700_comphy_lane * lane = phy_get_drvdata (phy );
1188
- int ret ;
1189
1155
1190
1156
if (!mvebu_a3700_comphy_check_mode (lane -> id , lane -> mode ,
1191
1157
lane -> submode )) {
1192
1158
dev_err (lane -> dev , "invalid COMPHY mode\n" );
1193
1159
return - EINVAL ;
1194
1160
}
1195
1161
1196
- if (lane -> needs_reset ) {
1197
- ret = mvebu_a3700_comphy_reset (phy );
1198
- if (ret )
1199
- return ret ;
1200
-
1201
- lane -> needs_reset = false;
1202
- }
1203
-
1204
1162
switch (lane -> mode ) {
1205
1163
case PHY_MODE_USB_HOST_SS :
1206
1164
dev_dbg (lane -> dev , "set lane %d to USB3 host mode\n" , lane -> id );
@@ -1224,38 +1182,28 @@ static int mvebu_a3700_comphy_power_off(struct phy *phy)
1224
1182
{
1225
1183
struct mvebu_a3700_comphy_lane * lane = phy_get_drvdata (phy );
1226
1184
1227
- switch (lane -> mode ) {
1228
- case PHY_MODE_USB_HOST_SS :
1229
- /*
1230
- * The USB3 MAC sets the USB3 PHY to low state, so we do not
1231
- * need to power off USB3 PHY again.
1232
- */
1233
- break ;
1234
-
1235
- case PHY_MODE_SATA :
1236
- mvebu_a3700_comphy_sata_power_off (lane );
1237
- break ;
1238
-
1239
- case PHY_MODE_ETHERNET :
1185
+ switch (lane -> id ) {
1186
+ case 0 :
1187
+ mvebu_a3700_comphy_usb3_power_off (lane );
1240
1188
mvebu_a3700_comphy_ethernet_power_off (lane );
1241
- break ;
1242
-
1243
- case PHY_MODE_PCIE :
1189
+ return 0 ;
1190
+ case 1 :
1244
1191
mvebu_a3700_comphy_pcie_power_off (lane );
1245
- break ;
1246
-
1192
+ mvebu_a3700_comphy_ethernet_power_off (lane );
1193
+ return 0 ;
1194
+ case 2 :
1195
+ mvebu_a3700_comphy_usb3_power_off (lane );
1196
+ mvebu_a3700_comphy_sata_power_off (lane );
1197
+ return 0 ;
1247
1198
default :
1248
1199
dev_err (lane -> dev , "invalid COMPHY mode\n" );
1249
1200
return - EINVAL ;
1250
1201
}
1251
-
1252
- return 0 ;
1253
1202
}
1254
1203
1255
1204
static const struct phy_ops mvebu_a3700_comphy_ops = {
1256
1205
.power_on = mvebu_a3700_comphy_power_on ,
1257
1206
.power_off = mvebu_a3700_comphy_power_off ,
1258
- .reset = mvebu_a3700_comphy_reset ,
1259
1207
.set_mode = mvebu_a3700_comphy_set_mode ,
1260
1208
.owner = THIS_MODULE ,
1261
1209
};
@@ -1393,8 +1341,7 @@ static int mvebu_a3700_comphy_probe(struct platform_device *pdev)
1393
1341
* To avoid relying on the bootloader/firmware configuration,
1394
1342
* power off all comphys.
1395
1343
*/
1396
- mvebu_a3700_comphy_reset (phy );
1397
- lane -> needs_reset = false;
1344
+ mvebu_a3700_comphy_power_off (phy );
1398
1345
}
1399
1346
1400
1347
provider = devm_of_phy_provider_register (& pdev -> dev ,
0 commit comments