Skip to content

Commit d6b0317

Browse files
nxpfranklibjorn-helgaas
authored andcommitted
dmaengine: dw-edma: Add support for chip-specific flags
Add a "flags" field to the "struct dw_edma_chip" so that the controller drivers can pass flags that are relevant to the platform. DW_EDMA_CHIP_LOCAL - Used by the controller drivers accessing eDMA locally. Local eDMA access doesn't require generating MSIs to the remote. Link: https://lore.kernel.org/r/20220524152159.2370739-8-Frank.Li@nxp.com Tested-by: Serge Semin <fancer.lancer@gmail.com> Tested-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Signed-off-by: Frank Li <Frank.Li@nxp.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Serge Semin <fancer.lancer@gmail.com> Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Acked-By: Vinod Koul <vkoul@kernel.org>
1 parent c1e3397 commit d6b0317

2 files changed

Lines changed: 16 additions & 3 deletions

File tree

drivers/dma/dw-edma/dw-edma-v0-core.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@ u32 dw_edma_v0_core_status_abort_int(struct dw_edma *dw, enum dw_edma_dir dir)
301301
static void dw_edma_v0_core_write_chunk(struct dw_edma_chunk *chunk)
302302
{
303303
struct dw_edma_burst *child;
304+
struct dw_edma_chan *chan = chunk->chan;
304305
struct dw_edma_v0_lli __iomem *lli;
305306
struct dw_edma_v0_llp __iomem *llp;
306307
u32 control = 0, i = 0;
@@ -314,9 +315,11 @@ static void dw_edma_v0_core_write_chunk(struct dw_edma_chunk *chunk)
314315
j = chunk->bursts_alloc;
315316
list_for_each_entry(child, &chunk->burst->list, list) {
316317
j--;
317-
if (!j)
318-
control |= (DW_EDMA_V0_LIE | DW_EDMA_V0_RIE);
319-
318+
if (!j) {
319+
control |= DW_EDMA_V0_LIE;
320+
if (!(chan->dw->chip->flags & DW_EDMA_CHIP_LOCAL))
321+
control |= DW_EDMA_V0_RIE;
322+
}
320323
/* Channel control */
321324
SET_LL_32(&lli[i].control, control);
322325
/* Transfer size */

include/linux/dma/edma.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,21 @@ enum dw_edma_map_format {
3333
EDMA_MF_HDMA_COMPAT = 0x5
3434
};
3535

36+
/**
37+
* enum dw_edma_chip_flags - Flags specific to an eDMA chip
38+
* @DW_EDMA_CHIP_LOCAL: eDMA is used locally by an endpoint
39+
*/
40+
enum dw_edma_chip_flags {
41+
DW_EDMA_CHIP_LOCAL = BIT(0),
42+
};
43+
3644
/**
3745
* struct dw_edma_chip - representation of DesignWare eDMA controller hardware
3846
* @dev: struct device of the eDMA controller
3947
* @id: instance ID
4048
* @nr_irqs: total number of DMA IRQs
4149
* @ops DMA channel to IRQ number mapping
50+
* @flags dw_edma_chip_flags
4251
* @reg_base DMA register base address
4352
* @ll_wr_cnt DMA write link list count
4453
* @ll_rd_cnt DMA read link list count
@@ -55,6 +64,7 @@ struct dw_edma_chip {
5564
int id;
5665
int nr_irqs;
5766
const struct dw_edma_core_ops *ops;
67+
u32 flags;
5868

5969
void __iomem *reg_base;
6070

0 commit comments

Comments
 (0)