net: stmmac: simplify the common DMA init API
[platform/kernel/linux-rpi.git] / drivers / net / ethernet / stmicro / stmmac / dwmac4_dma.c
index e81b6e5..7d82a34 100644 (file)
@@ -99,27 +99,29 @@ static void dwmac4_dma_init_channel(void __iomem *ioaddr, int pbl,
        writel(dma_rx_phy, ioaddr + DMA_CHAN_RX_BASE_ADDR(channel));
 }
 
-static void dwmac4_dma_init(void __iomem *ioaddr, int pbl, int fb, int mb,
-                           int aal, u32 dma_tx, u32 dma_rx, int atds)
+static void dwmac4_dma_init(void __iomem *ioaddr,
+                           struct stmmac_dma_cfg *dma_cfg,
+                           u32 dma_tx, u32 dma_rx, int atds)
 {
        u32 value = readl(ioaddr + DMA_SYS_BUS_MODE);
        int i;
 
        /* Set the Fixed burst mode */
-       if (fb)
+       if (dma_cfg->fixed_burst)
                value |= DMA_SYS_BUS_FB;
 
        /* Mixed Burst has no effect when fb is set */
-       if (mb)
+       if (dma_cfg->mixed_burst)
                value |= DMA_SYS_BUS_MB;
 
-       if (aal)
+       if (dma_cfg->aal)
                value |= DMA_SYS_BUS_AAL;
 
        writel(value, ioaddr + DMA_SYS_BUS_MODE);
 
        for (i = 0; i < DMA_CHANNEL_NB_MAX; i++)
-               dwmac4_dma_init_channel(ioaddr, pbl, dma_tx, dma_rx, i);
+               dwmac4_dma_init_channel(ioaddr, dma_cfg->pbl,
+                                       dma_tx, dma_rx, i);
 }
 
 static void _dwmac4_dump_dma_regs(void __iomem *ioaddr, u32 channel)