Skip to content

Commit 002905e

Browse files
Peng Mavinodkoul
authored andcommitted
dmaengine: fsl-edma: support little endian for edma driver
Our platforms with below registers(CHCFG0 - CHCFG15) of eDMA *-----------------------------------------------------------* | Offset | Big endian Register| Little endian Register| |--------------|--------------------|-----------------------| | 0x0 | CHCFG0 | CHCFG3 | |--------------|--------------------|-----------------------| | 0x1 | CHCFG1 | CHCFG2 | |--------------|--------------------|-----------------------| | 0x2 | CHCFG2 | CHCFG1 | |--------------|--------------------|-----------------------| | 0x3 | CHCFG3 | CHCFG0 | |--------------|--------------------|-----------------------| | ... | ...... | ...... | |--------------|--------------------|-----------------------| | 0xC | CHCFG12 | CHCFG15 | |--------------|--------------------|-----------------------| | 0xD | CHCFG13 | CHCFG14 | |--------------|--------------------|-----------------------| | 0xE | CHCFG14 | CHCFG13 | |--------------|--------------------|-----------------------| | 0xF | CHCFG15 | CHCFG12 | *-----------------------------------------------------------* Current eDMA driver does not support Little endian, so this patch is to improve edma driver to support little endian. Signed-off-by: Peng Ma <peng.ma@nxp.com> Signed-off-by: Vinod Koul <vkoul@kernel.org>
1 parent c24a5c7 commit 002905e

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎drivers/dma/fsl-edma-common.c‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,14 @@ void fsl_edma_chan_mux(struct fsl_edma_chan *fsl_chan,
8383
u32 ch = fsl_chan->vchan.chan.chan_id;
8484
void __iomem *muxaddr;
8585
unsigned int chans_per_mux, ch_off;
86+
int endian_diff[4] = {3, 1, -1, -3};
8687

8788
chans_per_mux = fsl_chan->edma->n_chans / DMAMUX_NR;
8889
ch_off = fsl_chan->vchan.chan.chan_id % chans_per_mux;
90+
91+
if (!fsl_chan->edma->big_endian)
92+
ch_off += endian_diff[ch_off % 4];
93+
8994
muxaddr = fsl_chan->edma->muxbase[ch / chans_per_mux];
9095
slot = EDMAMUX_CHCFG_SOURCE(slot);
9196

0 commit comments

Comments
 (0)