diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2016-03-23 11:41:04 -0400 |
---|---|---|
committer | Deepak Nibade <dnibade@nvidia.com> | 2016-12-27 04:56:16 -0500 |
commit | 3d0f9a751784ac9eb27f9f989f3b584ff5dc8f17 (patch) | |
tree | 4c1df46e81b17f47ddc8731beb95c7f351de7788 /drivers/gpu/nvgpu/gp106/hw_ram_gp106.h | |
parent | 21eda905ea69a0e090f6e29c444a9129c65f0b1f (diff) |
gpu: nvgpu: Add support for gp104 and gp106
Add support for chips gp104 and gp106.
Change-Id: Ied5f239bdd0ec85245bce1fb6ef51330871d0f05
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1120465
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ken Adams <kadams@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gp106/hw_ram_gp106.h')
-rw-r--r-- | drivers/gpu/nvgpu/gp106/hw_ram_gp106.h | 477 |
1 files changed, 477 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gp106/hw_ram_gp106.h b/drivers/gpu/nvgpu/gp106/hw_ram_gp106.h new file mode 100644 index 00000000..b325affc --- /dev/null +++ b/drivers/gpu/nvgpu/gp106/hw_ram_gp106.h | |||
@@ -0,0 +1,477 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify it | ||
5 | * under the terms and conditions of the GNU General Public License, | ||
6 | * version 2, as published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
9 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
10 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
11 | * more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
15 | */ | ||
16 | /* | ||
17 | * Function naming determines intended use: | ||
18 | * | ||
19 | * <x>_r(void) : Returns the offset for register <x>. | ||
20 | * | ||
21 | * <x>_o(void) : Returns the offset for element <x>. | ||
22 | * | ||
23 | * <x>_w(void) : Returns the word offset for word (4 byte) element <x>. | ||
24 | * | ||
25 | * <x>_<y>_s(void) : Returns size of field <y> of register <x> in bits. | ||
26 | * | ||
27 | * <x>_<y>_f(u32 v) : Returns a value based on 'v' which has been shifted | ||
28 | * and masked to place it at field <y> of register <x>. This value | ||
29 | * can be |'d with others to produce a full register value for | ||
30 | * register <x>. | ||
31 | * | ||
32 | * <x>_<y>_m(void) : Returns a mask for field <y> of register <x>. This | ||
33 | * value can be ~'d and then &'d to clear the value of field <y> for | ||
34 | * register <x>. | ||
35 | * | ||
36 | * <x>_<y>_<z>_f(void) : Returns the constant value <z> after being shifted | ||
37 | * to place it at field <y> of register <x>. This value can be |'d | ||
38 | * with others to produce a full register value for <x>. | ||
39 | * | ||
40 | * <x>_<y>_v(u32 r) : Returns the value of field <y> from a full register | ||
41 | * <x> value 'r' after being shifted to place its LSB at bit 0. | ||
42 | * This value is suitable for direct comparison with other unshifted | ||
43 | * values appropriate for use in field <y> of register <x>. | ||
44 | * | ||
45 | * <x>_<y>_<z>_v(void) : Returns the constant value for <z> defined for | ||
46 | * field <y> of register <x>. This value is suitable for direct | ||
47 | * comparison with unshifted values appropriate for use in field <y> | ||
48 | * of register <x>. | ||
49 | */ | ||
50 | #ifndef _hw_ram_gp106_h_ | ||
51 | #define _hw_ram_gp106_h_ | ||
52 | |||
53 | static inline u32 ram_in_ramfc_s(void) | ||
54 | { | ||
55 | return 4096; | ||
56 | } | ||
57 | static inline u32 ram_in_ramfc_w(void) | ||
58 | { | ||
59 | return 0; | ||
60 | } | ||
61 | static inline u32 ram_in_page_dir_base_target_f(u32 v) | ||
62 | { | ||
63 | return (v & 0x3) << 0; | ||
64 | } | ||
65 | static inline u32 ram_in_page_dir_base_target_w(void) | ||
66 | { | ||
67 | return 128; | ||
68 | } | ||
69 | static inline u32 ram_in_page_dir_base_target_vid_mem_f(void) | ||
70 | { | ||
71 | return 0x0; | ||
72 | } | ||
73 | static inline u32 ram_in_page_dir_base_target_sys_mem_coh_f(void) | ||
74 | { | ||
75 | return 0x2; | ||
76 | } | ||
77 | static inline u32 ram_in_page_dir_base_target_sys_mem_ncoh_f(void) | ||
78 | { | ||
79 | return 0x3; | ||
80 | } | ||
81 | static inline u32 ram_in_page_dir_base_vol_w(void) | ||
82 | { | ||
83 | return 128; | ||
84 | } | ||
85 | static inline u32 ram_in_page_dir_base_vol_true_f(void) | ||
86 | { | ||
87 | return 0x4; | ||
88 | } | ||
89 | static inline u32 ram_in_page_dir_base_fault_replay_tex_f(u32 v) | ||
90 | { | ||
91 | return (v & 0x1) << 4; | ||
92 | } | ||
93 | static inline u32 ram_in_page_dir_base_fault_replay_tex_m(void) | ||
94 | { | ||
95 | return 0x1 << 4; | ||
96 | } | ||
97 | static inline u32 ram_in_page_dir_base_fault_replay_tex_w(void) | ||
98 | { | ||
99 | return 128; | ||
100 | } | ||
101 | static inline u32 ram_in_page_dir_base_fault_replay_tex_true_f(void) | ||
102 | { | ||
103 | return 0x10; | ||
104 | } | ||
105 | static inline u32 ram_in_page_dir_base_fault_replay_gcc_f(u32 v) | ||
106 | { | ||
107 | return (v & 0x1) << 5; | ||
108 | } | ||
109 | static inline u32 ram_in_page_dir_base_fault_replay_gcc_m(void) | ||
110 | { | ||
111 | return 0x1 << 5; | ||
112 | } | ||
113 | static inline u32 ram_in_page_dir_base_fault_replay_gcc_w(void) | ||
114 | { | ||
115 | return 128; | ||
116 | } | ||
117 | static inline u32 ram_in_page_dir_base_fault_replay_gcc_true_f(void) | ||
118 | { | ||
119 | return 0x20; | ||
120 | } | ||
121 | static inline u32 ram_in_big_page_size_f(u32 v) | ||
122 | { | ||
123 | return (v & 0x1) << 11; | ||
124 | } | ||
125 | static inline u32 ram_in_big_page_size_m(void) | ||
126 | { | ||
127 | return 0x1 << 11; | ||
128 | } | ||
129 | static inline u32 ram_in_big_page_size_w(void) | ||
130 | { | ||
131 | return 128; | ||
132 | } | ||
133 | static inline u32 ram_in_big_page_size_128kb_f(void) | ||
134 | { | ||
135 | return 0x0; | ||
136 | } | ||
137 | static inline u32 ram_in_big_page_size_64kb_f(void) | ||
138 | { | ||
139 | return 0x800; | ||
140 | } | ||
141 | static inline u32 ram_in_page_dir_base_lo_f(u32 v) | ||
142 | { | ||
143 | return (v & 0xfffff) << 12; | ||
144 | } | ||
145 | static inline u32 ram_in_page_dir_base_lo_w(void) | ||
146 | { | ||
147 | return 128; | ||
148 | } | ||
149 | static inline u32 ram_in_page_dir_base_hi_f(u32 v) | ||
150 | { | ||
151 | return (v & 0xffffffff) << 0; | ||
152 | } | ||
153 | static inline u32 ram_in_page_dir_base_hi_w(void) | ||
154 | { | ||
155 | return 129; | ||
156 | } | ||
157 | static inline u32 ram_in_adr_limit_lo_f(u32 v) | ||
158 | { | ||
159 | return (v & 0xfffff) << 12; | ||
160 | } | ||
161 | static inline u32 ram_in_adr_limit_lo_w(void) | ||
162 | { | ||
163 | return 130; | ||
164 | } | ||
165 | static inline u32 ram_in_adr_limit_hi_f(u32 v) | ||
166 | { | ||
167 | return (v & 0xffffffff) << 0; | ||
168 | } | ||
169 | static inline u32 ram_in_adr_limit_hi_w(void) | ||
170 | { | ||
171 | return 131; | ||
172 | } | ||
173 | static inline u32 ram_in_engine_cs_w(void) | ||
174 | { | ||
175 | return 132; | ||
176 | } | ||
177 | static inline u32 ram_in_engine_cs_wfi_v(void) | ||
178 | { | ||
179 | return 0x00000000; | ||
180 | } | ||
181 | static inline u32 ram_in_engine_cs_wfi_f(void) | ||
182 | { | ||
183 | return 0x0; | ||
184 | } | ||
185 | static inline u32 ram_in_engine_cs_fg_v(void) | ||
186 | { | ||
187 | return 0x00000001; | ||
188 | } | ||
189 | static inline u32 ram_in_engine_cs_fg_f(void) | ||
190 | { | ||
191 | return 0x8; | ||
192 | } | ||
193 | static inline u32 ram_in_gr_cs_w(void) | ||
194 | { | ||
195 | return 132; | ||
196 | } | ||
197 | static inline u32 ram_in_gr_cs_wfi_f(void) | ||
198 | { | ||
199 | return 0x0; | ||
200 | } | ||
201 | static inline u32 ram_in_gr_wfi_target_w(void) | ||
202 | { | ||
203 | return 132; | ||
204 | } | ||
205 | static inline u32 ram_in_gr_wfi_mode_w(void) | ||
206 | { | ||
207 | return 132; | ||
208 | } | ||
209 | static inline u32 ram_in_gr_wfi_mode_physical_v(void) | ||
210 | { | ||
211 | return 0x00000000; | ||
212 | } | ||
213 | static inline u32 ram_in_gr_wfi_mode_physical_f(void) | ||
214 | { | ||
215 | return 0x0; | ||
216 | } | ||
217 | static inline u32 ram_in_gr_wfi_mode_virtual_v(void) | ||
218 | { | ||
219 | return 0x00000001; | ||
220 | } | ||
221 | static inline u32 ram_in_gr_wfi_mode_virtual_f(void) | ||
222 | { | ||
223 | return 0x4; | ||
224 | } | ||
225 | static inline u32 ram_in_gr_wfi_ptr_lo_f(u32 v) | ||
226 | { | ||
227 | return (v & 0xfffff) << 12; | ||
228 | } | ||
229 | static inline u32 ram_in_gr_wfi_ptr_lo_w(void) | ||
230 | { | ||
231 | return 132; | ||
232 | } | ||
233 | static inline u32 ram_in_gr_wfi_ptr_hi_f(u32 v) | ||
234 | { | ||
235 | return (v & 0xff) << 0; | ||
236 | } | ||
237 | static inline u32 ram_in_gr_wfi_ptr_hi_w(void) | ||
238 | { | ||
239 | return 133; | ||
240 | } | ||
241 | static inline u32 ram_in_base_shift_v(void) | ||
242 | { | ||
243 | return 0x0000000c; | ||
244 | } | ||
245 | static inline u32 ram_in_alloc_size_v(void) | ||
246 | { | ||
247 | return 0x00001000; | ||
248 | } | ||
249 | static inline u32 ram_fc_size_val_v(void) | ||
250 | { | ||
251 | return 0x00000200; | ||
252 | } | ||
253 | static inline u32 ram_fc_gp_put_w(void) | ||
254 | { | ||
255 | return 0; | ||
256 | } | ||
257 | static inline u32 ram_fc_userd_w(void) | ||
258 | { | ||
259 | return 2; | ||
260 | } | ||
261 | static inline u32 ram_fc_userd_hi_w(void) | ||
262 | { | ||
263 | return 3; | ||
264 | } | ||
265 | static inline u32 ram_fc_signature_w(void) | ||
266 | { | ||
267 | return 4; | ||
268 | } | ||
269 | static inline u32 ram_fc_gp_get_w(void) | ||
270 | { | ||
271 | return 5; | ||
272 | } | ||
273 | static inline u32 ram_fc_pb_get_w(void) | ||
274 | { | ||
275 | return 6; | ||
276 | } | ||
277 | static inline u32 ram_fc_pb_get_hi_w(void) | ||
278 | { | ||
279 | return 7; | ||
280 | } | ||
281 | static inline u32 ram_fc_pb_top_level_get_w(void) | ||
282 | { | ||
283 | return 8; | ||
284 | } | ||
285 | static inline u32 ram_fc_pb_top_level_get_hi_w(void) | ||
286 | { | ||
287 | return 9; | ||
288 | } | ||
289 | static inline u32 ram_fc_acquire_w(void) | ||
290 | { | ||
291 | return 12; | ||
292 | } | ||
293 | static inline u32 ram_fc_semaphorea_w(void) | ||
294 | { | ||
295 | return 14; | ||
296 | } | ||
297 | static inline u32 ram_fc_semaphoreb_w(void) | ||
298 | { | ||
299 | return 15; | ||
300 | } | ||
301 | static inline u32 ram_fc_semaphorec_w(void) | ||
302 | { | ||
303 | return 16; | ||
304 | } | ||
305 | static inline u32 ram_fc_semaphored_w(void) | ||
306 | { | ||
307 | return 17; | ||
308 | } | ||
309 | static inline u32 ram_fc_gp_base_w(void) | ||
310 | { | ||
311 | return 18; | ||
312 | } | ||
313 | static inline u32 ram_fc_gp_base_hi_w(void) | ||
314 | { | ||
315 | return 19; | ||
316 | } | ||
317 | static inline u32 ram_fc_gp_fetch_w(void) | ||
318 | { | ||
319 | return 20; | ||
320 | } | ||
321 | static inline u32 ram_fc_pb_fetch_w(void) | ||
322 | { | ||
323 | return 21; | ||
324 | } | ||
325 | static inline u32 ram_fc_pb_fetch_hi_w(void) | ||
326 | { | ||
327 | return 22; | ||
328 | } | ||
329 | static inline u32 ram_fc_pb_put_w(void) | ||
330 | { | ||
331 | return 23; | ||
332 | } | ||
333 | static inline u32 ram_fc_pb_put_hi_w(void) | ||
334 | { | ||
335 | return 24; | ||
336 | } | ||
337 | static inline u32 ram_fc_pb_header_w(void) | ||
338 | { | ||
339 | return 33; | ||
340 | } | ||
341 | static inline u32 ram_fc_pb_count_w(void) | ||
342 | { | ||
343 | return 34; | ||
344 | } | ||
345 | static inline u32 ram_fc_subdevice_w(void) | ||
346 | { | ||
347 | return 37; | ||
348 | } | ||
349 | static inline u32 ram_fc_formats_w(void) | ||
350 | { | ||
351 | return 39; | ||
352 | } | ||
353 | static inline u32 ram_fc_target_w(void) | ||
354 | { | ||
355 | return 43; | ||
356 | } | ||
357 | static inline u32 ram_fc_hce_ctrl_w(void) | ||
358 | { | ||
359 | return 57; | ||
360 | } | ||
361 | static inline u32 ram_fc_chid_w(void) | ||
362 | { | ||
363 | return 58; | ||
364 | } | ||
365 | static inline u32 ram_fc_chid_id_f(u32 v) | ||
366 | { | ||
367 | return (v & 0xfff) << 0; | ||
368 | } | ||
369 | static inline u32 ram_fc_chid_id_w(void) | ||
370 | { | ||
371 | return 0; | ||
372 | } | ||
373 | static inline u32 ram_fc_runlist_timeslice_w(void) | ||
374 | { | ||
375 | return 62; | ||
376 | } | ||
377 | static inline u32 ram_userd_base_shift_v(void) | ||
378 | { | ||
379 | return 0x00000009; | ||
380 | } | ||
381 | static inline u32 ram_userd_chan_size_v(void) | ||
382 | { | ||
383 | return 0x00000200; | ||
384 | } | ||
385 | static inline u32 ram_userd_put_w(void) | ||
386 | { | ||
387 | return 16; | ||
388 | } | ||
389 | static inline u32 ram_userd_get_w(void) | ||
390 | { | ||
391 | return 17; | ||
392 | } | ||
393 | static inline u32 ram_userd_ref_w(void) | ||
394 | { | ||
395 | return 18; | ||
396 | } | ||
397 | static inline u32 ram_userd_put_hi_w(void) | ||
398 | { | ||
399 | return 19; | ||
400 | } | ||
401 | static inline u32 ram_userd_ref_threshold_w(void) | ||
402 | { | ||
403 | return 20; | ||
404 | } | ||
405 | static inline u32 ram_userd_top_level_get_w(void) | ||
406 | { | ||
407 | return 22; | ||
408 | } | ||
409 | static inline u32 ram_userd_top_level_get_hi_w(void) | ||
410 | { | ||
411 | return 23; | ||
412 | } | ||
413 | static inline u32 ram_userd_get_hi_w(void) | ||
414 | { | ||
415 | return 24; | ||
416 | } | ||
417 | static inline u32 ram_userd_gp_get_w(void) | ||
418 | { | ||
419 | return 34; | ||
420 | } | ||
421 | static inline u32 ram_userd_gp_put_w(void) | ||
422 | { | ||
423 | return 35; | ||
424 | } | ||
425 | static inline u32 ram_userd_gp_top_level_get_w(void) | ||
426 | { | ||
427 | return 22; | ||
428 | } | ||
429 | static inline u32 ram_userd_gp_top_level_get_hi_w(void) | ||
430 | { | ||
431 | return 23; | ||
432 | } | ||
433 | static inline u32 ram_rl_entry_size_v(void) | ||
434 | { | ||
435 | return 0x00000008; | ||
436 | } | ||
437 | static inline u32 ram_rl_entry_chid_f(u32 v) | ||
438 | { | ||
439 | return (v & 0xfff) << 0; | ||
440 | } | ||
441 | static inline u32 ram_rl_entry_id_f(u32 v) | ||
442 | { | ||
443 | return (v & 0xfff) << 0; | ||
444 | } | ||
445 | static inline u32 ram_rl_entry_type_f(u32 v) | ||
446 | { | ||
447 | return (v & 0x1) << 13; | ||
448 | } | ||
449 | static inline u32 ram_rl_entry_type_chid_f(void) | ||
450 | { | ||
451 | return 0x0; | ||
452 | } | ||
453 | static inline u32 ram_rl_entry_type_tsg_f(void) | ||
454 | { | ||
455 | return 0x2000; | ||
456 | } | ||
457 | static inline u32 ram_rl_entry_timeslice_scale_f(u32 v) | ||
458 | { | ||
459 | return (v & 0xf) << 14; | ||
460 | } | ||
461 | static inline u32 ram_rl_entry_timeslice_scale_3_f(void) | ||
462 | { | ||
463 | return 0xc000; | ||
464 | } | ||
465 | static inline u32 ram_rl_entry_timeslice_timeout_f(u32 v) | ||
466 | { | ||
467 | return (v & 0xff) << 18; | ||
468 | } | ||
469 | static inline u32 ram_rl_entry_timeslice_timeout_128_f(void) | ||
470 | { | ||
471 | return 0x2000000; | ||
472 | } | ||
473 | static inline u32 ram_rl_entry_tsg_length_f(u32 v) | ||
474 | { | ||
475 | return (v & 0x3f) << 26; | ||
476 | } | ||
477 | #endif | ||