xref: /wlan-driver/fw-api/hw/qcn9000/reo_unblock_cache.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2019, The Linux Foundation. All rights reserved.
3  *
4  * Permission to use, copy, modify, and/or distribute this software for any
5  * purpose with or without fee is hereby granted, provided that the above
6  * copyright notice and this permission notice appear in all copies.
7  *
8  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15  */
16 
17 #ifndef _REO_UNBLOCK_CACHE_H_
18 #define _REO_UNBLOCK_CACHE_H_
19 #if !defined(__ASSEMBLER__)
20 #endif
21 
22 #include "uniform_reo_cmd_header.h"
23 
24 // ################ START SUMMARY #################
25 //
26 //	Dword	Fields
27 //	0	struct uniform_reo_cmd_header cmd_header;
28 //	1	unblock_type[0], cache_block_resource_index[2:1], reserved_1a[31:3]
29 //	2	reserved_2a[31:0]
30 //	3	reserved_3a[31:0]
31 //	4	reserved_4a[31:0]
32 //	5	reserved_5a[31:0]
33 //	6	reserved_6a[31:0]
34 //	7	reserved_7a[31:0]
35 //	8	reserved_8a[31:0]
36 //
37 // ################ END SUMMARY #################
38 
39 #define NUM_OF_DWORDS_REO_UNBLOCK_CACHE 9
40 
41 struct reo_unblock_cache {
42     struct            uniform_reo_cmd_header                       cmd_header;
43              uint32_t unblock_type                    :  1, //[0]
44                       cache_block_resource_index      :  2, //[2:1]
45                       reserved_1a                     : 29; //[31:3]
46              uint32_t reserved_2a                     : 32; //[31:0]
47              uint32_t reserved_3a                     : 32; //[31:0]
48              uint32_t reserved_4a                     : 32; //[31:0]
49              uint32_t reserved_5a                     : 32; //[31:0]
50              uint32_t reserved_6a                     : 32; //[31:0]
51              uint32_t reserved_7a                     : 32; //[31:0]
52              uint32_t reserved_8a                     : 32; //[31:0]
53 };
54 
55 /*
56 
57 struct uniform_reo_cmd_header cmd_header
58 
59 			Consumer: REO
60 
61 			Producer: SW
62 
63 
64 
65 			Details for command execution tracking purposes.
66 
67 unblock_type
68 
69 			Unblock type
70 
71 
72 
73 			<enum 0 unblock_resource_index> Unblock a block
74 			resource, whose index is given in field
75 			'cache_block_resource_index'.
76 
77 			If the indicated blocking resource is not in use (=> not
78 			blocking an address at the moment), the command status will
79 			indicate an error.
80 
81 
82 
83 			<enum 1 unblock_cache> The entire cache usage is
84 			unblocked.
85 
86 			If the entire cache is not in a blocked mode at the
87 			moment this command is received, the command status will
88 			indicate an error.
89 
90 			Note that unlocking the entire cache has no changes to
91 			the current settings of the blocking resource settings
92 
93 
94 
95 			<legal all>
96 
97 cache_block_resource_index
98 
99 			Field not valid when field Unblock_type is set to
100 			unblock_cache.
101 
102 
103 
104 			Indicates which of the four blocking resources in REO
105 			should be released from blocking a (descriptor) address.
106 
107 			<legal all>
108 
109 reserved_1a
110 
111 			<legal 0>
112 
113 reserved_2a
114 
115 			<legal 0>
116 
117 reserved_3a
118 
119 			<legal 0>
120 
121 reserved_4a
122 
123 			<legal 0>
124 
125 reserved_5a
126 
127 			<legal 0>
128 
129 reserved_6a
130 
131 			<legal 0>
132 
133 reserved_7a
134 
135 			<legal 0>
136 
137 reserved_8a
138 
139 			<legal 0>
140 */
141 
142 
143  /* EXTERNAL REFERENCE : struct uniform_reo_cmd_header cmd_header */
144 
145 
146 /* Description		REO_UNBLOCK_CACHE_0_CMD_HEADER_REO_CMD_NUMBER
147 
148 			Consumer: REO/SW/DEBUG
149 
150 			Producer: SW
151 
152 
153 
154 			This number can be used by SW to track, identify and
155 			link the created commands with the command statusses
156 
157 
158 
159 
160 
161 			<legal all>
162 */
163 #define REO_UNBLOCK_CACHE_0_CMD_HEADER_REO_CMD_NUMBER_OFFSET         0x00000000
164 #define REO_UNBLOCK_CACHE_0_CMD_HEADER_REO_CMD_NUMBER_LSB            0
165 #define REO_UNBLOCK_CACHE_0_CMD_HEADER_REO_CMD_NUMBER_MASK           0x0000ffff
166 
167 /* Description		REO_UNBLOCK_CACHE_0_CMD_HEADER_REO_STATUS_REQUIRED
168 
169 			Consumer: REO
170 
171 			Producer: SW
172 
173 
174 
175 			<enum 0 NoStatus> REO does not need to generate a status
176 			TLV for the execution of this command
177 
178 			<enum 1 StatusRequired> REO shall generate a status TLV
179 			for the execution of this command
180 
181 
182 
183 			<legal all>
184 */
185 #define REO_UNBLOCK_CACHE_0_CMD_HEADER_REO_STATUS_REQUIRED_OFFSET    0x00000000
186 #define REO_UNBLOCK_CACHE_0_CMD_HEADER_REO_STATUS_REQUIRED_LSB       16
187 #define REO_UNBLOCK_CACHE_0_CMD_HEADER_REO_STATUS_REQUIRED_MASK      0x00010000
188 
189 /* Description		REO_UNBLOCK_CACHE_0_CMD_HEADER_RESERVED_0A
190 
191 			<legal 0>
192 */
193 #define REO_UNBLOCK_CACHE_0_CMD_HEADER_RESERVED_0A_OFFSET            0x00000000
194 #define REO_UNBLOCK_CACHE_0_CMD_HEADER_RESERVED_0A_LSB               17
195 #define REO_UNBLOCK_CACHE_0_CMD_HEADER_RESERVED_0A_MASK              0xfffe0000
196 
197 /* Description		REO_UNBLOCK_CACHE_1_UNBLOCK_TYPE
198 
199 			Unblock type
200 
201 
202 
203 			<enum 0 unblock_resource_index> Unblock a block
204 			resource, whose index is given in field
205 			'cache_block_resource_index'.
206 
207 			If the indicated blocking resource is not in use (=> not
208 			blocking an address at the moment), the command status will
209 			indicate an error.
210 
211 
212 
213 			<enum 1 unblock_cache> The entire cache usage is
214 			unblocked.
215 
216 			If the entire cache is not in a blocked mode at the
217 			moment this command is received, the command status will
218 			indicate an error.
219 
220 			Note that unlocking the entire cache has no changes to
221 			the current settings of the blocking resource settings
222 
223 
224 
225 			<legal all>
226 */
227 #define REO_UNBLOCK_CACHE_1_UNBLOCK_TYPE_OFFSET                      0x00000004
228 #define REO_UNBLOCK_CACHE_1_UNBLOCK_TYPE_LSB                         0
229 #define REO_UNBLOCK_CACHE_1_UNBLOCK_TYPE_MASK                        0x00000001
230 
231 /* Description		REO_UNBLOCK_CACHE_1_CACHE_BLOCK_RESOURCE_INDEX
232 
233 			Field not valid when field Unblock_type is set to
234 			unblock_cache.
235 
236 
237 
238 			Indicates which of the four blocking resources in REO
239 			should be released from blocking a (descriptor) address.
240 
241 			<legal all>
242 */
243 #define REO_UNBLOCK_CACHE_1_CACHE_BLOCK_RESOURCE_INDEX_OFFSET        0x00000004
244 #define REO_UNBLOCK_CACHE_1_CACHE_BLOCK_RESOURCE_INDEX_LSB           1
245 #define REO_UNBLOCK_CACHE_1_CACHE_BLOCK_RESOURCE_INDEX_MASK          0x00000006
246 
247 /* Description		REO_UNBLOCK_CACHE_1_RESERVED_1A
248 
249 			<legal 0>
250 */
251 #define REO_UNBLOCK_CACHE_1_RESERVED_1A_OFFSET                       0x00000004
252 #define REO_UNBLOCK_CACHE_1_RESERVED_1A_LSB                          3
253 #define REO_UNBLOCK_CACHE_1_RESERVED_1A_MASK                         0xfffffff8
254 
255 /* Description		REO_UNBLOCK_CACHE_2_RESERVED_2A
256 
257 			<legal 0>
258 */
259 #define REO_UNBLOCK_CACHE_2_RESERVED_2A_OFFSET                       0x00000008
260 #define REO_UNBLOCK_CACHE_2_RESERVED_2A_LSB                          0
261 #define REO_UNBLOCK_CACHE_2_RESERVED_2A_MASK                         0xffffffff
262 
263 /* Description		REO_UNBLOCK_CACHE_3_RESERVED_3A
264 
265 			<legal 0>
266 */
267 #define REO_UNBLOCK_CACHE_3_RESERVED_3A_OFFSET                       0x0000000c
268 #define REO_UNBLOCK_CACHE_3_RESERVED_3A_LSB                          0
269 #define REO_UNBLOCK_CACHE_3_RESERVED_3A_MASK                         0xffffffff
270 
271 /* Description		REO_UNBLOCK_CACHE_4_RESERVED_4A
272 
273 			<legal 0>
274 */
275 #define REO_UNBLOCK_CACHE_4_RESERVED_4A_OFFSET                       0x00000010
276 #define REO_UNBLOCK_CACHE_4_RESERVED_4A_LSB                          0
277 #define REO_UNBLOCK_CACHE_4_RESERVED_4A_MASK                         0xffffffff
278 
279 /* Description		REO_UNBLOCK_CACHE_5_RESERVED_5A
280 
281 			<legal 0>
282 */
283 #define REO_UNBLOCK_CACHE_5_RESERVED_5A_OFFSET                       0x00000014
284 #define REO_UNBLOCK_CACHE_5_RESERVED_5A_LSB                          0
285 #define REO_UNBLOCK_CACHE_5_RESERVED_5A_MASK                         0xffffffff
286 
287 /* Description		REO_UNBLOCK_CACHE_6_RESERVED_6A
288 
289 			<legal 0>
290 */
291 #define REO_UNBLOCK_CACHE_6_RESERVED_6A_OFFSET                       0x00000018
292 #define REO_UNBLOCK_CACHE_6_RESERVED_6A_LSB                          0
293 #define REO_UNBLOCK_CACHE_6_RESERVED_6A_MASK                         0xffffffff
294 
295 /* Description		REO_UNBLOCK_CACHE_7_RESERVED_7A
296 
297 			<legal 0>
298 */
299 #define REO_UNBLOCK_CACHE_7_RESERVED_7A_OFFSET                       0x0000001c
300 #define REO_UNBLOCK_CACHE_7_RESERVED_7A_LSB                          0
301 #define REO_UNBLOCK_CACHE_7_RESERVED_7A_MASK                         0xffffffff
302 
303 /* Description		REO_UNBLOCK_CACHE_8_RESERVED_8A
304 
305 			<legal 0>
306 */
307 #define REO_UNBLOCK_CACHE_8_RESERVED_8A_OFFSET                       0x00000020
308 #define REO_UNBLOCK_CACHE_8_RESERVED_8A_LSB                          0
309 #define REO_UNBLOCK_CACHE_8_RESERVED_8A_MASK                         0xffffffff
310 
311 
312 #endif // _REO_UNBLOCK_CACHE_H_
313