From 2e9fd45831dc294c634a61a9746e38aed8ea57cd Mon Sep 17 00:00:00 2001 From: hhb Date: Tue, 4 Mar 2014 15:14:02 +0800 Subject: [PATCH] dma pl330:change SINGLE to BURST --- arch/arm/boot/dts/rk3188.dtsi | 4 ---- drivers/dma/pl330.c | 26 +++++++++++++++++++++++--- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/arch/arm/boot/dts/rk3188.dtsi b/arch/arm/boot/dts/rk3188.dtsi index 34d96873a1f1..f4e8d7e25075 100755 --- a/arch/arm/boot/dts/rk3188.dtsi +++ b/arch/arm/boot/dts/rk3188.dtsi @@ -227,8 +227,6 @@ interrupts = , ; #dma-cells = <1>; - #dma-channels = <9>; - #dma-requests = <10>; }; pdma1: pdma@20078000 { @@ -237,8 +235,6 @@ interrupts = , ; #dma-cells = <1>; - #dma-channels = <7>; - #dma-requests = <14>; }; }; diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c index 1244c8f780b3..9ca6f7df9ec1 100644 --- a/drivers/dma/pl330.c +++ b/drivers/dma/pl330.c @@ -1288,10 +1288,17 @@ static inline int _ldst_devtomem(unsigned dry_run, u8 buf[], int off = 0; while (cyc--) { +#ifdef CONFIG_ARCH_ROCKCHIP + off += _emit_WFP(dry_run, &buf[off], BURST, pxs->r->peri); + off += _emit_LDP(dry_run, &buf[off], BURST, pxs->r->peri); + off += _emit_ST(dry_run, &buf[off], ALWAYS); + //off += _emit_FLUSHP(dry_run, &buf[off], pxs->r->peri); //for sdmmc sdio +#else off += _emit_WFP(dry_run, &buf[off], SINGLE, pxs->r->peri); off += _emit_LDP(dry_run, &buf[off], SINGLE, pxs->r->peri); off += _emit_ST(dry_run, &buf[off], ALWAYS); - //off += _emit_FLUSHP(dry_run, &buf[off], pxs->r->peri); //for sdmmc sdio + off += _emit_FLUSHP(dry_run, &buf[off], pxs->r->peri); +#endif } return off; @@ -1303,10 +1310,17 @@ static inline int _ldst_memtodev(unsigned dry_run, u8 buf[], int off = 0; while (cyc--) { +#ifdef CONFIG_ARCH_ROCKCHIP + off += _emit_WFP(dry_run, &buf[off], BURST, pxs->r->peri); + off += _emit_LD(dry_run, &buf[off], ALWAYS); + off += _emit_STP(dry_run, &buf[off], BURST, pxs->r->peri); + //off += _emit_FLUSHP(dry_run, &buf[off], pxs->r->peri); +#else off += _emit_WFP(dry_run, &buf[off], SINGLE, pxs->r->peri); off += _emit_LD(dry_run, &buf[off], ALWAYS); off += _emit_STP(dry_run, &buf[off], SINGLE, pxs->r->peri); - //off += _emit_FLUSHP(dry_run, &buf[off], pxs->r->peri); + off += _emit_FLUSHP(dry_run, &buf[off], pxs->r->peri); +#endif } return off; @@ -2510,7 +2524,13 @@ static enum dma_status pl330_tx_status(struct dma_chan *chan, dma_cookie_t cookie, struct dma_tx_state *txstate) { - return dma_cookie_status(chan, cookie, txstate); + struct dma_pl330_chan *pch = to_pchan(chan); + void __iomem *regs = pch->dmac->pif.base; + struct pl330_thread *pt = pch->pl330_chid; + enum dma_status st; + st = dma_cookie_status(chan, cookie, txstate); + txstate->residue = readl(regs + DA(pt->id)); + return st; } static void pl330_issue_pending(struct dma_chan *chan) -- 2.34.1