2 * asm-arm/arch-lpc32xx/dma.h
4 * Author: Kevin Wells <kevin.wells@nxp.com>
6 * Copyright (C) 2008 NXP Semiconductors
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 #ifndef __ASM_ARCH_DMA_H
24 #define __ASM_ARCH_DMA_H
26 #include <mach/platform.h>
28 #define MAX_DMA_CHANNELS 8
30 #define DMA_CH_SDCARD_TX 0
31 #define DMA_CH_SDCARD_RX 1
32 #define DMA_CH_I2S_TX 2
33 #define DMA_CH_I2S_RX 3
42 * DMA channel control structure
45 int ch; /* Channel # to use */
46 int tc_inten; /* !0 = Enable TC interrupts for this channel */
47 int err_inten; /* !0 = Enable error interrupts for this channel */
48 int src_size; /* Source xfer size - must be 1, 2, or 4 */
49 int src_inc; /* !0 = Enable source address increment */
50 int src_ahb1; /* !0 = Use AHB1 for source transfer */
51 int src_bsize; /* Source burst size (ie, DMAC_CHAN_SRC_BURST_xxx) */
52 u32 src_prph; /* Source peripheral (ie, DMA_PERID_xxxx) */
53 int dst_size; /* Destination xfer size - must be 1, 2, or 4 */
54 int dst_inc; /* !0 = Enable destination address increment */
55 int dst_ahb1; /* !0 = Use AHB1 for destination transfer */
56 int dst_bsize; /* Destination burst size (ie, DMAC_CHAN_DEST_BURST_xxx) */
57 u32 dst_prph; /* Destination peripheral (ie, DMA_PERID_xxxx) */
58 u32 flowctrl; /* Flow control (ie, DMAC_CHAN_FLOW_xxxxxx) */
62 * Channel enable and disable functions
64 extern int lpc32xx_dma_ch_enable(int ch);
65 extern int lpc32xx_dma_ch_disable(int ch);
68 * Channel allocation and deallocation functions
70 extern int lpc32xx_dma_ch_get(struct dma_config *dmachcfg,
74 extern int lpc32xx_dma_ch_put(int ch);
75 extern int lpc32xx_dma_ch_pause_unpause(int ch, int pause);
78 * Setup or start an unbound DMA transfer
80 extern int lpc32xx_dma_start_pflow_xfer(int ch,
86 * DMA linked list support
88 extern u32 lpc32xx_dma_alloc_llist(int ch,
90 extern void lpc32xx_dma_dealloc_llist(int ch);
91 extern u32 lpc32xx_dma_llist_v_to_p(int ch,
93 extern u32 lpc32xx_dma_llist_p_to_v(int ch,
95 extern u32 lpc32xx_dma_get_llist_head(int ch);
96 extern void lpc32xx_dma_flush_llist(int ch);
97 extern u32 lpc32xx_dma_queue_llist_entry(int ch,
101 extern u32 lpc32xx_get_free_llist_entry(int ch);
103 #endif /* _ASM_ARCH_DMA_H */