hc
2023-11-06 e3e12f52b214121840b44c91de5b3e5af5d3eb84
kernel/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c
....@@ -119,6 +119,23 @@
119119 ioaddr + DMA_CHAN_INTR_ENA(chan));
120120 }
121121
122
+static void dwmac410_dma_init_channel(void __iomem *ioaddr,
123
+ struct stmmac_dma_cfg *dma_cfg, u32 chan)
124
+{
125
+ u32 value;
126
+
127
+ /* common channel control register config */
128
+ value = readl(ioaddr + DMA_CHAN_CONTROL(chan));
129
+ if (dma_cfg->pblx8)
130
+ value = value | DMA_BUS_MODE_PBL;
131
+
132
+ writel(value, ioaddr + DMA_CHAN_CONTROL(chan));
133
+
134
+ /* Mask interrupts by writing to CSR7 */
135
+ writel(DMA_CHAN_INTR_DEFAULT_MASK_4_10,
136
+ ioaddr + DMA_CHAN_INTR_ENA(chan));
137
+}
138
+
122139 static void dwmac4_dma_init(void __iomem *ioaddr,
123140 struct stmmac_dma_cfg *dma_cfg, int atds)
124141 {
....@@ -197,7 +214,7 @@
197214 u32 channel, int fifosz, u8 qmode)
198215 {
199216 unsigned int rqs = fifosz / 256 - 1;
200
- u32 mtl_rx_op, mtl_rx_int;
217
+ u32 mtl_rx_op;
201218
202219 mtl_rx_op = readl(ioaddr + MTL_CHAN_RX_OP_MODE(channel));
203220
....@@ -268,11 +285,6 @@
268285 }
269286
270287 writel(mtl_rx_op, ioaddr + MTL_CHAN_RX_OP_MODE(channel));
271
-
272
- /* Enable MTL RX overflow */
273
- mtl_rx_int = readl(ioaddr + MTL_CHAN_INT_CTRL(channel));
274
- writel(mtl_rx_int | MTL_RX_OVERFLOW_INT_EN,
275
- ioaddr + MTL_CHAN_INT_CTRL(channel));
276288 }
277289
278290 static void dwmac4_dma_tx_chan_op_mode(void __iomem *ioaddr, int mode,
....@@ -461,7 +473,7 @@
461473 const struct stmmac_dma_ops dwmac410_dma_ops = {
462474 .reset = dwmac4_dma_reset,
463475 .init = dwmac4_dma_init,
464
- .init_chan = dwmac4_dma_init_channel,
476
+ .init_chan = dwmac410_dma_init_channel,
465477 .init_rx_chan = dwmac4_dma_init_rx_chan,
466478 .init_tx_chan = dwmac4_dma_init_tx_chan,
467479 .axi = dwmac4_dma_axi,