xref: /wlan-driver/fw-api/hw/qca5018/ce_stat_desc.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1*5113495bSYour Name /*
2*5113495bSYour Name  * Copyright (c) 2020, 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 #ifndef _CE_STAT_DESC_H_
18*5113495bSYour Name #define _CE_STAT_DESC_H_
19*5113495bSYour Name #if !defined(__ASSEMBLER__)
20*5113495bSYour Name #endif
21*5113495bSYour Name 
22*5113495bSYour Name 
23*5113495bSYour Name // ################ START SUMMARY #################
24*5113495bSYour Name //
25*5113495bSYour Name //	Dword	Fields
26*5113495bSYour Name //	0	ce_res_5[7:0], toeplitz_en[8], src_swap[9], dest_swap[10], gather[11], ce_res_6[15:12], length[31:16]
27*5113495bSYour Name //	1	toeplitz_hash_0[31:0]
28*5113495bSYour Name //	2	toeplitz_hash_1[31:0]
29*5113495bSYour Name //	3	fw_metadata[15:0], ce_res_7[19:16], ring_id[27:20], looping_count[31:28]
30*5113495bSYour Name //
31*5113495bSYour Name // ################ END SUMMARY #################
32*5113495bSYour Name 
33*5113495bSYour Name #define NUM_OF_DWORDS_CE_STAT_DESC 4
34*5113495bSYour Name 
35*5113495bSYour Name struct ce_stat_desc {
36*5113495bSYour Name              uint32_t ce_res_5                        :  8, //[7:0]
37*5113495bSYour Name                       toeplitz_en                     :  1, //[8]
38*5113495bSYour Name                       src_swap                        :  1, //[9]
39*5113495bSYour Name                       dest_swap                       :  1, //[10]
40*5113495bSYour Name                       gather                          :  1, //[11]
41*5113495bSYour Name                       ce_res_6                        :  4, //[15:12]
42*5113495bSYour Name                       length                          : 16; //[31:16]
43*5113495bSYour Name              uint32_t toeplitz_hash_0                 : 32; //[31:0]
44*5113495bSYour Name              uint32_t toeplitz_hash_1                 : 32; //[31:0]
45*5113495bSYour Name              uint32_t fw_metadata                     : 16, //[15:0]
46*5113495bSYour Name                       ce_res_7                        :  4, //[19:16]
47*5113495bSYour Name                       ring_id                         :  8, //[27:20]
48*5113495bSYour Name                       looping_count                   :  4; //[31:28]
49*5113495bSYour Name };
50*5113495bSYour Name 
51*5113495bSYour Name /*
52*5113495bSYour Name 
53*5113495bSYour Name ce_res_5
54*5113495bSYour Name 
55*5113495bSYour Name 			Reserved
56*5113495bSYour Name 
57*5113495bSYour Name 			<legal all>
58*5113495bSYour Name 
59*5113495bSYour Name toeplitz_en
60*5113495bSYour Name 
61*5113495bSYour Name 
62*5113495bSYour Name 			<legal all>
63*5113495bSYour Name 
64*5113495bSYour Name src_swap
65*5113495bSYour Name 
66*5113495bSYour Name 			Source memory buffer swapped
67*5113495bSYour Name 
68*5113495bSYour Name 			<legal all>
69*5113495bSYour Name 
70*5113495bSYour Name dest_swap
71*5113495bSYour Name 
72*5113495bSYour Name 			Destination  memory buffer swapped
73*5113495bSYour Name 
74*5113495bSYour Name 			<legal all>
75*5113495bSYour Name 
76*5113495bSYour Name gather
77*5113495bSYour Name 
78*5113495bSYour Name 			Gather of multiple copy engine source descriptors to one
79*5113495bSYour Name 			destination enabled
80*5113495bSYour Name 
81*5113495bSYour Name 			<legal all>
82*5113495bSYour Name 
83*5113495bSYour Name ce_res_6
84*5113495bSYour Name 
85*5113495bSYour Name 			Reserved
86*5113495bSYour Name 
87*5113495bSYour Name 			<legal all>
88*5113495bSYour Name 
89*5113495bSYour Name length
90*5113495bSYour Name 
91*5113495bSYour Name 			Sum of all the Lengths of the source descriptor in the
92*5113495bSYour Name 			gather chain
93*5113495bSYour Name 
94*5113495bSYour Name 			<legal all>
95*5113495bSYour Name 
96*5113495bSYour Name toeplitz_hash_0
97*5113495bSYour Name 
98*5113495bSYour Name 			32 LS bits of 64 bit Toeplitz LFSR hash result
99*5113495bSYour Name 
100*5113495bSYour Name 			<legal all>
101*5113495bSYour Name 
102*5113495bSYour Name toeplitz_hash_1
103*5113495bSYour Name 
104*5113495bSYour Name 			32 MS bits of 64 bit Toeplitz LFSR hash result
105*5113495bSYour Name 
106*5113495bSYour Name 			<legal all>
107*5113495bSYour Name 
108*5113495bSYour Name fw_metadata
109*5113495bSYour Name 
110*5113495bSYour Name 			Meta data used by FW
111*5113495bSYour Name 
112*5113495bSYour Name 			In case of gather field in first source ring entry of
113*5113495bSYour Name 			the gather copy cycle in taken into account.
114*5113495bSYour Name 
115*5113495bSYour Name 			<legal all>
116*5113495bSYour Name 
117*5113495bSYour Name ce_res_7
118*5113495bSYour Name 
119*5113495bSYour Name 			Reserved
120*5113495bSYour Name 
121*5113495bSYour Name 			<legal all>
122*5113495bSYour Name 
123*5113495bSYour Name ring_id
124*5113495bSYour Name 
125*5113495bSYour Name 			The buffer pointer ring ID.
126*5113495bSYour Name 
127*5113495bSYour Name 			0 refers to the IDLE ring
128*5113495bSYour Name 
129*5113495bSYour Name 			1 - N refers to other rings
130*5113495bSYour Name 
131*5113495bSYour Name 
132*5113495bSYour Name 
133*5113495bSYour Name 			Helps with debugging when dumping ring contents.
134*5113495bSYour Name 
135*5113495bSYour Name 			<legal all>
136*5113495bSYour Name 
137*5113495bSYour Name looping_count
138*5113495bSYour Name 
139*5113495bSYour Name 			A count value that indicates the number of times the
140*5113495bSYour Name 			producer of entries into the Ring has looped around the
141*5113495bSYour Name 			ring.
142*5113495bSYour Name 
143*5113495bSYour Name 			At initialization time, this value is set to 0. On the
144*5113495bSYour Name 			first loop, this value is set to 1. After the max value is
145*5113495bSYour Name 			reached allowed by the number of bits for this field, the
146*5113495bSYour Name 			count value continues with 0 again.
147*5113495bSYour Name 
148*5113495bSYour Name 			In case SW is the consumer of the ring entries, it can
149*5113495bSYour Name 			use this field to figure out up to where the producer of
150*5113495bSYour Name 			entries has created new entries. This eliminates the need to
151*5113495bSYour Name 			check where the head pointer' of the ring is located once
152*5113495bSYour Name 			the SW starts processing an interrupt indicating that new
153*5113495bSYour Name 			entries have been put into this ring...
154*5113495bSYour Name 
155*5113495bSYour Name 			Also note that SW if it wants only needs to look at the
156*5113495bSYour Name 			LSB bit of this count value.
157*5113495bSYour Name 
158*5113495bSYour Name 			<legal all>
159*5113495bSYour Name */
160*5113495bSYour Name 
161*5113495bSYour Name 
162*5113495bSYour Name /* Description		CE_STAT_DESC_0_CE_RES_5
163*5113495bSYour Name 
164*5113495bSYour Name 			Reserved
165*5113495bSYour Name 
166*5113495bSYour Name 			<legal all>
167*5113495bSYour Name */
168*5113495bSYour Name #define CE_STAT_DESC_0_CE_RES_5_OFFSET                               0x00000000
169*5113495bSYour Name #define CE_STAT_DESC_0_CE_RES_5_LSB                                  0
170*5113495bSYour Name #define CE_STAT_DESC_0_CE_RES_5_MASK                                 0x000000ff
171*5113495bSYour Name 
172*5113495bSYour Name /* Description		CE_STAT_DESC_0_TOEPLITZ_EN
173*5113495bSYour Name 
174*5113495bSYour Name 
175*5113495bSYour Name 			<legal all>
176*5113495bSYour Name */
177*5113495bSYour Name #define CE_STAT_DESC_0_TOEPLITZ_EN_OFFSET                            0x00000000
178*5113495bSYour Name #define CE_STAT_DESC_0_TOEPLITZ_EN_LSB                               8
179*5113495bSYour Name #define CE_STAT_DESC_0_TOEPLITZ_EN_MASK                              0x00000100
180*5113495bSYour Name 
181*5113495bSYour Name /* Description		CE_STAT_DESC_0_SRC_SWAP
182*5113495bSYour Name 
183*5113495bSYour Name 			Source memory buffer swapped
184*5113495bSYour Name 
185*5113495bSYour Name 			<legal all>
186*5113495bSYour Name */
187*5113495bSYour Name #define CE_STAT_DESC_0_SRC_SWAP_OFFSET                               0x00000000
188*5113495bSYour Name #define CE_STAT_DESC_0_SRC_SWAP_LSB                                  9
189*5113495bSYour Name #define CE_STAT_DESC_0_SRC_SWAP_MASK                                 0x00000200
190*5113495bSYour Name 
191*5113495bSYour Name /* Description		CE_STAT_DESC_0_DEST_SWAP
192*5113495bSYour Name 
193*5113495bSYour Name 			Destination  memory buffer swapped
194*5113495bSYour Name 
195*5113495bSYour Name 			<legal all>
196*5113495bSYour Name */
197*5113495bSYour Name #define CE_STAT_DESC_0_DEST_SWAP_OFFSET                              0x00000000
198*5113495bSYour Name #define CE_STAT_DESC_0_DEST_SWAP_LSB                                 10
199*5113495bSYour Name #define CE_STAT_DESC_0_DEST_SWAP_MASK                                0x00000400
200*5113495bSYour Name 
201*5113495bSYour Name /* Description		CE_STAT_DESC_0_GATHER
202*5113495bSYour Name 
203*5113495bSYour Name 			Gather of multiple copy engine source descriptors to one
204*5113495bSYour Name 			destination enabled
205*5113495bSYour Name 
206*5113495bSYour Name 			<legal all>
207*5113495bSYour Name */
208*5113495bSYour Name #define CE_STAT_DESC_0_GATHER_OFFSET                                 0x00000000
209*5113495bSYour Name #define CE_STAT_DESC_0_GATHER_LSB                                    11
210*5113495bSYour Name #define CE_STAT_DESC_0_GATHER_MASK                                   0x00000800
211*5113495bSYour Name 
212*5113495bSYour Name /* Description		CE_STAT_DESC_0_CE_RES_6
213*5113495bSYour Name 
214*5113495bSYour Name 			Reserved
215*5113495bSYour Name 
216*5113495bSYour Name 			<legal all>
217*5113495bSYour Name */
218*5113495bSYour Name #define CE_STAT_DESC_0_CE_RES_6_OFFSET                               0x00000000
219*5113495bSYour Name #define CE_STAT_DESC_0_CE_RES_6_LSB                                  12
220*5113495bSYour Name #define CE_STAT_DESC_0_CE_RES_6_MASK                                 0x0000f000
221*5113495bSYour Name 
222*5113495bSYour Name /* Description		CE_STAT_DESC_0_LENGTH
223*5113495bSYour Name 
224*5113495bSYour Name 			Sum of all the Lengths of the source descriptor in the
225*5113495bSYour Name 			gather chain
226*5113495bSYour Name 
227*5113495bSYour Name 			<legal all>
228*5113495bSYour Name */
229*5113495bSYour Name #define CE_STAT_DESC_0_LENGTH_OFFSET                                 0x00000000
230*5113495bSYour Name #define CE_STAT_DESC_0_LENGTH_LSB                                    16
231*5113495bSYour Name #define CE_STAT_DESC_0_LENGTH_MASK                                   0xffff0000
232*5113495bSYour Name 
233*5113495bSYour Name /* Description		CE_STAT_DESC_1_TOEPLITZ_HASH_0
234*5113495bSYour Name 
235*5113495bSYour Name 			32 LS bits of 64 bit Toeplitz LFSR hash result
236*5113495bSYour Name 
237*5113495bSYour Name 			<legal all>
238*5113495bSYour Name */
239*5113495bSYour Name #define CE_STAT_DESC_1_TOEPLITZ_HASH_0_OFFSET                        0x00000004
240*5113495bSYour Name #define CE_STAT_DESC_1_TOEPLITZ_HASH_0_LSB                           0
241*5113495bSYour Name #define CE_STAT_DESC_1_TOEPLITZ_HASH_0_MASK                          0xffffffff
242*5113495bSYour Name 
243*5113495bSYour Name /* Description		CE_STAT_DESC_2_TOEPLITZ_HASH_1
244*5113495bSYour Name 
245*5113495bSYour Name 			32 MS bits of 64 bit Toeplitz LFSR hash result
246*5113495bSYour Name 
247*5113495bSYour Name 			<legal all>
248*5113495bSYour Name */
249*5113495bSYour Name #define CE_STAT_DESC_2_TOEPLITZ_HASH_1_OFFSET                        0x00000008
250*5113495bSYour Name #define CE_STAT_DESC_2_TOEPLITZ_HASH_1_LSB                           0
251*5113495bSYour Name #define CE_STAT_DESC_2_TOEPLITZ_HASH_1_MASK                          0xffffffff
252*5113495bSYour Name 
253*5113495bSYour Name /* Description		CE_STAT_DESC_3_FW_METADATA
254*5113495bSYour Name 
255*5113495bSYour Name 			Meta data used by FW
256*5113495bSYour Name 
257*5113495bSYour Name 			In case of gather field in first source ring entry of
258*5113495bSYour Name 			the gather copy cycle in taken into account.
259*5113495bSYour Name 
260*5113495bSYour Name 			<legal all>
261*5113495bSYour Name */
262*5113495bSYour Name #define CE_STAT_DESC_3_FW_METADATA_OFFSET                            0x0000000c
263*5113495bSYour Name #define CE_STAT_DESC_3_FW_METADATA_LSB                               0
264*5113495bSYour Name #define CE_STAT_DESC_3_FW_METADATA_MASK                              0x0000ffff
265*5113495bSYour Name 
266*5113495bSYour Name /* Description		CE_STAT_DESC_3_CE_RES_7
267*5113495bSYour Name 
268*5113495bSYour Name 			Reserved
269*5113495bSYour Name 
270*5113495bSYour Name 			<legal all>
271*5113495bSYour Name */
272*5113495bSYour Name #define CE_STAT_DESC_3_CE_RES_7_OFFSET                               0x0000000c
273*5113495bSYour Name #define CE_STAT_DESC_3_CE_RES_7_LSB                                  16
274*5113495bSYour Name #define CE_STAT_DESC_3_CE_RES_7_MASK                                 0x000f0000
275*5113495bSYour Name 
276*5113495bSYour Name /* Description		CE_STAT_DESC_3_RING_ID
277*5113495bSYour Name 
278*5113495bSYour Name 			The buffer pointer ring ID.
279*5113495bSYour Name 
280*5113495bSYour Name 			0 refers to the IDLE ring
281*5113495bSYour Name 
282*5113495bSYour Name 			1 - N refers to other rings
283*5113495bSYour Name 
284*5113495bSYour Name 
285*5113495bSYour Name 
286*5113495bSYour Name 			Helps with debugging when dumping ring contents.
287*5113495bSYour Name 
288*5113495bSYour Name 			<legal all>
289*5113495bSYour Name */
290*5113495bSYour Name #define CE_STAT_DESC_3_RING_ID_OFFSET                                0x0000000c
291*5113495bSYour Name #define CE_STAT_DESC_3_RING_ID_LSB                                   20
292*5113495bSYour Name #define CE_STAT_DESC_3_RING_ID_MASK                                  0x0ff00000
293*5113495bSYour Name 
294*5113495bSYour Name /* Description		CE_STAT_DESC_3_LOOPING_COUNT
295*5113495bSYour Name 
296*5113495bSYour Name 			A count value that indicates the number of times the
297*5113495bSYour Name 			producer of entries into the Ring has looped around the
298*5113495bSYour Name 			ring.
299*5113495bSYour Name 
300*5113495bSYour Name 			At initialization time, this value is set to 0. On the
301*5113495bSYour Name 			first loop, this value is set to 1. After the max value is
302*5113495bSYour Name 			reached allowed by the number of bits for this field, the
303*5113495bSYour Name 			count value continues with 0 again.
304*5113495bSYour Name 
305*5113495bSYour Name 			In case SW is the consumer of the ring entries, it can
306*5113495bSYour Name 			use this field to figure out up to where the producer of
307*5113495bSYour Name 			entries has created new entries. This eliminates the need to
308*5113495bSYour Name 			check where the head pointer' of the ring is located once
309*5113495bSYour Name 			the SW starts processing an interrupt indicating that new
310*5113495bSYour Name 			entries have been put into this ring...
311*5113495bSYour Name 
312*5113495bSYour Name 			Also note that SW if it wants only needs to look at the
313*5113495bSYour Name 			LSB bit of this count value.
314*5113495bSYour Name 
315*5113495bSYour Name 			<legal all>
316*5113495bSYour Name */
317*5113495bSYour Name #define CE_STAT_DESC_3_LOOPING_COUNT_OFFSET                          0x0000000c
318*5113495bSYour Name #define CE_STAT_DESC_3_LOOPING_COUNT_LSB                             28
319*5113495bSYour Name #define CE_STAT_DESC_3_LOOPING_COUNT_MASK                            0xf0000000
320*5113495bSYour Name 
321*5113495bSYour Name 
322*5113495bSYour Name #endif // _CE_STAT_DESC_H_
323