* [PATCH net 0/2] net: dsa: b53: fix bcm63xx rgmii user ports with speed < 1g
@ 2025-11-01 13:28 Jonas Gorski
2025-11-01 13:28 ` [PATCH net 1/2] net: dsa: b53: fix resetting speed and pause on forced link Jonas Gorski
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Jonas Gorski @ 2025-11-01 13:28 UTC (permalink / raw)
To: Florian Fainelli, Andrew Lunn, Vladimir Oltean, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni
Cc: Florian Fainelli, netdev, linux-kernel
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.
Jonas Gorski (2):
net: dsa: b53: fix resetting speed and pause on forced link
net: dsa: b53: fix bcm63xx RGMII port link adjustment
drivers/net/dsa/b53/b53_common.c | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
base-commit: d7d2fcf7ae31471b4e08b7e448b8fd0ec2e06a1b
--
2.43.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH net 1/2] net: dsa: b53: fix resetting speed and pause on forced link
2025-11-01 13:28 [PATCH net 0/2] net: dsa: b53: fix bcm63xx rgmii user ports with speed < 1g Jonas Gorski
@ 2025-11-01 13:28 ` Jonas Gorski
2025-11-03 16:48 ` Florian Fainelli
2025-11-01 13:28 ` [PATCH net 2/2] net: dsa: b53: fix bcm63xx RGMII port link adjustment Jonas Gorski
2025-11-04 1:10 ` [PATCH net 0/2] net: dsa: b53: fix bcm63xx rgmii user ports with speed < 1g patchwork-bot+netdevbpf
2 siblings, 1 reply; 6+ messages in thread
From: Jonas Gorski @ 2025-11-01 13:28 UTC (permalink / raw)
To: Florian Fainelli, Andrew Lunn, Vladimir Oltean, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni
Cc: Florian Fainelli, netdev, linux-kernel
There is no guarantee that the port state override registers have their
default values, as not all switches support being reset via register or
have a reset GPIO.
So when forcing port config, we need to make sure to clear all fields,
which we currently do not do for the speed and flow control
configuration. This can cause flow control stay enabled, or in the case
of speed becoming an illegal value, e.g. configured for 1G (0x2), then
setting 100M (0x1), results in 0x3 which is invalid.
For PORT_OVERRIDE_SPEED_2000M we need to make sure to only clear it on
supported chips, as the bit can have different meanings on other chips,
e.g. for BCM5389 this controls scanning PHYs for link/speed
configuration.
Fixes: 5e004460f874 ("net: dsa: b53: Add helper to set link parameters")
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
---
drivers/net/dsa/b53/b53_common.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c
index 2f846381d5a7..cb28256ef3cc 100644
--- a/drivers/net/dsa/b53/b53_common.c
+++ b/drivers/net/dsa/b53/b53_common.c
@@ -1372,6 +1372,10 @@ static void b53_force_port_config(struct b53_device *dev, int port,
else
reg &= ~PORT_OVERRIDE_FULL_DUPLEX;
+ reg &= ~(0x3 << GMII_PO_SPEED_S);
+ if (is5301x(dev) || is58xx(dev))
+ reg &= ~PORT_OVERRIDE_SPEED_2000M;
+
switch (speed) {
case 2000:
reg |= PORT_OVERRIDE_SPEED_2000M;
@@ -1390,6 +1394,11 @@ static void b53_force_port_config(struct b53_device *dev, int port,
return;
}
+ if (is5325(dev))
+ reg &= ~PORT_OVERRIDE_LP_FLOW_25;
+ else
+ reg &= ~(PORT_OVERRIDE_RX_FLOW | PORT_OVERRIDE_TX_FLOW);
+
if (rx_pause) {
if (is5325(dev))
reg |= PORT_OVERRIDE_LP_FLOW_25;
--
2.43.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH net 2/2] net: dsa: b53: fix bcm63xx RGMII port link adjustment
2025-11-01 13:28 [PATCH net 0/2] net: dsa: b53: fix bcm63xx rgmii user ports with speed < 1g Jonas Gorski
2025-11-01 13:28 ` [PATCH net 1/2] net: dsa: b53: fix resetting speed and pause on forced link Jonas Gorski
@ 2025-11-01 13:28 ` Jonas Gorski
2025-11-03 16:49 ` Florian Fainelli
2025-11-04 1:10 ` [PATCH net 0/2] net: dsa: b53: fix bcm63xx rgmii user ports with speed < 1g patchwork-bot+netdevbpf
2 siblings, 1 reply; 6+ messages in thread
From: Jonas Gorski @ 2025-11-01 13:28 UTC (permalink / raw)
To: Florian Fainelli, Andrew Lunn, Vladimir Oltean, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni
Cc: Florian Fainelli, netdev, linux-kernel
BCM63XX's switch does not support MDIO scanning of external phys, so its
MACs needs to be manually configured for autonegotiated link speeds.
So b53_force_port_config() and b53_force_link() accordingly also when
mode is MLO_AN_PHY for those ports.
Fixes lower speeds than 1000/full on rgmii ports 4 - 7.
This aligns the behaviour with the old bcm63xx_enetsw driver for those
ports.
Fixes: 967dd82ffc52 ("net: dsa: b53: Add support for Broadcom RoboSwitch")
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
---
drivers/net/dsa/b53/b53_common.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c
index cb28256ef3cc..bb2c6dfa7835 100644
--- a/drivers/net/dsa/b53/b53_common.c
+++ b/drivers/net/dsa/b53/b53_common.c
@@ -1602,8 +1602,11 @@ static void b53_phylink_mac_link_down(struct phylink_config *config,
struct b53_device *dev = dp->ds->priv;
int port = dp->index;
- if (mode == MLO_AN_PHY)
+ if (mode == MLO_AN_PHY) {
+ if (is63xx(dev) && in_range(port, B53_63XX_RGMII0, 4))
+ b53_force_link(dev, port, false);
return;
+ }
if (mode == MLO_AN_FIXED) {
b53_force_link(dev, port, false);
@@ -1631,6 +1634,13 @@ static void b53_phylink_mac_link_up(struct phylink_config *config,
if (mode == MLO_AN_PHY) {
/* Re-negotiate EEE if it was enabled already */
p->eee_enabled = b53_eee_init(ds, port, phydev);
+
+ if (is63xx(dev) && in_range(port, B53_63XX_RGMII0, 4)) {
+ b53_force_port_config(dev, port, speed, duplex,
+ tx_pause, rx_pause);
+ b53_force_link(dev, port, true);
+ }
+
return;
}
--
2.43.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net 1/2] net: dsa: b53: fix resetting speed and pause on forced link
2025-11-01 13:28 ` [PATCH net 1/2] net: dsa: b53: fix resetting speed and pause on forced link Jonas Gorski
@ 2025-11-03 16:48 ` Florian Fainelli
0 siblings, 0 replies; 6+ messages in thread
From: Florian Fainelli @ 2025-11-03 16:48 UTC (permalink / raw)
To: Jonas Gorski, Florian Fainelli, Andrew Lunn, Vladimir Oltean,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
Cc: netdev, linux-kernel
On 11/1/25 06:28, Jonas Gorski wrote:
> There is no guarantee that the port state override registers have their
> default values, as not all switches support being reset via register or
> have a reset GPIO.
>
> So when forcing port config, we need to make sure to clear all fields,
> which we currently do not do for the speed and flow control
> configuration. This can cause flow control stay enabled, or in the case
> of speed becoming an illegal value, e.g. configured for 1G (0x2), then
> setting 100M (0x1), results in 0x3 which is invalid.
>
> For PORT_OVERRIDE_SPEED_2000M we need to make sure to only clear it on
> supported chips, as the bit can have different meanings on other chips,
> e.g. for BCM5389 this controls scanning PHYs for link/speed
> configuration.
>
> Fixes: 5e004460f874 ("net: dsa: b53: Add helper to set link parameters")
> Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
--
Florian
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net 2/2] net: dsa: b53: fix bcm63xx RGMII port link adjustment
2025-11-01 13:28 ` [PATCH net 2/2] net: dsa: b53: fix bcm63xx RGMII port link adjustment Jonas Gorski
@ 2025-11-03 16:49 ` Florian Fainelli
0 siblings, 0 replies; 6+ messages in thread
From: Florian Fainelli @ 2025-11-03 16:49 UTC (permalink / raw)
To: Jonas Gorski, Florian Fainelli, Andrew Lunn, Vladimir Oltean,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
Cc: netdev, linux-kernel
On 11/1/25 06:28, Jonas Gorski wrote:
> BCM63XX's switch does not support MDIO scanning of external phys, so its
> MACs needs to be manually configured for autonegotiated link speeds.
>
> So b53_force_port_config() and b53_force_link() accordingly also when
> mode is MLO_AN_PHY for those ports.
>
> Fixes lower speeds than 1000/full on rgmii ports 4 - 7.
>
> This aligns the behaviour with the old bcm63xx_enetsw driver for those
> ports.
>
> Fixes: 967dd82ffc52 ("net: dsa: b53: Add support for Broadcom RoboSwitch")
> Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
--
Florian
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net 0/2] net: dsa: b53: fix bcm63xx rgmii user ports with speed < 1g
2025-11-01 13:28 [PATCH net 0/2] net: dsa: b53: fix bcm63xx rgmii user ports with speed < 1g Jonas Gorski
2025-11-01 13:28 ` [PATCH net 1/2] net: dsa: b53: fix resetting speed and pause on forced link Jonas Gorski
2025-11-01 13:28 ` [PATCH net 2/2] net: dsa: b53: fix bcm63xx RGMII port link adjustment Jonas Gorski
@ 2025-11-04 1:10 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 6+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-11-04 1:10 UTC (permalink / raw)
To: Jonas Gorski
Cc: florian.fainelli, andrew, olteanv, davem, edumazet, kuba, pabeni,
f.fainelli, netdev, linux-kernel
Hello:
This series was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Sat, 1 Nov 2025 14:28:05 +0100 you wrote:
> 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.
>
> [...]
Here is the summary with links:
- [net,1/2] net: dsa: b53: fix resetting speed and pause on forced link
https://git.kernel.org/netdev/net/c/b6a8a5477fe9
- [net,2/2] net: dsa: b53: fix bcm63xx RGMII port link adjustment
https://git.kernel.org/netdev/net/c/3e4ebdc1606a
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-11-04 1:10 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-11-01 13:28 [PATCH net 0/2] net: dsa: b53: fix bcm63xx rgmii user ports with speed < 1g Jonas Gorski
2025-11-01 13:28 ` [PATCH net 1/2] net: dsa: b53: fix resetting speed and pause on forced link Jonas Gorski
2025-11-03 16:48 ` Florian Fainelli
2025-11-01 13:28 ` [PATCH net 2/2] net: dsa: b53: fix bcm63xx RGMII port link adjustment Jonas Gorski
2025-11-03 16:49 ` Florian Fainelli
2025-11-04 1:10 ` [PATCH net 0/2] net: dsa: b53: fix bcm63xx rgmii user ports with speed < 1g patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®