mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 23:24:38 +00:00
net/designware: add explicit reset of {tx|rx}_currdescnum
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". Cc: Joe Hershberger <joe.hershberger@ni.com> Cc: Vipin Kumar <vipin.kumar@st.com> Cc: Stefan Roese <sr@denx.de> Cc: Mischa Jonker <mjonker@synopsys.com> Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
This commit is contained in:
parent
bde237368a
commit
74cb708d58
1 changed files with 2 additions and 0 deletions
|
@ -52,6 +52,7 @@ static void tx_descs_init(struct eth_device *dev)
|
||||||
desc_p->dmamac_next = &desc_table_p[0];
|
desc_p->dmamac_next = &desc_table_p[0];
|
||||||
|
|
||||||
writel((ulong)&desc_table_p[0], &dma_p->txdesclistaddr);
|
writel((ulong)&desc_table_p[0], &dma_p->txdesclistaddr);
|
||||||
|
priv->tx_currdescnum = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rx_descs_init(struct eth_device *dev)
|
static void rx_descs_init(struct eth_device *dev)
|
||||||
|
@ -79,6 +80,7 @@ static void rx_descs_init(struct eth_device *dev)
|
||||||
desc_p->dmamac_next = &desc_table_p[0];
|
desc_p->dmamac_next = &desc_table_p[0];
|
||||||
|
|
||||||
writel((ulong)&desc_table_p[0], &dma_p->rxdesclistaddr);
|
writel((ulong)&desc_table_p[0], &dma_p->rxdesclistaddr);
|
||||||
|
priv->rx_currdescnum = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void descs_init(struct eth_device *dev)
|
static void descs_init(struct eth_device *dev)
|
||||||
|
|
Loading…
Reference in a new issue