summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/include
diff options
context:
space:
mode:
authorDeepak Nibade <dnibade@nvidia.com>2018-09-07 09:45:41 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-09-12 20:48:58 -0400
commitf4040bae95d2df86c6d15534f502a21dd860d33c (patch)
treeb690e77f7a35b0ed83af654745c713a68b314ee8 /drivers/gpu/nvgpu/include
parent4a54c2ae80e9c7c7ee53bc2bb39d2efb55d5a132 (diff)
gpu: nvgpu: add gsp accessors for GV100
Change-Id: I0b0992e2eda98209ed3d7277a69a7fcf1d01f083 Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1816025 Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Mahantesh Kumbar <mkumbar@nvidia.com> Tested-by: Mahantesh Kumbar <mkumbar@nvidia.com> Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/include')
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gv100/hw_pgsp_gv100.h615
1 files changed, 615 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gv100/hw_pgsp_gv100.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gv100/hw_pgsp_gv100.h
new file mode 100644
index 00000000..f0f5bc26
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gv100/hw_pgsp_gv100.h
@@ -0,0 +1,615 @@
1/*
2 * Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 * DEALINGS IN THE SOFTWARE.
21 */
22/*
23 * Function naming determines intended use:
24 *
25 * <x>_r(void) : Returns the offset for register <x>.
26 *
27 * <x>_o(void) : Returns the offset for element <x>.
28 *
29 * <x>_w(void) : Returns the word offset for word (4 byte) element <x>.
30 *
31 * <x>_<y>_s(void) : Returns size of field <y> of register <x> in bits.
32 *
33 * <x>_<y>_f(u32 v) : Returns a value based on 'v' which has been shifted
34 * and masked to place it at field <y> of register <x>. This value
35 * can be |'d with others to produce a full register value for
36 * register <x>.
37 *
38 * <x>_<y>_m(void) : Returns a mask for field <y> of register <x>. This
39 * value can be ~'d and then &'d to clear the value of field <y> for
40 * register <x>.
41 *
42 * <x>_<y>_<z>_f(void) : Returns the constant value <z> after being shifted
43 * to place it at field <y> of register <x>. This value can be |'d
44 * with others to produce a full register value for <x>.
45 *
46 * <x>_<y>_v(u32 r) : Returns the value of field <y> from a full register
47 * <x> value 'r' after being shifted to place its LSB at bit 0.
48 * This value is suitable for direct comparison with other unshifted
49 * values appropriate for use in field <y> of register <x>.
50 *
51 * <x>_<y>_<z>_v(void) : Returns the constant value for <z> defined for
52 * field <y> of register <x>. This value is suitable for direct
53 * comparison with unshifted values appropriate for use in field <y>
54 * of register <x>.
55 */
56#ifndef _hw_pgsp_gv100_h_
57#define _hw_pgsp_gv100_h_
58
59static inline u32 pgsp_falcon_irqsset_r(void)
60{
61 return 0x00110000U;
62}
63static inline u32 pgsp_falcon_irqsset_swgen0_set_f(void)
64{
65 return 0x40U;
66}
67static inline u32 pgsp_falcon_irqsclr_r(void)
68{
69 return 0x00110004U;
70}
71static inline u32 pgsp_falcon_irqstat_r(void)
72{
73 return 0x00110008U;
74}
75static inline u32 pgsp_falcon_irqstat_halt_true_f(void)
76{
77 return 0x10U;
78}
79static inline u32 pgsp_falcon_irqstat_exterr_true_f(void)
80{
81 return 0x20U;
82}
83static inline u32 pgsp_falcon_irqstat_swgen0_true_f(void)
84{
85 return 0x40U;
86}
87static inline u32 pgsp_falcon_irqmode_r(void)
88{
89 return 0x0011000cU;
90}
91static inline u32 pgsp_falcon_irqmset_r(void)
92{
93 return 0x00110010U;
94}
95static inline u32 pgsp_falcon_irqmset_gptmr_f(u32 v)
96{
97 return (v & 0x1U) << 0U;
98}
99static inline u32 pgsp_falcon_irqmset_wdtmr_f(u32 v)
100{
101 return (v & 0x1U) << 1U;
102}
103static inline u32 pgsp_falcon_irqmset_mthd_f(u32 v)
104{
105 return (v & 0x1U) << 2U;
106}
107static inline u32 pgsp_falcon_irqmset_ctxsw_f(u32 v)
108{
109 return (v & 0x1U) << 3U;
110}
111static inline u32 pgsp_falcon_irqmset_halt_f(u32 v)
112{
113 return (v & 0x1U) << 4U;
114}
115static inline u32 pgsp_falcon_irqmset_exterr_f(u32 v)
116{
117 return (v & 0x1U) << 5U;
118}
119static inline u32 pgsp_falcon_irqmset_swgen0_f(u32 v)
120{
121 return (v & 0x1U) << 6U;
122}
123static inline u32 pgsp_falcon_irqmset_swgen1_f(u32 v)
124{
125 return (v & 0x1U) << 7U;
126}
127static inline u32 pgsp_falcon_irqmclr_r(void)
128{
129 return 0x00110014U;
130}
131static inline u32 pgsp_falcon_irqmclr_gptmr_f(u32 v)
132{
133 return (v & 0x1U) << 0U;
134}
135static inline u32 pgsp_falcon_irqmclr_wdtmr_f(u32 v)
136{
137 return (v & 0x1U) << 1U;
138}
139static inline u32 pgsp_falcon_irqmclr_mthd_f(u32 v)
140{
141 return (v & 0x1U) << 2U;
142}
143static inline u32 pgsp_falcon_irqmclr_ctxsw_f(u32 v)
144{
145 return (v & 0x1U) << 3U;
146}
147static inline u32 pgsp_falcon_irqmclr_halt_f(u32 v)
148{
149 return (v & 0x1U) << 4U;
150}
151static inline u32 pgsp_falcon_irqmclr_exterr_f(u32 v)
152{
153 return (v & 0x1U) << 5U;
154}
155static inline u32 pgsp_falcon_irqmclr_swgen0_f(u32 v)
156{
157 return (v & 0x1U) << 6U;
158}
159static inline u32 pgsp_falcon_irqmclr_swgen1_f(u32 v)
160{
161 return (v & 0x1U) << 7U;
162}
163static inline u32 pgsp_falcon_irqmclr_ext_f(u32 v)
164{
165 return (v & 0xffU) << 8U;
166}
167static inline u32 pgsp_falcon_irqmask_r(void)
168{
169 return 0x00110018U;
170}
171static inline u32 pgsp_falcon_irqdest_r(void)
172{
173 return 0x0011001cU;
174}
175static inline u32 pgsp_falcon_irqdest_host_gptmr_f(u32 v)
176{
177 return (v & 0x1U) << 0U;
178}
179static inline u32 pgsp_falcon_irqdest_host_wdtmr_f(u32 v)
180{
181 return (v & 0x1U) << 1U;
182}
183static inline u32 pgsp_falcon_irqdest_host_mthd_f(u32 v)
184{
185 return (v & 0x1U) << 2U;
186}
187static inline u32 pgsp_falcon_irqdest_host_ctxsw_f(u32 v)
188{
189 return (v & 0x1U) << 3U;
190}
191static inline u32 pgsp_falcon_irqdest_host_halt_f(u32 v)
192{
193 return (v & 0x1U) << 4U;
194}
195static inline u32 pgsp_falcon_irqdest_host_exterr_f(u32 v)
196{
197 return (v & 0x1U) << 5U;
198}
199static inline u32 pgsp_falcon_irqdest_host_swgen0_f(u32 v)
200{
201 return (v & 0x1U) << 6U;
202}
203static inline u32 pgsp_falcon_irqdest_host_swgen1_f(u32 v)
204{
205 return (v & 0x1U) << 7U;
206}
207static inline u32 pgsp_falcon_irqdest_host_ext_f(u32 v)
208{
209 return (v & 0xffU) << 8U;
210}
211static inline u32 pgsp_falcon_irqdest_target_gptmr_f(u32 v)
212{
213 return (v & 0x1U) << 16U;
214}
215static inline u32 pgsp_falcon_irqdest_target_wdtmr_f(u32 v)
216{
217 return (v & 0x1U) << 17U;
218}
219static inline u32 pgsp_falcon_irqdest_target_mthd_f(u32 v)
220{
221 return (v & 0x1U) << 18U;
222}
223static inline u32 pgsp_falcon_irqdest_target_ctxsw_f(u32 v)
224{
225 return (v & 0x1U) << 19U;
226}
227static inline u32 pgsp_falcon_irqdest_target_halt_f(u32 v)
228{
229 return (v & 0x1U) << 20U;
230}
231static inline u32 pgsp_falcon_irqdest_target_exterr_f(u32 v)
232{
233 return (v & 0x1U) << 21U;
234}
235static inline u32 pgsp_falcon_irqdest_target_swgen0_f(u32 v)
236{
237 return (v & 0x1U) << 22U;
238}
239static inline u32 pgsp_falcon_irqdest_target_swgen1_f(u32 v)
240{
241 return (v & 0x1U) << 23U;
242}
243static inline u32 pgsp_falcon_irqdest_target_ext_f(u32 v)
244{
245 return (v & 0xffU) << 24U;
246}
247static inline u32 pgsp_falcon_curctx_r(void)
248{
249 return 0x00110050U;
250}
251static inline u32 pgsp_falcon_nxtctx_r(void)
252{
253 return 0x00110054U;
254}
255static inline u32 pgsp_falcon_mailbox0_r(void)
256{
257 return 0x00110040U;
258}
259static inline u32 pgsp_falcon_mailbox1_r(void)
260{
261 return 0x00110044U;
262}
263static inline u32 pgsp_falcon_itfen_r(void)
264{
265 return 0x00110048U;
266}
267static inline u32 pgsp_falcon_itfen_ctxen_enable_f(void)
268{
269 return 0x1U;
270}
271static inline u32 pgsp_falcon_idlestate_r(void)
272{
273 return 0x0011004cU;
274}
275static inline u32 pgsp_falcon_idlestate_falcon_busy_v(u32 r)
276{
277 return (r >> 0U) & 0x1U;
278}
279static inline u32 pgsp_falcon_idlestate_ext_busy_v(u32 r)
280{
281 return (r >> 1U) & 0x7fffU;
282}
283static inline u32 pgsp_falcon_os_r(void)
284{
285 return 0x00110080U;
286}
287static inline u32 pgsp_falcon_engctl_r(void)
288{
289 return 0x001100a4U;
290}
291static inline u32 pgsp_falcon_cpuctl_r(void)
292{
293 return 0x00110100U;
294}
295static inline u32 pgsp_falcon_cpuctl_startcpu_f(u32 v)
296{
297 return (v & 0x1U) << 1U;
298}
299static inline u32 pgsp_falcon_cpuctl_halt_intr_f(u32 v)
300{
301 return (v & 0x1U) << 4U;
302}
303static inline u32 pgsp_falcon_cpuctl_halt_intr_m(void)
304{
305 return 0x1U << 4U;
306}
307static inline u32 pgsp_falcon_cpuctl_halt_intr_v(u32 r)
308{
309 return (r >> 4U) & 0x1U;
310}
311static inline u32 pgsp_falcon_cpuctl_cpuctl_alias_en_f(u32 v)
312{
313 return (v & 0x1U) << 6U;
314}
315static inline u32 pgsp_falcon_cpuctl_cpuctl_alias_en_m(void)
316{
317 return 0x1U << 6U;
318}
319static inline u32 pgsp_falcon_cpuctl_cpuctl_alias_en_v(u32 r)
320{
321 return (r >> 6U) & 0x1U;
322}
323static inline u32 pgsp_falcon_cpuctl_alias_r(void)
324{
325 return 0x00110130U;
326}
327static inline u32 pgsp_falcon_cpuctl_alias_startcpu_f(u32 v)
328{
329 return (v & 0x1U) << 1U;
330}
331static inline u32 pgsp_falcon_imemc_r(u32 i)
332{
333 return 0x00110180U + i*16U;
334}
335static inline u32 pgsp_falcon_imemc_offs_f(u32 v)
336{
337 return (v & 0x3fU) << 2U;
338}
339static inline u32 pgsp_falcon_imemc_blk_f(u32 v)
340{
341 return (v & 0xffU) << 8U;
342}
343static inline u32 pgsp_falcon_imemc_aincw_f(u32 v)
344{
345 return (v & 0x1U) << 24U;
346}
347static inline u32 pgsp_falcon_imemd_r(u32 i)
348{
349 return 0x00110184U + i*16U;
350}
351static inline u32 pgsp_falcon_imemt_r(u32 i)
352{
353 return 0x00110188U + i*16U;
354}
355static inline u32 pgsp_falcon_sctl_r(void)
356{
357 return 0x00110240U;
358}
359static inline u32 pgsp_falcon_mmu_phys_sec_r(void)
360{
361 return 0x00100ce4U;
362}
363static inline u32 pgsp_falcon_bootvec_r(void)
364{
365 return 0x00110104U;
366}
367static inline u32 pgsp_falcon_bootvec_vec_f(u32 v)
368{
369 return (v & 0xffffffffU) << 0U;
370}
371static inline u32 pgsp_falcon_dmactl_r(void)
372{
373 return 0x0011010cU;
374}
375static inline u32 pgsp_falcon_dmactl_dmem_scrubbing_m(void)
376{
377 return 0x1U << 1U;
378}
379static inline u32 pgsp_falcon_dmactl_imem_scrubbing_m(void)
380{
381 return 0x1U << 2U;
382}
383static inline u32 pgsp_falcon_dmactl_require_ctx_f(u32 v)
384{
385 return (v & 0x1U) << 0U;
386}
387static inline u32 pgsp_falcon_hwcfg_r(void)
388{
389 return 0x00110108U;
390}
391static inline u32 pgsp_falcon_hwcfg_imem_size_v(u32 r)
392{
393 return (r >> 0U) & 0x1ffU;
394}
395static inline u32 pgsp_falcon_hwcfg_dmem_size_v(u32 r)
396{
397 return (r >> 9U) & 0x1ffU;
398}
399static inline u32 pgsp_falcon_dmatrfbase_r(void)
400{
401 return 0x00110110U;
402}
403static inline u32 pgsp_falcon_dmatrfbase1_r(void)
404{
405 return 0x00110128U;
406}
407static inline u32 pgsp_falcon_dmatrfmoffs_r(void)
408{
409 return 0x00110114U;
410}
411static inline u32 pgsp_falcon_dmatrfcmd_r(void)
412{
413 return 0x00110118U;
414}
415static inline u32 pgsp_falcon_dmatrfcmd_imem_f(u32 v)
416{
417 return (v & 0x1U) << 4U;
418}
419static inline u32 pgsp_falcon_dmatrfcmd_write_f(u32 v)
420{
421 return (v & 0x1U) << 5U;
422}
423static inline u32 pgsp_falcon_dmatrfcmd_size_f(u32 v)
424{
425 return (v & 0x7U) << 8U;
426}
427static inline u32 pgsp_falcon_dmatrfcmd_ctxdma_f(u32 v)
428{
429 return (v & 0x7U) << 12U;
430}
431static inline u32 pgsp_falcon_dmatrffboffs_r(void)
432{
433 return 0x0011011cU;
434}
435static inline u32 pgsp_falcon_exterraddr_r(void)
436{
437 return 0x00110168U;
438}
439static inline u32 pgsp_falcon_exterrstat_r(void)
440{
441 return 0x0011016cU;
442}
443static inline u32 pgsp_falcon_exterrstat_valid_m(void)
444{
445 return 0x1U << 31U;
446}
447static inline u32 pgsp_falcon_exterrstat_valid_v(u32 r)
448{
449 return (r >> 31U) & 0x1U;
450}
451static inline u32 pgsp_falcon_exterrstat_valid_true_v(void)
452{
453 return 0x00000001U;
454}
455static inline u32 pgsp_sec2_falcon_icd_cmd_r(void)
456{
457 return 0x00110200U;
458}
459static inline u32 pgsp_sec2_falcon_icd_cmd_opc_s(void)
460{
461 return 4U;
462}
463static inline u32 pgsp_sec2_falcon_icd_cmd_opc_f(u32 v)
464{
465 return (v & 0xfU) << 0U;
466}
467static inline u32 pgsp_sec2_falcon_icd_cmd_opc_m(void)
468{
469 return 0xfU << 0U;
470}
471static inline u32 pgsp_sec2_falcon_icd_cmd_opc_v(u32 r)
472{
473 return (r >> 0U) & 0xfU;
474}
475static inline u32 pgsp_sec2_falcon_icd_cmd_opc_rreg_f(void)
476{
477 return 0x8U;
478}
479static inline u32 pgsp_sec2_falcon_icd_cmd_opc_rstat_f(void)
480{
481 return 0xeU;
482}
483static inline u32 pgsp_sec2_falcon_icd_cmd_idx_f(u32 v)
484{
485 return (v & 0x1fU) << 8U;
486}
487static inline u32 pgsp_sec2_falcon_icd_rdata_r(void)
488{
489 return 0x0011020cU;
490}
491static inline u32 pgsp_falcon_dmemc_r(u32 i)
492{
493 return 0x001101c0U + i*8U;
494}
495static inline u32 pgsp_falcon_dmemc_offs_f(u32 v)
496{
497 return (v & 0x3fU) << 2U;
498}
499static inline u32 pgsp_falcon_dmemc_offs_m(void)
500{
501 return 0x3fU << 2U;
502}
503static inline u32 pgsp_falcon_dmemc_blk_f(u32 v)
504{
505 return (v & 0xffU) << 8U;
506}
507static inline u32 pgsp_falcon_dmemc_blk_m(void)
508{
509 return 0xffU << 8U;
510}
511static inline u32 pgsp_falcon_dmemc_aincw_f(u32 v)
512{
513 return (v & 0x1U) << 24U;
514}
515static inline u32 pgsp_falcon_dmemc_aincr_f(u32 v)
516{
517 return (v & 0x1U) << 25U;
518}
519static inline u32 pgsp_falcon_dmemd_r(u32 i)
520{
521 return 0x001101c4U + i*8U;
522}
523static inline u32 pgsp_falcon_debug1_r(void)
524{
525 return 0x00110090U;
526}
527static inline u32 pgsp_falcon_debug1_ctxsw_mode_s(void)
528{
529 return 1U;
530}
531static inline u32 pgsp_falcon_debug1_ctxsw_mode_f(u32 v)
532{
533 return (v & 0x1U) << 16U;
534}
535static inline u32 pgsp_falcon_debug1_ctxsw_mode_m(void)
536{
537 return 0x1U << 16U;
538}
539static inline u32 pgsp_falcon_debug1_ctxsw_mode_v(u32 r)
540{
541 return (r >> 16U) & 0x1U;
542}
543static inline u32 pgsp_falcon_debug1_ctxsw_mode_init_f(void)
544{
545 return 0x0U;
546}
547static inline u32 pgsp_fbif_transcfg_r(u32 i)
548{
549 return 0x00110600U + i*4U;
550}
551static inline u32 pgsp_fbif_transcfg_target_local_fb_f(void)
552{
553 return 0x0U;
554}
555static inline u32 pgsp_fbif_transcfg_target_coherent_sysmem_f(void)
556{
557 return 0x1U;
558}
559static inline u32 pgsp_fbif_transcfg_target_noncoherent_sysmem_f(void)
560{
561 return 0x2U;
562}
563static inline u32 pgsp_fbif_transcfg_mem_type_s(void)
564{
565 return 1U;
566}
567static inline u32 pgsp_fbif_transcfg_mem_type_f(u32 v)
568{
569 return (v & 0x1U) << 2U;
570}
571static inline u32 pgsp_fbif_transcfg_mem_type_m(void)
572{
573 return 0x1U << 2U;
574}
575static inline u32 pgsp_fbif_transcfg_mem_type_v(u32 r)
576{
577 return (r >> 2U) & 0x1U;
578}
579static inline u32 pgsp_fbif_transcfg_mem_type_virtual_f(void)
580{
581 return 0x0U;
582}
583static inline u32 pgsp_fbif_transcfg_mem_type_physical_f(void)
584{
585 return 0x4U;
586}
587static inline u32 pgsp_falcon_engine_r(void)
588{
589 return 0x001103c0U;
590}
591static inline u32 pgsp_falcon_engine_reset_true_f(void)
592{
593 return 0x1U;
594}
595static inline u32 pgsp_falcon_engine_reset_false_f(void)
596{
597 return 0x0U;
598}
599static inline u32 pgsp_fbif_ctl_r(void)
600{
601 return 0x00110624U;
602}
603static inline u32 pgsp_fbif_ctl_allow_phys_no_ctx_init_f(void)
604{
605 return 0x0U;
606}
607static inline u32 pgsp_fbif_ctl_allow_phys_no_ctx_disallow_f(void)
608{
609 return 0x0U;
610}
611static inline u32 pgsp_fbif_ctl_allow_phys_no_ctx_allow_f(void)
612{
613 return 0x80U;
614}
615#endif