common: Drop linux/delay.h from common header
[oweals/u-boot.git] / drivers / net / macb.c
index 83594253787cefb0736e9e70a558b4338ddd7607..424ca59707f2d5549dda2d6998e6cabb1720c5f1 100644 (file)
@@ -6,6 +6,8 @@
 #include <clk.h>
 #include <cpu_func.h>
 #include <dm.h>
+#include <log.h>
+#include <linux/delay.h>
 
 /*
  * The u-boot networking stack is a little weird.  It seems like the
@@ -38,7 +40,7 @@
 
 #include <linux/mii.h>
 #include <asm/io.h>
-#include <asm/dma-mapping.h>
+#include <linux/dma-mapping.h>
 #include <asm/arch/clk.h>
 #include <linux/errno.h>
 
@@ -327,8 +329,6 @@ static int _macb_send(struct macb_device *macb, const char *name, void *packet,
        macb->tx_ring[tx_head].addr = paddr;
        barrier();
        macb_flush_ring_desc(macb, TX);
-       /* Do we need check paddr and length is dcache line aligned? */
-       flush_dcache_range(paddr, paddr + ALIGN(length, ARCH_DMA_MINALIGN));
        macb_writel(macb, NCR, MACB_BIT(TE) | MACB_BIT(RE) | MACB_BIT(TSTART));
 
        /*
@@ -344,7 +344,7 @@ static int _macb_send(struct macb_device *macb, const char *name, void *packet,
                udelay(1);
        }
 
-       dma_unmap_single(packet, length, paddr);
+       dma_unmap_single(paddr, length, DMA_TO_DEVICE);
 
        if (i <= MACB_TX_TIMEOUT) {
                if (ctrl & MACB_BIT(TX_UNDERRUN))
@@ -809,7 +809,7 @@ static int _macb_init(struct macb_device *macb, const char *name)
        macb->next_rx_tail = 0;
 
 #ifdef CONFIG_MACB_ZYNQ
-       macb_writel(macb, DMACFG, MACB_ZYNQ_GEM_DMACR_INIT);
+       gem_writel(macb, DMACFG, MACB_ZYNQ_GEM_DMACR_INIT);
 #endif
 
        macb_writel(macb, RBQP, macb->rx_ring_dma);