Skip to content

Commit 8ddad55

Browse files
1991Joyzouvinodkoul
authored andcommitted
dmaengine: fsl-edma: change the memory access from local into remote mode in i.MX 8QM
Fix the issue where MEM_TO_MEM fail on i.MX8QM due to the requirement that both source and destination addresses need pass through the IOMMU. Typically, peripheral FIFO addresses bypass the IOMMU, necessitating only one of the source or destination to go through it. Set "is_remote" to true to ensure both source and destination addresses pass through the IOMMU. iMX8 Spec define "Local" and "Remote" bus as below. Local bus: bypass IOMMU to directly access other peripheral register, such as FIFO. Remote bus: go through IOMMU to access system memory. The test fail log as follow: [ 66.268506] dmatest: dma0chan0-copy0: result #1: 'test timed out' with src_off=0x100 dst_off=0x80 len=0x3ec0 (0) [ 66.278785] dmatest: dma0chan0-copy0: summary 1 tests, 1 failures 0.32 iops 4 KB/s (0) Fixes: 72f5801 ("dmaengine: fsl-edma: integrate v3 support") Signed-off-by: Joy Zou <[email protected]> Cc: [email protected] Reviewed-by: Frank Li <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent 7dcf9e8 commit 8ddad55

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

drivers/dma/fsl-edma-common.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,8 @@ struct dma_async_tx_descriptor *fsl_edma_prep_memcpy(struct dma_chan *chan,
755755
fsl_desc->iscyclic = false;
756756

757757
fsl_chan->is_sw = true;
758+
if (fsl_edma_drvflags(fsl_chan) & FSL_EDMA_DRV_MEM_REMOTE)
759+
fsl_chan->is_remote = true;
758760

759761
/* To match with copy_align and max_seg_size so 1 tcd is enough */
760762
fsl_edma_fill_tcd(fsl_chan, fsl_desc->tcd[0].vtcd, dma_src, dma_dst,
@@ -848,6 +850,7 @@ void fsl_edma_free_chan_resources(struct dma_chan *chan)
848850
fsl_chan->tcd_pool = NULL;
849851
fsl_chan->is_sw = false;
850852
fsl_chan->srcid = 0;
853+
fsl_chan->is_remote = false;
851854
if (fsl_edma_drvflags(fsl_chan) & FSL_EDMA_DRV_HAS_CHCLK)
852855
clk_disable_unprepare(fsl_chan->clk);
853856
}

drivers/dma/fsl-edma-common.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ struct fsl_edma_desc {
194194
#define FSL_EDMA_DRV_HAS_PD BIT(5)
195195
#define FSL_EDMA_DRV_HAS_CHCLK BIT(6)
196196
#define FSL_EDMA_DRV_HAS_CHMUX BIT(7)
197+
#define FSL_EDMA_DRV_MEM_REMOTE BIT(8)
197198
/* control and status register is in tcd address space, edma3 reg layout */
198199
#define FSL_EDMA_DRV_SPLIT_REG BIT(9)
199200
#define FSL_EDMA_DRV_BUS_8BYTE BIT(10)

drivers/dma/fsl-edma-main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ static struct fsl_edma_drvdata imx7ulp_data = {
343343
};
344344

345345
static struct fsl_edma_drvdata imx8qm_data = {
346-
.flags = FSL_EDMA_DRV_HAS_PD | FSL_EDMA_DRV_EDMA3,
346+
.flags = FSL_EDMA_DRV_HAS_PD | FSL_EDMA_DRV_EDMA3 | FSL_EDMA_DRV_MEM_REMOTE,
347347
.chreg_space_sz = 0x10000,
348348
.chreg_off = 0x10000,
349349
.setup_irq = fsl_edma3_irq_init,

0 commit comments

Comments
 (0)