-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve net-designware-improve-ethernet-DMA-reset.patch
Signed-off-by: Artem Lapkin <[email protected]>
- Loading branch information
Artem Lapkin
committed
Jul 21, 2021
1 parent
c0a398c
commit c75ce0d
Showing
1 changed file
with
17 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
From 6318d121d7c604f128926650f6857b6dd12a2a0a Mon Sep 17 00:00:00 2001 | ||
From 0cc1d7b19f30e1938cbb3095ef24dd3e0595cc5e Mon Sep 17 00:00:00 2001 | ||
From: Artem Lapkin <[email protected]> | ||
Date: Wed, 21 Jul 2021 12:44:17 +0800 | ||
Date: Wed, 21 Jul 2021 13:57:55 +0800 | ||
Subject: [PATCH] net: designware: improve ethernet DMA reset | ||
|
||
Problem: uboot ethernet always have "DMA reset timeout" after | ||
|
@@ -23,19 +23,28 @@ patch may be just hack. | |
|
||
Signed-off-by: Artem Lapkin <[email protected]> | ||
--- | ||
drivers/net/designware.c | 2 ++ | ||
1 file changed, 2 insertions(+) | ||
drivers/net/designware.c | 4 ++++ | ||
1 file changed, 4 insertions(+) | ||
|
||
diff --git a/drivers/net/designware.c b/drivers/net/designware.c | ||
index 5d92257e..4433abe9 100644 | ||
index 5d92257e..6485c46d 100644 | ||
--- a/drivers/net/designware.c | ||
+++ b/drivers/net/designware.c | ||
@@ -389,6 +389,8 @@ int designware_eth_init(struct dw_eth_dev *priv, u8 *enetaddr) | ||
@@ -371,6 +371,7 @@ int designware_eth_init(struct dw_eth_dev *priv, u8 *enetaddr) | ||
struct eth_dma_regs *dma_p = priv->dma_regs_p; | ||
unsigned int start; | ||
int ret; | ||
+ int phy_reset_force=0; | ||
|
||
writel(readl(&dma_p->busmode) | DMAMAC_SRST, &dma_p->busmode); | ||
|
||
@@ -389,6 +390,9 @@ int designware_eth_init(struct dw_eth_dev *priv, u8 *enetaddr) | ||
printf("DMA reset timeout\n"); | ||
return -ETIMEDOUT; | ||
} | ||
+ // forced phy reset can help with DMAMAC_SRST | ||
+ phy_reset(priv->phydev); | ||
+ // forced phy reset after 0.2s can help with DMAMAC_SRST | ||
+ if (phy_reset_force++ == 2) | ||
+ phy_reset(priv->phydev); | ||
|
||
mdelay(100); | ||
}; | ||
|