Skip to content

Commit 2a1828e

Browse files
xdarklightkuba-moo
authored andcommitted
net: lantiq: Wait for the GPHY firmware to be ready
A user reports (slightly shortened from the original message): libphy: lantiq,xrx200-mdio: probed mdio_bus 1e108000.switch-mii: MDIO device at address 17 is missing. gswip 1e108000.switch lan: no phy at 2 gswip 1e108000.switch lan: failed to connect to port 2: -19 lantiq,xrx200-net 1e10b308.eth eth0: error -19 setting up slave phy This is a single-port board using the internal Fast Ethernet PHY. The user reports that switching to PHY scanning instead of configuring the PHY within device-tree works around this issue. The documentation for the standalone variant of the PHY11G (which is probably very similar to what is used inside the xRX200 SoCs but having the firmware burnt onto that standalone chip in the factory) states that the PHY needs 300ms to be ready for MDIO communication after releasing the reset. Add a 300ms delay after initializing all GPHYs to ensure that the GPHY firmware had enough time to initialize and to appear on the MDIO bus. Unfortunately there is no (known) documentation on what the minimum time to wait after releasing the reset on an internal PHY so play safe and take the one for the external variant. Only wait after the last GPHY firmware is loaded to not slow down the initialization too much ( xRX200 has two GPHYs but newer SoCs have at least three GPHYs). Fixes: 14fceff ("net: dsa: Add Lantiq / Intel DSA driver for vrx200") Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Acked-by: Hauke Mehrtens <hauke@hauke-m.de> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Link: https://lore.kernel.org/r/20201115165757.552641-1-martin.blumenstingl@googlemail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 8575245 commit 2a1828e

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

drivers/net/dsa/lantiq_gswip.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
*/
2727

2828
#include <linux/clk.h>
29+
#include <linux/delay.h>
2930
#include <linux/etherdevice.h>
3031
#include <linux/firmware.h>
3132
#include <linux/if_bridge.h>
@@ -1837,6 +1838,16 @@ static int gswip_gphy_fw_list(struct gswip_priv *priv,
18371838
i++;
18381839
}
18391840

1841+
/* The standalone PHY11G requires 300ms to be fully
1842+
* initialized and ready for any MDIO communication after being
1843+
* taken out of reset. For the SoC-internal GPHY variant there
1844+
* is no (known) documentation for the minimum time after a
1845+
* reset. Use the same value as for the standalone variant as
1846+
* some users have reported internal PHYs not being detected
1847+
* without any delay.
1848+
*/
1849+
msleep(300);
1850+
18401851
return 0;
18411852

18421853
remove_gphy:

0 commit comments

Comments
 (0)