Skip to content

Commit e0a08ed

Browse files
nxpfranklivinodkoul
authored andcommitted
dmaengine: fsl-edma: add address for channel mux register in fsl_edma_chan
iMX95 move channel mux register to management page address space. This prepare to support iMX95. Add mux_addr in struct fsl_edma_chan. No function change. Signed-off-by: Frank Li <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent 537df9a commit e0a08ed

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

drivers/dma/fsl-edma-common.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ static void fsl_edma3_enable_request(struct fsl_edma_chan *fsl_chan)
9797
* ch_mux: With the exception of 0, attempts to write a value
9898
* already in use will be forced to 0.
9999
*/
100-
if (!edma_readl_chreg(fsl_chan, ch_mux))
101-
edma_writel_chreg(fsl_chan, fsl_chan->srcid, ch_mux);
100+
if (!edma_readl(fsl_chan->edma, fsl_chan->mux_addr))
101+
edma_writel(fsl_chan->edma, fsl_chan->srcid, fsl_chan->mux_addr);
102102
}
103103

104104
val = edma_readl_chreg(fsl_chan, ch_csr);
@@ -134,7 +134,7 @@ static void fsl_edma3_disable_request(struct fsl_edma_chan *fsl_chan)
134134
flags = fsl_edma_drvflags(fsl_chan);
135135

136136
if (flags & FSL_EDMA_DRV_HAS_CHMUX)
137-
edma_writel_chreg(fsl_chan, 0, ch_mux);
137+
edma_writel(fsl_chan->edma, 0, fsl_chan->mux_addr);
138138

139139
val &= ~EDMA_V3_CH_CSR_ERQ;
140140
edma_writel_chreg(fsl_chan, val, ch_csr);

drivers/dma/fsl-edma-common.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ struct fsl_edma_chan {
145145
enum dma_data_direction dma_dir;
146146
char chan_name[32];
147147
struct fsl_edma_hw_tcd __iomem *tcd;
148+
void __iomem *mux_addr;
148149
u32 real_count;
149150
struct work_struct issue_worker;
150151
struct platform_device *pdev;
@@ -206,6 +207,8 @@ struct fsl_edma_drvdata {
206207
u32 chreg_off;
207208
u32 chreg_space_sz;
208209
u32 flags;
210+
u32 mux_off; /* channel mux register offset */
211+
u32 mux_skip; /* how much skip for each channel */
209212
int (*setup_irq)(struct platform_device *pdev,
210213
struct fsl_edma_engine *fsl_edma);
211214
};

drivers/dma/fsl-edma-main.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,8 @@ static struct fsl_edma_drvdata imx93_data4 = {
359359
.flags = FSL_EDMA_DRV_HAS_CHMUX | FSL_EDMA_DRV_HAS_DMACLK | FSL_EDMA_DRV_EDMA4,
360360
.chreg_space_sz = 0x8000,
361361
.chreg_off = 0x10000,
362+
.mux_off = 0x10000 + offsetof(struct fsl_edma3_ch_reg, ch_mux),
363+
.mux_skip = 0x8000,
362364
.setup_irq = fsl_edma3_irq_init,
363365
};
364366

@@ -532,6 +534,7 @@ static int fsl_edma_probe(struct platform_device *pdev)
532534
offsetof(struct fsl_edma3_ch_reg, tcd) : 0;
533535
fsl_chan->tcd = fsl_edma->membase
534536
+ i * drvdata->chreg_space_sz + drvdata->chreg_off + len;
537+
fsl_chan->mux_addr = fsl_edma->membase + drvdata->mux_off + i * drvdata->mux_skip;
535538

536539
fsl_chan->pdev = pdev;
537540
vchan_init(&fsl_chan->vchan, &fsl_edma->dma_dev);

0 commit comments

Comments
 (0)