[PATCH] bcmgenet: Reset the PHY of Raspberry Pi

André Althaus <[email protected]>
Newsgroups org.u-boot-project.lists.u-boot
Message-ID <[email protected]>
The Raspberry Pi firmware supports netbooting via tftp.
When U-Boot is run this way as the kernel, the network in U-Boot
is unstable resulting in multiple DHCP retries (sometimes no IP at all)
and timeouts during U-Boots tftp transfers.

It seems that the firmware does not completely reset the PHY and when
U-Boot configures it, some settings are not correct.
Reset the phy via phy_reset() during the bcmgenet_phy_init() call.

Signed-off-by: André Althaus <[email protected]>

---
I tested it on a Raspberry Pi 4B. When booting U-Boot from an SD card,
the network is stable, booting with the same files over the network
and it is unstable. After appling the patch the network is also
stable after netbooting.
---
  drivers/net/bcmgenet.c | 4 ++++
  1 file changed, 4 insertions(+)

diff --git a/drivers/net/bcmgenet.c b/drivers/net/bcmgenet.c
index a0264dc386d..f2253b25bc1 100644
--- a/drivers/net/bcmgenet.c
+++ b/drivers/net/bcmgenet.c
@@ -522,6 +522,10 @@ static int bcmgenet_phy_init(struct 
bcmgenet_eth_priv *priv, void *dev)
  	if (!phydev)
  		return -ENODEV;

+	ret = phy_reset(phydev);
+	if (ret)
+		return ret;
+
  	phydev->supported &= PHY_GBIT_FEATURES;
  	if (priv->speed) {
  		ret = phy_set_supported(priv->phydev, priv->speed);
-- 
2.55.0
smime.p7s (application/pkcs7-signature, 3.9 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.