Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
dma.h
Go to the documentation of this file.
1 /* linux/arch/arm/mach-s3c6400/include/mach/dma.h
2  *
3  * Copyright 2008 Openmoko, Inc.
4  * Copyright 2008 Simtec Electronics
5  * Ben Dooks <[email protected]>
6  * http://armlinux.simtec.co.uk/
7  *
8  * S3C6400 - DMA support
9  */
10 
11 #ifndef __ASM_ARCH_DMA_H
12 #define __ASM_ARCH_DMA_H __FILE__
13 
14 #define S3C_DMA_CHANNELS (16)
15 
16 /* see mach-s3c2410/dma.h for notes on dma channel numbers */
17 
18 /* Note, for the S3C64XX architecture we keep the DMACH_
19  * defines in the order they are allocated to [S]DMA0/[S]DMA1
20  * so that is easy to do DHACH_ -> DMA controller conversion
21  */
22 enum dma_ch {
23  /* DMA0/SDMA0 */
24  DMACH_DT_PROP = -1, /* not yet supported, do not use */
41 
42  /* DMA1/SDMA1 */
57  DMACH_SECURITY_RX, /* SDMA1 only */
58  DMACH_SECURITY_TX, /* SDMA1 only */
59  DMACH_MAX /* the end */
60 };
61 
62 static inline bool samsung_dma_has_circular(void)
63 {
64  return true;
65 }
66 
67 static inline bool samsung_dma_is_dmadev(void)
68 {
69  return false;
70 }
71 #define S3C2410_DMAF_CIRCULAR (1 << 0)
72 
73 #include <plat/dma.h>
74 
75 #define DMACH_LOW_LEVEL (1<<28) /* use this to specifiy hardware ch no */
76 
77 struct s3c64xx_dma_buff;
78 
87 
88  void *pw;
89  struct pl080s_lli *lli;
91 };
92 
93 struct s3c64xx_dmac;
94 
95 struct s3c2410_dma_chan {
96  unsigned char number; /* number of this dma channel */
97  unsigned char in_use; /* channel allocated */
98  unsigned char bit; /* bit for enable/disable/etc */
99  unsigned char hw_width;
100  unsigned char peripheral;
101 
102  unsigned int flags;
104 
105 
107 
108  struct s3c2410_dma_client *client;
109  struct s3c64xx_dmac *dmac; /* pointer to controller */
110 
111  void __iomem *regs;
112 
113  /* cdriver callbacks */
114  s3c2410_dma_cbfn_t callback_fn; /* buffer done callback */
115  s3c2410_dma_opfn_t op_fn; /* channel op callback */
116 
117  /* buffer list and information */
118  struct s3c64xx_dma_buff *curr; /* current dma buffer */
119  struct s3c64xx_dma_buff *next; /* next buffer to load */
120  struct s3c64xx_dma_buff *end; /* end of queue */
121 
122  /* note, when channel is running in circular mode, curr is the
123  * first buffer enqueued, end is the last and curr is where the
124  * last buffer-done event is set-at. The buffers are not freed
125  * and the last buffer hardware descriptor points back to the
126  * first.
127  */
128 };
129 
130 #include <plat/dma-core.h>
131 
132 #endif /* __ASM_ARCH_IRQ_H */