aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/ethernet/xilinx/ll_temac.h4
-rw-r--r--drivers/net/ethernet/xilinx/ll_temac_main.c40
-rw-r--r--include/linux/platform_data/xilinx-ll-temac.h5
3 files changed, 37 insertions, 12 deletions
diff --git a/drivers/net/ethernet/xilinx/ll_temac.h b/drivers/net/ethernet/xilinx/ll_temac.h
index 990f9ed151b2..1aeda084b8f1 100644
--- a/drivers/net/ethernet/xilinx/ll_temac.h
+++ b/drivers/net/ethernet/xilinx/ll_temac.h
@@ -375,6 +375,10 @@ struct temac_local {
375 int tx_bd_next; 375 int tx_bd_next;
376 int tx_bd_tail; 376 int tx_bd_tail;
377 int rx_bd_ci; 377 int rx_bd_ci;
378
379 /* DMA channel control setup */
380 u32 tx_chnl_ctrl;
381 u32 rx_chnl_ctrl;
378}; 382};
379 383
380/* Wrappers for temac_ior()/temac_iow() function pointers above */ 384/* Wrappers for temac_ior()/temac_iow() function pointers above */
diff --git a/drivers/net/ethernet/xilinx/ll_temac_main.c b/drivers/net/ethernet/xilinx/ll_temac_main.c
index fec8e4c22944..bccef30bf64e 100644
--- a/drivers/net/ethernet/xilinx/ll_temac_main.c
+++ b/drivers/net/ethernet/xilinx/ll_temac_main.c
@@ -304,18 +304,15 @@ static int temac_dma_bd_init(struct net_device *ndev)
304 lp->rx_bd_v[i].app0 = cpu_to_be32(STS_CTRL_APP0_IRQONEND); 304 lp->rx_bd_v[i].app0 = cpu_to_be32(STS_CTRL_APP0_IRQONEND);
305 } 305 }
306 306
307 lp->dma_out(lp, TX_CHNL_CTRL, 0x10220400 | 307 /* Configure DMA channel (irq setup) */
308 CHNL_CTRL_IRQ_EN | 308 lp->dma_out(lp, TX_CHNL_CTRL, lp->tx_chnl_ctrl |
309 CHNL_CTRL_IRQ_DLY_EN | 309 0x00000400 | // Use 1 Bit Wide Counters. Currently Not Used!
310 CHNL_CTRL_IRQ_COAL_EN); 310 CHNL_CTRL_IRQ_EN | CHNL_CTRL_IRQ_ERR_EN |
311 /* 0x10220483 */ 311 CHNL_CTRL_IRQ_DLY_EN | CHNL_CTRL_IRQ_COAL_EN);
312 /* 0x00100483 */ 312 lp->dma_out(lp, RX_CHNL_CTRL, lp->rx_chnl_ctrl |
313 lp->dma_out(lp, RX_CHNL_CTRL, 0xff070000 | 313 CHNL_CTRL_IRQ_IOE |
314 CHNL_CTRL_IRQ_EN | 314 CHNL_CTRL_IRQ_EN | CHNL_CTRL_IRQ_ERR_EN |
315 CHNL_CTRL_IRQ_DLY_EN | 315 CHNL_CTRL_IRQ_DLY_EN | CHNL_CTRL_IRQ_COAL_EN);
316 CHNL_CTRL_IRQ_COAL_EN |
317 CHNL_CTRL_IRQ_IOE);
318 /* 0xff010283 */
319 316
320 lp->dma_out(lp, RX_CURDESC_PTR, lp->rx_bd_p); 317 lp->dma_out(lp, RX_CURDESC_PTR, lp->rx_bd_p);
321 lp->dma_out(lp, RX_TAILDESC_PTR, 318 lp->dma_out(lp, RX_TAILDESC_PTR,
@@ -1191,6 +1188,13 @@ static int temac_probe(struct platform_device *pdev)
1191 lp->rx_irq = irq_of_parse_and_map(dma_np, 0); 1188 lp->rx_irq = irq_of_parse_and_map(dma_np, 0);
1192 lp->tx_irq = irq_of_parse_and_map(dma_np, 1); 1189 lp->tx_irq = irq_of_parse_and_map(dma_np, 1);
1193 1190
1191 /* Use defaults for IRQ delay/coalescing setup. These
1192 * are configuration values, so does not belong in
1193 * device-tree.
1194 */
1195 lp->tx_chnl_ctrl = 0x10220000;
1196 lp->rx_chnl_ctrl = 0xff070000;
1197
1194 /* Finished with the DMA node; drop the reference */ 1198 /* Finished with the DMA node; drop the reference */
1195 of_node_put(dma_np); 1199 of_node_put(dma_np);
1196 } else if (pdata) { 1200 } else if (pdata) {
@@ -1214,6 +1218,18 @@ static int temac_probe(struct platform_device *pdev)
1214 /* Get DMA RX and TX interrupts */ 1218 /* Get DMA RX and TX interrupts */
1215 lp->rx_irq = platform_get_irq(pdev, 0); 1219 lp->rx_irq = platform_get_irq(pdev, 0);
1216 lp->tx_irq = platform_get_irq(pdev, 1); 1220 lp->tx_irq = platform_get_irq(pdev, 1);
1221
1222 /* IRQ delay/coalescing setup */
1223 if (pdata->tx_irq_timeout || pdata->tx_irq_count)
1224 lp->tx_chnl_ctrl = (pdata->tx_irq_timeout << 24) |
1225 (pdata->tx_irq_count << 16);
1226 else
1227 lp->tx_chnl_ctrl = 0x10220000;
1228 if (pdata->rx_irq_timeout || pdata->rx_irq_count)
1229 lp->rx_chnl_ctrl = (pdata->rx_irq_timeout << 24) |
1230 (pdata->rx_irq_count << 16);
1231 else
1232 lp->rx_chnl_ctrl = 0xff070000;
1217 } 1233 }
1218 1234
1219 /* Error handle returned DMA RX and TX interrupts */ 1235 /* Error handle returned DMA RX and TX interrupts */
diff --git a/include/linux/platform_data/xilinx-ll-temac.h b/include/linux/platform_data/xilinx-ll-temac.h
index b0b8238a9b7d..368530f98176 100644
--- a/include/linux/platform_data/xilinx-ll-temac.h
+++ b/include/linux/platform_data/xilinx-ll-temac.h
@@ -22,6 +22,11 @@ struct ll_temac_platform_data {
22 * they share the same DCR bus bridge. 22 * they share the same DCR bus bridge.
23 */ 23 */
24 struct mutex *indirect_mutex; 24 struct mutex *indirect_mutex;
25 /* DMA channel control setup */
26 u8 tx_irq_timeout; /* TX Interrupt Delay Time-out */
27 u8 tx_irq_count; /* TX Interrupt Coalescing Threshold Count */
28 u8 rx_irq_timeout; /* RX Interrupt Delay Time-out */
29 u8 rx_irq_count; /* RX Interrupt Coalescing Threshold Count */
25}; 30};
26 31
27#endif /* __LINUX_XILINX_LL_TEMAC_H */ 32#endif /* __LINUX_XILINX_LL_TEMAC_H */