[PATCH 1/10] LPC32XX: 001-mmc.2: Define + Implement DMA_FORCE_BURST for pl08x (V2)
Cedric Berger
cedric at precidata.com
Tue Apr 23 04:02:17 EDT 2013
To implement the MMC driver on LPC32xx (and other silicon using PL08x+PL18x),
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
Signed-off-by: Gabriele Mondada <gabriele at precidata.com>
---
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;
More information about the linux-arm-kernel
mailing list