Skip to content

Commit 585d354

Browse files
fancervinodkoul
authored andcommitted
dmaengine: dw: Initialize min and max burst DMA device capability
According to the DW APB DMAC data book the minimum burst transaction length is 1 and it's true for any version of the controller since isn't parametrised in the coreAssembler so can't be changed at the IP-core synthesis stage. The maximum burst transaction can vary from channel to channel and from controller to controller depending on a IP-core parameter the system engineer activated during the IP-core synthesis. Let's initialise both min_burst and max_burst members of the DMA controller descriptor with extreme values so the DMA clients could use them to properly optimize the DMA requests. The channels and controller-specific max_burst length initialization will be introduced by the follow-up patches. Signed-off-by: Serge Semin <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent e6fe576 commit 585d354

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

drivers/dma/dw/core.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1223,6 +1223,8 @@ int do_dma_probe(struct dw_dma_chip *chip)
12231223
dw->dma.device_issue_pending = dwc_issue_pending;
12241224

12251225
/* DMA capabilities */
1226+
dw->dma.min_burst = DW_DMA_MIN_BURST;
1227+
dw->dma.max_burst = DW_DMA_MAX_BURST;
12261228
dw->dma.src_addr_widths = DW_DMA_BUSWIDTHS;
12271229
dw->dma.dst_addr_widths = DW_DMA_BUSWIDTHS;
12281230
dw->dma.directions = BIT(DMA_DEV_TO_MEM) | BIT(DMA_MEM_TO_DEV) |

include/linux/platform_data/dma-dw.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
#define DW_DMA_MAX_NR_MASTERS 4
1414
#define DW_DMA_MAX_NR_CHANNELS 8
15+
#define DW_DMA_MIN_BURST 1
16+
#define DW_DMA_MAX_BURST 256
1517

1618
/**
1719
* struct dw_dma_slave - Controller-specific information about a slave

0 commit comments

Comments
 (0)