Commit d82f2872 authored by David S. Miller's avatar David S. Miller

Merge branch 'Rate-adaptation-for-Felix-DSA-switch'

Vladimir Oltean says:

====================
Rate adaptation for Felix DSA switch

When operating the MAC at 2.5Gbps (2500Base-X and USXGMII/QSXGMII) and
in combination with certain PHYs, it is possible that the copper side
may operate at lower link speeds. In this case, it is the PHY who has a
MAC inside of it that emits pause frames towards the switch's MAC,
telling it to slow down so that the transmission is lossless.

These patches are the support needed for the switch side of things to
work.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 7f013ede 74984a19
...@@ -172,11 +172,10 @@ static void felix_phylink_validate(struct dsa_switch *ds, int port, ...@@ -172,11 +172,10 @@ static void felix_phylink_validate(struct dsa_switch *ds, int port,
phylink_set(mask, Autoneg); phylink_set(mask, Autoneg);
phylink_set(mask, Pause); phylink_set(mask, Pause);
phylink_set(mask, Asym_Pause); phylink_set(mask, Asym_Pause);
if (state->interface != PHY_INTERFACE_MODE_2500BASEX) { phylink_set(mask, 10baseT_Full);
phylink_set(mask, 10baseT_Full); phylink_set(mask, 100baseT_Full);
phylink_set(mask, 100baseT_Full); phylink_set(mask, 1000baseT_Full);
phylink_set(mask, 1000baseT_Full);
}
/* The internal ports that run at 2.5G are overclocked GMII */ /* The internal ports that run at 2.5G are overclocked GMII */
if (state->interface == PHY_INTERFACE_MODE_GMII || if (state->interface == PHY_INTERFACE_MODE_GMII ||
state->interface == PHY_INTERFACE_MODE_2500BASEX || state->interface == PHY_INTERFACE_MODE_2500BASEX ||
...@@ -222,8 +221,12 @@ static void felix_phylink_mac_config(struct dsa_switch *ds, int port, ...@@ -222,8 +221,12 @@ static void felix_phylink_mac_config(struct dsa_switch *ds, int port,
* specification in incoming pause frames. * specification in incoming pause frames.
*/ */
mac_fc_cfg = SYS_MAC_FC_CFG_FC_LINK_SPEED(state->speed); mac_fc_cfg = SYS_MAC_FC_CFG_FC_LINK_SPEED(state->speed);
if (state->pause & MLO_PAUSE_RX)
mac_fc_cfg |= SYS_MAC_FC_CFG_RX_FC_ENA; /* handle Rx pause in all cases, with 2500base-X this is used for rate
* adaptation.
*/
mac_fc_cfg |= SYS_MAC_FC_CFG_RX_FC_ENA;
if (state->pause & MLO_PAUSE_TX) if (state->pause & MLO_PAUSE_TX)
mac_fc_cfg |= SYS_MAC_FC_CFG_TX_FC_ENA | mac_fc_cfg |= SYS_MAC_FC_CFG_TX_FC_ENA |
SYS_MAC_FC_CFG_PAUSE_VAL_CFG(0xffff) | SYS_MAC_FC_CFG_PAUSE_VAL_CFG(0xffff) |
......
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