Skip to content

Commit 3e6fdeb

Browse files
xdarklightdavem330
authored andcommitted
net: dsa: lantiq_gswip: Let GSWIP automatically set the xMII clock
The xMII interface clock depends on the PHY interface (MII, RMII, RGMII) as well as the current link speed. Explicitly configure the GSWIP to automatically select the appropriate xMII interface clock. This fixes an issue seen by some users where ports using an external RMII or RGMII PHY were deaf (no RX or TX traffic could be seen). Most likely this is due to an "invalid" xMII clock being selected either by the bootloader or hardware-defaults. Fixes: 14fceff ("net: dsa: Add Lantiq / Intel DSA driver for vrx200") Signed-off-by: Martin Blumenstingl <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 3ed14d8 commit 3e6fdeb

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

drivers/net/dsa/lantiq_gswip.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -799,10 +799,15 @@ static int gswip_setup(struct dsa_switch *ds)
799799
/* Configure the MDIO Clock 2.5 MHz */
800800
gswip_mdio_mask(priv, 0xff, 0x09, GSWIP_MDIO_MDC_CFG1);
801801

802-
/* Disable the xMII link */
803-
for (i = 0; i < priv->hw_info->max_ports; i++)
802+
for (i = 0; i < priv->hw_info->max_ports; i++) {
803+
/* Disable the xMII link */
804804
gswip_mii_mask_cfg(priv, GSWIP_MII_CFG_EN, 0, i);
805805

806+
/* Automatically select the xMII interface clock */
807+
gswip_mii_mask_cfg(priv, GSWIP_MII_CFG_RATE_MASK,
808+
GSWIP_MII_CFG_RATE_AUTO, i);
809+
}
810+
806811
/* enable special tag insertion on cpu port */
807812
gswip_switch_mask(priv, 0, GSWIP_FDMA_PCTRL_STEN,
808813
GSWIP_FDMA_PCTRLp(cpu_port));

0 commit comments

Comments
 (0)