Commit 6dc3c8f2 authored by Kyungmin Park's avatar Kyungmin Park Committed by Tony Lindgren

ARM: OMAP: OMAP2 DMA burst support

OMAP2 DMA burst setting support
Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent e32f7ec2
...@@ -292,22 +292,39 @@ void omap_set_dma_src_data_pack(int lch, int enable) ...@@ -292,22 +292,39 @@ void omap_set_dma_src_data_pack(int lch, int enable)
void omap_set_dma_src_burst_mode(int lch, enum omap_dma_burst_mode burst_mode) void omap_set_dma_src_burst_mode(int lch, enum omap_dma_burst_mode burst_mode)
{ {
unsigned int burst = 0;
OMAP_DMA_CSDP_REG(lch) &= ~(0x03 << 7); OMAP_DMA_CSDP_REG(lch) &= ~(0x03 << 7);
switch (burst_mode) { switch (burst_mode) {
case OMAP_DMA_DATA_BURST_DIS: case OMAP_DMA_DATA_BURST_DIS:
break; break;
case OMAP_DMA_DATA_BURST_4: case OMAP_DMA_DATA_BURST_4:
OMAP_DMA_CSDP_REG(lch) |= (0x02 << 7); if (cpu_is_omap24xx())
burst = 0x1;
else
burst = 0x2;
break; break;
case OMAP_DMA_DATA_BURST_8: case OMAP_DMA_DATA_BURST_8:
/* not supported by current hardware if (cpu_is_omap24xx()) {
burst = 0x2;
break;
}
/* not supported by current hardware on OMAP1
* w |= (0x03 << 7); * w |= (0x03 << 7);
* fall through * fall through
*/ */
case OMAP_DMA_DATA_BURST_16:
if (cpu_is_omap24xx()) {
burst = 0x3;
break;
}
/* OMAP1 don't support burst 16
* fall through
*/
default: default:
BUG(); BUG();
} }
OMAP_DMA_CSDP_REG(lch) |= (burst << 7);
} }
/* Note that dest_port is only for OMAP1 */ /* Note that dest_port is only for OMAP1 */
...@@ -354,22 +371,38 @@ void omap_set_dma_dest_data_pack(int lch, int enable) ...@@ -354,22 +371,38 @@ void omap_set_dma_dest_data_pack(int lch, int enable)
void omap_set_dma_dest_burst_mode(int lch, enum omap_dma_burst_mode burst_mode) void omap_set_dma_dest_burst_mode(int lch, enum omap_dma_burst_mode burst_mode)
{ {
unsigned int burst = 0;
OMAP_DMA_CSDP_REG(lch) &= ~(0x03 << 14); OMAP_DMA_CSDP_REG(lch) &= ~(0x03 << 14);
switch (burst_mode) { switch (burst_mode) {
case OMAP_DMA_DATA_BURST_DIS: case OMAP_DMA_DATA_BURST_DIS:
break; break;
case OMAP_DMA_DATA_BURST_4: case OMAP_DMA_DATA_BURST_4:
OMAP_DMA_CSDP_REG(lch) |= (0x02 << 14); if (cpu_is_omap24xx())
burst = 0x1;
else
burst = 0x2;
break; break;
case OMAP_DMA_DATA_BURST_8: case OMAP_DMA_DATA_BURST_8:
OMAP_DMA_CSDP_REG(lch) |= (0x03 << 14); if (cpu_is_omap24xx())
burst = 0x2;
else
burst = 0x3;
break; break;
case OMAP_DMA_DATA_BURST_16:
if (cpu_is_omap24xx()) {
burst = 0x3;
break;
}
/* OMAP1 don't support burst 16
* fall through
*/
default: default:
printk(KERN_ERR "Invalid DMA burst mode\n"); printk(KERN_ERR "Invalid DMA burst mode\n");
BUG(); BUG();
return; return;
} }
OMAP_DMA_CSDP_REG(lch) |= (burst << 14);
} }
static inline void omap_enable_channel_irq(int lch) static inline void omap_enable_channel_irq(int lch)
......
...@@ -315,11 +315,11 @@ enum { ...@@ -315,11 +315,11 @@ enum {
OMAP_LCD_DMA_B2_BOTTOM OMAP_LCD_DMA_B2_BOTTOM
}; };
/* REVISIT: Check if BURST_4 is really 1 (or 2) */
enum omap_dma_burst_mode { enum omap_dma_burst_mode {
OMAP_DMA_DATA_BURST_DIS = 0, OMAP_DMA_DATA_BURST_DIS = 0,
OMAP_DMA_DATA_BURST_4, OMAP_DMA_DATA_BURST_4,
OMAP_DMA_DATA_BURST_8 OMAP_DMA_DATA_BURST_8,
OMAP_DMA_DATA_BURST_16,
}; };
enum omap_dma_color_mode { enum omap_dma_color_mode {
......
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