Commit 0815f8ea authored by Tomi Valkeinen's avatar Tomi Valkeinen Committed by Tony Lindgren

ARM: OMAP2/3: DMA: implement trans copy and const fill

Implement transparent copy and constant fill features for OMAP2/3.
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@nokia.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent ebe3b0e7
...@@ -310,41 +310,62 @@ EXPORT_SYMBOL(omap_set_dma_transfer_params); ...@@ -310,41 +310,62 @@ EXPORT_SYMBOL(omap_set_dma_transfer_params);
void omap_set_dma_color_mode(int lch, enum omap_dma_color_mode mode, u32 color) void omap_set_dma_color_mode(int lch, enum omap_dma_color_mode mode, u32 color)
{ {
u16 w;
BUG_ON(omap_dma_in_1510_mode()); BUG_ON(omap_dma_in_1510_mode());
if (cpu_class_is_omap2()) { if (cpu_class_is_omap1()) {
REVISIT_24XX(); u16 w;
return;
}
w = dma_read(CCR2(lch)); w = dma_read(CCR2(lch));
w &= ~0x03; w &= ~0x03;
switch (mode) { switch (mode) {
case OMAP_DMA_CONSTANT_FILL: case OMAP_DMA_CONSTANT_FILL:
w |= 0x01; w |= 0x01;
break; break;
case OMAP_DMA_TRANSPARENT_COPY: case OMAP_DMA_TRANSPARENT_COPY:
w |= 0x02; w |= 0x02;
break; break;
case OMAP_DMA_COLOR_DIS: case OMAP_DMA_COLOR_DIS:
break; break;
default: default:
BUG(); BUG();
}
dma_write(w, CCR2(lch));
w = dma_read(LCH_CTRL(lch));
w &= ~0x0f;
/* Default is channel type 2D */
if (mode) {
dma_write((u16)color, COLOR_L(lch));
dma_write((u16)(color >> 16), COLOR_U(lch));
w |= 1; /* Channel type G */
}
dma_write(w, LCH_CTRL(lch));
} }
dma_write(w, CCR2(lch));
w = dma_read(LCH_CTRL(lch)); if (cpu_class_is_omap2()) {
w &= ~0x0f; u32 val;
/* Default is channel type 2D */
if (mode) { val = dma_read(CCR(lch));
dma_write((u16)color, COLOR_L(lch)); val &= ~((1 << 17) | (1 << 16));
dma_write((u16)(color >> 16), COLOR_U(lch));
w |= 1; /* Channel type G */ switch (mode) {
case OMAP_DMA_CONSTANT_FILL:
val |= 1 << 16;
break;
case OMAP_DMA_TRANSPARENT_COPY:
val |= 1 << 17;
break;
case OMAP_DMA_COLOR_DIS:
break;
default:
BUG();
}
dma_write(val, CCR(lch));
color &= 0xffffff;
dma_write(color, COLOR(lch));
} }
dma_write(w, LCH_CTRL(lch));
} }
EXPORT_SYMBOL(omap_set_dma_color_mode); EXPORT_SYMBOL(omap_set_dma_color_mode);
......
...@@ -144,6 +144,7 @@ ...@@ -144,6 +144,7 @@
#define OMAP_DMA4_CSSA_U(n) 0 #define OMAP_DMA4_CSSA_U(n) 0
#define OMAP_DMA4_CDSA_L(n) 0 #define OMAP_DMA4_CDSA_L(n) 0
#define OMAP_DMA4_CDSA_U(n) 0 #define OMAP_DMA4_CDSA_U(n) 0
#define OMAP1_DMA_COLOR(n) 0
/*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/
......
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