2 * arch/arm/mach-pnx4008/include/mach/dma.h
4 * PNX4008 DMA header file
7 * Copyright: MontaVista Software Inc. (c) 2005
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
14 #ifndef __ASM_ARCH_DMA_H
15 #define __ASM_ARCH_DMA_H
19 #define MAX_DMA_CHANNELS 8
21 #define DMAC_BASE IO_ADDRESS(PNX4008_DMA_CONFIG_BASE)
22 #define DMAC_INT_STAT (DMAC_BASE + 0x0000)
23 #define DMAC_INT_TC_STAT (DMAC_BASE + 0x0004)
24 #define DMAC_INT_TC_CLEAR (DMAC_BASE + 0x0008)
25 #define DMAC_INT_ERR_STAT (DMAC_BASE + 0x000c)
26 #define DMAC_INT_ERR_CLEAR (DMAC_BASE + 0x0010)
27 #define DMAC_SOFT_SREQ (DMAC_BASE + 0x0024)
28 #define DMAC_CONFIG (DMAC_BASE + 0x0030)
29 #define DMAC_Cx_SRC_ADDR(c) (DMAC_BASE + 0x0100 + (c) * 0x20)
30 #define DMAC_Cx_DEST_ADDR(c) (DMAC_BASE + 0x0104 + (c) * 0x20)
31 #define DMAC_Cx_LLI(c) (DMAC_BASE + 0x0108 + (c) * 0x20)
32 #define DMAC_Cx_CONTROL(c) (DMAC_BASE + 0x010c + (c) * 0x20)
33 #define DMAC_Cx_CONFIG(c) (DMAC_BASE + 0x0110 + (c) * 0x20)
59 DMA_BUFFER_ALLOCATED
= 1,
66 PER_MBX_SLAVE_FIFO
= 2,
67 PER_SPI2_REC_XMIT
= 3,
68 PER_MS_SD_RX_XMIT
= 4,
69 PER_HS_UART_1_XMIT
= 5,
71 PER_HS_UART_2_XMIT
= 7,
73 PER_HS_UART_7_XMIT
= 9,
74 PER_HS_UART_7_RX
= 10,
75 PER_SPI1_REC_XMIT
= 11,
76 PER_MLC_NDF_SREC
= 12,
79 PER_PRNG_OUTFIFO
= 15,
82 struct pnx4008_dma_ch_ctrl
{
98 struct pnx4008_dma_ch_config
{
109 struct pnx4008_dma_ll
{
110 unsigned long src_addr
;
111 unsigned long dest_addr
;
113 unsigned long ch_ctrl
;
114 struct pnx4008_dma_ll
*next
;
117 int (*free
) (void *);
120 struct pnx4008_dma_config
{
122 unsigned long src_addr
;
123 unsigned long dest_addr
;
124 unsigned long ch_ctrl
;
125 unsigned long ch_cfg
;
126 struct pnx4008_dma_ll
*ll
;
130 int (*free
) (void *);
133 extern struct pnx4008_dma_ll
*pnx4008_alloc_ll_entry(dma_addr_t
*);
134 extern void pnx4008_free_ll_entry(struct pnx4008_dma_ll
*, dma_addr_t
);
135 extern void pnx4008_free_ll(u32 ll_dma
, struct pnx4008_dma_ll
*);
137 extern int pnx4008_request_channel(char *, int,
138 void (*)(int, int, void *),
140 extern void pnx4008_free_channel(int);
141 extern int pnx4008_config_dma(int, int, int);
142 extern int pnx4008_dma_pack_control(const struct pnx4008_dma_ch_ctrl
*,
144 extern int pnx4008_dma_parse_control(unsigned long,
145 struct pnx4008_dma_ch_ctrl
*);
146 extern int pnx4008_dma_pack_config(const struct pnx4008_dma_ch_config
*,
148 extern int pnx4008_dma_parse_config(unsigned long,
149 struct pnx4008_dma_ch_config
*);
150 extern int pnx4008_config_channel(int, struct pnx4008_dma_config
*);
151 extern int pnx4008_channel_get_config(int, struct pnx4008_dma_config
*);
152 extern int pnx4008_dma_ch_enable(int);
153 extern int pnx4008_dma_ch_disable(int);
154 extern int pnx4008_dma_ch_enabled(int);
155 extern void pnx4008_dma_split_head_entry(struct pnx4008_dma_config
*,
156 struct pnx4008_dma_ch_ctrl
*);
157 extern void pnx4008_dma_split_ll_entry(struct pnx4008_dma_ll
*,
158 struct pnx4008_dma_ch_ctrl
*);
160 #endif /* _ASM_ARCH_DMA_H */