From: cedric@precidata.com (Cedric Berger)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/10] LPC32XX: 001-mmc.1: Define + Implement DMA_FORCE_BURST for pl032
Date: Wed, 17 Apr 2013 22:42:49 +0200 (CEST) [thread overview]
Message-ID: <mailman.13.1366231399.1198.linux-arm-kernel@lists.infradead.org> (raw)
Signed-off-by: Gabriele Mondada <gabriele@precidata.com>
---
To implement the MMC driver on LPC32xx, we need a way to force a DMA burst by
software. This patch defines a new DMA_FORCE_BURST hook and implements it for
the pl08x.c
Index: include/linux/dmaengine.h
===================================================================
--- include/linux/dmaengine.h (revision 1688)
+++ include/linux/dmaengine.h (revision 1736)
@@ -208,6 +208,7 @@
* argument of struct dma_slave_config must be passed in with this
* command.
* @FSLDMA_EXTERNAL_START: this command will put the Freescale DMA controller
+ * @DMA_FORCE_BURST: force DMA burst
* into external start mode.
*/
enum dma_ctrl_cmd {
@@ -216,6 +217,7 @@
DMA_RESUME,
DMA_SLAVE_CONFIG,
FSLDMA_EXTERNAL_START,
+ DMA_FORCE_BURST,
};
/**
Index: drivers/dma/amba-pl08x.c
===================================================================
--- drivers/dma/amba-pl08x.c (revision 1688)
+++ drivers/dma/amba-pl08x.c (revision 1736)
@@ -448,6 +448,19 @@
writel(1 << ch->id, pl08x->base + PL080_TC_CLEAR);
}
+/*
+ * simulate a DMA request by software, generating a burst transfer
+ */
+static void pl08x_force_burst(struct pl08x_dma_chan *plchan)
+{
+ struct pl08x_driver_data *pl08x = plchan->host;
+
+ dev_dbg(&pl08x->adev->dev, "force burst signal=%d plchan=%p\n",
+ plchan->signal, plchan);
+ if (plchan->signal >= 0)
+ writel(1 << plchan->signal, pl08x->base + PL080_SOFT_BREQ);
+}
+
static inline u32 get_bytes_in_cctl(u32 cctl)
{
/* The source width defines the number of bytes */
@@ -1574,6 +1587,9 @@
pl08x_resume_phy_chan(plchan->phychan);
plchan->state = PL08X_CHAN_RUNNING;
break;
+ case DMA_FORCE_BURST:
+ pl08x_force_burst(plchan);
+ break;
default:
/* Unknown command */
ret = -ENXIO;
next reply other threads:[~2013-04-17 20:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-17 20:42 Cedric Berger [this message]
[not found] <E1USZCP-0006Pl-UO@merlin.infradead.org>
2013-04-18 9:48 ` [PATCH 1/10] LPC32XX: 001-mmc.1: Define + Implement DMA_FORCE_BURST for pl032 Russell King - ARM Linux
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=mailman.13.1366231399.1198.linux-arm-kernel@lists.infradead.org \
--to=cedric@precidata.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).