linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: tomasz.figa@gmail.com (Tomasz Figa)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH 05/11] dma: amba-pl08x: Add support for different maximum transfer size
Date: Sun, 16 Jun 2013 22:54:12 +0200	[thread overview]
Message-ID: <1371416058-22047-6-git-send-email-tomasz.figa@gmail.com> (raw)
In-Reply-To: <1371416058-22047-1-git-send-email-tomasz.figa@gmail.com>

PL080S has separate register to store transfer size in, allowing single
transfer to be much larger than in standard PL080.

This patch makes the amba-pl08x driver aware of this and removes writing
transfer size to reserved bits of CH_CONTROL register on PL080S, which
was not a problem witn transfer sizes fitting the original bitfield
of PL080, but now would overwrite other fields.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
---
 drivers/dma/amba-pl08x.c | 22 ++++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c
index d1f1333..eb10eb8 100644
--- a/drivers/dma/amba-pl08x.c
+++ b/drivers/dma/amba-pl08x.c
@@ -112,6 +112,7 @@ struct vendor_data {
 	u8 config_offset;
 	u8 channels;
 	u32 flags;
+	u32 max_transfer_size;
 };
 
 /*
@@ -843,7 +844,10 @@ static inline void prep_byte_width_lli(struct pl08x_driver_data *pl08x,
 		struct pl08x_lli_build_data *bd,
 		u32 *cctl, u32 len, int num_llis, size_t *total_bytes)
 {
-	*cctl = pl08x_cctl_bits(*cctl, 1, 1, len);
+	if (pl08x->vd->flags & PL08X_IS_PL080S)
+		*cctl = pl08x_cctl_bits(*cctl, 1, 1, 0);
+	else
+		*cctl = pl08x_cctl_bits(*cctl, 1, 1, len);
 	pl08x_fill_lli_for_desc(bd, num_llis, len, *cctl, len);
 	(*total_bytes) += len;
 }
@@ -992,7 +996,7 @@ static int pl08x_fill_llis_for_desc(struct pl08x_driver_data *pl08x,
 			 * MIN(buswidths)
 			 */
 			max_bytes_per_lli = bd.srcbus.buswidth *
-				PL080_CONTROL_TRANSFER_SIZE_MASK;
+						pl08x->vd->max_transfer_size;
 			dev_vdbg(&pl08x->adev->dev,
 				"%s max bytes per lli = %zu\n",
 				__func__, max_bytes_per_lli);
@@ -1025,8 +1029,14 @@ static int pl08x_fill_llis_for_desc(struct pl08x_driver_data *pl08x,
 					"size 0x%08zx (remainder 0x%08zx)\n",
 					__func__, lli_len, bd.remainder);
 
-				cctl = pl08x_cctl_bits(cctl, bd.srcbus.buswidth,
-					bd.dstbus.buswidth, tsize);
+				if (pl08x->vd->flags & PL08X_IS_PL080S)
+					cctl = pl08x_cctl_bits(cctl,
+						bd.srcbus.buswidth,
+						bd.dstbus.buswidth, 0);
+				else
+					cctl = pl08x_cctl_bits(cctl,
+						bd.srcbus.buswidth,
+						bd.dstbus.buswidth, tsize);
 				pl08x_fill_lli_for_desc(&bd, num_llis++,
 						lli_len, cctl, tsize);
 				total_bytes += lli_len;
