ath79/mikrotik: use routerbootpart partitions
[oweals/openwrt.git] / target / linux / layerscape / patches-5.4 / 806-dma-0004-MLK-15003-1-DMA-fsl-edma-v3-add-one-more-parameter-f.patch
1 From f8692ecd13a787c51eca9234312f5f3fd163a04a Mon Sep 17 00:00:00 2001
2 From: Shengjiu Wang <shengjiu.wang@freescale.com>
3 Date: Mon, 5 Jun 2017 11:05:52 +0800
4 Subject: [PATCH] MLK-15003-1: DMA: fsl-edma-v3: add one more parameter for
5  xlate
6
7 The parameter is "is_remote", which is to use remote access for
8 edma, the default access is local access.
9
10 Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
11 (cherry picked from commit eee976b30b0523680f30e762742984f5b5a01b97)
12 ---
13  drivers/dma/fsl-edma-v3.c | 8 +++++++-
14  1 file changed, 7 insertions(+), 1 deletion(-)
15
16 --- a/drivers/dma/fsl-edma-v3.c
17 +++ b/drivers/dma/fsl-edma-v3.c
18 @@ -139,6 +139,7 @@ struct fsl_edma3_chan {
19         int                             hw_chanid;
20         int                             priority;
21         int                             is_rxchan;
22 +       int                             is_remote;
23         struct dma_pool                 *tcd_pool;
24         u32                             chn_real_count;
25         char                            txirq_name[32];
26 @@ -189,6 +190,10 @@ static void fsl_edma3_enable_request(str
27                 else
28                         val |= EDMA_CH_SBR_WR;
29         }
30 +
31 +       if (fsl_chan->is_remote)
32 +               val &= ~(EDMA_CH_SBR_RD | EDMA_CH_SBR_WR);
33 +
34         writel(val, addr + EDMA_CH_SBR);
35  
36         val = readl(addr + EDMA_CH_CSR);
37 @@ -686,7 +691,7 @@ static struct dma_chan *fsl_edma3_xlate(
38         struct dma_chan *chan, *_chan;
39         struct fsl_edma3_chan *fsl_chan;
40  
41 -       if (dma_spec->args_count != 3)
42 +       if (dma_spec->args_count != 4)
43                 return NULL;
44  
45         mutex_lock(&fsl_edma3->fsl_edma3_mutex);
46 @@ -701,6 +706,7 @@ static struct dma_chan *fsl_edma3_xlate(
47                         chan->device->privatecnt++;
48                         fsl_chan->priority = dma_spec->args[1];
49                         fsl_chan->is_rxchan = dma_spec->args[2];
50 +                       fsl_chan->is_remote = dma_spec->args[3];
51                         mutex_unlock(&fsl_edma3->fsl_edma3_mutex);
52                         return chan;
53                 }