This source file includes following definitions.
- stedma40_slave_mem
- stedma40_filter
- stedma40_slave_mem
1
2
3
4
5
6
7
8
9 #ifndef STE_DMA40_H
10 #define STE_DMA40_H
11
12 #include <linux/dmaengine.h>
13 #include <linux/scatterlist.h>
14 #include <linux/workqueue.h>
15 #include <linux/interrupt.h>
16
17
18
19
20
21
22
23 #define STEDMA40_MAX_SEG_SIZE 0xFFFF
24
25
26 #define STEDMA40_DEV_DST_MEMORY (-1)
27 #define STEDMA40_DEV_SRC_MEMORY (-1)
28
29 enum stedma40_mode {
30 STEDMA40_MODE_LOGICAL = 0,
31 STEDMA40_MODE_PHYSICAL,
32 STEDMA40_MODE_OPERATION,
33 };
34
35 enum stedma40_mode_opt {
36 STEDMA40_PCHAN_BASIC_MODE = 0,
37 STEDMA40_LCHAN_SRC_LOG_DST_LOG = 0,
38 STEDMA40_PCHAN_MODULO_MODE,
39 STEDMA40_PCHAN_DOUBLE_DST_MODE,
40 STEDMA40_LCHAN_SRC_PHY_DST_LOG,
41 STEDMA40_LCHAN_SRC_LOG_DST_PHY,
42 };
43
44 #define STEDMA40_ESIZE_8_BIT 0x0
45 #define STEDMA40_ESIZE_16_BIT 0x1
46 #define STEDMA40_ESIZE_32_BIT 0x2
47 #define STEDMA40_ESIZE_64_BIT 0x3
48
49
50 #define STEDMA40_PSIZE_PHY_1 0x4
51 #define STEDMA40_PSIZE_PHY_2 0x0
52 #define STEDMA40_PSIZE_PHY_4 0x1
53 #define STEDMA40_PSIZE_PHY_8 0x2
54 #define STEDMA40_PSIZE_PHY_16 0x3
55
56
57
58
59
60 #define STEDMA40_PSIZE_LOG_1 STEDMA40_PSIZE_PHY_2
61 #define STEDMA40_PSIZE_LOG_4 STEDMA40_PSIZE_PHY_4
62 #define STEDMA40_PSIZE_LOG_8 STEDMA40_PSIZE_PHY_8
63 #define STEDMA40_PSIZE_LOG_16 STEDMA40_PSIZE_PHY_16
64
65
66 #define STEDMA40_MAX_PHYS 32
67
68 enum stedma40_flow_ctrl {
69 STEDMA40_NO_FLOW_CTRL,
70 STEDMA40_FLOW_CTRL,
71 };
72
73
74
75
76
77
78
79
80
81 struct stedma40_half_channel_info {
82 bool big_endian;
83 enum dma_slave_buswidth data_width;
84 int psize;
85 enum stedma40_flow_ctrl flow_ctrl;
86 };
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107 struct stedma40_chan_cfg {
108 enum dma_transfer_direction dir;
109 bool high_priority;
110 bool realtime;
111 enum stedma40_mode mode;
112 enum stedma40_mode_opt mode_opt;
113 int dev_type;
114 struct stedma40_half_channel_info src_info;
115 struct stedma40_half_channel_info dst_info;
116
117 bool use_fixed_channel;
118 int phy_channel;
119 };
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140 struct stedma40_platform_data {
141 int disabled_channels[STEDMA40_MAX_PHYS];
142 int *soft_lli_chans;
143 int num_of_soft_lli_chans;
144 bool use_esram_lcla;
145 int num_of_memcpy_chans;
146 int num_of_phy_chans;
147 };
148
149 #ifdef CONFIG_STE_DMA40
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164 bool stedma40_filter(struct dma_chan *chan, void *data);
165
166
167
168
169
170
171
172
173
174
175
176
177 static inline struct
178 dma_async_tx_descriptor *stedma40_slave_mem(struct dma_chan *chan,
179 dma_addr_t addr,
180 unsigned int size,
181 enum dma_transfer_direction direction,
182 unsigned long flags)
183 {
184 struct scatterlist sg;
185 sg_init_table(&sg, 1);
186 sg.dma_address = addr;
187 sg.length = size;
188
189 return dmaengine_prep_slave_sg(chan, &sg, 1, direction, flags);
190 }
191
192 #else
193 static inline bool stedma40_filter(struct dma_chan *chan, void *data)
194 {
195 return false;
196 }
197
198 static inline struct
199 dma_async_tx_descriptor *stedma40_slave_mem(struct dma_chan *chan,
200 dma_addr_t addr,
201 unsigned int size,
202 enum dma_transfer_direction direction,
203 unsigned long flags)
204 {
205 return NULL;
206 }
207 #endif
208
209 #endif