diff options
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/plat-omap/dma.c | 41 |
1 files changed, 37 insertions, 4 deletions
diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c index aa1cf79f9543..8e7c33656b52 100644 --- a/arch/arm/plat-omap/dma.c +++ b/arch/arm/plat-omap/dma.c | |||
@@ -292,22 +292,39 @@ void omap_set_dma_src_data_pack(int lch, int enable) | |||
292 | 292 | ||
293 | void omap_set_dma_src_burst_mode(int lch, enum omap_dma_burst_mode burst_mode) | 293 | void omap_set_dma_src_burst_mode(int lch, enum omap_dma_burst_mode burst_mode) |
294 | { | 294 | { |
295 | unsigned int burst = 0; | ||
295 | OMAP_DMA_CSDP_REG(lch) &= ~(0x03 << 7); | 296 | OMAP_DMA_CSDP_REG(lch) &= ~(0x03 << 7); |
296 | 297 | ||
297 | switch (burst_mode) { | 298 | switch (burst_mode) { |
298 | case OMAP_DMA_DATA_BURST_DIS: | 299 | case OMAP_DMA_DATA_BURST_DIS: |
299 | break; | 300 | break; |
300 | case OMAP_DMA_DATA_BURST_4: | 301 | case OMAP_DMA_DATA_BURST_4: |
301 | OMAP_DMA_CSDP_REG(lch) |= (0x02 << 7); | 302 | if (cpu_is_omap24xx()) |
303 | burst = 0x1; | ||
304 | else | ||
305 | burst = 0x2; | ||
302 | break; | 306 | break; |
303 | case OMAP_DMA_DATA_BURST_8: | 307 | case OMAP_DMA_DATA_BURST_8: |
304 | /* not supported by current hardware | 308 | if (cpu_is_omap24xx()) { |
309 | burst = 0x2; | ||
310 | break; | ||
311 | } | ||
312 | /* not supported by current hardware on OMAP1 | ||
305 | * w |= (0x03 << 7); | 313 | * w |= (0x03 << 7); |
306 | * fall through | 314 | * fall through |
307 | */ | 315 | */ |
316 | case OMAP_DMA_DATA_BURST_16: | ||
317 | if (cpu_is_omap24xx()) { | ||
318 | burst = 0x3; | ||
319 | break; | ||
320 | } | ||
321 | /* OMAP1 don't support burst 16 | ||
322 | * fall through | ||
323 | */ | ||
308 | default: | 324 | default: |
309 | BUG(); | 325 | BUG(); |
310 | } | 326 | } |
327 | OMAP_DMA_CSDP_REG(lch) |= (burst << 7); | ||
311 | } | 328 | } |
312 | 329 | ||
313 | /* Note that dest_port is only for OMAP1 */ | 330 | /* Note that dest_port is only for OMAP1 */ |
@@ -354,22 +371,38 @@ void omap_set_dma_dest_data_pack(int lch, int enable) | |||
354 | 371 | ||
355 | void omap_set_dma_dest_burst_mode(int lch, enum omap_dma_burst_mode burst_mode) | 372 | void omap_set_dma_dest_burst_mode(int lch, enum omap_dma_burst_mode burst_mode) |
356 | { | 373 | { |
374 | unsigned int burst = 0; | ||
357 | OMAP_DMA_CSDP_REG(lch) &= ~(0x03 << 14); | 375 | OMAP_DMA_CSDP_REG(lch) &= ~(0x03 << 14); |
358 | 376 | ||
359 | switch (burst_mode) { | 377 | switch (burst_mode) { |
360 | case OMAP_DMA_DATA_BURST_DIS: | 378 | case OMAP_DMA_DATA_BURST_DIS: |
361 | break; | 379 | break; |
362 | case OMAP_DMA_DATA_BURST_4: | 380 | case OMAP_DMA_DATA_BURST_4: |
363 | OMAP_DMA_CSDP_REG(lch) |= (0x02 << 14); | 381 | if (cpu_is_omap24xx()) |
382 | burst = 0x1; | ||
383 | else | ||
384 | burst = 0x2; | ||
364 | break; | 385 | break; |
365 | case OMAP_DMA_DATA_BURST_8: | 386 | case OMAP_DMA_DATA_BURST_8: |
366 | OMAP_DMA_CSDP_REG(lch) |= (0x03 << 14); | 387 | if (cpu_is_omap24xx()) |
388 | burst = 0x2; | ||
389 | else | ||
390 | burst = 0x3; | ||
367 | break; | 391 | break; |
392 | case OMAP_DMA_DATA_BURST_16: | ||
393 | if (cpu_is_omap24xx()) { | ||
394 | burst = 0x3; | ||
395 | break; | ||
396 | } | ||
397 | /* OMAP1 don't support burst 16 | ||
398 | * fall through | ||
399 | */ | ||
368 | default: | 400 | default: |
369 | printk(KERN_ERR "Invalid DMA burst mode\n"); | 401 | printk(KERN_ERR "Invalid DMA burst mode\n"); |
370 | BUG(); | 402 | BUG(); |
371 | return; | 403 | return; |
372 | } | 404 | } |
405 | OMAP_DMA_CSDP_REG(lch) |= (burst << 14); | ||
373 | } | 406 | } |
374 | 407 | ||
375 | static inline void omap_enable_channel_irq(int lch) | 408 | static inline void omap_enable_channel_irq(int lch) |