2 * linux/arch/arm/plat-omap/dma.c
4 * Copyright (C) 2003 Nokia Corporation
5 * Author: Juha Yrjölä <juha.yrjola@nokia.com>
6 * DMA channel linking for 1610 by Samuel Ortiz <samuel.ortiz@nokia.com>
7 * Graphics DMA and LCD DMA graphics tranformations
8 * by Imre Deak <imre.deak@nokia.com>
9 * OMAP2/3 support Copyright (C) 2004-2007 Texas Instruments, Inc.
10 * Merged to support both OMAP1 and OMAP2 by Tony Lindgren <tony@atomide.com>
11 * Some functions based on earlier dma-omap.c Copyright (C) 2001 RidgeRun, Inc.
13 * Support functions for the OMAP internal DMA channels.
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License version 2 as
17 * published by the Free Software Foundation.
21 #include <linux/module.h>
22 #include <linux/init.h>
23 #include <linux/sched.h>
24 #include <linux/spinlock.h>
25 #include <linux/errno.h>
26 #include <linux/interrupt.h>
27 #include <linux/irq.h>
29 #include <asm/system.h>
30 #include <asm/hardware.h>
34 #include <asm/arch/tc.h>
39 #define debug_printk(x) printk x
41 #define debug_printk(x)
44 #define OMAP_DMA_ACTIVE 0x01
45 #define OMAP_DMA_CCR_EN (1 << 7)
46 #define OMAP2_DMA_CSR_CLEAR_MASK 0xffe
48 #define OMAP_FUNC_MUX_ARM_BASE (0xfffe1000 + 0xec)
50 static int enable_1510_mode = 0;
58 void (* callback)(int lch, u16 ch_status, void *data);
63 static int dma_chan_count;
65 static spinlock_t dma_chan_lock;
66 static struct omap_dma_lch dma_chan[OMAP_LOGICAL_DMA_CH_COUNT];
68 static const u8 omap1_dma_irq[OMAP_LOGICAL_DMA_CH_COUNT] = {
69 INT_DMA_CH0_6, INT_DMA_CH1_7, INT_DMA_CH2_8, INT_DMA_CH3,
70 INT_DMA_CH4, INT_DMA_CH5, INT_1610_DMA_CH6, INT_1610_DMA_CH7,
71 INT_1610_DMA_CH8, INT_1610_DMA_CH9, INT_1610_DMA_CH10,
72 INT_1610_DMA_CH11, INT_1610_DMA_CH12, INT_1610_DMA_CH13,
73 INT_1610_DMA_CH14, INT_1610_DMA_CH15, INT_DMA_LCD
76 #define REVISIT_24XX() printk(KERN_ERR "FIXME: no %s on 24xx\n", \
79 #ifdef CONFIG_ARCH_OMAP15XX
80 /* Returns 1 if the DMA module is in OMAP1510-compatible mode, 0 otherwise */
81 int omap_dma_in_1510_mode(void)
83 return enable_1510_mode;
86 #define omap_dma_in_1510_mode() 0
89 #ifdef CONFIG_ARCH_OMAP1
90 static inline int get_gdma_dev(int req)
92 u32 reg = OMAP_FUNC_MUX_ARM_BASE + ((req - 1) / 5) * 4;
93 int shift = ((req - 1) % 5) * 6;
95 return ((omap_readl(reg) >> shift) & 0x3f) + 1;
98 static inline void set_gdma_dev(int req, int dev)
100 u32 reg = OMAP_FUNC_MUX_ARM_BASE + ((req - 1) / 5) * 4;
101 int shift = ((req - 1) % 5) * 6;
105 l &= ~(0x3f << shift);
106 l |= (dev - 1) << shift;
110 #define set_gdma_dev(req, dev) do {} while (0)
113 static void clear_lch_regs(int lch)
116 u32 lch_base = OMAP_DMA_BASE + lch * 0x40;
118 for (i = 0; i < 0x2c; i += 2)
119 omap_writew(0, lch_base + i);
122 void omap_set_dma_priority(int lch, int dst_port, int priority)
127 if (cpu_class_is_omap1()) {
129 case OMAP_DMA_PORT_OCP_T1: /* FFFECC00 */
130 reg = OMAP_TC_OCPT1_PRIOR;
132 case OMAP_DMA_PORT_OCP_T2: /* FFFECCD0 */
133 reg = OMAP_TC_OCPT2_PRIOR;
135 case OMAP_DMA_PORT_EMIFF: /* FFFECC08 */
136 reg = OMAP_TC_EMIFF_PRIOR;
138 case OMAP_DMA_PORT_EMIFS: /* FFFECC04 */
139 reg = OMAP_TC_EMIFS_PRIOR;
147 l |= (priority & 0xf) << 8;
151 if (cpu_class_is_omap2()) {
153 OMAP_DMA_CCR_REG(lch) |= (1 << 6);
155 OMAP_DMA_CCR_REG(lch) &= ~(1 << 6);
159 void omap_set_dma_transfer_params(int lch, int data_type, int elem_count,
160 int frame_count, int sync_mode,
161 int dma_trigger, int src_or_dst_synch)
163 OMAP_DMA_CSDP_REG(lch) &= ~0x03;
164 OMAP_DMA_CSDP_REG(lch) |= data_type;
166 if (cpu_class_is_omap1()) {
167 OMAP_DMA_CCR_REG(lch) &= ~(1 << 5);
168 if (sync_mode == OMAP_DMA_SYNC_FRAME)
169 OMAP_DMA_CCR_REG(lch) |= 1 << 5;
171 OMAP1_DMA_CCR2_REG(lch) &= ~(1 << 2);
172 if (sync_mode == OMAP_DMA_SYNC_BLOCK)
173 OMAP1_DMA_CCR2_REG(lch) |= 1 << 2;
176 if (cpu_class_is_omap2() && dma_trigger) {
177 u32 val = OMAP_DMA_CCR_REG(lch);
180 if (dma_trigger > 63)
182 if (dma_trigger > 31)
186 val |= (dma_trigger & 0x1f);
188 if (sync_mode & OMAP_DMA_SYNC_FRAME)
193 if (sync_mode & OMAP_DMA_SYNC_BLOCK)
198 if (src_or_dst_synch)
199 val |= 1 << 24; /* source synch */
201 val &= ~(1 << 24); /* dest synch */
203 OMAP_DMA_CCR_REG(lch) = val;
206 OMAP_DMA_CEN_REG(lch) = elem_count;
207 OMAP_DMA_CFN_REG(lch) = frame_count;
210 void omap_set_dma_color_mode(int lch, enum omap_dma_color_mode mode, u32 color)
214 BUG_ON(omap_dma_in_1510_mode());
216 if (cpu_class_is_omap2()) {
221 w = OMAP1_DMA_CCR2_REG(lch) & ~0x03;
223 case OMAP_DMA_CONSTANT_FILL:
226 case OMAP_DMA_TRANSPARENT_COPY:
229 case OMAP_DMA_COLOR_DIS:
234 OMAP1_DMA_CCR2_REG(lch) = w;
236 w = OMAP1_DMA_LCH_CTRL_REG(lch) & ~0x0f;
237 /* Default is channel type 2D */
239 OMAP1_DMA_COLOR_L_REG(lch) = (u16)color;
240 OMAP1_DMA_COLOR_U_REG(lch) = (u16)(color >> 16);
241 w |= 1; /* Channel type G */
243 OMAP1_DMA_LCH_CTRL_REG(lch) = w;
246 void omap_set_dma_write_mode(int lch, enum omap_dma_write_mode mode)
248 if (cpu_class_is_omap2()) {
249 OMAP_DMA_CSDP_REG(lch) &= ~(0x3 << 16);
250 OMAP_DMA_CSDP_REG(lch) |= (mode << 16);
254 /* Note that src_port is only for omap1 */
255 void omap_set_dma_src_params(int lch, int src_port, int src_amode,
256 unsigned long src_start,
257 int src_ei, int src_fi)
259 if (cpu_class_is_omap1()) {
260 OMAP_DMA_CSDP_REG(lch) &= ~(0x1f << 2);
261 OMAP_DMA_CSDP_REG(lch) |= src_port << 2;
264 OMAP_DMA_CCR_REG(lch) &= ~(0x03 << 12);
265 OMAP_DMA_CCR_REG(lch) |= src_amode << 12;
267 if (cpu_class_is_omap1()) {
268 OMAP1_DMA_CSSA_U_REG(lch) = src_start >> 16;
269 OMAP1_DMA_CSSA_L_REG(lch) = src_start;
272 if (cpu_class_is_omap2())
273 OMAP2_DMA_CSSA_REG(lch) = src_start;
275 OMAP_DMA_CSEI_REG(lch) = src_ei;
276 OMAP_DMA_CSFI_REG(lch) = src_fi;
279 void omap_set_dma_params(int lch, struct omap_dma_channel_params * params)
281 omap_set_dma_transfer_params(lch, params->data_type,
282 params->elem_count, params->frame_count,
283 params->sync_mode, params->trigger,
284 params->src_or_dst_synch);
285 omap_set_dma_src_params(lch, params->src_port,
286 params->src_amode, params->src_start,
287 params->src_ei, params->src_fi);
289 omap_set_dma_dest_params(lch, params->dst_port,
290 params->dst_amode, params->dst_start,
291 params->dst_ei, params->dst_fi);
292 if (params->read_prio || params->write_prio)
293 omap_dma_set_prio_lch(lch, params->read_prio,
297 void omap_set_dma_src_index(int lch, int eidx, int fidx)
299 if (cpu_class_is_omap2()) {
303 OMAP_DMA_CSEI_REG(lch) = eidx;
304 OMAP_DMA_CSFI_REG(lch) = fidx;
307 void omap_set_dma_src_data_pack(int lch, int enable)
309 OMAP_DMA_CSDP_REG(lch) &= ~(1 << 6);
311 OMAP_DMA_CSDP_REG(lch) |= (1 << 6);
314 void omap_set_dma_src_burst_mode(int lch, enum omap_dma_burst_mode burst_mode)
316 unsigned int burst = 0;
317 OMAP_DMA_CSDP_REG(lch) &= ~(0x03 << 7);
319 switch (burst_mode) {
320 case OMAP_DMA_DATA_BURST_DIS:
322 case OMAP_DMA_DATA_BURST_4:
323 if (cpu_class_is_omap2())
328 case OMAP_DMA_DATA_BURST_8:
329 if (cpu_class_is_omap2()) {
333 /* not supported by current hardware on OMAP1
337 case OMAP_DMA_DATA_BURST_16:
338 if (cpu_class_is_omap2()) {
342 /* OMAP1 don't support burst 16
348 OMAP_DMA_CSDP_REG(lch) |= (burst << 7);
351 /* Note that dest_port is only for OMAP1 */
352 void omap_set_dma_dest_params(int lch, int dest_port, int dest_amode,
353 unsigned long dest_start,
354 int dst_ei, int dst_fi)
356 if (cpu_class_is_omap1()) {
357 OMAP_DMA_CSDP_REG(lch) &= ~(0x1f << 9);
358 OMAP_DMA_CSDP_REG(lch) |= dest_port << 9;
361 OMAP_DMA_CCR_REG(lch) &= ~(0x03 << 14);
362 OMAP_DMA_CCR_REG(lch) |= dest_amode << 14;
364 if (cpu_class_is_omap1()) {
365 OMAP1_DMA_CDSA_U_REG(lch) = dest_start >> 16;
366 OMAP1_DMA_CDSA_L_REG(lch) = dest_start;
369 if (cpu_class_is_omap2())
370 OMAP2_DMA_CDSA_REG(lch) = dest_start;
372 OMAP_DMA_CDEI_REG(lch) = dst_ei;
373 OMAP_DMA_CDFI_REG(lch) = dst_fi;
376 void omap_set_dma_dest_index(int lch, int eidx, int fidx)
378 if (cpu_class_is_omap2()) {
382 OMAP_DMA_CDEI_REG(lch) = eidx;
383 OMAP_DMA_CDFI_REG(lch) = fidx;
386 void omap_set_dma_dest_data_pack(int lch, int enable)
388 OMAP_DMA_CSDP_REG(lch) &= ~(1 << 13);
390 OMAP_DMA_CSDP_REG(lch) |= 1 << 13;
393 void omap_set_dma_dest_burst_mode(int lch, enum omap_dma_burst_mode burst_mode)
395 unsigned int burst = 0;
396 OMAP_DMA_CSDP_REG(lch) &= ~(0x03 << 14);
398 switch (burst_mode) {
399 case OMAP_DMA_DATA_BURST_DIS:
401 case OMAP_DMA_DATA_BURST_4:
402 if (cpu_class_is_omap2())
407 case OMAP_DMA_DATA_BURST_8:
408 if (cpu_class_is_omap2())
413 case OMAP_DMA_DATA_BURST_16:
414 if (cpu_class_is_omap2()) {
418 /* OMAP1 don't support burst 16
422 printk(KERN_ERR "Invalid DMA burst mode\n");
426 OMAP_DMA_CSDP_REG(lch) |= (burst << 14);
429 static inline void omap_enable_channel_irq(int lch)
434 if (cpu_class_is_omap1())
435 status = OMAP_DMA_CSR_REG(lch);
436 else if (cpu_class_is_omap2())
437 OMAP_DMA_CSR_REG(lch) = OMAP2_DMA_CSR_CLEAR_MASK;
439 /* Enable some nice interrupts. */
440 OMAP_DMA_CICR_REG(lch) = dma_chan[lch].enabled_irqs;
442 dma_chan[lch].flags |= OMAP_DMA_ACTIVE;
445 static void omap_disable_channel_irq(int lch)
447 if (cpu_class_is_omap2())
448 OMAP_DMA_CICR_REG(lch) = 0;
451 void omap_enable_dma_irq(int lch, u16 bits)
453 dma_chan[lch].enabled_irqs |= bits;
456 void omap_disable_dma_irq(int lch, u16 bits)
458 dma_chan[lch].enabled_irqs &= ~bits;
461 static inline void enable_lnk(int lch)
463 if (cpu_class_is_omap1())
464 OMAP_DMA_CLNK_CTRL_REG(lch) &= ~(1 << 14);
466 /* Set the ENABLE_LNK bits */
467 if (dma_chan[lch].next_lch != -1)
468 OMAP_DMA_CLNK_CTRL_REG(lch) =
469 dma_chan[lch].next_lch | (1 << 15);
472 static inline void disable_lnk(int lch)
474 /* Disable interrupts */
475 if (cpu_class_is_omap1()) {
476 OMAP_DMA_CICR_REG(lch) = 0;
477 /* Set the STOP_LNK bit */
478 OMAP_DMA_CLNK_CTRL_REG(lch) |= 1 << 14;
481 if (cpu_class_is_omap2()) {
482 omap_disable_channel_irq(lch);
483 /* Clear the ENABLE_LNK bit */
484 OMAP_DMA_CLNK_CTRL_REG(lch) &= ~(1 << 15);
487 dma_chan[lch].flags &= ~OMAP_DMA_ACTIVE;
490 static inline void omap2_enable_irq_lch(int lch)
494 if (!cpu_class_is_omap2())
497 val = omap_readl(OMAP_DMA4_IRQENABLE_L0);
499 omap_writel(val, OMAP_DMA4_IRQENABLE_L0);
502 int omap_request_dma(int dev_id, const char *dev_name,
503 void (* callback)(int lch, u16 ch_status, void *data),
504 void *data, int *dma_ch_out)
506 int ch, free_ch = -1;
508 struct omap_dma_lch *chan;
510 spin_lock_irqsave(&dma_chan_lock, flags);
511 for (ch = 0; ch < dma_chan_count; ch++) {
512 if (free_ch == -1 && dma_chan[ch].dev_id == -1) {
519 spin_unlock_irqrestore(&dma_chan_lock, flags);
522 chan = dma_chan + free_ch;
523 chan->dev_id = dev_id;
525 if (cpu_class_is_omap1())
526 clear_lch_regs(free_ch);
528 if (cpu_class_is_omap2())
529 omap_clear_dma(free_ch);
531 spin_unlock_irqrestore(&dma_chan_lock, flags);
533 chan->dev_name = dev_name;
534 chan->callback = callback;
536 chan->enabled_irqs = OMAP_DMA_DROP_IRQ | OMAP_DMA_BLOCK_IRQ;
538 if (cpu_class_is_omap1())
539 chan->enabled_irqs |= OMAP1_DMA_TOUT_IRQ;
540 else if (cpu_class_is_omap2())
541 chan->enabled_irqs |= OMAP2_DMA_MISALIGNED_ERR_IRQ |
542 OMAP2_DMA_TRANS_ERR_IRQ;
544 if (cpu_is_omap16xx()) {
545 /* If the sync device is set, configure it dynamically. */
547 set_gdma_dev(free_ch + 1, dev_id);
548 dev_id = free_ch + 1;
550 /* Disable the 1510 compatibility mode and set the sync device
552 OMAP_DMA_CCR_REG(free_ch) = dev_id | (1 << 10);
553 } else if (cpu_is_omap730() || cpu_is_omap15xx()) {
554 OMAP_DMA_CCR_REG(free_ch) = dev_id;
557 if (cpu_class_is_omap2()) {
558 omap2_enable_irq_lch(free_ch);
560 omap_enable_channel_irq(free_ch);
561 /* Clear the CSR register and IRQ status register */
562 OMAP_DMA_CSR_REG(free_ch) = OMAP2_DMA_CSR_CLEAR_MASK;
563 omap_writel(1 << free_ch, OMAP_DMA4_IRQSTATUS_L0);
566 *dma_ch_out = free_ch;
571 void omap_free_dma(int lch)
575 spin_lock_irqsave(&dma_chan_lock, flags);
576 if (dma_chan[lch].dev_id == -1) {
577 printk("omap_dma: trying to free nonallocated DMA channel %d\n",
579 spin_unlock_irqrestore(&dma_chan_lock, flags);
582 dma_chan[lch].dev_id = -1;
583 dma_chan[lch].next_lch = -1;
584 dma_chan[lch].callback = NULL;
585 spin_unlock_irqrestore(&dma_chan_lock, flags);
587 if (cpu_class_is_omap1()) {
588 /* Disable all DMA interrupts for the channel. */
589 OMAP_DMA_CICR_REG(lch) = 0;
590 /* Make sure the DMA transfer is stopped. */
591 OMAP_DMA_CCR_REG(lch) = 0;
594 if (cpu_class_is_omap2()) {
596 /* Disable interrupts */
597 val = omap_readl(OMAP_DMA4_IRQENABLE_L0);
599 omap_writel(val, OMAP_DMA4_IRQENABLE_L0);
601 /* Clear the CSR register and IRQ status register */
602 OMAP_DMA_CSR_REG(lch) = OMAP2_DMA_CSR_CLEAR_MASK;
603 omap_writel(1 << lch, OMAP_DMA4_IRQSTATUS_L0);
605 /* Disable all DMA interrupts for the channel. */
606 OMAP_DMA_CICR_REG(lch) = 0;
608 /* Make sure the DMA transfer is stopped. */
609 OMAP_DMA_CCR_REG(lch) = 0;
615 * @brief omap_dma_set_global_params : Set global priority settings for dma
618 * @param max_fifo_depth
619 * @param tparams - Number of thereads to reserve : DMA_THREAD_RESERVE_NORM
620 * DMA_THREAD_RESERVE_ONET
621 * DMA_THREAD_RESERVE_TWOT
622 * DMA_THREAD_RESERVE_THREET
625 omap_dma_set_global_params(int arb_rate, int max_fifo_depth, int tparams)
629 if (!cpu_class_is_omap2()) {
630 printk(KERN_ERR "FIXME: no %s on 15xx/16xx\n", __FUNCTION__);
637 reg = (arb_rate & 0xff) << 16;
638 reg |= (0xff & max_fifo_depth);
640 omap_writel(reg, OMAP_DMA4_GCR_REG);
642 EXPORT_SYMBOL(omap_dma_set_global_params);
645 * @brief omap_dma_set_prio_lch : Set channel wise priority settings
648 * @param read_prio - Read priority
649 * @param write_prio - Write priority
650 * Both of the above can be set with one of the following values :
651 * DMA_CH_PRIO_HIGH/DMA_CH_PRIO_LOW
654 omap_dma_set_prio_lch(int lch, unsigned char read_prio,
655 unsigned char write_prio)
659 if (unlikely((lch < 0 || lch >= OMAP_LOGICAL_DMA_CH_COUNT))) {
660 printk(KERN_ERR "Invalid channel id\n");
663 w = OMAP_DMA_CCR_REG(lch);
664 w &= ~((1 << 6) | (1 << 26));
665 if (cpu_is_omap2430() || cpu_is_omap34xx())
666 w |= ((read_prio & 0x1) << 6) | ((write_prio & 0x1) << 26);
668 w |= ((read_prio & 0x1) << 6);
670 OMAP_DMA_CCR_REG(lch) = w;
673 EXPORT_SYMBOL(omap_dma_set_prio_lch);
676 * Clears any DMA state so the DMA engine is ready to restart with new buffers
677 * through omap_start_dma(). Any buffers in flight are discarded.
679 void omap_clear_dma(int lch)
683 local_irq_save(flags);
685 if (cpu_class_is_omap1()) {
687 OMAP_DMA_CCR_REG(lch) &= ~OMAP_DMA_CCR_EN;
689 /* Clear pending interrupts */
690 status = OMAP_DMA_CSR_REG(lch);
693 if (cpu_class_is_omap2()) {
695 u32 lch_base = OMAP_DMA4_BASE + lch * 0x60 + 0x80;
696 for (i = 0; i < 0x44; i += 4)
697 omap_writel(0, lch_base + i);
700 local_irq_restore(flags);
703 void omap_start_dma(int lch)
705 if (!omap_dma_in_1510_mode() && dma_chan[lch].next_lch != -1) {
706 int next_lch, cur_lch;
707 char dma_chan_link_map[OMAP_LOGICAL_DMA_CH_COUNT];
709 dma_chan_link_map[lch] = 1;
710 /* Set the link register of the first channel */
713 memset(dma_chan_link_map, 0, sizeof(dma_chan_link_map));
714 cur_lch = dma_chan[lch].next_lch;
716 next_lch = dma_chan[cur_lch].next_lch;
718 /* The loop case: we've been here already */
719 if (dma_chan_link_map[cur_lch])
721 /* Mark the current channel */
722 dma_chan_link_map[cur_lch] = 1;
725 omap_enable_channel_irq(cur_lch);
728 } while (next_lch != -1);
729 } else if (cpu_class_is_omap2()) {
730 /* Errata: Need to write lch even if not using chaining */
731 OMAP_DMA_CLNK_CTRL_REG(lch) = lch;
734 omap_enable_channel_irq(lch);
736 /* Errata: On ES2.0 BUFFERING disable must be set.
737 * This will always fail on ES1.0 */
738 if (cpu_is_omap24xx()) {
739 OMAP_DMA_CCR_REG(lch) |= OMAP_DMA_CCR_EN;
742 OMAP_DMA_CCR_REG(lch) |= OMAP_DMA_CCR_EN;
744 dma_chan[lch].flags |= OMAP_DMA_ACTIVE;
747 void omap_stop_dma(int lch)
749 if (!omap_dma_in_1510_mode() && dma_chan[lch].next_lch != -1) {
750 int next_lch, cur_lch = lch;
751 char dma_chan_link_map[OMAP_LOGICAL_DMA_CH_COUNT];
753 memset(dma_chan_link_map, 0, sizeof(dma_chan_link_map));
755 /* The loop case: we've been here already */
756 if (dma_chan_link_map[cur_lch])
758 /* Mark the current channel */
759 dma_chan_link_map[cur_lch] = 1;
761 disable_lnk(cur_lch);
763 next_lch = dma_chan[cur_lch].next_lch;
765 } while (next_lch != -1);
770 /* Disable all interrupts on the channel */
771 if (cpu_class_is_omap1())
772 OMAP_DMA_CICR_REG(lch) = 0;
774 OMAP_DMA_CCR_REG(lch) &= ~OMAP_DMA_CCR_EN;
775 dma_chan[lch].flags &= ~OMAP_DMA_ACTIVE;
779 * Allows changing the DMA callback function or data. This may be needed if
780 * the driver shares a single DMA channel for multiple dma triggers.
782 int omap_set_dma_callback(int lch,
783 void (* callback)(int lch, u16 ch_status, void *data),
791 spin_lock_irqsave(&dma_chan_lock, flags);
792 if (dma_chan[lch].dev_id == -1) {
793 printk(KERN_ERR "DMA callback for not set for free channel\n");
794 spin_unlock_irqrestore(&dma_chan_lock, flags);
797 dma_chan[lch].callback = callback;
798 dma_chan[lch].data = data;
799 spin_unlock_irqrestore(&dma_chan_lock, flags);
805 * Returns current physical source address for the given DMA channel.
806 * If the channel is running the caller must disable interrupts prior calling
807 * this function and process the returned value before re-enabling interrupt to
808 * prevent races with the interrupt handler. Note that in continuous mode there
809 * is a chance for CSSA_L register overflow inbetween the two reads resulting
810 * in incorrect return value.
812 dma_addr_t omap_get_dma_src_pos(int lch)
814 dma_addr_t offset = 0;
816 if (cpu_class_is_omap1())
817 offset = (dma_addr_t) (OMAP1_DMA_CSSA_L_REG(lch) |
818 (OMAP1_DMA_CSSA_U_REG(lch) << 16));
820 if (cpu_class_is_omap2())
821 offset = OMAP_DMA_CSAC_REG(lch);
827 * Returns current physical destination address for the given DMA channel.
828 * If the channel is running the caller must disable interrupts prior calling
829 * this function and process the returned value before re-enabling interrupt to
830 * prevent races with the interrupt handler. Note that in continuous mode there
831 * is a chance for CDSA_L register overflow inbetween the two reads resulting
832 * in incorrect return value.
834 dma_addr_t omap_get_dma_dst_pos(int lch)
836 dma_addr_t offset = 0;
838 if (cpu_class_is_omap1())
839 offset = (dma_addr_t) (OMAP1_DMA_CDSA_L_REG(lch) |
840 (OMAP1_DMA_CDSA_U_REG(lch) << 16));
842 if (cpu_class_is_omap2())
843 offset = OMAP_DMA_CDAC_REG(lch);
849 * Returns current source transfer counting for the given DMA channel.
850 * Can be used to monitor the progress of a transfer inside a block.
851 * It must be called with disabled interrupts.
853 int omap_get_dma_src_addr_counter(int lch)
855 return (dma_addr_t) OMAP_DMA_CSAC_REG(lch);
858 int omap_dma_running(void)
862 /* Check if LCD DMA is running */
863 if (cpu_is_omap16xx())
864 if (omap_readw(OMAP1610_DMA_LCD_CCR) & OMAP_DMA_CCR_EN)
867 for (lch = 0; lch < dma_chan_count; lch++)
868 if (OMAP_DMA_CCR_REG(lch) & OMAP_DMA_CCR_EN)
875 * lch_queue DMA will start right after lch_head one is finished.
876 * For this DMA link to start, you still need to start (see omap_start_dma)
877 * the first one. That will fire up the entire queue.
879 void omap_dma_link_lch (int lch_head, int lch_queue)
881 if (omap_dma_in_1510_mode()) {
882 printk(KERN_ERR "DMA linking is not supported in 1510 mode\n");
887 if ((dma_chan[lch_head].dev_id == -1) ||
888 (dma_chan[lch_queue].dev_id == -1)) {
889 printk(KERN_ERR "omap_dma: trying to link "
890 "non requested channels\n");
894 dma_chan[lch_head].next_lch = lch_queue;
898 * Once the DMA queue is stopped, we can destroy it.
900 void omap_dma_unlink_lch (int lch_head, int lch_queue)
902 if (omap_dma_in_1510_mode()) {
903 printk(KERN_ERR "DMA linking is not supported in 1510 mode\n");
908 if (dma_chan[lch_head].next_lch != lch_queue ||
909 dma_chan[lch_head].next_lch == -1) {
910 printk(KERN_ERR "omap_dma: trying to unlink "
911 "non linked channels\n");
916 if ((dma_chan[lch_head].flags & OMAP_DMA_ACTIVE) ||
917 (dma_chan[lch_head].flags & OMAP_DMA_ACTIVE)) {
918 printk(KERN_ERR "omap_dma: You need to stop the DMA channels "
919 "before unlinking\n");
923 dma_chan[lch_head].next_lch = -1;
926 /*----------------------------------------------------------------------------*/
928 #ifdef CONFIG_ARCH_OMAP1
930 static int omap1_dma_handle_ch(int ch)
934 if (enable_1510_mode && ch >= 6) {
935 csr = dma_chan[ch].saved_csr;
936 dma_chan[ch].saved_csr = 0;
938 csr = OMAP_DMA_CSR_REG(ch);
939 if (enable_1510_mode && ch <= 2 && (csr >> 7) != 0) {
940 dma_chan[ch + 6].saved_csr = csr >> 7;
943 if ((csr & 0x3f) == 0)
945 if (unlikely(dma_chan[ch].dev_id == -1)) {
946 printk(KERN_WARNING "Spurious interrupt from DMA channel "
947 "%d (CSR %04x)\n", ch, csr);
950 if (unlikely(csr & OMAP1_DMA_TOUT_IRQ))
951 printk(KERN_WARNING "DMA timeout with device %d\n",
952 dma_chan[ch].dev_id);
953 if (unlikely(csr & OMAP_DMA_DROP_IRQ))
954 printk(KERN_WARNING "DMA synchronization event drop occurred "
955 "with device %d\n", dma_chan[ch].dev_id);
956 if (likely(csr & OMAP_DMA_BLOCK_IRQ))
957 dma_chan[ch].flags &= ~OMAP_DMA_ACTIVE;
958 if (likely(dma_chan[ch].callback != NULL))
959 dma_chan[ch].callback(ch, csr, dma_chan[ch].data);
963 static irqreturn_t omap1_dma_irq_handler(int irq, void *dev_id)
965 int ch = ((int) dev_id) - 1;
971 handled_now += omap1_dma_handle_ch(ch);
972 if (enable_1510_mode && dma_chan[ch + 6].saved_csr)
973 handled_now += omap1_dma_handle_ch(ch + 6);
976 handled += handled_now;
979 return handled ? IRQ_HANDLED : IRQ_NONE;
983 #define omap1_dma_irq_handler NULL
986 #if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
988 static int omap2_dma_handle_ch(int ch)
990 u32 status = OMAP_DMA_CSR_REG(ch);
993 if (printk_ratelimit())
994 printk(KERN_WARNING "Spurious DMA IRQ for lch %d\n", ch);
997 if (unlikely(dma_chan[ch].dev_id == -1)) {
998 if (printk_ratelimit())
999 printk(KERN_WARNING "IRQ %04x for non-allocated DMA"
1000 "channel %d\n", status, ch);
1003 if (unlikely(status & OMAP_DMA_DROP_IRQ))
1005 "DMA synchronization event drop occurred with device "
1006 "%d\n", dma_chan[ch].dev_id);
1007 if (unlikely(status & OMAP2_DMA_TRANS_ERR_IRQ))
1008 printk(KERN_INFO "DMA transaction error with device %d\n",
1009 dma_chan[ch].dev_id);
1010 if (unlikely(status & OMAP2_DMA_SECURE_ERR_IRQ))
1011 printk(KERN_INFO "DMA secure error with device %d\n",
1012 dma_chan[ch].dev_id);
1013 if (unlikely(status & OMAP2_DMA_MISALIGNED_ERR_IRQ))
1014 printk(KERN_INFO "DMA misaligned error with device %d\n",
1015 dma_chan[ch].dev_id);
1017 OMAP_DMA_CSR_REG(ch) = OMAP2_DMA_CSR_CLEAR_MASK;
1018 omap_writel(1 << ch, OMAP_DMA4_IRQSTATUS_L0);
1020 if (likely(dma_chan[ch].callback != NULL))
1021 dma_chan[ch].callback(ch, status, dma_chan[ch].data);
1026 /* STATUS register count is from 1-32 while our is 0-31 */
1027 static irqreturn_t omap2_dma_irq_handler(int irq, void *dev_id)
1032 val = omap_readl(OMAP_DMA4_IRQSTATUS_L0);
1034 if (printk_ratelimit())
1035 printk(KERN_WARNING "Spurious DMA IRQ\n");
1038 for (i = 0; i < OMAP_LOGICAL_DMA_CH_COUNT && val != 0; i++) {
1040 omap2_dma_handle_ch(i);
1047 static struct irqaction omap24xx_dma_irq = {
1049 .handler = omap2_dma_irq_handler,
1050 .flags = IRQF_DISABLED
1054 static struct irqaction omap24xx_dma_irq;
1057 /*----------------------------------------------------------------------------*/
1059 static struct lcd_dma_info {
1062 void (* callback)(u16 status, void *data);
1066 unsigned long addr, size;
1067 int rotate, data_type, xres, yres;
1073 int single_transfer;
1076 void omap_set_lcd_dma_b1(unsigned long addr, u16 fb_xres, u16 fb_yres,
1079 lcd_dma.addr = addr;
1080 lcd_dma.data_type = data_type;
1081 lcd_dma.xres = fb_xres;
1082 lcd_dma.yres = fb_yres;
1085 void omap_set_lcd_dma_src_port(int port)
1087 lcd_dma.src_port = port;
1090 void omap_set_lcd_dma_ext_controller(int external)
1092 lcd_dma.ext_ctrl = external;
1095 void omap_set_lcd_dma_single_transfer(int single)
1097 lcd_dma.single_transfer = single;
1101 void omap_set_lcd_dma_b1_rotation(int rotate)
1103 if (omap_dma_in_1510_mode()) {
1104 printk(KERN_ERR "DMA rotation is not supported in 1510 mode\n");
1108 lcd_dma.rotate = rotate;
1111 void omap_set_lcd_dma_b1_mirror(int mirror)
1113 if (omap_dma_in_1510_mode()) {
1114 printk(KERN_ERR "DMA mirror is not supported in 1510 mode\n");
1117 lcd_dma.mirror = mirror;
1120 void omap_set_lcd_dma_b1_vxres(unsigned long vxres)
1122 if (omap_dma_in_1510_mode()) {
1123 printk(KERN_ERR "DMA virtual resulotion is not supported "
1127 lcd_dma.vxres = vxres;
1130 void omap_set_lcd_dma_b1_scale(unsigned int xscale, unsigned int yscale)
1132 if (omap_dma_in_1510_mode()) {
1133 printk(KERN_ERR "DMA scale is not supported in 1510 mode\n");
1136 lcd_dma.xscale = xscale;
1137 lcd_dma.yscale = yscale;
1140 static void set_b1_regs(void)
1142 unsigned long top, bottom;
1145 unsigned long en, fn;
1147 unsigned long vxres;
1148 unsigned int xscale, yscale;
1150 switch (lcd_dma.data_type) {
1151 case OMAP_DMA_DATA_TYPE_S8:
1154 case OMAP_DMA_DATA_TYPE_S16:
1157 case OMAP_DMA_DATA_TYPE_S32:
1165 vxres = lcd_dma.vxres ? lcd_dma.vxres : lcd_dma.xres;
1166 xscale = lcd_dma.xscale ? lcd_dma.xscale : 1;
1167 yscale = lcd_dma.yscale ? lcd_dma.yscale : 1;
1168 BUG_ON(vxres < lcd_dma.xres);
1169 #define PIXADDR(x,y) (lcd_dma.addr + ((y) * vxres * yscale + (x) * xscale) * es)
1170 #define PIXSTEP(sx, sy, dx, dy) (PIXADDR(dx, dy) - PIXADDR(sx, sy) - es + 1)
1171 switch (lcd_dma.rotate) {
1173 if (!lcd_dma.mirror) {
1174 top = PIXADDR(0, 0);
1175 bottom = PIXADDR(lcd_dma.xres - 1, lcd_dma.yres - 1);
1176 /* 1510 DMA requires the bottom address to be 2 more
1177 * than the actual last memory access location. */
1178 if (omap_dma_in_1510_mode() &&
1179 lcd_dma.data_type == OMAP_DMA_DATA_TYPE_S32)
1181 ei = PIXSTEP(0, 0, 1, 0);
1182 fi = PIXSTEP(lcd_dma.xres - 1, 0, 0, 1);
1184 top = PIXADDR(lcd_dma.xres - 1, 0);
1185 bottom = PIXADDR(0, lcd_dma.yres - 1);
1186 ei = PIXSTEP(1, 0, 0, 0);
1187 fi = PIXSTEP(0, 0, lcd_dma.xres - 1, 1);
1193 if (!lcd_dma.mirror) {
1194 top = PIXADDR(0, lcd_dma.yres - 1);
1195 bottom = PIXADDR(lcd_dma.xres - 1, 0);
1196 ei = PIXSTEP(0, 1, 0, 0);
1197 fi = PIXSTEP(0, 0, 1, lcd_dma.yres - 1);
1199 top = PIXADDR(lcd_dma.xres - 1, lcd_dma.yres - 1);
1200 bottom = PIXADDR(0, 0);
1201 ei = PIXSTEP(0, 1, 0, 0);
1202 fi = PIXSTEP(1, 0, 0, lcd_dma.yres - 1);
1208 if (!lcd_dma.mirror) {
1209 top = PIXADDR(lcd_dma.xres - 1, lcd_dma.yres - 1);
1210 bottom = PIXADDR(0, 0);
1211 ei = PIXSTEP(1, 0, 0, 0);
1212 fi = PIXSTEP(0, 1, lcd_dma.xres - 1, 0);
1214 top = PIXADDR(0, lcd_dma.yres - 1);
1215 bottom = PIXADDR(lcd_dma.xres - 1, 0);
1216 ei = PIXSTEP(0, 0, 1, 0);
1217 fi = PIXSTEP(lcd_dma.xres - 1, 1, 0, 0);
1223 if (!lcd_dma.mirror) {
1224 top = PIXADDR(lcd_dma.xres - 1, 0);
1225 bottom = PIXADDR(0, lcd_dma.yres - 1);
1226 ei = PIXSTEP(0, 0, 0, 1);
1227 fi = PIXSTEP(1, lcd_dma.yres - 1, 0, 0);
1229 top = PIXADDR(0, 0);
1230 bottom = PIXADDR(lcd_dma.xres - 1, lcd_dma.yres - 1);
1231 ei = PIXSTEP(0, 0, 0, 1);
1232 fi = PIXSTEP(0, lcd_dma.yres - 1, 1, 0);
1239 return; /* Suppress warning about uninitialized vars */
1242 if (omap_dma_in_1510_mode()) {
1243 omap_writew(top >> 16, OMAP1510_DMA_LCD_TOP_F1_U);
1244 omap_writew(top, OMAP1510_DMA_LCD_TOP_F1_L);
1245 omap_writew(bottom >> 16, OMAP1510_DMA_LCD_BOT_F1_U);
1246 omap_writew(bottom, OMAP1510_DMA_LCD_BOT_F1_L);
1252 omap_writew(top >> 16, OMAP1610_DMA_LCD_TOP_B1_U);
1253 omap_writew(top, OMAP1610_DMA_LCD_TOP_B1_L);
1254 omap_writew(bottom >> 16, OMAP1610_DMA_LCD_BOT_B1_U);
1255 omap_writew(bottom, OMAP1610_DMA_LCD_BOT_B1_L);
1257 omap_writew(en, OMAP1610_DMA_LCD_SRC_EN_B1);
1258 omap_writew(fn, OMAP1610_DMA_LCD_SRC_FN_B1);
1260 w = omap_readw(OMAP1610_DMA_LCD_CSDP);
1262 w |= lcd_dma.data_type;
1263 omap_writew(w, OMAP1610_DMA_LCD_CSDP);
1265 w = omap_readw(OMAP1610_DMA_LCD_CTRL);
1266 /* Always set the source port as SDRAM for now*/
1268 if (lcd_dma.callback != NULL)
1269 w |= 1 << 1; /* Block interrupt enable */
1272 omap_writew(w, OMAP1610_DMA_LCD_CTRL);
1274 if (!(lcd_dma.rotate || lcd_dma.mirror ||
1275 lcd_dma.vxres || lcd_dma.xscale || lcd_dma.yscale))
1278 w = omap_readw(OMAP1610_DMA_LCD_CCR);
1279 /* Set the double-indexed addressing mode */
1281 omap_writew(w, OMAP1610_DMA_LCD_CCR);
1283 omap_writew(ei, OMAP1610_DMA_LCD_SRC_EI_B1);
1284 omap_writew(fi >> 16, OMAP1610_DMA_LCD_SRC_FI_B1_U);
1285 omap_writew(fi, OMAP1610_DMA_LCD_SRC_FI_B1_L);
1288 static irqreturn_t lcd_dma_irq_handler(int irq, void *dev_id)
1292 w = omap_readw(OMAP1610_DMA_LCD_CTRL);
1293 if (unlikely(!(w & (1 << 3)))) {
1294 printk(KERN_WARNING "Spurious LCD DMA IRQ\n");
1299 omap_writew(w, OMAP1610_DMA_LCD_CTRL);
1301 if (lcd_dma.callback != NULL)
1302 lcd_dma.callback(w, lcd_dma.cb_data);
1307 int omap_request_lcd_dma(void (* callback)(u16 status, void *data),
1310 spin_lock_irq(&lcd_dma.lock);
1311 if (lcd_dma.reserved) {
1312 spin_unlock_irq(&lcd_dma.lock);
1313 printk(KERN_ERR "LCD DMA channel already reserved\n");
1317 lcd_dma.reserved = 1;
1318 spin_unlock_irq(&lcd_dma.lock);
1319 lcd_dma.callback = callback;
1320 lcd_dma.cb_data = data;
1322 lcd_dma.single_transfer = 0;
1328 lcd_dma.ext_ctrl = 0;
1329 lcd_dma.src_port = 0;
1334 void omap_free_lcd_dma(void)
1336 spin_lock(&lcd_dma.lock);
1337 if (!lcd_dma.reserved) {
1338 spin_unlock(&lcd_dma.lock);
1339 printk(KERN_ERR "LCD DMA is not reserved\n");
1343 if (!enable_1510_mode)
1344 omap_writew(omap_readw(OMAP1610_DMA_LCD_CCR) & ~1,
1345 OMAP1610_DMA_LCD_CCR);
1346 lcd_dma.reserved = 0;
1347 spin_unlock(&lcd_dma.lock);
1350 void omap_enable_lcd_dma(void)
1354 /* Set the Enable bit only if an external controller is
1355 * connected. Otherwise the OMAP internal controller will
1356 * start the transfer when it gets enabled.
1358 if (enable_1510_mode || !lcd_dma.ext_ctrl)
1361 w = omap_readw(OMAP1610_DMA_LCD_CTRL);
1363 omap_writew(w, OMAP1610_DMA_LCD_CTRL);
1367 w = omap_readw(OMAP1610_DMA_LCD_CCR);
1369 omap_writew(w, OMAP1610_DMA_LCD_CCR);
1372 void omap_setup_lcd_dma(void)
1374 BUG_ON(lcd_dma.active);
1375 if (!enable_1510_mode) {
1376 /* Set some reasonable defaults */
1377 omap_writew(0x5440, OMAP1610_DMA_LCD_CCR);
1378 omap_writew(0x9102, OMAP1610_DMA_LCD_CSDP);
1379 omap_writew(0x0004, OMAP1610_DMA_LCD_LCH_CTRL);
1382 if (!enable_1510_mode) {
1385 w = omap_readw(OMAP1610_DMA_LCD_CCR);
1386 /* If DMA was already active set the end_prog bit to have
1387 * the programmed register set loaded into the active
1390 w |= 1 << 11; /* End_prog */
1391 if (!lcd_dma.single_transfer)
1392 w |= (3 << 8); /* Auto_init, repeat */
1393 omap_writew(w, OMAP1610_DMA_LCD_CCR);
1397 void omap_stop_lcd_dma(void)
1402 if (enable_1510_mode || !lcd_dma.ext_ctrl)
1405 w = omap_readw(OMAP1610_DMA_LCD_CCR);
1407 omap_writew(w, OMAP1610_DMA_LCD_CCR);
1409 w = omap_readw(OMAP1610_DMA_LCD_CTRL);
1411 omap_writew(w, OMAP1610_DMA_LCD_CTRL);
1414 /*----------------------------------------------------------------------------*/
1416 static int __init omap_init_dma(void)
1420 if (cpu_is_omap15xx()) {
1421 printk(KERN_INFO "DMA support for OMAP15xx initialized\n");
1423 enable_1510_mode = 1;
1424 } else if (cpu_is_omap16xx() || cpu_is_omap730()) {
1425 printk(KERN_INFO "OMAP DMA hardware version %d\n",
1426 omap_readw(OMAP_DMA_HW_ID));
1427 printk(KERN_INFO "DMA capabilities: %08x:%08x:%04x:%04x:%04x\n",
1428 (omap_readw(OMAP_DMA_CAPS_0_U) << 16) |
1429 omap_readw(OMAP_DMA_CAPS_0_L),
1430 (omap_readw(OMAP_DMA_CAPS_1_U) << 16) |
1431 omap_readw(OMAP_DMA_CAPS_1_L),
1432 omap_readw(OMAP_DMA_CAPS_2), omap_readw(OMAP_DMA_CAPS_3),
1433 omap_readw(OMAP_DMA_CAPS_4));
1434 if (!enable_1510_mode) {
1437 /* Disable OMAP 3.0/3.1 compatibility mode. */
1438 w = omap_readw(OMAP_DMA_GSCR);
1440 omap_writew(w, OMAP_DMA_GSCR);
1441 dma_chan_count = 16;
1444 if (cpu_is_omap16xx()) {
1447 /* this would prevent OMAP sleep */
1448 w = omap_readw(OMAP1610_DMA_LCD_CTRL);
1450 omap_writew(w, OMAP1610_DMA_LCD_CTRL);
1452 } else if (cpu_class_is_omap2()) {
1453 u8 revision = omap_readb(OMAP_DMA4_REVISION);
1454 printk(KERN_INFO "OMAP DMA hardware revision %d.%d\n",
1455 revision >> 4, revision & 0xf);
1456 dma_chan_count = OMAP_LOGICAL_DMA_CH_COUNT;
1462 memset(&lcd_dma, 0, sizeof(lcd_dma));
1463 spin_lock_init(&lcd_dma.lock);
1464 spin_lock_init(&dma_chan_lock);
1465 memset(&dma_chan, 0, sizeof(dma_chan));
1467 for (ch = 0; ch < dma_chan_count; ch++) {
1469 dma_chan[ch].dev_id = -1;
1470 dma_chan[ch].next_lch = -1;
1472 if (ch >= 6 && enable_1510_mode)
1475 if (cpu_class_is_omap1()) {
1476 /* request_irq() doesn't like dev_id (ie. ch) being
1477 * zero, so we have to kludge around this. */
1478 r = request_irq(omap1_dma_irq[ch],
1479 omap1_dma_irq_handler, 0, "DMA",
1484 printk(KERN_ERR "unable to request IRQ %d "
1485 "for DMA (error %d)\n",
1486 omap1_dma_irq[ch], r);
1487 for (i = 0; i < ch; i++)
1488 free_irq(omap1_dma_irq[i],
1495 if (cpu_is_omap2430() || cpu_is_omap34xx())
1496 omap_dma_set_global_params(DMA_DEFAULT_ARB_RATE,
1497 DMA_DEFAULT_FIFO_DEPTH, 0);
1499 if (cpu_class_is_omap2())
1500 setup_irq(INT_24XX_SDMA_IRQ0, &omap24xx_dma_irq);
1502 /* FIXME: Update LCD DMA to work on 24xx */
1503 if (cpu_class_is_omap1()) {
1504 r = request_irq(INT_DMA_LCD, lcd_dma_irq_handler, 0,
1509 printk(KERN_ERR "unable to request IRQ for LCD DMA "
1511 for (i = 0; i < dma_chan_count; i++)
1512 free_irq(omap1_dma_irq[i], (void *) (i + 1));
1520 arch_initcall(omap_init_dma);
1522 EXPORT_SYMBOL(omap_get_dma_src_pos);
1523 EXPORT_SYMBOL(omap_get_dma_dst_pos);
1524 EXPORT_SYMBOL(omap_get_dma_src_addr_counter);
1525 EXPORT_SYMBOL(omap_clear_dma);
1526 EXPORT_SYMBOL(omap_set_dma_priority);
1527 EXPORT_SYMBOL(omap_request_dma);
1528 EXPORT_SYMBOL(omap_free_dma);
1529 EXPORT_SYMBOL(omap_start_dma);
1530 EXPORT_SYMBOL(omap_stop_dma);
1531 EXPORT_SYMBOL(omap_set_dma_callback);
1532 EXPORT_SYMBOL(omap_enable_dma_irq);
1533 EXPORT_SYMBOL(omap_disable_dma_irq);
1535 EXPORT_SYMBOL(omap_set_dma_transfer_params);
1536 EXPORT_SYMBOL(omap_set_dma_color_mode);
1537 EXPORT_SYMBOL(omap_set_dma_write_mode);
1539 EXPORT_SYMBOL(omap_set_dma_src_params);
1540 EXPORT_SYMBOL(omap_set_dma_src_index);
1541 EXPORT_SYMBOL(omap_set_dma_src_data_pack);
1542 EXPORT_SYMBOL(omap_set_dma_src_burst_mode);
1544 EXPORT_SYMBOL(omap_set_dma_dest_params);
1545 EXPORT_SYMBOL(omap_set_dma_dest_index);
1546 EXPORT_SYMBOL(omap_set_dma_dest_data_pack);
1547 EXPORT_SYMBOL(omap_set_dma_dest_burst_mode);
1549 EXPORT_SYMBOL(omap_set_dma_params);
1551 EXPORT_SYMBOL(omap_dma_link_lch);
1552 EXPORT_SYMBOL(omap_dma_unlink_lch);
1554 EXPORT_SYMBOL(omap_request_lcd_dma);
1555 EXPORT_SYMBOL(omap_free_lcd_dma);
1556 EXPORT_SYMBOL(omap_enable_lcd_dma);
1557 EXPORT_SYMBOL(omap_setup_lcd_dma);
1558 EXPORT_SYMBOL(omap_stop_lcd_dma);
1559 EXPORT_SYMBOL(omap_set_lcd_dma_b1);
1560 EXPORT_SYMBOL(omap_set_lcd_dma_single_transfer);
1561 EXPORT_SYMBOL(omap_set_lcd_dma_ext_controller);
1562 EXPORT_SYMBOL(omap_set_lcd_dma_b1_rotation);
1563 EXPORT_SYMBOL(omap_set_lcd_dma_b1_vxres);
1564 EXPORT_SYMBOL(omap_set_lcd_dma_b1_scale);
1565 EXPORT_SYMBOL(omap_set_lcd_dma_b1_mirror);