diff mbox series

[U-Boot,3/3] nds32: ftmac100: Fix write mac addr fail problem.

Message ID 1505267699-10017-1-git-send-email-uboot@andestech.com
State Accepted
Commit 1341494c7db46f4e4db59f7bb797c9ab79f4c51b
Delegated to: Andes
Headers show
Series [U-Boot,1/3] nds32: ftmac100: support cache enable. | expand

Commit Message

Andes Sept. 13, 2017, 1:54 a.m. UTC
From: rick <rick@andestech.com>

After soft reset complete, write mac address immediately will fail.
Add delay to work around this problem.

Signed-off-by: rick <rick@andestech.com>
---
 drivers/net/ftmac100.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/net/ftmac100.c b/drivers/net/ftmac100.c
index 4e45f00..e64bf3d 100644
--- a/drivers/net/ftmac100.c
+++ b/drivers/net/ftmac100.c
@@ -40,7 +40,12 @@  static void ftmac100_reset(struct ftmac100_data *priv)
 	writel (FTMAC100_MACCR_SW_RST, &ftmac100->maccr);
 
 	while (readl (&ftmac100->maccr) & FTMAC100_MACCR_SW_RST)
-		;
+		mdelay(1);
+	/*
+	 * When soft reset complete, write mac address immediately maybe fail somehow
+	 *  Wait for a while can avoid this problem
+	 */
+	mdelay(1);
 }
 
 /*