From: Caesar Wang <wxt@rock-chips.com>
To: Heiko Stuebner <heiko@sntech.de>, Vinod Koul <vinod.koul@intel.com>
Cc: Sonny Rao <sonnyrao@chromium.org>,
shawn.lin@rock-chips.com, dianders@chromium.org,
linux-rockchip@lists.infradead.org,
Boojin Kim <boojin.kim@samsung.com>,
Addy Ke <addy.ke@rock-chips.com>, Olof Johansson <olof@lixom.net>,
Caesar Wang <wxt@rock-chips.com>,
Dan Williams <dan.j.williams@intel.com>,
dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v7 1/9] dmaengine: pl330: support burst mode for dev-to-mem and mem-to-dev transmit
Date: Fri, 22 Jan 2016 19:06:44 +0800 [thread overview]
Message-ID: <1453460812-8498-2-git-send-email-wxt@rock-chips.com> (raw)
In-Reply-To: <1453460812-8498-1-git-send-email-wxt@rock-chips.com>
From: Boojin Kim <boojin.kim@samsung.com>
This patch adds to support burst mode for dev-to-mem and
mem-to-dev transmit.
Signed-off-by: Boojin Kim <boojin.kim@samsung.com>
Signed-off-by: Addy Ke <addy.ke@rock-chips.com>
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
cc: Heiko Stuebner <heiko@sntech.de>
cc: Doug Anderson <dianders@chromium.org>
cc: Olof Johansson <olof@lixom.net>
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
---
Changes in v7:
- As vinod comments, fix the subsystem name.
Changes in v6: None
Changes in v5:
- add Mark's tag for spi changes
- remove unnecessary whitespace change
- use switch statement for i2s quirk
Changes in v4:
- remove spi & i2s dts changes and query quirk from dmaengine API
suggeseted by Mark.
- fix typo
- Add dmaengine_get_quirk hook and implement it for pl330
Changes in v3:
- add Sunny's tag
- add more rockchip drivers' changes in this patchset
Changes in v2:
- amend the author
- reorder the patches suggested by Doug
- add Reviewed-by: Doug Anderson <dianders@chromium.org> for
rk3288.dtsi patch and arm-pl330.txt patch
Changes in v1:
- rename broken-no-flushp to "arm,pl330-broken-no-flushp" suggested
by Krzysztof.
- add From original author.
- remove Sunny's tag
drivers/dma/pl330.c | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
index 17ee758..7cdf8d4 100644
--- a/drivers/dma/pl330.c
+++ b/drivers/dma/pl330.c
@@ -1141,10 +1141,13 @@ static inline int _ldst_devtomem(unsigned dry_run, u8 buf[],
const struct _xfer_spec *pxs, int cyc)
{
int off = 0;
+ enum pl330_cond cond;
+
+ cond = (pxs->desc->rqcfg.brst_len == 1) ? SINGLE : BURST;
while (cyc--) {
- off += _emit_WFP(dry_run, &buf[off], SINGLE, pxs->desc->peri);
- off += _emit_LDP(dry_run, &buf[off], SINGLE, pxs->desc->peri);
+ off += _emit_WFP(dry_run, &buf[off], cond, pxs->desc->peri);
+ off += _emit_LDP(dry_run, &buf[off], cond, pxs->desc->peri);
off += _emit_ST(dry_run, &buf[off], ALWAYS);
off += _emit_FLUSHP(dry_run, &buf[off], pxs->desc->peri);
}
@@ -1156,11 +1159,14 @@ static inline int _ldst_memtodev(unsigned dry_run, u8 buf[],
const struct _xfer_spec *pxs, int cyc)
{
int off = 0;
+ enum pl330_cond cond;
+
+ cond = (pxs->desc->rqcfg.brst_len == 1) ? SINGLE : BURST;
while (cyc--) {
- off += _emit_WFP(dry_run, &buf[off], SINGLE, pxs->desc->peri);
+ off += _emit_WFP(dry_run, &buf[off], cond, pxs->desc->peri);
off += _emit_LD(dry_run, &buf[off], ALWAYS);
- off += _emit_STP(dry_run, &buf[off], SINGLE, pxs->desc->peri);
+ off += _emit_STP(dry_run, &buf[off], cond, pxs->desc->peri);
off += _emit_FLUSHP(dry_run, &buf[off], pxs->desc->peri);
}
@@ -1199,7 +1205,7 @@ static inline int _loop(unsigned dry_run, u8 buf[],
struct _arg_LPEND lpend;
if (*bursts == 1)
- return _bursts(dry_run, buf, pxs, 1);
+ return _bursts(pl330, dry_run, buf, pxs, 1);
/* Max iterations possible in DMALP is 256 */
if (*bursts >= 256*256) {
@@ -2560,7 +2566,7 @@ static struct dma_async_tx_descriptor *pl330_prep_dma_cyclic(
desc->rqtype = direction;
desc->rqcfg.brst_size = pch->burst_sz;
- desc->rqcfg.brst_len = 1;
+ desc->rqcfg.brst_len = pch->burst_len;
desc->bytes_requested = period_len;
fill_px(&desc->px, dst, src, period_len);
@@ -2705,7 +2711,7 @@ pl330_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
}
desc->rqcfg.brst_size = pch->burst_sz;
- desc->rqcfg.brst_len = 1;
+ desc->rqcfg.brst_len = pch->burst_len;
desc->rqtype = direction;
desc->bytes_requested = sg_dma_len(sg);
}
--
1.9.1
next prev parent reply other threads:[~2016-01-22 11:08 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-22 11:06 [PATCH v7 0/9] Fix broken DMAFLUSHP on Rockchips platform Caesar Wang
2016-01-22 11:06 ` Caesar Wang [this message]
2016-02-09 3:32 ` [PATCH v7 1/9] dmaengine: pl330: support burst mode for dev-to-mem and mem-to-dev transmit Vinod Koul
2016-01-22 11:06 ` [PATCH v7 2/9] dt/bindings: arm-pl330: add description of arm, pl330-broken-no-flushp Caesar Wang
2016-01-22 22:29 ` Rob Herring
2016-02-09 3:32 ` Vinod Koul
2016-01-22 11:06 ` [PATCH v7 3/9] dmaengine: pl330: add quirk for broken no flushp Caesar Wang
2016-02-09 3:33 ` Vinod Koul
2016-01-22 11:06 ` [PATCH v7 4/9] ARM: dts: Add arm, pl330-broken-no-flushp quirk for rk3288 platform Caesar Wang
2016-01-22 11:06 ` [PATCH v7 5/9] ARM: dts: Add arm, pl330-broken-no-flushp quirk for rk3xxx platform Caesar Wang
2016-01-22 11:06 ` [PATCH v7 6/9] ARM: dts: add pl330-broken-no-flushp quirk for rk3036 SoCs Caesar Wang
2016-02-09 17:29 ` Heiko Stuebner
2016-01-22 11:06 ` [PATCH v7 7/9] dmaengine: core: expose max burst capability to clients Caesar Wang
2016-02-09 3:33 ` Vinod Koul
2016-01-22 11:06 ` [PATCH v7 8/9] dmaengine: pl330: add max burst for dmaengine Caesar Wang
2016-02-09 3:34 ` Vinod Koul
2016-01-22 11:06 ` [PATCH v7 9/9] spi: rockchip: modify DMA max burst to 1 Caesar Wang
2016-02-09 3:34 ` Vinod Koul
2016-02-01 6:56 ` [PATCH v7 0/9] Fix broken DMAFLUSHP on Rockchips platform Caesar Wang
2016-02-08 3:11 ` Vinod Koul
2016-02-08 9:27 ` Heiko Stuebner
2016-02-08 13:14 ` Vinod Koul
2016-02-08 14:02 ` Mark Brown
2016-02-08 22:21 ` Heiko Stuebner
2016-02-09 3:21 ` Vinod Koul
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1453460812-8498-2-git-send-email-wxt@rock-chips.com \
--to=wxt@rock-chips.com \
--cc=addy.ke@rock-chips.com \
--cc=boojin.kim@samsung.com \
--cc=dan.j.williams@intel.com \
--cc=dianders@chromium.org \
--cc=dmaengine@vger.kernel.org \
--cc=heiko@sntech.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=olof@lixom.net \
--cc=shawn.lin@rock-chips.com \
--cc=sonnyrao@chromium.org \
--cc=vinod.koul@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).