Skip to content

Commit c732119

Browse files
committed
Merge branch 'net-dsa-b53-fix-bcm63xx-rgmii-user-ports-with-speed-1g'
Jonas Gorski says: ==================== net: dsa: b53: fix bcm63xx rgmii user ports with speed < 1g It seems that the integrated switch in bcm63xx does not support polling external PHYs for link configuration. While the appropriate registers seem to exist with expected content, changing them does nothing. This results in user ports with external PHYs only working in 1000/fd, and not in other modes, despite linking up. Fix this by writing the link result into the port state override register, like we already do for fixed links. With this, ports with lower speeds can successfully transmit and receive packets. This also aligns the behaviour with the old bcm63xx_enetsw driver for those ports. ==================== Link: https://patch.msgid.link/20251101132807.50419-1-jonas.gorski@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 parents 7ed8b63 + 3e4ebdc commit c732119

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

drivers/net/dsa/b53/b53_common.c

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1372,6 +1372,10 @@ static void b53_force_port_config(struct b53_device *dev, int port,
13721372
else
13731373
reg &= ~PORT_OVERRIDE_FULL_DUPLEX;
13741374

1375+
reg &= ~(0x3 << GMII_PO_SPEED_S);
1376+
if (is5301x(dev) || is58xx(dev))
1377+
reg &= ~PORT_OVERRIDE_SPEED_2000M;
1378+
13751379
switch (speed) {
13761380
case 2000:
13771381
reg |= PORT_OVERRIDE_SPEED_2000M;
@@ -1390,6 +1394,11 @@ static void b53_force_port_config(struct b53_device *dev, int port,
13901394
return;
13911395
}
13921396

1397+
if (is5325(dev))
1398+
reg &= ~PORT_OVERRIDE_LP_FLOW_25;
1399+
else
1400+
reg &= ~(PORT_OVERRIDE_RX_FLOW | PORT_OVERRIDE_TX_FLOW);
1401+
13931402
if (rx_pause) {
13941403
if (is5325(dev))
13951404
reg |= PORT_OVERRIDE_LP_FLOW_25;
@@ -1593,8 +1602,11 @@ static void b53_phylink_mac_link_down(struct phylink_config *config,
15931602
struct b53_device *dev = dp->ds->priv;
15941603
int port = dp->index;
15951604

1596-
if (mode == MLO_AN_PHY)
1605+
if (mode == MLO_AN_PHY) {
1606+
if (is63xx(dev) && in_range(port, B53_63XX_RGMII0, 4))
1607+
b53_force_link(dev, port, false);
15971608
return;
1609+
}
15981610

15991611
if (mode == MLO_AN_FIXED) {
16001612
b53_force_link(dev, port, false);
@@ -1622,6 +1634,13 @@ static void b53_phylink_mac_link_up(struct phylink_config *config,
16221634
if (mode == MLO_AN_PHY) {
16231635
/* Re-negotiate EEE if it was enabled already */
16241636
p->eee_enabled = b53_eee_init(ds, port, phydev);
1637+
1638+
if (is63xx(dev) && in_range(port, B53_63XX_RGMII0, 4)) {
1639+
b53_force_port_config(dev, port, speed, duplex,
1640+
tx_pause, rx_pause);
1641+
b53_force_link(dev, port, true);
1642+
}
1643+
16251644
return;
16261645
}
16271646

0 commit comments

Comments
 (0)