net: dsa: b53: add BCM63268 RGMII configuration
authorÁlvaro Fernández Rojas <noltari@gmail.com>
Tue, 21 Mar 2023 17:33:59 +0000 (18:33 +0100)
committerJakub Kicinski <kuba@kernel.org>
Thu, 23 Mar 2023 04:38:04 +0000 (21:38 -0700)
BCM63268 requires special RGMII configuration to work.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/dsa/b53/b53_common.c
drivers/net/dsa/b53/b53_regs.h

index 97327d7a6760c99d833e1353deb49fa421d6d94a..1f9b251a5452ceafa6b34a2435d792bd5fb72334 100644 (file)
@@ -1240,8 +1240,12 @@ static void b53_adjust_63xx_rgmii(struct dsa_switch *ds, int port,
                break;
        }
 
-       if (port != dev->imp_port)
+       if (port != dev->imp_port) {
+               if (is63268(dev))
+                       rgmii_ctrl |= RGMII_CTRL_MII_OVERRIDE;
+
                rgmii_ctrl |= RGMII_CTRL_ENABLE_GMII;
+       }
 
        b53_write8(dev, B53_CTRL_PAGE, off, rgmii_ctrl);
 
index b2c539a4215450a21cc12c019d1ba1c14d873953..bfbcb66bef6626d84c49d5389ddf7ab1c4e3d36e 100644 (file)
 
 #define B53_RGMII_CTRL_IMP             0x60
 #define   RGMII_CTRL_ENABLE_GMII       BIT(7)
+#define   RGMII_CTRL_MII_OVERRIDE      BIT(6)
 #define   RGMII_CTRL_TIMING_SEL                BIT(2)
 #define   RGMII_CTRL_DLL_RXC           BIT(1)
 #define   RGMII_CTRL_DLL_TXC           BIT(0)