Commit 66f86256 authored by Russell King (Oracle)'s avatar Russell King (Oracle) Committed by Paolo Abeni

net: dsa: mt7530: 1G can also support 1000BASE-X link mode

When using an external PHY connected using RGMII to mt7531 port 5, the
PHY can be used to used support 1000BASE-X connections. Moreover, if
1000BASE-T is supported, then we should allow 1000BASE-X as well, since
which are supported is a property of the PHY.

Therefore, it makes no sense to exclude this from the linkmodes when
1000BASE-T is supported.

Fixes: c288575f ("net: dsa: mt7530: Add the support of MT7531 switch")
Tested-by: default avatarMarek Behún <kabel@kernel.org>
Signed-off-by: default avatarRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent 1a915b23
...@@ -2539,13 +2539,7 @@ static void mt7531_sgmii_validate(struct mt7530_priv *priv, int port, ...@@ -2539,13 +2539,7 @@ static void mt7531_sgmii_validate(struct mt7530_priv *priv, int port,
/* Port5 supports ethier RGMII or SGMII. /* Port5 supports ethier RGMII or SGMII.
* Port6 supports SGMII only. * Port6 supports SGMII only.
*/ */
switch (port) { if (port == 6) {
case 5:
if (mt7531_is_rgmii_port(priv, port))
break;
fallthrough;
case 6:
phylink_set(supported, 1000baseX_Full);
phylink_set(supported, 2500baseX_Full); phylink_set(supported, 2500baseX_Full);
phylink_set(supported, 2500baseT_Full); phylink_set(supported, 2500baseT_Full);
} }
...@@ -2913,8 +2907,6 @@ static void ...@@ -2913,8 +2907,6 @@ static void
mt7530_mac_port_validate(struct dsa_switch *ds, int port, mt7530_mac_port_validate(struct dsa_switch *ds, int port,
unsigned long *supported) unsigned long *supported)
{ {
if (port == 5)
phylink_set(supported, 1000baseX_Full);
} }
static void mt7531_mac_port_validate(struct dsa_switch *ds, int port, static void mt7531_mac_port_validate(struct dsa_switch *ds, int port,
...@@ -2951,8 +2943,10 @@ mt753x_phylink_validate(struct dsa_switch *ds, int port, ...@@ -2951,8 +2943,10 @@ mt753x_phylink_validate(struct dsa_switch *ds, int port,
} }
/* This switch only supports 1G full-duplex. */ /* This switch only supports 1G full-duplex. */
if (state->interface != PHY_INTERFACE_MODE_MII) if (state->interface != PHY_INTERFACE_MODE_MII) {
phylink_set(mask, 1000baseT_Full); phylink_set(mask, 1000baseT_Full);
phylink_set(mask, 1000baseX_Full);
}
priv->info->mac_port_validate(ds, port, mask); priv->info->mac_port_validate(ds, port, mask);
......
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