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