summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gm20b/regops_gm20b.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/gm20b/regops_gm20b.c')
-rw-r--r--drivers/gpu/nvgpu/gm20b/regops_gm20b.c450
1 files changed, 450 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gm20b/regops_gm20b.c b/drivers/gpu/nvgpu/gm20b/regops_gm20b.c
new file mode 100644
index 00000000..79c980f4
--- /dev/null
+++ b/drivers/gpu/nvgpu/gm20b/regops_gm20b.c
@@ -0,0 +1,450 @@
1/*
2 * Tegra GK20A GPU Debugger Driver Register Ops
3 *
4 * Copyright (c) 2013-2017, NVIDIA CORPORATION. All rights reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
23 */
24
25#include "gk20a/gk20a.h"
26#include "gk20a/dbg_gpu_gk20a.h"
27#include "gk20a/regops_gk20a.h"
28#include "regops_gm20b.h"
29
30#include <nvgpu/bsearch.h>
31
32static const struct regop_offset_range gm20b_global_whitelist_ranges[] = {
33 { 0x00001a00, 3 },
34 { 0x0000259c, 1 },
35 { 0x0000280c, 1 },
36 { 0x00009400, 1 },
37 { 0x00009410, 1 },
38 { 0x00021970, 1 },
39 { 0x00021c00, 4 },
40 { 0x00021c14, 3 },
41 { 0x00021c24, 1 },
42 { 0x00021c2c, 5 },
43 { 0x00021cb8, 2 },
44 { 0x00021d38, 2 },
45 { 0x00021d44, 1 },
46 { 0x00021d4c, 1 },
47 { 0x00021d54, 1 },
48 { 0x00021d5c, 1 },
49 { 0x00021d64, 2 },
50 { 0x00021d70, 1 },
51 { 0x00022430, 7 },
52 { 0x00100c18, 3 },
53 { 0x00100c84, 1 },
54 { 0x00100cc4, 1 },
55 { 0x00106640, 1 },
56 { 0x0010a0a8, 1 },
57 { 0x0010a4f0, 1 },
58 { 0x0010e064, 1 },
59 { 0x0010e164, 1 },
60 { 0x0010e490, 1 },
61 { 0x00140028, 1 },
62 { 0x00140350, 1 },
63 { 0x00140550, 1 },
64 { 0x00142028, 1 },
65 { 0x00142350, 1 },
66 { 0x00142550, 1 },
67 { 0x0017e028, 1 },
68 { 0x0017e350, 1 },
69 { 0x0017e550, 1 },
70 { 0x00180040, 52 },
71 { 0x00180240, 52 },
72 { 0x00180440, 52 },
73 { 0x001a0040, 52 },
74 { 0x001b0040, 52 },
75 { 0x001b0240, 52 },
76 { 0x001b0440, 52 },
77 { 0x001b0640, 52 },
78 { 0x001b4000, 3 },
79 { 0x001b4010, 3 },
80 { 0x001b4020, 3 },
81 { 0x001b4030, 3 },
82 { 0x001b4040, 3 },
83 { 0x001b4050, 3 },
84 { 0x001b4060, 4 },
85 { 0x001b4074, 11 },
86 { 0x001b40a4, 1 },
87 { 0x001b4100, 6 },
88 { 0x001b4124, 2 },
89 { 0x001b8000, 7 },
90 { 0x001bc000, 7 },
91 { 0x001be000, 7 },
92 { 0x00400500, 1 },
93 { 0x00400700, 1 },
94 { 0x0040415c, 1 },
95 { 0x00405850, 1 },
96 { 0x00405908, 1 },
97 { 0x00405b40, 1 },
98 { 0x00405b50, 1 },
99 { 0x00406024, 1 },
100 { 0x00407010, 1 },
101 { 0x00407808, 1 },
102 { 0x0040803c, 1 },
103 { 0x0040880c, 1 },
104 { 0x00408910, 1 },
105 { 0x00408984, 1 },
106 { 0x004090a8, 1 },
107 { 0x004098a0, 1 },
108 { 0x00409b00, 1 },
109 { 0x0041000c, 1 },
110 { 0x00410110, 1 },
111 { 0x00410184, 1 },
112 { 0x0041040c, 1 },
113 { 0x00410510, 1 },
114 { 0x00410584, 1 },
115 { 0x00418384, 1 },
116 { 0x004184a0, 1 },
117 { 0x00418604, 1 },
118 { 0x00418680, 1 },
119 { 0x00418714, 1 },
120 { 0x0041881c, 1 },
121 { 0x00418884, 1 },
122 { 0x004188b0, 1 },
123 { 0x004188c8, 2 },
124 { 0x00418b04, 1 },
125 { 0x00418c04, 1 },
126 { 0x00418c1c, 1 },
127 { 0x00418c88, 1 },
128 { 0x00418d00, 1 },
129 { 0x00418e08, 1 },
130 { 0x00418f08, 1 },
131 { 0x00419000, 1 },
132 { 0x0041900c, 1 },
133 { 0x00419018, 1 },
134 { 0x00419854, 1 },
135 { 0x00419ab0, 1 },
136 { 0x00419ab8, 3 },
137 { 0x00419c0c, 1 },
138 { 0x00419c90, 1 },
139 { 0x00419d08, 2 },
140 { 0x00419e00, 4 },
141 { 0x00419e24, 2 },
142 { 0x00419e44, 11 },
143 { 0x00419e74, 9 },
144 { 0x00419ea4, 1 },
145 { 0x00419eb0, 1 },
146 { 0x00419ef0, 26 },
147 { 0x0041a0a0, 1 },
148 { 0x0041a0a8, 1 },
149 { 0x0041a17c, 1 },
150 { 0x0041a890, 2 },
151 { 0x0041a8a0, 3 },
152 { 0x0041a8b0, 2 },
153 { 0x0041b014, 1 },
154 { 0x0041b0a0, 1 },
155 { 0x0041b0cc, 1 },
156 { 0x0041b0e8, 2 },
157 { 0x0041b1dc, 1 },
158 { 0x0041be14, 1 },
159 { 0x0041bea0, 1 },
160 { 0x0041becc, 1 },
161 { 0x0041bee8, 2 },
162 { 0x0041bfdc, 1 },
163 { 0x0041c054, 1 },
164 { 0x0041c2b0, 1 },
165 { 0x0041c2b8, 3 },
166 { 0x0041c40c, 1 },
167 { 0x0041c490, 1 },
168 { 0x0041c508, 2 },
169 { 0x0041c600, 4 },
170 { 0x0041c624, 2 },
171 { 0x0041c644, 11 },
172 { 0x0041c674, 9 },
173 { 0x0041c6a4, 1 },
174 { 0x0041c6b0, 1 },
175 { 0x0041c6f0, 26 },
176 { 0x0041c854, 1 },
177 { 0x0041cab0, 1 },
178 { 0x0041cab8, 3 },
179 { 0x0041cc0c, 1 },
180 { 0x0041cc90, 1 },
181 { 0x0041cd08, 2 },
182 { 0x0041ce00, 4 },
183 { 0x0041ce24, 2 },
184 { 0x0041ce44, 11 },
185 { 0x0041ce74, 9 },
186 { 0x0041cea4, 1 },
187 { 0x0041ceb0, 1 },
188 { 0x0041cef0, 26 },
189 { 0x00500384, 1 },
190 { 0x005004a0, 1 },
191 { 0x00500604, 1 },
192 { 0x00500680, 1 },
193 { 0x00500714, 1 },
194 { 0x0050081c, 1 },
195 { 0x00500884, 1 },
196 { 0x005008c8, 2 },
197 { 0x00500b04, 1 },
198 { 0x00500c04, 1 },
199 { 0x00500c88, 1 },
200 { 0x00500d00, 1 },
201 { 0x00500e08, 1 },
202 { 0x00500f08, 1 },
203 { 0x00501000, 1 },
204 { 0x0050100c, 1 },
205 { 0x00501018, 1 },
206 { 0x00501854, 1 },
207 { 0x00501ab0, 1 },
208 { 0x00501ab8, 3 },
209 { 0x00501c0c, 1 },
210 { 0x00501c90, 1 },
211 { 0x00501d08, 2 },
212 { 0x00501e00, 4 },
213 { 0x00501e24, 2 },
214 { 0x00501e44, 11 },
215 { 0x00501e74, 9 },
216 { 0x00501ea4, 1 },
217 { 0x00501eb0, 1 },
218 { 0x00501ef0, 26 },
219 { 0x005020a0, 1 },
220 { 0x005020a8, 1 },
221 { 0x0050217c, 1 },
222 { 0x00502890, 2 },
223 { 0x005028a0, 3 },
224 { 0x005028b0, 2 },
225 { 0x00503014, 1 },
226 { 0x005030a0, 1 },
227 { 0x005030cc, 1 },
228 { 0x005030e8, 2 },
229 { 0x005031dc, 1 },
230 { 0x00503e14, 1 },
231 { 0x00503ea0, 1 },
232 { 0x00503ecc, 1 },
233 { 0x00503ee8, 2 },
234 { 0x00503fdc, 1 },
235 { 0x00504054, 1 },
236 { 0x005042b0, 1 },
237 { 0x005042b8, 3 },
238 { 0x0050440c, 1 },
239 { 0x00504490, 1 },
240 { 0x00504508, 2 },
241 { 0x00504600, 4 },
242 { 0x00504614, 6 },
243 { 0x00504634, 2 },
244 { 0x00504644, 11 },
245 { 0x00504674, 9 },
246 { 0x005046a4, 1 },
247 { 0x005046b0, 1 },
248 { 0x005046f0, 28 },
249 { 0x00504854, 1 },
250 { 0x00504ab0, 1 },
251 { 0x00504ab8, 3 },
252 { 0x00504c0c, 1 },
253 { 0x00504c90, 1 },
254 { 0x00504d08, 2 },
255 { 0x00504e00, 4 },
256 { 0x00504e14, 6 },
257 { 0x00504e34, 2 },
258 { 0x00504e44, 11 },
259 { 0x00504e74, 9 },
260 { 0x00504ea4, 1 },
261 { 0x00504eb0, 1 },
262 { 0x00504ef0, 28 },
263};
264static const u32 gm20b_global_whitelist_ranges_count =
265 ARRAY_SIZE(gm20b_global_whitelist_ranges);
266
267/* context */
268
269static const struct regop_offset_range gm20b_context_whitelist_ranges[] = {
270 { 0x0000259c, 1 },
271 { 0x0000280c, 1 },
272 { 0x00400500, 1 },
273 { 0x00405b40, 1 },
274 { 0x00418e00, 1 },
275 { 0x00418e34, 1 },
276 { 0x00418e40, 2 },
277 { 0x00418e58, 2 },
278 { 0x00419000, 1 },
279 { 0x00419864, 1 },
280 { 0x00419c90, 1 },
281 { 0x00419d08, 2 },
282 { 0x00419e04, 3 },
283 { 0x00419e24, 2 },
284 { 0x00419e44, 11 },
285 { 0x00419e74, 10 },
286 { 0x00419ea4, 1 },
287 { 0x00419eac, 2 },
288 { 0x00419ee8, 1 },
289 { 0x00419ef0, 26 },
290 { 0x0041b0e8, 2 },
291 { 0x0041bee8, 2 },
292 { 0x0041c490, 1 },
293 { 0x0041c508, 2 },
294 { 0x0041c604, 3 },
295 { 0x0041c624, 2 },
296 { 0x0041c644, 11 },
297 { 0x0041c674, 10 },
298 { 0x0041c6a4, 1 },
299 { 0x0041c6ac, 2 },
300 { 0x0041c6e8, 1 },
301 { 0x0041c6f0, 26 },
302 { 0x0041cc90, 1 },
303 { 0x0041cd08, 2 },
304 { 0x0041ce04, 3 },
305 { 0x0041ce24, 2 },
306 { 0x0041ce44, 11 },
307 { 0x0041ce74, 10 },
308 { 0x0041cea4, 1 },
309 { 0x0041ceac, 2 },
310 { 0x0041cee8, 1 },
311 { 0x0041cef0, 26 },
312 { 0x00501000, 1 },
313 { 0x00501c90, 1 },
314 { 0x00501d08, 2 },
315 { 0x00501e04, 3 },
316 { 0x00501e24, 2 },
317 { 0x00501e44, 11 },
318 { 0x00501e74, 10 },
319 { 0x00501ea4, 1 },
320 { 0x00501eac, 2 },
321 { 0x00501ee8, 1 },
322 { 0x00501ef0, 26 },
323 { 0x005030e8, 2 },
324 { 0x00503ee8, 2 },
325 { 0x00504490, 1 },
326 { 0x00504508, 2 },
327 { 0x00504604, 3 },
328 { 0x00504614, 6 },
329 { 0x00504634, 2 },
330 { 0x00504644, 11 },
331 { 0x00504674, 10 },
332 { 0x005046a4, 1 },
333 { 0x005046ac, 2 },
334 { 0x005046e8, 1 },
335 { 0x005046f0, 28 },
336 { 0x00504c90, 1 },
337 { 0x00504d08, 2 },
338 { 0x00504e04, 3 },
339 { 0x00504e14, 6 },
340 { 0x00504e34, 2 },
341 { 0x00504e44, 11 },
342 { 0x00504e74, 10 },
343 { 0x00504ea4, 1 },
344 { 0x00504eac, 2 },
345 { 0x00504ee8, 1 },
346 { 0x00504ef0, 28 },
347};
348static const u32 gm20b_context_whitelist_ranges_count =
349 ARRAY_SIZE(gm20b_context_whitelist_ranges);
350
351/* runcontrol */
352static const u32 gm20b_runcontrol_whitelist[] = {
353 0x00419e10,
354 0x0041c610,
355 0x0041ce10,
356 0x00501e10,
357 0x00504610,
358 0x00504e10,
359};
360static const u32 gm20b_runcontrol_whitelist_count =
361 ARRAY_SIZE(gm20b_runcontrol_whitelist);
362
363static const struct regop_offset_range gm20b_runcontrol_whitelist_ranges[] = {
364 { 0x00419e10, 1 },
365 { 0x0041c610, 1 },
366 { 0x0041ce10, 1 },
367 { 0x00501e10, 1 },
368 { 0x00504610, 1 },
369 { 0x00504e10, 1 },
370};
371static const u32 gm20b_runcontrol_whitelist_ranges_count =
372 ARRAY_SIZE(gm20b_runcontrol_whitelist_ranges);
373
374
375/* quad ctl */
376static const u32 gm20b_qctl_whitelist[] = {
377};
378static const u32 gm20b_qctl_whitelist_count =
379 ARRAY_SIZE(gm20b_qctl_whitelist);
380
381static const struct regop_offset_range gm20b_qctl_whitelist_ranges[] = {
382};
383static const u32 gm20b_qctl_whitelist_ranges_count =
384 ARRAY_SIZE(gm20b_qctl_whitelist_ranges);
385
386const struct regop_offset_range *gm20b_get_global_whitelist_ranges(void)
387{
388 return gm20b_global_whitelist_ranges;
389}
390
391int gm20b_get_global_whitelist_ranges_count(void)
392{
393 return gm20b_global_whitelist_ranges_count;
394}
395
396const struct regop_offset_range *gm20b_get_context_whitelist_ranges(void)
397{
398 return gm20b_context_whitelist_ranges;
399}
400
401int gm20b_get_context_whitelist_ranges_count(void)
402{
403 return gm20b_context_whitelist_ranges_count;
404}
405
406const u32 *gm20b_get_runcontrol_whitelist(void)
407{
408 return gm20b_runcontrol_whitelist;
409}
410
411int gm20b_get_runcontrol_whitelist_count(void)
412{
413 return gm20b_runcontrol_whitelist_count;
414}
415
416const struct regop_offset_range *gm20b_get_runcontrol_whitelist_ranges(void)
417{
418 return gm20b_runcontrol_whitelist_ranges;
419}
420
421int gm20b_get_runcontrol_whitelist_ranges_count(void)
422{
423 return gm20b_runcontrol_whitelist_ranges_count;
424}
425
426const u32 *gm20b_get_qctl_whitelist(void)
427{
428 return gm20b_qctl_whitelist;
429}
430
431int gm20b_get_qctl_whitelist_count(void)
432{
433 return gm20b_qctl_whitelist_count;
434}
435
436const struct regop_offset_range *gm20b_get_qctl_whitelist_ranges(void)
437{
438 return gm20b_qctl_whitelist_ranges;
439}
440
441int gm20b_get_qctl_whitelist_ranges_count(void)
442{
443 return gm20b_qctl_whitelist_ranges_count;
444}
445
446int gm20b_apply_smpc_war(struct dbg_session_gk20a *dbg_s)
447{
448 /* Not needed on gm20b */
449 return 0;
450}