From: Albert Aribaud Date: Sat, 10 Jul 2010 13:41:29 +0000 (+0200) Subject: kirkwood_egiga: bugfix: add DMA sequence points X-Git-Tag: v2010.09-rc1~82^2~2^2~21 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=c19a20d5bd3c2196fb1562a329191e2347d5a40a;p=oweals%2Fu-boot.git kirkwood_egiga: bugfix: add DMA sequence points Insert isb() sequence points to ensure DMA descriptors are filled in and set up before actual DMA occurs. Signed-off-by: Albert Aribaud Acked-by: Prafulla Wadaskar Signed-off-by: Ben Warren --- diff --git a/drivers/net/kirkwood_egiga.c b/drivers/net/kirkwood_egiga.c index 932792e364..ea0c5223bb 100644 --- a/drivers/net/kirkwood_egiga.c +++ b/drivers/net/kirkwood_egiga.c @@ -447,6 +447,8 @@ static int kwgbe_init(struct eth_device *dev) /* Assignment of Rx CRDB of given RXUQ */ KWGBEREG_WR(regs->rxcdp[RXUQ], (u32) dkwgbe->p_rxdesc_curr); + /* ensure previous write is done before enabling Rx DMA */ + isb(); /* Enable port Rx. */ KWGBEREG_WR(regs->rqc, (1 << RXUQ)); @@ -536,8 +538,13 @@ static int kwgbe_send(struct eth_device *dev, volatile void *dataptr, p_txdesc->buf_ptr = (u8 *) p; p_txdesc->byte_cnt = datasize; - /* Apply send command using zeroth TXUQ */ + /* Set this tc desc as zeroth TXUQ */ KWGBEREG_WR(regs->tcqdp[TXUQ], (u32) p_txdesc); + + /* ensure tx desc writes above are performed before we start Tx DMA */ + isb(); + + /* Apply send command using zeroth TXUQ */ KWGBEREG_WR(regs->tqc, (1 << TXUQ)); /*