1 From 5ea0d42c1980e6d10e5cb56a78021db5bfcebaaf Mon Sep 17 00:00:00 2001
2 From: Jonas Gorski <jonas.gorski@gmail.com>
3 Date: Mon, 2 Jun 2025 21:39:52 +0200
4 Subject: [PATCH] net: dsa: b53: allow RGMII for bcm63xx RGMII ports
6 Add RGMII to supported interfaces for BCM63xx RGMII ports so they can be
7 actually used in RGMII mode.
9 Without this, phylink will fail to configure them:
11 [ 3.580000] b53-switch 10700000.switch GbE3 (uninitialized): validation of rgmii with support 0000000,00000000,00000000,000062ff and advertisement 0000000,00000000,00000000,000062ff failed: -EINVAL
12 [ 3.600000] b53-switch 10700000.switch GbE3 (uninitialized): failed to connect to PHY: -EINVAL
13 [ 3.610000] b53-switch 10700000.switch GbE3 (uninitialized): error -22 setting up PHY for tree 0, switch 0, port 4
15 Fixes: ce3bf94871f7 ("net: dsa: b53: add support for BCM63xx RGMIIs")
16 Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
17 Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
18 Link: https://patch.msgid.link/20250602193953.1010487-5-jonas.gorski@gmail.com
19 Signed-off-by: Paolo Abeni <pabeni@redhat.com>
21 drivers/net/dsa/b53/b53_common.c | 4 ++++
22 1 file changed, 4 insertions(+)
24 --- a/drivers/net/dsa/b53/b53_common.c
25 +++ b/drivers/net/dsa/b53/b53_common.c
26 @@ -1439,6 +1439,10 @@ static void b53_phylink_get_caps(struct
27 __set_bit(PHY_INTERFACE_MODE_MII, config->supported_interfaces);
28 __set_bit(PHY_INTERFACE_MODE_REVMII, config->supported_interfaces);
30 + /* BCM63xx RGMII ports support RGMII */
31 + if (is63xx(dev) && in_range(port, B53_63XX_RGMII0, 4))
32 + phy_interface_set_rgmii(config->supported_interfaces);
34 config->mac_capabilities = MAC_ASYM_PAUSE | MAC_SYM_PAUSE |