aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma
diff options
context:
space:
mode:
authorRussell King - ARM Linux <linux@arm.linux.org.uk>2011-01-03 17:39:53 -0500
committerDan Williams <dan.j.williams@intel.com>2011-01-04 22:16:12 -0500
commit09b3c323332206aaadfb7aa13efffa82e7719b35 (patch)
treea64ddedf5178eef4bab335f90adcada034c77138 /drivers/dma
parent4983a04fd2562986360b646b378f267308bc22c0 (diff)
ARM: PL08x: assign ccfg DMA request signal in prep_phy_channel()
There is no need to wait until we start processing a tx descriptor before setting up the DMA request selection in the ccfg register. We know which channel and request will be used in prep_phy_channel(), so setup the ccfg request selection at txd creation time in prep_phy_channel(). Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Acked-by: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/dma')
-rw-r--r--drivers/dma/amba-pl08x.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c
index 75f9e2d4b03..f0a29885cb8 100644
--- a/drivers/dma/amba-pl08x.c
+++ b/drivers/dma/amba-pl08x.c
@@ -194,18 +194,10 @@ static void pl08x_start_txd(struct pl08x_dma_chan *plchan,
194 struct pl08x_driver_data *pl08x = plchan->host; 194 struct pl08x_driver_data *pl08x = plchan->host;
195 struct pl08x_phy_chan *phychan = plchan->phychan; 195 struct pl08x_phy_chan *phychan = plchan->phychan;
196 struct pl08x_lli *lli = &txd->llis_va[0]; 196 struct pl08x_lli *lli = &txd->llis_va[0];
197 u32 val, ccfg = txd->ccfg; 197 u32 val;
198 198
199 plchan->at = txd; 199 plchan->at = txd;
200 200
201 /* Assign the flow control signal to this channel */
202 if (txd->direction == DMA_TO_DEVICE)
203 /* Select signal as destination */
204 ccfg |= phychan->signal << PL080_CONFIG_DST_SEL_SHIFT;
205 else if (txd->direction == DMA_FROM_DEVICE)
206 /* Select signal as source */
207 ccfg |= phychan->signal << PL080_CONFIG_SRC_SEL_SHIFT;
208
209 /* Wait for channel inactive */ 201 /* Wait for channel inactive */
210 while (pl08x_phy_channel_busy(phychan)) 202 while (pl08x_phy_channel_busy(phychan))
211 cpu_relax(); 203 cpu_relax();
@@ -214,13 +206,13 @@ static void pl08x_start_txd(struct pl08x_dma_chan *plchan,
214 "WRITE channel %d: csrc=0x%08x, cdst=0x%08x, " 206 "WRITE channel %d: csrc=0x%08x, cdst=0x%08x, "
215 "clli=0x%08x, cctl=0x%08x, ccfg=0x%08x\n", 207 "clli=0x%08x, cctl=0x%08x, ccfg=0x%08x\n",
216 phychan->id, lli->src, lli->dst, lli->lli, lli->cctl, 208 phychan->id, lli->src, lli->dst, lli->lli, lli->cctl,
217 ccfg); 209 txd->ccfg);
218 210
219 writel(lli->src, phychan->base + PL080_CH_SRC_ADDR); 211 writel(lli->src, phychan->base + PL080_CH_SRC_ADDR);
220 writel(lli->dst, phychan->base + PL080_CH_DST_ADDR); 212 writel(lli->dst, phychan->base + PL080_CH_DST_ADDR);
221 writel(lli->lli, phychan->base + PL080_CH_LLI); 213 writel(lli->lli, phychan->base + PL080_CH_LLI);
222 writel(lli->cctl, phychan->base + PL080_CH_CONTROL); 214 writel(lli->cctl, phychan->base + PL080_CH_CONTROL);
223 writel(ccfg, phychan->base + PL080_CH_CONFIG); 215 writel(txd->ccfg, phychan->base + PL080_CH_CONFIG);
224 216
225 /* Enable the DMA channel */ 217 /* Enable the DMA channel */
226 /* Do not access config register until channel shows as disabled */ 218 /* Do not access config register until channel shows as disabled */
@@ -1001,6 +993,12 @@ static int prep_phy_channel(struct pl08x_dma_chan *plchan,
1001 return -EBUSY; 993 return -EBUSY;
1002 } 994 }
1003 ch->signal = ret; 995 ch->signal = ret;
996
997 /* Assign the flow control signal to this channel */
998 if (txd->direction == DMA_TO_DEVICE)
999 txd->ccfg |= ch->signal << PL080_CONFIG_DST_SEL_SHIFT;
1000 else if (txd->direction == DMA_FROM_DEVICE)
1001 txd->ccfg |= ch->signal << PL080_CONFIG_SRC_SEL_SHIFT;
1004 } 1002 }
1005 1003
1006 dev_dbg(&pl08x->adev->dev, "allocated physical channel %d and signal %d for xfer on %s\n", 1004 dev_dbg(&pl08x->adev->dev, "allocated physical channel %d and signal %d for xfer on %s\n",