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

Merge branch 'net-dsa-b53-SGMII-modes-fixes'

Florian Fainelli says:

====================
net: dsa: b53: SGMII modes fixes

Here are two additional fixes that are required in order for SGMII to
work correctly. This was discovered with using a copper SFP which would
make us use SGMII mode, we would actually leave the HW configured in its
default mode: Fiber.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents e24cf6b3 55a4d2ea
...@@ -1172,7 +1172,8 @@ int b53_phylink_mac_link_state(struct dsa_switch *ds, int port, ...@@ -1172,7 +1172,8 @@ int b53_phylink_mac_link_state(struct dsa_switch *ds, int port,
struct b53_device *dev = ds->priv; struct b53_device *dev = ds->priv;
int ret = -EOPNOTSUPP; int ret = -EOPNOTSUPP;
if (phy_interface_mode_is_8023z(state->interface) && if ((phy_interface_mode_is_8023z(state->interface) ||
state->interface == PHY_INTERFACE_MODE_SGMII) &&
dev->ops->serdes_link_state) dev->ops->serdes_link_state)
ret = dev->ops->serdes_link_state(dev, port, state); ret = dev->ops->serdes_link_state(dev, port, state);
...@@ -1195,7 +1196,8 @@ void b53_phylink_mac_config(struct dsa_switch *ds, int port, ...@@ -1195,7 +1196,8 @@ void b53_phylink_mac_config(struct dsa_switch *ds, int port,
return; return;
} }
if (phy_interface_mode_is_8023z(state->interface) && if ((phy_interface_mode_is_8023z(state->interface) ||
state->interface == PHY_INTERFACE_MODE_SGMII) &&
dev->ops->serdes_config) dev->ops->serdes_config)
dev->ops->serdes_config(dev, port, mode, state); dev->ops->serdes_config(dev, port, mode, state);
} }
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#define SERDES_ID0_REV_LETTER_SHIFT 14 #define SERDES_ID0_REV_LETTER_SHIFT 14
#define B53_SERDES_MII_REG(x) (0x20 + (x) * 2) #define B53_SERDES_MII_REG(x) (0x20 + (x) * 2)
#define B53_SERDES_DIGITAL_CONTROL(x) (0x18 + (x) * 2) #define B53_SERDES_DIGITAL_CONTROL(x) (0x1e + (x) * 2)
#define B53_SERDES_DIGITAL_STATUS 0x28 #define B53_SERDES_DIGITAL_STATUS 0x28
/* SERDES_DIGITAL_CONTROL1 */ /* SERDES_DIGITAL_CONTROL1 */
......
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