@@ -2092,24 +2102,28 @@ static struct vendor_data vendor_pl080 = {
 	.channels = 8,
 	.flags = PL08X_IS_DUALMASTER,
 	.config_offset = PL080_CH_CONFIG,
+	.max_transfer_size = PL080_CONTROL_TRANSFER_SIZE_MASK,
 };
 
 static struct vendor_data vendor_nomadik = {
 	.channels = 8,
 	.flags = PL08X_IS_DUALMASTER | PL08X_IS_NOMADIK,
 	.config_offset = PL080_CH_CONFIG,
+	.max_transfer_size = PL080_CONTROL_TRANSFER_SIZE_MASK,
 };
 
 static struct vendor_data vendor_pl080s = {
 	.channels = 8,
 	.flags = PL08X_IS_DUALMASTER | PL08X_IS_PL080S,
 	.config_offset = PL080S_CH_CONFIG,
+	.max_transfer_size = PL080S_CONTROL_TRANSFER_SIZE_MASK,
 };
 
 static struct vendor_data vendor_pl081 = {
 	.channels = 2,
 	.flags = 0,
 	.config_offset = PL080_CH_CONFIG,
+	.max_transfer_size = PL080_CONTROL_TRANSFER_SIZE_MASK,
 };
 
 static struct amba_id pl08x_ids[] = {
-- 
1.8.2.1

  parent reply	other threads:[~2013-06-16 20:54 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-16 20:54 [RFC PATCH 00/11] ARM: s3c64xx: Let amba-pl08x driver handle DMA Tomasz Figa
2013-06-16 20:54 ` [RFC PATCH 01/11] dma: amba-pl08x: Use bitmap to pass variant specific quirks Tomasz Figa
2013-06-17 13:25   ` Linus Walleij
2013-06-17 18:48   ` Russell King - ARM Linux
2013-06-17 18:56     ` Tomasz Figa
2013-06-18  7:47       ` Linus Walleij
2013-06-18 13:33         ` Arnd Bergmann
2013-06-16 20:54 ` [RFC PATCH 02/11] dma: amba-pl08x: Refactor pl08x_getbytes_chan() to lower indentation Tomasz Figa
2013-06-17 13:29   ` Linus Walleij
2013-06-16 20:54 ` [RFC PATCH 03/11] dma: amba-pl08x: Add support for different offset of CONFIG register Tomasz Figa
2013-06-17 13:31   ` Linus Walleij
2013-06-17 18:52   ` Russell King - ARM Linux
2013-06-17 19:02     ` Tomasz Figa
2013-06-16 20:54 ` [RFC PATCH 04/11] dma: amba-pl08x: Add support for PL080S variant Tomasz Figa
2013-06-17 13:39   ` Linus Walleij
2013-06-17 18:22     ` Tomasz Figa
2013-06-16 20:54 ` Tomasz Figa [this message]
2013-06-17 13:42   ` [RFC PATCH 05/11] dma: amba-pl08x: Add support for different maximum transfer size Linus Walleij
2013-06-17 18:27     ` Tomasz Figa
2013-06-16 20:54 ` [RFC PATCH 06/11] dma: amba-pl08x: Keep LLIs aligned to 4-word boundary Tomasz Figa
2013-06-17 13:51   ` Linus Walleij
2013-06-17 18:28     ` Tomasz Figa
2013-06-17 19:01     ` Russell King - ARM Linux
2013-06-16 20:54 ` [RFC PATCH 07/11] dmaengine: PL08x: Fix reading the byte count in cctl Tomasz Figa
2013-06-17 13:53   ` Linus Walleij
2013-06-17 18:32     ` Tomasz Figa
2013-06-17 19:03     ` Russell King - ARM Linux
2013-06-16 20:54 ` [RFC PATCH 08/11] dmaengine: PL08x: Add cyclic transfer support Tomasz Figa
2013-06-17 13:57   ` Linus Walleij
2013-06-17 18:52     ` Tomasz Figa
2013-06-17 18:56   ` Russell King - ARM Linux
2013-06-16 20:54 ` [RFC PATCH 09/11] spi: s3c64xx: Do not require legacy DMA API in case of S3C64XX Tomasz Figa
2013-06-17 13:59   ` Linus Walleij
2013-06-17 16:06     ` Mark Brown
2013-06-17 19:36       ` Tomasz Figa
2013-06-16 20:54 ` [RFC PATCH 10/11] ASoC: samsung: " Tomasz Figa
2013-06-17 14:01   ` Linus Walleij
2013-06-16 20:54 ` [RFC PATCH 11/11] ARM: s3c64xx: Add support for DMA using generic amba-pl08x driver Tomasz Figa
2013-06-17 14:04   ` Linus Walleij
2013-06-19 18:23     ` Tomasz Figa
2013-06-19 19:50       ` Linus Walleij
2013-06-17 14:06 ` [RFC PATCH 00/11] ARM: s3c64xx: Let amba-pl08x driver handle DMA Linus Walleij
2013-06-17 19:38   ` Tomasz Figa
2013-06-19 17:40 ` Mark Brown
2013-06-19 18:26   ` Tomasz Figa
2013-06-19 19:01     ` Arnd Bergmann
2013-06-19 19:24       ` Mark Brown
2013-06-19 19:22     ` Mark Brown
2013-06-19 19:32       ` Tomasz Figa
2013-06-19 22:48         ` Mark Brown
2013-06-20  9:24       ` Phil Carmody
2013-06-20 10:35         ` Mark Brown
2013-06-20 11:14           ` Phil Carmody
2013-06-21  9:47             ` Mark Brown

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=1371416058-22047-6-git-send-email-tomasz.figa@gmail.com \
    --to=tomasz.figa@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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).