hc
2023-02-14 b625cdcd68479b3d540a915785b6d9809b52a2f8
kernel/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c
....@@ -119,23 +119,6 @@
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
-
139122 static void dwmac4_dma_init(void __iomem *ioaddr,
140123 struct stmmac_dma_cfg *dma_cfg, int atds)
141124 {
....@@ -214,7 +197,7 @@
214197 u32 channel, int fifosz, u8 qmode)
215198 {
216199 unsigned int rqs = fifosz / 256 - 1;
217
- u32 mtl_rx_op;
200
+ u32 mtl_rx_op, mtl_rx_int;
218201
219202 mtl_rx_op = readl(ioaddr + MTL_CHAN_RX_OP_MODE(channel));
220203
....@@ -285,6 +268,11 @@
285268 }
286269
287270 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));
288276 }
289277
290278 static void dwmac4_dma_tx_chan_op_mode(void __iomem *ioaddr, int mode,
....@@ -473,7 +461,7 @@
473461 const struct stmmac_dma_ops dwmac410_dma_ops = {
474462 .reset = dwmac4_dma_reset,
475463 .init = dwmac4_dma_init,
476
- .init_chan = dwmac410_dma_init_channel,
464
+ .init_chan = dwmac4_dma_init_channel,
477465 .init_rx_chan = dwmac4_dma_init_rx_chan,
478466 .init_tx_chan = dwmac4_dma_init_tx_chan,
479467 .axi = dwmac4_dma_axi,