xref: /wlan-driver/fw-api/hw/qca6290/v2/ce_src_desc.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved.
3  *
4  * Permission to use, copy, modify, and/or distribute this software for
5  * any purpose with or without fee is hereby granted, provided that the
6  * above copyright notice and this permission notice appear in all
7  * copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
13  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
14  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
15  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16  * PERFORMANCE OF THIS SOFTWARE.
17  */
18 
19 //
20 // DO NOT EDIT!  This file is automatically generated
21 //               These definitions are tied to a particular hardware layout
22 
23 
24 #ifndef _CE_SRC_DESC_H_
25 #define _CE_SRC_DESC_H_
26 #if !defined(__ASSEMBLER__)
27 #endif
28 
29 
30 // ################ START SUMMARY #################
31 //
32 //	Dword	Fields
33 //	0	src_buffer_low[31:0]
34 //	1	src_buffer_high[7:0], toeplitz_en[8], src_swap[9], dest_swap[10], gather[11], ce_res_0[15:12], length[31:16]
35 //	2	fw_metadata[15:0], ce_res_1[31:16]
36 //	3	ce_res_2[19:0], ring_id[27:20], looping_count[31:28]
37 //
38 // ################ END SUMMARY #################
39 
40 #define NUM_OF_DWORDS_CE_SRC_DESC 4
41 
42 struct ce_src_desc {
43              uint32_t src_buffer_low                  : 32; //[31:0]
44              uint32_t src_buffer_high                 :  8, //[7:0]
45                       toeplitz_en                     :  1, //[8]
46                       src_swap                        :  1, //[9]
47                       dest_swap                       :  1, //[10]
48                       gather                          :  1, //[11]
49                       ce_res_0                        :  4, //[15:12]
50                       length                          : 16; //[31:16]
51              uint32_t fw_metadata                     : 16, //[15:0]
52                       ce_res_1                        : 16; //[31:16]
53              uint32_t ce_res_2                        : 20, //[19:0]
54                       ring_id                         :  8, //[27:20]
55                       looping_count                   :  4; //[31:28]
56 };
57 
58 /*
59 
60 src_buffer_low
61 
62 			LSB 32 bits of the 40 Bit Pointer to the source buffer
63 
64 			<legal all>
65 
66 src_buffer_high
67 
68 			MSB 8 bits of the 40 Bit Pointer to the source buffer
69 
70 			<legal all>
71 
72 toeplitz_en
73 
74 			Enable generation of 32-bit Toeplitz-LFSR hash for the
75 			data transfer
76 
77 			In case of gather field in first source ring entry of
78 			the gather copy cycle in taken into account.
79 
80 			<legal all>
81 
82 src_swap
83 
84 			Treats source memory organization as big-endian. For
85 			each dword read (4 bytes), the byte 0 is swapped with byte 3
86 			and byte 1 is swapped with byte 2.
87 
88 			In case of gather field in first source ring entry of
89 			the gather copy cycle in taken into account.
90 
91 			<legal all>
92 
93 dest_swap
94 
95 			Treats destination memory organization as big-endian.
96 			For each dword write (4 bytes), the byte 0 is swapped with
97 			byte 3 and byte 1 is swapped with byte 2.
98 
99 			In case of gather field in first source ring entry of
100 			the gather copy cycle in taken into account.
101 
102 			<legal all>
103 
104 gather
105 
106 			Enables gather of multiple copy engine source
107 			descriptors to one destination.
108 
109 			<legal all>
110 
111 ce_res_0
112 
113 			Reserved
114 
115 			<legal all>
116 
117 length
118 
119 			Length of the buffer in units of octets of the current
120 			descriptor
121 
122 			<legal all>
123 
124 fw_metadata
125 
126 			Meta data used by FW
127 
128 			In case of gather field in first source ring entry of
129 			the gather copy cycle in taken into account.
130 
131 			<legal all>
132 
133 ce_res_1
134 
135 			Reserved
136 
137 			<legal all>
138 
139 ce_res_2
140 
141 			Reserved
142 
143 			<legal all>
144 
145 ring_id
146 
147 			The buffer pointer ring ID.
148 
149 			0 refers to the IDLE ring
150 
151 			1 - N refers to other rings
152 
153 
154 
155 			Helps with debugging when dumping ring contents.
156 
157 			<legal all>
158 
159 looping_count
160 
161 			A count value that indicates the number of times the
162 			producer of entries into the Ring has looped around the
163 			ring.
164 
165 			At initialization time, this value is set to 0. On the
166 			first loop, this value is set to 1. After the max value is
167 			reached allowed by the number of bits for this field, the
168 			count value continues with 0 again.
169 
170 			In case SW is the consumer of the ring entries, it can
171 			use this field to figure out up to where the producer of
172 			entries has created new entries. This eliminates the need to
173 			check where the head pointer' of the ring is located once
174 			the SW starts processing an interrupt indicating that new
175 			entries have been put into this ring...
176 
177 			Also note that SW if it wants only needs to look at the
178 			LSB bit of this count value.
179 
180 			<legal all>
181 */
182 
183 
184 /* Description		CE_SRC_DESC_0_SRC_BUFFER_LOW
185 
186 			LSB 32 bits of the 40 Bit Pointer to the source buffer
187 
188 			<legal all>
189 */
190 #define CE_SRC_DESC_0_SRC_BUFFER_LOW_OFFSET                          0x00000000
191 #define CE_SRC_DESC_0_SRC_BUFFER_LOW_LSB                             0
192 #define CE_SRC_DESC_0_SRC_BUFFER_LOW_MASK                            0xffffffff
193 
194 /* Description		CE_SRC_DESC_1_SRC_BUFFER_HIGH
195 
196 			MSB 8 bits of the 40 Bit Pointer to the source buffer
197 
198 			<legal all>
199 */
200 #define CE_SRC_DESC_1_SRC_BUFFER_HIGH_OFFSET                         0x00000004
201 #define CE_SRC_DESC_1_SRC_BUFFER_HIGH_LSB                            0
202 #define CE_SRC_DESC_1_SRC_BUFFER_HIGH_MASK                           0x000000ff
203 
204 /* Description		CE_SRC_DESC_1_TOEPLITZ_EN
205 
206 			Enable generation of 32-bit Toeplitz-LFSR hash for the
207 			data transfer
208 
209 			In case of gather field in first source ring entry of
210 			the gather copy cycle in taken into account.
211 
212 			<legal all>
213 */
214 #define CE_SRC_DESC_1_TOEPLITZ_EN_OFFSET                             0x00000004
215 #define CE_SRC_DESC_1_TOEPLITZ_EN_LSB                                8
216 #define CE_SRC_DESC_1_TOEPLITZ_EN_MASK                               0x00000100
217 
218 /* Description		CE_SRC_DESC_1_SRC_SWAP
219 
220 			Treats source memory organization as big-endian. For
221 			each dword read (4 bytes), the byte 0 is swapped with byte 3
222 			and byte 1 is swapped with byte 2.
223 
224 			In case of gather field in first source ring entry of
225 			the gather copy cycle in taken into account.
226 
227 			<legal all>
228 */
229 #define CE_SRC_DESC_1_SRC_SWAP_OFFSET                                0x00000004
230 #define CE_SRC_DESC_1_SRC_SWAP_LSB                                   9
231 #define CE_SRC_DESC_1_SRC_SWAP_MASK                                  0x00000200
232 
233 /* Description		CE_SRC_DESC_1_DEST_SWAP
234 
235 			Treats destination memory organization as big-endian.
236 			For each dword write (4 bytes), the byte 0 is swapped with
237 			byte 3 and byte 1 is swapped with byte 2.
238 
239 			In case of gather field in first source ring entry of
240 			the gather copy cycle in taken into account.
241 
242 			<legal all>
243 */
244 #define CE_SRC_DESC_1_DEST_SWAP_OFFSET                               0x00000004
245 #define CE_SRC_DESC_1_DEST_SWAP_LSB                                  10
246 #define CE_SRC_DESC_1_DEST_SWAP_MASK                                 0x00000400
247 
248 /* Description		CE_SRC_DESC_1_GATHER
249 
250 			Enables gather of multiple copy engine source
251 			descriptors to one destination.
252 
253 			<legal all>
254 */
255 #define CE_SRC_DESC_1_GATHER_OFFSET                                  0x00000004
256 #define CE_SRC_DESC_1_GATHER_LSB                                     11
257 #define CE_SRC_DESC_1_GATHER_MASK                                    0x00000800
258 
259 /* Description		CE_SRC_DESC_1_CE_RES_0
260 
261 			Reserved
262 
263 			<legal all>
264 */
265 #define CE_SRC_DESC_1_CE_RES_0_OFFSET                                0x00000004
266 #define CE_SRC_DESC_1_CE_RES_0_LSB                                   12
267 #define CE_SRC_DESC_1_CE_RES_0_MASK                                  0x0000f000
268 
269 /* Description		CE_SRC_DESC_1_LENGTH
270 
271 			Length of the buffer in units of octets of the current
272 			descriptor
273 
274 			<legal all>
275 */
276 #define CE_SRC_DESC_1_LENGTH_OFFSET                                  0x00000004
277 #define CE_SRC_DESC_1_LENGTH_LSB                                     16
278 #define CE_SRC_DESC_1_LENGTH_MASK                                    0xffff0000
279 
280 /* Description		CE_SRC_DESC_2_FW_METADATA
281 
282 			Meta data used by FW
283 
284 			In case of gather field in first source ring entry of
285 			the gather copy cycle in taken into account.
286 
287 			<legal all>
288 */
289 #define CE_SRC_DESC_2_FW_METADATA_OFFSET                             0x00000008
290 #define CE_SRC_DESC_2_FW_METADATA_LSB                                0
291 #define CE_SRC_DESC_2_FW_METADATA_MASK                               0x0000ffff
292 
293 /* Description		CE_SRC_DESC_2_CE_RES_1
294 
295 			Reserved
296 
297 			<legal all>
298 */
299 #define CE_SRC_DESC_2_CE_RES_1_OFFSET                                0x00000008
300 #define CE_SRC_DESC_2_CE_RES_1_LSB                                   16
301 #define CE_SRC_DESC_2_CE_RES_1_MASK                                  0xffff0000
302 
303 /* Description		CE_SRC_DESC_3_CE_RES_2
304 
305 			Reserved
306 
307 			<legal all>
308 */
309 #define CE_SRC_DESC_3_CE_RES_2_OFFSET                                0x0000000c
310 #define CE_SRC_DESC_3_CE_RES_2_LSB                                   0
311 #define CE_SRC_DESC_3_CE_RES_2_MASK                                  0x000fffff
312 
313 /* Description		CE_SRC_DESC_3_RING_ID
314 
315 			The buffer pointer ring ID.
316 
317 			0 refers to the IDLE ring
318 
319 			1 - N refers to other rings
320 
321 
322 
323 			Helps with debugging when dumping ring contents.
324 
325 			<legal all>
326 */
327 #define CE_SRC_DESC_3_RING_ID_OFFSET                                 0x0000000c
328 #define CE_SRC_DESC_3_RING_ID_LSB                                    20
329 #define CE_SRC_DESC_3_RING_ID_MASK                                   0x0ff00000
330 
331 /* Description		CE_SRC_DESC_3_LOOPING_COUNT
332 
333 			A count value that indicates the number of times the
334 			producer of entries into the Ring has looped around the
335 			ring.
336 
337 			At initialization time, this value is set to 0. On the
338 			first loop, this value is set to 1. After the max value is
339 			reached allowed by the number of bits for this field, the
340 			count value continues with 0 again.
341 
342 			In case SW is the consumer of the ring entries, it can
343 			use this field to figure out up to where the producer of
344 			entries has created new entries. This eliminates the need to
345 			check where the head pointer' of the ring is located once
346 			the SW starts processing an interrupt indicating that new
347 			entries have been put into this ring...
348 
349 			Also note that SW if it wants only needs to look at the
350 			LSB bit of this count value.
351 
352 			<legal all>
353 */
354 #define CE_SRC_DESC_3_LOOPING_COUNT_OFFSET                           0x0000000c
355 #define CE_SRC_DESC_3_LOOPING_COUNT_LSB                              28
356 #define CE_SRC_DESC_3_LOOPING_COUNT_MASK                             0xf0000000
357 
358 
359 #endif // _CE_SRC_DESC_H_
360