Commit e26199ae authored by David Griego's avatar David Griego Committed by Kevin Hilman

ARM: DaVinci: Clear an EDMA event

Adds edma_clear_event API support to EDMA.

There has been a change to the MMC interface on TI's DA830/OMAP-L137
architecture that requires setting the DMATRIG bit to trigger
the first read data transfer when doing a read operation using
the CPU, but it has the unintended consequence causing a DMA
event.  Because of this, the next DMA read from the MMC/SD will
fail with an Event Miss. This API will be used to clear the ER.
Signed-off-by: default avatarDavid Griego <dgriego@mvista.com>
Signed-off-by: default avatarSergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: default avatarSudhakar Rajashekhara <sudhakar.raj@ti.com>
Signed-off-by: default avatarKevin Hilman <khilman@deeprootsystems.com>
parent aeb81be7
...@@ -95,6 +95,8 @@ ...@@ -95,6 +95,8 @@
#define EDMA_CCSTAT 0x0640 #define EDMA_CCSTAT 0x0640
#define EDMA_M 0x1000 /* global channel registers */ #define EDMA_M 0x1000 /* global channel registers */
#define EDMA_ECR 0x1008
#define EDMA_ECRH 0x100C
#define EDMA_SHADOW0 0x2000 /* 4 regions shadowing global channels */ #define EDMA_SHADOW0 0x2000 /* 4 regions shadowing global channels */
#define EDMA_PARM 0x4000 /* 128 param entries */ #define EDMA_PARM 0x4000 /* 128 param entries */
...@@ -987,6 +989,22 @@ void edma_clean_channel(unsigned channel) ...@@ -987,6 +989,22 @@ void edma_clean_channel(unsigned channel)
} }
EXPORT_SYMBOL(edma_clean_channel); EXPORT_SYMBOL(edma_clean_channel);
/*
* edma_clear_event - clear an outstanding event on the DMA channel
* Arguments:
* channel - channel number
*/
void edma_clear_event(unsigned channel)
{
if (channel >= num_channels)
return;
if (channel < 32)
edma_write(EDMA_ECR, 1 << channel);
else
edma_write(EDMA_ECRH, 1 << (channel - 32));
}
EXPORT_SYMBOL(edma_clear_event);
/*-----------------------------------------------------------------------*/ /*-----------------------------------------------------------------------*/
static int __init edma_probe(struct platform_device *pdev) static int __init edma_probe(struct platform_device *pdev)
......
...@@ -205,6 +205,7 @@ void edma_read_slot(unsigned slot, struct edmacc_param *params); ...@@ -205,6 +205,7 @@ void edma_read_slot(unsigned slot, struct edmacc_param *params);
int edma_start(unsigned channel); int edma_start(unsigned channel);
void edma_stop(unsigned channel); void edma_stop(unsigned channel);
void edma_clean_channel(unsigned channel); void edma_clean_channel(unsigned channel);
void edma_clear_event(unsigned channel);
void edma_pause(unsigned channel); void edma_pause(unsigned channel);
void edma_resume(unsigned channel); void edma_resume(unsigned channel);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment