summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@armlinux.org.uk>2020-07-08 12:31:01 +0100
committerRussell King (Oracle) <rmk+kernel@armlinux.org.uk>2022-01-12 12:01:49 +0000
commit9283701d1c1e9e5a87d7423c7b9927b213eb79a3 (patch)
tree636a1dd8a98b0e2e0dd3a52318963e45ba9ca0ef
parent66caadc43649e0e10c01caca6e5fd48b697f7689 (diff)
net: dsa/mv88e6xxx: add support for rate-matching PHYs
Add basic support for rate-matching 10G PHYs for mv88e6xxx - if we are in RXAUI, XAUI or 10GBASE-R mode, the link speed is 10G, even if the media is running at a slower speed. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
-rw-r--r--drivers/net/dsa/mv88e6xxx/chip.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index 60f775c47b58..27abd29316c2 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -809,6 +809,18 @@ static void mv88e6xxx_mac_link_up(struct dsa_switch *ds, int port,
if (err)
goto error;
+ /* The link parameters passed in are the media side parameters.
+ * If in RXAUI, XAUI or 10GBASE-R with a rate matching PHY, we
+ * need to operate our link at 10G. Only full duplex is
+ * supported at this speed.
+ */
+ if (interface == PHY_INTERFACE_MODE_RXAUI ||
+ interface == PHY_INTERFACE_MODE_XAUI ||
+ interface == PHY_INTERFACE_MODE_10GBASER) {
+ speed = SPEED_10000;
+ duplex = DUPLEX_FULL;
+ }
+
if (ops->port_set_speed_duplex) {
err = ops->port_set_speed_duplex(chip, port,
speed, duplex);