Linux-2.6.12-rc2
[linux-flexiantxendom0-natty.git] / include / asm-arm / arch-pxa / dma.h
1 /*
2  *  linux/include/asm-arm/arch-pxa/dma.h
3  *
4  *  Author:     Nicolas Pitre
5  *  Created:    Jun 15, 2001
6  *  Copyright:  MontaVista Software, Inc.
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License version 2 as
10  * published by the Free Software Foundation.
11  */
12 #ifndef __ASM_ARCH_DMA_H
13 #define __ASM_ARCH_DMA_H
14
15 #define MAX_DMA_ADDRESS         0xffffffff
16
17 /* No DMA as the rest of the world see it */
18 #define MAX_DMA_CHANNELS        0
19
20 /*
21  * Descriptor structure for PXA's DMA engine
22  * Note: this structure must always be aligned to a 16-byte boundary.
23  */
24
25 typedef struct pxa_dma_desc {
26         volatile u32 ddadr;     /* Points to the next descriptor + flags */
27         volatile u32 dsadr;     /* DSADR value for the current transfer */
28         volatile u32 dtadr;     /* DTADR value for the current transfer */
29         volatile u32 dcmd;      /* DCMD value for the current transfer */
30 } pxa_dma_desc;
31
32 #if defined(CONFIG_PXA27x)
33
34 #define PXA_DMA_CHANNELS        32
35 #define PXA_DMA_NBCH(prio)      ((prio == DMA_PRIO_LOW) ? 16 : 8)
36
37 typedef enum {
38         DMA_PRIO_HIGH = 0,
39         DMA_PRIO_MEDIUM = 8,
40         DMA_PRIO_LOW = 16
41 } pxa_dma_prio;
42
43 #elif defined(CONFIG_PXA25x)
44
45 #define PXA_DMA_CHANNELS        16
46 #define PXA_DMA_NBCH(prio)      ((prio == DMA_PRIO_LOW) ? 8 : 4)
47
48 typedef enum {
49         DMA_PRIO_HIGH = 0,
50         DMA_PRIO_MEDIUM = 4,
51         DMA_PRIO_LOW = 8
52 } pxa_dma_prio;
53
54 #endif
55
56 /*
57  * DMA registration
58  */
59
60 int pxa_request_dma (char *name,
61                          pxa_dma_prio prio,
62                          void (*irq_handler)(int, void *, struct pt_regs *),
63                          void *data);
64
65 void pxa_free_dma (int dma_ch);
66
67 #endif /* _ASM_ARCH_DMA_H */