1 From 49293bbc50cb7d44223eb49e0f7cb38e7dac2361 Mon Sep 17 00:00:00 2001
2 From: Aleksander Jan Bajkowski <olek2@wp.pl>
3 Date: Tue, 14 Sep 2021 23:21:01 +0200
4 Subject: [PATCH 4/5] MIPS: lantiq: dma: make the burst length configurable by
7 Make the burst length configurable by the drivers.
9 Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
10 Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
11 Signed-off-by: David S. Miller <davem@davemloft.net>
13 .../include/asm/mach-lantiq/xway/xway_dma.h | 2 +-
14 arch/mips/lantiq/xway/dma.c | 38 ++++++++++++++++---
15 2 files changed, 34 insertions(+), 6 deletions(-)
17 --- a/arch/mips/include/asm/mach-lantiq/xway/xway_dma.h
18 +++ b/arch/mips/include/asm/mach-lantiq/xway/xway_dma.h
19 @@ -45,6 +45,6 @@ extern void ltq_dma_close(struct ltq_dma
20 extern void ltq_dma_alloc_tx(struct ltq_dma_channel *ch);
21 extern void ltq_dma_alloc_rx(struct ltq_dma_channel *ch);
22 extern void ltq_dma_free(struct ltq_dma_channel *ch);
23 -extern void ltq_dma_init_port(int p);
24 +extern void ltq_dma_init_port(int p, int tx_burst, int rx_burst);
27 --- a/arch/mips/lantiq/xway/dma.c
28 +++ b/arch/mips/lantiq/xway/dma.c
29 @@ -181,7 +181,7 @@ ltq_dma_free(struct ltq_dma_channel *ch)
30 EXPORT_SYMBOL_GPL(ltq_dma_free);
33 -ltq_dma_init_port(int p)
34 +ltq_dma_init_port(int p, int tx_burst, int rx_burst)
36 ltq_dma_w32(p, LTQ_DMA_PS);
38 @@ -190,16 +190,44 @@ ltq_dma_init_port(int p)
39 * Tell the DMA engine to swap the endianness of data frames and
40 * drop packets if the channel arbitration fails.
42 - ltq_dma_w32_mask(0, DMA_ETOP_ENDIANNESS | DMA_PDEN,
43 + ltq_dma_w32_mask(0, (DMA_ETOP_ENDIANNESS | DMA_PDEN),
48 - ltq_dma_w32((DMA_PCTRL_2W_BURST << DMA_TX_BURST_SHIFT) |
49 - (DMA_PCTRL_2W_BURST << DMA_RX_BURST_SHIFT),
56 + ltq_dma_w32_mask(0x0c, (DMA_PCTRL_8W_BURST << DMA_RX_BURST_SHIFT),
60 + ltq_dma_w32_mask(0x0c, (DMA_PCTRL_4W_BURST << DMA_RX_BURST_SHIFT),
64 + ltq_dma_w32_mask(0x0c, (DMA_PCTRL_2W_BURST << DMA_RX_BURST_SHIFT),
73 + ltq_dma_w32_mask(0x30, (DMA_PCTRL_8W_BURST << DMA_TX_BURST_SHIFT),
77 + ltq_dma_w32_mask(0x30, (DMA_PCTRL_4W_BURST << DMA_TX_BURST_SHIFT),
81 + ltq_dma_w32_mask(0x30, (DMA_PCTRL_2W_BURST << DMA_TX_BURST_SHIFT),