xref: /wlan-driver/fw-api/hw/qca5018/uniform_reo_status_header.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2020, 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 _UNIFORM_REO_STATUS_HEADER_H_
18 #define _UNIFORM_REO_STATUS_HEADER_H_
19 #if !defined(__ASSEMBLER__)
20 #endif
21 
22 
23 // ################ START SUMMARY #################
24 //
25 //	Dword	Fields
26 //	0	reo_status_number[15:0], cmd_execution_time[25:16], reo_cmd_execution_status[27:26], reserved_0a[31:28]
27 //	1	timestamp[31:0]
28 //
29 // ################ END SUMMARY #################
30 
31 #define NUM_OF_DWORDS_UNIFORM_REO_STATUS_HEADER 2
32 
33 struct uniform_reo_status_header {
34              uint32_t reo_status_number               : 16, //[15:0]
35                       cmd_execution_time              : 10, //[25:16]
36                       reo_cmd_execution_status        :  2, //[27:26]
37                       reserved_0a                     :  4; //[31:28]
38              uint32_t timestamp                       : 32; //[31:0]
39 };
40 
41 /*
42 
43 reo_status_number
44 
45 			Consumer: SW , DEBUG
46 
47 			Producer: REO
48 
49 
50 
51 			The value in this field is equal to value of the
52 			'REO_CMD_Number' field the REO command
53 
54 
55 
56 			This field helps to correlate the statuses with the REO
57 			commands.
58 
59 
60 
61 			<legal all>
62 
63 cmd_execution_time
64 
65 			Consumer: DEBUG
66 
67 			Producer: REO
68 
69 
70 
71 			The amount of time REO took to excecute the command.
72 			Note that this time does not include the duration of the
73 			command waiting in the command ring, before the execution
74 			started.
75 
76 
77 
78 			In us.
79 
80 
81 
82 			<legal all>
83 
84 reo_cmd_execution_status
85 
86 			Consumer: DEBUG
87 
88 			Producer: REO
89 
90 
91 
92 			Execution status of the command.
93 
94 
95 
96 			<enum 0 reo_successful_execution> Command has
97 			successfully be executed
98 
99 			<enum 1 reo_blocked_execution> Command could not be
100 			executed as the queue or cache was blocked
101 
102 			<enum 2 reo_failed_execution> Command has encountered
103 			problems when executing, like the queue descriptor not being
104 			valid. None of the status fields in the entire STATUS TLV
105 			are valid.
106 
107 			<enum 3 reo_resource_blocked> Command is NOT  executed
108 			because one or more descriptors were blocked. This is SW
109 			programming mistake.
110 
111 			None of the status fields in the entire STATUS TLV are
112 			valid.
113 
114 
115 
116 			<legal  0-3>
117 
118 reserved_0a
119 
120 			<legal 0>
121 
122 timestamp
123 
124 			Timestamp at the moment that this status report is
125 			written.
126 
127 
128 
129 			<legal all>
130 */
131 
132 
133 /* Description		UNIFORM_REO_STATUS_HEADER_0_REO_STATUS_NUMBER
134 
135 			Consumer: SW , DEBUG
136 
137 			Producer: REO
138 
139 
140 
141 			The value in this field is equal to value of the
142 			'REO_CMD_Number' field the REO command
143 
144 
145 
146 			This field helps to correlate the statuses with the REO
147 			commands.
148 
149 
150 
151 			<legal all>
152 */
153 #define UNIFORM_REO_STATUS_HEADER_0_REO_STATUS_NUMBER_OFFSET         0x00000000
154 #define UNIFORM_REO_STATUS_HEADER_0_REO_STATUS_NUMBER_LSB            0
155 #define UNIFORM_REO_STATUS_HEADER_0_REO_STATUS_NUMBER_MASK           0x0000ffff
156 
157 /* Description		UNIFORM_REO_STATUS_HEADER_0_CMD_EXECUTION_TIME
158 
159 			Consumer: DEBUG
160 
161 			Producer: REO
162 
163 
164 
165 			The amount of time REO took to excecute the command.
166 			Note that this time does not include the duration of the
167 			command waiting in the command ring, before the execution
168 			started.
169 
170 
171 
172 			In us.
173 
174 
175 
176 			<legal all>
177 */
178 #define UNIFORM_REO_STATUS_HEADER_0_CMD_EXECUTION_TIME_OFFSET        0x00000000
179 #define UNIFORM_REO_STATUS_HEADER_0_CMD_EXECUTION_TIME_LSB           16
180 #define UNIFORM_REO_STATUS_HEADER_0_CMD_EXECUTION_TIME_MASK          0x03ff0000
181 
182 /* Description		UNIFORM_REO_STATUS_HEADER_0_REO_CMD_EXECUTION_STATUS
183 
184 			Consumer: DEBUG
185 
186 			Producer: REO
187 
188 
189 
190 			Execution status of the command.
191 
192 
193 
194 			<enum 0 reo_successful_execution> Command has
195 			successfully be executed
196 
197 			<enum 1 reo_blocked_execution> Command could not be
198 			executed as the queue or cache was blocked
199 
200 			<enum 2 reo_failed_execution> Command has encountered
201 			problems when executing, like the queue descriptor not being
202 			valid. None of the status fields in the entire STATUS TLV
203 			are valid.
204 
205 			<enum 3 reo_resource_blocked> Command is NOT  executed
206 			because one or more descriptors were blocked. This is SW
207 			programming mistake.
208 
209 			None of the status fields in the entire STATUS TLV are
210 			valid.
211 
212 
213 
214 			<legal  0-3>
215 */
216 #define UNIFORM_REO_STATUS_HEADER_0_REO_CMD_EXECUTION_STATUS_OFFSET  0x00000000
217 #define UNIFORM_REO_STATUS_HEADER_0_REO_CMD_EXECUTION_STATUS_LSB     26
218 #define UNIFORM_REO_STATUS_HEADER_0_REO_CMD_EXECUTION_STATUS_MASK    0x0c000000
219 
220 /* Description		UNIFORM_REO_STATUS_HEADER_0_RESERVED_0A
221 
222 			<legal 0>
223 */
224 #define UNIFORM_REO_STATUS_HEADER_0_RESERVED_0A_OFFSET               0x00000000
225 #define UNIFORM_REO_STATUS_HEADER_0_RESERVED_0A_LSB                  28
226 #define UNIFORM_REO_STATUS_HEADER_0_RESERVED_0A_MASK                 0xf0000000
227 
228 /* Description		UNIFORM_REO_STATUS_HEADER_1_TIMESTAMP
229 
230 			Timestamp at the moment that this status report is
231 			written.
232 
233 
234 
235 			<legal all>
236 */
237 #define UNIFORM_REO_STATUS_HEADER_1_TIMESTAMP_OFFSET                 0x00000004
238 #define UNIFORM_REO_STATUS_HEADER_1_TIMESTAMP_LSB                    0
239 #define UNIFORM_REO_STATUS_HEADER_1_TIMESTAMP_MASK                   0xffffffff
240 
241 
242 #endif // _UNIFORM_REO_STATUS_HEADER_H_
243