]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
net: zynq: Setup BD when structures are filled
authorMichal Simek <michal.simek@xilinx.com>
Mon, 17 Aug 2015 07:50:09 +0000 (09:50 +0200)
committerMichal Simek <michal.simek@xilinx.com>
Thu, 19 Nov 2015 12:50:09 +0000 (13:50 +0100)
Fix incorrect sequence in BD handling.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
drivers/net/zynq_gem.c

index 875738abb25a388aa711e80293e18f08abb969a8..b8686f3e23652f40528b5404ea75afc107442ca1 100644 (file)
@@ -406,9 +406,6 @@ static int zynq_gem_send(struct eth_device *dev, void *ptr, int len)
        struct zynq_gem_priv *priv = dev->priv;
        struct zynq_gem_regs *regs = (struct zynq_gem_regs *)dev->iobase;
 
-       /* setup BD */
-       writel((ulong)priv->tx_bd, &regs->txqbase);
-
        /* Setup Tx BD */
        memset(priv->tx_bd, 0, sizeof(struct emac_bd));
 
@@ -417,6 +414,9 @@ static int zynq_gem_send(struct eth_device *dev, void *ptr, int len)
                               ZYNQ_GEM_TXBUF_LAST_MASK |
                               ZYNQ_GEM_TXBUF_WRAP_MASK;
 
+       /* setup BD */
+       writel((ulong)priv->tx_bd, &regs->txqbase);
+
        addr = (ulong) ptr;
        addr &= ~(ARCH_DMA_MINALIGN - 1);
        size = roundup(len, ARCH_DMA_MINALIGN);