Commit 49293bbc authored by Aleksander Jan Bajkowski's avatar Aleksander Jan Bajkowski Committed by David S. Miller

MIPS: lantiq: dma: make the burst length configurable by the drivers

Make the burst length configurable by the drivers.
Signed-off-by: default avatarAleksander Jan Bajkowski <olek2@wp.pl>
Acked-by: default avatarHauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5ad74d39
...@@ -45,6 +45,6 @@ extern void ltq_dma_close(struct ltq_dma_channel *ch); ...@@ -45,6 +45,6 @@ extern void ltq_dma_close(struct ltq_dma_channel *ch);
extern void ltq_dma_alloc_tx(struct ltq_dma_channel *ch); extern void ltq_dma_alloc_tx(struct ltq_dma_channel *ch);
extern void ltq_dma_alloc_rx(struct ltq_dma_channel *ch); extern void ltq_dma_alloc_rx(struct ltq_dma_channel *ch);
extern void ltq_dma_free(struct ltq_dma_channel *ch); extern void ltq_dma_free(struct ltq_dma_channel *ch);
extern void ltq_dma_init_port(int p); extern void ltq_dma_init_port(int p, int tx_burst, int rx_burst);
#endif #endif
...@@ -182,7 +182,7 @@ ltq_dma_free(struct ltq_dma_channel *ch) ...@@ -182,7 +182,7 @@ ltq_dma_free(struct ltq_dma_channel *ch)
EXPORT_SYMBOL_GPL(ltq_dma_free); EXPORT_SYMBOL_GPL(ltq_dma_free);
void void
ltq_dma_init_port(int p) ltq_dma_init_port(int p, int tx_burst, int rx_burst)
{ {
ltq_dma_w32(p, LTQ_DMA_PS); ltq_dma_w32(p, LTQ_DMA_PS);
switch (p) { switch (p) {
...@@ -191,16 +191,44 @@ ltq_dma_init_port(int p) ...@@ -191,16 +191,44 @@ ltq_dma_init_port(int p)
* Tell the DMA engine to swap the endianness of data frames and * Tell the DMA engine to swap the endianness of data frames and
* drop packets if the channel arbitration fails. * drop packets if the channel arbitration fails.
*/ */
ltq_dma_w32_mask(0, DMA_ETOP_ENDIANNESS | DMA_PDEN, ltq_dma_w32_mask(0, (DMA_ETOP_ENDIANNESS | DMA_PDEN),
LTQ_DMA_PCTRL); LTQ_DMA_PCTRL);
break; break;
case DMA_PORT_DEU: default:
ltq_dma_w32((DMA_PCTRL_2W_BURST << DMA_TX_BURST_SHIFT) | break;
(DMA_PCTRL_2W_BURST << DMA_RX_BURST_SHIFT), }
switch (rx_burst) {
case 8:
ltq_dma_w32_mask(0x0c, (DMA_PCTRL_8W_BURST << DMA_RX_BURST_SHIFT),
LTQ_DMA_PCTRL); LTQ_DMA_PCTRL);
break; break;
case 4:
ltq_dma_w32_mask(0x0c, (DMA_PCTRL_4W_BURST << DMA_RX_BURST_SHIFT),
LTQ_DMA_PCTRL);
break;
case 2:
ltq_dma_w32_mask(0x0c, (DMA_PCTRL_2W_BURST << DMA_RX_BURST_SHIFT),
LTQ_DMA_PCTRL);
break;
default:
break;
}
switch (tx_burst) {
case 8:
ltq_dma_w32_mask(0x30, (DMA_PCTRL_8W_BURST << DMA_TX_BURST_SHIFT),
LTQ_DMA_PCTRL);
break;
case 4:
ltq_dma_w32_mask(0x30, (DMA_PCTRL_4W_BURST << DMA_TX_BURST_SHIFT),
LTQ_DMA_PCTRL);
break;
case 2:
ltq_dma_w32_mask(0x30, (DMA_PCTRL_2W_BURST << DMA_TX_BURST_SHIFT),
LTQ_DMA_PCTRL);
break;
default: default:
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment