Commit 6512204b authored by Arınç ÜNAL's avatar Arınç ÜNAL Committed by David S. Miller

net: dsa: mt7530: define MAC speed capabilities per switch model

With the support of the MT7988 SoC switch, the MAC speed capabilities
defined on mt753x_phylink_get_caps() won't apply to all switch models
anymore. Move them to more appropriate locations instead of overwriting
config->mac_capabilities.

Remove the comment on mt753x_phylink_get_caps() as it's become invalid with
the support of MT7531 and MT7988 SoC switch.

Add break to case 6 of mt7988_mac_port_get_caps() to be explicit.
Signed-off-by: default avatarArınç ÜNAL <arinc.unal@arinc9.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7bf06bcd
...@@ -2685,6 +2685,8 @@ mt7531_setup(struct dsa_switch *ds) ...@@ -2685,6 +2685,8 @@ mt7531_setup(struct dsa_switch *ds)
static void mt7530_mac_port_get_caps(struct dsa_switch *ds, int port, static void mt7530_mac_port_get_caps(struct dsa_switch *ds, int port,
struct phylink_config *config) struct phylink_config *config)
{ {
config->mac_capabilities |= MAC_10 | MAC_100 | MAC_1000FD;
switch (port) { switch (port) {
/* Ports which are connected to switch PHYs. There is no MII pinout. */ /* Ports which are connected to switch PHYs. There is no MII pinout. */
case 0 ... 4: case 0 ... 4:
...@@ -2716,6 +2718,8 @@ static void mt7531_mac_port_get_caps(struct dsa_switch *ds, int port, ...@@ -2716,6 +2718,8 @@ static void mt7531_mac_port_get_caps(struct dsa_switch *ds, int port,
{ {
struct mt7530_priv *priv = ds->priv; struct mt7530_priv *priv = ds->priv;
config->mac_capabilities |= MAC_10 | MAC_100 | MAC_1000FD;
switch (port) { switch (port) {
/* Ports which are connected to switch PHYs. There is no MII pinout. */ /* Ports which are connected to switch PHYs. There is no MII pinout. */
case 0 ... 4: case 0 ... 4:
...@@ -2755,14 +2759,17 @@ static void mt7988_mac_port_get_caps(struct dsa_switch *ds, int port, ...@@ -2755,14 +2759,17 @@ static void mt7988_mac_port_get_caps(struct dsa_switch *ds, int port,
case 0 ... 3: case 0 ... 3:
__set_bit(PHY_INTERFACE_MODE_INTERNAL, __set_bit(PHY_INTERFACE_MODE_INTERNAL,
config->supported_interfaces); config->supported_interfaces);
config->mac_capabilities |= MAC_10 | MAC_100 | MAC_1000FD;
break; break;
/* Port 6 is connected to SoC's XGMII MAC. There is no MII pinout. */ /* Port 6 is connected to SoC's XGMII MAC. There is no MII pinout. */
case 6: case 6:
__set_bit(PHY_INTERFACE_MODE_INTERNAL, __set_bit(PHY_INTERFACE_MODE_INTERNAL,
config->supported_interfaces); config->supported_interfaces);
config->mac_capabilities = MAC_ASYM_PAUSE | MAC_SYM_PAUSE |
MAC_10000FD; config->mac_capabilities |= MAC_10000FD;
break;
} }
} }
...@@ -2932,9 +2939,7 @@ static void mt753x_phylink_get_caps(struct dsa_switch *ds, int port, ...@@ -2932,9 +2939,7 @@ static void mt753x_phylink_get_caps(struct dsa_switch *ds, int port,
{ {
struct mt7530_priv *priv = ds->priv; struct mt7530_priv *priv = ds->priv;
/* This switch only supports full-duplex at 1Gbps */ config->mac_capabilities = MAC_ASYM_PAUSE | MAC_SYM_PAUSE;
config->mac_capabilities = MAC_ASYM_PAUSE | MAC_SYM_PAUSE |
MAC_10 | MAC_100 | MAC_1000FD;
priv->info->mac_port_get_caps(ds, port, config); priv->info->mac_port_get_caps(ds, port, config);
} }
......
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