[U-Boot] [PATCH] net/designware: add explicit reset of {tx|rx}_currdescnum

Alexey Brodkin Alexey.Brodkin at synopsys.com
Mon Jan 13 10:28:38 CET 2014


Driver "init" function might be called multiple times.
On every "init" Tx/Rx buffer descriptors are initialized: "descs_init"
-> "{tx|rx}_descs_init".

In its turn those init functions set MAC's "{tx|rx}desclistaddr" to
point on the first buffer descriptor in the list.

So CPU to start operation from the first buffer descriptor as well after
every "init" we have to reset "{tx|rx}_currdescnum".

Signed-off-by: Alexey Brodkin <abrodkin at synopsys.com>

Cc: Joe Hershberger <joe.hershberger at ni.com>
Cc: Vipin Kumar <vipin.kumar at st.com>
Cc: Stefan Roese <sr at denx.de>
Cc: Mischa Jonker <mjonker at synopsys.com>
---
 drivers/net/designware.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/designware.c b/drivers/net/designware.c
index 53a95bf..d1cc25b 100644
--- a/drivers/net/designware.c
+++ b/drivers/net/designware.c
@@ -57,6 +57,7 @@ static void tx_descs_init(struct eth_device *dev)
 			   sizeof(priv->tx_mac_descrtable));
 
 	writel((ulong)&desc_table_p[0], &dma_p->txdesclistaddr);
+	priv->tx_currdescnum = 0;
 }
 
 static void rx_descs_init(struct eth_device *dev)
@@ -98,6 +99,7 @@ static void rx_descs_init(struct eth_device *dev)
 			   sizeof(priv->rx_mac_descrtable));
 
 	writel((ulong)&desc_table_p[0], &dma_p->rxdesclistaddr);
+	priv->rx_currdescnum = 0;
 }
 
 static void descs_init(struct eth_device *dev)
-- 
1.8.4.2



More information about the U-Boot mailing list