[PATCH 6/6] net: sun8i-emac: v3s: fix soft reset timeout

Andreas Rehn rehn.andreas86 at gmail.com
Wed May 19 21:42:08 CEST 2021


v3s emac soft reset tooks quit longer if autonegation is active
on 100 Mbit full duplex pairs what can result in
`sun8i_emac_eth_start: Timeout` error

wait_for_bit_le32 polls register value each ms.
Increasing the timeout for setup do not effect current behavior
but reduces unexpected behaviors (e.g. timeouts on tftp download).

Signed-off-by: Andreas Rehn <rehn.andreas86 at gmail.com>
---
 drivers/net/sun8i_emac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/sun8i_emac.c b/drivers/net/sun8i_emac.c
index 0e7ad3b0d4..23fd35f9e1 100644
--- a/drivers/net/sun8i_emac.c
+++ b/drivers/net/sun8i_emac.c
@@ -475,7 +475,7 @@ static int sun8i_emac_eth_start(struct udevice *dev)
 	/* Soft reset MAC */
 	writel(EMAC_CTL1_SOFT_RST, priv->mac_reg + EMAC_CTL1);
 	ret = wait_for_bit_le32(priv->mac_reg + EMAC_CTL1,
-				EMAC_CTL1_SOFT_RST, false, 10, true);
+				EMAC_CTL1_SOFT_RST, false, 500, true);
 	if (ret) {
 		printf("%s: Timeout\n", __func__);
 		return ret;
-- 
2.25.1



More information about the U-Boot mailing list