8 #ifndef _BLACKFIN_DMA_H_
9 #define _BLACKFIN_DMA_H_
23 #define DATA_SIZE_16 1
24 #define DATA_SIZE_32 2
26 #define DATA_SIZE_64 3
29 #define DMA_FLOW_STOP 0
30 #define DMA_FLOW_AUTO 1
32 #define DMA_FLOW_LIST 4
33 #define DMA_FLOW_ARRAY 5
34 #define DMA_FLOW_LIST_DEMAND 6
35 #define DMA_FLOW_ARRAY_DEMAND 7
37 #define DMA_FLOW_ARRAY 4
38 #define DMA_FLOW_SMALL 6
39 #define DMA_FLOW_LARGE 7
42 #define DIMENSION_LINEAR 0
43 #define DIMENSION_2D 1
48 #define INTR_DISABLE 0
50 #define INTR_ON_PERI 1
55 #define DMA_NOSYNC_KEEP_DMA_BUF 0
56 #define DMA_SYNC_RESTART 1
58 #ifdef DMA_MMR_SIZE_32
59 #define DMA_MMR_SIZE_TYPE long
60 #define DMA_MMR_READ bfin_read32
61 #define DMA_MMR_WRITE bfin_write32
63 #define DMA_MMR_SIZE_TYPE short
64 #define DMA_MMR_READ bfin_read16
65 #define DMA_MMR_WRITE bfin_write16
116 unsigned long bw_limit_count;
117 unsigned long curr_bw_limit_count;
119 unsigned long bw_monitor_count;
120 unsigned long curr_bw_monitor_count;
171 unsigned short saved_peripheral_map;
176 int blackfin_dma_suspend(
void);
177 void blackfin_dma_resume(
void);
187 static inline void set_dma_start_addr(
unsigned int channel,
unsigned long addr)
191 static inline void set_dma_next_desc_addr(
unsigned int channel,
void *
addr)
195 static inline void set_dma_curr_desc_addr(
unsigned int channel,
void *
addr)
219 static inline void set_dma_curr_addr(
unsigned int channel,
unsigned long addr)
225 static inline unsigned long
226 set_bfin_dma_config2(
char direction,
char flow_mode,
char intr_mode,
227 char dma_mode,
char mem_width,
char syncmode,
char peri_width)
246 return config | (direction << 1) | (mem_width << 8) | (dma_mode << 26) |
247 (flow_mode << 12) | (syncmode << 2) | (peri_width << 4);
252 set_bfin_dma_config(
char direction,
char flow_mode,
253 char intr_mode,
char dma_mode,
char mem_width,
char syncmode)
256 return set_bfin_dma_config2(direction, flow_mode, intr_mode, dma_mode,
257 mem_width, syncmode, mem_width);
259 return (direction << 1) | (mem_width << 2) | (dma_mode << 4) |
260 (intr_mode << 6) | (flow_mode << 12) | (syncmode << 5);
276 static inline void *get_dma_next_desc_ptr(
unsigned int channel)
280 static inline void *get_dma_curr_desc_ptr(
unsigned int channel)
288 static inline unsigned long get_dma_curr_addr(
unsigned int channel)
312 static inline void disable_dma(
unsigned int channel)
317 static inline void enable_dma(
unsigned int channel)
325 static inline void dma_disable_irq(
unsigned int channel)
329 static inline void dma_disable_irq_nosync(
unsigned int channel)
333 static inline void dma_enable_irq(
unsigned int channel)
337 static inline void clear_dma_irqstat(
unsigned int channel)