Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
adma.h
Go to the documentation of this file.
1 /*
2  * 2006-2009 (C) DENX Software Engineering.
3  *
4  * Author: Yuri Tikhonov <[email protected]>
5  *
6  * This file is licensed under the terms of the GNU General Public License
7  * version 2. This program is licensed "as is" without any warranty of
8  * any kind, whether express or implied.
9  */
10 
11 #ifndef _PPC440SPE_ADMA_H
12 #define _PPC440SPE_ADMA_H
13 
14 #include <linux/types.h>
15 #include "dma.h"
16 #include "xor.h"
17 
18 #define to_ppc440spe_adma_chan(chan) \
19  container_of(chan, struct ppc440spe_adma_chan, common)
20 #define to_ppc440spe_adma_device(dev) \
21  container_of(dev, struct ppc440spe_adma_device, common)
22 #define tx_to_ppc440spe_adma_slot(tx) \
23  container_of(tx, struct ppc440spe_adma_desc_slot, async_tx)
24 
25 /* Default polynomial (for 440SP is only available) */
26 #define PPC440SPE_DEFAULT_POLY 0x4d
27 
28 #define PPC440SPE_ADMA_ENGINES_NUM (XOR_ENGINES_NUM + DMA_ENGINES_NUM)
29 
30 #define PPC440SPE_ADMA_WATCHDOG_MSEC 3
31 #define PPC440SPE_ADMA_THRESHOLD 1
32 
33 #define PPC440SPE_DMA0_ID 0
34 #define PPC440SPE_DMA1_ID 1
35 #define PPC440SPE_XOR_ID 2
36 
37 #define PPC440SPE_ADMA_DMA_MAX_BYTE_COUNT 0xFFFFFFUL
38 /* this is the XOR_CBBCR width */
39 #define PPC440SPE_ADMA_XOR_MAX_BYTE_COUNT (1 << 31)
40 #define PPC440SPE_ADMA_ZERO_SUM_MAX_BYTE_COUNT PPC440SPE_ADMA_XOR_MAX_BYTE_COUNT
41 
42 #define PPC440SPE_RXOR_RUN 0
43 
44 #define MQ0_CF2H_RXOR_BS_MASK 0x1FF
45 
46 #undef ADMA_LL_DEBUG
47 
63  struct device *dev;
67  int id;
70  size_t pool_size;
71  int irq;
72  int err_irq;
74 };
75 
96  struct list_head chain;
97  struct dma_chan common;
100  int pending;
105  struct page *pdest_page;
106  struct page *qdest_page;
109 };
110 
114  int len;
118  int state;
119 };
120 
152  struct list_head chain_node; /* node in channel ops list */
153  struct list_head group_list; /* list */
154  unsigned int unmap_len;
155  void *hw_desc;
163  unsigned long flags;
164  unsigned long reverse_flags[8];
165 
166 #define PPC440SPE_DESC_INT 0 /* generate interrupt on complete */
167 #define PPC440SPE_ZERO_P 1 /* clear P destionaion */
168 #define PPC440SPE_ZERO_Q 2 /* clear Q destination */
169 #define PPC440SPE_COHERENT 3 /* src/dst are coherent */
170 
171 #define PPC440SPE_DESC_WXOR 4 /* WXORs are in chain */
172 #define PPC440SPE_DESC_RXOR 5 /* RXOR is in chain */
173 
174 #define PPC440SPE_DESC_RXOR123 8 /* CDB for RXOR123 operation */
175 #define PPC440SPE_DESC_RXOR124 9 /* CDB for RXOR124 operation */
176 #define PPC440SPE_DESC_RXOR125 10 /* CDB for RXOR125 operation */
177 #define PPC440SPE_DESC_RXOR12 11 /* CDB for RXOR12 operation */
178 #define PPC440SPE_DESC_RXOR_REV 12 /* CDB has srcs in reversed order */
179 
180 #define PPC440SPE_DESC_PCHECK 13
181 #define PPC440SPE_DESC_QCHECK 14
182 
183 #define PPC440SPE_DESC_RXOR_MSK 0x3
184 
186 
187  union {
190  };
191 };
192 
193 #endif /* _PPC440SPE_ADMA_H */