All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fabrice Goucem <f-goucem@ti.com>
To: linux-omap@vger.kernel.org
Cc: Fabrice Goucem <f-goucem@ti.com>
Subject: [PATCH] Add support for packet synchronised sDMA transfers.
Date: Wed,  3 Mar 2010 11:20:58 +0100	[thread overview]
Message-ID: <1267611658-18946-1-git-send-email-f-goucem@ti.com> (raw)

System DMA packet synchronisation is currently not supported in the
Linux Kernel.
This patch provides necessary modifications to support packet
synchronisation:
Function omap_set_dma_transfer_params() handles value OMAP_DMA_SYNC_PACKET
to program FS and BS bits of register CCR.
Users can give the packet size to the DMA driver by using parameters
src_fi / dst_fi in functions omap_set_dma_src_params() /
omap_set_dma_dest_params().

Patch has been validated using OMAP's McSPI (on Zoom2, OMAP3430):
McSPI is configured to use DMA transfer.
FIFO are activated with a threshold of 16 bytes (i.e. DMA requests will be
triggered as soon as more than 16 bytes are free in the FIFO).
A frame of 132 elements (bytes) has been transfered, by packets of 16
elements. Resulting transfer was 8 packets of 16 elements plus a last packet
of 4 elements.

Modifications tested building on OMAP2, OMAP3 and OMAP4 configurations.

Signed-off-by: Fabrice Goucem <f-goucem@ti.com>
Acked-by: Venkatraman S <svenkatr@ti.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Acked-by: Shilpa Maddi <s-maddi@ti.com>
---
 arch/arm/plat-omap/dma.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c
index 2ab224c..48f9355 100644
--- a/arch/arm/plat-omap/dma.c
+++ b/arch/arm/plat-omap/dma.c
@@ -293,12 +293,14 @@ void omap_set_dma_transfer_params(int lch, int data_type, int elem_count,
 		val |= (dma_trigger & ~0x1f) << 14;
 		val |= dma_trigger & 0x1f;
 
-		if (sync_mode & OMAP_DMA_SYNC_FRAME)
+		if ((sync_mode == OMAP_DMA_SYNC_FRAME) ||
+		    (sync_mode == OMAP_DMA_SYNC_PACKET))
 			val |= 1 << 5;
 		else
 			val &= ~(1 << 5);
 
-		if (sync_mode & OMAP_DMA_SYNC_BLOCK)
+		if ((sync_mode == OMAP_DMA_SYNC_BLOCK) ||
+		    (sync_mode == OMAP_DMA_SYNC_PACKET))
 			val |= 1 << 18;
 		else
 			val &= ~(1 << 18);
-- 
1.6.0.4


             reply	other threads:[~2010-03-03 10:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-03 10:20 Fabrice Goucem [this message]
2010-03-03 13:02 ` [PATCH] Add support for packet synchronised sDMA transfers hari n
2010-03-09 13:14   ` Goucem, Fabrice
2010-05-11 22:47     ` Tony Lindgren

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=1267611658-18946-1-git-send-email-f-goucem@ti.com \
    --to=f-goucem@ti.com \
    --cc=linux-omap@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.