summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2018-09-21 20:01:20 -0700
committerDavid S. Miller <davem@davemloft.net>2018-09-21 20:01:20 -0700
commitbd4d08daeb959234a9f8365037b0fefa6ae790c6 (patch)
tree0b20714f23e2af84e5c7478a563fd43d4cdf6dba
parente24cf6b3891ca9f3f2ed2387adeda95e8364bf3e (diff)
parent55a4d2eac327fca4b22544f98d86d6e7b7981913 (diff)
downloadlinux-rt-bd4d08daeb959234a9f8365037b0fefa6ae790c6.tar.gz
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: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/dsa/b53/b53_common.c10
-rw-r--r--drivers/net/dsa/b53/b53_serdes.h2
2 files changed, 7 insertions, 5 deletions
diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c
index dbf5b86a07fe..700d86dd5e13 100644
--- a/drivers/net/dsa/b53/b53_common.c
+++ b/drivers/net/dsa/b53/b53_common.c
@@ -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;
@@ -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);
diff --git a/drivers/net/dsa/b53/b53_serdes.h b/drivers/net/dsa/b53/b53_serdes.h
index eed7c9357091..3bb4f91aec9e 100644
--- a/drivers/net/dsa/b53/b53_serdes.h
+++ b/drivers/net/dsa/b53/b53_serdes.h
@@ -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 */