Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <Sergey.Semin@baikalelectronics.ru>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20200723005848.31907-9-Sergey.Semin@baikalelectronics.ru
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Serge Semin and committed by
Vinod Koul
585d3545 e6fe5767

+4
+2
drivers/dma/dw/core.c
··· 1223 1223 dw->dma.device_issue_pending = dwc_issue_pending; 1224 1224 1225 1225 /* DMA capabilities */ 1226 + dw->dma.min_burst = DW_DMA_MIN_BURST; 1227 + dw->dma.max_burst = DW_DMA_MAX_BURST; 1226 1228 dw->dma.src_addr_widths = DW_DMA_BUSWIDTHS; 1227 1229 dw->dma.dst_addr_widths = DW_DMA_BUSWIDTHS; 1228 1230 dw->dma.directions = BIT(DMA_DEV_TO_MEM) | BIT(DMA_MEM_TO_DEV) |
+2
include/linux/platform_data/dma-dw.h
··· 12 12 13 13 #define DW_DMA_MAX_NR_MASTERS 4 14 14 #define DW_DMA_MAX_NR_CHANNELS 8 15 + #define DW_DMA_MIN_BURST 1 16 + #define DW_DMA_MAX_BURST 256 15 17 16 18 /** 17 19 * struct dw_dma_slave - Controller-specific information about a slave