Skip to content

Commit

Permalink
Merge branch 'net-dsa-b53-SGMII-modes-fixes'
Browse files Browse the repository at this point in the history
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: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Sep 22, 2018
2 parents e24cf6b + 55a4d2e commit bd4d08d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions drivers/net/dsa/b53/b53_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -1172,8 +1172,9 @@ int b53_phylink_mac_link_state(struct dsa_switch *ds, int port,
struct b53_device *dev = ds->priv;
int ret = -EOPNOTSUPP;

if (phy_interface_mode_is_8023z(state->interface) &&
dev->ops->serdes_link_state)
if ((phy_interface_mode_is_8023z(state->interface) ||
state->interface == PHY_INTERFACE_MODE_SGMII) &&
dev->ops->serdes_link_state)
ret = dev->ops->serdes_link_state(dev, port, state);

return ret;
Expand All @@ -1195,8 +1196,9 @@ void b53_phylink_mac_config(struct dsa_switch *ds, int port,
return;
}

if (phy_interface_mode_is_8023z(state->interface) &&
dev->ops->serdes_config)
if ((phy_interface_mode_is_8023z(state->interface) ||
state->interface == PHY_INTERFACE_MODE_SGMII) &&
dev->ops->serdes_config)
dev->ops->serdes_config(dev, port, mode, state);
}
EXPORT_SYMBOL(b53_phylink_mac_config);
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/dsa/b53/b53_serdes.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#define SERDES_ID0_REV_LETTER_SHIFT 14

#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

/* SERDES_DIGITAL_CONTROL1 */
Expand Down

0 comments on commit bd4d08d

Please sign in to comment.