summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gm20b/regops_gm20b.c
diff options
context:
space:
mode:
authorKevin Huang <kevinh@nvidia.com>2014-05-09 14:41:26 -0400
committerDan Willemsen <dwillemsen@nvidia.com>2015-03-18 15:11:06 -0400
commit82e01758f050b9780a2c9bd22b30e84e934d963b (patch)
treeaed511763589c2dbbcc5edb16568d840b64b45d4 /drivers/gpu/nvgpu/gm20b/regops_gm20b.c
parent1d9eba07c58b0a30f479b233371c939180a0e419 (diff)
gpu: nvgpu: gm20b: update regops whitelist
Bug 1500195 Change-Id: Ie2253f2650844cbc707a3083cc2f6b5150c4a17b Signed-off-by: Kevin Huang <kevinh@nvidia.com> Reviewed-on: http://git-master/r/488508 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gm20b/regops_gm20b.c')
-rw-r--r--drivers/gpu/nvgpu/gm20b/regops_gm20b.c529
1 files changed, 529 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..e0f1fc0b
--- /dev/null
+++ b/drivers/gpu/nvgpu/gm20b/regops_gm20b.c
@@ -0,0 +1,529 @@
1/*
2 *
3 * Tegra GK20A GPU Debugger Driver Register Ops
4 *
5 * Copyright (c) 2013-2014, NVIDIA CORPORATION. All rights reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms and conditions of the GNU General Public License,
9 * version 2, as published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#include <linux/slab.h>
21#include <linux/err.h>
22#include <linux/bsearch.h>
23#include <linux/nvhost_dbg_gpu_ioctl.h>
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
30static const struct regop_offset_range gm20b_global_whitelist_ranges[] = {
31 { 0x000004f0, 1 },
32 { 0x00001a00, 3 },
33 { 0x0000259c, 1 },
34 { 0x0000280c, 1 },
35 { 0x00009400, 1 },
36 { 0x00009410, 1 },
37 { 0x00020200, 1 },
38 { 0x00022430, 7 },
39 { 0x00022548, 1 },
40 { 0x00100c18, 3 },
41 { 0x00100c84, 1 },
42 { 0x00100cc4, 1 },
43 { 0x00106640, 1 },
44 { 0x0010a0a8, 1 },
45 { 0x0010a4f0, 1 },
46 { 0x0010e064, 1 },
47 { 0x0010e164, 1 },
48 { 0x0010e490, 1 },
49 { 0x00110100, 1 },
50 { 0x00140028, 1 },
51 { 0x001408dc, 1 },
52 { 0x00140a5c, 1 },
53 { 0x001410dc, 1 },
54 { 0x0014125c, 1 },
55 { 0x0017e028, 1 },
56 { 0x0017e8dc, 1 },
57 { 0x0017ea5c, 1 },
58 { 0x0017f0dc, 1 },
59 { 0x0017f25c, 1 },
60 { 0x00180000, 68 },
61 { 0x00180200, 68 },
62 { 0x001a0000, 68 },
63 { 0x001b0000, 68 },
64 { 0x001b0200, 68 },
65 { 0x001b0400, 68 },
66 { 0x001b0600, 68 },
67 { 0x001b4000, 3 },
68 { 0x001b4010, 3 },
69 { 0x001b4020, 3 },
70 { 0x001b4040, 3 },
71 { 0x001b4050, 3 },
72 { 0x001b4060, 16 },
73 { 0x001b40a4, 1 },
74 { 0x001b4100, 6 },
75 { 0x001b4124, 2 },
76 { 0x001b8000, 7 },
77 { 0x001bc000, 7 },
78 { 0x001be000, 7 },
79 { 0x00400500, 1 },
80 { 0x00400700, 1 },
81 { 0x0040415c, 1 },
82 { 0x00405850, 1 },
83 { 0x00405908, 1 },
84 { 0x00405b40, 1 },
85 { 0x00405b50, 1 },
86 { 0x00406024, 1 },
87 { 0x00407010, 1 },
88 { 0x00407808, 1 },
89 { 0x0040803c, 1 },
90 { 0x0040880c, 1 },
91 { 0x00408910, 1 },
92 { 0x00408984, 1 },
93 { 0x004090a8, 1 },
94 { 0x004098a0, 1 },
95 { 0x0041000c, 1 },
96 { 0x00410110, 1 },
97 { 0x00410184, 1 },
98 { 0x00418384, 1 },
99 { 0x004184a0, 1 },
100 { 0x00418604, 1 },
101 { 0x00418680, 1 },
102 { 0x00418714, 1 },
103 { 0x0041881c, 1 },
104 { 0x004188b0, 1 },
105 { 0x004188c8, 2 },
106 { 0x00418b04, 1 },
107 { 0x00418c04, 1 },
108 { 0x00418c64, 2 },
109 { 0x00418c88, 1 },
110 { 0x00418cb4, 2 },
111 { 0x00418d00, 1 },
112 { 0x00418d28, 2 },
113 { 0x00418e08, 1 },
114 { 0x00418e1c, 2 },
115 { 0x00418f08, 1 },
116 { 0x00418f20, 2 },
117 { 0x00419000, 1 },
118 { 0x0041900c, 1 },
119 { 0x00419018, 1 },
120 { 0x00419854, 1 },
121 { 0x00419ab0, 1 },
122 { 0x00419ab8, 3 },
123 { 0x00419ac8, 1 },
124 { 0x00419c0c, 1 },
125 { 0x00419c8c, 3 },
126 { 0x00419ca8, 1 },
127 { 0x00419d08, 2 },
128 { 0x00419e00, 1 },
129 { 0x00419e0c, 1 },
130 { 0x00419e14, 2 },
131 { 0x00419e24, 2 },
132 { 0x00419e34, 2 },
133 { 0x00419e44, 4 },
134 { 0x00419ea4, 1 },
135 { 0x00419eb0, 1 },
136 { 0x0041a0a0, 1 },
137 { 0x0041a0a8, 1 },
138 { 0x0041a17c, 1 },
139 { 0x0041a890, 2 },
140 { 0x0041a8a0, 3 },
141 { 0x0041a8b0, 2 },
142 { 0x0041b014, 1 },
143 { 0x0041b0a0, 1 },
144 { 0x0041b0cc, 1 },
145 { 0x0041b0e8, 2 },
146 { 0x0041b1dc, 1 },
147 { 0x0041b1f8, 2 },
148 { 0x0041be14, 1 },
149 { 0x0041bea0, 1 },
150 { 0x0041becc, 1 },
151 { 0x0041bee8, 2 },
152 { 0x0041bfdc, 1 },
153 { 0x0041bff8, 2 },
154 { 0x0041c054, 1 },
155 { 0x0041c2b0, 1 },
156 { 0x0041c2b8, 3 },
157 { 0x0041c2c8, 1 },
158 { 0x0041c40c, 1 },
159 { 0x0041c48c, 3 },
160 { 0x0041c48c, 1 },
161 { 0x0041c4a8, 1 },
162 { 0x0041c508, 2 },
163 { 0x0041c508, 2 },
164 { 0x0041c600, 1 },
165 { 0x0041c60c, 1 },
166 { 0x0041c614, 2 },
167 { 0x0041c624, 2 },
168 { 0x0041c634, 2 },
169 { 0x0041c644, 4 },
170 { 0x0041c6a4, 1 },
171 { 0x0041c6b0, 1 },
172 { 0x0041ce04, 6 },
173 { 0x0041ce24, 2 },
174 { 0x0041ce34, 2 },
175 { 0x0041ce44, 4 },
176 { 0x0041ce58, 6 },
177 { 0x0041ce74, 9 },
178 { 0x0041cea4, 1 },
179 { 0x0041ceac, 2 },
180 { 0x0041cf30, 8 },
181 { 0x0041cf58, 2 },
182 { 0x00500384, 1 },
183 { 0x005004a0, 1 },
184 { 0x00500604, 1 },
185 { 0x00500680, 1 },
186 { 0x00500714, 1 },
187 { 0x0050081c, 1 },
188 { 0x005008c8, 2 },
189 { 0x00500b04, 1 },
190 { 0x00500c04, 1 },
191 { 0x00500c64, 2 },
192 { 0x00500c88, 1 },
193 { 0x00500cb4, 2 },
194 { 0x00500d00, 1 },
195 { 0x00500d28, 2 },
196 { 0x00500e08, 1 },
197 { 0x00500e1c, 2 },
198 { 0x00500f08, 1 },
199 { 0x00500f20, 2 },
200 { 0x00501000, 1 },
201 { 0x0050100c, 1 },
202 { 0x00501018, 1 },
203 { 0x00501854, 1 },
204 { 0x00501ab0, 1 },
205 { 0x00501ab8, 3 },
206 { 0x00501ac8, 1 },
207 { 0x00501c0c, 1 },
208 { 0x00501c8c, 3 },
209 { 0x00501ca8, 1 },
210 { 0x00501d08, 2 },
211 { 0x00501e00, 1 },
212 { 0x00501e0c, 1 },
213 { 0x00501e14, 2 },
214 { 0x00501e24, 2 },
215 { 0x00501e34, 2 },
216 { 0x00501e44, 4 },
217 { 0x00501ea4, 1 },
218 { 0x00501eb0, 1 },
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 { 0x005031f8, 2 },
231 { 0x00503e14, 1 },
232 { 0x00503ea0, 1 },
233 { 0x00503ecc, 1 },
234 { 0x00503ee8, 2 },
235 { 0x00503fdc, 1 },
236 { 0x00503ff8, 2 },
237 { 0x00504054, 1 },
238 { 0x005042b0, 1 },
239 { 0x005042b8, 3 },
240 { 0x005042c8, 1 },
241 { 0x0050440c, 1 },
242 { 0x0050448c, 3 },
243 { 0x005044a8, 1 },
244 { 0x00504508, 2 },
245 { 0x00504600, 1 },
246 { 0x0050460c, 1 },
247 { 0x00504614, 2 },
248 { 0x00504624, 2 },
249 { 0x00504634, 2 },
250 { 0x00504644, 4 },
251 { 0x005046a4, 1 },
252 { 0x005046b0, 1 },
253 { 0x00504c8c, 1 },
254 { 0x00504d08, 2 },
255 { 0x00504d0c, 1 },
256 { 0x00504e04, 6 },
257 { 0x00504e0c, 1 },
258 { 0x00504e14, 1 },
259 { 0x00504e24, 1 },
260 { 0x00504e24, 2 },
261 { 0x00504e34, 1 },
262 { 0x00504e34, 2 },
263 { 0x00504e44, 4 },
264 { 0x00504e48, 1 },
265 { 0x00504e58, 6 },
266 { 0x00504e74, 9 },
267 { 0x00504ea4, 1 },
268 { 0x00504eac, 2 },
269 { 0x00504f30, 8 },
270 { 0x00504f5c, 2 },
271};
272static const u32 gm20b_global_whitelist_ranges_count =
273 ARRAY_SIZE(gm20b_global_whitelist_ranges);
274
275/* context */
276
277static const struct regop_offset_range gm20b_context_whitelist_ranges[] = {
278 { 0x0000280c, 1 },
279 { 0x00021c00, 4 },
280 { 0x00021c14, 3 },
281 { 0x00021c24, 1 },
282 { 0x00021c2c, 5 },
283 { 0x00021cb8, 2 },
284 { 0x00021d3c, 1 },
285 { 0x00021d44, 1 },
286 { 0x00021d4c, 1 },
287 { 0x00021d54, 1 },
288 { 0x00021d5c, 1 },
289 { 0x00021d64, 2 },
290 { 0x00100cc4, 1 },
291 { 0x00400500, 1 },
292 { 0x00405b40, 1 },
293 { 0x00418e00, 1 },
294 { 0x00418e34, 1 },
295 { 0x00418e40, 2 },
296 { 0x00418e58, 2 },
297 { 0x00419000, 1 },
298 { 0x00419864, 1 },
299 { 0x00419c8c, 3 },
300 { 0x00419c8c, 1 },
301 { 0x00419d08, 2 },
302 { 0x00419e04, 3 },
303 { 0x00419e14, 2 },
304 { 0x00419e24, 2 },
305 { 0x00419e34, 2 },
306 { 0x00419e44, 4 },
307 { 0x00419e4c, 1 },
308 { 0x00419e54, 1 },
309 { 0x00419e58, 6 },
310 { 0x00419e84, 5 },
311 { 0x00419ea4, 1 },
312 { 0x00419eac, 2 },
313 { 0x00419eb0, 1 },
314 { 0x00419ee8, 1 },
315 { 0x00419f30, 8 },
316 { 0x0041b0e8, 2 },
317 { 0x0041bee8, 2 },
318 { 0x0041c48c, 3 },
319 { 0x0041c48c, 1 },
320 { 0x0041c508, 2 },
321 { 0x0041c604, 3 },
322 { 0x0041c614, 2 },
323 { 0x0041c624, 2 },
324 { 0x0041c634, 2 },
325 { 0x0041c644, 4 },
326 { 0x0041c64c, 1 },
327 { 0x0041c654, 1 },
328 { 0x0041c658, 6 },
329 { 0x0041c684, 5 },
330 { 0x0041c6a4, 1 },
331 { 0x0041c6ac, 2 },
332 { 0x0041c6e8, 1 },
333 { 0x0041c730, 8 },
334 { 0x0041cc8c, 1 },
335 { 0x0041ce4c, 1 },
336 { 0x0041ce54, 1 },
337 { 0x0041cee8, 1 },
338 { 0x00501000, 1 },
339 { 0x00501c8c, 3 },
340 { 0x00501c8c, 1 },
341 { 0x00501d08, 2 },
342 { 0x00501e04, 3 },
343 { 0x00501e14, 2 },
344 { 0x00501e24, 2 },
345 { 0x00501e34, 2 },
346 { 0x00501e44, 4 },
347 { 0x00501e4c, 1 },
348 { 0x00501e54, 1 },
349 { 0x00501e58, 6 },
350 { 0x00501e84, 5 },
351 { 0x00501ea4, 1 },
352 { 0x00501eac, 2 },
353 { 0x00501ee8, 1 },
354 { 0x00501f30, 8 },
355 { 0x005030e8, 2 },
356 { 0x00503ee8, 2 },
357 { 0x0050448c, 3 },
358 { 0x0050448c, 1 },
359 { 0x00504508, 2 },
360 { 0x0050450c, 1 },
361 { 0x00504604, 3 },
362 { 0x0050460c, 1 },
363 { 0x00504614, 2 },
364 { 0x00504614, 4 },
365 { 0x00504624, 2 },
366 { 0x00504624, 2 },
367 { 0x00504634, 2 },
368 { 0x00504634, 2 },
369 { 0x00504644, 4 },
370 { 0x00504644, 1 },
371 { 0x0050464c, 3 },
372 { 0x00504658, 6 },
373 { 0x00504684, 5 },
374 { 0x00504684, 4 },
375 { 0x00504698, 1 },
376 { 0x005046a4, 1 },
377 { 0x005046a4, 1 },
378 { 0x005046ac, 2 },
379 { 0x005046e8, 1 },
380 { 0x005046f0, 24 },
381 { 0x00504730, 8 },
382 { 0x00504750, 2 },
383 { 0x00504758, 2 },
384 { 0x00504c8c, 1 },
385 { 0x00504d0c, 1 },
386 { 0x00504e0c, 1 },
387 { 0x00504e14, 4 },
388 { 0x00504e24, 2 },
389 { 0x00504e34, 2 },
390 { 0x00504e44, 1 },
391 { 0x00504e4c, 3 },
392 { 0x00504e84, 4 },
393 { 0x00504e98, 1 },
394 { 0x00504ea4, 1 },
395 { 0x00504ee8, 1 },
396 { 0x00504ef0, 24 },
397 { 0x00504f50, 2 },
398 { 0x00504f58, 2 },
399};
400static const u32 gm20b_context_whitelist_ranges_count =
401 ARRAY_SIZE(gm20b_context_whitelist_ranges);
402
403/* runcontrol */
404static const u32 gm20b_runcontrol_whitelist[] = {
405 0x00419e10,
406 0x0041c610,
407 0x0041ce10,
408 0x00501e10,
409 0x00504610,
410 0x00504e10,
411};
412static const u32 gm20b_runcontrol_whitelist_count =
413 ARRAY_SIZE(gm20b_runcontrol_whitelist);
414
415static const struct regop_offset_range gm20b_runcontrol_whitelist_ranges[] = {
416 { 0x00419e10, 1 },
417 { 0x0041c610, 1 },
418 { 0x0041ce10, 1 },
419 { 0x00501e10, 1 },
420 { 0x00504610, 1 },
421 { 0x00504e10, 1 },
422};
423static const u32 gm20b_runcontrol_whitelist_ranges_count =
424 ARRAY_SIZE(gm20b_runcontrol_whitelist_ranges);
425
426
427/* quad ctl */
428static const u32 gm20b_qctl_whitelist[] = {
429};
430static const u32 gm20b_qctl_whitelist_count =
431 ARRAY_SIZE(gm20b_qctl_whitelist);
432
433static const struct regop_offset_range gm20b_qctl_whitelist_ranges[] = {
434};
435static const u32 gm20b_qctl_whitelist_ranges_count =
436 ARRAY_SIZE(gm20b_qctl_whitelist_ranges);
437
438const struct regop_offset_range *gm20b_get_global_whitelist_ranges(void)
439{
440 return gm20b_global_whitelist_ranges;
441}
442
443int gm20b_get_global_whitelist_ranges_count(void)
444{
445 return gm20b_global_whitelist_ranges_count;
446}
447
448const struct regop_offset_range *gm20b_get_context_whitelist_ranges(void)
449{
450 return gm20b_context_whitelist_ranges;
451}
452
453int gm20b_get_context_whitelist_ranges_count(void)
454{
455 return gm20b_context_whitelist_ranges_count;
456}
457
458const u32 *gm20b_get_runcontrol_whitelist(void)
459{
460 return gm20b_runcontrol_whitelist;
461}
462
463int gm20b_get_runcontrol_whitelist_count(void)
464{
465 return gm20b_runcontrol_whitelist_count;
466}
467
468const struct regop_offset_range *gm20b_get_runcontrol_whitelist_ranges(void)
469{
470 return gm20b_runcontrol_whitelist_ranges;
471}
472
473int gm20b_get_runcontrol_whitelist_ranges_count(void)
474{
475 return gm20b_runcontrol_whitelist_ranges_count;
476}
477
478const u32 *gm20b_get_qctl_whitelist(void)
479{
480 return gm20b_qctl_whitelist;
481}
482
483int gm20b_get_qctl_whitelist_count(void)
484{
485 return gm20b_qctl_whitelist_count;
486}
487
488const struct regop_offset_range *gm20b_get_qctl_whitelist_ranges(void)
489{
490 return gm20b_qctl_whitelist_ranges;
491}
492
493int gm20b_get_qctl_whitelist_ranges_count(void)
494{
495 return gm20b_qctl_whitelist_ranges_count;
496}
497
498void gm20b_init_regops(struct gpu_ops *gops)
499{
500 gops->regops.get_global_whitelist_ranges =
501 gm20b_get_global_whitelist_ranges;
502 gops->regops.get_global_whitelist_ranges_count =
503 gm20b_get_global_whitelist_ranges_count;
504
505 gops->regops.get_context_whitelist_ranges =
506 gm20b_get_context_whitelist_ranges;
507 gops->regops.get_context_whitelist_ranges_count =
508 gm20b_get_context_whitelist_ranges_count;
509
510 gops->regops.get_runcontrol_whitelist =
511 gm20b_get_runcontrol_whitelist;
512 gops->regops.get_runcontrol_whitelist_count =
513 gm20b_get_runcontrol_whitelist_count;
514
515 gops->regops.get_runcontrol_whitelist_ranges =
516 gm20b_get_runcontrol_whitelist_ranges;
517 gops->regops.get_runcontrol_whitelist_ranges_count =
518 gm20b_get_runcontrol_whitelist_ranges_count;
519
520 gops->regops.get_qctl_whitelist =
521 gm20b_get_qctl_whitelist;
522 gops->regops.get_qctl_whitelist_count =
523 gm20b_get_qctl_whitelist_count;
524
525 gops->regops.get_qctl_whitelist_ranges =
526 gm20b_get_qctl_whitelist_ranges;
527 gops->regops.get_qctl_whitelist_ranges_count =
528 gm20b_get_qctl_whitelist_ranges_count;
529}