2013-10-11 01:07:46

by Qiao Zhou

[permalink] [raw]
Subject: [PATCH v2] dma: mmp-tdma: add multiple burst size support for 910-squ

v1: add multiple burst size support. remove previous fixed 32-byte setting.
v2: correct some missing definition.

Qiao Zhou (1):
dma: mmp_tdma: add multiple burst size support for 910-squ

drivers/dma/mmp_tdma.c | 25 ++++++++++++++++++++++++-
1 files changed, 24 insertions(+), 1 deletions(-)


2013-10-11 01:07:39

by Qiao Zhou

[permalink] [raw]
Subject: [PATCH v2] dma: mmp_tdma: add multiple burst size support for 910-squ

add multiple burst size support for 910-squ.

Signed-off-by: Qiao Zhou <[email protected]>
---
drivers/dma/mmp_tdma.c | 30 +++++++++++++++++++++++++++++-
1 files changed, 29 insertions(+), 1 deletions(-)

diff --git a/drivers/dma/mmp_tdma.c b/drivers/dma/mmp_tdma.c
index 38cb517..f6b9ec7 100644
--- a/drivers/dma/mmp_tdma.c
+++ b/drivers/dma/mmp_tdma.c
@@ -62,6 +62,11 @@
#define TDCR_BURSTSZ_16B (0x3 << 6)
#define TDCR_BURSTSZ_32B (0x6 << 6)
#define TDCR_BURSTSZ_64B (0x7 << 6)
+#define TDCR_BURSTSZ_SQU_1B (0x5 << 6)
+#define TDCR_BURSTSZ_SQU_2B (0x6 << 6)
+#define TDCR_BURSTSZ_SQU_4B (0x0 << 6)
+#define TDCR_BURSTSZ_SQU_8B (0x1 << 6)
+#define TDCR_BURSTSZ_SQU_16B (0x3 << 6)
#define TDCR_BURSTSZ_SQU_32B (0x7 << 6)
#define TDCR_BURSTSZ_128B (0x5 << 6)
#define TDCR_DSTDIR_MSK (0x3 << 4) /* Dst Direction */
@@ -228,8 +233,31 @@ static int mmp_tdma_config_chan(struct mmp_tdma_chan *tdmac)
return -EINVAL;
}
} else if (tdmac->type == PXA910_SQU) {
- tdcr |= TDCR_BURSTSZ_SQU_32B;
tdcr |= TDCR_SSPMOD;
+
+ switch (tdmac->burst_sz) {
+ case 1:
+ tdcr |= TDCR_BURSTSZ_SQU_1B;
+ break;
+ case 2:
+ tdcr |= TDCR_BURSTSZ_SQU_2B;
+ break;
+ case 4:
+ tdcr |= TDCR_BURSTSZ_SQU_4B;
+ break;
+ case 8:
+ tdcr |= TDCR_BURSTSZ_SQU_8B;
+ break;
+ case 16:
+ tdcr |= TDCR_BURSTSZ_SQU_16B;
+ break;
+ case 32:
+ tdcr |= TDCR_BURSTSZ_SQU_32B;
+ break;
+ default:
+ dev_err(tdmac->dev, "mmp_tdma: unknown burst size.\n");
+ return -EINVAL;
+ }
}

writel(tdcr, tdmac->reg_base + TDCR);
--
1.7.0.4

2013-10-11 07:47:23

by Zhangfei Gao

[permalink] [raw]
Subject: Re: [PATCH v2] dma: mmp_tdma: add multiple burst size support for 910-squ

On Fri, Oct 11, 2013 at 9:07 AM, Qiao Zhou <[email protected]> wrote:
> add multiple burst size support for 910-squ.
>
> Signed-off-by: Qiao Zhou <[email protected]>

Acked-by: Zhangfei Gao <[email protected]>

Thanks

2013-10-13 15:55:32

by Vinod Koul

[permalink] [raw]
Subject: Re: [PATCH v2] dma: mmp_tdma: add multiple burst size support for 910-squ

On Fri, Oct 11, 2013 at 09:07:01AM +0800, Qiao Zhou wrote:
> add multiple burst size support for 910-squ.

Applied, thanks

~Vinod