Skip to content

Commit ef3e515

Browse files
fancervinodkoul
authored andcommitted
dmaengine: dw: Take HC_LLP flag into account for noLLP auto-config
Full multi-block transfers functionality is enabled in DW DMA controller only if CHx_MULTI_BLK_EN is set. But LLP-based transfers can be executed only if hardcode channel x LLP register feature isn't enabled, which can be switched on at the IP core synthesis for optimization. If it's enabled then the LLP register is hardcoded to zero, so the blocks chaining based on the LLPs is unsupported. 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-7-Sergey.Semin@baikalelectronics.ru Signed-off-by: Vinod Koul <vkoul@kernel.org>
1 parent 3b6d694 commit ef3e515

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

‎drivers/dma/dw/core.c‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1178,8 +1178,17 @@ int do_dma_probe(struct dw_dma_chip *chip)
11781178
*/
11791179
dwc->block_size =
11801180
(4 << ((pdata->block_size >> 4 * i) & 0xf)) - 1;
1181+
1182+
/*
1183+
* According to the DW DMA databook the true scatter-
1184+
* gether LLPs aren't available if either multi-block
1185+
* config is disabled (CHx_MULTI_BLK_EN == 0) or the
1186+
* LLP register is hard-coded to zeros
1187+
* (CHx_HC_LLP == 1).
1188+
*/
11811189
dwc->nollp =
1182-
(dwc_params >> DWC_PARAMS_MBLK_EN & 0x1) == 0;
1190+
(dwc_params >> DWC_PARAMS_MBLK_EN & 0x1) == 0 ||
1191+
(dwc_params >> DWC_PARAMS_HC_LLP & 0x1) == 1;
11831192
} else {
11841193
dwc->block_size = pdata->block_size;
11851194
dwc->nollp = !pdata->multi_block[i];

‎drivers/dma/dw/regs.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ struct dw_dma_regs {
125125

126126
/* Bitfields in DWC_PARAMS */
127127
#define DWC_PARAMS_MBLK_EN 11 /* multi block transfer */
128+
#define DWC_PARAMS_HC_LLP 13 /* set LLP register to zero */
128129

129130
/* bursts size */
130131
enum dw_dma_msize {

0 commit comments

Comments
 (0)