if (sfp_base[AXGBE_SFP_BASE_EXT_ID] != AXGBE_SFP_EXT_ID_SFP)
return;
- if (axgbe_phy_sfp_parse_quirks(pdata))
- return;
+ axgbe_phy_sfp_parse_quirks(pdata);
/* Assume ACTIVE cable unless told it is PASSIVE */
if (sfp_base[AXGBE_SFP_BASE_CABLE] & AXGBE_SFP_BASE_CABLE_PASSIVE) {
phy_data->cur_mode = AXGBE_MODE_KR;
}
+static void axgbe_phy_kx_2500_mode(struct axgbe_port *pdata)
+{
+ struct axgbe_phy_data *phy_data = pdata->phy_data;
+ unsigned int s0;
+
+ axgbe_phy_set_redrv_mode(pdata);
+ /* 2.5G/KX */
+ axgbe_phy_start_ratechange(pdata);
+ s0 = 0;
+ XP_SET_BITS(s0, XP_DRIVER_SCRATCH_0, COMMAND, 2);
+ XP_SET_BITS(s0, XP_DRIVER_SCRATCH_0, SUB_COMMAND, 0);
+
+ XP_IOWRITE(pdata, XP_DRIVER_SCRATCH_0, s0);
+ XP_IOWRITE(pdata, XP_DRIVER_SCRATCH_1, 0);
+
+ XP_IOWRITE_BITS(pdata, XP_DRIVER_INT_REQ, REQUEST, 1);
+
+ phy_data->cur_mode = AXGBE_MODE_KX_2500;
+}
+
+static void axgbe_phy_sgmii_1000_mode(struct axgbe_port *pdata)
+{
+ struct axgbe_phy_data *phy_data = pdata->phy_data;
+ unsigned int s0;
+
+ axgbe_phy_set_redrv_mode(pdata);
+
+ /* 1G/SGMII */
+ axgbe_phy_start_ratechange(pdata);
+ s0 = 0;
+ XP_SET_BITS(s0, XP_DRIVER_SCRATCH_0, COMMAND, 1);
+ XP_SET_BITS(s0, XP_DRIVER_SCRATCH_0, SUB_COMMAND, 2);
+
+ XP_IOWRITE(pdata, XP_DRIVER_SCRATCH_0, s0);
+ XP_IOWRITE(pdata, XP_DRIVER_SCRATCH_1, 0);
+
+ XP_IOWRITE_BITS(pdata, XP_DRIVER_INT_REQ, REQUEST, 1);
+
+ phy_data->cur_mode = AXGBE_MODE_SGMII_1000;
+}
+
static enum axgbe_mode axgbe_phy_cur_mode(struct axgbe_port *pdata)
{
struct axgbe_phy_data *phy_data = pdata->phy_data;
case AXGBE_MODE_SFI:
axgbe_phy_sfi_mode(pdata);
break;
+ case AXGBE_MODE_KX_2500:
+ axgbe_phy_kx_2500_mode(pdata);
+ break;
+ case AXGBE_MODE_SGMII_1000:
+ axgbe_phy_sgmii_1000_mode(pdata);
+ break;
default:
break;
}