Commit 3ee217c4 authored by Raju Rangoju's avatar Raju Rangoju Committed by Paolo Abeni

amd-xgbe: add 2.5GbE support to 10G BaseT mode

Add support to the driver to fully recognize and enable 2.5GbE speed in
10GBaseT mode.
Acked-by: default avatarShyam Sundar S K <Shyam-sundar.S-k@amd.com>
Signed-off-by: default avatarRaju Rangoju <Raju.Rangoju@amd.com>
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent 8b6f322e
...@@ -1882,6 +1882,9 @@ static void xgbe_phy_an_advertising(struct xgbe_prv_data *pdata, ...@@ -1882,6 +1882,9 @@ static void xgbe_phy_an_advertising(struct xgbe_prv_data *pdata,
if (phy_data->phydev && if (phy_data->phydev &&
(phy_data->phydev->speed == SPEED_10000)) (phy_data->phydev->speed == SPEED_10000))
XGBE_SET_ADV(dlks, 10000baseKR_Full); XGBE_SET_ADV(dlks, 10000baseKR_Full);
else if (phy_data->phydev &&
(phy_data->phydev->speed == SPEED_2500))
XGBE_SET_ADV(dlks, 2500baseX_Full);
else else
XGBE_SET_ADV(dlks, 1000baseKX_Full); XGBE_SET_ADV(dlks, 1000baseKX_Full);
break; break;
...@@ -2282,9 +2285,11 @@ static enum xgbe_mode xgbe_phy_switch_baset_mode(struct xgbe_prv_data *pdata) ...@@ -2282,9 +2285,11 @@ static enum xgbe_mode xgbe_phy_switch_baset_mode(struct xgbe_prv_data *pdata)
case XGBE_MODE_SGMII_100: case XGBE_MODE_SGMII_100:
case XGBE_MODE_SGMII_1000: case XGBE_MODE_SGMII_1000:
return XGBE_MODE_KR; return XGBE_MODE_KR;
case XGBE_MODE_KX_2500:
return XGBE_MODE_SGMII_1000;
case XGBE_MODE_KR: case XGBE_MODE_KR:
default: default:
return XGBE_MODE_SGMII_1000; return XGBE_MODE_KX_2500;
} }
} }
...@@ -2644,7 +2649,8 @@ static bool xgbe_phy_valid_speed_baset_mode(struct xgbe_prv_data *pdata, ...@@ -2644,7 +2649,8 @@ static bool xgbe_phy_valid_speed_baset_mode(struct xgbe_prv_data *pdata,
case SPEED_1000: case SPEED_1000:
return true; return true;
case SPEED_2500: case SPEED_2500:
return (phy_data->port_mode == XGBE_PORT_MODE_NBASE_T); return ((phy_data->port_mode == XGBE_PORT_MODE_10GBASE_T) ||
(phy_data->port_mode == XGBE_PORT_MODE_NBASE_T));
case SPEED_10000: case SPEED_10000:
return (phy_data->port_mode == XGBE_PORT_MODE_10GBASE_T); return (phy_data->port_mode == XGBE_PORT_MODE_10GBASE_T);
default: default:
...@@ -3024,6 +3030,7 @@ static bool xgbe_phy_port_mode_mismatch(struct xgbe_prv_data *pdata) ...@@ -3024,6 +3030,7 @@ static bool xgbe_phy_port_mode_mismatch(struct xgbe_prv_data *pdata)
if ((phy_data->port_speeds & XGBE_PHY_PORT_SPEED_10) || if ((phy_data->port_speeds & XGBE_PHY_PORT_SPEED_10) ||
(phy_data->port_speeds & XGBE_PHY_PORT_SPEED_100) || (phy_data->port_speeds & XGBE_PHY_PORT_SPEED_100) ||
(phy_data->port_speeds & XGBE_PHY_PORT_SPEED_1000) || (phy_data->port_speeds & XGBE_PHY_PORT_SPEED_1000) ||
(phy_data->port_speeds & XGBE_PHY_PORT_SPEED_2500) ||
(phy_data->port_speeds & XGBE_PHY_PORT_SPEED_10000)) (phy_data->port_speeds & XGBE_PHY_PORT_SPEED_10000))
return false; return false;
break; break;
...@@ -3474,6 +3481,10 @@ static int xgbe_phy_init(struct xgbe_prv_data *pdata) ...@@ -3474,6 +3481,10 @@ static int xgbe_phy_init(struct xgbe_prv_data *pdata)
XGBE_SET_SUP(lks, 1000baseT_Full); XGBE_SET_SUP(lks, 1000baseT_Full);
phy_data->start_mode = XGBE_MODE_SGMII_1000; phy_data->start_mode = XGBE_MODE_SGMII_1000;
} }
if (phy_data->port_speeds & XGBE_PHY_PORT_SPEED_2500) {
XGBE_SET_SUP(lks, 2500baseT_Full);
phy_data->start_mode = XGBE_MODE_KX_2500;
}
if (phy_data->port_speeds & XGBE_PHY_PORT_SPEED_10000) { if (phy_data->port_speeds & XGBE_PHY_PORT_SPEED_10000) {
XGBE_SET_SUP(lks, 10000baseT_Full); XGBE_SET_SUP(lks, 10000baseT_Full);
phy_data->start_mode = XGBE_MODE_KR; phy_data->start_mode = XGBE_MODE_KR;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment