From: Vishwas Srivastava Date: Mon, 25 Jan 2016 15:58:17 +0000 (+0530) Subject: net: fix wrong initialization in davinci-emac driver X-Git-Tag: v2016.03-rc2~92^2~2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=abbf2d9b56f2583b5f047f64a6efe11c01ef8d4b;p=u-boot net: fix wrong initialization in davinci-emac driver emac module of the davinci platform supports only 8 tx and 8 rx channels (total 16). emac driver for davinci platform, however, while doing initialization of the dma descriptor head pointers, wrongly initializes the 16 head pointers (instead of 8) for tx dma and 16 head pointers (insted of 8) for rx dma, which is wrong. The result is, that this register initilization spills over the other registers which was not intended and is undesirable. This patch fixes this problem. Signed-off-by: Vishwas Srivastava CC: Joe Hershberger Acked-by: Joe Hershberger Signed-off-by: Anatolij Gustschin --- diff --git a/drivers/net/davinci_emac.c b/drivers/net/davinci_emac.c index 92c3dcae3c..6f2dc8d648 100644 --- a/drivers/net/davinci_emac.c +++ b/drivers/net/davinci_emac.c @@ -459,11 +459,11 @@ static int davinci_eth_open(struct eth_device *dev, bd_t *bis) /* Set DMA 8 TX / 8 RX Head pointers to 0 */ addr = &adap_emac->TX0HDP; - for(cnt = 0; cnt < 16; cnt++) + for (cnt = 0; cnt < 8; cnt++) writel(0, addr++); addr = &adap_emac->RX0HDP; - for(cnt = 0; cnt < 16; cnt++) + for (cnt = 0; cnt < 8; cnt++) writel(0, addr++); /* Clear Statistics (do this before setting MacControl register) */