aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/layerscape/patches-5.4/806-dma-0004-MLK-15003-1-DMA-fsl-edma-v3-add-one-more-parameter-f.patch
blob: 1af6c7e79d92105792ab7e56b82b3c35ea50ed04 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
From f8692ecd13a787c51eca9234312f5f3fd163a04a Mon Sep 17 00:00:00 2001
From: Shengjiu Wang <shengjiu.wang@freescale.com>
Date: Mon, 5 Jun 2017 11:05:52 +0800
Subject: [PATCH] MLK-15003-1: DMA: fsl-edma-v3: add one more parameter for
 xlate

The parameter is "is_remote", which is to use remote access for
edma, the default access is local access.

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
(cherry picked from commit eee976b30b0523680f30e762742984f5b5a01b97)
---
 drivers/dma/fsl-edma-v3.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

--- a/drivers/dma/fsl-edma-v3.c
+++ b/drivers/dma/fsl-edma-v3.c
@@ -139,6 +139,7 @@ struct fsl_edma3_chan {
 	int				hw_chanid;
 	int				priority;
 	int				is_rxchan;
+	int				is_remote;
 	struct dma_pool			*tcd_pool;
 	u32				chn_real_count;
 	char				txirq_name[32];
@@ -189,6 +190,10 @@ static void fsl_edma3_enable_request(str
 		else
 			val |= EDMA_CH_SBR_WR;
 	}
+
+	if (fsl_chan->is_remote)
+		val &= ~(EDMA_CH_SBR_RD | EDMA_CH_SBR_WR);
+
 	writel(val, addr + EDMA_CH_SBR);
 
 	val = readl(addr + EDMA_CH_CSR);
@@ -686,7 +691,7 @@ static struct dma_chan *fsl_edma3_xlate(
 	struct dma_chan *chan, *_chan;
 	struct fsl_edma3_chan *fsl_chan;
 
-	if (dma_spec->args_count != 3)
+	if (dma_spec->args_count != 4)
 		return NULL;
 
 	mutex_lock(&fsl_edma3->fsl_edma3_mutex);
@@ -701,6 +706,7 @@ static struct dma_chan *fsl_edma3_xlate(
 			chan->device->privatecnt++;
 			fsl_chan->priority = dma_spec->args[1];
 			fsl_chan->is_rxchan = dma_spec->args[2];
+			fsl_chan->is_remote = dma_spec->args[3];
 			mutex_unlock(&fsl_edma3->fsl_edma3_mutex);
 			return chan;
 		}