summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/include
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/include')
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/acr/acr_flcnbl.h144
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/acr/acr_lsfm.h249
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/acr/acr_objflcn.h91
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/acr/acr_objlsfm.h85
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/acr/nvgpu_acr.h105
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/allocator.h331
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/as.h45
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/atomic.h128
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/barrier.h50
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/bios.h1055
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/bitops.h32
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/bsearch.h29
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/bug.h31
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/bus.h38
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/circ_buf.h29
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/clk_arb.h82
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/comptags.h97
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/cond.h104
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/ctxsw_trace.h53
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/debug.h59
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/dma.h337
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/enabled.h164
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/errno.h41
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/falcon.h248
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/firmware.h72
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/flcnif_cmn.h140
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/fuse.h36
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/gmmu.h347
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hashtable.h29
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_bus_gk20a.h171
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_ccsr_gk20a.h163
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_ce2_gk20a.h87
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_ctxsw_prog_gk20a.h447
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_falcon_gk20a.h555
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_fb_gk20a.h263
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_fifo_gk20a.h619
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_flush_gk20a.h187
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_gmmu_gk20a.h1199
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_gr_gk20a.h3771
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_ltc_gk20a.h455
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_mc_gk20a.h291
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_pbdma_gk20a.h567
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_perf_gk20a.h211
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_pram_gk20a.h63
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_pri_ringmaster_gk20a.h159
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_pri_ringstation_fbp_gk20a.h231
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_pri_ringstation_gpc_gk20a.h79
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_pri_ringstation_sys_gk20a.h91
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_proj_gk20a.h163
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_pwr_gk20a.h783
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_ram_gk20a.h443
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_sim_gk20a.h2153
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_therm_gk20a.h367
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_timer_gk20a.h127
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_top_gk20a.h211
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_trim_gk20a.h315
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_bus_gm20b.h223
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_ccsr_gm20b.h163
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_ce2_gm20b.h87
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_ctxsw_prog_gm20b.h471
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_falcon_gm20b.h595
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_fb_gm20b.h351
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_fifo_gm20b.h571
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_flush_gm20b.h187
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_fuse_gm20b.h143
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_gmmu_gm20b.h1207
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_gr_gm20b.h3891
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_ltc_gm20b.h527
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_mc_gm20b.h287
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_pbdma_gm20b.h571
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_perf_gm20b.h211
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_pram_gm20b.h63
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_pri_ringmaster_gm20b.h167
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_pri_ringstation_gpc_gm20b.h79
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_pri_ringstation_sys_gm20b.h91
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_proj_gm20b.h167
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_pwr_gm20b.h827
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_ram_gm20b.h459
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_therm_gm20b.h355
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_timer_gm20b.h115
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_top_gm20b.h235
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_trim_gm20b.h503
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_bus_gp106.h223
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_ccsr_gp106.h163
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_ce_gp106.h87
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_ctxsw_prog_gp106.h295
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_falcon_gp106.h599
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_fb_gp106.h603
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_fbpa_gp106.h67
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_fifo_gp106.h695
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_flush_gp106.h187
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_fuse_gp106.h271
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_gc6_gp106.h62
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_gmmu_gp106.h1275
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_gr_gp106.h4111
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_ltc_gp106.h559
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_mc_gp106.h251
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_pbdma_gp106.h527
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_perf_gp106.h211
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_pram_gp106.h63
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_pri_ringmaster_gp106.h151
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_pri_ringstation_gpc_gp106.h79
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_pri_ringstation_sys_gp106.h91
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_proj_gp106.h175
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_psec_gp106.h615
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_pwr_gp106.h847
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_ram_gp106.h487
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_therm_gp106.h183
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_timer_gp106.h115
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_top_gp106.h255
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_trim_gp106.h195
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_xp_gp106.h143
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_xve_gp106.h207
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_bus_gp10b.h223
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_ccsr_gp10b.h163
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_ce_gp10b.h87
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_ctxsw_prog_gp10b.h487
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_falcon_gp10b.h599
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_fb_gp10b.h487
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_fifo_gp10b.h699
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_flush_gp10b.h187
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_fuse_gp10b.h151
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_gmmu_gp10b.h1283
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_gr_gp10b.h4363
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_ltc_gp10b.h587
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_mc_gp10b.h251
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_pbdma_gp10b.h607
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_perf_gp10b.h211
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_pram_gp10b.h63
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_pri_ringmaster_gp10b.h167
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_pri_ringstation_gpc_gp10b.h79
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_pri_ringstation_sys_gp10b.h91
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_proj_gp10b.h175
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_pwr_gp10b.h831
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_ram_gp10b.h499
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_therm_gp10b.h415
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_timer_gp10b.h115
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_top_gp10b.h231
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/io.h49
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/kmem.h288
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/kref.h86
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/linux/atomic.h149
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/linux/barrier.h35
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/linux/cond.h80
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/linux/dma.h38
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/linux/kmem.h50
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/linux/lock.h81
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/linux/nvgpu_mem.h89
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/linux/rwsem.h26
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/linux/thread.h29
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/linux/vidmem.h77
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/linux/vm.h88
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/list.h103
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/lock.h73
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/log.h183
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/log2.h29
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/ltc.h34
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/mm.h222
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/nvgpu_common.h34
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/nvgpu_mem.h331
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/nvhost.h81
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/page_allocator.h185
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/pmu.h465
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuif_acr.h113
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuif_ap.h256
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuif_cmn.h130
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuif_perfmon.h187
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuif_pg.h336
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuif_pg_rppg.h110
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuif_pmu.h236
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuifbios.h50
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuifboardobj.h204
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuifclk.h464
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuifperf.h126
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuifperfvfe.h229
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuifpmgr.h443
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuifseq.h82
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuiftherm.h102
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuifthermsensor.h83
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuifvolt.h335
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/pmuif/nvgpu_gpmu_cmdif.h99
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/pramin.h45
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/rbtree.h130
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/rwsem.h46
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/semaphore.h340
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/soc.h33
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/sort.h29
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/thread.h79
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/timers.h113
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/types.h31
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/unit.h36
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/vgpu/vm.h31
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/vidmem.h151
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/vm.h299
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/vm_area.h69
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/xve.h67
196 files changed, 65800 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/include/nvgpu/acr/acr_flcnbl.h b/drivers/gpu/nvgpu/include/nvgpu/acr/acr_flcnbl.h
new file mode 100644
index 00000000..52dc3f24
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/acr/acr_flcnbl.h
@@ -0,0 +1,144 @@
1/*
2 * Copyright (c) 2017, 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#ifndef __ACR_FLCNBL_H__
23#define __ACR_FLCNBL_H__
24
25#include <nvgpu/flcnif_cmn.h>
26
27#ifndef __NVGPU_ACR_H__
28#warning "acr_flcnbl.h not included from nvgpu_acr.h!" \
29 "Include nvgpu_acr.h instead of acr_xxx.h to get access to ACR interfaces"
30#endif
31
32/*
33 * Structure used by the boot-loader to load the rest of the code. This has
34 * to be filled by NVGPU and copied into DMEM at offset provided in the
35 * hsflcn_bl_desc.bl_desc_dmem_load_off.
36 */
37struct flcn_bl_dmem_desc {
38 u32 reserved[4]; /*Should be the first element..*/
39 u32 signature[4]; /*Should be the first element..*/
40 u32 ctx_dma;
41 u32 code_dma_base;
42 u32 non_sec_code_off;
43 u32 non_sec_code_size;
44 u32 sec_code_off;
45 u32 sec_code_size;
46 u32 code_entry_point;
47 u32 data_dma_base;
48 u32 data_size;
49 u32 code_dma_base1;
50 u32 data_dma_base1;
51};
52
53struct flcn_bl_dmem_desc_v1 {
54 u32 reserved[4]; /*Should be the first element..*/
55 u32 signature[4]; /*Should be the first element..*/
56 u32 ctx_dma;
57 struct falc_u64 code_dma_base;
58 u32 non_sec_code_off;
59 u32 non_sec_code_size;
60 u32 sec_code_off;
61 u32 sec_code_size;
62 u32 code_entry_point;
63 struct falc_u64 data_dma_base;
64 u32 data_size;
65 u32 argc;
66 u32 argv;
67};
68
69/*
70 * The header used by NVGPU to figure out code and data sections of bootloader
71 *
72 * bl_code_off - Offset of code section in the image
73 * bl_code_size - Size of code section in the image
74 * bl_data_off - Offset of data section in the image
75 * bl_data_size - Size of data section in the image
76 */
77struct flcn_bl_img_hdr {
78 u32 bl_code_off;
79 u32 bl_code_size;
80 u32 bl_data_off;
81 u32 bl_data_size;
82};
83
84/*
85 * The descriptor used by NVGPU to figure out the requirements of bootloader
86 *
87 * bl_start_tag - Starting tag of bootloader
88 * bl_desc_dmem_load_off - Dmem offset where _def_rm_flcn_bl_dmem_desc
89 * to be loaded
90 * bl_img_hdr - Description of the image
91 */
92struct hsflcn_bl_desc {
93 u32 bl_start_tag;
94 u32 bl_desc_dmem_load_off;
95 struct flcn_bl_img_hdr bl_img_hdr;
96};
97
98/*
99 * Legacy structure used by the current PMU/DPU bootloader.
100 */
101struct loader_config {
102 u32 dma_idx;
103 u32 code_dma_base; /* upper 32-bits of 40-bit dma address */
104 u32 code_size_total;
105 u32 code_size_to_load;
106 u32 code_entry_point;
107 u32 data_dma_base; /* upper 32-bits of 40-bit dma address */
108 u32 data_size; /* initialized data of the application */
109 u32 overlay_dma_base; /* upper 32-bits of the 40-bit dma address */
110 u32 argc;
111 u32 argv;
112 u16 code_dma_base1; /* upper 7 bits of 47-bit dma address */
113 u16 data_dma_base1; /* upper 7 bits of 47-bit dma address */
114 u16 overlay_dma_base1; /* upper 7 bits of the 47-bit dma address */
115};
116
117struct loader_config_v1 {
118 u32 reserved;
119 u32 dma_idx;
120 struct falc_u64 code_dma_base;
121 u32 code_size_total;
122 u32 code_size_to_load;
123 u32 code_entry_point;
124 struct falc_u64 data_dma_base;
125 u32 data_size;
126 struct falc_u64 overlay_dma_base;
127 u32 argc;
128 u32 argv;
129};
130
131/*
132 * Union of all supported structures used by bootloaders.
133 */
134union flcn_bl_generic_desc {
135 struct flcn_bl_dmem_desc bl_dmem_desc;
136 struct loader_config loader_cfg;
137};
138
139union flcn_bl_generic_desc_v1 {
140 struct flcn_bl_dmem_desc_v1 bl_dmem_desc_v1;
141 struct loader_config_v1 loader_cfg_v1;
142};
143
144#endif /* __ACR_FLCNBL_H__ */
diff --git a/drivers/gpu/nvgpu/include/nvgpu/acr/acr_lsfm.h b/drivers/gpu/nvgpu/include/nvgpu/acr/acr_lsfm.h
new file mode 100644
index 00000000..70184934
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/acr/acr_lsfm.h
@@ -0,0 +1,249 @@
1/*
2 * Copyright (c) 2017, 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#ifndef __ACR_LSFM_H__
23#define __ACR_LSFM_H__
24
25#ifndef __NVGPU_ACR_H__
26#warning "acr_lsfm.h not included from nvgpu_acr.h!" \
27 "Include nvgpu_acr.h instead of acr_xxx.h to get access to ACR interfaces"
28#endif
29
30/*
31 * Falcon Id Defines
32 * Defines a common Light Secure Falcon identifier.
33 */
34#define LSF_FALCON_ID_PMU (0)
35#define LSF_FALCON_ID_RESERVED (1)
36#define LSF_FALCON_ID_FECS (2)
37#define LSF_FALCON_ID_GPCCS (3)
38#define LSF_FALCON_ID_SEC2 (7)
39#define LSF_FALCON_ID_END (11)
40#define LSF_FALCON_ID_INVALID (0xFFFFFFFF)
41
42/*
43 * Light Secure Falcon Ucode Description Defines
44 * This structure is prelim and may change as the ucode signing flow evolves.
45 */
46struct lsf_ucode_desc {
47 u8 prd_keys[2][16];
48 u8 dbg_keys[2][16];
49 u32 b_prd_present;
50 u32 b_dbg_present;
51 u32 falcon_id;
52};
53
54struct lsf_ucode_desc_v1 {
55 u8 prd_keys[2][16];
56 u8 dbg_keys[2][16];
57 u32 b_prd_present;
58 u32 b_dbg_present;
59 u32 falcon_id;
60 u32 bsupports_versioning;
61 u32 version;
62 u32 dep_map_count;
63 u8 dep_map[LSF_FALCON_ID_END * 2 * 4];
64 u8 kdf[16];
65};
66
67/*
68 * Light Secure WPR Header
69 * Defines state allowing Light Secure Falcon bootstrapping.
70 */
71struct lsf_wpr_header {
72 u32 falcon_id;
73 u32 lsb_offset;
74 u32 bootstrap_owner;
75 u32 lazy_bootstrap;
76 u32 status;
77};
78
79struct lsf_wpr_header_v1 {
80 u32 falcon_id;
81 u32 lsb_offset;
82 u32 bootstrap_owner;
83 u32 lazy_bootstrap;
84 u32 bin_version;
85 u32 status;
86};
87/*
88 * Bootstrap Owner Defines
89 */
90#define LSF_BOOTSTRAP_OWNER_DEFAULT (LSF_FALCON_ID_PMU)
91
92/*
93 * Image Status Defines
94 */
95#define LSF_IMAGE_STATUS_NONE (0)
96#define LSF_IMAGE_STATUS_COPY (1)
97#define LSF_IMAGE_STATUS_VALIDATION_CODE_FAILED (2)
98#define LSF_IMAGE_STATUS_VALIDATION_DATA_FAILED (3)
99#define LSF_IMAGE_STATUS_VALIDATION_DONE (4)
100#define LSF_IMAGE_STATUS_VALIDATION_SKIPPED (5)
101#define LSF_IMAGE_STATUS_BOOTSTRAP_READY (6)
102
103/*Light Secure Bootstrap header related defines*/
104#define NV_FLCN_ACR_LSF_FLAG_LOAD_CODE_AT_0_FALSE 0
105#define NV_FLCN_ACR_LSF_FLAG_LOAD_CODE_AT_0_TRUE 1
106#define NV_FLCN_ACR_LSF_FLAG_DMACTL_REQ_CTX_FALSE 0
107#define NV_FLCN_ACR_LSF_FLAG_DMACTL_REQ_CTX_TRUE 4
108#define NV_FLCN_ACR_LSF_FLAG_FORCE_PRIV_LOAD_TRUE 8
109#define NV_FLCN_ACR_LSF_FLAG_FORCE_PRIV_LOAD_FALSE 0
110
111/*
112 * Light Secure Bootstrap Header
113 * Defines state allowing Light Secure Falcon bootstrapping.
114 */
115struct lsf_lsb_header {
116 struct lsf_ucode_desc signature;
117 u32 ucode_off;
118 u32 ucode_size;
119 u32 data_size;
120 u32 bl_code_size;
121 u32 bl_imem_off;
122 u32 bl_data_off;
123 u32 bl_data_size;
124 u32 app_code_off;
125 u32 app_code_size;
126 u32 app_data_off;
127 u32 app_data_size;
128 u32 flags;
129};
130
131struct lsf_lsb_header_v1 {
132 struct lsf_ucode_desc_v1 signature;
133 u32 ucode_off;
134 u32 ucode_size;
135 u32 data_size;
136 u32 bl_code_size;
137 u32 bl_imem_off;
138 u32 bl_data_off;
139 u32 bl_data_size;
140 u32 app_code_off;
141 u32 app_code_size;
142 u32 app_data_off;
143 u32 app_data_size;
144 u32 flags;
145};
146
147/*
148 * Light Secure WPR Content Alignments
149 */
150#define LSF_LSB_HEADER_ALIGNMENT 256
151#define LSF_BL_DATA_ALIGNMENT 256
152#define LSF_BL_DATA_SIZE_ALIGNMENT 256
153#define LSF_BL_CODE_SIZE_ALIGNMENT 256
154
155#define LSF_UCODE_DATA_ALIGNMENT 4096
156
157/*
158 * Supporting maximum of 2 regions.
159 * This is needed to pre-allocate space in DMEM
160 */
161#define NVGPU_FLCN_ACR_MAX_REGIONS (2)
162#define LSF_BOOTSTRAP_OWNER_RESERVED_DMEM_SIZE (0x200)
163
164/*
165 * start_addr - Starting address of region
166 * end_addr - Ending address of region
167 * region_id - Region ID
168 * read_mask - Read Mask
169 * write_mask - WriteMask
170 * client_mask - Bit map of all clients currently using this region
171 */
172struct flcn_acr_region_prop {
173 u32 start_addr;
174 u32 end_addr;
175 u32 region_id;
176 u32 read_mask;
177 u32 write_mask;
178 u32 client_mask;
179};
180
181struct flcn_acr_region_prop_v1 {
182 u32 start_addr;
183 u32 end_addr;
184 u32 region_id;
185 u32 read_mask;
186 u32 write_mask;
187 u32 client_mask;
188 u32 shadowmMem_startaddress;
189};
190
191/*
192 * no_regions - Number of regions used.
193 * region_props - Region properties
194 */
195struct flcn_acr_regions {
196 u32 no_regions;
197 struct flcn_acr_region_prop region_props[NVGPU_FLCN_ACR_MAX_REGIONS];
198};
199
200struct flcn_acr_regions_v1 {
201 u32 no_regions;
202 struct flcn_acr_region_prop_v1 region_props[NVGPU_FLCN_ACR_MAX_REGIONS];
203};
204/*
205 * reserved_dmem-When the bootstrap owner has done bootstrapping other falcons,
206 * and need to switch into LS mode, it needs to have its own
207 * actual DMEM image copied into DMEM as part of LS setup. If
208 * ACR desc is at location 0, it will definitely get overwritten
209 * causing data corruption. Hence we are reserving 0x200 bytes
210 * to give room for any loading data. NOTE: This has to be the
211 * first member always
212 * signature - Signature of ACR ucode.
213 * wpr_region_id - Region ID holding the WPR header and its details
214 * wpr_offset - Offset from the WPR region holding the wpr header
215 * regions - Region descriptors
216 * nonwpr_ucode_blob_start -stores non-WPR start where kernel stores ucode blob
217 * nonwpr_ucode_blob_end -stores non-WPR end where kernel stores ucode blob
218 */
219struct flcn_acr_desc {
220 union {
221 u32 reserved_dmem[(LSF_BOOTSTRAP_OWNER_RESERVED_DMEM_SIZE/4)];
222 u32 signatures[4];
223 } ucode_reserved_space;
224 /*Always 1st*/
225 u32 wpr_region_id;
226 u32 wpr_offset;
227 u32 mmu_mem_range;
228 struct flcn_acr_regions regions;
229 u32 nonwpr_ucode_blob_size;
230 u64 nonwpr_ucode_blob_start;
231};
232
233struct flcn_acr_desc_v1 {
234 union {
235 u32 reserved_dmem[(LSF_BOOTSTRAP_OWNER_RESERVED_DMEM_SIZE/4)];
236 } ucode_reserved_space;
237 u32 signatures[4];
238 /*Always 1st*/
239 u32 wpr_region_id;
240 u32 wpr_offset;
241 u32 mmu_mem_range;
242 struct flcn_acr_regions_v1 regions;
243 u32 nonwpr_ucode_blob_size;
244 u64 nonwpr_ucode_blob_start;
245 u32 dummy[4]; /* ACR_BSI_VPR_DESC */
246};
247
248
249#endif /* __ACR_LSFM_H__ */
diff --git a/drivers/gpu/nvgpu/include/nvgpu/acr/acr_objflcn.h b/drivers/gpu/nvgpu/include/nvgpu/acr/acr_objflcn.h
new file mode 100644
index 00000000..951eb3c6
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/acr/acr_objflcn.h
@@ -0,0 +1,91 @@
1/*
2 * Copyright (c) 2017, 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#ifndef __ACR_OBJFLCN_H__
23#define __ACR_OBJFLCN_H__
24
25#ifndef __NVGPU_ACR_H__
26#warning "acr_objflcn.h not included from nvgpu_acr.h!" \
27 "Include nvgpu_acr.h instead of acr_xxx.h to get access to ACR interfaces"
28#endif
29
30struct flcn_ucode_img {
31 u32 *header; /* only some falcons have header */
32 u32 *data;
33 struct pmu_ucode_desc *desc; /* only some falcons have descriptor */
34 u32 data_size;
35 void *fw_ver; /* CTRL_GPU_GET_FIRMWARE_VERSION_PARAMS struct */
36 u8 load_entire_os_data; /* load the whole osData section at boot time.*/
37 /* NULL if not a light secure falcon.*/
38 struct lsf_ucode_desc *lsf_desc;
39 /* True if there a resources to freed by the client. */
40 u8 free_res_allocs;
41 u32 flcn_inst;
42};
43
44struct flcn_ucode_img_v1 {
45 u32 *header;
46 u32 *data;
47 struct pmu_ucode_desc_v1 *desc;
48 u32 data_size;
49 void *fw_ver;
50 u8 load_entire_os_data;
51 struct lsf_ucode_desc_v1 *lsf_desc;
52 u8 free_res_allocs;
53 u32 flcn_inst;
54};
55
56/*
57 * Falcon UCODE header index.
58 */
59#define FLCN_NL_UCODE_HDR_OS_CODE_OFF_IND (0)
60#define FLCN_NL_UCODE_HDR_OS_CODE_SIZE_IND (1)
61#define FLCN_NL_UCODE_HDR_OS_DATA_OFF_IND (2)
62#define FLCN_NL_UCODE_HDR_OS_DATA_SIZE_IND (3)
63#define FLCN_NL_UCODE_HDR_NUM_APPS_IND (4)
64
65/*
66 * There are total N number of Apps with code and offset defined in UCODE header
67 * This macro provides the CODE and DATA offset and size of Ath application.
68 */
69#define FLCN_NL_UCODE_HDR_APP_CODE_START_IND (5)
70#define FLCN_NL_UCODE_HDR_APP_CODE_OFF_IND(N, A) \
71 (FLCN_NL_UCODE_HDR_APP_CODE_START_IND + (A*2))
72#define FLCN_NL_UCODE_HDR_APP_CODE_SIZE_IND(N, A) \
73 (FLCN_NL_UCODE_HDR_APP_CODE_START_IND + (A*2) + 1)
74#define FLCN_NL_UCODE_HDR_APP_CODE_END_IND(N) \
75 (FLCN_NL_UCODE_HDR_APP_CODE_START_IND + (N*2) - 1)
76
77#define FLCN_NL_UCODE_HDR_APP_DATA_START_IND(N) \
78 (FLCN_NL_UCODE_HDR_APP_CODE_END_IND(N) + 1)
79#define FLCN_NL_UCODE_HDR_APP_DATA_OFF_IND(N, A) \
80 (FLCN_NL_UCODE_HDR_APP_DATA_START_IND(N) + (A*2))
81#define FLCN_NL_UCODE_HDR_APP_DATA_SIZE_IND(N, A) \
82 (FLCN_NL_UCODE_HDR_APP_DATA_START_IND(N) + (A*2) + 1)
83#define FLCN_NL_UCODE_HDR_APP_DATA_END_IND(N) \
84 (FLCN_NL_UCODE_HDR_APP_DATA_START_IND(N) + (N*2) - 1)
85
86#define FLCN_NL_UCODE_HDR_OS_OVL_OFF_IND(N) \
87 (FLCN_NL_UCODE_HDR_APP_DATA_END_IND(N) + 1)
88#define FLCN_NL_UCODE_HDR_OS_OVL_SIZE_IND(N) \
89 (FLCN_NL_UCODE_HDR_APP_DATA_END_IND(N) + 2)
90
91#endif /* __ACR_OBJFLCN_H__ */
diff --git a/drivers/gpu/nvgpu/include/nvgpu/acr/acr_objlsfm.h b/drivers/gpu/nvgpu/include/nvgpu/acr/acr_objlsfm.h
new file mode 100644
index 00000000..cde8707a
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/acr/acr_objlsfm.h
@@ -0,0 +1,85 @@
1/*
2 * Copyright (c) 2017, 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#ifndef __ACR_OBJLSFM_H__
23#define __ACR_OBJLSFM_H__
24
25#ifndef __NVGPU_ACR_H__
26#warning "acr_objlsfm.h not included from nvgpu_acr.h!" \
27 "Include nvgpu_acr.h instead of acr_xxx.h to get access to ACR interfaces"
28#endif
29
30#include "acr_flcnbl.h"
31#include "acr_objflcn.h"
32
33/*
34 * LSFM Managed Ucode Image
35 * next : Next image the list, NULL if last.
36 * wpr_header : WPR header for this ucode image
37 * lsb_header : LSB header for this ucode image
38 * bl_gen_desc : Bootloader generic desc structure for this ucode image
39 * bl_gen_desc_size : Sizeof bootloader desc structure for this ucode image
40 * full_ucode_size : Surface size required for final ucode image
41 * ucode_img : Ucode image info
42 */
43struct lsfm_managed_ucode_img {
44 struct lsfm_managed_ucode_img *next;
45 struct lsf_wpr_header wpr_header;
46 struct lsf_lsb_header lsb_header;
47 union flcn_bl_generic_desc bl_gen_desc;
48 u32 bl_gen_desc_size;
49 u32 full_ucode_size;
50 struct flcn_ucode_img ucode_img;
51};
52
53struct lsfm_managed_ucode_img_v2 {
54 struct lsfm_managed_ucode_img_v2 *next;
55 struct lsf_wpr_header_v1 wpr_header;
56 struct lsf_lsb_header_v1 lsb_header;
57 union flcn_bl_generic_desc_v1 bl_gen_desc;
58 u32 bl_gen_desc_size;
59 u32 full_ucode_size;
60 struct flcn_ucode_img_v1 ucode_img;
61};
62
63/*
64 * Defines the structure used to contain all generic information related to
65 * the LSFM.
66 * Contains the Light Secure Falcon Manager (LSFM) feature related data.
67 */
68struct ls_flcn_mgr {
69 u16 managed_flcn_cnt;
70 u32 wpr_size;
71 u32 disable_mask;
72 struct lsfm_managed_ucode_img *ucode_img_list;
73 void *wpr_client_req_state;/*PACR_CLIENT_REQUEST_STATE originally*/
74};
75
76struct ls_flcn_mgr_v1 {
77 u16 managed_flcn_cnt;
78 u32 wpr_size;
79 u32 disable_mask;
80 struct lsfm_managed_ucode_img_v2 *ucode_img_list;
81 void *wpr_client_req_state;/*PACR_CLIENT_REQUEST_STATE originally*/
82};
83
84
85#endif /* __ACR_OBJLSFM_H__ */
diff --git a/drivers/gpu/nvgpu/include/nvgpu/acr/nvgpu_acr.h b/drivers/gpu/nvgpu/include/nvgpu/acr/nvgpu_acr.h
new file mode 100644
index 00000000..a9ed6e68
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/acr/nvgpu_acr.h
@@ -0,0 +1,105 @@
1/*
2 * Copyright (c) 2016-2017, 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#ifndef __NVGPU_ACR_H__
24#define __NVGPU_ACR_H__
25
26#include "gk20a/mm_gk20a.h"
27
28#include "acr_lsfm.h"
29#include "acr_flcnbl.h"
30#include "acr_objlsfm.h"
31#include "acr_objflcn.h"
32
33struct nvgpu_firmware;
34
35#define MAX_SUPPORTED_LSFM 3 /*PMU, FECS, GPCCS*/
36
37#define ACR_COMPLETION_TIMEOUT_MS 10000 /*in msec */
38
39#define PMU_SECURE_MODE (0x1)
40#define PMU_LSFM_MANAGED (0x2)
41
42struct bin_hdr {
43 /* 0x10de */
44 u32 bin_magic;
45 /* versioning of bin format */
46 u32 bin_ver;
47 /* Entire image size including this header */
48 u32 bin_size;
49 /*
50 * Header offset of executable binary metadata,
51 * start @ offset- 0x100 *
52 */
53 u32 header_offset;
54 /*
55 * Start of executable binary data, start @
56 * offset- 0x200
57 */
58 u32 data_offset;
59 /* Size of executable binary */
60 u32 data_size;
61};
62
63struct acr_fw_header {
64 u32 sig_dbg_offset;
65 u32 sig_dbg_size;
66 u32 sig_prod_offset;
67 u32 sig_prod_size;
68 u32 patch_loc;
69 u32 patch_sig;
70 u32 hdr_offset; /* This header points to acr_ucode_header_t210_load */
71 u32 hdr_size; /* Size of above header */
72};
73
74struct wpr_carveout_info {
75 u64 wpr_base;
76 u64 nonwpr_base;
77 u64 size;
78};
79
80struct acr_desc {
81 struct nvgpu_mem ucode_blob;
82 struct nvgpu_mem wpr_dummy;
83 struct bin_hdr *bl_bin_hdr;
84 struct hsflcn_bl_desc *pmu_hsbl_desc;
85 struct bin_hdr *hsbin_hdr;
86 struct acr_fw_header *fw_hdr;
87 u32 pmu_args;
88 struct nvgpu_firmware *acr_fw;
89 union{
90 struct flcn_acr_desc *acr_dmem_desc;
91 struct flcn_acr_desc_v1 *acr_dmem_desc_v1;
92 };
93 struct nvgpu_mem acr_ucode;
94 struct nvgpu_firmware *hsbl_fw;
95 struct nvgpu_mem hsbl_ucode;
96 union {
97 struct flcn_bl_dmem_desc bl_dmem_desc;
98 struct flcn_bl_dmem_desc_v1 bl_dmem_desc_v1;
99 };
100 struct nvgpu_firmware *pmu_fw;
101 struct nvgpu_firmware *pmu_desc;
102 u32 capabilities;
103};
104
105#endif /*__NVGPU_ACR_H__*/
diff --git a/drivers/gpu/nvgpu/include/nvgpu/allocator.h b/drivers/gpu/nvgpu/include/nvgpu/allocator.h
new file mode 100644
index 00000000..1e7ab38f
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/allocator.h
@@ -0,0 +1,331 @@
1/*
2 * Copyright (c) 2011-2017, 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#ifndef __NVGPU_ALLOCATOR_H__
24#define __NVGPU_ALLOCATOR_H__
25
26#ifdef __KERNEL__
27/*
28 * The Linux kernel has this notion of seq_files for printing info to userspace.
29 * One of the allocator function pointers takes advantage of this and allows the
30 * debug output to be directed either to nvgpu_log() or a seq_file.
31 */
32#include <linux/seq_file.h>
33#endif
34
35#include <nvgpu/log.h>
36#include <nvgpu/lock.h>
37#include <nvgpu/list.h>
38#include <nvgpu/types.h>
39
40/* #define ALLOCATOR_DEBUG */
41
42struct nvgpu_allocator;
43struct nvgpu_alloc_carveout;
44struct vm_gk20a;
45struct gk20a;
46
47/*
48 * Operations for an allocator to implement.
49 */
50struct nvgpu_allocator_ops {
51 u64 (*alloc)(struct nvgpu_allocator *allocator, u64 len);
52 void (*free)(struct nvgpu_allocator *allocator, u64 addr);
53
54 /*
55 * Special interface to allocate a memory region with a specific
56 * starting address. Yikes. Note: if free() works for freeing both
57 * regular and fixed allocations then free_fixed() does not need to
58 * be implemented. This behavior exists for legacy reasons and should
59 * not be propagated to new allocators.
60 *
61 * For allocators where the @page_size field is not applicable it can
62 * be left as 0. Otherwise a valid page size should be passed (4k or
63 * what the large page size is).
64 */
65 u64 (*alloc_fixed)(struct nvgpu_allocator *allocator,
66 u64 base, u64 len, u32 page_size);
67 void (*free_fixed)(struct nvgpu_allocator *allocator,
68 u64 base, u64 len);
69
70 /*
71 * Allow allocators to reserve space for carveouts.
72 */
73 int (*reserve_carveout)(struct nvgpu_allocator *allocator,
74 struct nvgpu_alloc_carveout *co);
75 void (*release_carveout)(struct nvgpu_allocator *allocator,
76 struct nvgpu_alloc_carveout *co);
77
78 /*
79 * Returns info about the allocator.
80 */
81 u64 (*base)(struct nvgpu_allocator *allocator);
82 u64 (*length)(struct nvgpu_allocator *allocator);
83 u64 (*end)(struct nvgpu_allocator *allocator);
84 int (*inited)(struct nvgpu_allocator *allocator);
85 u64 (*space)(struct nvgpu_allocator *allocator);
86
87 /* Destructor. */
88 void (*fini)(struct nvgpu_allocator *allocator);
89
90#ifdef __KERNEL__
91 /* Debugging. */
92 void (*print_stats)(struct nvgpu_allocator *allocator,
93 struct seq_file *s, int lock);
94#endif
95};
96
97struct nvgpu_allocator {
98 struct gk20a *g;
99
100 char name[32];
101 struct nvgpu_mutex lock;
102
103 void *priv;
104 const struct nvgpu_allocator_ops *ops;
105
106 struct dentry *debugfs_entry;
107 bool debug; /* Control for debug msgs. */
108};
109
110struct nvgpu_alloc_carveout {
111 const char *name;
112 u64 base;
113 u64 length;
114
115 struct nvgpu_allocator *allocator;
116
117 /*
118 * For usage by the allocator implementation.
119 */
120 struct nvgpu_list_node co_entry;
121};
122
123static inline struct nvgpu_alloc_carveout *
124nvgpu_alloc_carveout_from_co_entry(struct nvgpu_list_node *node)
125{
126 return (struct nvgpu_alloc_carveout *)
127 ((uintptr_t)node - offsetof(struct nvgpu_alloc_carveout, co_entry));
128};
129
130#define NVGPU_CARVEOUT(__name, __base, __length) \
131 { \
132 .name = (__name), \
133 .base = (__base), \
134 .length = (__length) \
135 }
136
137/*
138 * These are the available allocator flags.
139 *
140 * GPU_ALLOC_GVA_SPACE
141 *
142 * This flag makes sense for the buddy allocator only. It specifies that the
143 * allocator will be used for managing a GVA space. When managing GVA spaces
144 * special care has to be taken to ensure that allocations of similar PTE
145 * sizes are placed in the same PDE block. This allows the higher level
146 * code to skip defining both small and large PTE tables for every PDE. That
147 * can save considerable memory for address spaces that have a lot of
148 * allocations.
149 *
150 * GPU_ALLOC_NO_ALLOC_PAGE
151 *
152 * For any allocator that needs to manage a resource in a latency critical
153 * path this flag specifies that the allocator should not use any kmalloc()
154 * or similar functions during normal operation. Initialization routines
155 * may still use kmalloc(). This prevents the possibility of long waits for
156 * pages when using alloc_page(). Currently only the bitmap allocator
157 * implements this functionality.
158 *
159 * Also note that if you accept this flag then you must also define the
160 * free_fixed() function. Since no meta-data is allocated to help free
161 * allocations you need to keep track of the meta-data yourself (in this
162 * case the base and length of the allocation as opposed to just the base
163 * of the allocation).
164 *
165 * GPU_ALLOC_4K_VIDMEM_PAGES
166 *
167 * We manage vidmem pages at a large page granularity for performance
168 * reasons; however, this can lead to wasting memory. For page allocators
169 * setting this flag will tell the allocator to manage pools of 4K pages
170 * inside internally allocated large pages.
171 *
172 * Currently this flag is ignored since the only usage of the page allocator
173 * uses a 4K block size already. However, this flag has been reserved since
174 * it will be necessary in the future.
175 *
176 * GPU_ALLOC_FORCE_CONTIG
177 *
178 * Force allocations to be contiguous. Currently only relevant for page
179 * allocators since all other allocators are naturally contiguous.
180 *
181 * GPU_ALLOC_NO_SCATTER_GATHER
182 *
183 * The page allocator normally returns a scatter gather data structure for
184 * allocations (to handle discontiguous pages). However, at times that can
185 * be annoying so this flag forces the page allocator to return a u64
186 * pointing to the allocation base (requires GPU_ALLOC_FORCE_CONTIG to be
187 * set as well).
188 */
189#define GPU_ALLOC_GVA_SPACE 0x1
190#define GPU_ALLOC_NO_ALLOC_PAGE 0x2
191#define GPU_ALLOC_4K_VIDMEM_PAGES 0x4
192#define GPU_ALLOC_FORCE_CONTIG 0x8
193#define GPU_ALLOC_NO_SCATTER_GATHER 0x10
194
195static inline void alloc_lock(struct nvgpu_allocator *a)
196{
197 nvgpu_mutex_acquire(&a->lock);
198}
199
200static inline void alloc_unlock(struct nvgpu_allocator *a)
201{
202 nvgpu_mutex_release(&a->lock);
203}
204
205/*
206 * Buddy allocator specific initializers.
207 */
208int __nvgpu_buddy_allocator_init(struct gk20a *g, struct nvgpu_allocator *a,
209 struct vm_gk20a *vm, const char *name,
210 u64 base, u64 size, u64 blk_size,
211 u64 max_order, u64 flags);
212int nvgpu_buddy_allocator_init(struct gk20a *g, struct nvgpu_allocator *a,
213 const char *name, u64 base, u64 size,
214 u64 blk_size, u64 flags);
215
216/*
217 * Bitmap initializers.
218 */
219int nvgpu_bitmap_allocator_init(struct gk20a *g, struct nvgpu_allocator *a,
220 const char *name, u64 base, u64 length,
221 u64 blk_size, u64 flags);
222
223/*
224 * Page allocator initializers.
225 */
226int nvgpu_page_allocator_init(struct gk20a *g, struct nvgpu_allocator *a,
227 const char *name, u64 base, u64 length,
228 u64 blk_size, u64 flags);
229
230/*
231 * Lockless allocatior initializers.
232 * Note: This allocator can only allocate fixed-size structures of a
233 * pre-defined size.
234 */
235int nvgpu_lockless_allocator_init(struct gk20a *g, struct nvgpu_allocator *a,
236 const char *name, u64 base, u64 length,
237 u64 struct_size, u64 flags);
238
239#define GPU_BALLOC_MAX_ORDER 31
240
241/*
242 * Allocator APIs.
243 */
244u64 nvgpu_alloc(struct nvgpu_allocator *allocator, u64 len);
245void nvgpu_free(struct nvgpu_allocator *allocator, u64 addr);
246
247u64 nvgpu_alloc_fixed(struct nvgpu_allocator *allocator, u64 base, u64 len,
248 u32 page_size);
249void nvgpu_free_fixed(struct nvgpu_allocator *allocator, u64 base, u64 len);
250
251int nvgpu_alloc_reserve_carveout(struct nvgpu_allocator *a,
252 struct nvgpu_alloc_carveout *co);
253void nvgpu_alloc_release_carveout(struct nvgpu_allocator *a,
254 struct nvgpu_alloc_carveout *co);
255
256u64 nvgpu_alloc_base(struct nvgpu_allocator *a);
257u64 nvgpu_alloc_length(struct nvgpu_allocator *a);
258u64 nvgpu_alloc_end(struct nvgpu_allocator *a);
259u64 nvgpu_alloc_initialized(struct nvgpu_allocator *a);
260u64 nvgpu_alloc_space(struct nvgpu_allocator *a);
261
262void nvgpu_alloc_destroy(struct nvgpu_allocator *allocator);
263
264#ifdef __KERNEL__
265void nvgpu_alloc_print_stats(struct nvgpu_allocator *a,
266 struct seq_file *s, int lock);
267#endif
268
269static inline struct gk20a *nvgpu_alloc_to_gpu(struct nvgpu_allocator *a)
270{
271 return a->g;
272}
273
274#ifdef CONFIG_DEBUG_FS
275/*
276 * Common functionality for the internals of the allocators.
277 */
278void nvgpu_init_alloc_debug(struct gk20a *g, struct nvgpu_allocator *a);
279void nvgpu_fini_alloc_debug(struct nvgpu_allocator *a);
280#endif
281
282int __nvgpu_alloc_common_init(struct nvgpu_allocator *a, struct gk20a *g,
283 const char *name, void *priv, bool dbg,
284 const struct nvgpu_allocator_ops *ops);
285
286static inline void nvgpu_alloc_enable_dbg(struct nvgpu_allocator *a)
287{
288 a->debug = true;
289}
290
291static inline void nvgpu_alloc_disable_dbg(struct nvgpu_allocator *a)
292{
293 a->debug = false;
294}
295
296/*
297 * Debug stuff.
298 */
299#ifdef __KERNEL__
300#define __alloc_pstat(seq, allocator, fmt, arg...) \
301 do { \
302 if (seq) \
303 seq_printf(seq, fmt, ##arg); \
304 else \
305 alloc_dbg(allocator, fmt, ##arg); \
306 } while (0)
307#endif
308
309#define __alloc_dbg(a, fmt, arg...) \
310 nvgpu_log((a)->g, gpu_dbg_alloc, "%25s " fmt, (a)->name, ##arg)
311
312/*
313 * This gives finer control over debugging messages. By defining the
314 * ALLOCATOR_DEBUG macro prints for an allocator will only get made if
315 * that allocator's debug flag is set.
316 *
317 * Otherwise debugging is as normal: debug statements for all allocators
318 * if the GPU debugging mask bit is set. Note: even when ALLOCATOR_DEBUG
319 * is set gpu_dbg_alloc must still also be set to true.
320 */
321#if defined(ALLOCATOR_DEBUG)
322#define alloc_dbg(a, fmt, arg...) \
323 do { \
324 if ((a)->debug) \
325 __alloc_dbg((a), fmt, ##arg); \
326 } while (0)
327#else
328#define alloc_dbg(a, fmt, arg...) __alloc_dbg(a, fmt, ##arg)
329#endif
330
331#endif /* NVGPU_ALLOCATOR_H */
diff --git a/drivers/gpu/nvgpu/include/nvgpu/as.h b/drivers/gpu/nvgpu/include/nvgpu/as.h
new file mode 100644
index 00000000..03799717
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/as.h
@@ -0,0 +1,45 @@
1/*
2 * GK20A Address Spaces
3 *
4 * Copyright (c) 2011-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#ifndef __NVGPU_AS_H__
25#define __NVGPU_AS_H__
26
27struct vm_gk20a;
28
29struct gk20a_as {
30 int last_share_id; /* dummy allocator for now */
31};
32
33struct gk20a_as_share {
34 struct gk20a_as *as;
35 struct vm_gk20a *vm;
36 int id;
37};
38
39int gk20a_as_release_share(struct gk20a_as_share *as_share);
40
41/* if big_page_size == 0, the default big page size is used */
42int gk20a_as_alloc_share(struct gk20a *g, u32 big_page_size,
43 u32 flags, struct gk20a_as_share **out);
44
45#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/atomic.h b/drivers/gpu/nvgpu/include/nvgpu/atomic.h
new file mode 100644
index 00000000..0f319f71
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/atomic.h
@@ -0,0 +1,128 @@
1/*
2 * Copyright (c) 2017, 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#ifndef __NVGPU_ATOMIC_H__
23#define __NVGPU_ATOMIC_H__
24
25#ifdef __KERNEL__
26#include <nvgpu/linux/atomic.h>
27#else
28#include <nvgpu_rmos/include/atomic.h>
29#endif
30
31#define NVGPU_ATOMIC_INIT(i) __nvgpu_atomic_init(i)
32#define NVGPU_ATOMIC64_INIT(i) __nvgpu_atomic64_init(i)
33
34static inline void nvgpu_atomic_set(nvgpu_atomic_t *v, int i)
35{
36 __nvgpu_atomic_set(v, i);
37}
38static inline int nvgpu_atomic_read(nvgpu_atomic_t *v)
39{
40 return __nvgpu_atomic_read(v);
41}
42static inline void nvgpu_atomic_inc(nvgpu_atomic_t *v)
43{
44 __nvgpu_atomic_inc(v);
45}
46static inline int nvgpu_atomic_inc_return(nvgpu_atomic_t *v)
47{
48 return __nvgpu_atomic_inc_return(v);
49}
50static inline void nvgpu_atomic_dec(nvgpu_atomic_t *v)
51{
52 __nvgpu_atomic_dec(v);
53}
54static inline int nvgpu_atomic_dec_return(nvgpu_atomic_t *v)
55{
56 return __nvgpu_atomic_dec_return(v);
57}
58static inline int nvgpu_atomic_cmpxchg(nvgpu_atomic_t *v, int old, int new)
59{
60 return __nvgpu_atomic_cmpxchg(v, old, new);
61}
62static inline int nvgpu_atomic_xchg(nvgpu_atomic_t *v, int new)
63{
64 return __nvgpu_atomic_xchg(v, new);
65}
66static inline bool nvgpu_atomic_inc_and_test(nvgpu_atomic_t *v)
67{
68 return __nvgpu_atomic_inc_and_test(v);
69}
70static inline bool nvgpu_atomic_dec_and_test(nvgpu_atomic_t *v)
71{
72 return __nvgpu_atomic_dec_and_test(v);
73}
74static inline bool nvgpu_atomic_sub_and_test(int i, nvgpu_atomic_t *v)
75{
76 return __nvgpu_atomic_sub_and_test(i, v);
77}
78static inline int nvgpu_atomic_add_return(int i, nvgpu_atomic_t *v)
79{
80 return __nvgpu_atomic_add_return(i, v);
81}
82static inline int nvgpu_atomic_add_unless(nvgpu_atomic_t *v, int a, int u)
83{
84 return __nvgpu_atomic_add_unless(v, a, u);
85}
86static inline void nvgpu_atomic64_set(nvgpu_atomic64_t *v, long i)
87{
88 return __nvgpu_atomic64_set(v, i);
89}
90static inline long nvgpu_atomic64_read(nvgpu_atomic64_t *v)
91{
92 return __nvgpu_atomic64_read(v);
93}
94static inline void nvgpu_atomic64_add(long x, nvgpu_atomic64_t *v)
95{
96 __nvgpu_atomic64_add(x, v);
97}
98static inline void nvgpu_atomic64_inc(nvgpu_atomic64_t *v)
99{
100 __nvgpu_atomic64_inc(v);
101}
102static inline long nvgpu_atomic64_inc_return(nvgpu_atomic64_t *v)
103{
104 return __nvgpu_atomic64_inc_return(v);
105}
106static inline void nvgpu_atomic64_dec(nvgpu_atomic64_t *v)
107{
108 __nvgpu_atomic64_dec(v);
109}
110static inline void nvgpu_atomic64_dec_return(nvgpu_atomic64_t *v)
111{
112 __nvgpu_atomic64_dec_return(v);
113}
114static inline long nvgpu_atomic64_cmpxchg(nvgpu_atomic64_t *v, long old,
115 long new)
116{
117 return __nvgpu_atomic64_cmpxchg(v, old, new);
118}
119static inline void nvgpu_atomic64_sub(long x, nvgpu_atomic64_t *v)
120{
121 __nvgpu_atomic64_sub(x, v);
122}
123static inline long nvgpu_atomic64_sub_return(long x, nvgpu_atomic64_t *v)
124{
125 return __nvgpu_atomic64_sub_return(x, v);
126}
127
128#endif /* __NVGPU_ATOMIC_H__ */
diff --git a/drivers/gpu/nvgpu/include/nvgpu/barrier.h b/drivers/gpu/nvgpu/include/nvgpu/barrier.h
new file mode 100644
index 00000000..01bd3023
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/barrier.h
@@ -0,0 +1,50 @@
1/*
2 * Copyright (c) 2017, 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/* This file contains NVGPU_* high-level abstractions for various
24 * memor-barrier operations available in linux/kernel. Every OS
25 * should provide their own OS specific calls under this common API
26 */
27
28#ifndef __NVGPU_BARRIER_H__
29#define __NVGPU_BARRIER_H__
30
31#ifdef __KERNEL__
32#include <nvgpu/linux/barrier.h>
33#else
34#include <nvgpu_rmos/include/barrier.h>
35#endif
36
37#define nvgpu_mb() __nvgpu_mb()
38#define nvgpu_rmb() __nvgpu_rmb()
39#define nvgpu_wmb() __nvgpu_wmb()
40
41#define nvgpu_smp_mb() __nvgpu_smp_mb()
42#define nvgpu_smp_rmb() __nvgpu_smp_rmb()
43#define nvgpu_smp_wmb() __nvgpu_smp_wmb()
44
45#define nvgpu_read_barrier_depends() __nvgpu_read_barrier_depends()
46#define nvgpu_smp_read_barrier_depends() __nvgpu_smp_read_barrier_depends()
47
48#define NV_ACCESS_ONCE(x) __NV_ACCESS_ONCE(x)
49
50#endif /* __NVGPU_BARRIER_H__ */
diff --git a/drivers/gpu/nvgpu/include/nvgpu/bios.h b/drivers/gpu/nvgpu/include/nvgpu/bios.h
new file mode 100644
index 00000000..a4823caa
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/bios.h
@@ -0,0 +1,1055 @@
1/*
2 * Copyright (c) 2014-2017, 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#ifndef NVGPU_BIOS_H
24#define NVGPU_BIOS_H
25
26#include <nvgpu/types.h>
27
28struct gk20a;
29
30#define PERF_PTRS_WIDTH 0x4
31#define PERF_PTRS_WIDTH_16 0x2
32
33enum {
34 CLOCKS_TABLE = 2,
35 CLOCK_PROGRAMMING_TABLE,
36 FLL_TABLE,
37 VIN_TABLE,
38 FREQUENCY_CONTROLLER_TABLE
39};
40
41enum {
42 PERFORMANCE_TABLE = 0,
43 MEMORY_CLOCK_TABLE,
44 MEMORY_TWEAK_TABLE,
45 POWER_CONTROL_TABLE,
46 THERMAL_CONTROL_TABLE,
47 THERMAL_DEVICE_TABLE,
48 THERMAL_COOLERS_TABLE,
49 PERFORMANCE_SETTINGS_SCRIPT,
50 CONTINUOUS_VIRTUAL_BINNING_TABLE,
51 POWER_SENSORS_TABLE = 0xA,
52 POWER_CAPPING_TABLE = 0xB,
53 POWER_TOPOLOGY_TABLE = 0xF,
54 THERMAL_CHANNEL_TABLE = 0x12,
55 VOLTAGE_RAIL_TABLE = 26,
56 VOLTAGE_DEVICE_TABLE,
57 VOLTAGE_POLICY_TABLE,
58 LOWPOWER_TABLE,
59 LOWPOWER_GR_TABLE = 32,
60 LOWPOWER_MS_TABLE = 33,
61};
62
63enum {
64 VP_FIELD_TABLE = 0,
65 VP_FIELD_REGISTER,
66 VP_TRANSLATION_TABLE,
67};
68
69struct bit_token {
70 u8 token_id;
71 u8 data_version;
72 u16 data_size;
73 u16 data_ptr;
74} __packed;
75
76#define BIOS_GET_FIELD(value, name) ((value & name##_MASK) >> name##_SHIFT)
77
78struct fll_descriptor_header {
79 u8 version;
80 u8 size;
81} __packed;
82
83#define FLL_DESCRIPTOR_HEADER_10_SIZE_4 4
84#define FLL_DESCRIPTOR_HEADER_10_SIZE_6 6
85
86struct fll_descriptor_header_10 {
87 u8 version;
88 u8 header_size;
89 u8 entry_size;
90 u8 entry_count;
91 u16 max_min_freq_mhz;
92} __packed;
93
94#define FLL_DESCRIPTOR_ENTRY_10_SIZE 15
95
96struct fll_descriptor_entry_10 {
97 u8 fll_device_type;
98 u8 clk_domain;
99 u8 fll_device_id;
100 u16 lut_params;
101 u8 vin_idx_logic;
102 u8 vin_idx_sram;
103 u16 fll_params;
104 u8 min_freq_vfe_idx;
105 u8 freq_ctrl_idx;
106 u16 ref_freq_mhz;
107 u16 ffr_cutoff_freq_mhz;
108} __packed;
109
110#define NV_FLL_DESC_FLL_PARAMS_MDIV_MASK 0x1F
111#define NV_FLL_DESC_FLL_PARAMS_MDIV_SHIFT 0
112
113#define NV_FLL_DESC_LUT_PARAMS_VSELECT_MASK 0x3
114#define NV_FLL_DESC_LUT_PARAMS_VSELECT_SHIFT 0
115
116#define NV_FLL_DESC_LUT_PARAMS_HYSTERISIS_THRESHOLD_MASK 0x3C
117#define NV_FLL_DESC_LUT_PARAMS_HYSTERISIS_THRESHOLD_SHIFT 2
118
119struct vin_descriptor_header_10 {
120 u8 version;
121 u8 header_sizee;
122 u8 entry_size;
123 u8 entry_count;
124 u8 flags0;
125 u32 vin_cal;
126} __packed;
127
128struct vin_descriptor_entry_10 {
129 u8 vin_device_type;
130 u8 volt_domain_vbios;
131 u8 vin_device_id;
132} __packed;
133
134#define NV_VIN_DESC_FLAGS0_VIN_CAL_REVISION_MASK 0x7
135#define NV_VIN_DESC_FLAGS0_VIN_CAL_REVISION_SHIFT 0
136
137#define NV_VIN_DESC_FLAGS0_DISABLE_CONTROL_MASK 0x8
138#define NV_VIN_DESC_FLAGS0_DISABLE_CONTROL_SHIFT 3
139
140#define NV_VIN_DESC_VIN_CAL_SLOPE_FRACTION_MASK 0x1FF
141#define NV_VIN_DESC_VIN_CAL_SLOPE_FRACTION_SHIFT 0
142
143#define NV_VIN_DESC_VIN_CAL_SLOPE_INTEGER_MASK 0x3C00
144#define NV_VIN_DESC_VIN_CAL_SLOPE_INTEGER_SHIFT 10
145
146#define NV_VIN_DESC_VIN_CAL_INTERCEPT_FRACTION_MASK 0x3C000
147#define NV_VIN_DESC_VIN_CAL_INTERCEPT_FRACTION_SHIFT 14
148
149#define NV_VIN_DESC_VIN_CAL_INTERCEPT_INTEGER_MASK 0xFFC0000
150#define NV_VIN_DESC_VIN_CAL_INTERCEPT_INTEGER_SHIFT 18
151
152#define VBIOS_CLOCKS_TABLE_1X_HEADER_SIZE_07 0x07
153struct vbios_clocks_table_1x_header {
154 u8 version;
155 u8 header_size;
156 u8 entry_size;
157 u8 entry_count;
158 u8 clocks_hal;
159 u16 cntr_sampling_periodms;
160} __packed;
161
162#define VBIOS_CLOCKS_TABLE_1X_ENTRY_SIZE_09 0x09
163struct vbios_clocks_table_1x_entry {
164 u8 flags0;
165 u16 param0;
166 u32 param1;
167 u16 param2;
168} __packed;
169
170#define NV_VBIOS_CLOCKS_TABLE_1X_ENTRY_FLAGS0_USAGE_MASK 0x1F
171#define NV_VBIOS_CLOCKS_TABLE_1X_ENTRY_FLAGS0_USAGE_SHIFT 0
172#define NV_VBIOS_CLOCKS_TABLE_1X_ENTRY_FLAGS0_USAGE_FIXED 0x00
173#define NV_VBIOS_CLOCKS_TABLE_1X_ENTRY_FLAGS0_USAGE_MASTER 0x01
174#define NV_VBIOS_CLOCKS_TABLE_1X_ENTRY_FLAGS0_USAGE_SLAVE 0x02
175
176#define NV_VBIOS_CLOCKS_TABLE_1X_ENTRY_PARAM0_PROG_CLK_PROG_IDX_FIRST_MASK 0xFF
177#define NV_VBIOS_CLOCKS_TABLE_1X_ENTRY_PARAM0_PROG_CLK_PROG_IDX_FIRST_SHIFT 0
178#define NV_VBIOS_CLOCKS_TABLE_1X_ENTRY_PARAM0_PROG_CLK_PROG_IDX_LAST_MASK 0xFF00
179#define NV_VBIOS_CLOCKS_TABLE_1X_ENTRY_PARAM0_PROG_CLK_PROG_IDX_LAST_SHIFT 0x08
180
181#define NV_VBIOS_CLOCKS_TABLE_1X_ENTRY_PARAM1_FIXED_FREQUENCY_MHZ_MASK 0xFFFF
182#define NV_VBIOS_CLOCKS_TABLE_1X_ENTRY_PARAM1_FIXED_FREQUENCY_MHZ_SHIFT 0
183#define NV_VBIOS_CLOCKS_TABLE_1X_ENTRY_PARAM1_MASTER_FREQ_OC_DELTA_MIN_MHZ_MASK 0xFFFF
184#define NV_VBIOS_CLOCKS_TABLE_1X_ENTRY_PARAM1_MASTER_FREQ_OC_DELTA_MIN_MHZ_SHIFT 0
185
186#define NV_VBIOS_CLOCKS_TABLE_1X_ENTRY_PARAM1_MASTER_FREQ_OC_DELTA_MAX_MHZ_MASK 0xFFFF0000
187#define NV_VBIOS_CLOCKS_TABLE_1X_ENTRY_PARAM1_MASTER_FREQ_OC_DELTA_MAX_MHZ_SHIFT 0
188
189#define NV_VBIOS_CLOCKS_TABLE_1X_ENTRY_PARAM1_SLAVE_MASTER_DOMAIN_MASK 0xF
190#define NV_VBIOS_CLOCKS_TABLE_1X_ENTRY_PARAM1_SLAVE_MASTER_DOMAIN_SHIFT 0
191
192#define NV_VBIOS_CLOCKS_TABLE_1X_ENTRY_PARAM2_PROG_NOISE_UNAWARE_ORDERING_IDX_MASK 0xF
193#define NV_VBIOS_CLOCKS_TABLE_1X_ENTRY_PARAM2_PROG_NOISE_UNAWARE_ORDERING_IDX_SHIFT 0
194
195#define NV_VBIOS_CLOCKS_TABLE_1X_ENTRY_PARAM2_PROG_NOISE_AWARE_ORDERING_IDX_MASK 0xF0
196#define NV_VBIOS_CLOCKS_TABLE_1X_ENTRY_PARAM2_PROG_NOISE_AWARE_ORDERING_IDX_SHIFT 4
197
198#define NV_VBIOS_CLOCKS_TABLE_1X_ENTRY_PARAM2_PROG_FORCE_NOISE_UNAWARE_ORDERING_MASK 0x100
199#define NV_VBIOS_CLOCKS_TABLE_1X_ENTRY_PARAM2_PROG_FORCE_NOISE_UNAWARE_ORDERING_SHIFT 8
200#define NV_VBIOS_CLOCKS_TABLE_1X_ENTRY_PARAM2_PROG_FORCE_NOISE_UNAWARE_ORDERING_FALSE 0x00
201#define NV_VBIOS_CLOCKS_TABLE_1X_ENTRY_PARAM2_PROG_FORCE_NOISE_UNAWARE_ORDERING_TRUE 0x01
202
203#define VBIOS_CLOCK_PROGRAMMING_TABLE_1X_HEADER_SIZE_08 0x08
204struct vbios_clock_programming_table_1x_header {
205 u8 version;
206 u8 header_size;
207 u8 entry_size;
208 u8 entry_count;
209 u8 slave_entry_size;
210 u8 slave_entry_count;
211 u8 vf_entry_size;
212 u8 vf_entry_count;
213} __packed;
214
215#define VBIOS_CLOCK_PROGRAMMING_TABLE_1X_ENTRY_SIZE_05 0x05
216#define VBIOS_CLOCK_PROGRAMMING_TABLE_1X_ENTRY_SIZE_0D 0x0D
217struct vbios_clock_programming_table_1x_entry {
218 u8 flags0;
219 u16 freq_max_mhz;
220 u8 param0;
221 u8 param1;
222 u32 rsvd;
223 u32 rsvd1;
224} __packed;
225
226#define NV_VBIOS_CLOCK_PROGRAMMING_TABLE_1X_ENTRY_FLAGS0_TYPE_MASK 0xF
227#define NV_VBIOS_CLOCK_PROGRAMMING_TABLE_1X_ENTRY_FLAGS0_TYPE_SHIFT 0
228#define NV_VBIOS_CLOCK_PROGRAMMING_TABLE_1X_ENTRY_FLAGS0_TYPE_MASTER_RATIO 0x00
229#define NV_VBIOS_CLOCK_PROGRAMMING_TABLE_1X_ENTRY_FLAGS0_TYPE_MASTER_TABLE 0x01
230#define NV_VBIOS_CLOCK_PROGRAMMING_TABLE_1X_ENTRY_FLAGS0_TYPE_SLAVE 0x02
231
232#define NV_VBIOS_CLOCK_PROGRAMMING_TABLE_1X_ENTRY_FLAGS0_SOURCE_MASK 0x70
233#define NV_VBIOS_CLOCK_PROGRAMMING_TABLE_1X_ENTRY_FLAGS0_SOURCE_SHIFT 4
234#define NV_VBIOS_CLOCK_PROGRAMMING_TABLE_1X_ENTRY_FLAGS0_SOURCE_PLL 0x00
235#define NV_VBIOS_CLOCK_PROGRAMMING_TABLE_1X_ENTRY_FLAGS0_SOURCE_ONE_SOURCE 0x01
236#define NV_VBIOS_CLOCK_PROGRAMMING_TABLE_1X_ENTRY_FLAGS0_SOURCE_FLL 0x02
237
238#define NV_VBIOS_CLOCK_PROGRAMMING_TABLE_1X_ENTRY_FLAGS0_OVOC_ENABLED_MASK 0x80
239#define NV_VBIOS_CLOCK_PROGRAMMING_TABLE_1X_ENTRY_FLAGS0_OVOC_ENABLED_SHIFT 7
240#define NV_VBIOS_CLOCK_PROGRAMMING_TABLE_1X_ENTRY_FLAGS0_OVOC_ENABLED_FALSE 0x00
241#define NV_VBIOS_CLOCK_PROGRAMMING_TABLE_1X_ENTRY_FLAGS0_OVOC_ENABLED_TRUE 0x01
242
243#define NV_VBIOS_CLOCK_PROGRAMMING_TABLE_1X_ENTRY_PARAM0_PLL_PLL_INDEX_MASK 0xFF
244#define NV_VBIOS_CLOCK_PROGRAMMING_TABLE_1X_ENTRY_PARAM0_PLL_PLL_INDEX_SHIFT 0
245
246#define NV_VBIOS_CLOCK_PROGRAMMING_TABLE_1X_ENTRY_PARAM1_PLL_FREQ_STEP_SIZE_MASK 0xFF
247#define NV_VBIOS_CLOCK_PROGRAMMING_TABLE_1X_ENTRY_PARAM1_PLL_FREQ_STEP_SIZE_SHIFT 0
248
249#define VBIOS_CLOCK_PROGRAMMING_TABLE_1X_SLAVE_ENTRY_SIZE_03 0x03
250struct vbios_clock_programming_table_1x_slave_entry {
251 u8 clk_dom_idx;
252 u16 param0;
253} __packed;
254
255#define NV_VBIOS_CLOCK_PROGRAMMING_TABLE_1X_SLAVE_ENTRY_PARAM0_MASTER_RATIO_RATIO_MASK 0xFF
256#define NV_VBIOS_CLOCK_PROGRAMMING_TABLE_1X_SLAVE_ENTRY_PARAM0_MASTER_RATIO_RATIO_SHIFT 0
257
258#define NV_VBIOS_CLOCK_PROGRAMMING_TABLE_1X_SLAVE_ENTRY_PARAM0_MASTER_TABLE_FREQ_MASK 0x3FFF
259#define NV_VBIOS_CLOCK_PROGRAMMING_TABLE_1X_SLAVE_ENTRY_PARAM0_MASTER_TABLE_FREQ_SHIFT 0
260
261#define VBIOS_CLOCK_PROGRAMMING_TABLE_1X_VF_ENTRY_SIZE_02 0x02
262struct vbios_clock_programming_table_1x_vf_entry {
263 u8 vfe_idx;
264 u8 param0;
265} __packed;
266
267#define NV_VBIOS_CLOCK_PROGRAMMING_TABLE_1X_VF_ENTRY_PARAM0_FLL_GAIN_VFE_IDX_MASK 0xFF
268#define NV_VBIOS_CLOCK_PROGRAMMING_TABLE_1X_VF_ENTRY_PARAM0_FLL_GAIN_VFE_IDX_SHIFT 0
269
270struct vbios_vfe_3x_header_struct {
271 u8 version;
272 u8 header_size;
273 u8 vfe_var_entry_size;
274 u8 vfe_var_entry_count;
275 u8 vfe_equ_entry_size;
276 u8 vfe_equ_entry_count;
277 u8 polling_periodms;
278} __packed;
279
280#define VBIOS_VFE_3X_VAR_ENTRY_SIZE_11 0x11
281#define VBIOS_VFE_3X_VAR_ENTRY_SIZE_19 0x19
282struct vbios_vfe_3x_var_entry_struct {
283 u8 type;
284 u32 out_range_min;
285 u32 out_range_max;
286 u32 param0;
287 u32 param1;
288 u32 param2;
289 u32 param3;
290} __packed;
291
292#define VBIOS_VFE_3X_VAR_ENTRY_TYPE_DISABLED 0x00
293#define VBIOS_VFE_3X_VAR_ENTRY_TYPE_SINGLE_FREQUENCY 0x01
294#define VBIOS_VFE_3X_VAR_ENTRY_TYPE_SINGLE_VOLTAGE 0x02
295#define VBIOS_VFE_3X_VAR_ENTRY_TYPE_SINGLE_SENSED_TEMP 0x03
296#define VBIOS_VFE_3X_VAR_ENTRY_TYPE_SINGLE_SENSED_FUSE 0x04
297#define VBIOS_VFE_3X_VAR_ENTRY_TYPE_DERIVED_PRODUCT 0x05
298#define VBIOS_VFE_3X_VAR_ENTRY_TYPE_DERIVED_SUM 0x06
299
300#define VBIOS_VFE_3X_VAR_ENTRY_PAR0_SSTEMP_TH_CH_IDX_MASK 0xFF
301#define VBIOS_VFE_3X_VAR_ENTRY_PAR0_SSTEMP_TH_CH_IDX_SHIFT 0
302
303#define VBIOS_VFE_3X_VAR_ENTRY_PAR0_SSTEMP_HYS_POS_MASK 0xFF00
304#define VBIOS_VFE_3X_VAR_ENTRY_PAR0_SSTEMP_HYS_POS_SHIFT 8
305
306#define VBIOS_VFE_3X_VAR_ENTRY_PAR0_SSTEMP_HYS_NEG_MASK 0xFF0000
307#define VBIOS_VFE_3X_VAR_ENTRY_PAR0_SSTEMP_HYS_NEG_SHIFT 16
308
309#define VBIOS_VFE_3X_VAR_ENTRY_PAR0_SSFUSE_VFIELD_ID_MASK 0xFF
310#define VBIOS_VFE_3X_VAR_ENTRY_PAR0_SSFUSE_VFIELD_ID_SHIFT 0
311
312#define VBIOS_VFE_3X_VAR_ENTRY_PAR0_SSFUSE_VFIELD_ID_VER_MASK 0xFF00
313#define VBIOS_VFE_3X_VAR_ENTRY_PAR0_SSFUSE_VFIELD_ID_VER_SHIFT 8
314
315#define VBIOS_VFE_3X_VAR_ENTRY_PAR0_SSFUSE_EXPECTED_VER_MASK 0xFF0000
316#define VBIOS_VFE_3X_VAR_ENTRY_PAR0_SSFUSE_EXPECTED_VER_SHIFT 16
317
318#define VBIOS_VFE_3X_VAR_ENTRY_PAR0_SSFUSE_USE_DEFAULT_ON_VER_CHECK_FAIL_MASK 0x1000000
319#define VBIOS_VFE_3X_VAR_ENTRY_PAR0_SSFUSE_USE_DEFAULT_ON_VER_CHECK_FAIL_SHIFT 24
320
321#define VBIOS_VFE_3X_VAR_ENTRY_PAR0_SSFUSE_USE_DEFAULT_ON_VER_CHECK_FAIL_YES 0x00000001
322#define VBIOS_VFE_3X_VAR_ENTRY_PAR0_SSFUSE_USE_DEFAULT_ON_VER_CHECK_FAIL_NO 0x00000000
323#define VBIOS_VFE_3X_VAR_ENTRY_PAR0_DPROD_VFE_VAR_IDX_0_MASK 0xFF
324#define VBIOS_VFE_3X_VAR_ENTRY_PAR0_DPROD_VFE_VAR_IDX_0_SHIFT 0
325
326#define VBIOS_VFE_3X_VAR_ENTRY_PAR0_DPROD_VFE_VAR_IDX_1_MASK 0xFF00
327#define VBIOS_VFE_3X_VAR_ENTRY_PAR0_DPROD_VFE_VAR_IDX_1_SHIFT 8
328
329#define VBIOS_VFE_3X_VAR_ENTRY_PAR0_DSUM_VFE_VAR_IDX_0_MASK 0xFF
330#define VBIOS_VFE_3X_VAR_ENTRY_PAR0_DSUM_VFE_VAR_IDX_0_SHIFT 0
331
332#define VBIOS_VFE_3X_VAR_ENTRY_PAR0_DSUM_VFE_VAR_IDX_1_MASK 0xFF00
333#define VBIOS_VFE_3X_VAR_ENTRY_PAR0_DSUM_VFE_VAR_IDX_1_SHIFT 8
334
335#define VBIOS_VFE_3X_VAR_ENTRY_PAR1_SSFUSE_DEFAULT_VAL_MASK 0xFFFFFFFF
336#define VBIOS_VFE_3X_VAR_ENTRY_PAR1_SSFUSE_DEFAULT_VAL_SHIFT 0
337
338#define VBIOS_VFE_3X_VAR_ENTRY_PAR1_SSFUSE_HW_CORRECTION_SCALE_MASK 0xFFFFFFFF
339#define VBIOS_VFE_3X_VAR_ENTRY_PAR1_SSFUSE_HW_CORRECTION_SCALE_SHIFT 0
340
341#define VBIOS_VFE_3X_VAR_ENTRY_PAR1_SSFUSE_HW_CORRECTION_OFFSET_MASK 0xFFFFFFFF
342#define VBIOS_VFE_3X_VAR_ENTRY_PAR1_SSFUSE_HW_CORRECTION_OFFSET_SHIFT 0
343
344#define VBIOS_VFE_3X_EQU_ENTRY_SIZE_17 0x17
345#define VBIOS_VFE_3X_EQU_ENTRY_SIZE_18 0x18
346
347struct vbios_vfe_3x_equ_entry_struct {
348 u8 type;
349 u8 var_idx;
350 u8 equ_idx_next;
351 u32 out_range_min;
352 u32 out_range_max;
353 u32 param0;
354 u32 param1;
355 u32 param2;
356 u8 param3;
357} __packed;
358
359
360#define VBIOS_VFE_3X_EQU_ENTRY_TYPE_DISABLED 0x00
361#define VBIOS_VFE_3X_EQU_ENTRY_TYPE_QUADRATIC 0x01
362#define VBIOS_VFE_3X_EQU_ENTRY_TYPE_MINMAX 0x02
363#define VBIOS_VFE_3X_EQU_ENTRY_TYPE_COMPARE 0x03
364#define VBIOS_VFE_3X_EQU_ENTRY_TYPE_QUADRATIC_FXP 0x04
365#define VBIOS_VFE_3X_EQU_ENTRY_TYPE_MINMAX_FXP 0x05
366
367#define VBIOS_VFE_3X_EQU_ENTRY_IDX_INVALID 0xFF
368
369#define VBIOS_VFE_3X_EQU_ENTRY_PAR0_QUADRATIC_C0_MASK 0xFFFFFFFF
370#define VBIOS_VFE_3X_EQU_ENTRY_PAR0_QUADRATIC_C0_SHIFT 0
371
372#define VBIOS_VFE_3X_EQU_ENTRY_PAR0_MINMAX_VFE_EQU_IDX_0_MASK 0xFF
373#define VBIOS_VFE_3X_EQU_ENTRY_PAR0_MINMAX_VFE_EQU_IDX_0_SHIFT 0
374
375#define VBIOS_VFE_3X_EQU_ENTRY_PAR0_MINMAX_VFE_EQU_IDX_1_MASK 0xFF00
376#define VBIOS_VFE_3X_EQU_ENTRY_PAR0_MINMAX_VFE_EQU_IDX_1_SHIFT 8
377
378#define VBIOS_VFE_3X_EQU_ENTRY_PAR0_MINMAX_CRIT_MASK 0x10000
379#define VBIOS_VFE_3X_EQU_ENTRY_PAR0_MINMAX_CRIT_SHIFT 16
380#define VBIOS_VFE_3X_EQU_ENTRY_PAR0_MINMAX_CRIT_MIN 0x00000000
381#define VBIOS_VFE_3X_EQU_ENTRY_PAR0_MINMAX_CRIT_MAX 0x00000001
382
383#define VBIOS_VFE_3X_EQU_ENTRY_PAR0_COMPARE_CRIT_MASK 0xFFFFFFFF
384#define VBIOS_VFE_3X_EQU_ENTRY_PAR0_COMPARE_CRIT_SHIFT 0
385
386#define VBIOS_VFE_3X_EQU_ENTRY_PAR1_QUADRATIC_C1_MASK 0xFFFFFFFF
387#define VBIOS_VFE_3X_EQU_ENTRY_PAR1_QUADRATIC_C1_SHIFT 0
388
389#define VBIOS_VFE_3X_EQU_ENTRY_PAR1_COMPARE_VFE_EQU_IDX_TRUE_MASK 0xFF
390#define VBIOS_VFE_3X_EQU_ENTRY_PAR1_COMPARE_VFE_EQU_IDX_TRUE_SHIFT 0
391
392#define VBIOS_VFE_3X_EQU_ENTRY_PAR1_COMPARE_VFE_EQU_IDX_FALSE_MASK 0xFF00
393#define VBIOS_VFE_3X_EQU_ENTRY_PAR1_COMPARE_VFE_EQU_IDX_FALSE_SHIFT 8
394
395#define VBIOS_VFE_3X_EQU_ENTRY_PAR1_COMPARE_FUNCTION_MASK 0x70000
396#define VBIOS_VFE_3X_EQU_ENTRY_PAR1_COMPARE_FUNCTION_SHIFT 16
397#define VBIOS_VFE_3X_EQU_ENTRY_PAR1_COMPARE_FUNCTION_EQUAL 0x00000000
398#define VBIOS_VFE_3X_EQU_ENTRY_PAR1_COMPARE_FUNCTION_GREATER_EQ 0x00000001
399#define VBIOS_VFE_3X_EQU_ENTRY_PAR1_COMPARE_FUNCTION_GREATER 0x00000002
400
401#define VBIOS_VFE_3X_EQU_ENTRY_PAR3_OUTPUT_TYPE_MASK 0xF
402#define VBIOS_VFE_3X_EQU_ENTRY_PAR3_OUTPUT_TYPE_SHIFT 0
403#define VBIOS_VFE_3X_EQU_ENTRY_PAR3_OUTPUT_TYPE_UNITLESS 0x0
404#define VBIOS_VFE_3X_EQU_ENTRY_PAR3_OUTPUT_TYPE_FREQ_MHZ 0x1
405#define VBIOS_VFE_3X_EQU_ENTRY_PAR3_OUTPUT_TYPE_VOLT_UV 0x2
406#define VBIOS_VFE_3X_EQU_ENTRY_PAR3_OUTPUT_TYPE_VF_GAIN 0x3
407#define VBIOS_VFE_3X_EQU_ENTRY_PAR3_OUTPUT_TYPE_VOLT_DELTA_UV 0x4
408
409#define NV_VFIELD_DESC_SIZE_BYTE 0x00000000
410#define NV_VFIELD_DESC_SIZE_WORD 0x00000001
411#define NV_VFIELD_DESC_SIZE_DWORD 0x00000002
412#define VFIELD_SIZE(pvregentry) ((pvregentry->strap_reg_desc & 0x18) >> 3)
413
414#define NV_PMU_BIOS_VFIELD_DESC_CODE_INVALID 0x00000000
415#define NV_PMU_BIOS_VFIELD_DESC_CODE_REG 0x00000001
416#define NV_PMU_BIOS_VFIELD_DESC_CODE_INDEX_REG 0x00000002
417
418#define NV_VFIELD_DESC_CODE_INVALID NV_PMU_BIOS_VFIELD_DESC_CODE_INVALID
419#define NV_VFIELD_DESC_CODE_REG NV_PMU_BIOS_VFIELD_DESC_CODE_REG
420#define NV_VFIELD_DESC_CODE_INDEX_REG NV_PMU_BIOS_VFIELD_DESC_CODE_INDEX_REG
421
422#define VFIELD_CODE(pvregentry) ((pvregentry->strap_reg_desc & 0xE0) >> 5)
423
424#define VFIELD_ID_STRAP_IDDQ 0x09
425#define VFIELD_ID_STRAP_IDDQ_1 0x0B
426
427#define VFIELD_REG_HEADER_SIZE 3
428struct vfield_reg_header {
429 u8 version;
430 u8 entry_size;
431 u8 count;
432} __packed;
433
434#define VBIOS_VFIELD_REG_TABLE_VERSION_1_0 0x10
435
436
437#define VFIELD_REG_ENTRY_SIZE 13
438struct vfield_reg_entry {
439 u8 strap_reg_desc;
440 u32 reg;
441 u32 reg_index;
442 u32 index;
443} __packed;
444
445#define VFIELD_HEADER_SIZE 3
446
447struct vfield_header {
448 u8 version;
449 u8 entry_size;
450 u8 count;
451} __packed;
452
453#define VBIOS_VFIELD_TABLE_VERSION_1_0 0x10
454
455#define VFIELD_BIT_START(ventry) (ventry.strap_desc & 0x1F)
456#define VFIELD_BIT_STOP(ventry) ((ventry.strap_desc & 0x3E0) >> 5)
457#define VFIELD_BIT_REG(ventry) ((ventry.strap_desc & 0x3C00) >> 10)
458
459#define VFIELD_ENTRY_SIZE 3
460
461struct vfield_entry {
462 u8 strap_id;
463 u16 strap_desc;
464} __packed;
465
466#define PERF_CLK_DOMAINS_IDX_MAX (32)
467#define PERF_CLK_DOMAINS_IDX_INVALID PERF_CLK_DOMAINS_IDX_MAX
468
469#define VBIOS_PSTATE_TABLE_VERSION_5X 0x50
470#define VBIOS_PSTATE_HEADER_5X_SIZE_10 (10)
471
472struct vbios_pstate_header_5x {
473 u8 version;
474 u8 header_size;
475 u8 base_entry_size;
476 u8 base_entry_count;
477 u8 clock_entry_size;
478 u8 clock_entry_count;
479 u8 flags0;
480 u8 initial_pstate;
481 u8 cpi_support_level;
482u8 cpi_features;
483} __packed;
484
485#define VBIOS_PSTATE_CLOCK_ENTRY_5X_SIZE_6 6
486
487#define VBIOS_PSTATE_BASE_ENTRY_5X_SIZE_2 0x2
488#define VBIOS_PSTATE_BASE_ENTRY_5X_SIZE_3 0x3
489
490struct vbios_pstate_entry_clock_5x {
491 u16 param0;
492 u32 param1;
493} __packed;
494
495struct vbios_pstate_entry_5x {
496 u8 pstate_level;
497 u8 flags0;
498 u8 lpwr_entry_idx;
499 struct vbios_pstate_entry_clock_5x clockEntry[PERF_CLK_DOMAINS_IDX_MAX];
500} __packed;
501
502#define VBIOS_PSTATE_5X_CLOCK_PROG_PARAM0_NOM_FREQ_MHZ_SHIFT 0
503#define VBIOS_PSTATE_5X_CLOCK_PROG_PARAM0_NOM_FREQ_MHZ_MASK 0x00003FFF
504
505#define VBIOS_PSTATE_5X_CLOCK_PROG_PARAM1_MIN_FREQ_MHZ_SHIFT 0
506#define VBIOS_PSTATE_5X_CLOCK_PROG_PARAM1_MIN_FREQ_MHZ_MASK 0x00003FFF
507
508#define VBIOS_PSTATE_5X_CLOCK_PROG_PARAM1_MAX_FREQ_MHZ_SHIFT 14
509#define VBIOS_PSTATE_5X_CLOCK_PROG_PARAM1_MAX_FREQ_MHZ_MASK 0x0FFFC000
510
511#define VBIOS_PERFLEVEL_SKIP_ENTRY 0xFF
512
513#define VBIOS_MEMORY_CLOCK_HEADER_11_VERSION 0x11
514
515#define VBIOS_MEMORY_CLOCK_HEADER_11_0_SIZE 16
516#define VBIOS_MEMORY_CLOCK_HEADER_11_1_SIZE 21
517#define VBIOS_MEMORY_CLOCK_HEADER_11_2_SIZE 26
518
519struct vbios_memory_clock_header_1x {
520 u8 version;
521 u8 header_size;
522 u8 base_entry_size;
523 u8 strap_entry_size;
524 u8 strap_entry_count;
525 u8 entry_count;
526 u8 flags;
527 u8 fbvdd_settle_time;
528 u32 cfg_pwrd_val;
529 u16 fbvddq_high;
530 u16 fbvddq_low;
531 u32 script_list_ptr;
532 u8 script_list_count;
533 u32 cmd_script_list_ptr;
534 u8 cmd_script_list_count;
535} __packed;
536
537#define VBIOS_MEMORY_CLOCK_BASE_ENTRY_11_2_SIZE 20
538
539struct vbios_memory_clock_base_entry_11 {
540 u16 minimum;
541 u16 maximum;
542 u32 script_pointer;
543 u8 flags0;
544 u32 fbpa_config;
545 u32 fbpa_config1;
546 u8 flags1;
547 u8 ref_mpllssf_freq_delta;
548 u8 flags2;
549} __packed;
550
551/* Script Pointer Index */
552/* #define VBIOS_MEMORY_CLOCK_BASE_ENTRY_11_FLAGS1_SCRIPT_INDEX 3:2*/
553#define VBIOS_MEMORY_CLOCK_BASE_ENTRY_11_FLAGS1_SCRIPT_INDEX_MASK 0xc
554#define VBIOS_MEMORY_CLOCK_BASE_ENTRY_11_FLAGS1_SCRIPT_INDEX_SHIFT 2
555/* #define VBIOS_MEMORY_CLOCK_BASE_ENTRY_12_FLAGS2_CMD_SCRIPT_INDEX 1:0*/
556#define VBIOS_MEMORY_CLOCK_BASE_ENTRY_12_FLAGS2_CMD_SCRIPT_INDEX_MASK 0x3
557#define VBIOS_MEMORY_CLOCK_BASE_ENTRY_12_FLAGS2_CMD_SCRIPT_INDEX_SHIFT 0
558
559#define VBIOS_POWER_SENSORS_VERSION_2X 0x20
560#define VBIOS_POWER_SENSORS_2X_HEADER_SIZE_08 0x00000008
561
562struct pwr_sensors_2x_header {
563 u8 version;
564 u8 header_size;
565 u8 table_entry_size;
566 u8 num_table_entries;
567 u32 ba_script_pointer;
568} __packed;
569
570#define VBIOS_POWER_SENSORS_2X_ENTRY_SIZE_15 0x00000015
571
572struct pwr_sensors_2x_entry {
573 u8 flags0;
574 u32 class_param0;
575 u32 sensor_param0;
576 u32 sensor_param1;
577 u32 sensor_param2;
578 u32 sensor_param3;
579} __packed;
580
581#define NV_VBIOS_POWER_SENSORS_2X_ENTRY_FLAGS0_CLASS_MASK 0xF
582#define NV_VBIOS_POWER_SENSORS_2X_ENTRY_FLAGS0_CLASS_SHIFT 0
583#define NV_VBIOS_POWER_SENSORS_2X_ENTRY_FLAGS0_CLASS_I2C 0x00000001
584
585#define NV_VBIOS_POWER_SENSORS_2X_ENTRY_CLASS_PARAM0_I2C_INDEX_MASK 0xFF
586#define NV_VBIOS_POWER_SENSORS_2X_ENTRY_CLASS_PARAM0_I2C_INDEX_SHIFT 0
587#define NV_VBIOS_POWER_SENSORS_2X_ENTRY_CLASS_PARAM0_I2C_USE_FXP8_8_MASK 0x100
588#define NV_VBIOS_POWER_SENSORS_2X_ENTRY_CLASS_PARAM0_I2C_USE_FXP8_8_SHIFT 8
589
590#define NV_VBIOS_POWER_SENSORS_2X_ENTRY_SENSOR_PARAM0_INA3221_RSHUNT0_MOHM_MASK 0xFFFF
591#define NV_VBIOS_POWER_SENSORS_2X_ENTRY_SENSOR_PARAM0_INA3221_RSHUNT0_MOHM_SHIFT 0
592#define NV_VBIOS_POWER_SENSORS_2X_ENTRY_SENSOR_PARAM0_INA3221_RSHUNT1_MOHM_MASK 0xFFFF0000
593#define NV_VBIOS_POWER_SENSORS_2X_ENTRY_SENSOR_PARAM0_INA3221_RSHUNT1_MOHM_SHIFT 16
594#define NV_VBIOS_POWER_SENSORS_2X_ENTRY_SENSOR_PARAM1_INA3221_RSHUNT2_MOHM_MASK 0xFFFF
595#define NV_VBIOS_POWER_SENSORS_2X_ENTRY_SENSOR_PARAM1_INA3221_RSHUNT2_MOHM_SHIFT 0
596#define NV_VBIOS_POWER_SENSORS_2X_ENTRY_SENSOR_PARAM1_INA3221_CONFIGURATION_MASK 0xFFFF0000
597#define NV_VBIOS_POWER_SENSORS_2X_ENTRY_SENSOR_PARAM1_INA3221_CONFIGURATION_SHIFT 16
598
599#define NV_VBIOS_POWER_SENSORS_2X_ENTRY_SENSOR_PARAM2_INA3221_MASKENABLE_MASK 0xFFFF
600#define NV_VBIOS_POWER_SENSORS_2X_ENTRY_SENSOR_PARAM2_INA3221_MASKENABLE_SHIFT 0
601#define NV_VBIOS_POWER_SENSORS_2X_ENTRY_SENSOR_PARAM2_INA3221_GPIOFUNCTION_MASK 0xFF0000
602#define NV_VBIOS_POWER_SENSORS_2X_ENTRY_SENSOR_PARAM2_INA3221_GPIOFUNCTION_SHIFT 16
603#define NV_VBIOS_POWER_SENSORS_2X_ENTRY_SENSOR_PARAM3_INA3221_CURR_CORRECT_M_MASK 0xFFFF
604#define NV_VBIOS_POWER_SENSORS_2X_ENTRY_SENSOR_PARAM3_INA3221_CURR_CORRECT_M_SHIFT 0
605#define NV_VBIOS_POWER_SENSORS_2X_ENTRY_SENSOR_PARAM3_INA3221_CURR_CORRECT_B_MASK 0xFFFF0000
606#define NV_VBIOS_POWER_SENSORS_2X_ENTRY_SENSOR_PARAM3_INA3221_CURR_CORRECT_B_SHIFT 16
607
608#define VBIOS_POWER_TOPOLOGY_VERSION_2X 0x20
609#define VBIOS_POWER_TOPOLOGY_2X_HEADER_SIZE_06 0x00000006
610
611struct pwr_topology_2x_header {
612 u8 version;
613 u8 header_size;
614 u8 table_entry_size;
615 u8 num_table_entries;
616 u8 rel_entry_size;
617 u8 num_rel_entries;
618} __packed;
619
620#define VBIOS_POWER_TOPOLOGY_2X_ENTRY_SIZE_16 0x00000016
621
622struct pwr_topology_2x_entry {
623 u8 flags0;
624 u8 pwr_rail;
625 u32 param0;
626 u32 curr_corr_slope;
627 u32 curr_corr_offset;
628 u32 param1;
629 u32 param2;
630} __packed;
631
632#define NV_VBIOS_POWER_TOPOLOGY_2X_ENTRY_FLAGS0_CLASS_MASK 0xF
633#define NV_VBIOS_POWER_TOPOLOGY_2X_ENTRY_FLAGS0_CLASS_SHIFT 0
634#define NV_VBIOS_POWER_TOPOLOGY_2X_ENTRY_FLAGS0_CLASS_SENSOR 0x00000001
635
636#define NV_VBIOS_POWER_TOPOLOGY_2X_ENTRY_PARAM1_SENSOR_INDEX_MASK 0xFF
637#define NV_VBIOS_POWER_TOPOLOGY_2X_ENTRY_PARAM1_SENSOR_INDEX_SHIFT 0
638#define NV_VBIOS_POWER_TOPOLOGY_2X_ENTRY_PARAM1_SENSOR_PROVIDER_INDEX_MASK 0xFF00
639#define NV_VBIOS_POWER_TOPOLOGY_2X_ENTRY_PARAM1_SENSOR_PROVIDER_INDEX_SHIFT 8
640
641#define VBIOS_POWER_POLICY_VERSION_3X 0x30
642#define VBIOS_POWER_POLICY_3X_HEADER_SIZE_25 0x00000025
643
644struct pwr_policy_3x_header_struct {
645 u8 version;
646 u8 header_size;
647 u8 table_entry_size;
648 u8 num_table_entries;
649 u16 base_sample_period;
650 u16 min_client_sample_period;
651 u8 table_rel_entry_size;
652 u8 num_table_rel_entries;
653 u8 tgp_policy_idx;
654 u8 rtp_policy_idx;
655 u8 mxm_policy_idx;
656 u8 dnotifier_policy_idx;
657 u32 d2_limit;
658 u32 d3_limit;
659 u32 d4_limit;
660 u32 d5_limit;
661 u8 low_sampling_mult;
662 u8 pwr_tgt_policy_idx;
663 u8 pwr_tgt_floor_policy_idx;
664 u8 sm_bus_policy_idx;
665 u8 table_viol_entry_size;
666 u8 num_table_viol_entries;
667} __packed;
668
669#define VBIOS_POWER_POLICY_3X_ENTRY_SIZE_2E 0x0000002E
670
671struct pwr_policy_3x_entry_struct {
672 u8 flags0;
673 u8 ch_idx;
674 u32 limit_min;
675 u32 limit_rated;
676 u32 limit_max;
677 u32 param0;
678 u32 param1;
679 u32 param2;
680 u32 param3;
681 u32 limit_batt;
682 u8 flags1;
683 u8 past_length;
684 u8 next_length;
685 u16 ratio_min;
686 u16 ratio_max;
687 u8 sample_mult;
688 u32 filter_param;
689} __packed;
690
691#define NV_VBIOS_POWER_POLICY_3X_ENTRY_FLAGS0_CLASS_MASK 0xF
692#define NV_VBIOS_POWER_POLICY_3X_ENTRY_FLAGS0_CLASS_SHIFT 0
693#define NV_VBIOS_POWER_POLICY_3X_ENTRY_FLAGS0_CLASS_HW_THRESHOLD 0x00000005
694#define NV_VBIOS_POWER_POLICY_3X_ENTRY_FLAGS0_LIMIT_UNIT_MASK 0x10
695#define NV_VBIOS_POWER_POLICY_3X_ENTRY_FLAGS0_LIMIT_UNIT_SHIFT 4
696
697#define NV_VBIOS_POWER_POLICY_3X_ENTRY_FLAGS1_FULL_DEFLECTION_LIMIT_MASK 0x1
698#define NV_VBIOS_POWER_POLICY_3X_ENTRY_FLAGS1_FULL_DEFLECTION_LIMIT_SHIFT 0
699#define NV_VBIOS_POWER_POLICY_3X_ENTRY_FLAGS1_INTEGRAL_CONTROL_MASK 0x2
700#define NV_VBIOS_POWER_POLICY_3X_ENTRY_FLAGS1_INTEGRAL_CONTROL_SHIFT 1
701#define NV_VBIOS_POWER_POLICY_3X_ENTRY_FLAGS1_FILTER_TYPE_MASK 0x3C
702#define NV_VBIOS_POWER_POLICY_3X_ENTRY_FLAGS1_FILTER_TYPE_SHIFT 2
703
704#define NV_VBIOS_POWER_POLICY_3X_ENTRY_PARAM0_HW_THRESHOLD_THRES_IDX_MASK 0xFF
705#define NV_VBIOS_POWER_POLICY_3X_ENTRY_PARAM0_HW_THRESHOLD_THRES_IDX_SHIFT 0
706#define NV_VBIOS_POWER_POLICY_3X_ENTRY_PARAM0_HW_THRESHOLD_LOW_THRESHOLD_IDX_MASK 0xFF00
707#define NV_VBIOS_POWER_POLICY_3X_ENTRY_PARAM0_HW_THRESHOLD_LOW_THRESHOLD_IDX_SHIFT 8
708#define NV_VBIOS_POWER_POLICY_3X_ENTRY_PARAM0_HW_THRESHOLD_LOW_THRESHOLD_USE_MASK 0x10000
709#define NV_VBIOS_POWER_POLICY_3X_ENTRY_PARAM0_HW_THRESHOLD_LOW_THRESHOLD_USE_SHIFT 16
710
711#define NV_VBIOS_POWER_POLICY_3X_ENTRY_PARAM1_HW_THRESHOLD_LOW_THRESHOLD_VAL_MASK 0xFFFF
712#define NV_VBIOS_POWER_POLICY_3X_ENTRY_PARAM1_HW_THRESHOLD_LOW_THRESHOLD_VAL_SHIFT 0
713
714/* Voltage Rail Table */
715struct vbios_voltage_rail_table_1x_header {
716 u8 version;
717 u8 header_size;
718 u8 table_entry_size;
719 u8 num_table_entries;
720 u8 volt_domain_hal;
721} __packed;
722
723#define NV_VBIOS_VOLTAGE_RAIL_1X_ENTRY_SIZE_07 0X00000007
724#define NV_VBIOS_VOLTAGE_RAIL_1X_ENTRY_SIZE_08 0X00000008
725#define NV_VBIOS_VOLTAGE_RAIL_1X_ENTRY_SIZE_09 0X00000009
726#define NV_VBIOS_VOLTAGE_RAIL_1X_ENTRY_SIZE_0A 0X0000000A
727#define NV_VBIOS_VOLTAGE_RAIL_1X_ENTRY_SIZE_0B 0X0000000B
728
729struct vbios_voltage_rail_table_1x_entry {
730 u32 boot_voltage_uv;
731 u8 rel_limit_vfe_equ_idx;
732 u8 alt_rel_limit_vfe_equidx;
733 u8 ov_limit_vfe_equ_idx;
734 u8 pwr_equ_idx;
735 u8 boot_volt_vfe_equ_idx;
736 u8 vmin_limit_vfe_equ_idx;
737 u8 volt_margin_limit_vfe_equ_idx;
738} __packed;
739
740/* Voltage Device Table */
741struct vbios_voltage_device_table_1x_header {
742 u8 version;
743 u8 header_size;
744 u8 table_entry_size;
745 u8 num_table_entries;
746} __packed;
747
748struct vbios_voltage_device_table_1x_entry {
749 u8 type;
750 u8 volt_domain;
751 u16 settle_time_us;
752 u32 param0;
753 u32 param1;
754 u32 param2;
755 u32 param3;
756 u32 param4;
757} __packed;
758
759#define NV_VBIOS_VOLTAGE_DEVICE_1X_ENTRY_TYPE_INVALID 0x00
760#define NV_VBIOS_VOLTAGE_DEVICE_1X_ENTRY_TYPE_PSV 0x02
761
762#define NV_VBIOS_VDT_1X_ENTRY_PARAM0_PSV_INPUT_FREQUENCY_MASK \
763 GENMASK(23, 0)
764#define NV_VBIOS_VDT_1X_ENTRY_PARAM0_PSV_INPUT_FREQUENCY_SHIFT 0
765#define NV_VBIOS_VDT_1X_ENTRY_PARAM0_PSV_EXT_DEVICE_INDEX_MASK \
766 GENMASK(31, 24)
767#define NV_VBIOS_VDT_1X_ENTRY_PARAM0_PSV_EXT_DEVICE_INDEX_SHIFT 24
768
769#define NV_VBIOS_VDT_1X_ENTRY_PARAM1_PSV_VOLTAGE_MINIMUM_MASK \
770 GENMASK(23, 0)
771#define NV_VBIOS_VDT_1X_ENTRY_PARAM1_PSV_VOLTAGE_MINIMUM_SHIFT 0
772#define NV_VBIOS_VDT_1X_ENTRY_PARAM1_PSV_OPERATION_TYPE_MASK \
773 GENMASK(31, 24)
774#define NV_VBIOS_VDT_1X_ENTRY_PARAM1_PSV_OPERATION_TYPE_SHIFT 24
775#define NV_VBIOS_VDT_1X_ENTRY_PARAM1_PSV_OPERATION_TYPE_DEFAULT 0x00
776#define NV_VBIOS_VDT_1X_ENTRY_PARAM1_PSV_OPERATION_TYPE_LPWR_STEADY_STATE \
777 0x01
778#define NV_VBIOS_VDT_1X_ENTRY_PARAM1_PSV_OPERATION_TYPE_LPWR_SLEEP_STATE \
779 0x02
780#define NV_VBIOS_VDT_1X_ENTRY_PARAM2_PSV_VOLTAGE_MAXIMUM_MASK \
781 GENMASK(23, 0)
782#define NV_VBIOS_VDT_1X_ENTRY_PARAM2_PSV_VOLTAGE_MAXIMUM_SHIFT 0
783#define NV_VBIOS_VDT_1X_ENTRY_PARAM2_PSV_RSVD_MASK \
784 GENMASK(31, 24)
785#define NV_VBIOS_VDT_1X_ENTRY_PARAM2_PSV_RSVD_SHIFT 24
786
787#define NV_VBIOS_VDT_1X_ENTRY_PARAM3_PSV_VOLTAGE_BASE_MASK \
788 GENMASK(23, 0)
789#define NV_VBIOS_VDT_1X_ENTRY_PARAM3_PSV_VOLTAGE_BASE_SHIFT 0
790#define NV_VBIOS_VDT_1X_ENTRY_PARAM3_PSV_VOLTAGE_STEPS_MASK \
791 GENMASK(31, 24)
792#define NV_VBIOS_VDT_1X_ENTRY_PARAM3_PSV_VOLTAGE_STEPS_SHIFT 24
793
794#define NV_VBIOS_VDT_1X_ENTRY_PARAM4_PSV_OFFSET_SCALE_MASK \
795 GENMASK(23, 0)
796#define NV_VBIOS_VDT_1X_ENTRY_PARAM4_PSV_OFFSET_SCALE_SHIFT 0
797#define NV_VBIOS_VDT_1X_ENTRY_PARAM4_PSV_RSVD_MASK \
798 GENMASK(31, 24)
799#define NV_VBIOS_VDT_1X_ENTRY_PARAM4_PSV_RSVD_SHIFT 24
800
801/* Voltage Policy Table */
802struct vbios_voltage_policy_table_1x_header {
803 u8 version;
804 u8 header_size;
805 u8 table_entry_size;
806 u8 num_table_entries;
807 u8 perf_core_vf_seq_policy_idx;
808} __packed;
809
810struct vbios_voltage_policy_table_1x_entry {
811 u8 type;
812 u32 param0;
813 u32 param1;
814} __packed;
815
816#define NV_VBIOS_VOLTAGE_POLICY_1X_ENTRY_TYPE_INVALID 0x00
817#define NV_VBIOS_VOLTAGE_POLICY_1X_ENTRY_TYPE_SINGLE_RAIL 0x01
818#define NV_VBIOS_VOLTAGE_POLICY_1X_ENTRY_TYPE_SR_MULTI_STEP 0x02
819#define NV_VBIOS_VOLTAGE_POLICY_1X_ENTRY_TYPE_SR_SINGLE_STEP 0x03
820
821#define NV_VBIOS_VPT_ENTRY_PARAM0_SINGLE_RAIL_VOLT_DOMAIN_MASK \
822 GENMASK(7, 0)
823#define NV_VBIOS_VPT_ENTRY_PARAM0_SINGLE_RAIL_VOLT_DOMAIN_SHIFT 0
824#define NV_VBIOS_VPT_ENTRY_PARAM0_RSVD_MASK GENMASK(8, 31)
825#define NV_VBIOS_VPT_ENTRY_PARAM0_RSVD_SHIFT 8
826
827#define NV_VBIOS_VPT_ENTRY_PARAM0_SR_VD_MASTER_MASK \
828 GENMASK(7, 0)
829#define NV_VBIOS_VPT_ENTRY_PARAM0_SR_VD_MASTER_SHIFT 0
830#define NV_VBIOS_VPT_ENTRY_PARAM0_SR_VD_SLAVE_MASK \
831 GENMASK(15, 8)
832#define NV_VBIOS_VPT_ENTRY_PARAM0_SR_VD_SLAVE_SHIFT 8
833#define NV_VBIOS_VPT_ENTRY_PARAM0_SR_DELTA_SM_MIN_MASK \
834 GENMASK(23, 16)
835#define NV_VBIOS_VPT_ENTRY_PARAM0_SR_DELTA_SM_MIN_SHIFT 16
836#define NV_VBIOS_VPT_ENTRY_PARAM0_SR_DELTA_SM_MAX_MASK \
837 GENMASK(31, 24)
838#define NV_VBIOS_VPT_ENTRY_PARAM0_SR_DELTA_SM_MAX_SHIFT 24
839
840/* Type-Specific Parameter DWORD 0 - Type = _SR_MULTI_STEP */
841#define NV_VBIOS_VPT_ENTRY_PARAM1_SR_SETTLE_TIME_INTERMEDIATE_MASK \
842 GENMASK(15, 0)
843#define NV_VBIOS_VPT_ENTRY_PARAM1_SR_SETTLE_TIME_INTERMEDIATE_SHIFT \
844 0
845
846#define VBIOS_THERM_DEVICE_VERSION_1X 0x10
847
848#define VBIOS_THERM_DEVICE_1X_HEADER_SIZE_04 0x00000004
849
850struct therm_device_1x_header {
851 u8 version;
852 u8 header_size;
853 u8 table_entry_size;
854 u8 num_table_entries;
855} ;
856
857struct therm_device_1x_entry {
858 u8 class_id;
859 u8 param0;
860 u8 flags;
861} ;
862
863#define NV_VBIOS_THERM_DEVICE_1X_ENTRY_CLASS_GPU 0x01
864
865#define NV_VBIOS_THERM_DEVICE_1X_ENTRY_PARAM0_I2C_DEVICE_INDEX_MASK 0xFF
866#define NV_VBIOS_THERM_DEVICE_1X_ENTRY_PARAM0_I2C_DEVICE_INDEX_SHIFT 0
867
868#define VBIOS_THERM_CHANNEL_VERSION_1X 0x10
869
870#define VBIOS_THERM_CHANNEL_1X_HEADER_SIZE_09 0x00000009
871
872struct therm_channel_1x_header {
873 u8 version;
874 u8 header_size;
875 u8 table_entry_size;
876 u8 num_table_entries;
877 u8 gpu_avg_pri_ch_idx;
878 u8 gpu_max_pri_ch_idx;
879 u8 board_pri_ch_idx;
880 u8 mem_pri_ch_idx;
881 u8 pwr_supply_pri_ch_idx;
882} __packed;
883
884struct therm_channel_1x_entry {
885 u8 class_id;
886 u8 param0;
887 u8 param1;
888 u8 param2;
889 u8 flags;
890} __packed;
891
892#define NV_VBIOS_THERM_CHANNEL_1X_ENTRY_CLASS_DEVICE 0x01
893
894#define NV_VBIOS_THERM_CHANNEL_1X_ENTRY_PARAM0_DEVICE_INDEX_MASK 0xFF
895#define NV_VBIOS_THERM_CHANNEL_1X_ENTRY_PARAM0_DEVICE_INDEX_SHIFT 0
896
897#define NV_VBIOS_THERM_CHANNEL_1X_ENTRY_PARAM1_DEVICE_PROVIDER_INDEX_MASK 0xFF
898#define NV_VBIOS_THERM_CHANNEL_1X_ENTRY_PARAM1_DEVICE_PROVIDER_INDEX_SHIFT 0
899
900/* Frequency Controller Table */
901struct vbios_fct_1x_header {
902 u8 version;
903 u8 header_size;
904 u8 entry_size;
905 u8 entry_count;
906 u16 sampling_period_ms;
907} __packed;
908
909struct vbios_fct_1x_entry {
910 u8 flags0;
911 u8 clk_domain_idx;
912 u16 param0;
913 u16 param1;
914 u32 param2;
915 u32 param3;
916 u32 param4;
917 u32 param5;
918 u32 param6;
919 u32 param7;
920 u32 param8;
921} __packed;
922
923#define NV_VBIOS_FCT_1X_ENTRY_FLAGS0_TYPE_MASK GENMASK(3, 0)
924#define NV_VBIOS_FCT_1X_ENTRY_FLAGS0_TYPE_SHIFT 0
925#define NV_VBIOS_FCT_1X_ENTRY_FLAGS0_TYPE_DISABLED 0x0
926#define NV_VBIOS_FCT_1X_ENTRY_FLAGS0_TYPE_PI 0x1
927
928#define NV_VBIOS_FCT_1X_ENTRY_PARAM0_ID_MASK GENMASK(7, 0)
929#define NV_VBIOS_FCT_1X_ENTRY_PARAM0_ID_SHIFT 0
930#define NV_VBIOS_FCT_1X_ENTRY_PARAM0_ID_SYS 0x00
931#define NV_VBIOS_FCT_1X_ENTRY_PARAM0_ID_LTC 0x01
932#define NV_VBIOS_FCT_1X_ENTRY_PARAM0_ID_XBAR 0x02
933#define NV_VBIOS_FCT_1X_ENTRY_PARAM0_ID_GPC0 0x03
934#define NV_VBIOS_FCT_1X_ENTRY_PARAM0_ID_GPC1 0x04
935#define NV_VBIOS_FCT_1X_ENTRY_PARAM0_ID_GPC2 0x05
936#define NV_VBIOS_FCT_1X_ENTRY_PARAM0_ID_GPC3 0x06
937#define NV_VBIOS_FCT_1X_ENTRY_PARAM0_ID_GPC4 0x07
938#define NV_VBIOS_FCT_1X_ENTRY_PARAM0_ID_GPC5 0x08
939#define NV_VBIOS_FCT_1X_ENTRY_PARAM0_ID_GPCS 0x09
940
941#define NV_VBIOS_FCT_1X_ENTRY_PARAM0_FREQ_MODE_MASK GENMASK(9, 8)
942#define NV_VBIOS_FCT_1X_ENTRY_PARAM0_FREQ_MODE_SHIFT 8
943#define NV_VBIOS_FCT_1X_ENTRY_PARAM0_FREQ_MODE_BCAST 0x0
944#define NV_VBIOS_FCT_1X_ENTRY_PARAM0_FREQ_MODE_MIN 0x1
945#define NV_VBIOS_FCT_1X_ENTRY_PARAM0_FREQ_MODE_MAX 0x2
946#define NV_VBIOS_FCT_1X_ENTRY_PARAM0_FREQ_MODE_AVG 0x3
947
948#define NV_VBIOS_FCT_1X_ENTRY_PARAM1_SLOWDOWN_PCT_MIN_MASK GENMASK(7, 0)
949#define NV_VBIOS_FCT_1X_ENTRY_PARAM1_SLOWDOWN_PCT_MIN_SHIFT 0
950
951#define NV_VBIOS_FCT_1X_ENTRY_PARAM1_POISON_MASK GENMASK(8, 8)
952#define NV_VBIOS_FCT_1X_ENTRY_PARAM1_POISON_SHIFT 8
953#define NV_VBIOS_FCT_1X_ENTRY_PARAM1_POISON_NO 0x0
954#define NV_VBIOS_FCT_1X_ENTRY_PARAM1_POISON_YES 0x1
955
956#define NV_VBIOS_FCT_1X_ENTRY_PARAM2_PROP_GAIN_MASK GENMASK(31, 0)
957#define NV_VBIOS_FCT_1X_ENTRY_PARAM2_PROP_GAIN_SHIFT 0
958
959#define NV_VBIOS_FCT_1X_ENTRY_PARAM3_INTEG_GAIN_MASK GENMASK(31, 0)
960#define NV_VBIOS_FCT_1X_ENTRY_PARAM3_INTEG_GAIN_SHIFT 0
961
962
963#define NV_VBIOS_FCT_1X_ENTRY_PARAM4_INTEG_DECAY_MASK GENMASK(31, 0)
964#define NV_VBIOS_FCT_1X_ENTRY_PARAM4_INTEG_DECAY_SHIFT 0
965
966#define NV_VBIOS_FCT_1X_ENTRY_PARAM5_VOLT_DELTA_MIN_MASK GENMASK(31, 0)
967#define NV_VBIOS_FCT_1X_ENTRY_PARAM5_VOLT_DELTA_MIN_SHIFT 0
968
969
970#define NV_VBIOS_FCT_1X_ENTRY_PARAM6_VOLT_DELTA_MAX_MASK GENMASK(31, 0)
971#define NV_VBIOS_FCT_1X_ENTRY_PARAM6_VOLT_DELTA_MAX_SHIFT 0
972
973#define NV_VBIOS_FCT_1X_ENTRY_PARAM7_FREQ_CAP_VF_MASK GENMASK(15, 0)
974#define NV_VBIOS_FCT_1X_ENTRY_PARAM7_FREQ_CAP_VF_SHIFT 0
975#define NV_VBIOS_FCT_1X_ENTRY_PARAM7_FREQ_CAP_VMIN_MASK GENMASK(31, 16)
976#define NV_VBIOS_FCT_1X_ENTRY_PARAM7_FREQ_CAP_VMIN_SHIFT 16
977
978#define NV_VBIOS_FCT_1X_ENTRY_PARAM8_FREQ_HYST_POS_MASK GENMASK(15, 0)
979#define NV_VBIOS_FCT_1X_ENTRY_PARAM8_FREQ_HYST_POS_SHIFT 0
980#define NV_VBIOS_FCT_1X_ENTRY_PARAM8_FREQ_HYST_NEG_MASK GENMASK(31, 16)
981#define NV_VBIOS_FCT_1X_ENTRY_PARAM8_FREQ_HYST_NEG_SHIFT 16
982
983/* LPWR Index Table */
984struct nvgpu_bios_lpwr_idx_table_1x_header {
985 u8 version;
986 u8 header_size;
987 u8 entry_size;
988 u8 entry_count;
989 u16 base_sampling_period;
990} __packed;
991
992struct nvgpu_bios_lpwr_idx_table_1x_entry {
993 u8 pcie_idx;
994 u8 gr_idx;
995 u8 ms_idx;
996 u8 di_idx;
997 u8 gc6_idx;
998} __packed;
999
1000/* LPWR MS Table*/
1001struct nvgpu_bios_lpwr_ms_table_1x_header {
1002 u8 version;
1003 u8 header_size;
1004 u8 entry_size;
1005 u8 entry_count;
1006 u8 default_entry_idx;
1007 u16 idle_threshold_us;
1008} __packed;
1009
1010struct nvgpu_bios_lpwr_ms_table_1x_entry {
1011 u32 feautre_mask;
1012 u16 dynamic_current_logic;
1013 u16 dynamic_current_sram;
1014} __packed;
1015
1016#define NV_VBIOS_LPWR_MS_FEATURE_MASK_MS_MASK GENMASK(0, 0)
1017#define NV_VBIOS_LPWR_MS_FEATURE_MASK_MS_SHIFT 0
1018#define NV_VBIOS_LPWR_MS_FEATURE_MASK_MS_SWASR_MASK GENMASK(2, 2)
1019#define NV_VBIOS_LPWR_MS_FEATURE_MASK_MS_SWASR_SHIFT 2
1020#define NV_VBIOS_LPWR_MS_FEATURE_MASK_MS_CLOCK_GATING_MASK \
1021 GENMASK(3, 3)
1022#define NV_VBIOS_LPWR_MS_FEATURE_MASK_MS_CLOCK_GATING_SHIFT 3
1023#define NV_VBIOS_LPWR_MS_FEATURE_MASK_MS_RPPG_MASK GENMASK(5, 5)
1024#define NV_VBIOS_LPWR_MS_FEATURE_MASK_MS_RPPG_SHIFT 5
1025
1026/* LPWR GR Table */
1027struct nvgpu_bios_lpwr_gr_table_1x_header {
1028 u8 version;
1029 u8 header_size;
1030 u8 entry_size;
1031 u8 entry_count;
1032 u8 default_entry_idx;
1033 u16 idle_threshold_us;
1034 u8 adaptive_gr_multiplier;
1035} __packed;
1036
1037struct nvgpu_bios_lpwr_gr_table_1x_entry {
1038 u32 feautre_mask;
1039} __packed;
1040
1041#define NV_VBIOS_LPWR_GR_FEATURE_MASK_GR_MASK GENMASK(0, 0)
1042#define NV_VBIOS_LPWR_GR_FEATURE_MASK_GR_SHIFT 0
1043
1044#define NV_VBIOS_LPWR_GR_FEATURE_MASK_GR_RPPG_MASK GENMASK(4, 4)
1045#define NV_VBIOS_LPWR_GR_FEATURE_MASK_GR_RPPG_SHIFT 4
1046int nvgpu_bios_parse_rom(struct gk20a *g);
1047u8 nvgpu_bios_read_u8(struct gk20a *g, u32 offset);
1048s8 nvgpu_bios_read_s8(struct gk20a *g, u32 offset);
1049u16 nvgpu_bios_read_u16(struct gk20a *g, u32 offset);
1050u32 nvgpu_bios_read_u32(struct gk20a *g, u32 offset);
1051void *nvgpu_bios_get_perf_table_ptrs(struct gk20a *g,
1052 struct bit_token *ptoken, u8 table_id);
1053int nvgpu_bios_execute_script(struct gk20a *g, u32 offset);
1054
1055#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/bitops.h b/drivers/gpu/nvgpu/include/nvgpu/bitops.h
new file mode 100644
index 00000000..d3bac60e
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/bitops.h
@@ -0,0 +1,32 @@
1/*
2 * Copyright (c) 2017, 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#ifndef __NVGPU_BITOPS_H__
23#define __NVGPU_BITOPS_H__
24
25#ifdef __KERNEL__
26#include <linux/bitops.h>
27#include <linux/bitmap.h>
28#else
29#include <nvgpu_rmos/include/bitops.h>
30#endif
31
32#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/bsearch.h b/drivers/gpu/nvgpu/include/nvgpu/bsearch.h
new file mode 100644
index 00000000..b02cc85c
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/bsearch.h
@@ -0,0 +1,29 @@
1/*
2 * Copyright (c) 2017, 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#ifndef __NVGPU_BSEARCH_H__
23#define __NVGPU_BSEARCH_H__
24
25#ifdef __KERNEL__
26#include <linux/bsearch.h>
27#endif
28
29#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/bug.h b/drivers/gpu/nvgpu/include/nvgpu/bug.h
new file mode 100644
index 00000000..ea62c6d8
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/bug.h
@@ -0,0 +1,31 @@
1/*
2 * Copyright (c) 2017, 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#ifndef __NVGPU_BUG_H__
23#define __NVGPU_BUG_H__
24
25#ifdef __KERNEL__
26#include <linux/bug.h>
27#else
28#include <nvgpu_rmos/include/bug.h>
29#endif
30
31#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/bus.h b/drivers/gpu/nvgpu/include/nvgpu/bus.h
new file mode 100644
index 00000000..6957bfbd
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/bus.h
@@ -0,0 +1,38 @@
1/*
2 * Copyright (c) 2017, 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#ifndef __NVGPU_BUS_H__
23#define __NVGPU_BUS_H__
24
25#include <nvgpu/types.h>
26
27struct gk20a;
28
29struct nvgpu_cpu_time_correlation_sample {
30 u64 cpu_timestamp;
31 u64 gpu_timestamp;
32};
33
34int nvgpu_get_timestamps_zipper(struct gk20a *g,
35 u32 source_id, u32 count,
36 struct nvgpu_cpu_time_correlation_sample *samples);
37
38#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/circ_buf.h b/drivers/gpu/nvgpu/include/nvgpu/circ_buf.h
new file mode 100644
index 00000000..c6620663
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/circ_buf.h
@@ -0,0 +1,29 @@
1/*
2 * Copyright (c) 2017, 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#ifndef __NVGPU_CIRC_BUF_H__
23#define __NVGPU_CIRC_BUF_H__
24
25#ifdef __KERNEL__
26#include <linux/circ_buf.h>
27#endif
28
29#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/clk_arb.h b/drivers/gpu/nvgpu/include/nvgpu/clk_arb.h
new file mode 100644
index 00000000..09f0b0d3
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/clk_arb.h
@@ -0,0 +1,82 @@
1/*
2 * Copyright (c) 2016-2017, 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#ifndef __NVGPU_CLK_ARB_H__
24#define __NVGPU_CLK_ARB_H__
25
26#include <nvgpu/types.h>
27
28struct gk20a;
29struct nvgpu_clk_session;
30
31int nvgpu_clk_arb_init_arbiter(struct gk20a *g);
32
33int nvgpu_clk_arb_get_arbiter_clk_range(struct gk20a *g, u32 api_domain,
34 u16 *min_mhz, u16 *max_mhz);
35
36int nvgpu_clk_arb_get_arbiter_actual_mhz(struct gk20a *g,
37 u32 api_domain, u16 *actual_mhz);
38
39int nvgpu_clk_arb_get_arbiter_effective_mhz(struct gk20a *g,
40 u32 api_domain, u16 *effective_mhz);
41
42int nvgpu_clk_arb_get_arbiter_clk_f_points(struct gk20a *g,
43 u32 api_domain, u32 *max_points, u16 *fpoints);
44
45u32 nvgpu_clk_arb_get_arbiter_clk_domains(struct gk20a *g);
46bool nvgpu_clk_arb_is_valid_domain(struct gk20a *g, u32 api_domain);
47
48void nvgpu_clk_arb_cleanup_arbiter(struct gk20a *g);
49
50int nvgpu_clk_arb_install_session_fd(struct gk20a *g,
51 struct nvgpu_clk_session *session);
52
53int nvgpu_clk_arb_init_session(struct gk20a *g,
54 struct nvgpu_clk_session **_session);
55
56void nvgpu_clk_arb_release_session(struct gk20a *g,
57 struct nvgpu_clk_session *session);
58
59int nvgpu_clk_arb_commit_request_fd(struct gk20a *g,
60 struct nvgpu_clk_session *session, int request_fd);
61
62int nvgpu_clk_arb_set_session_target_mhz(struct nvgpu_clk_session *session,
63 int fd, u32 api_domain, u16 target_mhz);
64
65int nvgpu_clk_arb_get_session_target_mhz(struct nvgpu_clk_session *session,
66 u32 api_domain, u16 *target_mhz);
67
68int nvgpu_clk_arb_install_event_fd(struct gk20a *g,
69 struct nvgpu_clk_session *session, int *event_fd, u32 alarm_mask);
70
71int nvgpu_clk_arb_install_request_fd(struct gk20a *g,
72 struct nvgpu_clk_session *session, int *event_fd);
73
74void nvgpu_clk_arb_schedule_vf_table_update(struct gk20a *g);
75
76int nvgpu_clk_arb_get_current_pstate(struct gk20a *g);
77
78void nvgpu_clk_arb_pstate_change_lock(struct gk20a *g, bool lock);
79
80void nvgpu_clk_arb_schedule_alarm(struct gk20a *g, u32 alarm);
81#endif /* __NVGPU_CLK_ARB_H__ */
82
diff --git a/drivers/gpu/nvgpu/include/nvgpu/comptags.h b/drivers/gpu/nvgpu/include/nvgpu/comptags.h
new file mode 100644
index 00000000..679a0f9e
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/comptags.h
@@ -0,0 +1,97 @@
1/*
2* Copyright (c) 2017, 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#ifndef __NVGPU_COMPTAGS__
18#define __NVGPU_COMPTAGS__
19
20#include <nvgpu/lock.h>
21
22struct gk20a;
23struct nvgpu_os_buffer;
24
25struct gk20a_comptags {
26 u32 offset;
27 u32 lines;
28
29 /*
30 * This signals whether allocation has been attempted. Observe 'lines'
31 * to see whether the comptags were actually allocated. We try alloc
32 * only once per buffer in order not to break multiple compressible-kind
33 * mappings.
34 */
35 bool allocated;
36
37 /*
38 * Do comptags need to be cleared before mapping?
39 */
40 bool needs_clear;
41};
42
43struct gk20a_comptag_allocator {
44 struct gk20a *g;
45
46 struct nvgpu_mutex lock;
47
48 /* This bitmap starts at ctag 1. 0th cannot be taken. */
49 unsigned long *bitmap;
50
51 /* Size of bitmap, not max ctags, so one less. */
52 unsigned long size;
53};
54
55/* real size here, but first (ctag 0) isn't used */
56int gk20a_comptag_allocator_init(struct gk20a *g,
57 struct gk20a_comptag_allocator *allocator,
58 unsigned long size);
59void gk20a_comptag_allocator_destroy(struct gk20a *g,
60 struct gk20a_comptag_allocator *allocator);
61
62int gk20a_comptaglines_alloc(struct gk20a_comptag_allocator *allocator,
63 u32 *offset, u32 len);
64void gk20a_comptaglines_free(struct gk20a_comptag_allocator *allocator,
65 u32 offset, u32 len);
66
67/*
68 * Defined by OS specific code since comptags are stored in a highly OS specific
69 * way.
70 */
71int gk20a_alloc_or_get_comptags(struct gk20a *g,
72 struct nvgpu_os_buffer *buf,
73 struct gk20a_comptag_allocator *allocator,
74 struct gk20a_comptags *comptags);
75void gk20a_get_comptags(struct nvgpu_os_buffer *buf,
76 struct gk20a_comptags *comptags);
77
78/*
79 * These functions must be used to synchronize comptags clear. The usage:
80 *
81 * if (gk20a_comptags_start_clear(os_buf)) {
82 * // we now hold the buffer lock for clearing
83 *
84 * bool successful = hw_clear_comptags();
85 *
86 * // mark the buf cleared (or not) and release the buffer lock
87 * gk20a_comptags_finish_clear(os_buf, successful);
88 * }
89 *
90 * If gk20a_start_comptags_clear() returns false, another caller has
91 * already cleared the comptags.
92 */
93bool gk20a_comptags_start_clear(struct nvgpu_os_buffer *buf);
94void gk20a_comptags_finish_clear(struct nvgpu_os_buffer *buf,
95 bool clear_successful);
96
97#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/cond.h b/drivers/gpu/nvgpu/include/nvgpu/cond.h
new file mode 100644
index 00000000..b6f2598e
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/cond.h
@@ -0,0 +1,104 @@
1/*
2 * Copyright (c) 2017, 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#ifndef __NVGPU_COND_H__
24#define __NVGPU_COND_H__
25
26#ifdef __KERNEL__
27#include <nvgpu/linux/cond.h>
28#else
29#include <nvgpu_rmos/include/cond.h>
30#endif
31
32/*
33 * struct nvgpu_cond
34 *
35 * Should be implemented per-OS in a separate library
36 */
37struct nvgpu_cond;
38
39/**
40 * nvgpu_cond_init - Initialize a condition variable
41 *
42 * @cond - The condition variable to initialize
43 *
44 * Initialize a condition variable before using it.
45 */
46int nvgpu_cond_init(struct nvgpu_cond *cond);
47
48/**
49 * nvgpu_cond_signal - Signal a condition variable
50 *
51 * @cond - The condition variable to signal
52 *
53 * Wake up a waiter for a condition variable to check if its condition has been
54 * satisfied.
55 *
56 * The waiter is using an uninterruptible wait.
57 */
58int nvgpu_cond_signal(struct nvgpu_cond *cond);
59
60/**
61 * nvgpu_cond_signal_interruptible - Signal a condition variable
62 *
63 * @cond - The condition variable to signal
64 *
65 * Wake up a waiter for a condition variable to check if its condition has been
66 * satisfied.
67 *
68 * The waiter is using an interruptible wait.
69 */
70int nvgpu_cond_signal_interruptible(struct nvgpu_cond *cond);
71
72/**
73 * nvgpu_cond_broadcast - Signal all waiters of a condition variable
74 *
75 * @cond - The condition variable to signal
76 *
77 * Wake up all waiters for a condition variable to check if their conditions
78 * have been satisfied.
79 *
80 * The waiters are using an uninterruptible wait.
81 */
82int nvgpu_cond_broadcast(struct nvgpu_cond *cond);
83
84/**
85 * nvgpu_cond_broadcast_interruptible - Signal all waiters of a condition
86 * variable
87 *
88 * @cond - The condition variable to signal
89 *
90 * Wake up all waiters for a condition variable to check if their conditions
91 * have been satisfied.
92 *
93 * The waiters are using an interruptible wait.
94 */
95int nvgpu_cond_broadcast_interruptible(struct nvgpu_cond *cond);
96
97/**
98 * nvgpu_cond_destroy - Destroy a condition variable
99 *
100 * @cond - The condition variable to destroy
101 */
102void nvgpu_cond_destroy(struct nvgpu_cond *cond);
103
104#endif /* __NVGPU_COND_H__ */
diff --git a/drivers/gpu/nvgpu/include/nvgpu/ctxsw_trace.h b/drivers/gpu/nvgpu/include/nvgpu/ctxsw_trace.h
new file mode 100644
index 00000000..cc6edb49
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/ctxsw_trace.h
@@ -0,0 +1,53 @@
1/*
2 * Copyright (c) 2017, 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#ifndef __NVGPU_CTXSW_TRACE_H__
24#define __NVGPU_CTXSW_TRACE_H__
25
26#include <nvgpu/types.h>
27
28struct gk20a;
29struct tsg_gk20a;
30struct channel_gk20a;
31struct nvgpu_ctxsw_trace_entry;
32
33int gk20a_ctxsw_trace_init(struct gk20a *g);
34
35void gk20a_ctxsw_trace_channel_reset(struct gk20a *g, struct channel_gk20a *ch);
36void gk20a_ctxsw_trace_tsg_reset(struct gk20a *g, struct tsg_gk20a *tsg);
37
38void gk20a_ctxsw_trace_cleanup(struct gk20a *g);
39int gk20a_ctxsw_trace_write(struct gk20a *g,
40 struct nvgpu_ctxsw_trace_entry *entry);
41void gk20a_ctxsw_trace_wake_up(struct gk20a *g, int vmid);
42
43#ifdef CONFIG_GK20A_CTXSW_TRACE
44struct file;
45struct vm_area_struct;
46
47int gk20a_ctxsw_dev_mmap(struct file *filp, struct vm_area_struct *vma);
48int gk20a_ctxsw_dev_ring_alloc(struct gk20a *g, void **buf, size_t *size);
49int gk20a_ctxsw_dev_ring_free(struct gk20a *g);
50int gk20a_ctxsw_dev_mmap_buffer(struct gk20a *g, struct vm_area_struct *vma);
51#endif
52
53#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/debug.h b/drivers/gpu/nvgpu/include/nvgpu/debug.h
new file mode 100644
index 00000000..c2811319
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/debug.h
@@ -0,0 +1,59 @@
1/*
2 * GK20A Debug functionality
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#ifndef __NVGPU_DEBUG_H__
24#define __NVGPU_DEBUG_H__
25
26struct gk20a;
27struct gpu_ops;
28
29struct gk20a_debug_output {
30 void (*fn)(void *ctx, const char *str, size_t len);
31 void *ctx;
32 char buf[256];
33};
34
35#ifdef CONFIG_DEBUG_FS
36extern unsigned int gk20a_debug_trace_cmdbuf;
37
38void gk20a_debug_output(struct gk20a_debug_output *o,
39 const char *fmt, ...);
40
41void gk20a_debug_dump(struct gk20a *g);
42void gk20a_debug_show_dump(struct gk20a *g, struct gk20a_debug_output *o);
43int gk20a_gr_debug_dump(struct gk20a *g);
44void gk20a_init_debug_ops(struct gpu_ops *gops);
45
46void gk20a_debug_init(struct gk20a *g, const char *debugfs_symlink);
47void gk20a_debug_deinit(struct gk20a *g);
48#else
49static inline void gk20a_debug_output(struct gk20a_debug_output *o,
50 const char *fmt, ...) {}
51
52static inline void gk20a_debug_dump(struct gk20a *g) {}
53static inline void gk20a_debug_show_dump(struct gk20a *g, struct gk20a_debug_output *o) {}
54static inline int gk20a_gr_debug_dump(struct gk20a *g) { return 0;}
55static inline void gk20a_debug_init(struct gk20a *g, const char *debugfs_symlink) {}
56static inline void gk20a_debug_deinit(struct gk20a *g) {}
57#endif
58
59#endif /* __NVGPU_DEBUG_H__ */
diff --git a/drivers/gpu/nvgpu/include/nvgpu/dma.h b/drivers/gpu/nvgpu/include/nvgpu/dma.h
new file mode 100644
index 00000000..c0397b58
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/dma.h
@@ -0,0 +1,337 @@
1/*
2 * Copyright (c) 2017, 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#ifndef __NVGPU_DMA_H__
24#define __NVGPU_DMA_H__
25
26#include <nvgpu/types.h>
27
28struct gk20a;
29struct vm_gk20a;
30struct nvgpu_mem;
31
32/*
33 * Flags for the below nvgpu_dma_{alloc,alloc_map}_flags*
34 */
35
36/*
37 * Don't create a virtual kernel mapping for the buffer but only allocate it;
38 * this may save some resources. The buffer can be mapped later explicitly.
39 */
40#define NVGPU_DMA_NO_KERNEL_MAPPING (1 << 0)
41
42/*
43 * Don't allow building the buffer from individual pages but require a
44 * physically contiguous block.
45 */
46#define NVGPU_DMA_FORCE_CONTIGUOUS (1 << 1)
47
48/*
49 * Make the mapping read-only.
50 */
51#define NVGPU_DMA_READ_ONLY (1 << 2)
52
53/**
54 * nvgpu_iommuable - Check if GPU is behind IOMMU
55 *
56 * @g - The GPU.
57 *
58 * Returns true if the passed GPU is behind an IOMMU; false otherwise. If the
59 * GPU is iommuable then the DMA address in nvgpu_mem_sgl is valid.
60 *
61 * Note that even if a GPU is behind an IOMMU that does not necessarily mean the
62 * GPU _must_ use DMA addresses. GPUs may still use physical addresses if it
63 * makes sense.
64 */
65bool nvgpu_iommuable(struct gk20a *g);
66
67/**
68 * nvgpu_dma_alloc - Allocate DMA memory
69 *
70 * @g - The GPU.
71 * @size - Size of the allocation in bytes.
72 * @mem - Struct for storing the allocation information.
73 *
74 * Allocate memory suitable for doing DMA. Store the allocation info in @mem.
75 * Returns 0 on success and a suitable error code when there's an error. This
76 * memory can be either placed in VIDMEM or SYSMEM, which ever is more
77 * convenient for the driver.
78 */
79int nvgpu_dma_alloc(struct gk20a *g, size_t size, struct nvgpu_mem *mem);
80
81/**
82 * nvgpu_dma_alloc_flags - Allocate DMA memory
83 *
84 * @g - The GPU.
85 * @flags - Flags modifying the operation of the DMA allocation.
86 * @size - Size of the allocation in bytes.
87 * @mem - Struct for storing the allocation information.
88 *
89 * Allocate memory suitable for doing DMA. Store the allocation info in @mem.
90 * Returns 0 on success and a suitable error code when there's an error. This
91 * memory can be either placed in VIDMEM or SYSMEM, which ever is more
92 * convenient for the driver.
93 *
94 * The following flags are accepted:
95 *
96 * %NVGPU_DMA_NO_KERNEL_MAPPING
97 * %NVGPU_DMA_FORCE_CONTIGUOUS
98 * %NVGPU_DMA_READ_ONLY
99 */
100int nvgpu_dma_alloc_flags(struct gk20a *g, unsigned long flags, size_t size,
101 struct nvgpu_mem *mem);
102
103/**
104 * nvgpu_dma_alloc_sys - Allocate DMA memory
105 *
106 * @g - The GPU.
107 * @size - Size of the allocation in bytes.
108 * @mem - Struct for storing the allocation information.
109 *
110 * Allocate memory suitable for doing DMA. Store the allocation info in @mem.
111 * Returns 0 on success and a suitable error code when there's an error. This
112 * allocates memory specifically in SYSMEM.
113 */
114int nvgpu_dma_alloc_sys(struct gk20a *g, size_t size, struct nvgpu_mem *mem);
115
116/**
117 * nvgpu_dma_alloc_flags_sys - Allocate DMA memory
118 *
119 * @g - The GPU.
120 * @flags - Flags modifying the operation of the DMA allocation.
121 * @size - Size of the allocation in bytes.
122 * @mem - Struct for storing the allocation information.
123 *
124 * Allocate memory suitable for doing DMA. Store the allocation info in @mem.
125 * Returns 0 on success and a suitable error code when there's an error. This
126 * allocates memory specifically in SYSMEM.
127 *
128 * The following flags are accepted:
129 *
130 * %NVGPU_DMA_NO_KERNEL_MAPPING
131 * %NVGPU_DMA_FORCE_CONTIGUOUS
132 * %NVGPU_DMA_READ_ONLY
133 */
134int nvgpu_dma_alloc_flags_sys(struct gk20a *g, unsigned long flags,
135 size_t size, struct nvgpu_mem *mem);
136
137/**
138 * nvgpu_dma_alloc_vid - Allocate DMA memory
139 *
140 * @g - The GPU.
141 * @size - Size of the allocation in bytes.
142 * @mem - Struct for storing the allocation information.
143 *
144 * Allocate memory suitable for doing DMA. Store the allocation info in @mem.
145 * Returns 0 on success and a suitable error code when there's an error. This
146 * allocates memory specifically in VIDMEM.
147 */
148int nvgpu_dma_alloc_vid(struct gk20a *g, size_t size, struct nvgpu_mem *mem);
149
150/**
151 * nvgpu_dma_alloc_flags_vid - Allocate DMA memory
152 *
153 * @g - The GPU.
154 * @flags - Flags modifying the operation of the DMA allocation.
155 * @size - Size of the allocation in bytes.
156 * @mem - Struct for storing the allocation information.
157 *
158 * Allocate memory suitable for doing DMA. Store the allocation info in @mem.
159 * Returns 0 on success and a suitable error code when there's an error. This
160 * allocates memory specifically in VIDMEM.
161 *
162 * Only the following flags are accepted:
163 *
164 * %NVGPU_DMA_NO_KERNEL_MAPPING
165 *
166 */
167int nvgpu_dma_alloc_flags_vid(struct gk20a *g, unsigned long flags,
168 size_t size, struct nvgpu_mem *mem);
169
170/**
171 * nvgpu_dma_alloc_flags_vid_at - Allocate DMA memory
172 *
173 * @g - The GPU.
174 * @flags - Flags modifying the operation of the DMA allocation.
175 * @size - Size of the allocation in bytes.
176 * @mem - Struct for storing the allocation information.
177 * @at - A specific location to attempt to allocate memory from or 0 if the
178 * caller does not care what the address is.
179 *
180 * Allocate memory suitable for doing DMA. Store the allocation info in @mem.
181 * Returns 0 on success and a suitable error code when there's an error. This
182 * allocates memory specifically in VIDMEM.
183 *
184 * Only the following flags are accepted:
185 *
186 * %NVGPU_DMA_NO_KERNEL_MAPPING
187 */
188int nvgpu_dma_alloc_flags_vid_at(struct gk20a *g, unsigned long flags,
189 size_t size, struct nvgpu_mem *mem, u64 at);
190
191/**
192 * nvgpu_dma_free - Free a DMA allocation
193 *
194 * @g - The GPU.
195 * @mem - An allocation to free.
196 *
197 * Free memory created with any of:
198 *
199 * nvgpu_dma_alloc()
200 * nvgpu_dma_alloc_flags()
201 * nvgpu_dma_alloc_sys()
202 * nvgpu_dma_alloc_flags_sys()
203 * nvgpu_dma_alloc_vid()
204 * nvgpu_dma_alloc_flags_vid()
205 * nvgpu_dma_alloc_flags_vid_at()
206 */
207void nvgpu_dma_free(struct gk20a *g, struct nvgpu_mem *mem);
208
209/**
210 * nvgpu_dma_alloc_map - Allocate DMA memory and map into GMMU.
211 *
212 * @vm - VM context for GMMU mapping.
213 * @size - Size of the allocation in bytes.
214 * @mem - Struct for storing the allocation information.
215 *
216 * Allocate memory suitable for doing DMA and map that memory into the GMMU.
217 * Note this is different than mapping it into the CPU. This memory can be
218 * either placed in VIDMEM or SYSMEM, which ever is more convenient for the
219 * driver.
220 *
221 * Note: currently a bug exists in the nvgpu_dma_alloc_map*() routines: you
222 * cannot use nvgpu_gmmu_map() on said buffer - it will overwrite the necessary
223 * information for the DMA unmap routines to actually unmap the buffer. You
224 * will either leak mappings or see GMMU faults.
225 */
226int nvgpu_dma_alloc_map(struct vm_gk20a *vm, size_t size,
227 struct nvgpu_mem *mem);
228
229/**
230 * nvgpu_dma_alloc_map_flags - Allocate DMA memory and map into GMMU.
231 *
232 * @vm - VM context for GMMU mapping.
233 * @flags - Flags modifying the operation of the DMA allocation.
234 * @size - Size of the allocation in bytes.
235 * @mem - Struct for storing the allocation information.
236 *
237 * Allocate memory suitable for doing DMA and map that memory into the GMMU.
238 * Note this is different than mapping it into the CPU. This memory can be
239 * either placed in VIDMEM or SYSMEM, which ever is more convenient for the
240 * driver.
241 *
242 * This version passes @flags on to the underlying DMA allocation. The accepted
243 * flags are:
244 *
245 * %NVGPU_DMA_NO_KERNEL_MAPPING
246 * %NVGPU_DMA_FORCE_CONTIGUOUS
247 * %NVGPU_DMA_READ_ONLY
248 */
249int nvgpu_dma_alloc_map_flags(struct vm_gk20a *vm, unsigned long flags,
250 size_t size, struct nvgpu_mem *mem);
251
252/**
253 * nvgpu_dma_alloc_map_sys - Allocate DMA memory and map into GMMU.
254 *
255 * @vm - VM context for GMMU mapping.
256 * @size - Size of the allocation in bytes.
257 * @mem - Struct for storing the allocation information.
258 *
259 * Allocate memory suitable for doing DMA and map that memory into the GMMU.
260 * This memory will be placed in SYSMEM.
261 */
262int nvgpu_dma_alloc_map_sys(struct vm_gk20a *vm, size_t size,
263 struct nvgpu_mem *mem);
264
265/**
266 * nvgpu_dma_alloc_map_flags_sys - Allocate DMA memory and map into GMMU.
267 *
268 * @vm - VM context for GMMU mapping.
269 * @flags - Flags modifying the operation of the DMA allocation.
270 * @size - Size of the allocation in bytes.
271 * @mem - Struct for storing the allocation information.
272 *
273 * Allocate memory suitable for doing DMA and map that memory into the GMMU.
274 * This memory will be placed in SYSMEM.
275 *
276 * This version passes @flags on to the underlying DMA allocation. The accepted
277 * flags are:
278 *
279 * %NVGPU_DMA_NO_KERNEL_MAPPING
280 * %NVGPU_DMA_FORCE_CONTIGUOUS
281 * %NVGPU_DMA_READ_ONLY
282 */
283int nvgpu_dma_alloc_map_flags_sys(struct vm_gk20a *vm, unsigned long flags,
284 size_t size, struct nvgpu_mem *mem);
285
286/**
287 * nvgpu_dma_alloc_map_vid - Allocate DMA memory and map into GMMU.
288 *
289 * @vm - VM context for GMMU mapping.
290 * @size - Size of the allocation in bytes.
291 * @mem - Struct for storing the allocation information.
292 *
293 * Allocate memory suitable for doing DMA and map that memory into the GMMU.
294 * This memory will be placed in VIDMEM.
295 */
296int nvgpu_dma_alloc_map_vid(struct vm_gk20a *vm, size_t size,
297 struct nvgpu_mem *mem);
298
299/**
300 * nvgpu_dma_alloc_map_flags_vid - Allocate DMA memory and map into GMMU.
301 *
302 * @vm - VM context for GMMU mapping.
303 * @flags - Flags modifying the operation of the DMA allocation.
304 * @size - Size of the allocation in bytes.
305 * @mem - Struct for storing the allocation information.
306 *
307 * Allocate memory suitable for doing DMA and map that memory into the GMMU.
308 * This memory will be placed in VIDMEM.
309 *
310 * This version passes @flags on to the underlying DMA allocation. The accepted
311 * flags are:
312 *
313 * %NVGPU_DMA_NO_KERNEL_MAPPING
314 * %NVGPU_DMA_FORCE_CONTIGUOUS
315 * %NVGPU_DMA_READ_ONLY
316 */
317int nvgpu_dma_alloc_map_flags_vid(struct vm_gk20a *vm, unsigned long flags,
318 size_t size, struct nvgpu_mem *mem);
319
320/**
321 * nvgpu_dma_unmap_free - Free a DMA allocation
322 *
323 * @g - The GPU.
324 * @mem - An allocation to free.
325 *
326 * Free memory created with any of:
327 *
328 * nvgpu_dma_alloc_map()
329 * nvgpu_dma_alloc_map_flags()
330 * nvgpu_dma_alloc_map_sys()
331 * nvgpu_dma_alloc_map_flags_sys()
332 * nvgpu_dma_alloc_map_vid()
333 * nvgpu_dma_alloc_map_flags_vid()
334 */
335void nvgpu_dma_unmap_free(struct vm_gk20a *vm, struct nvgpu_mem *mem);
336
337#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/enabled.h b/drivers/gpu/nvgpu/include/nvgpu/enabled.h
new file mode 100644
index 00000000..ad5b3db3
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/enabled.h
@@ -0,0 +1,164 @@
1/*
2 * Copyright (c) 2017, 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#ifndef __NVGPU_ENABLED_H__
24#define __NVGPU_ENABLED_H__
25
26struct gk20a;
27
28#include <nvgpu/types.h>
29
30/*
31 * Available flags that describe what's enabled and what's not in the GPU. Each
32 * flag here is defined by it's offset in a bitmap.
33 */
34#define NVGPU_IS_FMODEL 1
35#define NVGPU_DRIVER_IS_DYING 2
36#define NVGPU_GR_USE_DMA_FOR_FW_BOOTSTRAP 3
37
38/*
39 * ECC flags
40 */
41/* SM LRF ECC is enabled */
42#define NVGPU_ECC_ENABLED_SM_LRF 8
43/* SM SHM ECC is enabled */
44#define NVGPU_ECC_ENABLED_SM_SHM 9
45/* TEX ECC is enabled */
46#define NVGPU_ECC_ENABLED_TEX 10
47/* L2 ECC is enabled */
48#define NVGPU_ECC_ENABLED_LTC 11
49/*
50 * MM flags.
51 */
52#define NVGPU_MM_UNIFY_ADDRESS_SPACES 16
53/* false if vidmem aperture actually points to sysmem */
54#define NVGPU_MM_HONORS_APERTURE 17
55/* unified or split memory with separate vidmem? */
56#define NVGPU_MM_UNIFIED_MEMORY 18
57/* kernel mode ce vidmem clearing channels need to be in a tsg */
58#define NVGPU_MM_CE_TSG_REQUIRED 19
59/* User-space managed address spaces support */
60#define NVGPU_SUPPORT_USERSPACE_MANAGED_AS 20
61/* IO coherence support is available */
62#define NVGPU_SUPPORT_IO_COHERENCE 21
63/* MAP_BUFFER_EX with partial mappings */
64#define NVGPU_SUPPORT_PARTIAL_MAPPINGS 22
65/* MAP_BUFFER_EX with sparse allocations */
66#define NVGPU_SUPPORT_SPARSE_ALLOCS 23
67/* Direct PTE kind control is supported (map_buffer_ex) */
68#define NVGPU_SUPPORT_MAP_DIRECT_KIND_CTRL 24
69/* Support batch mapping */
70#define NVGPU_SUPPORT_MAP_BUFFER_BATCH 25
71
72/*
73 * Host flags
74 */
75#define NVGPU_HAS_SYNCPOINTS 30
76/* sync fence FDs are available in, e.g., submit_gpfifo */
77#define NVGPU_SUPPORT_SYNC_FENCE_FDS 31
78/* NVGPU_IOCTL_CHANNEL_CYCLE_STATS is available */
79#define NVGPU_SUPPORT_CYCLE_STATS 32
80/* NVGPU_IOCTL_CHANNEL_CYCLE_STATS_SNAPSHOT is available */
81#define NVGPU_SUPPORT_CYCLE_STATS_SNAPSHOT 33
82/* Both gpu driver and device support TSG */
83#define NVGPU_SUPPORT_TSG 34
84/* Fast deterministic submits with no job tracking are supported */
85#define NVGPU_SUPPORT_DETERMINISTIC_SUBMIT_NO_JOBTRACKING 35
86/* Deterministic submits are supported even with job tracking */
87#define NVGPU_SUPPORT_DETERMINISTIC_SUBMIT_FULL 36
88/* NVGPU_SUBMIT_GPFIFO_FLAGS_RESCHEDULE_RUNLIST is available */
89#define NVGPU_SUPPORT_RESCHEDULE_RUNLIST 37
90
91/* NVGPU_GPU_IOCTL_GET_EVENT_FD is available */
92#define NVGPU_SUPPORT_DEVICE_EVENTS 38
93/* FECS context switch tracing is available */
94#define NVGPU_SUPPORT_FECS_CTXSW_TRACE 39
95
96/* NVGPU_GPU_IOCTL_SET_DETERMINISTIC_OPTS is available */
97#define NVGPU_SUPPORT_DETERMINISTIC_OPTS 40
98
99/*
100 * Security flags
101 */
102
103#define NVGPU_SEC_SECUREGPCCS 41
104#define NVGPU_SEC_PRIVSECURITY 42
105
106/*
107 * PMU flags.
108 */
109/* perfmon enabled or disabled for PMU */
110#define NVGPU_PMU_PERFMON 48
111#define NVGPU_PMU_PSTATE 49
112#define NVGPU_PMU_ZBC_SAVE 50
113#define NVGPU_PMU_FECS_BOOTSTRAP_DONE 51
114#define NVGPU_GPU_CAN_BLCG 52
115#define NVGPU_GPU_CAN_SLCG 53
116#define NVGPU_GPU_CAN_ELCG 54
117/* Clock control support */
118#define NVGPU_SUPPORT_CLOCK_CONTROLS 55
119/* NVGPU_GPU_IOCTL_GET_VOLTAGE is available */
120#define NVGPU_SUPPORT_GET_VOLTAGE 56
121/* NVGPU_GPU_IOCTL_GET_CURRENT is available */
122#define NVGPU_SUPPORT_GET_CURRENT 57
123/* NVGPU_GPU_IOCTL_GET_POWER is available */
124#define NVGPU_SUPPORT_GET_POWER 58
125/* NVGPU_GPU_IOCTL_GET_TEMPERATURE is available */
126#define NVGPU_SUPPORT_GET_TEMPERATURE 59
127/* NVGPU_GPU_IOCTL_SET_THERM_ALERT_LIMIT is available */
128#define NVGPU_SUPPORT_SET_THERM_ALERT_LIMIT 60
129
130/* whether to run PREOS binary on dGPUs */
131#define NVGPU_PMU_RUN_PREOS 61
132
133/* set if ASPM is enabled; only makes sense for PCI */
134#define NVGPU_SUPPORT_ASPM 62
135/*
136 * Must be greater than the largest bit offset in the above list.
137 */
138#define NVGPU_MAX_ENABLED_BITS 64
139
140/**
141 * nvgpu_is_enabled - Check if the passed flag is enabled.
142 *
143 * @g - The GPU.
144 * @flag - Which flag to check.
145 *
146 * Returns true if the passed @flag is true; false otherwise.
147 */
148bool nvgpu_is_enabled(struct gk20a *g, int flag);
149
150/**
151 * __nvgpu_set_enabled - Set the state of a flag.
152 *
153 * @g - The GPU.
154 * @flag - Which flag to modify.
155 * @state - The state to set the flag to.
156 *
157 * Set the state of the passed @flag to @state. This will return the previous
158 * state of the passed @flag.
159 */
160bool __nvgpu_set_enabled(struct gk20a *g, int flag, bool state);
161
162int nvgpu_init_enabled_flags(struct gk20a *g);
163
164#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/errno.h b/drivers/gpu/nvgpu/include/nvgpu/errno.h
new file mode 100644
index 00000000..12ba118e
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/errno.h
@@ -0,0 +1,41 @@
1/*
2 * Copyright (c) 2017, 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#ifndef __NVGPU_ERRNO_H__
24#define __NVGPU_ERRNO_H__
25
26/*
27 * Explicit include to get all the -E* error messages. Useful for header files
28 * with static inlines that return error messages. In actual C code normally
29 * enough Linux/QNX headers bleed in to get the error messages but header files
30 * with sparse includes do not have this luxury.
31 */
32
33#ifdef __KERNEL__
34#include <linux/errno.h>
35#endif
36
37/*
38 * TODO: add else path above for QNX.
39 */
40
41#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/falcon.h b/drivers/gpu/nvgpu/include/nvgpu/falcon.h
new file mode 100644
index 00000000..4be16576
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/falcon.h
@@ -0,0 +1,248 @@
1/*
2 * Copyright (c) 2017, 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#ifndef __FALCON_H__
24#define __FALCON_H__
25
26#include <nvgpu/types.h>
27#include <nvgpu/lock.h>
28
29/*
30 * Falcon Id Defines
31 */
32#define FALCON_ID_PMU (0)
33#define FALCON_ID_FECS (2)
34#define FALCON_ID_GPCCS (3)
35#define FALCON_ID_NVDEC (4)
36#define FALCON_ID_SEC2 (7)
37
38/*
39 * Falcon Base address Defines
40 */
41#define FALCON_NVDEC_BASE 0x00084000
42#define FALCON_PWR_BASE 0x0010a000
43#define FALCON_SEC_BASE 0x00087000
44#define FALCON_FECS_BASE 0x00409000
45#define FALCON_GPCCS_BASE 0x0041a000
46
47/* Falcon Register index */
48#define FALCON_REG_R0 (0)
49#define FALCON_REG_R1 (1)
50#define FALCON_REG_R2 (2)
51#define FALCON_REG_R3 (3)
52#define FALCON_REG_R4 (4)
53#define FALCON_REG_R5 (5)
54#define FALCON_REG_R6 (6)
55#define FALCON_REG_R7 (7)
56#define FALCON_REG_R8 (8)
57#define FALCON_REG_R9 (9)
58#define FALCON_REG_R10 (10)
59#define FALCON_REG_R11 (11)
60#define FALCON_REG_R12 (12)
61#define FALCON_REG_R13 (13)
62#define FALCON_REG_R14 (14)
63#define FALCON_REG_R15 (15)
64#define FALCON_REG_IV0 (16)
65#define FALCON_REG_IV1 (17)
66#define FALCON_REG_UNDEFINED (18)
67#define FALCON_REG_EV (19)
68#define FALCON_REG_SP (20)
69#define FALCON_REG_PC (21)
70#define FALCON_REG_IMB (22)
71#define FALCON_REG_DMB (23)
72#define FALCON_REG_CSW (24)
73#define FALCON_REG_CCR (25)
74#define FALCON_REG_SEC (26)
75#define FALCON_REG_CTX (27)
76#define FALCON_REG_EXCI (28)
77#define FALCON_REG_RSVD0 (29)
78#define FALCON_REG_RSVD1 (30)
79#define FALCON_REG_RSVD2 (31)
80#define FALCON_REG_SIZE (32)
81
82#define FALCON_MAILBOX_COUNT 0x02
83#define FALCON_BLOCK_SIZE 0x100
84
85#define GET_IMEM_TAG(IMEM_ADDR) (IMEM_ADDR >> 8)
86
87#define GET_NEXT_BLOCK(ADDR) \
88 ((((ADDR + (FALCON_BLOCK_SIZE - 1)) & ~(FALCON_BLOCK_SIZE-1)) \
89 / FALCON_BLOCK_SIZE) << 8)
90
91/*
92 * Falcon HWCFG request read types defines
93 */
94enum flcn_hwcfg_read {
95 FALCON_IMEM_SIZE = 0,
96 FALCON_DMEM_SIZE,
97 FALCON_CORE_REV,
98 FALCON_SECURITY_MODEL,
99 FLACON_MAILBOX_COUNT
100};
101
102/*
103 * Falcon HWCFG request write types defines
104 */
105enum flcn_hwcfg_write {
106 FALCON_STARTCPU = 0,
107 FALCON_STARTCPU_SECURE,
108 FALCON_BOOTVEC,
109 FALCON_ITF_EN
110};
111
112#define FALCON_MEM_SCRUBBING_TIMEOUT_MAX 1000
113#define FALCON_MEM_SCRUBBING_TIMEOUT_DEFAULT 10
114
115enum flcn_dma_dir {
116 DMA_TO_FB = 0,
117 DMA_FROM_FB
118};
119
120enum flcn_mem_type {
121 MEM_DMEM = 0,
122 MEM_IMEM
123};
124
125/* Falcon ucode header format
126 * OS Code Offset
127 * OS Code Size
128 * OS Data Offset
129 * OS Data Size
130 * NumApps (N)
131 * App 0 Code Offset
132 * App 0 Code Size
133 * . . . .
134 * App N - 1 Code Offset
135 * App N - 1 Code Size
136 * App 0 Data Offset
137 * App 0 Data Size
138 * . . . .
139 * App N - 1 Data Offset
140 * App N - 1 Data Size
141 * OS Ovl Offset
142 * OS Ovl Size
143*/
144#define OS_CODE_OFFSET 0x0
145#define OS_CODE_SIZE 0x1
146#define OS_DATA_OFFSET 0x2
147#define OS_DATA_SIZE 0x3
148#define NUM_APPS 0x4
149#define APP_0_CODE_OFFSET 0x5
150#define APP_0_CODE_SIZE 0x6
151
152struct nvgpu_falcon_dma_info {
153 u32 fb_base;
154 u32 fb_off;
155 u32 flcn_mem_off;
156 u32 size_in_bytes;
157 enum flcn_dma_dir dir;
158 u32 ctx_dma;
159 enum flcn_mem_type flcn_mem;
160 u32 is_wait_complete;
161};
162
163struct gk20a;
164struct nvgpu_falcon;
165
166struct nvgpu_falcon_version_ops {
167 void (*start_cpu_secure)(struct nvgpu_falcon *flcn);
168 void (*write_dmatrfbase)(struct nvgpu_falcon *flcn, u32 addr);
169};
170
171/* ops which are falcon engine specific */
172struct nvgpu_falcon_engine_dependency_ops {
173 int (*reset_eng)(struct gk20a *g);
174};
175
176struct nvgpu_falcon_ops {
177 int (*reset)(struct nvgpu_falcon *flcn);
178 void (*set_irq)(struct nvgpu_falcon *flcn, bool enable);
179 bool (*clear_halt_interrupt_status)(struct nvgpu_falcon *flcn);
180 bool (*is_falcon_cpu_halted)(struct nvgpu_falcon *flcn);
181 bool (*is_falcon_idle)(struct nvgpu_falcon *flcn);
182 bool (*is_falcon_scrubbing_done)(struct nvgpu_falcon *flcn);
183 int (*copy_from_dmem)(struct nvgpu_falcon *flcn, u32 src, u8 *dst,
184 u32 size, u8 port);
185 int (*copy_to_dmem)(struct nvgpu_falcon *flcn, u32 dst, u8 *src,
186 u32 size, u8 port);
187 int (*copy_from_imem)(struct nvgpu_falcon *flcn, u32 src, u8 *dst,
188 u32 size, u8 port);
189 int (*copy_to_imem)(struct nvgpu_falcon *flcn, u32 dst, u8 *src,
190 u32 size, u8 port, bool sec, u32 tag);
191 int (*dma_copy)(struct nvgpu_falcon *flcn,
192 struct nvgpu_falcon_dma_info *dma_info);
193 u32 (*mailbox_read)(struct nvgpu_falcon *flcn, u32 mailbox_index);
194 void (*mailbox_write)(struct nvgpu_falcon *flcn, u32 mailbox_index,
195 u32 data);
196 int (*bootstrap)(struct nvgpu_falcon *flcn, u32 boot_vector);
197 void (*dump_falcon_stats)(struct nvgpu_falcon *flcn);
198};
199
200struct nvgpu_falcon {
201 struct gk20a *g;
202 u32 flcn_id;
203 u32 flcn_base;
204 u32 flcn_core_rev;
205 bool is_falcon_supported;
206 bool is_interrupt_enabled;
207 u32 intr_mask;
208 u32 intr_dest;
209 bool isr_enabled;
210 struct nvgpu_mutex isr_mutex;
211 struct nvgpu_mutex copy_lock;
212 struct nvgpu_falcon_ops flcn_ops;
213 struct nvgpu_falcon_version_ops flcn_vops;
214 struct nvgpu_falcon_engine_dependency_ops flcn_engine_dep_ops;
215};
216
217int nvgpu_flcn_wait_idle(struct nvgpu_falcon *flcn);
218int nvgpu_flcn_wait_for_halt(struct nvgpu_falcon *flcn, unsigned int timeout);
219int nvgpu_flcn_clear_halt_intr_status(struct nvgpu_falcon *flcn,
220 unsigned int timeout);
221int nvgpu_flcn_reset(struct nvgpu_falcon *flcn);
222void nvgpu_flcn_set_irq(struct nvgpu_falcon *flcn, bool enable,
223 u32 intr_mask, u32 intr_dest);
224bool nvgpu_flcn_get_mem_scrubbing_status(struct nvgpu_falcon *flcn);
225bool nvgpu_flcn_get_cpu_halted_status(struct nvgpu_falcon *flcn);
226bool nvgpu_flcn_get_idle_status(struct nvgpu_falcon *flcn);
227int nvgpu_flcn_copy_from_dmem(struct nvgpu_falcon *flcn,
228 u32 src, u8 *dst, u32 size, u8 port);
229int nvgpu_flcn_copy_to_dmem(struct nvgpu_falcon *flcn,
230 u32 dst, u8 *src, u32 size, u8 port);
231int nvgpu_flcn_copy_to_imem(struct nvgpu_falcon *flcn,
232 u32 dst, u8 *src, u32 size, u8 port, bool sec, u32 tag);
233int nvgpu_flcn_copy_from_imem(struct nvgpu_falcon *flcn,
234 u32 src, u8 *dst, u32 size, u8 port);
235int nvgpu_flcn_dma_copy(struct nvgpu_falcon *flcn,
236 struct nvgpu_falcon_dma_info *dma_info);
237u32 nvgpu_flcn_mailbox_read(struct nvgpu_falcon *flcn, u32 mailbox_index);
238void nvgpu_flcn_mailbox_write(struct nvgpu_falcon *flcn, u32 mailbox_index,
239 u32 data);
240int nvgpu_flcn_bootstrap(struct nvgpu_falcon *flcn, u32 boot_vector);
241void nvgpu_flcn_print_dmem(struct nvgpu_falcon *flcn, u32 src, u32 size);
242void nvgpu_flcn_print_imem(struct nvgpu_falcon *flcn, u32 src, u32 size);
243void nvgpu_flcn_dump_stats(struct nvgpu_falcon *flcn);
244
245void nvgpu_flcn_sw_init(struct gk20a *g, u32 flcn_id);
246
247
248#endif /* __FALCON_H__ */
diff --git a/drivers/gpu/nvgpu/include/nvgpu/firmware.h b/drivers/gpu/nvgpu/include/nvgpu/firmware.h
new file mode 100644
index 00000000..b541947a
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/firmware.h
@@ -0,0 +1,72 @@
1/*
2 * Copyright (c) 2016-2017, 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#ifndef _NVGPU_FIRMWARE_H_
24#define _NVGPU_FIRMWARE_H_
25
26struct gk20a;
27
28#define NVGPU_REQUEST_FIRMWARE_NO_WARN (1UL << 0)
29#define NVGPU_REQUEST_FIRMWARE_NO_SOC (1UL << 1)
30
31struct nvgpu_firmware {
32 u8 *data;
33 size_t size;
34};
35
36/**
37 * nvgpu_request_firmware - load a firmware blob from filesystem.
38 *
39 * @g The GPU driver struct for device to load firmware for
40 * @fw_name The base name of the firmware file.
41 * @flags Flags for loading;
42 *
43 * NVGPU_REQUEST_FIRMWARE_NO_WARN: Do not display warning on
44 * failed load.
45 *
46 * NVGPU_REQUEST_FIRMWARE_NO_SOC: Do not attempt loading from
47 * path <SOC_NAME>.
48 *
49 * nvgpu_request_firmware() will load firmware from:
50 *
51 * <system firmware load path>/<GPU name>/<fw_name>
52 *
53 * If that fails and NO_SOC is not enabled, it'll try next from:
54 *
55 * <system firmware load path>/<SOC name>/<fw_name>
56 *
57 * It'll allocate a nvgpu_firmware structure and initializes it and returns
58 * it to caller.
59 */
60struct nvgpu_firmware *nvgpu_request_firmware(struct gk20a *g,
61 const char *fw_name,
62 int flags);
63
64/**
65 * nvgpu_release_firmware - free firmware and associated nvgpu_firmware blob
66 *
67 * @g The GPU driver struct for device to free firmware for
68 * @fw The firmware to free. fw blob will also be freed.
69 */
70void nvgpu_release_firmware(struct gk20a *g, struct nvgpu_firmware *fw);
71
72#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/flcnif_cmn.h b/drivers/gpu/nvgpu/include/nvgpu/flcnif_cmn.h
new file mode 100644
index 00000000..1622849a
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/flcnif_cmn.h
@@ -0,0 +1,140 @@
1/*
2 * Copyright (c) 2017, 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#ifndef __FLCNIFCMN_H__
24#define __FLCNIFCMN_H__
25
26#define PMU_CMD_SUBMIT_PAYLOAD_PARAMS_FB_SIZE_UNUSED 0
27
28struct falc_u64 {
29 u32 lo;
30 u32 hi;
31};
32
33struct falc_dma_addr {
34 u32 dma_base;
35 /*
36 * dma_base1 is 9-bit MSB for FB Base
37 * address for the transfer in FB after
38 * address using 49b FB address
39 */
40 u16 dma_base1;
41 u8 dma_offset;
42};
43
44struct pmu_mem_v0 {
45 u32 dma_base;
46 u8 dma_offset;
47 u8 dma_idx;
48};
49
50struct pmu_mem_v1 {
51 u32 dma_base;
52 u8 dma_offset;
53 u8 dma_idx;
54 u16 fb_size;
55};
56
57struct pmu_mem_v2 {
58 struct falc_dma_addr dma_addr;
59 u8 dma_idx;
60 u16 fb_size;
61};
62
63struct pmu_mem_desc_v0 {
64 struct falc_u64 dma_addr;
65 u16 dma_sizemax;
66 u8 dma_idx;
67};
68
69struct pmu_dmem {
70 u16 size;
71 u32 offset;
72};
73
74struct flcn_mem_desc_v0 {
75 struct falc_u64 address;
76 u32 params;
77};
78
79#define nv_flcn_mem_desc flcn_mem_desc_v0
80
81struct pmu_allocation_v0 {
82 u8 pad[3];
83 u8 fb_mem_use;
84 struct {
85 struct pmu_dmem dmem;
86 struct pmu_mem_v0 fb;
87 } alloc;
88};
89
90struct pmu_allocation_v1 {
91 struct {
92 struct pmu_dmem dmem;
93 struct pmu_mem_v1 fb;
94 } alloc;
95};
96
97struct pmu_allocation_v2 {
98 struct {
99 struct pmu_dmem dmem;
100 struct pmu_mem_desc_v0 fb;
101 } alloc;
102};
103
104struct pmu_allocation_v3 {
105 struct {
106 struct pmu_dmem dmem;
107 struct flcn_mem_desc_v0 fb;
108 } alloc;
109};
110
111#define nv_pmu_allocation pmu_allocation_v3
112
113struct pmu_hdr {
114 u8 unit_id;
115 u8 size;
116 u8 ctrl_flags;
117 u8 seq_id;
118};
119
120#define PMU_MSG_HDR_SIZE sizeof(struct pmu_hdr)
121#define PMU_CMD_HDR_SIZE sizeof(struct pmu_hdr)
122
123#define nv_pmu_hdr pmu_hdr
124typedef u8 flcn_status;
125
126#define PMU_DMEM_ALLOC_ALIGNMENT (4)
127#define PMU_DMEM_ALIGNMENT (4)
128
129#define PMU_CMD_FLAGS_PMU_MASK (0xF0)
130
131#define PMU_CMD_FLAGS_STATUS BIT(0)
132#define PMU_CMD_FLAGS_INTR BIT(1)
133#define PMU_CMD_FLAGS_EVENT BIT(2)
134#define PMU_CMD_FLAGS_WATERMARK BIT(3)
135
136#define ALIGN_UP(v, gran) (((v) + ((gran) - 1)) & ~((gran)-1))
137
138#define NV_UNSIGNED_ROUNDED_DIV(a, b) (((a) + ((b) / 2)) / (b))
139
140#endif /* _FLCNIFCMN_H_*/
diff --git a/drivers/gpu/nvgpu/include/nvgpu/fuse.h b/drivers/gpu/nvgpu/include/nvgpu/fuse.h
new file mode 100644
index 00000000..15a656e4
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/fuse.h
@@ -0,0 +1,36 @@
1/*
2 * Copyright (c) 2017, 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#ifndef __NVGPU_FUSE_H__
23#define __NVGPU_FUSE_H__
24
25struct gk20a;
26
27int nvgpu_tegra_get_gpu_speedo_id(struct gk20a *g);
28
29void nvgpu_tegra_fuse_write_bypass(struct gk20a *g, u32 val);
30void nvgpu_tegra_fuse_write_access_sw(struct gk20a *g, u32 val);
31void nvgpu_tegra_fuse_write_opt_gpu_tpc0_disable(struct gk20a *g, u32 val);
32void nvgpu_tegra_fuse_write_opt_gpu_tpc1_disable(struct gk20a *g, u32 val);
33int nvgpu_tegra_fuse_read_gcplex_config_fuse(struct gk20a *g, u32 *val);
34int nvgpu_tegra_fuse_read_reserved_calib(struct gk20a *g, u32 *val);
35
36#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/gmmu.h b/drivers/gpu/nvgpu/include/nvgpu/gmmu.h
new file mode 100644
index 00000000..ca07e359
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/gmmu.h
@@ -0,0 +1,347 @@
1/*
2 * Copyright (c) 2017, 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#ifndef __NVGPU_GMMU_H__
24#define __NVGPU_GMMU_H__
25
26#include <nvgpu/types.h>
27#include <nvgpu/nvgpu_mem.h>
28#include <nvgpu/list.h>
29#include <nvgpu/rbtree.h>
30#include <nvgpu/lock.h>
31
32#ifdef CONFIG_TEGRA_19x_GPU
33#include <nvgpu/gmmu_t19x.h>
34#endif
35
36/*
37 * This is the GMMU API visible to blocks outside of the GMMU. Basically this
38 * API supports all the different types of mappings that might be done in the
39 * GMMU.
40 */
41
42struct vm_gk20a;
43struct nvgpu_mem;
44
45enum gmmu_pgsz_gk20a {
46 gmmu_page_size_small = 0,
47 gmmu_page_size_big = 1,
48 gmmu_page_size_kernel = 2,
49 gmmu_nr_page_sizes = 3,
50};
51
52enum gk20a_mem_rw_flag {
53 gk20a_mem_flag_none = 0, /* RW */
54 gk20a_mem_flag_read_only = 1, /* RO */
55 gk20a_mem_flag_write_only = 2, /* WO */
56};
57
58/*
59 * Minimum size of a cache. The number of different caches in the nvgpu_pd_cache
60 * structure is of course depending on this. The MIN_SHIFT define is the right
61 * number of bits to shift to determine which list to use in the array of lists.
62 */
63#define NVGPU_PD_CACHE_MIN 256
64#define NVGPU_PD_CACHE_MIN_SHIFT 9
65#define NVGPU_PD_CACHE_COUNT 4
66
67struct nvgpu_pd_mem_entry {
68 struct nvgpu_mem mem;
69
70 /*
71 * Size of the page directories (not the mem). bmap is a bitmap showing
72 * which PDs have been allocated. The size of mem will always be one
73 * page. pd_size will always be a power of 2.
74 */
75 u32 pd_size;
76 unsigned long alloc_map;
77
78 struct nvgpu_list_node list_entry;
79 struct nvgpu_rbtree_node tree_entry;
80};
81
82static inline struct nvgpu_pd_mem_entry *
83nvgpu_pd_mem_entry_from_list_entry(struct nvgpu_list_node *node)
84{
85 return (struct nvgpu_pd_mem_entry *)
86 ((uintptr_t)node -
87 offsetof(struct nvgpu_pd_mem_entry, list_entry));
88};
89
90static inline struct nvgpu_pd_mem_entry *
91nvgpu_pd_mem_entry_from_tree_entry(struct nvgpu_rbtree_node *node)
92{
93 return (struct nvgpu_pd_mem_entry *)
94 ((uintptr_t)node -
95 offsetof(struct nvgpu_pd_mem_entry, tree_entry));
96};
97
98/*
99 * A cache for allocating PD memory from. This enables smaller PDs to be packed
100 * into single pages.
101 *
102 * This is fairly complex so see the documentation in pd_cache.c for a full
103 * description of how this is organized.
104 */
105struct nvgpu_pd_cache {
106 /*
107 * Array of lists of full nvgpu_pd_mem_entries and partially full (or
108 * empty) nvgpu_pd_mem_entries.
109 */
110 struct nvgpu_list_node full[NVGPU_PD_CACHE_COUNT];
111 struct nvgpu_list_node partial[NVGPU_PD_CACHE_COUNT];
112
113 /*
114 * Tree of all allocated struct nvgpu_mem's for fast look up.
115 */
116 struct nvgpu_rbtree_node *mem_tree;
117
118 /*
119 * All access to the cache much be locked. This protects the lists and
120 * the rb tree.
121 */
122 struct nvgpu_mutex lock;
123};
124
125/*
126 * GMMU page directory. This is the kernel's tracking of a list of PDEs or PTEs
127 * in the GMMU.
128 */
129struct nvgpu_gmmu_pd {
130 /*
131 * DMA memory describing the PTEs or PDEs. @mem_offs describes the
132 * offset of the PDE table in @mem. @cached specifies if this PD is
133 * using pd_cache memory.
134 */
135 struct nvgpu_mem *mem;
136 u32 mem_offs;
137 bool cached;
138
139 /*
140 * List of pointers to the next level of page tables. Does not
141 * need to be populated when this PD is pointing to PTEs.
142 */
143 struct nvgpu_gmmu_pd *entries;
144 int num_entries;
145};
146
147/*
148 * Reduce the number of arguments getting passed through the various levels of
149 * GMMU mapping functions.
150 *
151 * The following fields are set statically and do not change throughout the
152 * mapping call:
153 *
154 * pgsz: Index into the page size table.
155 * kind_v: Kind attributes for mapping.
156 * cacheable: Cacheability of the mapping.
157 * rw_flag: Flag from enum gk20a_mem_rw_flag
158 * sparse: Set if the mapping should be sparse.
159 * priv: Privilidged mapping.
160 * coherent: Set if the mapping should be IO coherent.
161 * valid: Set if the PTE should be marked valid.
162 * aperture: VIDMEM or SYSMEM.
163 * debug: When set print debugging info.
164 *
165 * These fields are dynamically updated as necessary during the map:
166 *
167 * ctag: Comptag line in the comptag cache;
168 * updated every time we write a PTE.
169 */
170struct nvgpu_gmmu_attrs {
171 u32 pgsz;
172 u32 kind_v;
173 u64 ctag;
174 bool cacheable;
175 int rw_flag;
176 bool sparse;
177 bool priv;
178 bool coherent;
179 bool valid;
180 enum nvgpu_aperture aperture;
181 bool debug;
182
183#ifdef CONFIG_TEGRA_19x_GPU
184 struct nvgpu_gmmu_attrs_t19x t19x_attrs;
185#endif
186};
187
188struct gk20a_mmu_level {
189 int hi_bit[2];
190 int lo_bit[2];
191
192 /*
193 * Build map from virt_addr -> phys_addr.
194 */
195 void (*update_entry)(struct vm_gk20a *vm,
196 const struct gk20a_mmu_level *l,
197 struct nvgpu_gmmu_pd *pd,
198 u32 pd_idx,
199 u64 phys_addr,
200 u64 virt_addr,
201 struct nvgpu_gmmu_attrs *attrs);
202 u32 entry_size;
203 /*
204 * Get pde page size
205 */
206 enum gmmu_pgsz_gk20a (*get_pgsz)(struct gk20a *g,
207 struct nvgpu_gmmu_pd *pd, u32 pd_idx);
208};
209
210static inline const char *nvgpu_gmmu_perm_str(enum gk20a_mem_rw_flag p)
211{
212 switch (p) {
213 case gk20a_mem_flag_none:
214 return "RW";
215 case gk20a_mem_flag_write_only:
216 return "WO";
217 case gk20a_mem_flag_read_only:
218 return "RO";
219 default:
220 return "??";
221 }
222}
223
224int nvgpu_gmmu_init_page_table(struct vm_gk20a *vm);
225
226/**
227 * nvgpu_gmmu_map - Map memory into the GMMU.
228 *
229 * Kernel space.
230 */
231u64 nvgpu_gmmu_map(struct vm_gk20a *vm,
232 struct nvgpu_mem *mem,
233 u64 size,
234 u32 flags,
235 int rw_flag,
236 bool priv,
237 enum nvgpu_aperture aperture);
238
239/**
240 * nvgpu_gmmu_map_fixed - Map memory into the GMMU.
241 *
242 * Kernel space.
243 */
244u64 nvgpu_gmmu_map_fixed(struct vm_gk20a *vm,
245 struct nvgpu_mem *mem,
246 u64 addr,
247 u64 size,
248 u32 flags,
249 int rw_flag,
250 bool priv,
251 enum nvgpu_aperture aperture);
252
253/**
254 * nvgpu_gmmu_unmap - Unmap a buffer.
255 *
256 * Kernel space.
257 */
258void nvgpu_gmmu_unmap(struct vm_gk20a *vm,
259 struct nvgpu_mem *mem,
260 u64 gpu_va);
261
262int __nvgpu_pd_alloc(struct vm_gk20a *vm, struct nvgpu_gmmu_pd *pd, u32 bytes);
263void __nvgpu_pd_free(struct vm_gk20a *vm, struct nvgpu_gmmu_pd *pd);
264int __nvgpu_pd_cache_alloc_direct(struct gk20a *g,
265 struct nvgpu_gmmu_pd *pd, u32 bytes);
266void __nvgpu_pd_cache_free_direct(struct gk20a *g, struct nvgpu_gmmu_pd *pd);
267int nvgpu_pd_cache_init(struct gk20a *g);
268void nvgpu_pd_cache_fini(struct gk20a *g);
269
270/*
271 * Some useful routines that are shared across chips.
272 */
273static inline u32 pd_offset_from_index(const struct gk20a_mmu_level *l,
274 u32 pd_idx)
275{
276 return (pd_idx * l->entry_size) / sizeof(u32);
277}
278
279static inline void pd_write(struct gk20a *g, struct nvgpu_gmmu_pd *pd,
280 size_t w, size_t data)
281{
282 nvgpu_mem_wr32(g, pd->mem, (pd->mem_offs / sizeof(u32)) + w, data);
283}
284
285/**
286 * __nvgpu_pte_words - Compute number of words in a PTE.
287 *
288 * @g - The GPU.
289 *
290 * This computes and returns the size of a PTE for the passed chip.
291 */
292u32 __nvgpu_pte_words(struct gk20a *g);
293
294/**
295 * __nvgpu_get_pte - Get the contents of a PTE by virtual address
296 *
297 * @g - The GPU.
298 * @vm - VM to look in.
299 * @vaddr - GPU virtual address.
300 * @pte - [out] Set to the contents of the PTE.
301 *
302 * Find a PTE in the passed VM based on the passed GPU virtual address. This
303 * will @pte with a copy of the contents of the PTE. @pte must be an array of
304 * u32s large enough to contain the PTE. This can be computed using
305 * __nvgpu_pte_words().
306 *
307 * If you wish to write to this PTE then you may modify @pte and then use the
308 * __nvgpu_set_pte().
309 *
310 * This function returns 0 if the PTE is found and -EINVAL otherwise.
311 */
312int __nvgpu_get_pte(struct gk20a *g, struct vm_gk20a *vm, u64 vaddr, u32 *pte);
313
314/**
315 * __nvgpu_set_pte - Set a PTE based on virtual address
316 *
317 * @g - The GPU.
318 * @vm - VM to look in.
319 * @vaddr - GPU virtual address.
320 * @pte - The contents of the PTE to write.
321 *
322 * Find a PTE and overwrite the contents of that PTE with the passed in data
323 * located in @pte. If the PTE does not exist then no writing will happen. That
324 * is this function will not fill out the page tables for you. The expectation
325 * is that the passed @vaddr has already been mapped and this is just modifying
326 * the mapping (for instance changing invalid to valid).
327 *
328 * @pte must contain at least the required words for the PTE. See
329 * __nvgpu_pte_words().
330 *
331 * This function returns 0 on success and -EINVAL otherwise.
332 */
333int __nvgpu_set_pte(struct gk20a *g, struct vm_gk20a *vm, u64 vaddr, u32 *pte);
334
335
336/*
337 * Internal debugging routines. Probably not something you want to use.
338 */
339#define pte_dbg(g, attrs, fmt, args...) \
340 do { \
341 if (attrs && attrs->debug) \
342 nvgpu_info(g, fmt, ##args); \
343 else \
344 nvgpu_log(g, gpu_dbg_pte, fmt, ##args); \
345 } while (0)
346
347#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hashtable.h b/drivers/gpu/nvgpu/include/nvgpu/hashtable.h
new file mode 100644
index 00000000..5ce56f05
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hashtable.h
@@ -0,0 +1,29 @@
1/*
2 * Copyright (c) 2017, 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#ifndef __NVGPU_SORT_H__
23#define __NVGPU_SORT_H__
24
25#ifdef __KERNEL__
26#include <linux/hashtable.h>
27#endif
28
29#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_bus_gk20a.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_bus_gk20a.h
new file mode 100644
index 00000000..d3bb9e98
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_bus_gk20a.h
@@ -0,0 +1,171 @@
1/*
2 * Copyright (c) 2012-2017, 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_bus_gk20a_h_
57#define _hw_bus_gk20a_h_
58
59static inline u32 bus_bar0_window_r(void)
60{
61 return 0x00001700U;
62}
63static inline u32 bus_bar0_window_base_f(u32 v)
64{
65 return (v & 0xffffffU) << 0U;
66}
67static inline u32 bus_bar0_window_target_vid_mem_f(void)
68{
69 return 0x0U;
70}
71static inline u32 bus_bar0_window_target_sys_mem_coherent_f(void)
72{
73 return 0x2000000U;
74}
75static inline u32 bus_bar0_window_target_sys_mem_noncoherent_f(void)
76{
77 return 0x3000000U;
78}
79static inline u32 bus_bar0_window_target_bar0_window_base_shift_v(void)
80{
81 return 0x00000010U;
82}
83static inline u32 bus_bar1_block_r(void)
84{
85 return 0x00001704U;
86}
87static inline u32 bus_bar1_block_ptr_f(u32 v)
88{
89 return (v & 0xfffffffU) << 0U;
90}
91static inline u32 bus_bar1_block_target_vid_mem_f(void)
92{
93 return 0x0U;
94}
95static inline u32 bus_bar1_block_target_sys_mem_coh_f(void)
96{
97 return 0x20000000U;
98}
99static inline u32 bus_bar1_block_target_sys_mem_ncoh_f(void)
100{
101 return 0x30000000U;
102}
103static inline u32 bus_bar1_block_mode_virtual_f(void)
104{
105 return 0x80000000U;
106}
107static inline u32 bus_bar2_block_r(void)
108{
109 return 0x00001714U;
110}
111static inline u32 bus_bar2_block_ptr_f(u32 v)
112{
113 return (v & 0xfffffffU) << 0U;
114}
115static inline u32 bus_bar2_block_target_vid_mem_f(void)
116{
117 return 0x0U;
118}
119static inline u32 bus_bar2_block_target_sys_mem_coh_f(void)
120{
121 return 0x20000000U;
122}
123static inline u32 bus_bar2_block_target_sys_mem_ncoh_f(void)
124{
125 return 0x30000000U;
126}
127static inline u32 bus_bar2_block_mode_virtual_f(void)
128{
129 return 0x80000000U;
130}
131static inline u32 bus_bar1_block_ptr_shift_v(void)
132{
133 return 0x0000000cU;
134}
135static inline u32 bus_bar2_block_ptr_shift_v(void)
136{
137 return 0x0000000cU;
138}
139static inline u32 bus_intr_0_r(void)
140{
141 return 0x00001100U;
142}
143static inline u32 bus_intr_0_pri_squash_m(void)
144{
145 return 0x1U << 1U;
146}
147static inline u32 bus_intr_0_pri_fecserr_m(void)
148{
149 return 0x1U << 2U;
150}
151static inline u32 bus_intr_0_pri_timeout_m(void)
152{
153 return 0x1U << 3U;
154}
155static inline u32 bus_intr_en_0_r(void)
156{
157 return 0x00001140U;
158}
159static inline u32 bus_intr_en_0_pri_squash_m(void)
160{
161 return 0x1U << 1U;
162}
163static inline u32 bus_intr_en_0_pri_fecserr_m(void)
164{
165 return 0x1U << 2U;
166}
167static inline u32 bus_intr_en_0_pri_timeout_m(void)
168{
169 return 0x1U << 3U;
170}
171#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_ccsr_gk20a.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_ccsr_gk20a.h
new file mode 100644
index 00000000..95151f62
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_ccsr_gk20a.h
@@ -0,0 +1,163 @@
1/*
2 * Copyright (c) 2012-2017, 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_ccsr_gk20a_h_
57#define _hw_ccsr_gk20a_h_
58
59static inline u32 ccsr_channel_inst_r(u32 i)
60{
61 return 0x00800000U + i*8U;
62}
63static inline u32 ccsr_channel_inst__size_1_v(void)
64{
65 return 0x00000080U;
66}
67static inline u32 ccsr_channel_inst_ptr_f(u32 v)
68{
69 return (v & 0xfffffffU) << 0U;
70}
71static inline u32 ccsr_channel_inst_target_vid_mem_f(void)
72{
73 return 0x0U;
74}
75static inline u32 ccsr_channel_inst_target_sys_mem_coh_f(void)
76{
77 return 0x20000000U;
78}
79static inline u32 ccsr_channel_inst_target_sys_mem_ncoh_f(void)
80{
81 return 0x30000000U;
82}
83static inline u32 ccsr_channel_inst_bind_false_f(void)
84{
85 return 0x0U;
86}
87static inline u32 ccsr_channel_inst_bind_true_f(void)
88{
89 return 0x80000000U;
90}
91static inline u32 ccsr_channel_r(u32 i)
92{
93 return 0x00800004U + i*8U;
94}
95static inline u32 ccsr_channel__size_1_v(void)
96{
97 return 0x00000080U;
98}
99static inline u32 ccsr_channel_enable_v(u32 r)
100{
101 return (r >> 0U) & 0x1U;
102}
103static inline u32 ccsr_channel_enable_set_f(u32 v)
104{
105 return (v & 0x1U) << 10U;
106}
107static inline u32 ccsr_channel_enable_set_true_f(void)
108{
109 return 0x400U;
110}
111static inline u32 ccsr_channel_enable_clr_true_f(void)
112{
113 return 0x800U;
114}
115static inline u32 ccsr_channel_runlist_f(u32 v)
116{
117 return (v & 0xfU) << 16U;
118}
119static inline u32 ccsr_channel_status_v(u32 r)
120{
121 return (r >> 24U) & 0xfU;
122}
123static inline u32 ccsr_channel_status_pending_ctx_reload_v(void)
124{
125 return 0x00000002U;
126}
127static inline u32 ccsr_channel_status_pending_acq_ctx_reload_v(void)
128{
129 return 0x00000004U;
130}
131static inline u32 ccsr_channel_status_on_pbdma_ctx_reload_v(void)
132{
133 return 0x0000000aU;
134}
135static inline u32 ccsr_channel_status_on_pbdma_and_eng_ctx_reload_v(void)
136{
137 return 0x0000000bU;
138}
139static inline u32 ccsr_channel_status_on_eng_ctx_reload_v(void)
140{
141 return 0x0000000cU;
142}
143static inline u32 ccsr_channel_status_on_eng_pending_ctx_reload_v(void)
144{
145 return 0x0000000dU;
146}
147static inline u32 ccsr_channel_status_on_eng_pending_acq_ctx_reload_v(void)
148{
149 return 0x0000000eU;
150}
151static inline u32 ccsr_channel_next_v(u32 r)
152{
153 return (r >> 1U) & 0x1U;
154}
155static inline u32 ccsr_channel_next_true_v(void)
156{
157 return 0x00000001U;
158}
159static inline u32 ccsr_channel_busy_v(u32 r)
160{
161 return (r >> 28U) & 0x1U;
162}
163#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_ce2_gk20a.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_ce2_gk20a.h
new file mode 100644
index 00000000..87481cd4
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_ce2_gk20a.h
@@ -0,0 +1,87 @@
1/*
2 * Copyright (c) 2015-2017, 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_ce2_gk20a_h_
57#define _hw_ce2_gk20a_h_
58
59static inline u32 ce2_intr_status_r(void)
60{
61 return 0x00106908U;
62}
63static inline u32 ce2_intr_status_blockpipe_pending_f(void)
64{
65 return 0x1U;
66}
67static inline u32 ce2_intr_status_blockpipe_reset_f(void)
68{
69 return 0x1U;
70}
71static inline u32 ce2_intr_status_nonblockpipe_pending_f(void)
72{
73 return 0x2U;
74}
75static inline u32 ce2_intr_status_nonblockpipe_reset_f(void)
76{
77 return 0x2U;
78}
79static inline u32 ce2_intr_status_launcherr_pending_f(void)
80{
81 return 0x4U;
82}
83static inline u32 ce2_intr_status_launcherr_reset_f(void)
84{
85 return 0x4U;
86}
87#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_ctxsw_prog_gk20a.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_ctxsw_prog_gk20a.h
new file mode 100644
index 00000000..131fd12e
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_ctxsw_prog_gk20a.h
@@ -0,0 +1,447 @@
1/*
2 * Copyright (c) 2012-2017, 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_ctxsw_prog_gk20a_h_
57#define _hw_ctxsw_prog_gk20a_h_
58
59static inline u32 ctxsw_prog_fecs_header_v(void)
60{
61 return 0x00000100U;
62}
63static inline u32 ctxsw_prog_main_image_num_gpcs_o(void)
64{
65 return 0x00000008U;
66}
67static inline u32 ctxsw_prog_main_image_patch_count_o(void)
68{
69 return 0x00000010U;
70}
71static inline u32 ctxsw_prog_main_image_context_id_o(void)
72{
73 return 0x000000f0U;
74}
75static inline u32 ctxsw_prog_main_image_patch_adr_lo_o(void)
76{
77 return 0x00000014U;
78}
79static inline u32 ctxsw_prog_main_image_patch_adr_hi_o(void)
80{
81 return 0x00000018U;
82}
83static inline u32 ctxsw_prog_main_image_zcull_o(void)
84{
85 return 0x0000001cU;
86}
87static inline u32 ctxsw_prog_main_image_zcull_mode_no_ctxsw_v(void)
88{
89 return 0x00000001U;
90}
91static inline u32 ctxsw_prog_main_image_zcull_mode_separate_buffer_v(void)
92{
93 return 0x00000002U;
94}
95static inline u32 ctxsw_prog_main_image_zcull_ptr_o(void)
96{
97 return 0x00000020U;
98}
99static inline u32 ctxsw_prog_main_image_pm_o(void)
100{
101 return 0x00000028U;
102}
103static inline u32 ctxsw_prog_main_image_pm_mode_m(void)
104{
105 return 0x7U << 0U;
106}
107static inline u32 ctxsw_prog_main_image_pm_mode_ctxsw_f(void)
108{
109 return 0x1U;
110}
111static inline u32 ctxsw_prog_main_image_pm_mode_no_ctxsw_f(void)
112{
113 return 0x0U;
114}
115static inline u32 ctxsw_prog_main_image_pm_smpc_mode_m(void)
116{
117 return 0x7U << 3U;
118}
119static inline u32 ctxsw_prog_main_image_pm_smpc_mode_ctxsw_f(void)
120{
121 return 0x8U;
122}
123static inline u32 ctxsw_prog_main_image_pm_smpc_mode_no_ctxsw_f(void)
124{
125 return 0x0U;
126}
127static inline u32 ctxsw_prog_main_image_pm_ptr_o(void)
128{
129 return 0x0000002cU;
130}
131static inline u32 ctxsw_prog_main_image_num_save_ops_o(void)
132{
133 return 0x000000f4U;
134}
135static inline u32 ctxsw_prog_main_image_num_restore_ops_o(void)
136{
137 return 0x000000f8U;
138}
139static inline u32 ctxsw_prog_main_image_magic_value_o(void)
140{
141 return 0x000000fcU;
142}
143static inline u32 ctxsw_prog_main_image_magic_value_v_value_v(void)
144{
145 return 0x600dc0deU;
146}
147static inline u32 ctxsw_prog_local_priv_register_ctl_o(void)
148{
149 return 0x0000000cU;
150}
151static inline u32 ctxsw_prog_local_priv_register_ctl_offset_v(u32 r)
152{
153 return (r >> 0U) & 0xffffU;
154}
155static inline u32 ctxsw_prog_local_image_ppc_info_o(void)
156{
157 return 0x000000f4U;
158}
159static inline u32 ctxsw_prog_local_image_ppc_info_num_ppcs_v(u32 r)
160{
161 return (r >> 0U) & 0xffffU;
162}
163static inline u32 ctxsw_prog_local_image_ppc_info_ppc_mask_v(u32 r)
164{
165 return (r >> 16U) & 0xffffU;
166}
167static inline u32 ctxsw_prog_local_image_num_tpcs_o(void)
168{
169 return 0x000000f8U;
170}
171static inline u32 ctxsw_prog_local_magic_value_o(void)
172{
173 return 0x000000fcU;
174}
175static inline u32 ctxsw_prog_local_magic_value_v_value_v(void)
176{
177 return 0xad0becabU;
178}
179static inline u32 ctxsw_prog_main_extended_buffer_ctl_o(void)
180{
181 return 0x000000ecU;
182}
183static inline u32 ctxsw_prog_main_extended_buffer_ctl_offset_v(u32 r)
184{
185 return (r >> 0U) & 0xffffU;
186}
187static inline u32 ctxsw_prog_main_extended_buffer_ctl_size_v(u32 r)
188{
189 return (r >> 16U) & 0xffU;
190}
191static inline u32 ctxsw_prog_extended_buffer_segments_size_in_bytes_v(void)
192{
193 return 0x00000100U;
194}
195static inline u32 ctxsw_prog_extended_marker_size_in_bytes_v(void)
196{
197 return 0x00000004U;
198}
199static inline u32 ctxsw_prog_extended_sm_dsm_perf_counter_register_stride_v(void)
200{
201 return 0x00000005U;
202}
203static inline u32 ctxsw_prog_extended_sm_dsm_perf_counter_control_register_stride_v(void)
204{
205 return 0x00000004U;
206}
207static inline u32 ctxsw_prog_extended_num_smpc_quadrants_v(void)
208{
209 return 0x00000004U;
210}
211static inline u32 ctxsw_prog_main_image_priv_access_map_config_o(void)
212{
213 return 0x000000a0U;
214}
215static inline u32 ctxsw_prog_main_image_priv_access_map_config_mode_s(void)
216{
217 return 2U;
218}
219static inline u32 ctxsw_prog_main_image_priv_access_map_config_mode_f(u32 v)
220{
221 return (v & 0x3U) << 0U;
222}
223static inline u32 ctxsw_prog_main_image_priv_access_map_config_mode_m(void)
224{
225 return 0x3U << 0U;
226}
227static inline u32 ctxsw_prog_main_image_priv_access_map_config_mode_v(u32 r)
228{
229 return (r >> 0U) & 0x3U;
230}
231static inline u32 ctxsw_prog_main_image_priv_access_map_config_mode_allow_all_f(void)
232{
233 return 0x0U;
234}
235static inline u32 ctxsw_prog_main_image_priv_access_map_config_mode_use_map_f(void)
236{
237 return 0x2U;
238}
239static inline u32 ctxsw_prog_main_image_priv_access_map_addr_lo_o(void)
240{
241 return 0x000000a4U;
242}
243static inline u32 ctxsw_prog_main_image_priv_access_map_addr_hi_o(void)
244{
245 return 0x000000a8U;
246}
247static inline u32 ctxsw_prog_main_image_misc_options_o(void)
248{
249 return 0x0000003cU;
250}
251static inline u32 ctxsw_prog_main_image_misc_options_verif_features_m(void)
252{
253 return 0x1U << 3U;
254}
255static inline u32 ctxsw_prog_main_image_misc_options_verif_features_disabled_f(void)
256{
257 return 0x0U;
258}
259static inline u32 ctxsw_prog_main_image_context_timestamp_buffer_control_o(void)
260{
261 return 0x000000acU;
262}
263static inline u32 ctxsw_prog_main_image_context_timestamp_buffer_control_num_records_f(u32 v)
264{
265 return (v & 0xffffU) << 0U;
266}
267static inline u32 ctxsw_prog_main_image_context_timestamp_buffer_ptr_hi_o(void)
268{
269 return 0x000000b0U;
270}
271static inline u32 ctxsw_prog_main_image_context_timestamp_buffer_ptr_hi_v_m(void)
272{
273 return 0xfffffffU << 0U;
274}
275static inline u32 ctxsw_prog_main_image_context_timestamp_buffer_ptr_hi_target_m(void)
276{
277 return 0x3U << 28U;
278}
279static inline u32 ctxsw_prog_main_image_context_timestamp_buffer_ptr_hi_target_vid_mem_f(void)
280{
281 return 0x0U;
282}
283static inline u32 ctxsw_prog_main_image_context_timestamp_buffer_ptr_hi_target_sys_mem_coherent_f(void)
284{
285 return 0x20000000U;
286}
287static inline u32 ctxsw_prog_main_image_context_timestamp_buffer_ptr_hi_target_sys_mem_noncoherent_f(void)
288{
289 return 0x30000000U;
290}
291static inline u32 ctxsw_prog_main_image_context_timestamp_buffer_ptr_o(void)
292{
293 return 0x000000b4U;
294}
295static inline u32 ctxsw_prog_main_image_context_timestamp_buffer_ptr_v_f(u32 v)
296{
297 return (v & 0xffffffffU) << 0U;
298}
299static inline u32 ctxsw_prog_record_timestamp_record_size_in_bytes_v(void)
300{
301 return 0x00000080U;
302}
303static inline u32 ctxsw_prog_record_timestamp_record_size_in_words_v(void)
304{
305 return 0x00000020U;
306}
307static inline u32 ctxsw_prog_record_timestamp_magic_value_lo_o(void)
308{
309 return 0x00000000U;
310}
311static inline u32 ctxsw_prog_record_timestamp_magic_value_lo_v_value_v(void)
312{
313 return 0x00000000U;
314}
315static inline u32 ctxsw_prog_record_timestamp_magic_value_hi_o(void)
316{
317 return 0x00000004U;
318}
319static inline u32 ctxsw_prog_record_timestamp_magic_value_hi_v_value_v(void)
320{
321 return 0x600dbeefU;
322}
323static inline u32 ctxsw_prog_record_timestamp_context_id_o(void)
324{
325 return 0x00000008U;
326}
327static inline u32 ctxsw_prog_record_timestamp_context_ptr_o(void)
328{
329 return 0x0000000cU;
330}
331static inline u32 ctxsw_prog_record_timestamp_new_context_id_o(void)
332{
333 return 0x00000010U;
334}
335static inline u32 ctxsw_prog_record_timestamp_new_context_ptr_o(void)
336{
337 return 0x00000014U;
338}
339static inline u32 ctxsw_prog_record_timestamp_timestamp_lo_o(void)
340{
341 return 0x00000018U;
342}
343static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_o(void)
344{
345 return 0x0000001cU;
346}
347static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_v_f(u32 v)
348{
349 return (v & 0xffffffU) << 0U;
350}
351static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_v_v(u32 r)
352{
353 return (r >> 0U) & 0xffffffU;
354}
355static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_f(u32 v)
356{
357 return (v & 0xffU) << 24U;
358}
359static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_m(void)
360{
361 return 0xffU << 24U;
362}
363static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_v(u32 r)
364{
365 return (r >> 24U) & 0xffU;
366}
367static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_ctxsw_req_by_host_v(void)
368{
369 return 0x00000001U;
370}
371static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_ctxsw_req_by_host_f(void)
372{
373 return 0x1000000U;
374}
375static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_fe_ack_v(void)
376{
377 return 0x00000002U;
378}
379static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_fe_ack_f(void)
380{
381 return 0x2000000U;
382}
383static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_fe_ack_wfi_v(void)
384{
385 return 0x0000000aU;
386}
387static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_fe_ack_wfi_f(void)
388{
389 return 0xa000000U;
390}
391static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_fe_ack_gfxp_v(void)
392{
393 return 0x0000000bU;
394}
395static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_fe_ack_gfxp_f(void)
396{
397 return 0xb000000U;
398}
399static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_fe_ack_ctap_v(void)
400{
401 return 0x0000000cU;
402}
403static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_fe_ack_ctap_f(void)
404{
405 return 0xc000000U;
406}
407static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_fe_ack_cilp_v(void)
408{
409 return 0x0000000dU;
410}
411static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_fe_ack_cilp_f(void)
412{
413 return 0xd000000U;
414}
415static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_save_end_v(void)
416{
417 return 0x00000003U;
418}
419static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_save_end_f(void)
420{
421 return 0x3000000U;
422}
423static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_restore_start_v(void)
424{
425 return 0x00000004U;
426}
427static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_restore_start_f(void)
428{
429 return 0x4000000U;
430}
431static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_context_start_v(void)
432{
433 return 0x00000005U;
434}
435static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_context_start_f(void)
436{
437 return 0x5000000U;
438}
439static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_invalid_timestamp_v(void)
440{
441 return 0x000000ffU;
442}
443static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_invalid_timestamp_f(void)
444{
445 return 0xff000000U;
446}
447#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_falcon_gk20a.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_falcon_gk20a.h
new file mode 100644
index 00000000..27fb5884
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_falcon_gk20a.h
@@ -0,0 +1,555 @@
1/*
2 * Copyright (c) 2017, 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_falcon_gk20a_h_
57#define _hw_falcon_gk20a_h_
58
59static inline u32 falcon_falcon_irqsset_r(void)
60{
61 return 0x00000000U;
62}
63static inline u32 falcon_falcon_irqsset_swgen0_set_f(void)
64{
65 return 0x40U;
66}
67static inline u32 falcon_falcon_irqsclr_r(void)
68{
69 return 0x00000004U;
70}
71static inline u32 falcon_falcon_irqstat_r(void)
72{
73 return 0x00000008U;
74}
75static inline u32 falcon_falcon_irqstat_halt_true_f(void)
76{
77 return 0x10U;
78}
79static inline u32 falcon_falcon_irqstat_exterr_true_f(void)
80{
81 return 0x20U;
82}
83static inline u32 falcon_falcon_irqstat_swgen0_true_f(void)
84{
85 return 0x40U;
86}
87static inline u32 falcon_falcon_irqmode_r(void)
88{
89 return 0x0000000cU;
90}
91static inline u32 falcon_falcon_irqmset_r(void)
92{
93 return 0x00000010U;
94}
95static inline u32 falcon_falcon_irqmset_gptmr_f(u32 v)
96{
97 return (v & 0x1U) << 0U;
98}
99static inline u32 falcon_falcon_irqmset_wdtmr_f(u32 v)
100{
101 return (v & 0x1U) << 1U;
102}
103static inline u32 falcon_falcon_irqmset_mthd_f(u32 v)
104{
105 return (v & 0x1U) << 2U;
106}
107static inline u32 falcon_falcon_irqmset_ctxsw_f(u32 v)
108{
109 return (v & 0x1U) << 3U;
110}
111static inline u32 falcon_falcon_irqmset_halt_f(u32 v)
112{
113 return (v & 0x1U) << 4U;
114}
115static inline u32 falcon_falcon_irqmset_exterr_f(u32 v)
116{
117 return (v & 0x1U) << 5U;
118}
119static inline u32 falcon_falcon_irqmset_swgen0_f(u32 v)
120{
121 return (v & 0x1U) << 6U;
122}
123static inline u32 falcon_falcon_irqmset_swgen1_f(u32 v)
124{
125 return (v & 0x1U) << 7U;
126}
127static inline u32 falcon_falcon_irqmclr_r(void)
128{
129 return 0x00000014U;
130}
131static inline u32 falcon_falcon_irqmclr_gptmr_f(u32 v)
132{
133 return (v & 0x1U) << 0U;
134}
135static inline u32 falcon_falcon_irqmclr_wdtmr_f(u32 v)
136{
137 return (v & 0x1U) << 1U;
138}
139static inline u32 falcon_falcon_irqmclr_mthd_f(u32 v)
140{
141 return (v & 0x1U) << 2U;
142}
143static inline u32 falcon_falcon_irqmclr_ctxsw_f(u32 v)
144{
145 return (v & 0x1U) << 3U;
146}
147static inline u32 falcon_falcon_irqmclr_halt_f(u32 v)
148{
149 return (v & 0x1U) << 4U;
150}
151static inline u32 falcon_falcon_irqmclr_exterr_f(u32 v)
152{
153 return (v & 0x1U) << 5U;
154}
155static inline u32 falcon_falcon_irqmclr_swgen0_f(u32 v)
156{
157 return (v & 0x1U) << 6U;
158}
159static inline u32 falcon_falcon_irqmclr_swgen1_f(u32 v)
160{
161 return (v & 0x1U) << 7U;
162}
163static inline u32 falcon_falcon_irqmclr_ext_f(u32 v)
164{
165 return (v & 0xffU) << 8U;
166}
167static inline u32 falcon_falcon_irqmask_r(void)
168{
169 return 0x00000018U;
170}
171static inline u32 falcon_falcon_irqdest_r(void)
172{
173 return 0x0000001cU;
174}
175static inline u32 falcon_falcon_irqdest_host_gptmr_f(u32 v)
176{
177 return (v & 0x1U) << 0U;
178}
179static inline u32 falcon_falcon_irqdest_host_wdtmr_f(u32 v)
180{
181 return (v & 0x1U) << 1U;
182}
183static inline u32 falcon_falcon_irqdest_host_mthd_f(u32 v)
184{
185 return (v & 0x1U) << 2U;
186}
187static inline u32 falcon_falcon_irqdest_host_ctxsw_f(u32 v)
188{
189 return (v & 0x1U) << 3U;
190}
191static inline u32 falcon_falcon_irqdest_host_halt_f(u32 v)
192{
193 return (v & 0x1U) << 4U;
194}
195static inline u32 falcon_falcon_irqdest_host_exterr_f(u32 v)
196{
197 return (v & 0x1U) << 5U;
198}
199static inline u32 falcon_falcon_irqdest_host_swgen0_f(u32 v)
200{
201 return (v & 0x1U) << 6U;
202}
203static inline u32 falcon_falcon_irqdest_host_swgen1_f(u32 v)
204{
205 return (v & 0x1U) << 7U;
206}
207static inline u32 falcon_falcon_irqdest_host_ext_f(u32 v)
208{
209 return (v & 0xffU) << 8U;
210}
211static inline u32 falcon_falcon_irqdest_target_gptmr_f(u32 v)
212{
213 return (v & 0x1U) << 16U;
214}
215static inline u32 falcon_falcon_irqdest_target_wdtmr_f(u32 v)
216{
217 return (v & 0x1U) << 17U;
218}
219static inline u32 falcon_falcon_irqdest_target_mthd_f(u32 v)
220{
221 return (v & 0x1U) << 18U;
222}
223static inline u32 falcon_falcon_irqdest_target_ctxsw_f(u32 v)
224{
225 return (v & 0x1U) << 19U;
226}
227static inline u32 falcon_falcon_irqdest_target_halt_f(u32 v)
228{
229 return (v & 0x1U) << 20U;
230}
231static inline u32 falcon_falcon_irqdest_target_exterr_f(u32 v)
232{
233 return (v & 0x1U) << 21U;
234}
235static inline u32 falcon_falcon_irqdest_target_swgen0_f(u32 v)
236{
237 return (v & 0x1U) << 22U;
238}
239static inline u32 falcon_falcon_irqdest_target_swgen1_f(u32 v)
240{
241 return (v & 0x1U) << 23U;
242}
243static inline u32 falcon_falcon_irqdest_target_ext_f(u32 v)
244{
245 return (v & 0xffU) << 24U;
246}
247static inline u32 falcon_falcon_curctx_r(void)
248{
249 return 0x00000050U;
250}
251static inline u32 falcon_falcon_nxtctx_r(void)
252{
253 return 0x00000054U;
254}
255static inline u32 falcon_falcon_mailbox0_r(void)
256{
257 return 0x00000040U;
258}
259static inline u32 falcon_falcon_mailbox1_r(void)
260{
261 return 0x00000044U;
262}
263static inline u32 falcon_falcon_itfen_r(void)
264{
265 return 0x00000048U;
266}
267static inline u32 falcon_falcon_itfen_ctxen_enable_f(void)
268{
269 return 0x1U;
270}
271static inline u32 falcon_falcon_idlestate_r(void)
272{
273 return 0x0000004cU;
274}
275static inline u32 falcon_falcon_idlestate_falcon_busy_v(u32 r)
276{
277 return (r >> 0U) & 0x1U;
278}
279static inline u32 falcon_falcon_idlestate_ext_busy_v(u32 r)
280{
281 return (r >> 1U) & 0x7fffU;
282}
283static inline u32 falcon_falcon_os_r(void)
284{
285 return 0x00000080U;
286}
287static inline u32 falcon_falcon_engctl_r(void)
288{
289 return 0x000000a4U;
290}
291static inline u32 falcon_falcon_cpuctl_r(void)
292{
293 return 0x00000100U;
294}
295static inline u32 falcon_falcon_cpuctl_startcpu_f(u32 v)
296{
297 return (v & 0x1U) << 1U;
298}
299static inline u32 falcon_falcon_cpuctl_sreset_f(u32 v)
300{
301 return (v & 0x1U) << 2U;
302}
303static inline u32 falcon_falcon_cpuctl_hreset_f(u32 v)
304{
305 return (v & 0x1U) << 3U;
306}
307static inline u32 falcon_falcon_cpuctl_halt_intr_f(u32 v)
308{
309 return (v & 0x1U) << 4U;
310}
311static inline u32 falcon_falcon_cpuctl_halt_intr_m(void)
312{
313 return 0x1U << 4U;
314}
315static inline u32 falcon_falcon_cpuctl_halt_intr_v(u32 r)
316{
317 return (r >> 4U) & 0x1U;
318}
319static inline u32 falcon_falcon_cpuctl_stopped_m(void)
320{
321 return 0x1U << 5U;
322}
323static inline u32 falcon_falcon_imemc_r(u32 i)
324{
325 return 0x00000180U + i*16U;
326}
327static inline u32 falcon_falcon_imemc_offs_f(u32 v)
328{
329 return (v & 0x3fU) << 2U;
330}
331static inline u32 falcon_falcon_imemc_blk_f(u32 v)
332{
333 return (v & 0xffU) << 8U;
334}
335static inline u32 falcon_falcon_imemc_aincw_f(u32 v)
336{
337 return (v & 0x1U) << 24U;
338}
339static inline u32 falcon_falcon_imemd_r(u32 i)
340{
341 return 0x00000184U + i*16U;
342}
343static inline u32 falcon_falcon_imemt_r(u32 i)
344{
345 return 0x00000188U + i*16U;
346}
347static inline u32 falcon_falcon_bootvec_r(void)
348{
349 return 0x00000104U;
350}
351static inline u32 falcon_falcon_bootvec_vec_f(u32 v)
352{
353 return (v & 0xffffffffU) << 0U;
354}
355static inline u32 falcon_falcon_dmactl_r(void)
356{
357 return 0x0000010cU;
358}
359static inline u32 falcon_falcon_dmactl_dmem_scrubbing_m(void)
360{
361 return 0x1U << 1U;
362}
363static inline u32 falcon_falcon_dmactl_imem_scrubbing_m(void)
364{
365 return 0x1U << 2U;
366}
367static inline u32 falcon_falcon_dmactl_require_ctx_f(u32 v)
368{
369 return (v & 0x1U) << 0U;
370}
371static inline u32 falcon_falcon_hwcfg_r(void)
372{
373 return 0x00000108U;
374}
375static inline u32 falcon_falcon_hwcfg_imem_size_v(u32 r)
376{
377 return (r >> 0U) & 0x1ffU;
378}
379static inline u32 falcon_falcon_hwcfg_dmem_size_v(u32 r)
380{
381 return (r >> 9U) & 0x1ffU;
382}
383static inline u32 falcon_falcon_dmatrfbase_r(void)
384{
385 return 0x00000110U;
386}
387static inline u32 falcon_falcon_dmatrfmoffs_r(void)
388{
389 return 0x00000114U;
390}
391static inline u32 falcon_falcon_dmatrfcmd_r(void)
392{
393 return 0x00000118U;
394}
395static inline u32 falcon_falcon_dmatrfcmd_imem_f(u32 v)
396{
397 return (v & 0x1U) << 4U;
398}
399static inline u32 falcon_falcon_dmatrfcmd_write_f(u32 v)
400{
401 return (v & 0x1U) << 5U;
402}
403static inline u32 falcon_falcon_dmatrfcmd_size_f(u32 v)
404{
405 return (v & 0x7U) << 8U;
406}
407static inline u32 falcon_falcon_dmatrfcmd_ctxdma_f(u32 v)
408{
409 return (v & 0x7U) << 12U;
410}
411static inline u32 falcon_falcon_dmatrffboffs_r(void)
412{
413 return 0x0000011cU;
414}
415static inline u32 falcon_falcon_imstat_r(void)
416{
417 return 0x00000144U;
418}
419static inline u32 falcon_falcon_traceidx_r(void)
420{
421 return 0x00000148U;
422}
423static inline u32 falcon_falcon_traceidx_maxidx_v(u32 r)
424{
425 return (r >> 16U) & 0xffU;
426}
427static inline u32 falcon_falcon_traceidx_idx_v(u32 r)
428{
429 return (r >> 0U) & 0xffU;
430}
431static inline u32 falcon_falcon_tracepc_r(void)
432{
433 return 0x0000014cU;
434}
435static inline u32 falcon_falcon_tracepc_pc_v(u32 r)
436{
437 return (r >> 0U) & 0xffffffU;
438}
439static inline u32 falcon_falcon_exterraddr_r(void)
440{
441 return 0x00000168U;
442}
443static inline u32 falcon_falcon_exterrstat_r(void)
444{
445 return 0x0000016cU;
446}
447static inline u32 falcon_falcon_exterrstat_valid_m(void)
448{
449 return 0x1U << 31U;
450}
451static inline u32 falcon_falcon_exterrstat_valid_v(u32 r)
452{
453 return (r >> 31U) & 0x1U;
454}
455static inline u32 falcon_falcon_exterrstat_valid_true_v(void)
456{
457 return 0x00000001U;
458}
459static inline u32 falcon_falcon_icd_cmd_r(void)
460{
461 return 0x00000200U;
462}
463static inline u32 falcon_falcon_icd_cmd_opc_s(void)
464{
465 return 4U;
466}
467static inline u32 falcon_falcon_icd_cmd_opc_f(u32 v)
468{
469 return (v & 0xfU) << 0U;
470}
471static inline u32 falcon_falcon_icd_cmd_opc_m(void)
472{
473 return 0xfU << 0U;
474}
475static inline u32 falcon_falcon_icd_cmd_opc_v(u32 r)
476{
477 return (r >> 0U) & 0xfU;
478}
479static inline u32 falcon_falcon_icd_cmd_opc_rreg_f(void)
480{
481 return 0x8U;
482}
483static inline u32 falcon_falcon_icd_cmd_opc_rstat_f(void)
484{
485 return 0xeU;
486}
487static inline u32 falcon_falcon_icd_cmd_idx_f(u32 v)
488{
489 return (v & 0x1fU) << 8U;
490}
491static inline u32 falcon_falcon_icd_rdata_r(void)
492{
493 return 0x0000020cU;
494}
495static inline u32 falcon_falcon_dmemc_r(u32 i)
496{
497 return 0x000001c0U + i*8U;
498}
499static inline u32 falcon_falcon_dmemc_offs_f(u32 v)
500{
501 return (v & 0x3fU) << 2U;
502}
503static inline u32 falcon_falcon_dmemc_offs_m(void)
504{
505 return 0x3fU << 2U;
506}
507static inline u32 falcon_falcon_dmemc_blk_f(u32 v)
508{
509 return (v & 0xffU) << 8U;
510}
511static inline u32 falcon_falcon_dmemc_blk_m(void)
512{
513 return 0xffU << 8U;
514}
515static inline u32 falcon_falcon_dmemc_aincw_f(u32 v)
516{
517 return (v & 0x1U) << 24U;
518}
519static inline u32 falcon_falcon_dmemc_aincr_f(u32 v)
520{
521 return (v & 0x1U) << 25U;
522}
523static inline u32 falcon_falcon_dmemd_r(u32 i)
524{
525 return 0x000001c4U + i*8U;
526}
527static inline u32 falcon_falcon_debug1_r(void)
528{
529 return 0x00000090U;
530}
531static inline u32 falcon_falcon_debug1_ctxsw_mode_s(void)
532{
533 return 1U;
534}
535static inline u32 falcon_falcon_debug1_ctxsw_mode_f(u32 v)
536{
537 return (v & 0x1U) << 16U;
538}
539static inline u32 falcon_falcon_debug1_ctxsw_mode_m(void)
540{
541 return 0x1U << 16U;
542}
543static inline u32 falcon_falcon_debug1_ctxsw_mode_v(u32 r)
544{
545 return (r >> 16U) & 0x1U;
546}
547static inline u32 falcon_falcon_debug1_ctxsw_mode_init_f(void)
548{
549 return 0x0U;
550}
551static inline u32 falcon_falcon_debuginfo_r(void)
552{
553 return 0x00000094U;
554}
555#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_fb_gk20a.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_fb_gk20a.h
new file mode 100644
index 00000000..42df4f5e
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_fb_gk20a.h
@@ -0,0 +1,263 @@
1/*
2 * Copyright (c) 2012-2017, 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_fb_gk20a_h_
57#define _hw_fb_gk20a_h_
58
59static inline u32 fb_mmu_ctrl_r(void)
60{
61 return 0x00100c80U;
62}
63static inline u32 fb_mmu_ctrl_vm_pg_size_f(u32 v)
64{
65 return (v & 0x1U) << 0U;
66}
67static inline u32 fb_mmu_ctrl_vm_pg_size_128kb_f(void)
68{
69 return 0x0U;
70}
71static inline u32 fb_mmu_ctrl_vm_pg_size_64kb_f(void)
72{
73 return 0x1U;
74}
75static inline u32 fb_mmu_ctrl_pri_fifo_empty_v(u32 r)
76{
77 return (r >> 15U) & 0x1U;
78}
79static inline u32 fb_mmu_ctrl_pri_fifo_empty_false_f(void)
80{
81 return 0x0U;
82}
83static inline u32 fb_mmu_ctrl_pri_fifo_space_v(u32 r)
84{
85 return (r >> 16U) & 0xffU;
86}
87static inline u32 fb_mmu_invalidate_pdb_r(void)
88{
89 return 0x00100cb8U;
90}
91static inline u32 fb_mmu_invalidate_pdb_aperture_vid_mem_f(void)
92{
93 return 0x0U;
94}
95static inline u32 fb_mmu_invalidate_pdb_aperture_sys_mem_f(void)
96{
97 return 0x2U;
98}
99static inline u32 fb_mmu_invalidate_pdb_addr_f(u32 v)
100{
101 return (v & 0xfffffffU) << 4U;
102}
103static inline u32 fb_mmu_invalidate_r(void)
104{
105 return 0x00100cbcU;
106}
107static inline u32 fb_mmu_invalidate_all_va_true_f(void)
108{
109 return 0x1U;
110}
111static inline u32 fb_mmu_invalidate_all_pdb_true_f(void)
112{
113 return 0x2U;
114}
115static inline u32 fb_mmu_invalidate_trigger_s(void)
116{
117 return 1U;
118}
119static inline u32 fb_mmu_invalidate_trigger_f(u32 v)
120{
121 return (v & 0x1U) << 31U;
122}
123static inline u32 fb_mmu_invalidate_trigger_m(void)
124{
125 return 0x1U << 31U;
126}
127static inline u32 fb_mmu_invalidate_trigger_v(u32 r)
128{
129 return (r >> 31U) & 0x1U;
130}
131static inline u32 fb_mmu_invalidate_trigger_true_f(void)
132{
133 return 0x80000000U;
134}
135static inline u32 fb_mmu_debug_wr_r(void)
136{
137 return 0x00100cc8U;
138}
139static inline u32 fb_mmu_debug_wr_aperture_s(void)
140{
141 return 2U;
142}
143static inline u32 fb_mmu_debug_wr_aperture_f(u32 v)
144{
145 return (v & 0x3U) << 0U;
146}
147static inline u32 fb_mmu_debug_wr_aperture_m(void)
148{
149 return 0x3U << 0U;
150}
151static inline u32 fb_mmu_debug_wr_aperture_v(u32 r)
152{
153 return (r >> 0U) & 0x3U;
154}
155static inline u32 fb_mmu_debug_wr_aperture_vid_mem_f(void)
156{
157 return 0x0U;
158}
159static inline u32 fb_mmu_debug_wr_aperture_sys_mem_coh_f(void)
160{
161 return 0x2U;
162}
163static inline u32 fb_mmu_debug_wr_aperture_sys_mem_ncoh_f(void)
164{
165 return 0x3U;
166}
167static inline u32 fb_mmu_debug_wr_vol_false_f(void)
168{
169 return 0x0U;
170}
171static inline u32 fb_mmu_debug_wr_vol_true_v(void)
172{
173 return 0x00000001U;
174}
175static inline u32 fb_mmu_debug_wr_vol_true_f(void)
176{
177 return 0x4U;
178}
179static inline u32 fb_mmu_debug_wr_addr_f(u32 v)
180{
181 return (v & 0xfffffffU) << 4U;
182}
183static inline u32 fb_mmu_debug_wr_addr_alignment_v(void)
184{
185 return 0x0000000cU;
186}
187static inline u32 fb_mmu_debug_rd_r(void)
188{
189 return 0x00100cccU;
190}
191static inline u32 fb_mmu_debug_rd_aperture_vid_mem_f(void)
192{
193 return 0x0U;
194}
195static inline u32 fb_mmu_debug_rd_aperture_sys_mem_coh_f(void)
196{
197 return 0x2U;
198}
199static inline u32 fb_mmu_debug_rd_aperture_sys_mem_ncoh_f(void)
200{
201 return 0x3U;
202}
203static inline u32 fb_mmu_debug_rd_vol_false_f(void)
204{
205 return 0x0U;
206}
207static inline u32 fb_mmu_debug_rd_addr_f(u32 v)
208{
209 return (v & 0xfffffffU) << 4U;
210}
211static inline u32 fb_mmu_debug_rd_addr_alignment_v(void)
212{
213 return 0x0000000cU;
214}
215static inline u32 fb_mmu_debug_ctrl_r(void)
216{
217 return 0x00100cc4U;
218}
219static inline u32 fb_mmu_debug_ctrl_debug_v(u32 r)
220{
221 return (r >> 16U) & 0x1U;
222}
223static inline u32 fb_mmu_debug_ctrl_debug_m(void)
224{
225 return 0x1U << 16U;
226}
227static inline u32 fb_mmu_debug_ctrl_debug_enabled_v(void)
228{
229 return 0x00000001U;
230}
231static inline u32 fb_mmu_debug_ctrl_debug_enabled_f(void)
232{
233 return 0x10000U;
234}
235static inline u32 fb_mmu_debug_ctrl_debug_disabled_v(void)
236{
237 return 0x00000000U;
238}
239static inline u32 fb_mmu_debug_ctrl_debug_disabled_f(void)
240{
241 return 0x0U;
242}
243static inline u32 fb_mmu_vpr_info_r(void)
244{
245 return 0x00100cd0U;
246}
247static inline u32 fb_mmu_vpr_info_fetch_v(u32 r)
248{
249 return (r >> 2U) & 0x1U;
250}
251static inline u32 fb_mmu_vpr_info_fetch_false_v(void)
252{
253 return 0x00000000U;
254}
255static inline u32 fb_mmu_vpr_info_fetch_true_v(void)
256{
257 return 0x00000001U;
258}
259static inline u32 fb_niso_flush_sysmem_addr_r(void)
260{
261 return 0x00100c10U;
262}
263#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_fifo_gk20a.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_fifo_gk20a.h
new file mode 100644
index 00000000..e61e386d
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_fifo_gk20a.h
@@ -0,0 +1,619 @@
1/*
2 * Copyright (c) 2012-2017, 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_fifo_gk20a_h_
57#define _hw_fifo_gk20a_h_
58
59static inline u32 fifo_bar1_base_r(void)
60{
61 return 0x00002254U;
62}
63static inline u32 fifo_bar1_base_ptr_f(u32 v)
64{
65 return (v & 0xfffffffU) << 0U;
66}
67static inline u32 fifo_bar1_base_ptr_align_shift_v(void)
68{
69 return 0x0000000cU;
70}
71static inline u32 fifo_bar1_base_valid_false_f(void)
72{
73 return 0x0U;
74}
75static inline u32 fifo_bar1_base_valid_true_f(void)
76{
77 return 0x10000000U;
78}
79static inline u32 fifo_runlist_base_r(void)
80{
81 return 0x00002270U;
82}
83static inline u32 fifo_runlist_base_ptr_f(u32 v)
84{
85 return (v & 0xfffffffU) << 0U;
86}
87static inline u32 fifo_runlist_base_target_vid_mem_f(void)
88{
89 return 0x0U;
90}
91static inline u32 fifo_runlist_base_target_sys_mem_coh_f(void)
92{
93 return 0x20000000U;
94}
95static inline u32 fifo_runlist_base_target_sys_mem_ncoh_f(void)
96{
97 return 0x30000000U;
98}
99static inline u32 fifo_runlist_r(void)
100{
101 return 0x00002274U;
102}
103static inline u32 fifo_runlist_engine_f(u32 v)
104{
105 return (v & 0xfU) << 20U;
106}
107static inline u32 fifo_eng_runlist_base_r(u32 i)
108{
109 return 0x00002280U + i*8U;
110}
111static inline u32 fifo_eng_runlist_base__size_1_v(void)
112{
113 return 0x00000001U;
114}
115static inline u32 fifo_eng_runlist_r(u32 i)
116{
117 return 0x00002284U + i*8U;
118}
119static inline u32 fifo_eng_runlist__size_1_v(void)
120{
121 return 0x00000001U;
122}
123static inline u32 fifo_eng_runlist_length_f(u32 v)
124{
125 return (v & 0xffffU) << 0U;
126}
127static inline u32 fifo_eng_runlist_length_max_v(void)
128{
129 return 0x0000ffffU;
130}
131static inline u32 fifo_eng_runlist_pending_true_f(void)
132{
133 return 0x100000U;
134}
135static inline u32 fifo_runlist_timeslice_r(u32 i)
136{
137 return 0x00002310U + i*4U;
138}
139static inline u32 fifo_runlist_timeslice_timeout_128_f(void)
140{
141 return 0x80U;
142}
143static inline u32 fifo_runlist_timeslice_timescale_3_f(void)
144{
145 return 0x3000U;
146}
147static inline u32 fifo_runlist_timeslice_enable_true_f(void)
148{
149 return 0x10000000U;
150}
151static inline u32 fifo_eng_timeout_r(void)
152{
153 return 0x00002a0cU;
154}
155static inline u32 fifo_eng_timeout_period_max_f(void)
156{
157 return 0x7fffffffU;
158}
159static inline u32 fifo_eng_timeout_detection_enabled_f(void)
160{
161 return 0x80000000U;
162}
163static inline u32 fifo_eng_timeout_detection_disabled_f(void)
164{
165 return 0x0U;
166}
167static inline u32 fifo_pb_timeslice_r(u32 i)
168{
169 return 0x00002350U + i*4U;
170}
171static inline u32 fifo_pb_timeslice_timeout_16_f(void)
172{
173 return 0x10U;
174}
175static inline u32 fifo_pb_timeslice_timescale_0_f(void)
176{
177 return 0x0U;
178}
179static inline u32 fifo_pb_timeslice_enable_true_f(void)
180{
181 return 0x10000000U;
182}
183static inline u32 fifo_pbdma_map_r(u32 i)
184{
185 return 0x00002390U + i*4U;
186}
187static inline u32 fifo_intr_0_r(void)
188{
189 return 0x00002100U;
190}
191static inline u32 fifo_intr_0_bind_error_pending_f(void)
192{
193 return 0x1U;
194}
195static inline u32 fifo_intr_0_bind_error_reset_f(void)
196{
197 return 0x1U;
198}
199static inline u32 fifo_intr_0_pio_error_pending_f(void)
200{
201 return 0x10U;
202}
203static inline u32 fifo_intr_0_pio_error_reset_f(void)
204{
205 return 0x10U;
206}
207static inline u32 fifo_intr_0_sched_error_pending_f(void)
208{
209 return 0x100U;
210}
211static inline u32 fifo_intr_0_sched_error_reset_f(void)
212{
213 return 0x100U;
214}
215static inline u32 fifo_intr_0_chsw_error_pending_f(void)
216{
217 return 0x10000U;
218}
219static inline u32 fifo_intr_0_chsw_error_reset_f(void)
220{
221 return 0x10000U;
222}
223static inline u32 fifo_intr_0_fb_flush_timeout_pending_f(void)
224{
225 return 0x800000U;
226}
227static inline u32 fifo_intr_0_fb_flush_timeout_reset_f(void)
228{
229 return 0x800000U;
230}
231static inline u32 fifo_intr_0_lb_error_pending_f(void)
232{
233 return 0x1000000U;
234}
235static inline u32 fifo_intr_0_lb_error_reset_f(void)
236{
237 return 0x1000000U;
238}
239static inline u32 fifo_intr_0_dropped_mmu_fault_pending_f(void)
240{
241 return 0x8000000U;
242}
243static inline u32 fifo_intr_0_dropped_mmu_fault_reset_f(void)
244{
245 return 0x8000000U;
246}
247static inline u32 fifo_intr_0_mmu_fault_pending_f(void)
248{
249 return 0x10000000U;
250}
251static inline u32 fifo_intr_0_pbdma_intr_pending_f(void)
252{
253 return 0x20000000U;
254}
255static inline u32 fifo_intr_0_runlist_event_pending_f(void)
256{
257 return 0x40000000U;
258}
259static inline u32 fifo_intr_0_channel_intr_pending_f(void)
260{
261 return 0x80000000U;
262}
263static inline u32 fifo_intr_en_0_r(void)
264{
265 return 0x00002140U;
266}
267static inline u32 fifo_intr_en_0_sched_error_f(u32 v)
268{
269 return (v & 0x1U) << 8U;
270}
271static inline u32 fifo_intr_en_0_sched_error_m(void)
272{
273 return 0x1U << 8U;
274}
275static inline u32 fifo_intr_en_0_mmu_fault_f(u32 v)
276{
277 return (v & 0x1U) << 28U;
278}
279static inline u32 fifo_intr_en_0_mmu_fault_m(void)
280{
281 return 0x1U << 28U;
282}
283static inline u32 fifo_intr_en_1_r(void)
284{
285 return 0x00002528U;
286}
287static inline u32 fifo_intr_bind_error_r(void)
288{
289 return 0x0000252cU;
290}
291static inline u32 fifo_intr_sched_error_r(void)
292{
293 return 0x0000254cU;
294}
295static inline u32 fifo_intr_sched_error_code_f(u32 v)
296{
297 return (v & 0xffU) << 0U;
298}
299static inline u32 fifo_intr_sched_error_code_ctxsw_timeout_v(void)
300{
301 return 0x0000000aU;
302}
303static inline u32 fifo_intr_chsw_error_r(void)
304{
305 return 0x0000256cU;
306}
307static inline u32 fifo_intr_mmu_fault_id_r(void)
308{
309 return 0x0000259cU;
310}
311static inline u32 fifo_intr_mmu_fault_eng_id_graphics_v(void)
312{
313 return 0x00000000U;
314}
315static inline u32 fifo_intr_mmu_fault_eng_id_graphics_f(void)
316{
317 return 0x0U;
318}
319static inline u32 fifo_intr_mmu_fault_inst_r(u32 i)
320{
321 return 0x00002800U + i*16U;
322}
323static inline u32 fifo_intr_mmu_fault_inst_ptr_v(u32 r)
324{
325 return (r >> 0U) & 0xfffffffU;
326}
327static inline u32 fifo_intr_mmu_fault_inst_ptr_align_shift_v(void)
328{
329 return 0x0000000cU;
330}
331static inline u32 fifo_intr_mmu_fault_lo_r(u32 i)
332{
333 return 0x00002804U + i*16U;
334}
335static inline u32 fifo_intr_mmu_fault_hi_r(u32 i)
336{
337 return 0x00002808U + i*16U;
338}
339static inline u32 fifo_intr_mmu_fault_info_r(u32 i)
340{
341 return 0x0000280cU + i*16U;
342}
343static inline u32 fifo_intr_mmu_fault_info_type_v(u32 r)
344{
345 return (r >> 0U) & 0xfU;
346}
347static inline u32 fifo_intr_mmu_fault_info_write_v(u32 r)
348{
349 return (r >> 7U) & 0x1U;
350}
351static inline u32 fifo_intr_mmu_fault_info_engine_subid_v(u32 r)
352{
353 return (r >> 6U) & 0x1U;
354}
355static inline u32 fifo_intr_mmu_fault_info_engine_subid_gpc_v(void)
356{
357 return 0x00000000U;
358}
359static inline u32 fifo_intr_mmu_fault_info_engine_subid_hub_v(void)
360{
361 return 0x00000001U;
362}
363static inline u32 fifo_intr_mmu_fault_info_client_v(u32 r)
364{
365 return (r >> 8U) & 0x1fU;
366}
367static inline u32 fifo_intr_pbdma_id_r(void)
368{
369 return 0x000025a0U;
370}
371static inline u32 fifo_intr_pbdma_id_status_f(u32 v, u32 i)
372{
373 return (v & 0x1U) << (0U + i*1U);
374}
375static inline u32 fifo_intr_pbdma_id_status_v(u32 r, u32 i)
376{
377 return (r >> (0U + i*1U)) & 0x1U;
378}
379static inline u32 fifo_intr_pbdma_id_status__size_1_v(void)
380{
381 return 0x00000001U;
382}
383static inline u32 fifo_intr_runlist_r(void)
384{
385 return 0x00002a00U;
386}
387static inline u32 fifo_fb_timeout_r(void)
388{
389 return 0x00002a04U;
390}
391static inline u32 fifo_fb_timeout_period_m(void)
392{
393 return 0x3fffffffU << 0U;
394}
395static inline u32 fifo_fb_timeout_period_max_f(void)
396{
397 return 0x3fffffffU;
398}
399static inline u32 fifo_pb_timeout_r(void)
400{
401 return 0x00002a08U;
402}
403static inline u32 fifo_pb_timeout_detection_enabled_f(void)
404{
405 return 0x80000000U;
406}
407static inline u32 fifo_error_sched_disable_r(void)
408{
409 return 0x0000262cU;
410}
411static inline u32 fifo_sched_disable_r(void)
412{
413 return 0x00002630U;
414}
415static inline u32 fifo_sched_disable_runlist_f(u32 v, u32 i)
416{
417 return (v & 0x1U) << (0U + i*1U);
418}
419static inline u32 fifo_sched_disable_runlist_m(u32 i)
420{
421 return 0x1U << (0U + i*1U);
422}
423static inline u32 fifo_sched_disable_true_v(void)
424{
425 return 0x00000001U;
426}
427static inline u32 fifo_preempt_r(void)
428{
429 return 0x00002634U;
430}
431static inline u32 fifo_preempt_pending_true_f(void)
432{
433 return 0x100000U;
434}
435static inline u32 fifo_preempt_type_channel_f(void)
436{
437 return 0x0U;
438}
439static inline u32 fifo_preempt_type_tsg_f(void)
440{
441 return 0x1000000U;
442}
443static inline u32 fifo_preempt_chid_f(u32 v)
444{
445 return (v & 0xfffU) << 0U;
446}
447static inline u32 fifo_preempt_id_f(u32 v)
448{
449 return (v & 0xfffU) << 0U;
450}
451static inline u32 fifo_trigger_mmu_fault_r(u32 i)
452{
453 return 0x00002a30U + i*4U;
454}
455static inline u32 fifo_trigger_mmu_fault_id_f(u32 v)
456{
457 return (v & 0x1fU) << 0U;
458}
459static inline u32 fifo_trigger_mmu_fault_enable_f(u32 v)
460{
461 return (v & 0x1U) << 8U;
462}
463static inline u32 fifo_engine_status_r(u32 i)
464{
465 return 0x00002640U + i*8U;
466}
467static inline u32 fifo_engine_status__size_1_v(void)
468{
469 return 0x00000002U;
470}
471static inline u32 fifo_engine_status_id_v(u32 r)
472{
473 return (r >> 0U) & 0xfffU;
474}
475static inline u32 fifo_engine_status_id_type_v(u32 r)
476{
477 return (r >> 12U) & 0x1U;
478}
479static inline u32 fifo_engine_status_id_type_chid_v(void)
480{
481 return 0x00000000U;
482}
483static inline u32 fifo_engine_status_id_type_tsgid_v(void)
484{
485 return 0x00000001U;
486}
487static inline u32 fifo_engine_status_ctx_status_v(u32 r)
488{
489 return (r >> 13U) & 0x7U;
490}
491static inline u32 fifo_engine_status_ctx_status_invalid_v(void)
492{
493 return 0x00000000U;
494}
495static inline u32 fifo_engine_status_ctx_status_valid_v(void)
496{
497 return 0x00000001U;
498}
499static inline u32 fifo_engine_status_ctx_status_ctxsw_load_v(void)
500{
501 return 0x00000005U;
502}
503static inline u32 fifo_engine_status_ctx_status_ctxsw_save_v(void)
504{
505 return 0x00000006U;
506}
507static inline u32 fifo_engine_status_ctx_status_ctxsw_switch_v(void)
508{
509 return 0x00000007U;
510}
511static inline u32 fifo_engine_status_next_id_v(u32 r)
512{
513 return (r >> 16U) & 0xfffU;
514}
515static inline u32 fifo_engine_status_next_id_type_v(u32 r)
516{
517 return (r >> 28U) & 0x1U;
518}
519static inline u32 fifo_engine_status_next_id_type_chid_v(void)
520{
521 return 0x00000000U;
522}
523static inline u32 fifo_engine_status_faulted_v(u32 r)
524{
525 return (r >> 30U) & 0x1U;
526}
527static inline u32 fifo_engine_status_faulted_true_v(void)
528{
529 return 0x00000001U;
530}
531static inline u32 fifo_engine_status_engine_v(u32 r)
532{
533 return (r >> 31U) & 0x1U;
534}
535static inline u32 fifo_engine_status_engine_idle_v(void)
536{
537 return 0x00000000U;
538}
539static inline u32 fifo_engine_status_engine_busy_v(void)
540{
541 return 0x00000001U;
542}
543static inline u32 fifo_engine_status_ctxsw_v(u32 r)
544{
545 return (r >> 15U) & 0x1U;
546}
547static inline u32 fifo_engine_status_ctxsw_in_progress_v(void)
548{
549 return 0x00000001U;
550}
551static inline u32 fifo_engine_status_ctxsw_in_progress_f(void)
552{
553 return 0x8000U;
554}
555static inline u32 fifo_pbdma_status_r(u32 i)
556{
557 return 0x00003080U + i*4U;
558}
559static inline u32 fifo_pbdma_status__size_1_v(void)
560{
561 return 0x00000001U;
562}
563static inline u32 fifo_pbdma_status_id_v(u32 r)
564{
565 return (r >> 0U) & 0xfffU;
566}
567static inline u32 fifo_pbdma_status_id_type_v(u32 r)
568{
569 return (r >> 12U) & 0x1U;
570}
571static inline u32 fifo_pbdma_status_id_type_chid_v(void)
572{
573 return 0x00000000U;
574}
575static inline u32 fifo_pbdma_status_id_type_tsgid_v(void)
576{
577 return 0x00000001U;
578}
579static inline u32 fifo_pbdma_status_chan_status_v(u32 r)
580{
581 return (r >> 13U) & 0x7U;
582}
583static inline u32 fifo_pbdma_status_chan_status_valid_v(void)
584{
585 return 0x00000001U;
586}
587static inline u32 fifo_pbdma_status_chan_status_chsw_load_v(void)
588{
589 return 0x00000005U;
590}
591static inline u32 fifo_pbdma_status_chan_status_chsw_save_v(void)
592{
593 return 0x00000006U;
594}
595static inline u32 fifo_pbdma_status_chan_status_chsw_switch_v(void)
596{
597 return 0x00000007U;
598}
599static inline u32 fifo_pbdma_status_next_id_v(u32 r)
600{
601 return (r >> 16U) & 0xfffU;
602}
603static inline u32 fifo_pbdma_status_next_id_type_v(u32 r)
604{
605 return (r >> 28U) & 0x1U;
606}
607static inline u32 fifo_pbdma_status_next_id_type_chid_v(void)
608{
609 return 0x00000000U;
610}
611static inline u32 fifo_pbdma_status_chsw_v(u32 r)
612{
613 return (r >> 15U) & 0x1U;
614}
615static inline u32 fifo_pbdma_status_chsw_in_progress_v(void)
616{
617 return 0x00000001U;
618}
619#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_flush_gk20a.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_flush_gk20a.h
new file mode 100644
index 00000000..d270b5f3
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_flush_gk20a.h
@@ -0,0 +1,187 @@
1/*
2 * Copyright (c) 2012-2017, 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_flush_gk20a_h_
57#define _hw_flush_gk20a_h_
58
59static inline u32 flush_l2_system_invalidate_r(void)
60{
61 return 0x00070004U;
62}
63static inline u32 flush_l2_system_invalidate_pending_v(u32 r)
64{
65 return (r >> 0U) & 0x1U;
66}
67static inline u32 flush_l2_system_invalidate_pending_busy_v(void)
68{
69 return 0x00000001U;
70}
71static inline u32 flush_l2_system_invalidate_pending_busy_f(void)
72{
73 return 0x1U;
74}
75static inline u32 flush_l2_system_invalidate_outstanding_v(u32 r)
76{
77 return (r >> 1U) & 0x1U;
78}
79static inline u32 flush_l2_system_invalidate_outstanding_true_v(void)
80{
81 return 0x00000001U;
82}
83static inline u32 flush_l2_flush_dirty_r(void)
84{
85 return 0x00070010U;
86}
87static inline u32 flush_l2_flush_dirty_pending_v(u32 r)
88{
89 return (r >> 0U) & 0x1U;
90}
91static inline u32 flush_l2_flush_dirty_pending_empty_v(void)
92{
93 return 0x00000000U;
94}
95static inline u32 flush_l2_flush_dirty_pending_empty_f(void)
96{
97 return 0x0U;
98}
99static inline u32 flush_l2_flush_dirty_pending_busy_v(void)
100{
101 return 0x00000001U;
102}
103static inline u32 flush_l2_flush_dirty_pending_busy_f(void)
104{
105 return 0x1U;
106}
107static inline u32 flush_l2_flush_dirty_outstanding_v(u32 r)
108{
109 return (r >> 1U) & 0x1U;
110}
111static inline u32 flush_l2_flush_dirty_outstanding_false_v(void)
112{
113 return 0x00000000U;
114}
115static inline u32 flush_l2_flush_dirty_outstanding_false_f(void)
116{
117 return 0x0U;
118}
119static inline u32 flush_l2_flush_dirty_outstanding_true_v(void)
120{
121 return 0x00000001U;
122}
123static inline u32 flush_l2_clean_comptags_r(void)
124{
125 return 0x0007000cU;
126}
127static inline u32 flush_l2_clean_comptags_pending_v(u32 r)
128{
129 return (r >> 0U) & 0x1U;
130}
131static inline u32 flush_l2_clean_comptags_pending_empty_v(void)
132{
133 return 0x00000000U;
134}
135static inline u32 flush_l2_clean_comptags_pending_empty_f(void)
136{
137 return 0x0U;
138}
139static inline u32 flush_l2_clean_comptags_pending_busy_v(void)
140{
141 return 0x00000001U;
142}
143static inline u32 flush_l2_clean_comptags_pending_busy_f(void)
144{
145 return 0x1U;
146}
147static inline u32 flush_l2_clean_comptags_outstanding_v(u32 r)
148{
149 return (r >> 1U) & 0x1U;
150}
151static inline u32 flush_l2_clean_comptags_outstanding_false_v(void)
152{
153 return 0x00000000U;
154}
155static inline u32 flush_l2_clean_comptags_outstanding_false_f(void)
156{
157 return 0x0U;
158}
159static inline u32 flush_l2_clean_comptags_outstanding_true_v(void)
160{
161 return 0x00000001U;
162}
163static inline u32 flush_fb_flush_r(void)
164{
165 return 0x00070000U;
166}
167static inline u32 flush_fb_flush_pending_v(u32 r)
168{
169 return (r >> 0U) & 0x1U;
170}
171static inline u32 flush_fb_flush_pending_busy_v(void)
172{
173 return 0x00000001U;
174}
175static inline u32 flush_fb_flush_pending_busy_f(void)
176{
177 return 0x1U;
178}
179static inline u32 flush_fb_flush_outstanding_v(u32 r)
180{
181 return (r >> 1U) & 0x1U;
182}
183static inline u32 flush_fb_flush_outstanding_true_v(void)
184{
185 return 0x00000001U;
186}
187#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_gmmu_gk20a.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_gmmu_gk20a.h
new file mode 100644
index 00000000..94330a6c
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_gmmu_gk20a.h
@@ -0,0 +1,1199 @@
1/*
2 * Copyright (c) 2012-2017, 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_gmmu_gk20a_h_
57#define _hw_gmmu_gk20a_h_
58
59static inline u32 gmmu_pde_aperture_big_w(void)
60{
61 return 0U;
62}
63static inline u32 gmmu_pde_aperture_big_invalid_f(void)
64{
65 return 0x0U;
66}
67static inline u32 gmmu_pde_aperture_big_video_memory_f(void)
68{
69 return 0x1U;
70}
71static inline u32 gmmu_pde_aperture_big_sys_mem_coh_f(void)
72{
73 return 0x2U;
74}
75static inline u32 gmmu_pde_aperture_big_sys_mem_ncoh_f(void)
76{
77 return 0x3U;
78}
79static inline u32 gmmu_pde_size_w(void)
80{
81 return 0U;
82}
83static inline u32 gmmu_pde_size_full_f(void)
84{
85 return 0x0U;
86}
87static inline u32 gmmu_pde_address_big_sys_f(u32 v)
88{
89 return (v & 0xfffffffU) << 4U;
90}
91static inline u32 gmmu_pde_address_big_sys_w(void)
92{
93 return 0U;
94}
95static inline u32 gmmu_pde_aperture_small_w(void)
96{
97 return 1U;
98}
99static inline u32 gmmu_pde_aperture_small_invalid_f(void)
100{
101 return 0x0U;
102}
103static inline u32 gmmu_pde_aperture_small_video_memory_f(void)
104{
105 return 0x1U;
106}
107static inline u32 gmmu_pde_aperture_small_sys_mem_coh_f(void)
108{
109 return 0x2U;
110}
111static inline u32 gmmu_pde_aperture_small_sys_mem_ncoh_f(void)
112{
113 return 0x3U;
114}
115static inline u32 gmmu_pde_vol_small_w(void)
116{
117 return 1U;
118}
119static inline u32 gmmu_pde_vol_small_true_f(void)
120{
121 return 0x4U;
122}
123static inline u32 gmmu_pde_vol_small_false_f(void)
124{
125 return 0x0U;
126}
127static inline u32 gmmu_pde_vol_big_w(void)
128{
129 return 1U;
130}
131static inline u32 gmmu_pde_vol_big_true_f(void)
132{
133 return 0x8U;
134}
135static inline u32 gmmu_pde_vol_big_false_f(void)
136{
137 return 0x0U;
138}
139static inline u32 gmmu_pde_address_small_sys_f(u32 v)
140{
141 return (v & 0xfffffffU) << 4U;
142}
143static inline u32 gmmu_pde_address_small_sys_w(void)
144{
145 return 1U;
146}
147static inline u32 gmmu_pde_address_shift_v(void)
148{
149 return 0x0000000cU;
150}
151static inline u32 gmmu_pde__size_v(void)
152{
153 return 0x00000008U;
154}
155static inline u32 gmmu_pte__size_v(void)
156{
157 return 0x00000008U;
158}
159static inline u32 gmmu_pte_valid_w(void)
160{
161 return 0U;
162}
163static inline u32 gmmu_pte_valid_true_f(void)
164{
165 return 0x1U;
166}
167static inline u32 gmmu_pte_valid_false_f(void)
168{
169 return 0x0U;
170}
171static inline u32 gmmu_pte_privilege_w(void)
172{
173 return 0U;
174}
175static inline u32 gmmu_pte_privilege_true_f(void)
176{
177 return 0x2U;
178}
179static inline u32 gmmu_pte_privilege_false_f(void)
180{
181 return 0x0U;
182}
183static inline u32 gmmu_pte_address_sys_f(u32 v)
184{
185 return (v & 0xfffffffU) << 4U;
186}
187static inline u32 gmmu_pte_address_sys_w(void)
188{
189 return 0U;
190}
191static inline u32 gmmu_pte_address_vid_f(u32 v)
192{
193 return (v & 0x1ffffffU) << 4U;
194}
195static inline u32 gmmu_pte_address_vid_w(void)
196{
197 return 0U;
198}
199static inline u32 gmmu_pte_vol_w(void)
200{
201 return 1U;
202}
203static inline u32 gmmu_pte_vol_true_f(void)
204{
205 return 0x1U;
206}
207static inline u32 gmmu_pte_vol_false_f(void)
208{
209 return 0x0U;
210}
211static inline u32 gmmu_pte_aperture_w(void)
212{
213 return 1U;
214}
215static inline u32 gmmu_pte_aperture_video_memory_f(void)
216{
217 return 0x0U;
218}
219static inline u32 gmmu_pte_aperture_sys_mem_coh_f(void)
220{
221 return 0x4U;
222}
223static inline u32 gmmu_pte_aperture_sys_mem_ncoh_f(void)
224{
225 return 0x6U;
226}
227static inline u32 gmmu_pte_read_only_w(void)
228{
229 return 0U;
230}
231static inline u32 gmmu_pte_read_only_true_f(void)
232{
233 return 0x4U;
234}
235static inline u32 gmmu_pte_write_disable_w(void)
236{
237 return 1U;
238}
239static inline u32 gmmu_pte_write_disable_true_f(void)
240{
241 return 0x80000000U;
242}
243static inline u32 gmmu_pte_read_disable_w(void)
244{
245 return 1U;
246}
247static inline u32 gmmu_pte_read_disable_true_f(void)
248{
249 return 0x40000000U;
250}
251static inline u32 gmmu_pte_comptagline_s(void)
252{
253 return 17U;
254}
255static inline u32 gmmu_pte_comptagline_f(u32 v)
256{
257 return (v & 0x1ffffU) << 12U;
258}
259static inline u32 gmmu_pte_comptagline_w(void)
260{
261 return 1U;
262}
263static inline u32 gmmu_pte_address_shift_v(void)
264{
265 return 0x0000000cU;
266}
267static inline u32 gmmu_pte_kind_f(u32 v)
268{
269 return (v & 0xffU) << 4U;
270}
271static inline u32 gmmu_pte_kind_w(void)
272{
273 return 1U;
274}
275static inline u32 gmmu_pte_kind_invalid_v(void)
276{
277 return 0x000000ffU;
278}
279static inline u32 gmmu_pte_kind_pitch_v(void)
280{
281 return 0x00000000U;
282}
283static inline u32 gmmu_pte_kind_z16_v(void)
284{
285 return 0x00000001U;
286}
287static inline u32 gmmu_pte_kind_z16_2c_v(void)
288{
289 return 0x00000002U;
290}
291static inline u32 gmmu_pte_kind_z16_ms2_2c_v(void)
292{
293 return 0x00000003U;
294}
295static inline u32 gmmu_pte_kind_z16_ms4_2c_v(void)
296{
297 return 0x00000004U;
298}
299static inline u32 gmmu_pte_kind_z16_ms8_2c_v(void)
300{
301 return 0x00000005U;
302}
303static inline u32 gmmu_pte_kind_z16_ms16_2c_v(void)
304{
305 return 0x00000006U;
306}
307static inline u32 gmmu_pte_kind_z16_2z_v(void)
308{
309 return 0x00000007U;
310}
311static inline u32 gmmu_pte_kind_z16_ms2_2z_v(void)
312{
313 return 0x00000008U;
314}
315static inline u32 gmmu_pte_kind_z16_ms4_2z_v(void)
316{
317 return 0x00000009U;
318}
319static inline u32 gmmu_pte_kind_z16_ms8_2z_v(void)
320{
321 return 0x0000000aU;
322}
323static inline u32 gmmu_pte_kind_z16_ms16_2z_v(void)
324{
325 return 0x0000000bU;
326}
327static inline u32 gmmu_pte_kind_z16_4cz_v(void)
328{
329 return 0x0000000cU;
330}
331static inline u32 gmmu_pte_kind_z16_ms2_4cz_v(void)
332{
333 return 0x0000000dU;
334}
335static inline u32 gmmu_pte_kind_z16_ms4_4cz_v(void)
336{
337 return 0x0000000eU;
338}
339static inline u32 gmmu_pte_kind_z16_ms8_4cz_v(void)
340{
341 return 0x0000000fU;
342}
343static inline u32 gmmu_pte_kind_z16_ms16_4cz_v(void)
344{
345 return 0x00000010U;
346}
347static inline u32 gmmu_pte_kind_s8z24_v(void)
348{
349 return 0x00000011U;
350}
351static inline u32 gmmu_pte_kind_s8z24_1z_v(void)
352{
353 return 0x00000012U;
354}
355static inline u32 gmmu_pte_kind_s8z24_ms2_1z_v(void)
356{
357 return 0x00000013U;
358}
359static inline u32 gmmu_pte_kind_s8z24_ms4_1z_v(void)
360{
361 return 0x00000014U;
362}
363static inline u32 gmmu_pte_kind_s8z24_ms8_1z_v(void)
364{
365 return 0x00000015U;
366}
367static inline u32 gmmu_pte_kind_s8z24_ms16_1z_v(void)
368{
369 return 0x00000016U;
370}
371static inline u32 gmmu_pte_kind_s8z24_2cz_v(void)
372{
373 return 0x00000017U;
374}
375static inline u32 gmmu_pte_kind_s8z24_ms2_2cz_v(void)
376{
377 return 0x00000018U;
378}
379static inline u32 gmmu_pte_kind_s8z24_ms4_2cz_v(void)
380{
381 return 0x00000019U;
382}
383static inline u32 gmmu_pte_kind_s8z24_ms8_2cz_v(void)
384{
385 return 0x0000001aU;
386}
387static inline u32 gmmu_pte_kind_s8z24_ms16_2cz_v(void)
388{
389 return 0x0000001bU;
390}
391static inline u32 gmmu_pte_kind_s8z24_2cs_v(void)
392{
393 return 0x0000001cU;
394}
395static inline u32 gmmu_pte_kind_s8z24_ms2_2cs_v(void)
396{
397 return 0x0000001dU;
398}
399static inline u32 gmmu_pte_kind_s8z24_ms4_2cs_v(void)
400{
401 return 0x0000001eU;
402}
403static inline u32 gmmu_pte_kind_s8z24_ms8_2cs_v(void)
404{
405 return 0x0000001fU;
406}
407static inline u32 gmmu_pte_kind_s8z24_ms16_2cs_v(void)
408{
409 return 0x00000020U;
410}
411static inline u32 gmmu_pte_kind_s8z24_4cszv_v(void)
412{
413 return 0x00000021U;
414}
415static inline u32 gmmu_pte_kind_s8z24_ms2_4cszv_v(void)
416{
417 return 0x00000022U;
418}
419static inline u32 gmmu_pte_kind_s8z24_ms4_4cszv_v(void)
420{
421 return 0x00000023U;
422}
423static inline u32 gmmu_pte_kind_s8z24_ms8_4cszv_v(void)
424{
425 return 0x00000024U;
426}
427static inline u32 gmmu_pte_kind_s8z24_ms16_4cszv_v(void)
428{
429 return 0x00000025U;
430}
431static inline u32 gmmu_pte_kind_v8z24_ms4_vc12_v(void)
432{
433 return 0x00000026U;
434}
435static inline u32 gmmu_pte_kind_v8z24_ms4_vc4_v(void)
436{
437 return 0x00000027U;
438}
439static inline u32 gmmu_pte_kind_v8z24_ms8_vc8_v(void)
440{
441 return 0x00000028U;
442}
443static inline u32 gmmu_pte_kind_v8z24_ms8_vc24_v(void)
444{
445 return 0x00000029U;
446}
447static inline u32 gmmu_pte_kind_v8z24_ms4_vc12_1zv_v(void)
448{
449 return 0x0000002eU;
450}
451static inline u32 gmmu_pte_kind_v8z24_ms4_vc4_1zv_v(void)
452{
453 return 0x0000002fU;
454}
455static inline u32 gmmu_pte_kind_v8z24_ms8_vc8_1zv_v(void)
456{
457 return 0x00000030U;
458}
459static inline u32 gmmu_pte_kind_v8z24_ms8_vc24_1zv_v(void)
460{
461 return 0x00000031U;
462}
463static inline u32 gmmu_pte_kind_v8z24_ms4_vc12_2cs_v(void)
464{
465 return 0x00000032U;
466}
467static inline u32 gmmu_pte_kind_v8z24_ms4_vc4_2cs_v(void)
468{
469 return 0x00000033U;
470}
471static inline u32 gmmu_pte_kind_v8z24_ms8_vc8_2cs_v(void)
472{
473 return 0x00000034U;
474}
475static inline u32 gmmu_pte_kind_v8z24_ms8_vc24_2cs_v(void)
476{
477 return 0x00000035U;
478}
479static inline u32 gmmu_pte_kind_v8z24_ms4_vc12_2czv_v(void)
480{
481 return 0x0000003aU;
482}
483static inline u32 gmmu_pte_kind_v8z24_ms4_vc4_2czv_v(void)
484{
485 return 0x0000003bU;
486}
487static inline u32 gmmu_pte_kind_v8z24_ms8_vc8_2czv_v(void)
488{
489 return 0x0000003cU;
490}
491static inline u32 gmmu_pte_kind_v8z24_ms8_vc24_2czv_v(void)
492{
493 return 0x0000003dU;
494}
495static inline u32 gmmu_pte_kind_v8z24_ms4_vc12_2zv_v(void)
496{
497 return 0x0000003eU;
498}
499static inline u32 gmmu_pte_kind_v8z24_ms4_vc4_2zv_v(void)
500{
501 return 0x0000003fU;
502}
503static inline u32 gmmu_pte_kind_v8z24_ms8_vc8_2zv_v(void)
504{
505 return 0x00000040U;
506}
507static inline u32 gmmu_pte_kind_v8z24_ms8_vc24_2zv_v(void)
508{
509 return 0x00000041U;
510}
511static inline u32 gmmu_pte_kind_v8z24_ms4_vc12_4cszv_v(void)
512{
513 return 0x00000042U;
514}
515static inline u32 gmmu_pte_kind_v8z24_ms4_vc4_4cszv_v(void)
516{
517 return 0x00000043U;
518}
519static inline u32 gmmu_pte_kind_v8z24_ms8_vc8_4cszv_v(void)
520{
521 return 0x00000044U;
522}
523static inline u32 gmmu_pte_kind_v8z24_ms8_vc24_4cszv_v(void)
524{
525 return 0x00000045U;
526}
527static inline u32 gmmu_pte_kind_z24s8_v(void)
528{
529 return 0x00000046U;
530}
531static inline u32 gmmu_pte_kind_z24s8_1z_v(void)
532{
533 return 0x00000047U;
534}
535static inline u32 gmmu_pte_kind_z24s8_ms2_1z_v(void)
536{
537 return 0x00000048U;
538}
539static inline u32 gmmu_pte_kind_z24s8_ms4_1z_v(void)
540{
541 return 0x00000049U;
542}
543static inline u32 gmmu_pte_kind_z24s8_ms8_1z_v(void)
544{
545 return 0x0000004aU;
546}
547static inline u32 gmmu_pte_kind_z24s8_ms16_1z_v(void)
548{
549 return 0x0000004bU;
550}
551static inline u32 gmmu_pte_kind_z24s8_2cs_v(void)
552{
553 return 0x0000004cU;
554}
555static inline u32 gmmu_pte_kind_z24s8_ms2_2cs_v(void)
556{
557 return 0x0000004dU;
558}
559static inline u32 gmmu_pte_kind_z24s8_ms4_2cs_v(void)
560{
561 return 0x0000004eU;
562}
563static inline u32 gmmu_pte_kind_z24s8_ms8_2cs_v(void)
564{
565 return 0x0000004fU;
566}
567static inline u32 gmmu_pte_kind_z24s8_ms16_2cs_v(void)
568{
569 return 0x00000050U;
570}
571static inline u32 gmmu_pte_kind_z24s8_2cz_v(void)
572{
573 return 0x00000051U;
574}
575static inline u32 gmmu_pte_kind_z24s8_ms2_2cz_v(void)
576{
577 return 0x00000052U;
578}
579static inline u32 gmmu_pte_kind_z24s8_ms4_2cz_v(void)
580{
581 return 0x00000053U;
582}
583static inline u32 gmmu_pte_kind_z24s8_ms8_2cz_v(void)
584{
585 return 0x00000054U;
586}
587static inline u32 gmmu_pte_kind_z24s8_ms16_2cz_v(void)
588{
589 return 0x00000055U;
590}
591static inline u32 gmmu_pte_kind_z24s8_4cszv_v(void)
592{
593 return 0x00000056U;
594}
595static inline u32 gmmu_pte_kind_z24s8_ms2_4cszv_v(void)
596{
597 return 0x00000057U;
598}
599static inline u32 gmmu_pte_kind_z24s8_ms4_4cszv_v(void)
600{
601 return 0x00000058U;
602}
603static inline u32 gmmu_pte_kind_z24s8_ms8_4cszv_v(void)
604{
605 return 0x00000059U;
606}
607static inline u32 gmmu_pte_kind_z24s8_ms16_4cszv_v(void)
608{
609 return 0x0000005aU;
610}
611static inline u32 gmmu_pte_kind_z24v8_ms4_vc12_v(void)
612{
613 return 0x0000005bU;
614}
615static inline u32 gmmu_pte_kind_z24v8_ms4_vc4_v(void)
616{
617 return 0x0000005cU;
618}
619static inline u32 gmmu_pte_kind_z24v8_ms8_vc8_v(void)
620{
621 return 0x0000005dU;
622}
623static inline u32 gmmu_pte_kind_z24v8_ms8_vc24_v(void)
624{
625 return 0x0000005eU;
626}
627static inline u32 gmmu_pte_kind_z24v8_ms4_vc12_1zv_v(void)
628{
629 return 0x00000063U;
630}
631static inline u32 gmmu_pte_kind_z24v8_ms4_vc4_1zv_v(void)
632{
633 return 0x00000064U;
634}
635static inline u32 gmmu_pte_kind_z24v8_ms8_vc8_1zv_v(void)
636{
637 return 0x00000065U;
638}
639static inline u32 gmmu_pte_kind_z24v8_ms8_vc24_1zv_v(void)
640{
641 return 0x00000066U;
642}
643static inline u32 gmmu_pte_kind_z24v8_ms4_vc12_2cs_v(void)
644{
645 return 0x00000067U;
646}
647static inline u32 gmmu_pte_kind_z24v8_ms4_vc4_2cs_v(void)
648{
649 return 0x00000068U;
650}
651static inline u32 gmmu_pte_kind_z24v8_ms8_vc8_2cs_v(void)
652{
653 return 0x00000069U;
654}
655static inline u32 gmmu_pte_kind_z24v8_ms8_vc24_2cs_v(void)
656{
657 return 0x0000006aU;
658}
659static inline u32 gmmu_pte_kind_z24v8_ms4_vc12_2czv_v(void)
660{
661 return 0x0000006fU;
662}
663static inline u32 gmmu_pte_kind_z24v8_ms4_vc4_2czv_v(void)
664{
665 return 0x00000070U;
666}
667static inline u32 gmmu_pte_kind_z24v8_ms8_vc8_2czv_v(void)
668{
669 return 0x00000071U;
670}
671static inline u32 gmmu_pte_kind_z24v8_ms8_vc24_2czv_v(void)
672{
673 return 0x00000072U;
674}
675static inline u32 gmmu_pte_kind_z24v8_ms4_vc12_2zv_v(void)
676{
677 return 0x00000073U;
678}
679static inline u32 gmmu_pte_kind_z24v8_ms4_vc4_2zv_v(void)
680{
681 return 0x00000074U;
682}
683static inline u32 gmmu_pte_kind_z24v8_ms8_vc8_2zv_v(void)
684{
685 return 0x00000075U;
686}
687static inline u32 gmmu_pte_kind_z24v8_ms8_vc24_2zv_v(void)
688{
689 return 0x00000076U;
690}
691static inline u32 gmmu_pte_kind_z24v8_ms4_vc12_4cszv_v(void)
692{
693 return 0x00000077U;
694}
695static inline u32 gmmu_pte_kind_z24v8_ms4_vc4_4cszv_v(void)
696{
697 return 0x00000078U;
698}
699static inline u32 gmmu_pte_kind_z24v8_ms8_vc8_4cszv_v(void)
700{
701 return 0x00000079U;
702}
703static inline u32 gmmu_pte_kind_z24v8_ms8_vc24_4cszv_v(void)
704{
705 return 0x0000007aU;
706}
707static inline u32 gmmu_pte_kind_zf32_v(void)
708{
709 return 0x0000007bU;
710}
711static inline u32 gmmu_pte_kind_zf32_1z_v(void)
712{
713 return 0x0000007cU;
714}
715static inline u32 gmmu_pte_kind_zf32_ms2_1z_v(void)
716{
717 return 0x0000007dU;
718}
719static inline u32 gmmu_pte_kind_zf32_ms4_1z_v(void)
720{
721 return 0x0000007eU;
722}
723static inline u32 gmmu_pte_kind_zf32_ms8_1z_v(void)
724{
725 return 0x0000007fU;
726}
727static inline u32 gmmu_pte_kind_zf32_ms16_1z_v(void)
728{
729 return 0x00000080U;
730}
731static inline u32 gmmu_pte_kind_zf32_2cs_v(void)
732{
733 return 0x00000081U;
734}
735static inline u32 gmmu_pte_kind_zf32_ms2_2cs_v(void)
736{
737 return 0x00000082U;
738}
739static inline u32 gmmu_pte_kind_zf32_ms4_2cs_v(void)
740{
741 return 0x00000083U;
742}
743static inline u32 gmmu_pte_kind_zf32_ms8_2cs_v(void)
744{
745 return 0x00000084U;
746}
747static inline u32 gmmu_pte_kind_zf32_ms16_2cs_v(void)
748{
749 return 0x00000085U;
750}
751static inline u32 gmmu_pte_kind_zf32_2cz_v(void)
752{
753 return 0x00000086U;
754}
755static inline u32 gmmu_pte_kind_zf32_ms2_2cz_v(void)
756{
757 return 0x00000087U;
758}
759static inline u32 gmmu_pte_kind_zf32_ms4_2cz_v(void)
760{
761 return 0x00000088U;
762}
763static inline u32 gmmu_pte_kind_zf32_ms8_2cz_v(void)
764{
765 return 0x00000089U;
766}
767static inline u32 gmmu_pte_kind_zf32_ms16_2cz_v(void)
768{
769 return 0x0000008aU;
770}
771static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms4_vc12_v(void)
772{
773 return 0x0000008bU;
774}
775static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms4_vc4_v(void)
776{
777 return 0x0000008cU;
778}
779static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms8_vc8_v(void)
780{
781 return 0x0000008dU;
782}
783static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms8_vc24_v(void)
784{
785 return 0x0000008eU;
786}
787static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms4_vc12_1cs_v(void)
788{
789 return 0x0000008fU;
790}
791static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms4_vc4_1cs_v(void)
792{
793 return 0x00000090U;
794}
795static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms8_vc8_1cs_v(void)
796{
797 return 0x00000091U;
798}
799static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms8_vc24_1cs_v(void)
800{
801 return 0x00000092U;
802}
803static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms4_vc12_1zv_v(void)
804{
805 return 0x00000097U;
806}
807static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms4_vc4_1zv_v(void)
808{
809 return 0x00000098U;
810}
811static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms8_vc8_1zv_v(void)
812{
813 return 0x00000099U;
814}
815static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms8_vc24_1zv_v(void)
816{
817 return 0x0000009aU;
818}
819static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms4_vc12_1czv_v(void)
820{
821 return 0x0000009bU;
822}
823static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms4_vc4_1czv_v(void)
824{
825 return 0x0000009cU;
826}
827static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms8_vc8_1czv_v(void)
828{
829 return 0x0000009dU;
830}
831static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms8_vc24_1czv_v(void)
832{
833 return 0x0000009eU;
834}
835static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms4_vc12_2cs_v(void)
836{
837 return 0x0000009fU;
838}
839static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms4_vc4_2cs_v(void)
840{
841 return 0x000000a0U;
842}
843static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms8_vc8_2cs_v(void)
844{
845 return 0x000000a1U;
846}
847static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms8_vc24_2cs_v(void)
848{
849 return 0x000000a2U;
850}
851static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms4_vc12_2cszv_v(void)
852{
853 return 0x000000a3U;
854}
855static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms4_vc4_2cszv_v(void)
856{
857 return 0x000000a4U;
858}
859static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms8_vc8_2cszv_v(void)
860{
861 return 0x000000a5U;
862}
863static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms8_vc24_2cszv_v(void)
864{
865 return 0x000000a6U;
866}
867static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms4_vc12_v(void)
868{
869 return 0x000000a7U;
870}
871static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms4_vc4_v(void)
872{
873 return 0x000000a8U;
874}
875static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms8_vc8_v(void)
876{
877 return 0x000000a9U;
878}
879static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms8_vc24_v(void)
880{
881 return 0x000000aaU;
882}
883static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms4_vc12_1cs_v(void)
884{
885 return 0x000000abU;
886}
887static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms4_vc4_1cs_v(void)
888{
889 return 0x000000acU;
890}
891static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms8_vc8_1cs_v(void)
892{
893 return 0x000000adU;
894}
895static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms8_vc24_1cs_v(void)
896{
897 return 0x000000aeU;
898}
899static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms4_vc12_1zv_v(void)
900{
901 return 0x000000b3U;
902}
903static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms4_vc4_1zv_v(void)
904{
905 return 0x000000b4U;
906}
907static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms8_vc8_1zv_v(void)
908{
909 return 0x000000b5U;
910}
911static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms8_vc24_1zv_v(void)
912{
913 return 0x000000b6U;
914}
915static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms4_vc12_1czv_v(void)
916{
917 return 0x000000b7U;
918}
919static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms4_vc4_1czv_v(void)
920{
921 return 0x000000b8U;
922}
923static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms8_vc8_1czv_v(void)
924{
925 return 0x000000b9U;
926}
927static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms8_vc24_1czv_v(void)
928{
929 return 0x000000baU;
930}
931static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms4_vc12_2cs_v(void)
932{
933 return 0x000000bbU;
934}
935static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms4_vc4_2cs_v(void)
936{
937 return 0x000000bcU;
938}
939static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms8_vc8_2cs_v(void)
940{
941 return 0x000000bdU;
942}
943static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms8_vc24_2cs_v(void)
944{
945 return 0x000000beU;
946}
947static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms4_vc12_2cszv_v(void)
948{
949 return 0x000000bfU;
950}
951static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms4_vc4_2cszv_v(void)
952{
953 return 0x000000c0U;
954}
955static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms8_vc8_2cszv_v(void)
956{
957 return 0x000000c1U;
958}
959static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms8_vc24_2cszv_v(void)
960{
961 return 0x000000c2U;
962}
963static inline u32 gmmu_pte_kind_zf32_x24s8_v(void)
964{
965 return 0x000000c3U;
966}
967static inline u32 gmmu_pte_kind_zf32_x24s8_1cs_v(void)
968{
969 return 0x000000c4U;
970}
971static inline u32 gmmu_pte_kind_zf32_x24s8_ms2_1cs_v(void)
972{
973 return 0x000000c5U;
974}
975static inline u32 gmmu_pte_kind_zf32_x24s8_ms4_1cs_v(void)
976{
977 return 0x000000c6U;
978}
979static inline u32 gmmu_pte_kind_zf32_x24s8_ms8_1cs_v(void)
980{
981 return 0x000000c7U;
982}
983static inline u32 gmmu_pte_kind_zf32_x24s8_ms16_1cs_v(void)
984{
985 return 0x000000c8U;
986}
987static inline u32 gmmu_pte_kind_zf32_x24s8_2cszv_v(void)
988{
989 return 0x000000ceU;
990}
991static inline u32 gmmu_pte_kind_zf32_x24s8_ms2_2cszv_v(void)
992{
993 return 0x000000cfU;
994}
995static inline u32 gmmu_pte_kind_zf32_x24s8_ms4_2cszv_v(void)
996{
997 return 0x000000d0U;
998}
999static inline u32 gmmu_pte_kind_zf32_x24s8_ms8_2cszv_v(void)
1000{
1001 return 0x000000d1U;
1002}
1003static inline u32 gmmu_pte_kind_zf32_x24s8_ms16_2cszv_v(void)
1004{
1005 return 0x000000d2U;
1006}
1007static inline u32 gmmu_pte_kind_zf32_x24s8_2cs_v(void)
1008{
1009 return 0x000000d3U;
1010}
1011static inline u32 gmmu_pte_kind_zf32_x24s8_ms2_2cs_v(void)
1012{
1013 return 0x000000d4U;
1014}
1015static inline u32 gmmu_pte_kind_zf32_x24s8_ms4_2cs_v(void)
1016{
1017 return 0x000000d5U;
1018}
1019static inline u32 gmmu_pte_kind_zf32_x24s8_ms8_2cs_v(void)
1020{
1021 return 0x000000d6U;
1022}
1023static inline u32 gmmu_pte_kind_zf32_x24s8_ms16_2cs_v(void)
1024{
1025 return 0x000000d7U;
1026}
1027static inline u32 gmmu_pte_kind_generic_16bx2_v(void)
1028{
1029 return 0x000000feU;
1030}
1031static inline u32 gmmu_pte_kind_c32_2c_v(void)
1032{
1033 return 0x000000d8U;
1034}
1035static inline u32 gmmu_pte_kind_c32_2cbr_v(void)
1036{
1037 return 0x000000d9U;
1038}
1039static inline u32 gmmu_pte_kind_c32_2cba_v(void)
1040{
1041 return 0x000000daU;
1042}
1043static inline u32 gmmu_pte_kind_c32_2cra_v(void)
1044{
1045 return 0x000000dbU;
1046}
1047static inline u32 gmmu_pte_kind_c32_2bra_v(void)
1048{
1049 return 0x000000dcU;
1050}
1051static inline u32 gmmu_pte_kind_c32_ms2_2c_v(void)
1052{
1053 return 0x000000ddU;
1054}
1055static inline u32 gmmu_pte_kind_c32_ms2_2cbr_v(void)
1056{
1057 return 0x000000deU;
1058}
1059static inline u32 gmmu_pte_kind_c32_ms2_2cra_v(void)
1060{
1061 return 0x000000ccU;
1062}
1063static inline u32 gmmu_pte_kind_c32_ms4_2c_v(void)
1064{
1065 return 0x000000dfU;
1066}
1067static inline u32 gmmu_pte_kind_c32_ms4_2cbr_v(void)
1068{
1069 return 0x000000e0U;
1070}
1071static inline u32 gmmu_pte_kind_c32_ms4_2cba_v(void)
1072{
1073 return 0x000000e1U;
1074}
1075static inline u32 gmmu_pte_kind_c32_ms4_2cra_v(void)
1076{
1077 return 0x000000e2U;
1078}
1079static inline u32 gmmu_pte_kind_c32_ms4_2bra_v(void)
1080{
1081 return 0x000000e3U;
1082}
1083static inline u32 gmmu_pte_kind_c32_ms8_ms16_2c_v(void)
1084{
1085 return 0x000000e4U;
1086}
1087static inline u32 gmmu_pte_kind_c32_ms8_ms16_2cra_v(void)
1088{
1089 return 0x000000e5U;
1090}
1091static inline u32 gmmu_pte_kind_c64_2c_v(void)
1092{
1093 return 0x000000e6U;
1094}
1095static inline u32 gmmu_pte_kind_c64_2cbr_v(void)
1096{
1097 return 0x000000e7U;
1098}
1099static inline u32 gmmu_pte_kind_c64_2cba_v(void)
1100{
1101 return 0x000000e8U;
1102}
1103static inline u32 gmmu_pte_kind_c64_2cra_v(void)
1104{
1105 return 0x000000e9U;
1106}
1107static inline u32 gmmu_pte_kind_c64_2bra_v(void)
1108{
1109 return 0x000000eaU;
1110}
1111static inline u32 gmmu_pte_kind_c64_ms2_2c_v(void)
1112{
1113 return 0x000000ebU;
1114}
1115static inline u32 gmmu_pte_kind_c64_ms2_2cbr_v(void)
1116{
1117 return 0x000000ecU;
1118}
1119static inline u32 gmmu_pte_kind_c64_ms2_2cra_v(void)
1120{
1121 return 0x000000cdU;
1122}
1123static inline u32 gmmu_pte_kind_c64_ms4_2c_v(void)
1124{
1125 return 0x000000edU;
1126}
1127static inline u32 gmmu_pte_kind_c64_ms4_2cbr_v(void)
1128{
1129 return 0x000000eeU;
1130}
1131static inline u32 gmmu_pte_kind_c64_ms4_2cba_v(void)
1132{
1133 return 0x000000efU;
1134}
1135static inline u32 gmmu_pte_kind_c64_ms4_2cra_v(void)
1136{
1137 return 0x000000f0U;
1138}
1139static inline u32 gmmu_pte_kind_c64_ms4_2bra_v(void)
1140{
1141 return 0x000000f1U;
1142}
1143static inline u32 gmmu_pte_kind_c64_ms8_ms16_2c_v(void)
1144{
1145 return 0x000000f2U;
1146}
1147static inline u32 gmmu_pte_kind_c64_ms8_ms16_2cra_v(void)
1148{
1149 return 0x000000f3U;
1150}
1151static inline u32 gmmu_pte_kind_c128_2c_v(void)
1152{
1153 return 0x000000f4U;
1154}
1155static inline u32 gmmu_pte_kind_c128_2cr_v(void)
1156{
1157 return 0x000000f5U;
1158}
1159static inline u32 gmmu_pte_kind_c128_ms2_2c_v(void)
1160{
1161 return 0x000000f6U;
1162}
1163static inline u32 gmmu_pte_kind_c128_ms2_2cr_v(void)
1164{
1165 return 0x000000f7U;
1166}
1167static inline u32 gmmu_pte_kind_c128_ms4_2c_v(void)
1168{
1169 return 0x000000f8U;
1170}
1171static inline u32 gmmu_pte_kind_c128_ms4_2cr_v(void)
1172{
1173 return 0x000000f9U;
1174}
1175static inline u32 gmmu_pte_kind_c128_ms8_ms16_2c_v(void)
1176{
1177 return 0x000000faU;
1178}
1179static inline u32 gmmu_pte_kind_c128_ms8_ms16_2cr_v(void)
1180{
1181 return 0x000000fbU;
1182}
1183static inline u32 gmmu_pte_kind_x8c24_v(void)
1184{
1185 return 0x000000fcU;
1186}
1187static inline u32 gmmu_pte_kind_pitch_no_swizzle_v(void)
1188{
1189 return 0x000000fdU;
1190}
1191static inline u32 gmmu_pte_kind_smsked_message_v(void)
1192{
1193 return 0x000000caU;
1194}
1195static inline u32 gmmu_pte_kind_smhost_message_v(void)
1196{
1197 return 0x000000cbU;
1198}
1199#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_gr_gk20a.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_gr_gk20a.h
new file mode 100644
index 00000000..ef259bcf
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_gr_gk20a.h
@@ -0,0 +1,3771 @@
1/*
2 * Copyright (c) 2014-2017, 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_gr_gk20a_h_
57#define _hw_gr_gk20a_h_
58
59static inline u32 gr_intr_r(void)
60{
61 return 0x00400100U;
62}
63static inline u32 gr_intr_notify_pending_f(void)
64{
65 return 0x1U;
66}
67static inline u32 gr_intr_notify_reset_f(void)
68{
69 return 0x1U;
70}
71static inline u32 gr_intr_semaphore_pending_f(void)
72{
73 return 0x2U;
74}
75static inline u32 gr_intr_semaphore_reset_f(void)
76{
77 return 0x2U;
78}
79static inline u32 gr_intr_semaphore_timeout_not_pending_f(void)
80{
81 return 0x0U;
82}
83static inline u32 gr_intr_semaphore_timeout_pending_f(void)
84{
85 return 0x4U;
86}
87static inline u32 gr_intr_semaphore_timeout_reset_f(void)
88{
89 return 0x4U;
90}
91static inline u32 gr_intr_illegal_method_pending_f(void)
92{
93 return 0x10U;
94}
95static inline u32 gr_intr_illegal_method_reset_f(void)
96{
97 return 0x10U;
98}
99static inline u32 gr_intr_illegal_notify_pending_f(void)
100{
101 return 0x40U;
102}
103static inline u32 gr_intr_illegal_notify_reset_f(void)
104{
105 return 0x40U;
106}
107static inline u32 gr_intr_firmware_method_f(u32 v)
108{
109 return (v & 0x1U) << 8U;
110}
111static inline u32 gr_intr_firmware_method_pending_f(void)
112{
113 return 0x100U;
114}
115static inline u32 gr_intr_firmware_method_reset_f(void)
116{
117 return 0x100U;
118}
119static inline u32 gr_intr_illegal_class_pending_f(void)
120{
121 return 0x20U;
122}
123static inline u32 gr_intr_illegal_class_reset_f(void)
124{
125 return 0x20U;
126}
127static inline u32 gr_intr_fecs_error_pending_f(void)
128{
129 return 0x80000U;
130}
131static inline u32 gr_intr_fecs_error_reset_f(void)
132{
133 return 0x80000U;
134}
135static inline u32 gr_intr_class_error_pending_f(void)
136{
137 return 0x100000U;
138}
139static inline u32 gr_intr_class_error_reset_f(void)
140{
141 return 0x100000U;
142}
143static inline u32 gr_intr_exception_pending_f(void)
144{
145 return 0x200000U;
146}
147static inline u32 gr_intr_exception_reset_f(void)
148{
149 return 0x200000U;
150}
151static inline u32 gr_fecs_intr_r(void)
152{
153 return 0x00400144U;
154}
155static inline u32 gr_class_error_r(void)
156{
157 return 0x00400110U;
158}
159static inline u32 gr_class_error_code_v(u32 r)
160{
161 return (r >> 0U) & 0xffffU;
162}
163static inline u32 gr_intr_nonstall_r(void)
164{
165 return 0x00400120U;
166}
167static inline u32 gr_intr_nonstall_trap_pending_f(void)
168{
169 return 0x2U;
170}
171static inline u32 gr_intr_en_r(void)
172{
173 return 0x0040013cU;
174}
175static inline u32 gr_exception_r(void)
176{
177 return 0x00400108U;
178}
179static inline u32 gr_exception_fe_m(void)
180{
181 return 0x1U << 0U;
182}
183static inline u32 gr_exception_gpc_m(void)
184{
185 return 0x1U << 24U;
186}
187static inline u32 gr_exception_memfmt_m(void)
188{
189 return 0x1U << 1U;
190}
191static inline u32 gr_exception_ds_m(void)
192{
193 return 0x1U << 4U;
194}
195static inline u32 gr_exception_sked_m(void)
196{
197 return 0x1U << 8U;
198}
199static inline u32 gr_exception1_r(void)
200{
201 return 0x00400118U;
202}
203static inline u32 gr_exception1_gpc_0_pending_f(void)
204{
205 return 0x1U;
206}
207static inline u32 gr_exception2_r(void)
208{
209 return 0x0040011cU;
210}
211static inline u32 gr_exception_en_r(void)
212{
213 return 0x00400138U;
214}
215static inline u32 gr_exception_en_fe_m(void)
216{
217 return 0x1U << 0U;
218}
219static inline u32 gr_exception1_en_r(void)
220{
221 return 0x00400130U;
222}
223static inline u32 gr_exception2_en_r(void)
224{
225 return 0x00400134U;
226}
227static inline u32 gr_gpfifo_ctl_r(void)
228{
229 return 0x00400500U;
230}
231static inline u32 gr_gpfifo_ctl_access_f(u32 v)
232{
233 return (v & 0x1U) << 0U;
234}
235static inline u32 gr_gpfifo_ctl_access_disabled_f(void)
236{
237 return 0x0U;
238}
239static inline u32 gr_gpfifo_ctl_access_enabled_f(void)
240{
241 return 0x1U;
242}
243static inline u32 gr_gpfifo_ctl_semaphore_access_f(u32 v)
244{
245 return (v & 0x1U) << 16U;
246}
247static inline u32 gr_gpfifo_ctl_semaphore_access_enabled_v(void)
248{
249 return 0x00000001U;
250}
251static inline u32 gr_gpfifo_ctl_semaphore_access_enabled_f(void)
252{
253 return 0x10000U;
254}
255static inline u32 gr_gpfifo_status_r(void)
256{
257 return 0x00400504U;
258}
259static inline u32 gr_trapped_addr_r(void)
260{
261 return 0x00400704U;
262}
263static inline u32 gr_trapped_addr_mthd_v(u32 r)
264{
265 return (r >> 2U) & 0xfffU;
266}
267static inline u32 gr_trapped_addr_subch_v(u32 r)
268{
269 return (r >> 16U) & 0x7U;
270}
271static inline u32 gr_trapped_addr_mme_generated_v(u32 r)
272{
273 return (r >> 20U) & 0x1U;
274}
275static inline u32 gr_trapped_addr_datahigh_v(u32 r)
276{
277 return (r >> 24U) & 0x1U;
278}
279static inline u32 gr_trapped_addr_priv_v(u32 r)
280{
281 return (r >> 28U) & 0x1U;
282}
283static inline u32 gr_trapped_addr_status_v(u32 r)
284{
285 return (r >> 31U) & 0x1U;
286}
287static inline u32 gr_trapped_data_lo_r(void)
288{
289 return 0x00400708U;
290}
291static inline u32 gr_trapped_data_hi_r(void)
292{
293 return 0x0040070cU;
294}
295static inline u32 gr_trapped_data_mme_r(void)
296{
297 return 0x00400710U;
298}
299static inline u32 gr_trapped_data_mme_pc_v(u32 r)
300{
301 return (r >> 0U) & 0x7ffU;
302}
303static inline u32 gr_status_r(void)
304{
305 return 0x00400700U;
306}
307static inline u32 gr_status_fe_method_upper_v(u32 r)
308{
309 return (r >> 1U) & 0x1U;
310}
311static inline u32 gr_status_fe_method_lower_v(u32 r)
312{
313 return (r >> 2U) & 0x1U;
314}
315static inline u32 gr_status_fe_method_lower_idle_v(void)
316{
317 return 0x00000000U;
318}
319static inline u32 gr_status_fe_gi_v(u32 r)
320{
321 return (r >> 21U) & 0x1U;
322}
323static inline u32 gr_status_mask_r(void)
324{
325 return 0x00400610U;
326}
327static inline u32 gr_status_1_r(void)
328{
329 return 0x00400604U;
330}
331static inline u32 gr_status_2_r(void)
332{
333 return 0x00400608U;
334}
335static inline u32 gr_engine_status_r(void)
336{
337 return 0x0040060cU;
338}
339static inline u32 gr_engine_status_value_busy_f(void)
340{
341 return 0x1U;
342}
343static inline u32 gr_pri_be0_becs_be_exception_r(void)
344{
345 return 0x00410204U;
346}
347static inline u32 gr_pri_be0_becs_be_exception_en_r(void)
348{
349 return 0x00410208U;
350}
351static inline u32 gr_pri_gpc0_gpccs_gpc_exception_r(void)
352{
353 return 0x00502c90U;
354}
355static inline u32 gr_pri_gpc0_gpccs_gpc_exception_en_r(void)
356{
357 return 0x00502c94U;
358}
359static inline u32 gr_pri_gpc0_tpc0_tpccs_tpc_exception_r(void)
360{
361 return 0x00504508U;
362}
363static inline u32 gr_pri_gpc0_tpc0_tpccs_tpc_exception_en_r(void)
364{
365 return 0x0050450cU;
366}
367static inline u32 gr_activity_0_r(void)
368{
369 return 0x00400380U;
370}
371static inline u32 gr_activity_1_r(void)
372{
373 return 0x00400384U;
374}
375static inline u32 gr_activity_2_r(void)
376{
377 return 0x00400388U;
378}
379static inline u32 gr_activity_4_r(void)
380{
381 return 0x00400390U;
382}
383static inline u32 gr_pri_gpc0_gcc_dbg_r(void)
384{
385 return 0x00501000U;
386}
387static inline u32 gr_pri_gpcs_gcc_dbg_r(void)
388{
389 return 0x00419000U;
390}
391static inline u32 gr_pri_gpcs_gcc_dbg_invalidate_m(void)
392{
393 return 0x1U << 1U;
394}
395static inline u32 gr_pri_gpc0_tpc0_sm_cache_control_r(void)
396{
397 return 0x005046a4U;
398}
399static inline u32 gr_pri_gpcs_tpcs_sm_cache_control_r(void)
400{
401 return 0x00419ea4U;
402}
403static inline u32 gr_pri_gpcs_tpcs_sm_cache_control_invalidate_cache_m(void)
404{
405 return 0x1U << 0U;
406}
407static inline u32 gr_pri_sked_activity_r(void)
408{
409 return 0x00407054U;
410}
411static inline u32 gr_pri_gpc0_gpccs_gpc_activity0_r(void)
412{
413 return 0x00502c80U;
414}
415static inline u32 gr_pri_gpc0_gpccs_gpc_activity1_r(void)
416{
417 return 0x00502c84U;
418}
419static inline u32 gr_pri_gpc0_gpccs_gpc_activity2_r(void)
420{
421 return 0x00502c88U;
422}
423static inline u32 gr_pri_gpc0_gpccs_gpc_activity3_r(void)
424{
425 return 0x00502c8cU;
426}
427static inline u32 gr_pri_gpc0_tpc0_tpccs_tpc_activity_0_r(void)
428{
429 return 0x00504500U;
430}
431static inline u32 gr_pri_gpc0_tpcs_tpccs_tpc_activity_0_r(void)
432{
433 return 0x00501d00U;
434}
435static inline u32 gr_pri_gpcs_gpccs_gpc_activity_0_r(void)
436{
437 return 0x0041ac80U;
438}
439static inline u32 gr_pri_gpcs_gpccs_gpc_activity_1_r(void)
440{
441 return 0x0041ac84U;
442}
443static inline u32 gr_pri_gpcs_gpccs_gpc_activity_2_r(void)
444{
445 return 0x0041ac88U;
446}
447static inline u32 gr_pri_gpcs_gpccs_gpc_activity_3_r(void)
448{
449 return 0x0041ac8cU;
450}
451static inline u32 gr_pri_gpcs_tpc0_tpccs_tpc_activity_0_r(void)
452{
453 return 0x0041c500U;
454}
455static inline u32 gr_pri_gpcs_tpcs_tpccs_tpc_activity_0_r(void)
456{
457 return 0x00419d00U;
458}
459static inline u32 gr_pri_be0_becs_be_activity0_r(void)
460{
461 return 0x00410200U;
462}
463static inline u32 gr_pri_bes_becs_be_activity0_r(void)
464{
465 return 0x00408a00U;
466}
467static inline u32 gr_pri_ds_mpipe_status_r(void)
468{
469 return 0x00405858U;
470}
471static inline u32 gr_pri_fe_go_idle_on_status_r(void)
472{
473 return 0x00404150U;
474}
475static inline u32 gr_pri_fe_go_idle_check_r(void)
476{
477 return 0x00404158U;
478}
479static inline u32 gr_pri_fe_go_idle_info_r(void)
480{
481 return 0x00404194U;
482}
483static inline u32 gr_pri_gpc0_tpc0_tex_m_tex_subunits_status_r(void)
484{
485 return 0x00504238U;
486}
487static inline u32 gr_pri_be0_crop_status1_r(void)
488{
489 return 0x00410134U;
490}
491static inline u32 gr_pri_bes_crop_status1_r(void)
492{
493 return 0x00408934U;
494}
495static inline u32 gr_pri_be0_zrop_status_r(void)
496{
497 return 0x00410048U;
498}
499static inline u32 gr_pri_be0_zrop_status2_r(void)
500{
501 return 0x0041004cU;
502}
503static inline u32 gr_pri_bes_zrop_status_r(void)
504{
505 return 0x00408848U;
506}
507static inline u32 gr_pri_bes_zrop_status2_r(void)
508{
509 return 0x0040884cU;
510}
511static inline u32 gr_pipe_bundle_address_r(void)
512{
513 return 0x00400200U;
514}
515static inline u32 gr_pipe_bundle_address_value_v(u32 r)
516{
517 return (r >> 0U) & 0xffffU;
518}
519static inline u32 gr_pipe_bundle_data_r(void)
520{
521 return 0x00400204U;
522}
523static inline u32 gr_pipe_bundle_config_r(void)
524{
525 return 0x00400208U;
526}
527static inline u32 gr_pipe_bundle_config_override_pipe_mode_disabled_f(void)
528{
529 return 0x0U;
530}
531static inline u32 gr_pipe_bundle_config_override_pipe_mode_enabled_f(void)
532{
533 return 0x80000000U;
534}
535static inline u32 gr_fe_hww_esr_r(void)
536{
537 return 0x00404000U;
538}
539static inline u32 gr_fe_hww_esr_reset_active_f(void)
540{
541 return 0x40000000U;
542}
543static inline u32 gr_fe_hww_esr_en_enable_f(void)
544{
545 return 0x80000000U;
546}
547static inline u32 gr_fe_go_idle_timeout_r(void)
548{
549 return 0x00404154U;
550}
551static inline u32 gr_fe_go_idle_timeout_count_f(u32 v)
552{
553 return (v & 0xffffffffU) << 0U;
554}
555static inline u32 gr_fe_go_idle_timeout_count_disabled_f(void)
556{
557 return 0x0U;
558}
559static inline u32 gr_fe_go_idle_timeout_count_prod_f(void)
560{
561 return 0x800U;
562}
563static inline u32 gr_fe_object_table_r(u32 i)
564{
565 return 0x00404200U + i*4U;
566}
567static inline u32 gr_fe_object_table_nvclass_v(u32 r)
568{
569 return (r >> 0U) & 0xffffU;
570}
571static inline u32 gr_pri_mme_shadow_raw_index_r(void)
572{
573 return 0x00404488U;
574}
575static inline u32 gr_pri_mme_shadow_raw_index_write_trigger_f(void)
576{
577 return 0x80000000U;
578}
579static inline u32 gr_pri_mme_shadow_raw_data_r(void)
580{
581 return 0x0040448cU;
582}
583static inline u32 gr_mme_hww_esr_r(void)
584{
585 return 0x00404490U;
586}
587static inline u32 gr_mme_hww_esr_reset_active_f(void)
588{
589 return 0x40000000U;
590}
591static inline u32 gr_mme_hww_esr_en_enable_f(void)
592{
593 return 0x80000000U;
594}
595static inline u32 gr_memfmt_hww_esr_r(void)
596{
597 return 0x00404600U;
598}
599static inline u32 gr_memfmt_hww_esr_reset_active_f(void)
600{
601 return 0x40000000U;
602}
603static inline u32 gr_memfmt_hww_esr_en_enable_f(void)
604{
605 return 0x80000000U;
606}
607static inline u32 gr_fecs_cpuctl_r(void)
608{
609 return 0x00409100U;
610}
611static inline u32 gr_fecs_cpuctl_startcpu_f(u32 v)
612{
613 return (v & 0x1U) << 1U;
614}
615static inline u32 gr_fecs_dmactl_r(void)
616{
617 return 0x0040910cU;
618}
619static inline u32 gr_fecs_dmactl_require_ctx_f(u32 v)
620{
621 return (v & 0x1U) << 0U;
622}
623static inline u32 gr_fecs_dmactl_dmem_scrubbing_m(void)
624{
625 return 0x1U << 1U;
626}
627static inline u32 gr_fecs_dmactl_imem_scrubbing_m(void)
628{
629 return 0x1U << 2U;
630}
631static inline u32 gr_fecs_os_r(void)
632{
633 return 0x00409080U;
634}
635static inline u32 gr_fecs_idlestate_r(void)
636{
637 return 0x0040904cU;
638}
639static inline u32 gr_fecs_mailbox0_r(void)
640{
641 return 0x00409040U;
642}
643static inline u32 gr_fecs_mailbox1_r(void)
644{
645 return 0x00409044U;
646}
647static inline u32 gr_fecs_irqstat_r(void)
648{
649 return 0x00409008U;
650}
651static inline u32 gr_fecs_irqmode_r(void)
652{
653 return 0x0040900cU;
654}
655static inline u32 gr_fecs_irqmask_r(void)
656{
657 return 0x00409018U;
658}
659static inline u32 gr_fecs_irqdest_r(void)
660{
661 return 0x0040901cU;
662}
663static inline u32 gr_fecs_curctx_r(void)
664{
665 return 0x00409050U;
666}
667static inline u32 gr_fecs_nxtctx_r(void)
668{
669 return 0x00409054U;
670}
671static inline u32 gr_fecs_engctl_r(void)
672{
673 return 0x004090a4U;
674}
675static inline u32 gr_fecs_debug1_r(void)
676{
677 return 0x00409090U;
678}
679static inline u32 gr_fecs_debuginfo_r(void)
680{
681 return 0x00409094U;
682}
683static inline u32 gr_fecs_icd_cmd_r(void)
684{
685 return 0x00409200U;
686}
687static inline u32 gr_fecs_icd_cmd_opc_s(void)
688{
689 return 4U;
690}
691static inline u32 gr_fecs_icd_cmd_opc_f(u32 v)
692{
693 return (v & 0xfU) << 0U;
694}
695static inline u32 gr_fecs_icd_cmd_opc_m(void)
696{
697 return 0xfU << 0U;
698}
699static inline u32 gr_fecs_icd_cmd_opc_v(u32 r)
700{
701 return (r >> 0U) & 0xfU;
702}
703static inline u32 gr_fecs_icd_cmd_opc_rreg_f(void)
704{
705 return 0x8U;
706}
707static inline u32 gr_fecs_icd_cmd_opc_rstat_f(void)
708{
709 return 0xeU;
710}
711static inline u32 gr_fecs_icd_cmd_idx_f(u32 v)
712{
713 return (v & 0x1fU) << 8U;
714}
715static inline u32 gr_fecs_icd_rdata_r(void)
716{
717 return 0x0040920cU;
718}
719static inline u32 gr_fecs_imemc_r(u32 i)
720{
721 return 0x00409180U + i*16U;
722}
723static inline u32 gr_fecs_imemc_offs_f(u32 v)
724{
725 return (v & 0x3fU) << 2U;
726}
727static inline u32 gr_fecs_imemc_blk_f(u32 v)
728{
729 return (v & 0xffU) << 8U;
730}
731static inline u32 gr_fecs_imemc_aincw_f(u32 v)
732{
733 return (v & 0x1U) << 24U;
734}
735static inline u32 gr_fecs_imemd_r(u32 i)
736{
737 return 0x00409184U + i*16U;
738}
739static inline u32 gr_fecs_imemt_r(u32 i)
740{
741 return 0x00409188U + i*16U;
742}
743static inline u32 gr_fecs_imemt_tag_f(u32 v)
744{
745 return (v & 0xffffU) << 0U;
746}
747static inline u32 gr_fecs_dmemc_r(u32 i)
748{
749 return 0x004091c0U + i*8U;
750}
751static inline u32 gr_fecs_dmemc_offs_s(void)
752{
753 return 6U;
754}
755static inline u32 gr_fecs_dmemc_offs_f(u32 v)
756{
757 return (v & 0x3fU) << 2U;
758}
759static inline u32 gr_fecs_dmemc_offs_m(void)
760{
761 return 0x3fU << 2U;
762}
763static inline u32 gr_fecs_dmemc_offs_v(u32 r)
764{
765 return (r >> 2U) & 0x3fU;
766}
767static inline u32 gr_fecs_dmemc_blk_f(u32 v)
768{
769 return (v & 0xffU) << 8U;
770}
771static inline u32 gr_fecs_dmemc_aincw_f(u32 v)
772{
773 return (v & 0x1U) << 24U;
774}
775static inline u32 gr_fecs_dmemd_r(u32 i)
776{
777 return 0x004091c4U + i*8U;
778}
779static inline u32 gr_fecs_dmatrfbase_r(void)
780{
781 return 0x00409110U;
782}
783static inline u32 gr_fecs_dmatrfmoffs_r(void)
784{
785 return 0x00409114U;
786}
787static inline u32 gr_fecs_dmatrffboffs_r(void)
788{
789 return 0x0040911cU;
790}
791static inline u32 gr_fecs_dmatrfcmd_r(void)
792{
793 return 0x00409118U;
794}
795static inline u32 gr_fecs_dmatrfcmd_imem_f(u32 v)
796{
797 return (v & 0x1U) << 4U;
798}
799static inline u32 gr_fecs_dmatrfcmd_write_f(u32 v)
800{
801 return (v & 0x1U) << 5U;
802}
803static inline u32 gr_fecs_dmatrfcmd_size_f(u32 v)
804{
805 return (v & 0x7U) << 8U;
806}
807static inline u32 gr_fecs_dmatrfcmd_ctxdma_f(u32 v)
808{
809 return (v & 0x7U) << 12U;
810}
811static inline u32 gr_fecs_bootvec_r(void)
812{
813 return 0x00409104U;
814}
815static inline u32 gr_fecs_bootvec_vec_f(u32 v)
816{
817 return (v & 0xffffffffU) << 0U;
818}
819static inline u32 gr_fecs_falcon_hwcfg_r(void)
820{
821 return 0x00409108U;
822}
823static inline u32 gr_gpcs_gpccs_falcon_hwcfg_r(void)
824{
825 return 0x0041a108U;
826}
827static inline u32 gr_fecs_falcon_rm_r(void)
828{
829 return 0x00409084U;
830}
831static inline u32 gr_fecs_current_ctx_r(void)
832{
833 return 0x00409b00U;
834}
835static inline u32 gr_fecs_current_ctx_ptr_f(u32 v)
836{
837 return (v & 0xfffffffU) << 0U;
838}
839static inline u32 gr_fecs_current_ctx_ptr_v(u32 r)
840{
841 return (r >> 0U) & 0xfffffffU;
842}
843static inline u32 gr_fecs_current_ctx_target_s(void)
844{
845 return 2U;
846}
847static inline u32 gr_fecs_current_ctx_target_f(u32 v)
848{
849 return (v & 0x3U) << 28U;
850}
851static inline u32 gr_fecs_current_ctx_target_m(void)
852{
853 return 0x3U << 28U;
854}
855static inline u32 gr_fecs_current_ctx_target_v(u32 r)
856{
857 return (r >> 28U) & 0x3U;
858}
859static inline u32 gr_fecs_current_ctx_target_vid_mem_f(void)
860{
861 return 0x0U;
862}
863static inline u32 gr_fecs_current_ctx_target_sys_mem_coh_f(void)
864{
865 return 0x20000000U;
866}
867static inline u32 gr_fecs_current_ctx_target_sys_mem_ncoh_f(void)
868{
869 return 0x30000000U;
870}
871static inline u32 gr_fecs_current_ctx_valid_s(void)
872{
873 return 1U;
874}
875static inline u32 gr_fecs_current_ctx_valid_f(u32 v)
876{
877 return (v & 0x1U) << 31U;
878}
879static inline u32 gr_fecs_current_ctx_valid_m(void)
880{
881 return 0x1U << 31U;
882}
883static inline u32 gr_fecs_current_ctx_valid_v(u32 r)
884{
885 return (r >> 31U) & 0x1U;
886}
887static inline u32 gr_fecs_current_ctx_valid_false_f(void)
888{
889 return 0x0U;
890}
891static inline u32 gr_fecs_method_data_r(void)
892{
893 return 0x00409500U;
894}
895static inline u32 gr_fecs_method_push_r(void)
896{
897 return 0x00409504U;
898}
899static inline u32 gr_fecs_method_push_adr_f(u32 v)
900{
901 return (v & 0xfffU) << 0U;
902}
903static inline u32 gr_fecs_method_push_adr_bind_pointer_v(void)
904{
905 return 0x00000003U;
906}
907static inline u32 gr_fecs_method_push_adr_bind_pointer_f(void)
908{
909 return 0x3U;
910}
911static inline u32 gr_fecs_method_push_adr_discover_image_size_v(void)
912{
913 return 0x00000010U;
914}
915static inline u32 gr_fecs_method_push_adr_wfi_golden_save_v(void)
916{
917 return 0x00000009U;
918}
919static inline u32 gr_fecs_method_push_adr_restore_golden_v(void)
920{
921 return 0x00000015U;
922}
923static inline u32 gr_fecs_method_push_adr_discover_zcull_image_size_v(void)
924{
925 return 0x00000016U;
926}
927static inline u32 gr_fecs_method_push_adr_discover_pm_image_size_v(void)
928{
929 return 0x00000025U;
930}
931static inline u32 gr_fecs_method_push_adr_discover_reglist_image_size_v(void)
932{
933 return 0x00000030U;
934}
935static inline u32 gr_fecs_method_push_adr_set_reglist_bind_instance_v(void)
936{
937 return 0x00000031U;
938}
939static inline u32 gr_fecs_method_push_adr_set_reglist_virtual_address_v(void)
940{
941 return 0x00000032U;
942}
943static inline u32 gr_fecs_method_push_adr_stop_ctxsw_v(void)
944{
945 return 0x00000038U;
946}
947static inline u32 gr_fecs_method_push_adr_start_ctxsw_v(void)
948{
949 return 0x00000039U;
950}
951static inline u32 gr_fecs_method_push_adr_set_watchdog_timeout_f(void)
952{
953 return 0x21U;
954}
955static inline u32 gr_fecs_method_push_adr_halt_pipeline_v(void)
956{
957 return 0x00000004U;
958}
959static inline u32 gr_fecs_host_int_status_r(void)
960{
961 return 0x00409c18U;
962}
963static inline u32 gr_fecs_host_int_status_fault_during_ctxsw_f(u32 v)
964{
965 return (v & 0x1U) << 16U;
966}
967static inline u32 gr_fecs_host_int_status_umimp_firmware_method_f(u32 v)
968{
969 return (v & 0x1U) << 17U;
970}
971static inline u32 gr_fecs_host_int_status_umimp_illegal_method_f(u32 v)
972{
973 return (v & 0x1U) << 18U;
974}
975static inline u32 gr_fecs_host_int_status_ctxsw_intr_f(u32 v)
976{
977 return (v & 0xffffU) << 0U;
978}
979static inline u32 gr_fecs_host_int_clear_r(void)
980{
981 return 0x00409c20U;
982}
983static inline u32 gr_fecs_host_int_clear_ctxsw_intr1_f(u32 v)
984{
985 return (v & 0x1U) << 1U;
986}
987static inline u32 gr_fecs_host_int_clear_ctxsw_intr1_clear_f(void)
988{
989 return 0x2U;
990}
991static inline u32 gr_fecs_host_int_enable_r(void)
992{
993 return 0x00409c24U;
994}
995static inline u32 gr_fecs_host_int_enable_ctxsw_intr1_enable_f(void)
996{
997 return 0x2U;
998}
999static inline u32 gr_fecs_host_int_enable_fault_during_ctxsw_enable_f(void)
1000{
1001 return 0x10000U;
1002}
1003static inline u32 gr_fecs_host_int_enable_umimp_firmware_method_enable_f(void)
1004{
1005 return 0x20000U;
1006}
1007static inline u32 gr_fecs_host_int_enable_umimp_illegal_method_enable_f(void)
1008{
1009 return 0x40000U;
1010}
1011static inline u32 gr_fecs_host_int_enable_watchdog_enable_f(void)
1012{
1013 return 0x80000U;
1014}
1015static inline u32 gr_fecs_ctxsw_reset_ctl_r(void)
1016{
1017 return 0x00409614U;
1018}
1019static inline u32 gr_fecs_ctxsw_reset_ctl_sys_halt_disabled_f(void)
1020{
1021 return 0x0U;
1022}
1023static inline u32 gr_fecs_ctxsw_reset_ctl_gpc_halt_disabled_f(void)
1024{
1025 return 0x0U;
1026}
1027static inline u32 gr_fecs_ctxsw_reset_ctl_be_halt_disabled_f(void)
1028{
1029 return 0x0U;
1030}
1031static inline u32 gr_fecs_ctxsw_reset_ctl_sys_engine_reset_disabled_f(void)
1032{
1033 return 0x10U;
1034}
1035static inline u32 gr_fecs_ctxsw_reset_ctl_gpc_engine_reset_disabled_f(void)
1036{
1037 return 0x20U;
1038}
1039static inline u32 gr_fecs_ctxsw_reset_ctl_be_engine_reset_disabled_f(void)
1040{
1041 return 0x40U;
1042}
1043static inline u32 gr_fecs_ctxsw_reset_ctl_sys_context_reset_enabled_f(void)
1044{
1045 return 0x0U;
1046}
1047static inline u32 gr_fecs_ctxsw_reset_ctl_sys_context_reset_disabled_f(void)
1048{
1049 return 0x100U;
1050}
1051static inline u32 gr_fecs_ctxsw_reset_ctl_gpc_context_reset_enabled_f(void)
1052{
1053 return 0x0U;
1054}
1055static inline u32 gr_fecs_ctxsw_reset_ctl_gpc_context_reset_disabled_f(void)
1056{
1057 return 0x200U;
1058}
1059static inline u32 gr_fecs_ctxsw_reset_ctl_be_context_reset_s(void)
1060{
1061 return 1U;
1062}
1063static inline u32 gr_fecs_ctxsw_reset_ctl_be_context_reset_f(u32 v)
1064{
1065 return (v & 0x1U) << 10U;
1066}
1067static inline u32 gr_fecs_ctxsw_reset_ctl_be_context_reset_m(void)
1068{
1069 return 0x1U << 10U;
1070}
1071static inline u32 gr_fecs_ctxsw_reset_ctl_be_context_reset_v(u32 r)
1072{
1073 return (r >> 10U) & 0x1U;
1074}
1075static inline u32 gr_fecs_ctxsw_reset_ctl_be_context_reset_enabled_f(void)
1076{
1077 return 0x0U;
1078}
1079static inline u32 gr_fecs_ctxsw_reset_ctl_be_context_reset_disabled_f(void)
1080{
1081 return 0x400U;
1082}
1083static inline u32 gr_fecs_ctx_state_store_major_rev_id_r(void)
1084{
1085 return 0x0040960cU;
1086}
1087static inline u32 gr_fecs_ctxsw_mailbox_r(u32 i)
1088{
1089 return 0x00409800U + i*4U;
1090}
1091static inline u32 gr_fecs_ctxsw_mailbox__size_1_v(void)
1092{
1093 return 0x00000008U;
1094}
1095static inline u32 gr_fecs_ctxsw_mailbox_value_f(u32 v)
1096{
1097 return (v & 0xffffffffU) << 0U;
1098}
1099static inline u32 gr_fecs_ctxsw_mailbox_value_pass_v(void)
1100{
1101 return 0x00000001U;
1102}
1103static inline u32 gr_fecs_ctxsw_mailbox_value_fail_v(void)
1104{
1105 return 0x00000002U;
1106}
1107static inline u32 gr_fecs_ctxsw_mailbox_set_r(u32 i)
1108{
1109 return 0x00409820U + i*4U;
1110}
1111static inline u32 gr_fecs_ctxsw_mailbox_set_value_f(u32 v)
1112{
1113 return (v & 0xffffffffU) << 0U;
1114}
1115static inline u32 gr_fecs_ctxsw_mailbox_clear_r(u32 i)
1116{
1117 return 0x00409840U + i*4U;
1118}
1119static inline u32 gr_fecs_ctxsw_mailbox_clear_value_f(u32 v)
1120{
1121 return (v & 0xffffffffU) << 0U;
1122}
1123static inline u32 gr_fecs_fs_r(void)
1124{
1125 return 0x00409604U;
1126}
1127static inline u32 gr_fecs_fs_num_available_gpcs_s(void)
1128{
1129 return 5U;
1130}
1131static inline u32 gr_fecs_fs_num_available_gpcs_f(u32 v)
1132{
1133 return (v & 0x1fU) << 0U;
1134}
1135static inline u32 gr_fecs_fs_num_available_gpcs_m(void)
1136{
1137 return 0x1fU << 0U;
1138}
1139static inline u32 gr_fecs_fs_num_available_gpcs_v(u32 r)
1140{
1141 return (r >> 0U) & 0x1fU;
1142}
1143static inline u32 gr_fecs_fs_num_available_fbps_s(void)
1144{
1145 return 5U;
1146}
1147static inline u32 gr_fecs_fs_num_available_fbps_f(u32 v)
1148{
1149 return (v & 0x1fU) << 16U;
1150}
1151static inline u32 gr_fecs_fs_num_available_fbps_m(void)
1152{
1153 return 0x1fU << 16U;
1154}
1155static inline u32 gr_fecs_fs_num_available_fbps_v(u32 r)
1156{
1157 return (r >> 16U) & 0x1fU;
1158}
1159static inline u32 gr_fecs_cfg_r(void)
1160{
1161 return 0x00409620U;
1162}
1163static inline u32 gr_fecs_cfg_imem_sz_v(u32 r)
1164{
1165 return (r >> 0U) & 0xffU;
1166}
1167static inline u32 gr_fecs_rc_lanes_r(void)
1168{
1169 return 0x00409880U;
1170}
1171static inline u32 gr_fecs_rc_lanes_num_chains_s(void)
1172{
1173 return 6U;
1174}
1175static inline u32 gr_fecs_rc_lanes_num_chains_f(u32 v)
1176{
1177 return (v & 0x3fU) << 0U;
1178}
1179static inline u32 gr_fecs_rc_lanes_num_chains_m(void)
1180{
1181 return 0x3fU << 0U;
1182}
1183static inline u32 gr_fecs_rc_lanes_num_chains_v(u32 r)
1184{
1185 return (r >> 0U) & 0x3fU;
1186}
1187static inline u32 gr_fecs_ctxsw_status_1_r(void)
1188{
1189 return 0x00409400U;
1190}
1191static inline u32 gr_fecs_ctxsw_status_1_arb_busy_s(void)
1192{
1193 return 1U;
1194}
1195static inline u32 gr_fecs_ctxsw_status_1_arb_busy_f(u32 v)
1196{
1197 return (v & 0x1U) << 12U;
1198}
1199static inline u32 gr_fecs_ctxsw_status_1_arb_busy_m(void)
1200{
1201 return 0x1U << 12U;
1202}
1203static inline u32 gr_fecs_ctxsw_status_1_arb_busy_v(u32 r)
1204{
1205 return (r >> 12U) & 0x1U;
1206}
1207static inline u32 gr_fecs_arb_ctx_adr_r(void)
1208{
1209 return 0x00409a24U;
1210}
1211static inline u32 gr_fecs_new_ctx_r(void)
1212{
1213 return 0x00409b04U;
1214}
1215static inline u32 gr_fecs_new_ctx_ptr_s(void)
1216{
1217 return 28U;
1218}
1219static inline u32 gr_fecs_new_ctx_ptr_f(u32 v)
1220{
1221 return (v & 0xfffffffU) << 0U;
1222}
1223static inline u32 gr_fecs_new_ctx_ptr_m(void)
1224{
1225 return 0xfffffffU << 0U;
1226}
1227static inline u32 gr_fecs_new_ctx_ptr_v(u32 r)
1228{
1229 return (r >> 0U) & 0xfffffffU;
1230}
1231static inline u32 gr_fecs_new_ctx_target_s(void)
1232{
1233 return 2U;
1234}
1235static inline u32 gr_fecs_new_ctx_target_f(u32 v)
1236{
1237 return (v & 0x3U) << 28U;
1238}
1239static inline u32 gr_fecs_new_ctx_target_m(void)
1240{
1241 return 0x3U << 28U;
1242}
1243static inline u32 gr_fecs_new_ctx_target_v(u32 r)
1244{
1245 return (r >> 28U) & 0x3U;
1246}
1247static inline u32 gr_fecs_new_ctx_target_vid_mem_f(void)
1248{
1249 return 0x0U;
1250}
1251static inline u32 gr_fecs_new_ctx_target_sys_mem_ncoh_f(void)
1252{
1253 return 0x30000000U;
1254}
1255static inline u32 gr_fecs_new_ctx_valid_s(void)
1256{
1257 return 1U;
1258}
1259static inline u32 gr_fecs_new_ctx_valid_f(u32 v)
1260{
1261 return (v & 0x1U) << 31U;
1262}
1263static inline u32 gr_fecs_new_ctx_valid_m(void)
1264{
1265 return 0x1U << 31U;
1266}
1267static inline u32 gr_fecs_new_ctx_valid_v(u32 r)
1268{
1269 return (r >> 31U) & 0x1U;
1270}
1271static inline u32 gr_fecs_arb_ctx_ptr_r(void)
1272{
1273 return 0x00409a0cU;
1274}
1275static inline u32 gr_fecs_arb_ctx_ptr_ptr_s(void)
1276{
1277 return 28U;
1278}
1279static inline u32 gr_fecs_arb_ctx_ptr_ptr_f(u32 v)
1280{
1281 return (v & 0xfffffffU) << 0U;
1282}
1283static inline u32 gr_fecs_arb_ctx_ptr_ptr_m(void)
1284{
1285 return 0xfffffffU << 0U;
1286}
1287static inline u32 gr_fecs_arb_ctx_ptr_ptr_v(u32 r)
1288{
1289 return (r >> 0U) & 0xfffffffU;
1290}
1291static inline u32 gr_fecs_arb_ctx_ptr_target_s(void)
1292{
1293 return 2U;
1294}
1295static inline u32 gr_fecs_arb_ctx_ptr_target_f(u32 v)
1296{
1297 return (v & 0x3U) << 28U;
1298}
1299static inline u32 gr_fecs_arb_ctx_ptr_target_m(void)
1300{
1301 return 0x3U << 28U;
1302}
1303static inline u32 gr_fecs_arb_ctx_ptr_target_v(u32 r)
1304{
1305 return (r >> 28U) & 0x3U;
1306}
1307static inline u32 gr_fecs_arb_ctx_ptr_target_vid_mem_f(void)
1308{
1309 return 0x0U;
1310}
1311static inline u32 gr_fecs_arb_ctx_ptr_target_sys_mem_ncoh_f(void)
1312{
1313 return 0x30000000U;
1314}
1315static inline u32 gr_fecs_arb_ctx_cmd_r(void)
1316{
1317 return 0x00409a10U;
1318}
1319static inline u32 gr_fecs_arb_ctx_cmd_cmd_s(void)
1320{
1321 return 5U;
1322}
1323static inline u32 gr_fecs_arb_ctx_cmd_cmd_f(u32 v)
1324{
1325 return (v & 0x1fU) << 0U;
1326}
1327static inline u32 gr_fecs_arb_ctx_cmd_cmd_m(void)
1328{
1329 return 0x1fU << 0U;
1330}
1331static inline u32 gr_fecs_arb_ctx_cmd_cmd_v(u32 r)
1332{
1333 return (r >> 0U) & 0x1fU;
1334}
1335static inline u32 gr_fecs_ctxsw_status_fe_0_r(void)
1336{
1337 return 0x00409c00U;
1338}
1339static inline u32 gr_gpc0_gpccs_ctxsw_status_gpc_0_r(void)
1340{
1341 return 0x00502c04U;
1342}
1343static inline u32 gr_gpc0_gpccs_ctxsw_status_1_r(void)
1344{
1345 return 0x00502400U;
1346}
1347static inline u32 gr_fecs_ctxsw_idlestate_r(void)
1348{
1349 return 0x00409420U;
1350}
1351static inline u32 gr_gpc0_gpccs_ctxsw_idlestate_r(void)
1352{
1353 return 0x00502420U;
1354}
1355static inline u32 gr_rstr2d_gpc_map0_r(void)
1356{
1357 return 0x0040780cU;
1358}
1359static inline u32 gr_rstr2d_gpc_map1_r(void)
1360{
1361 return 0x00407810U;
1362}
1363static inline u32 gr_rstr2d_gpc_map2_r(void)
1364{
1365 return 0x00407814U;
1366}
1367static inline u32 gr_rstr2d_gpc_map3_r(void)
1368{
1369 return 0x00407818U;
1370}
1371static inline u32 gr_rstr2d_gpc_map4_r(void)
1372{
1373 return 0x0040781cU;
1374}
1375static inline u32 gr_rstr2d_gpc_map5_r(void)
1376{
1377 return 0x00407820U;
1378}
1379static inline u32 gr_rstr2d_map_table_cfg_r(void)
1380{
1381 return 0x004078bcU;
1382}
1383static inline u32 gr_rstr2d_map_table_cfg_row_offset_f(u32 v)
1384{
1385 return (v & 0xffU) << 0U;
1386}
1387static inline u32 gr_rstr2d_map_table_cfg_num_entries_f(u32 v)
1388{
1389 return (v & 0xffU) << 8U;
1390}
1391static inline u32 gr_pd_hww_esr_r(void)
1392{
1393 return 0x00406018U;
1394}
1395static inline u32 gr_pd_hww_esr_reset_active_f(void)
1396{
1397 return 0x40000000U;
1398}
1399static inline u32 gr_pd_hww_esr_en_enable_f(void)
1400{
1401 return 0x80000000U;
1402}
1403static inline u32 gr_pd_num_tpc_per_gpc_r(u32 i)
1404{
1405 return 0x00406028U + i*4U;
1406}
1407static inline u32 gr_pd_num_tpc_per_gpc__size_1_v(void)
1408{
1409 return 0x00000004U;
1410}
1411static inline u32 gr_pd_num_tpc_per_gpc_count0_f(u32 v)
1412{
1413 return (v & 0xfU) << 0U;
1414}
1415static inline u32 gr_pd_num_tpc_per_gpc_count1_f(u32 v)
1416{
1417 return (v & 0xfU) << 4U;
1418}
1419static inline u32 gr_pd_num_tpc_per_gpc_count2_f(u32 v)
1420{
1421 return (v & 0xfU) << 8U;
1422}
1423static inline u32 gr_pd_num_tpc_per_gpc_count3_f(u32 v)
1424{
1425 return (v & 0xfU) << 12U;
1426}
1427static inline u32 gr_pd_num_tpc_per_gpc_count4_f(u32 v)
1428{
1429 return (v & 0xfU) << 16U;
1430}
1431static inline u32 gr_pd_num_tpc_per_gpc_count5_f(u32 v)
1432{
1433 return (v & 0xfU) << 20U;
1434}
1435static inline u32 gr_pd_num_tpc_per_gpc_count6_f(u32 v)
1436{
1437 return (v & 0xfU) << 24U;
1438}
1439static inline u32 gr_pd_num_tpc_per_gpc_count7_f(u32 v)
1440{
1441 return (v & 0xfU) << 28U;
1442}
1443static inline u32 gr_pd_ab_dist_cfg0_r(void)
1444{
1445 return 0x004064c0U;
1446}
1447static inline u32 gr_pd_ab_dist_cfg0_timeslice_enable_en_f(void)
1448{
1449 return 0x80000000U;
1450}
1451static inline u32 gr_pd_ab_dist_cfg0_timeslice_enable_dis_f(void)
1452{
1453 return 0x0U;
1454}
1455static inline u32 gr_pd_ab_dist_cfg1_r(void)
1456{
1457 return 0x004064c4U;
1458}
1459static inline u32 gr_pd_ab_dist_cfg1_max_batches_init_f(void)
1460{
1461 return 0xffffU;
1462}
1463static inline u32 gr_pd_ab_dist_cfg1_max_output_f(u32 v)
1464{
1465 return (v & 0x7ffU) << 16U;
1466}
1467static inline u32 gr_pd_ab_dist_cfg1_max_output_granularity_v(void)
1468{
1469 return 0x00000080U;
1470}
1471static inline u32 gr_pd_ab_dist_cfg2_r(void)
1472{
1473 return 0x004064c8U;
1474}
1475static inline u32 gr_pd_ab_dist_cfg2_token_limit_f(u32 v)
1476{
1477 return (v & 0xfffU) << 0U;
1478}
1479static inline u32 gr_pd_ab_dist_cfg2_token_limit_init_v(void)
1480{
1481 return 0x00000100U;
1482}
1483static inline u32 gr_pd_ab_dist_cfg2_state_limit_f(u32 v)
1484{
1485 return (v & 0xfffU) << 16U;
1486}
1487static inline u32 gr_pd_ab_dist_cfg2_state_limit_scc_bundle_granularity_v(void)
1488{
1489 return 0x00000020U;
1490}
1491static inline u32 gr_pd_ab_dist_cfg2_state_limit_min_gpm_fifo_depths_v(void)
1492{
1493 return 0x00000062U;
1494}
1495static inline u32 gr_pd_pagepool_r(void)
1496{
1497 return 0x004064ccU;
1498}
1499static inline u32 gr_pd_pagepool_total_pages_f(u32 v)
1500{
1501 return (v & 0xffU) << 0U;
1502}
1503static inline u32 gr_pd_pagepool_valid_true_f(void)
1504{
1505 return 0x80000000U;
1506}
1507static inline u32 gr_pd_dist_skip_table_r(u32 i)
1508{
1509 return 0x004064d0U + i*4U;
1510}
1511static inline u32 gr_pd_dist_skip_table__size_1_v(void)
1512{
1513 return 0x00000008U;
1514}
1515static inline u32 gr_pd_dist_skip_table_gpc_4n0_mask_f(u32 v)
1516{
1517 return (v & 0xffU) << 0U;
1518}
1519static inline u32 gr_pd_dist_skip_table_gpc_4n1_mask_f(u32 v)
1520{
1521 return (v & 0xffU) << 8U;
1522}
1523static inline u32 gr_pd_dist_skip_table_gpc_4n2_mask_f(u32 v)
1524{
1525 return (v & 0xffU) << 16U;
1526}
1527static inline u32 gr_pd_dist_skip_table_gpc_4n3_mask_f(u32 v)
1528{
1529 return (v & 0xffU) << 24U;
1530}
1531static inline u32 gr_pd_alpha_ratio_table_r(u32 i)
1532{
1533 return 0x00406800U + i*4U;
1534}
1535static inline u32 gr_pd_alpha_ratio_table__size_1_v(void)
1536{
1537 return 0x00000100U;
1538}
1539static inline u32 gr_pd_alpha_ratio_table_gpc_4n0_mask_f(u32 v)
1540{
1541 return (v & 0xffU) << 0U;
1542}
1543static inline u32 gr_pd_alpha_ratio_table_gpc_4n1_mask_f(u32 v)
1544{
1545 return (v & 0xffU) << 8U;
1546}
1547static inline u32 gr_pd_alpha_ratio_table_gpc_4n2_mask_f(u32 v)
1548{
1549 return (v & 0xffU) << 16U;
1550}
1551static inline u32 gr_pd_alpha_ratio_table_gpc_4n3_mask_f(u32 v)
1552{
1553 return (v & 0xffU) << 24U;
1554}
1555static inline u32 gr_pd_beta_ratio_table_r(u32 i)
1556{
1557 return 0x00406c00U + i*4U;
1558}
1559static inline u32 gr_pd_beta_ratio_table__size_1_v(void)
1560{
1561 return 0x00000100U;
1562}
1563static inline u32 gr_pd_beta_ratio_table_gpc_4n0_mask_f(u32 v)
1564{
1565 return (v & 0xffU) << 0U;
1566}
1567static inline u32 gr_pd_beta_ratio_table_gpc_4n1_mask_f(u32 v)
1568{
1569 return (v & 0xffU) << 8U;
1570}
1571static inline u32 gr_pd_beta_ratio_table_gpc_4n2_mask_f(u32 v)
1572{
1573 return (v & 0xffU) << 16U;
1574}
1575static inline u32 gr_pd_beta_ratio_table_gpc_4n3_mask_f(u32 v)
1576{
1577 return (v & 0xffU) << 24U;
1578}
1579static inline u32 gr_ds_debug_r(void)
1580{
1581 return 0x00405800U;
1582}
1583static inline u32 gr_ds_debug_timeslice_mode_disable_f(void)
1584{
1585 return 0x0U;
1586}
1587static inline u32 gr_ds_debug_timeslice_mode_enable_f(void)
1588{
1589 return 0x8000000U;
1590}
1591static inline u32 gr_ds_zbc_color_r_r(void)
1592{
1593 return 0x00405804U;
1594}
1595static inline u32 gr_ds_zbc_color_r_val_f(u32 v)
1596{
1597 return (v & 0xffffffffU) << 0U;
1598}
1599static inline u32 gr_ds_zbc_color_g_r(void)
1600{
1601 return 0x00405808U;
1602}
1603static inline u32 gr_ds_zbc_color_g_val_f(u32 v)
1604{
1605 return (v & 0xffffffffU) << 0U;
1606}
1607static inline u32 gr_ds_zbc_color_b_r(void)
1608{
1609 return 0x0040580cU;
1610}
1611static inline u32 gr_ds_zbc_color_b_val_f(u32 v)
1612{
1613 return (v & 0xffffffffU) << 0U;
1614}
1615static inline u32 gr_ds_zbc_color_a_r(void)
1616{
1617 return 0x00405810U;
1618}
1619static inline u32 gr_ds_zbc_color_a_val_f(u32 v)
1620{
1621 return (v & 0xffffffffU) << 0U;
1622}
1623static inline u32 gr_ds_zbc_color_fmt_r(void)
1624{
1625 return 0x00405814U;
1626}
1627static inline u32 gr_ds_zbc_color_fmt_val_f(u32 v)
1628{
1629 return (v & 0x7fU) << 0U;
1630}
1631static inline u32 gr_ds_zbc_color_fmt_val_invalid_f(void)
1632{
1633 return 0x0U;
1634}
1635static inline u32 gr_ds_zbc_color_fmt_val_zero_v(void)
1636{
1637 return 0x00000001U;
1638}
1639static inline u32 gr_ds_zbc_color_fmt_val_unorm_one_v(void)
1640{
1641 return 0x00000002U;
1642}
1643static inline u32 gr_ds_zbc_color_fmt_val_rf32_gf32_bf32_af32_v(void)
1644{
1645 return 0x00000004U;
1646}
1647static inline u32 gr_ds_zbc_color_fmt_val_a8_b8_g8_r8_v(void)
1648{
1649 return 0x00000028U;
1650}
1651static inline u32 gr_ds_zbc_z_r(void)
1652{
1653 return 0x00405818U;
1654}
1655static inline u32 gr_ds_zbc_z_val_s(void)
1656{
1657 return 32U;
1658}
1659static inline u32 gr_ds_zbc_z_val_f(u32 v)
1660{
1661 return (v & 0xffffffffU) << 0U;
1662}
1663static inline u32 gr_ds_zbc_z_val_m(void)
1664{
1665 return 0xffffffffU << 0U;
1666}
1667static inline u32 gr_ds_zbc_z_val_v(u32 r)
1668{
1669 return (r >> 0U) & 0xffffffffU;
1670}
1671static inline u32 gr_ds_zbc_z_val__init_v(void)
1672{
1673 return 0x00000000U;
1674}
1675static inline u32 gr_ds_zbc_z_val__init_f(void)
1676{
1677 return 0x0U;
1678}
1679static inline u32 gr_ds_zbc_z_fmt_r(void)
1680{
1681 return 0x0040581cU;
1682}
1683static inline u32 gr_ds_zbc_z_fmt_val_f(u32 v)
1684{
1685 return (v & 0x1U) << 0U;
1686}
1687static inline u32 gr_ds_zbc_z_fmt_val_invalid_f(void)
1688{
1689 return 0x0U;
1690}
1691static inline u32 gr_ds_zbc_z_fmt_val_fp32_v(void)
1692{
1693 return 0x00000001U;
1694}
1695static inline u32 gr_ds_zbc_tbl_index_r(void)
1696{
1697 return 0x00405820U;
1698}
1699static inline u32 gr_ds_zbc_tbl_index_val_f(u32 v)
1700{
1701 return (v & 0xfU) << 0U;
1702}
1703static inline u32 gr_ds_zbc_tbl_ld_r(void)
1704{
1705 return 0x00405824U;
1706}
1707static inline u32 gr_ds_zbc_tbl_ld_select_c_f(void)
1708{
1709 return 0x0U;
1710}
1711static inline u32 gr_ds_zbc_tbl_ld_select_z_f(void)
1712{
1713 return 0x1U;
1714}
1715static inline u32 gr_ds_zbc_tbl_ld_action_write_f(void)
1716{
1717 return 0x0U;
1718}
1719static inline u32 gr_ds_zbc_tbl_ld_trigger_active_f(void)
1720{
1721 return 0x4U;
1722}
1723static inline u32 gr_ds_tga_constraintlogic_r(void)
1724{
1725 return 0x00405830U;
1726}
1727static inline u32 gr_ds_tga_constraintlogic_beta_cbsize_f(u32 v)
1728{
1729 return (v & 0xfffU) << 16U;
1730}
1731static inline u32 gr_ds_tga_constraintlogic_alpha_cbsize_f(u32 v)
1732{
1733 return (v & 0xfffU) << 0U;
1734}
1735static inline u32 gr_ds_hww_esr_r(void)
1736{
1737 return 0x00405840U;
1738}
1739static inline u32 gr_ds_hww_esr_reset_s(void)
1740{
1741 return 1U;
1742}
1743static inline u32 gr_ds_hww_esr_reset_f(u32 v)
1744{
1745 return (v & 0x1U) << 30U;
1746}
1747static inline u32 gr_ds_hww_esr_reset_m(void)
1748{
1749 return 0x1U << 30U;
1750}
1751static inline u32 gr_ds_hww_esr_reset_v(u32 r)
1752{
1753 return (r >> 30U) & 0x1U;
1754}
1755static inline u32 gr_ds_hww_esr_reset_task_v(void)
1756{
1757 return 0x00000001U;
1758}
1759static inline u32 gr_ds_hww_esr_reset_task_f(void)
1760{
1761 return 0x40000000U;
1762}
1763static inline u32 gr_ds_hww_esr_en_enabled_f(void)
1764{
1765 return 0x80000000U;
1766}
1767static inline u32 gr_ds_hww_report_mask_r(void)
1768{
1769 return 0x00405844U;
1770}
1771static inline u32 gr_ds_hww_report_mask_sph0_err_report_f(void)
1772{
1773 return 0x1U;
1774}
1775static inline u32 gr_ds_hww_report_mask_sph1_err_report_f(void)
1776{
1777 return 0x2U;
1778}
1779static inline u32 gr_ds_hww_report_mask_sph2_err_report_f(void)
1780{
1781 return 0x4U;
1782}
1783static inline u32 gr_ds_hww_report_mask_sph3_err_report_f(void)
1784{
1785 return 0x8U;
1786}
1787static inline u32 gr_ds_hww_report_mask_sph4_err_report_f(void)
1788{
1789 return 0x10U;
1790}
1791static inline u32 gr_ds_hww_report_mask_sph5_err_report_f(void)
1792{
1793 return 0x20U;
1794}
1795static inline u32 gr_ds_hww_report_mask_sph6_err_report_f(void)
1796{
1797 return 0x40U;
1798}
1799static inline u32 gr_ds_hww_report_mask_sph7_err_report_f(void)
1800{
1801 return 0x80U;
1802}
1803static inline u32 gr_ds_hww_report_mask_sph8_err_report_f(void)
1804{
1805 return 0x100U;
1806}
1807static inline u32 gr_ds_hww_report_mask_sph9_err_report_f(void)
1808{
1809 return 0x200U;
1810}
1811static inline u32 gr_ds_hww_report_mask_sph10_err_report_f(void)
1812{
1813 return 0x400U;
1814}
1815static inline u32 gr_ds_hww_report_mask_sph11_err_report_f(void)
1816{
1817 return 0x800U;
1818}
1819static inline u32 gr_ds_hww_report_mask_sph12_err_report_f(void)
1820{
1821 return 0x1000U;
1822}
1823static inline u32 gr_ds_hww_report_mask_sph13_err_report_f(void)
1824{
1825 return 0x2000U;
1826}
1827static inline u32 gr_ds_hww_report_mask_sph14_err_report_f(void)
1828{
1829 return 0x4000U;
1830}
1831static inline u32 gr_ds_hww_report_mask_sph15_err_report_f(void)
1832{
1833 return 0x8000U;
1834}
1835static inline u32 gr_ds_hww_report_mask_sph16_err_report_f(void)
1836{
1837 return 0x10000U;
1838}
1839static inline u32 gr_ds_hww_report_mask_sph17_err_report_f(void)
1840{
1841 return 0x20000U;
1842}
1843static inline u32 gr_ds_hww_report_mask_sph18_err_report_f(void)
1844{
1845 return 0x40000U;
1846}
1847static inline u32 gr_ds_hww_report_mask_sph19_err_report_f(void)
1848{
1849 return 0x80000U;
1850}
1851static inline u32 gr_ds_hww_report_mask_sph20_err_report_f(void)
1852{
1853 return 0x100000U;
1854}
1855static inline u32 gr_ds_hww_report_mask_sph21_err_report_f(void)
1856{
1857 return 0x200000U;
1858}
1859static inline u32 gr_ds_hww_report_mask_sph22_err_report_f(void)
1860{
1861 return 0x400000U;
1862}
1863static inline u32 gr_ds_hww_report_mask_sph23_err_report_f(void)
1864{
1865 return 0x800000U;
1866}
1867static inline u32 gr_ds_num_tpc_per_gpc_r(u32 i)
1868{
1869 return 0x00405870U + i*4U;
1870}
1871static inline u32 gr_scc_bundle_cb_base_r(void)
1872{
1873 return 0x00408004U;
1874}
1875static inline u32 gr_scc_bundle_cb_base_addr_39_8_f(u32 v)
1876{
1877 return (v & 0xffffffffU) << 0U;
1878}
1879static inline u32 gr_scc_bundle_cb_base_addr_39_8_align_bits_v(void)
1880{
1881 return 0x00000008U;
1882}
1883static inline u32 gr_scc_bundle_cb_size_r(void)
1884{
1885 return 0x00408008U;
1886}
1887static inline u32 gr_scc_bundle_cb_size_div_256b_f(u32 v)
1888{
1889 return (v & 0x7ffU) << 0U;
1890}
1891static inline u32 gr_scc_bundle_cb_size_div_256b__prod_v(void)
1892{
1893 return 0x00000018U;
1894}
1895static inline u32 gr_scc_bundle_cb_size_div_256b_byte_granularity_v(void)
1896{
1897 return 0x00000100U;
1898}
1899static inline u32 gr_scc_bundle_cb_size_valid_false_v(void)
1900{
1901 return 0x00000000U;
1902}
1903static inline u32 gr_scc_bundle_cb_size_valid_false_f(void)
1904{
1905 return 0x0U;
1906}
1907static inline u32 gr_scc_bundle_cb_size_valid_true_f(void)
1908{
1909 return 0x80000000U;
1910}
1911static inline u32 gr_scc_pagepool_base_r(void)
1912{
1913 return 0x0040800cU;
1914}
1915static inline u32 gr_scc_pagepool_base_addr_39_8_f(u32 v)
1916{
1917 return (v & 0xffffffffU) << 0U;
1918}
1919static inline u32 gr_scc_pagepool_base_addr_39_8_align_bits_v(void)
1920{
1921 return 0x00000008U;
1922}
1923static inline u32 gr_scc_pagepool_r(void)
1924{
1925 return 0x00408010U;
1926}
1927static inline u32 gr_scc_pagepool_total_pages_f(u32 v)
1928{
1929 return (v & 0xffU) << 0U;
1930}
1931static inline u32 gr_scc_pagepool_total_pages_hwmax_v(void)
1932{
1933 return 0x00000000U;
1934}
1935static inline u32 gr_scc_pagepool_total_pages_hwmax_value_v(void)
1936{
1937 return 0x00000080U;
1938}
1939static inline u32 gr_scc_pagepool_total_pages_byte_granularity_v(void)
1940{
1941 return 0x00000100U;
1942}
1943static inline u32 gr_scc_pagepool_max_valid_pages_s(void)
1944{
1945 return 8U;
1946}
1947static inline u32 gr_scc_pagepool_max_valid_pages_f(u32 v)
1948{
1949 return (v & 0xffU) << 8U;
1950}
1951static inline u32 gr_scc_pagepool_max_valid_pages_m(void)
1952{
1953 return 0xffU << 8U;
1954}
1955static inline u32 gr_scc_pagepool_max_valid_pages_v(u32 r)
1956{
1957 return (r >> 8U) & 0xffU;
1958}
1959static inline u32 gr_scc_pagepool_valid_true_f(void)
1960{
1961 return 0x80000000U;
1962}
1963static inline u32 gr_scc_init_r(void)
1964{
1965 return 0x0040802cU;
1966}
1967static inline u32 gr_scc_init_ram_trigger_f(void)
1968{
1969 return 0x1U;
1970}
1971static inline u32 gr_scc_hww_esr_r(void)
1972{
1973 return 0x00408030U;
1974}
1975static inline u32 gr_scc_hww_esr_reset_active_f(void)
1976{
1977 return 0x40000000U;
1978}
1979static inline u32 gr_scc_hww_esr_en_enable_f(void)
1980{
1981 return 0x80000000U;
1982}
1983static inline u32 gr_sked_hww_esr_r(void)
1984{
1985 return 0x00407020U;
1986}
1987static inline u32 gr_sked_hww_esr_reset_active_f(void)
1988{
1989 return 0x40000000U;
1990}
1991static inline u32 gr_cwd_fs_r(void)
1992{
1993 return 0x00405b00U;
1994}
1995static inline u32 gr_cwd_fs_num_gpcs_f(u32 v)
1996{
1997 return (v & 0xffU) << 0U;
1998}
1999static inline u32 gr_cwd_fs_num_tpcs_f(u32 v)
2000{
2001 return (v & 0xffU) << 8U;
2002}
2003static inline u32 gr_gpc0_fs_gpc_r(void)
2004{
2005 return 0x00502608U;
2006}
2007static inline u32 gr_gpc0_fs_gpc_num_available_tpcs_v(u32 r)
2008{
2009 return (r >> 0U) & 0x1fU;
2010}
2011static inline u32 gr_gpc0_fs_gpc_num_available_zculls_v(u32 r)
2012{
2013 return (r >> 16U) & 0x1fU;
2014}
2015static inline u32 gr_gpc0_cfg_r(void)
2016{
2017 return 0x00502620U;
2018}
2019static inline u32 gr_gpc0_cfg_imem_sz_v(u32 r)
2020{
2021 return (r >> 0U) & 0xffU;
2022}
2023static inline u32 gr_gpccs_rc_lanes_r(void)
2024{
2025 return 0x00502880U;
2026}
2027static inline u32 gr_gpccs_rc_lanes_num_chains_s(void)
2028{
2029 return 6U;
2030}
2031static inline u32 gr_gpccs_rc_lanes_num_chains_f(u32 v)
2032{
2033 return (v & 0x3fU) << 0U;
2034}
2035static inline u32 gr_gpccs_rc_lanes_num_chains_m(void)
2036{
2037 return 0x3fU << 0U;
2038}
2039static inline u32 gr_gpccs_rc_lanes_num_chains_v(u32 r)
2040{
2041 return (r >> 0U) & 0x3fU;
2042}
2043static inline u32 gr_gpccs_rc_lane_size_r(u32 i)
2044{
2045 return 0x00502910U + i*0U;
2046}
2047static inline u32 gr_gpccs_rc_lane_size__size_1_v(void)
2048{
2049 return 0x00000010U;
2050}
2051static inline u32 gr_gpccs_rc_lane_size_v_s(void)
2052{
2053 return 24U;
2054}
2055static inline u32 gr_gpccs_rc_lane_size_v_f(u32 v)
2056{
2057 return (v & 0xffffffU) << 0U;
2058}
2059static inline u32 gr_gpccs_rc_lane_size_v_m(void)
2060{
2061 return 0xffffffU << 0U;
2062}
2063static inline u32 gr_gpccs_rc_lane_size_v_v(u32 r)
2064{
2065 return (r >> 0U) & 0xffffffU;
2066}
2067static inline u32 gr_gpccs_rc_lane_size_v_0_v(void)
2068{
2069 return 0x00000000U;
2070}
2071static inline u32 gr_gpccs_rc_lane_size_v_0_f(void)
2072{
2073 return 0x0U;
2074}
2075static inline u32 gr_gpc0_zcull_fs_r(void)
2076{
2077 return 0x00500910U;
2078}
2079static inline u32 gr_gpc0_zcull_fs_num_sms_f(u32 v)
2080{
2081 return (v & 0x1ffU) << 0U;
2082}
2083static inline u32 gr_gpc0_zcull_fs_num_active_banks_f(u32 v)
2084{
2085 return (v & 0xfU) << 16U;
2086}
2087static inline u32 gr_gpc0_zcull_ram_addr_r(void)
2088{
2089 return 0x00500914U;
2090}
2091static inline u32 gr_gpc0_zcull_ram_addr_tiles_per_hypertile_row_per_gpc_f(u32 v)
2092{
2093 return (v & 0xfU) << 0U;
2094}
2095static inline u32 gr_gpc0_zcull_ram_addr_row_offset_f(u32 v)
2096{
2097 return (v & 0xfU) << 8U;
2098}
2099static inline u32 gr_gpc0_zcull_sm_num_rcp_r(void)
2100{
2101 return 0x00500918U;
2102}
2103static inline u32 gr_gpc0_zcull_sm_num_rcp_conservative_f(u32 v)
2104{
2105 return (v & 0xffffffU) << 0U;
2106}
2107static inline u32 gr_gpc0_zcull_sm_num_rcp_conservative__max_v(void)
2108{
2109 return 0x00800000U;
2110}
2111static inline u32 gr_gpc0_zcull_total_ram_size_r(void)
2112{
2113 return 0x00500920U;
2114}
2115static inline u32 gr_gpc0_zcull_total_ram_size_num_aliquots_f(u32 v)
2116{
2117 return (v & 0xffffU) << 0U;
2118}
2119static inline u32 gr_gpc0_zcull_zcsize_r(u32 i)
2120{
2121 return 0x00500a04U + i*32U;
2122}
2123static inline u32 gr_gpc0_zcull_zcsize_height_subregion__multiple_v(void)
2124{
2125 return 0x00000040U;
2126}
2127static inline u32 gr_gpc0_zcull_zcsize_width_subregion__multiple_v(void)
2128{
2129 return 0x00000010U;
2130}
2131static inline u32 gr_gpc0_gpm_pd_active_tpcs_r(void)
2132{
2133 return 0x00500c08U;
2134}
2135static inline u32 gr_gpc0_gpm_pd_active_tpcs_num_f(u32 v)
2136{
2137 return (v & 0x7U) << 0U;
2138}
2139static inline u32 gr_gpc0_gpm_pd_sm_id_r(u32 i)
2140{
2141 return 0x00500c10U + i*4U;
2142}
2143static inline u32 gr_gpc0_gpm_pd_sm_id_id_f(u32 v)
2144{
2145 return (v & 0xffU) << 0U;
2146}
2147static inline u32 gr_gpc0_gpm_pd_pes_tpc_id_mask_r(u32 i)
2148{
2149 return 0x00500c30U + i*4U;
2150}
2151static inline u32 gr_gpc0_gpm_pd_pes_tpc_id_mask_mask_v(u32 r)
2152{
2153 return (r >> 0U) & 0xffU;
2154}
2155static inline u32 gr_gpc0_gpm_sd_active_tpcs_r(void)
2156{
2157 return 0x00500c8cU;
2158}
2159static inline u32 gr_gpc0_gpm_sd_active_tpcs_num_f(u32 v)
2160{
2161 return (v & 0x7U) << 0U;
2162}
2163static inline u32 gr_gpc0_tpc0_pe_cfg_smid_r(void)
2164{
2165 return 0x00504088U;
2166}
2167static inline u32 gr_gpc0_tpc0_pe_cfg_smid_value_f(u32 v)
2168{
2169 return (v & 0xffffU) << 0U;
2170}
2171static inline u32 gr_gpc0_tpc0_l1c_cfg_smid_r(void)
2172{
2173 return 0x005044e8U;
2174}
2175static inline u32 gr_gpc0_tpc0_l1c_cfg_smid_value_f(u32 v)
2176{
2177 return (v & 0xffffU) << 0U;
2178}
2179static inline u32 gr_gpc0_tpc0_sm_cfg_r(void)
2180{
2181 return 0x00504698U;
2182}
2183static inline u32 gr_gpc0_tpc0_sm_cfg_sm_id_f(u32 v)
2184{
2185 return (v & 0xffffU) << 0U;
2186}
2187static inline u32 gr_gpc0_tpc0_sm_cfg_sm_id_v(u32 r)
2188{
2189 return (r >> 0U) & 0xffffU;
2190}
2191static inline u32 gr_gpc0_tpc0_sm_arch_r(void)
2192{
2193 return 0x0050469cU;
2194}
2195static inline u32 gr_gpc0_tpc0_sm_arch_warp_count_v(u32 r)
2196{
2197 return (r >> 0U) & 0xffU;
2198}
2199static inline u32 gr_gpc0_tpc0_sm_arch_spa_version_v(u32 r)
2200{
2201 return (r >> 8U) & 0xfU;
2202}
2203static inline u32 gr_gpc0_tpc0_sm_arch_spa_version_smkepler_lp_v(void)
2204{
2205 return 0x0000000cU;
2206}
2207static inline u32 gr_gpc0_ppc0_pes_vsc_strem_r(void)
2208{
2209 return 0x00503018U;
2210}
2211static inline u32 gr_gpc0_ppc0_pes_vsc_strem_master_pe_m(void)
2212{
2213 return 0x1U << 0U;
2214}
2215static inline u32 gr_gpc0_ppc0_pes_vsc_strem_master_pe_true_f(void)
2216{
2217 return 0x1U;
2218}
2219static inline u32 gr_gpc0_ppc0_cbm_cfg_r(void)
2220{
2221 return 0x005030c0U;
2222}
2223static inline u32 gr_gpc0_ppc0_cbm_cfg_start_offset_f(u32 v)
2224{
2225 return (v & 0xffffU) << 0U;
2226}
2227static inline u32 gr_gpc0_ppc0_cbm_cfg_start_offset_m(void)
2228{
2229 return 0xffffU << 0U;
2230}
2231static inline u32 gr_gpc0_ppc0_cbm_cfg_start_offset_v(u32 r)
2232{
2233 return (r >> 0U) & 0xffffU;
2234}
2235static inline u32 gr_gpc0_ppc0_cbm_cfg_size_f(u32 v)
2236{
2237 return (v & 0xfffU) << 16U;
2238}
2239static inline u32 gr_gpc0_ppc0_cbm_cfg_size_m(void)
2240{
2241 return 0xfffU << 16U;
2242}
2243static inline u32 gr_gpc0_ppc0_cbm_cfg_size_v(u32 r)
2244{
2245 return (r >> 16U) & 0xfffU;
2246}
2247static inline u32 gr_gpc0_ppc0_cbm_cfg_size_default_v(void)
2248{
2249 return 0x00000240U;
2250}
2251static inline u32 gr_gpc0_ppc0_cbm_cfg_size_granularity_v(void)
2252{
2253 return 0x00000020U;
2254}
2255static inline u32 gr_gpc0_ppc0_cbm_cfg_timeslice_mode_f(u32 v)
2256{
2257 return (v & 0x1U) << 28U;
2258}
2259static inline u32 gr_gpc0_ppc0_cbm_cfg2_r(void)
2260{
2261 return 0x005030e4U;
2262}
2263static inline u32 gr_gpc0_ppc0_cbm_cfg2_start_offset_f(u32 v)
2264{
2265 return (v & 0xffffU) << 0U;
2266}
2267static inline u32 gr_gpc0_ppc0_cbm_cfg2_size_f(u32 v)
2268{
2269 return (v & 0xfffU) << 16U;
2270}
2271static inline u32 gr_gpc0_ppc0_cbm_cfg2_size_m(void)
2272{
2273 return 0xfffU << 16U;
2274}
2275static inline u32 gr_gpc0_ppc0_cbm_cfg2_size_v(u32 r)
2276{
2277 return (r >> 16U) & 0xfffU;
2278}
2279static inline u32 gr_gpc0_ppc0_cbm_cfg2_size_default_v(void)
2280{
2281 return 0x00000648U;
2282}
2283static inline u32 gr_gpc0_ppc0_cbm_cfg2_size_granularity_v(void)
2284{
2285 return 0x00000020U;
2286}
2287static inline u32 gr_gpccs_falcon_addr_r(void)
2288{
2289 return 0x0041a0acU;
2290}
2291static inline u32 gr_gpccs_falcon_addr_lsb_s(void)
2292{
2293 return 6U;
2294}
2295static inline u32 gr_gpccs_falcon_addr_lsb_f(u32 v)
2296{
2297 return (v & 0x3fU) << 0U;
2298}
2299static inline u32 gr_gpccs_falcon_addr_lsb_m(void)
2300{
2301 return 0x3fU << 0U;
2302}
2303static inline u32 gr_gpccs_falcon_addr_lsb_v(u32 r)
2304{
2305 return (r >> 0U) & 0x3fU;
2306}
2307static inline u32 gr_gpccs_falcon_addr_lsb_init_v(void)
2308{
2309 return 0x00000000U;
2310}
2311static inline u32 gr_gpccs_falcon_addr_lsb_init_f(void)
2312{
2313 return 0x0U;
2314}
2315static inline u32 gr_gpccs_falcon_addr_msb_s(void)
2316{
2317 return 6U;
2318}
2319static inline u32 gr_gpccs_falcon_addr_msb_f(u32 v)
2320{
2321 return (v & 0x3fU) << 6U;
2322}
2323static inline u32 gr_gpccs_falcon_addr_msb_m(void)
2324{
2325 return 0x3fU << 6U;
2326}
2327static inline u32 gr_gpccs_falcon_addr_msb_v(u32 r)
2328{
2329 return (r >> 6U) & 0x3fU;
2330}
2331static inline u32 gr_gpccs_falcon_addr_msb_init_v(void)
2332{
2333 return 0x00000000U;
2334}
2335static inline u32 gr_gpccs_falcon_addr_msb_init_f(void)
2336{
2337 return 0x0U;
2338}
2339static inline u32 gr_gpccs_falcon_addr_ext_s(void)
2340{
2341 return 12U;
2342}
2343static inline u32 gr_gpccs_falcon_addr_ext_f(u32 v)
2344{
2345 return (v & 0xfffU) << 0U;
2346}
2347static inline u32 gr_gpccs_falcon_addr_ext_m(void)
2348{
2349 return 0xfffU << 0U;
2350}
2351static inline u32 gr_gpccs_falcon_addr_ext_v(u32 r)
2352{
2353 return (r >> 0U) & 0xfffU;
2354}
2355static inline u32 gr_gpccs_cpuctl_r(void)
2356{
2357 return 0x0041a100U;
2358}
2359static inline u32 gr_gpccs_cpuctl_startcpu_f(u32 v)
2360{
2361 return (v & 0x1U) << 1U;
2362}
2363static inline u32 gr_gpccs_dmactl_r(void)
2364{
2365 return 0x0041a10cU;
2366}
2367static inline u32 gr_gpccs_dmactl_require_ctx_f(u32 v)
2368{
2369 return (v & 0x1U) << 0U;
2370}
2371static inline u32 gr_gpccs_dmactl_dmem_scrubbing_m(void)
2372{
2373 return 0x1U << 1U;
2374}
2375static inline u32 gr_gpccs_dmactl_imem_scrubbing_m(void)
2376{
2377 return 0x1U << 2U;
2378}
2379static inline u32 gr_gpccs_imemc_r(u32 i)
2380{
2381 return 0x0041a180U + i*16U;
2382}
2383static inline u32 gr_gpccs_imemc_offs_f(u32 v)
2384{
2385 return (v & 0x3fU) << 2U;
2386}
2387static inline u32 gr_gpccs_imemc_blk_f(u32 v)
2388{
2389 return (v & 0xffU) << 8U;
2390}
2391static inline u32 gr_gpccs_imemc_aincw_f(u32 v)
2392{
2393 return (v & 0x1U) << 24U;
2394}
2395static inline u32 gr_gpccs_imemd_r(u32 i)
2396{
2397 return 0x0041a184U + i*16U;
2398}
2399static inline u32 gr_gpccs_imemt_r(u32 i)
2400{
2401 return 0x0041a188U + i*16U;
2402}
2403static inline u32 gr_gpccs_imemt__size_1_v(void)
2404{
2405 return 0x00000004U;
2406}
2407static inline u32 gr_gpccs_imemt_tag_f(u32 v)
2408{
2409 return (v & 0xffffU) << 0U;
2410}
2411static inline u32 gr_gpccs_dmemc_r(u32 i)
2412{
2413 return 0x0041a1c0U + i*8U;
2414}
2415static inline u32 gr_gpccs_dmemc_offs_f(u32 v)
2416{
2417 return (v & 0x3fU) << 2U;
2418}
2419static inline u32 gr_gpccs_dmemc_blk_f(u32 v)
2420{
2421 return (v & 0xffU) << 8U;
2422}
2423static inline u32 gr_gpccs_dmemc_aincw_f(u32 v)
2424{
2425 return (v & 0x1U) << 24U;
2426}
2427static inline u32 gr_gpccs_dmemd_r(u32 i)
2428{
2429 return 0x0041a1c4U + i*8U;
2430}
2431static inline u32 gr_gpccs_ctxsw_mailbox_r(u32 i)
2432{
2433 return 0x0041a800U + i*4U;
2434}
2435static inline u32 gr_gpccs_ctxsw_mailbox_value_f(u32 v)
2436{
2437 return (v & 0xffffffffU) << 0U;
2438}
2439static inline u32 gr_gpcs_setup_bundle_cb_base_r(void)
2440{
2441 return 0x00418808U;
2442}
2443static inline u32 gr_gpcs_setup_bundle_cb_base_addr_39_8_s(void)
2444{
2445 return 32U;
2446}
2447static inline u32 gr_gpcs_setup_bundle_cb_base_addr_39_8_f(u32 v)
2448{
2449 return (v & 0xffffffffU) << 0U;
2450}
2451static inline u32 gr_gpcs_setup_bundle_cb_base_addr_39_8_m(void)
2452{
2453 return 0xffffffffU << 0U;
2454}
2455static inline u32 gr_gpcs_setup_bundle_cb_base_addr_39_8_v(u32 r)
2456{
2457 return (r >> 0U) & 0xffffffffU;
2458}
2459static inline u32 gr_gpcs_setup_bundle_cb_base_addr_39_8_init_v(void)
2460{
2461 return 0x00000000U;
2462}
2463static inline u32 gr_gpcs_setup_bundle_cb_base_addr_39_8_init_f(void)
2464{
2465 return 0x0U;
2466}
2467static inline u32 gr_gpcs_setup_bundle_cb_size_r(void)
2468{
2469 return 0x0041880cU;
2470}
2471static inline u32 gr_gpcs_setup_bundle_cb_size_div_256b_s(void)
2472{
2473 return 11U;
2474}
2475static inline u32 gr_gpcs_setup_bundle_cb_size_div_256b_f(u32 v)
2476{
2477 return (v & 0x7ffU) << 0U;
2478}
2479static inline u32 gr_gpcs_setup_bundle_cb_size_div_256b_m(void)
2480{
2481 return 0x7ffU << 0U;
2482}
2483static inline u32 gr_gpcs_setup_bundle_cb_size_div_256b_v(u32 r)
2484{
2485 return (r >> 0U) & 0x7ffU;
2486}
2487static inline u32 gr_gpcs_setup_bundle_cb_size_div_256b_init_v(void)
2488{
2489 return 0x00000000U;
2490}
2491static inline u32 gr_gpcs_setup_bundle_cb_size_div_256b_init_f(void)
2492{
2493 return 0x0U;
2494}
2495static inline u32 gr_gpcs_setup_bundle_cb_size_div_256b__prod_v(void)
2496{
2497 return 0x00000018U;
2498}
2499static inline u32 gr_gpcs_setup_bundle_cb_size_div_256b__prod_f(void)
2500{
2501 return 0x18U;
2502}
2503static inline u32 gr_gpcs_setup_bundle_cb_size_valid_s(void)
2504{
2505 return 1U;
2506}
2507static inline u32 gr_gpcs_setup_bundle_cb_size_valid_f(u32 v)
2508{
2509 return (v & 0x1U) << 31U;
2510}
2511static inline u32 gr_gpcs_setup_bundle_cb_size_valid_m(void)
2512{
2513 return 0x1U << 31U;
2514}
2515static inline u32 gr_gpcs_setup_bundle_cb_size_valid_v(u32 r)
2516{
2517 return (r >> 31U) & 0x1U;
2518}
2519static inline u32 gr_gpcs_setup_bundle_cb_size_valid_false_v(void)
2520{
2521 return 0x00000000U;
2522}
2523static inline u32 gr_gpcs_setup_bundle_cb_size_valid_false_f(void)
2524{
2525 return 0x0U;
2526}
2527static inline u32 gr_gpcs_setup_bundle_cb_size_valid_true_v(void)
2528{
2529 return 0x00000001U;
2530}
2531static inline u32 gr_gpcs_setup_bundle_cb_size_valid_true_f(void)
2532{
2533 return 0x80000000U;
2534}
2535static inline u32 gr_gpcs_setup_attrib_cb_base_r(void)
2536{
2537 return 0x00418810U;
2538}
2539static inline u32 gr_gpcs_setup_attrib_cb_base_addr_39_12_f(u32 v)
2540{
2541 return (v & 0xfffffffU) << 0U;
2542}
2543static inline u32 gr_gpcs_setup_attrib_cb_base_addr_39_12_align_bits_v(void)
2544{
2545 return 0x0000000cU;
2546}
2547static inline u32 gr_gpcs_setup_attrib_cb_base_valid_true_f(void)
2548{
2549 return 0x80000000U;
2550}
2551static inline u32 gr_crstr_gpc_map0_r(void)
2552{
2553 return 0x00418b08U;
2554}
2555static inline u32 gr_crstr_gpc_map0_tile0_f(u32 v)
2556{
2557 return (v & 0x7U) << 0U;
2558}
2559static inline u32 gr_crstr_gpc_map0_tile1_f(u32 v)
2560{
2561 return (v & 0x7U) << 5U;
2562}
2563static inline u32 gr_crstr_gpc_map0_tile2_f(u32 v)
2564{
2565 return (v & 0x7U) << 10U;
2566}
2567static inline u32 gr_crstr_gpc_map0_tile3_f(u32 v)
2568{
2569 return (v & 0x7U) << 15U;
2570}
2571static inline u32 gr_crstr_gpc_map0_tile4_f(u32 v)
2572{
2573 return (v & 0x7U) << 20U;
2574}
2575static inline u32 gr_crstr_gpc_map0_tile5_f(u32 v)
2576{
2577 return (v & 0x7U) << 25U;
2578}
2579static inline u32 gr_crstr_gpc_map1_r(void)
2580{
2581 return 0x00418b0cU;
2582}
2583static inline u32 gr_crstr_gpc_map1_tile6_f(u32 v)
2584{
2585 return (v & 0x7U) << 0U;
2586}
2587static inline u32 gr_crstr_gpc_map1_tile7_f(u32 v)
2588{
2589 return (v & 0x7U) << 5U;
2590}
2591static inline u32 gr_crstr_gpc_map1_tile8_f(u32 v)
2592{
2593 return (v & 0x7U) << 10U;
2594}
2595static inline u32 gr_crstr_gpc_map1_tile9_f(u32 v)
2596{
2597 return (v & 0x7U) << 15U;
2598}
2599static inline u32 gr_crstr_gpc_map1_tile10_f(u32 v)
2600{
2601 return (v & 0x7U) << 20U;
2602}
2603static inline u32 gr_crstr_gpc_map1_tile11_f(u32 v)
2604{
2605 return (v & 0x7U) << 25U;
2606}
2607static inline u32 gr_crstr_gpc_map2_r(void)
2608{
2609 return 0x00418b10U;
2610}
2611static inline u32 gr_crstr_gpc_map2_tile12_f(u32 v)
2612{
2613 return (v & 0x7U) << 0U;
2614}
2615static inline u32 gr_crstr_gpc_map2_tile13_f(u32 v)
2616{
2617 return (v & 0x7U) << 5U;
2618}
2619static inline u32 gr_crstr_gpc_map2_tile14_f(u32 v)
2620{
2621 return (v & 0x7U) << 10U;
2622}
2623static inline u32 gr_crstr_gpc_map2_tile15_f(u32 v)
2624{
2625 return (v & 0x7U) << 15U;
2626}
2627static inline u32 gr_crstr_gpc_map2_tile16_f(u32 v)
2628{
2629 return (v & 0x7U) << 20U;
2630}
2631static inline u32 gr_crstr_gpc_map2_tile17_f(u32 v)
2632{
2633 return (v & 0x7U) << 25U;
2634}
2635static inline u32 gr_crstr_gpc_map3_r(void)
2636{
2637 return 0x00418b14U;
2638}
2639static inline u32 gr_crstr_gpc_map3_tile18_f(u32 v)
2640{
2641 return (v & 0x7U) << 0U;
2642}
2643static inline u32 gr_crstr_gpc_map3_tile19_f(u32 v)
2644{
2645 return (v & 0x7U) << 5U;
2646}
2647static inline u32 gr_crstr_gpc_map3_tile20_f(u32 v)
2648{
2649 return (v & 0x7U) << 10U;
2650}
2651static inline u32 gr_crstr_gpc_map3_tile21_f(u32 v)
2652{
2653 return (v & 0x7U) << 15U;
2654}
2655static inline u32 gr_crstr_gpc_map3_tile22_f(u32 v)
2656{
2657 return (v & 0x7U) << 20U;
2658}
2659static inline u32 gr_crstr_gpc_map3_tile23_f(u32 v)
2660{
2661 return (v & 0x7U) << 25U;
2662}
2663static inline u32 gr_crstr_gpc_map4_r(void)
2664{
2665 return 0x00418b18U;
2666}
2667static inline u32 gr_crstr_gpc_map4_tile24_f(u32 v)
2668{
2669 return (v & 0x7U) << 0U;
2670}
2671static inline u32 gr_crstr_gpc_map4_tile25_f(u32 v)
2672{
2673 return (v & 0x7U) << 5U;
2674}
2675static inline u32 gr_crstr_gpc_map4_tile26_f(u32 v)
2676{
2677 return (v & 0x7U) << 10U;
2678}
2679static inline u32 gr_crstr_gpc_map4_tile27_f(u32 v)
2680{
2681 return (v & 0x7U) << 15U;
2682}
2683static inline u32 gr_crstr_gpc_map4_tile28_f(u32 v)
2684{
2685 return (v & 0x7U) << 20U;
2686}
2687static inline u32 gr_crstr_gpc_map4_tile29_f(u32 v)
2688{
2689 return (v & 0x7U) << 25U;
2690}
2691static inline u32 gr_crstr_gpc_map5_r(void)
2692{
2693 return 0x00418b1cU;
2694}
2695static inline u32 gr_crstr_gpc_map5_tile30_f(u32 v)
2696{
2697 return (v & 0x7U) << 0U;
2698}
2699static inline u32 gr_crstr_gpc_map5_tile31_f(u32 v)
2700{
2701 return (v & 0x7U) << 5U;
2702}
2703static inline u32 gr_crstr_gpc_map5_tile32_f(u32 v)
2704{
2705 return (v & 0x7U) << 10U;
2706}
2707static inline u32 gr_crstr_gpc_map5_tile33_f(u32 v)
2708{
2709 return (v & 0x7U) << 15U;
2710}
2711static inline u32 gr_crstr_gpc_map5_tile34_f(u32 v)
2712{
2713 return (v & 0x7U) << 20U;
2714}
2715static inline u32 gr_crstr_gpc_map5_tile35_f(u32 v)
2716{
2717 return (v & 0x7U) << 25U;
2718}
2719static inline u32 gr_crstr_map_table_cfg_r(void)
2720{
2721 return 0x00418bb8U;
2722}
2723static inline u32 gr_crstr_map_table_cfg_row_offset_f(u32 v)
2724{
2725 return (v & 0xffU) << 0U;
2726}
2727static inline u32 gr_crstr_map_table_cfg_num_entries_f(u32 v)
2728{
2729 return (v & 0xffU) << 8U;
2730}
2731static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map0_r(void)
2732{
2733 return 0x00418980U;
2734}
2735static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map0_tile_0_f(u32 v)
2736{
2737 return (v & 0x7U) << 0U;
2738}
2739static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map0_tile_1_f(u32 v)
2740{
2741 return (v & 0x7U) << 4U;
2742}
2743static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map0_tile_2_f(u32 v)
2744{
2745 return (v & 0x7U) << 8U;
2746}
2747static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map0_tile_3_f(u32 v)
2748{
2749 return (v & 0x7U) << 12U;
2750}
2751static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map0_tile_4_f(u32 v)
2752{
2753 return (v & 0x7U) << 16U;
2754}
2755static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map0_tile_5_f(u32 v)
2756{
2757 return (v & 0x7U) << 20U;
2758}
2759static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map0_tile_6_f(u32 v)
2760{
2761 return (v & 0x7U) << 24U;
2762}
2763static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map0_tile_7_f(u32 v)
2764{
2765 return (v & 0x7U) << 28U;
2766}
2767static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map1_r(void)
2768{
2769 return 0x00418984U;
2770}
2771static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map1_tile_8_f(u32 v)
2772{
2773 return (v & 0x7U) << 0U;
2774}
2775static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map1_tile_9_f(u32 v)
2776{
2777 return (v & 0x7U) << 4U;
2778}
2779static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map1_tile_10_f(u32 v)
2780{
2781 return (v & 0x7U) << 8U;
2782}
2783static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map1_tile_11_f(u32 v)
2784{
2785 return (v & 0x7U) << 12U;
2786}
2787static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map1_tile_12_f(u32 v)
2788{
2789 return (v & 0x7U) << 16U;
2790}
2791static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map1_tile_13_f(u32 v)
2792{
2793 return (v & 0x7U) << 20U;
2794}
2795static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map1_tile_14_f(u32 v)
2796{
2797 return (v & 0x7U) << 24U;
2798}
2799static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map1_tile_15_f(u32 v)
2800{
2801 return (v & 0x7U) << 28U;
2802}
2803static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map2_r(void)
2804{
2805 return 0x00418988U;
2806}
2807static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map2_tile_16_f(u32 v)
2808{
2809 return (v & 0x7U) << 0U;
2810}
2811static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map2_tile_17_f(u32 v)
2812{
2813 return (v & 0x7U) << 4U;
2814}
2815static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map2_tile_18_f(u32 v)
2816{
2817 return (v & 0x7U) << 8U;
2818}
2819static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map2_tile_19_f(u32 v)
2820{
2821 return (v & 0x7U) << 12U;
2822}
2823static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map2_tile_20_f(u32 v)
2824{
2825 return (v & 0x7U) << 16U;
2826}
2827static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map2_tile_21_f(u32 v)
2828{
2829 return (v & 0x7U) << 20U;
2830}
2831static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map2_tile_22_f(u32 v)
2832{
2833 return (v & 0x7U) << 24U;
2834}
2835static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map2_tile_23_s(void)
2836{
2837 return 3U;
2838}
2839static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map2_tile_23_f(u32 v)
2840{
2841 return (v & 0x7U) << 28U;
2842}
2843static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map2_tile_23_m(void)
2844{
2845 return 0x7U << 28U;
2846}
2847static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map2_tile_23_v(u32 r)
2848{
2849 return (r >> 28U) & 0x7U;
2850}
2851static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map3_r(void)
2852{
2853 return 0x0041898cU;
2854}
2855static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map3_tile_24_f(u32 v)
2856{
2857 return (v & 0x7U) << 0U;
2858}
2859static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map3_tile_25_f(u32 v)
2860{
2861 return (v & 0x7U) << 4U;
2862}
2863static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map3_tile_26_f(u32 v)
2864{
2865 return (v & 0x7U) << 8U;
2866}
2867static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map3_tile_27_f(u32 v)
2868{
2869 return (v & 0x7U) << 12U;
2870}
2871static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map3_tile_28_f(u32 v)
2872{
2873 return (v & 0x7U) << 16U;
2874}
2875static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map3_tile_29_f(u32 v)
2876{
2877 return (v & 0x7U) << 20U;
2878}
2879static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map3_tile_30_f(u32 v)
2880{
2881 return (v & 0x7U) << 24U;
2882}
2883static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map3_tile_31_f(u32 v)
2884{
2885 return (v & 0x7U) << 28U;
2886}
2887static inline u32 gr_gpcs_gpm_pd_cfg_r(void)
2888{
2889 return 0x00418c6cU;
2890}
2891static inline u32 gr_gpcs_gpm_pd_cfg_timeslice_mode_disable_f(void)
2892{
2893 return 0x0U;
2894}
2895static inline u32 gr_gpcs_gpm_pd_cfg_timeslice_mode_enable_f(void)
2896{
2897 return 0x1U;
2898}
2899static inline u32 gr_gpcs_gcc_pagepool_base_r(void)
2900{
2901 return 0x00419004U;
2902}
2903static inline u32 gr_gpcs_gcc_pagepool_base_addr_39_8_f(u32 v)
2904{
2905 return (v & 0xffffffffU) << 0U;
2906}
2907static inline u32 gr_gpcs_gcc_pagepool_r(void)
2908{
2909 return 0x00419008U;
2910}
2911static inline u32 gr_gpcs_gcc_pagepool_total_pages_f(u32 v)
2912{
2913 return (v & 0xffU) << 0U;
2914}
2915static inline u32 gr_gpcs_tpcs_pe_vaf_r(void)
2916{
2917 return 0x0041980cU;
2918}
2919static inline u32 gr_gpcs_tpcs_pe_vaf_fast_mode_switch_true_f(void)
2920{
2921 return 0x10U;
2922}
2923static inline u32 gr_gpcs_tpcs_pe_pin_cb_global_base_addr_r(void)
2924{
2925 return 0x00419848U;
2926}
2927static inline u32 gr_gpcs_tpcs_pe_pin_cb_global_base_addr_v_f(u32 v)
2928{
2929 return (v & 0xfffffffU) << 0U;
2930}
2931static inline u32 gr_gpcs_tpcs_pe_pin_cb_global_base_addr_valid_f(u32 v)
2932{
2933 return (v & 0x1U) << 28U;
2934}
2935static inline u32 gr_gpcs_tpcs_pe_pin_cb_global_base_addr_valid_true_f(void)
2936{
2937 return 0x10000000U;
2938}
2939static inline u32 gr_gpcs_tpcs_mpc_vtg_debug_r(void)
2940{
2941 return 0x00419c00U;
2942}
2943static inline u32 gr_gpcs_tpcs_mpc_vtg_debug_timeslice_mode_disabled_f(void)
2944{
2945 return 0x0U;
2946}
2947static inline u32 gr_gpcs_tpcs_mpc_vtg_debug_timeslice_mode_enabled_f(void)
2948{
2949 return 0x8U;
2950}
2951static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_r(void)
2952{
2953 return 0x00419e44U;
2954}
2955static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_stack_error_report_f(void)
2956{
2957 return 0x2U;
2958}
2959static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_api_stack_error_report_f(void)
2960{
2961 return 0x4U;
2962}
2963static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_ret_empty_stack_error_report_f(void)
2964{
2965 return 0x8U;
2966}
2967static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_pc_wrap_report_f(void)
2968{
2969 return 0x10U;
2970}
2971static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_misaligned_pc_report_f(void)
2972{
2973 return 0x20U;
2974}
2975static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_pc_overflow_report_f(void)
2976{
2977 return 0x40U;
2978}
2979static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_misaligned_immc_addr_report_f(void)
2980{
2981 return 0x80U;
2982}
2983static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_misaligned_reg_report_f(void)
2984{
2985 return 0x100U;
2986}
2987static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_illegal_instr_encoding_report_f(void)
2988{
2989 return 0x200U;
2990}
2991static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_illegal_sph_instr_combo_report_f(void)
2992{
2993 return 0x400U;
2994}
2995static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_illegal_instr_param_report_f(void)
2996{
2997 return 0x800U;
2998}
2999static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_invalid_const_addr_report_f(void)
3000{
3001 return 0x1000U;
3002}
3003static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_oor_reg_report_f(void)
3004{
3005 return 0x2000U;
3006}
3007static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_oor_addr_report_f(void)
3008{
3009 return 0x4000U;
3010}
3011static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_misaligned_addr_report_f(void)
3012{
3013 return 0x8000U;
3014}
3015static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_invalid_addr_space_report_f(void)
3016{
3017 return 0x10000U;
3018}
3019static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_illegal_instr_param2_report_f(void)
3020{
3021 return 0x20000U;
3022}
3023static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_invalid_const_addr_ldc_report_f(void)
3024{
3025 return 0x40000U;
3026}
3027static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_geometry_sm_error_report_f(void)
3028{
3029 return 0x80000U;
3030}
3031static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_divergent_report_f(void)
3032{
3033 return 0x100000U;
3034}
3035static inline u32 gr_gpcs_tpcs_sm_hww_global_esr_report_mask_r(void)
3036{
3037 return 0x00419e4cU;
3038}
3039static inline u32 gr_gpcs_tpcs_sm_hww_global_esr_report_mask_sm_to_sm_fault_report_f(void)
3040{
3041 return 0x1U;
3042}
3043static inline u32 gr_gpcs_tpcs_sm_hww_global_esr_report_mask_l1_error_report_f(void)
3044{
3045 return 0x2U;
3046}
3047static inline u32 gr_gpcs_tpcs_sm_hww_global_esr_report_mask_multiple_warp_errors_report_f(void)
3048{
3049 return 0x4U;
3050}
3051static inline u32 gr_gpcs_tpcs_sm_hww_global_esr_report_mask_physical_stack_overflow_error_report_f(void)
3052{
3053 return 0x8U;
3054}
3055static inline u32 gr_gpcs_tpcs_sm_hww_global_esr_report_mask_bpt_int_report_f(void)
3056{
3057 return 0x10U;
3058}
3059static inline u32 gr_gpcs_tpcs_sm_hww_global_esr_report_mask_bpt_pause_report_f(void)
3060{
3061 return 0x20U;
3062}
3063static inline u32 gr_gpcs_tpcs_sm_hww_global_esr_report_mask_single_step_complete_report_f(void)
3064{
3065 return 0x40U;
3066}
3067static inline u32 gr_gpcs_tpcs_tpccs_tpc_exception_en_r(void)
3068{
3069 return 0x00419d0cU;
3070}
3071static inline u32 gr_gpcs_tpcs_tpccs_tpc_exception_en_sm_enabled_f(void)
3072{
3073 return 0x2U;
3074}
3075static inline u32 gr_gpcs_tpcs_tpccs_tpc_exception_en_tex_enabled_f(void)
3076{
3077 return 0x1U;
3078}
3079static inline u32 gr_gpc0_tpc0_tpccs_tpc_exception_en_r(void)
3080{
3081 return 0x0050450cU;
3082}
3083static inline u32 gr_gpc0_tpc0_tpccs_tpc_exception_en_sm_v(u32 r)
3084{
3085 return (r >> 1U) & 0x1U;
3086}
3087static inline u32 gr_gpc0_tpc0_tpccs_tpc_exception_en_sm_enabled_f(void)
3088{
3089 return 0x2U;
3090}
3091static inline u32 gr_gpcs_gpccs_gpc_exception_en_r(void)
3092{
3093 return 0x0041ac94U;
3094}
3095static inline u32 gr_gpcs_gpccs_gpc_exception_en_tpc_f(u32 v)
3096{
3097 return (v & 0xffU) << 16U;
3098}
3099static inline u32 gr_gpc0_gpccs_gpc_exception_r(void)
3100{
3101 return 0x00502c90U;
3102}
3103static inline u32 gr_gpc0_gpccs_gpc_exception_gcc_v(u32 r)
3104{
3105 return (r >> 2U) & 0x1U;
3106}
3107static inline u32 gr_gpc0_gpccs_gpc_exception_tpc_v(u32 r)
3108{
3109 return (r >> 16U) & 0xffU;
3110}
3111static inline u32 gr_gpc0_gpccs_gpc_exception_tpc_0_pending_v(void)
3112{
3113 return 0x00000001U;
3114}
3115static inline u32 gr_gpc0_tpc0_tpccs_tpc_exception_r(void)
3116{
3117 return 0x00504508U;
3118}
3119static inline u32 gr_gpc0_tpc0_tpccs_tpc_exception_tex_v(u32 r)
3120{
3121 return (r >> 0U) & 0x1U;
3122}
3123static inline u32 gr_gpc0_tpc0_tpccs_tpc_exception_tex_pending_v(void)
3124{
3125 return 0x00000001U;
3126}
3127static inline u32 gr_gpc0_tpc0_tpccs_tpc_exception_sm_v(u32 r)
3128{
3129 return (r >> 1U) & 0x1U;
3130}
3131static inline u32 gr_gpc0_tpc0_tpccs_tpc_exception_sm_pending_v(void)
3132{
3133 return 0x00000001U;
3134}
3135static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_r(void)
3136{
3137 return 0x00504610U;
3138}
3139static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_debugger_mode_m(void)
3140{
3141 return 0x1U << 0U;
3142}
3143static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_debugger_mode_v(u32 r)
3144{
3145 return (r >> 0U) & 0x1U;
3146}
3147static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_debugger_mode_on_v(void)
3148{
3149 return 0x00000001U;
3150}
3151static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_debugger_mode_on_f(void)
3152{
3153 return 0x1U;
3154}
3155static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_debugger_mode_off_v(void)
3156{
3157 return 0x00000000U;
3158}
3159static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_debugger_mode_off_f(void)
3160{
3161 return 0x0U;
3162}
3163static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_stop_trigger_enable_f(void)
3164{
3165 return 0x80000000U;
3166}
3167static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_stop_trigger_disable_f(void)
3168{
3169 return 0x0U;
3170}
3171static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_single_step_mode_enable_f(void)
3172{
3173 return 0x8U;
3174}
3175static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_single_step_mode_disable_f(void)
3176{
3177 return 0x0U;
3178}
3179static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_run_trigger_task_f(void)
3180{
3181 return 0x40000000U;
3182}
3183static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_stop_on_any_warp_m(void)
3184{
3185 return 0x1U << 1U;
3186}
3187static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_stop_on_any_warp_v(u32 r)
3188{
3189 return (r >> 1U) & 0x1U;
3190}
3191static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_stop_on_any_warp_disable_f(void)
3192{
3193 return 0x0U;
3194}
3195static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_stop_on_any_sm_m(void)
3196{
3197 return 0x1U << 2U;
3198}
3199static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_stop_on_any_sm_v(u32 r)
3200{
3201 return (r >> 2U) & 0x1U;
3202}
3203static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_stop_on_any_sm_disable_f(void)
3204{
3205 return 0x0U;
3206}
3207static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_stop_on_any_sm_stop_on_any_warp_disable_v(void)
3208{
3209 return 0x00000000U;
3210}
3211static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_stop_on_any_sm_stop_on_any_sm_disable_v(void)
3212{
3213 return 0x00000000U;
3214}
3215static inline u32 gr_gpc0_tpc0_sm_warp_valid_mask_r(void)
3216{
3217 return 0x00504614U;
3218}
3219static inline u32 gr_gpc0_tpc0_sm_warp_valid_mask_1_r(void)
3220{
3221 return 0x00504618U;
3222}
3223static inline u32 gr_gpc0_tpc0_sm_dbgr_bpt_pause_mask_r(void)
3224{
3225 return 0x00504624U;
3226}
3227static inline u32 gr_gpc0_tpc0_sm_dbgr_bpt_pause_mask_1_r(void)
3228{
3229 return 0x00504628U;
3230}
3231static inline u32 gr_gpc0_tpc0_sm_dbgr_bpt_trap_mask_r(void)
3232{
3233 return 0x00504634U;
3234}
3235static inline u32 gr_gpc0_tpc0_sm_dbgr_bpt_trap_mask_1_r(void)
3236{
3237 return 0x00504638U;
3238}
3239static inline u32 gr_gpcs_tpcs_sm_dbgr_bpt_pause_mask_r(void)
3240{
3241 return 0x00419e24U;
3242}
3243static inline u32 gr_gpc0_tpc0_sm_dbgr_status0_r(void)
3244{
3245 return 0x0050460cU;
3246}
3247static inline u32 gr_gpc0_tpc0_sm_dbgr_status0_sm_in_trap_mode_v(u32 r)
3248{
3249 return (r >> 0U) & 0x1U;
3250}
3251static inline u32 gr_gpc0_tpc0_sm_dbgr_status0_locked_down_v(u32 r)
3252{
3253 return (r >> 4U) & 0x1U;
3254}
3255static inline u32 gr_gpc0_tpc0_sm_dbgr_status0_locked_down_true_v(void)
3256{
3257 return 0x00000001U;
3258}
3259static inline u32 gr_gpcs_tpcs_sm_hww_global_esr_r(void)
3260{
3261 return 0x00419e50U;
3262}
3263static inline u32 gr_gpcs_tpcs_sm_hww_global_esr_bpt_int_pending_f(void)
3264{
3265 return 0x10U;
3266}
3267static inline u32 gr_gpcs_tpcs_sm_hww_global_esr_bpt_pause_pending_f(void)
3268{
3269 return 0x20U;
3270}
3271static inline u32 gr_gpcs_tpcs_sm_hww_global_esr_single_step_complete_pending_f(void)
3272{
3273 return 0x40U;
3274}
3275static inline u32 gr_gpcs_tpcs_sm_hww_global_esr_sm_to_sm_fault_pending_f(void)
3276{
3277 return 0x1U;
3278}
3279static inline u32 gr_gpcs_tpcs_sm_hww_global_esr_l1_error_pending_f(void)
3280{
3281 return 0x2U;
3282}
3283static inline u32 gr_gpcs_tpcs_sm_hww_global_esr_multiple_warp_errors_pending_f(void)
3284{
3285 return 0x4U;
3286}
3287static inline u32 gr_gpcs_tpcs_sm_hww_global_esr_physical_stack_overflow_error_pending_f(void)
3288{
3289 return 0x8U;
3290}
3291static inline u32 gr_gpcs_tpcs_sm_hww_global_esr_timeout_error_pending_f(void)
3292{
3293 return 0x80000000U;
3294}
3295static inline u32 gr_gpc0_tpc0_sm_hww_global_esr_r(void)
3296{
3297 return 0x00504650U;
3298}
3299static inline u32 gr_gpc0_tpc0_sm_hww_global_esr_bpt_int_pending_f(void)
3300{
3301 return 0x10U;
3302}
3303static inline u32 gr_gpc0_tpc0_sm_hww_global_esr_bpt_pause_pending_f(void)
3304{
3305 return 0x20U;
3306}
3307static inline u32 gr_gpc0_tpc0_sm_hww_global_esr_single_step_complete_pending_f(void)
3308{
3309 return 0x40U;
3310}
3311static inline u32 gr_gpc0_tpc0_sm_hww_global_esr_sm_to_sm_fault_pending_f(void)
3312{
3313 return 0x1U;
3314}
3315static inline u32 gr_gpc0_tpc0_sm_hww_global_esr_l1_error_pending_f(void)
3316{
3317 return 0x2U;
3318}
3319static inline u32 gr_gpc0_tpc0_sm_hww_global_esr_multiple_warp_errors_pending_f(void)
3320{
3321 return 0x4U;
3322}
3323static inline u32 gr_gpc0_tpc0_sm_hww_global_esr_physical_stack_overflow_error_pending_f(void)
3324{
3325 return 0x8U;
3326}
3327static inline u32 gr_gpc0_tpc0_sm_hww_global_esr_timeout_error_pending_f(void)
3328{
3329 return 0x80000000U;
3330}
3331static inline u32 gr_gpc0_tpc0_tex_m_hww_esr_r(void)
3332{
3333 return 0x00504224U;
3334}
3335static inline u32 gr_gpc0_tpc0_tex_m_hww_esr_intr_pending_f(void)
3336{
3337 return 0x1U;
3338}
3339static inline u32 gr_gpc0_tpc0_sm_hww_warp_esr_r(void)
3340{
3341 return 0x00504648U;
3342}
3343static inline u32 gr_gpc0_tpc0_sm_hww_warp_esr_error_v(u32 r)
3344{
3345 return (r >> 0U) & 0xffffU;
3346}
3347static inline u32 gr_gpc0_tpc0_sm_hww_warp_esr_error_none_v(void)
3348{
3349 return 0x00000000U;
3350}
3351static inline u32 gr_gpc0_tpc0_sm_hww_warp_esr_error_none_f(void)
3352{
3353 return 0x0U;
3354}
3355static inline u32 gr_gpc0_tpc0_sm_halfctl_ctrl_r(void)
3356{
3357 return 0x00504770U;
3358}
3359static inline u32 gr_gpcs_tpcs_sm_halfctl_ctrl_r(void)
3360{
3361 return 0x00419f70U;
3362}
3363static inline u32 gr_gpcs_tpcs_sm_halfctl_ctrl_sctl_read_quad_ctl_m(void)
3364{
3365 return 0x1U << 4U;
3366}
3367static inline u32 gr_gpcs_tpcs_sm_halfctl_ctrl_sctl_read_quad_ctl_f(u32 v)
3368{
3369 return (v & 0x1U) << 4U;
3370}
3371static inline u32 gr_gpc0_tpc0_sm_debug_sfe_control_r(void)
3372{
3373 return 0x0050477cU;
3374}
3375static inline u32 gr_gpcs_tpcs_sm_debug_sfe_control_r(void)
3376{
3377 return 0x00419f7cU;
3378}
3379static inline u32 gr_gpcs_tpcs_sm_debug_sfe_control_read_half_ctl_m(void)
3380{
3381 return 0x1U << 0U;
3382}
3383static inline u32 gr_gpcs_tpcs_sm_debug_sfe_control_read_half_ctl_f(u32 v)
3384{
3385 return (v & 0x1U) << 0U;
3386}
3387static inline u32 gr_gpcs_tpcs_pes_vsc_vpc_r(void)
3388{
3389 return 0x0041be08U;
3390}
3391static inline u32 gr_gpcs_tpcs_pes_vsc_vpc_fast_mode_switch_true_f(void)
3392{
3393 return 0x4U;
3394}
3395static inline u32 gr_ppcs_wwdx_map_gpc_map0_r(void)
3396{
3397 return 0x0041bf00U;
3398}
3399static inline u32 gr_ppcs_wwdx_map_gpc_map1_r(void)
3400{
3401 return 0x0041bf04U;
3402}
3403static inline u32 gr_ppcs_wwdx_map_gpc_map2_r(void)
3404{
3405 return 0x0041bf08U;
3406}
3407static inline u32 gr_ppcs_wwdx_map_gpc_map3_r(void)
3408{
3409 return 0x0041bf0cU;
3410}
3411static inline u32 gr_ppcs_wwdx_map_gpc_map4_r(void)
3412{
3413 return 0x0041bf10U;
3414}
3415static inline u32 gr_ppcs_wwdx_map_gpc_map5_r(void)
3416{
3417 return 0x0041bf14U;
3418}
3419static inline u32 gr_ppcs_wwdx_map_table_cfg_r(void)
3420{
3421 return 0x0041bfd0U;
3422}
3423static inline u32 gr_ppcs_wwdx_map_table_cfg_row_offset_f(u32 v)
3424{
3425 return (v & 0xffU) << 0U;
3426}
3427static inline u32 gr_ppcs_wwdx_map_table_cfg_num_entries_f(u32 v)
3428{
3429 return (v & 0xffU) << 8U;
3430}
3431static inline u32 gr_ppcs_wwdx_map_table_cfg_normalized_num_entries_f(u32 v)
3432{
3433 return (v & 0x1fU) << 16U;
3434}
3435static inline u32 gr_ppcs_wwdx_map_table_cfg_normalized_shift_value_f(u32 v)
3436{
3437 return (v & 0x7U) << 21U;
3438}
3439static inline u32 gr_ppcs_wwdx_map_table_cfg_coeff5_mod_value_f(u32 v)
3440{
3441 return (v & 0x1fU) << 24U;
3442}
3443static inline u32 gr_gpcs_ppcs_wwdx_sm_num_rcp_r(void)
3444{
3445 return 0x0041bfd4U;
3446}
3447static inline u32 gr_gpcs_ppcs_wwdx_sm_num_rcp_conservative_f(u32 v)
3448{
3449 return (v & 0xffffffU) << 0U;
3450}
3451static inline u32 gr_ppcs_wwdx_map_table_cfg2_r(void)
3452{
3453 return 0x0041bfe4U;
3454}
3455static inline u32 gr_ppcs_wwdx_map_table_cfg2_coeff6_mod_value_f(u32 v)
3456{
3457 return (v & 0x1fU) << 0U;
3458}
3459static inline u32 gr_ppcs_wwdx_map_table_cfg2_coeff7_mod_value_f(u32 v)
3460{
3461 return (v & 0x1fU) << 5U;
3462}
3463static inline u32 gr_ppcs_wwdx_map_table_cfg2_coeff8_mod_value_f(u32 v)
3464{
3465 return (v & 0x1fU) << 10U;
3466}
3467static inline u32 gr_ppcs_wwdx_map_table_cfg2_coeff9_mod_value_f(u32 v)
3468{
3469 return (v & 0x1fU) << 15U;
3470}
3471static inline u32 gr_ppcs_wwdx_map_table_cfg2_coeff10_mod_value_f(u32 v)
3472{
3473 return (v & 0x1fU) << 20U;
3474}
3475static inline u32 gr_ppcs_wwdx_map_table_cfg2_coeff11_mod_value_f(u32 v)
3476{
3477 return (v & 0x1fU) << 25U;
3478}
3479static inline u32 gr_gpcs_ppcs_cbm_cfg_r(void)
3480{
3481 return 0x0041bec0U;
3482}
3483static inline u32 gr_gpcs_ppcs_cbm_cfg_timeslice_mode_enable_v(void)
3484{
3485 return 0x00000001U;
3486}
3487static inline u32 gr_bes_zrop_settings_r(void)
3488{
3489 return 0x00408850U;
3490}
3491static inline u32 gr_bes_zrop_settings_num_active_fbps_f(u32 v)
3492{
3493 return (v & 0xfU) << 0U;
3494}
3495static inline u32 gr_bes_crop_settings_r(void)
3496{
3497 return 0x00408958U;
3498}
3499static inline u32 gr_bes_crop_settings_num_active_fbps_f(u32 v)
3500{
3501 return (v & 0xfU) << 0U;
3502}
3503static inline u32 gr_zcull_bytes_per_aliquot_per_gpu_v(void)
3504{
3505 return 0x00000020U;
3506}
3507static inline u32 gr_zcull_save_restore_header_bytes_per_gpc_v(void)
3508{
3509 return 0x00000020U;
3510}
3511static inline u32 gr_zcull_save_restore_subregion_header_bytes_per_gpc_v(void)
3512{
3513 return 0x000000c0U;
3514}
3515static inline u32 gr_zcull_subregion_qty_v(void)
3516{
3517 return 0x00000010U;
3518}
3519static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter_control_sel0_r(void)
3520{
3521 return 0x00504604U;
3522}
3523static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter_control_sel1_r(void)
3524{
3525 return 0x00504608U;
3526}
3527static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter_control0_r(void)
3528{
3529 return 0x0050465cU;
3530}
3531static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter_control1_r(void)
3532{
3533 return 0x00504660U;
3534}
3535static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter_control2_r(void)
3536{
3537 return 0x00504664U;
3538}
3539static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter_control3_r(void)
3540{
3541 return 0x00504668U;
3542}
3543static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter_control4_r(void)
3544{
3545 return 0x0050466cU;
3546}
3547static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter_control5_r(void)
3548{
3549 return 0x00504658U;
3550}
3551static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter_status_r(void)
3552{
3553 return 0x00504670U;
3554}
3555static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter_status1_r(void)
3556{
3557 return 0x00504694U;
3558}
3559static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter0_control_r(void)
3560{
3561 return 0x00504730U;
3562}
3563static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter1_control_r(void)
3564{
3565 return 0x00504734U;
3566}
3567static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter2_control_r(void)
3568{
3569 return 0x00504738U;
3570}
3571static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter3_control_r(void)
3572{
3573 return 0x0050473cU;
3574}
3575static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter4_control_r(void)
3576{
3577 return 0x00504740U;
3578}
3579static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter5_control_r(void)
3580{
3581 return 0x00504744U;
3582}
3583static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter6_control_r(void)
3584{
3585 return 0x00504748U;
3586}
3587static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter7_control_r(void)
3588{
3589 return 0x0050474cU;
3590}
3591static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter0_r(void)
3592{
3593 return 0x00504674U;
3594}
3595static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter1_r(void)
3596{
3597 return 0x00504678U;
3598}
3599static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter2_r(void)
3600{
3601 return 0x0050467cU;
3602}
3603static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter3_r(void)
3604{
3605 return 0x00504680U;
3606}
3607static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter4_r(void)
3608{
3609 return 0x00504684U;
3610}
3611static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter5_r(void)
3612{
3613 return 0x00504688U;
3614}
3615static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter6_r(void)
3616{
3617 return 0x0050468cU;
3618}
3619static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter7_r(void)
3620{
3621 return 0x00504690U;
3622}
3623static inline u32 gr_fe_pwr_mode_r(void)
3624{
3625 return 0x00404170U;
3626}
3627static inline u32 gr_fe_pwr_mode_mode_auto_f(void)
3628{
3629 return 0x0U;
3630}
3631static inline u32 gr_fe_pwr_mode_mode_force_on_f(void)
3632{
3633 return 0x2U;
3634}
3635static inline u32 gr_fe_pwr_mode_req_v(u32 r)
3636{
3637 return (r >> 4U) & 0x1U;
3638}
3639static inline u32 gr_fe_pwr_mode_req_send_f(void)
3640{
3641 return 0x10U;
3642}
3643static inline u32 gr_fe_pwr_mode_req_done_v(void)
3644{
3645 return 0x00000000U;
3646}
3647static inline u32 gr_gpc0_tpc0_l1c_dbg_r(void)
3648{
3649 return 0x005044b0U;
3650}
3651static inline u32 gr_gpc0_tpc0_l1c_dbg_cya15_en_f(void)
3652{
3653 return 0x8000000U;
3654}
3655static inline u32 gr_gpcs_tpcs_sm_sch_texlock_r(void)
3656{
3657 return 0x00419ec8U;
3658}
3659static inline u32 gr_gpcs_tpcs_sm_sch_texlock_tex_hash_m(void)
3660{
3661 return 0x1U << 0U;
3662}
3663static inline u32 gr_gpcs_tpcs_sm_sch_texlock_tex_hash_disable_f(void)
3664{
3665 return 0x0U;
3666}
3667static inline u32 gr_gpcs_tpcs_sm_sch_texlock_tex_hash_tile_m(void)
3668{
3669 return 0x1U << 1U;
3670}
3671static inline u32 gr_gpcs_tpcs_sm_sch_texlock_tex_hash_tile_disable_f(void)
3672{
3673 return 0x0U;
3674}
3675static inline u32 gr_gpcs_tpcs_sm_sch_texlock_tex_hash_phase_m(void)
3676{
3677 return 0x1U << 2U;
3678}
3679static inline u32 gr_gpcs_tpcs_sm_sch_texlock_tex_hash_phase_disable_f(void)
3680{
3681 return 0x0U;
3682}
3683static inline u32 gr_gpcs_tpcs_sm_sch_texlock_tex_hash_tex_m(void)
3684{
3685 return 0x1U << 3U;
3686}
3687static inline u32 gr_gpcs_tpcs_sm_sch_texlock_tex_hash_tex_disable_f(void)
3688{
3689 return 0x0U;
3690}
3691static inline u32 gr_gpcs_tpcs_sm_sch_texlock_tex_hash_timeout_m(void)
3692{
3693 return 0xffU << 4U;
3694}
3695static inline u32 gr_gpcs_tpcs_sm_sch_texlock_tex_hash_timeout_disable_f(void)
3696{
3697 return 0x0U;
3698}
3699static inline u32 gr_gpcs_tpcs_sm_sch_texlock_dot_t_unlock_m(void)
3700{
3701 return 0x1U << 16U;
3702}
3703static inline u32 gr_gpcs_tpcs_sm_sch_texlock_dot_t_unlock_disable_f(void)
3704{
3705 return 0x0U;
3706}
3707static inline u32 gr_gpcs_tpcs_sm_sch_macro_sched_r(void)
3708{
3709 return 0x00419eacU;
3710}
3711static inline u32 gr_gpcs_tpcs_sm_sch_macro_sched_lockboost_size_f(u32 v)
3712{
3713 return (v & 0x1U) << 2U;
3714}
3715static inline u32 gr_gpcs_tpcs_sm_sch_macro_sched_lockboost_size_m(void)
3716{
3717 return 0x1U << 2U;
3718}
3719static inline u32 gr_gpcs_tpcs_sm_dbgr_control0_r(void)
3720{
3721 return 0x00419e10U;
3722}
3723static inline u32 gr_gpcs_tpcs_sm_dbgr_control0_debugger_mode_f(u32 v)
3724{
3725 return (v & 0x1U) << 0U;
3726}
3727static inline u32 gr_gpcs_tpcs_sm_dbgr_control0_debugger_mode_on_v(void)
3728{
3729 return 0x00000001U;
3730}
3731static inline u32 gr_gpcs_tpcs_sm_dbgr_control0_stop_trigger_m(void)
3732{
3733 return 0x1U << 31U;
3734}
3735static inline u32 gr_gpcs_tpcs_sm_dbgr_control0_stop_trigger_v(u32 r)
3736{
3737 return (r >> 31U) & 0x1U;
3738}
3739static inline u32 gr_gpcs_tpcs_sm_dbgr_control0_stop_trigger_enable_f(void)
3740{
3741 return 0x80000000U;
3742}
3743static inline u32 gr_gpcs_tpcs_sm_dbgr_control0_stop_trigger_disable_f(void)
3744{
3745 return 0x0U;
3746}
3747static inline u32 gr_gpcs_tpcs_sm_dbgr_control0_single_step_mode_m(void)
3748{
3749 return 0x1U << 3U;
3750}
3751static inline u32 gr_gpcs_tpcs_sm_dbgr_control0_single_step_mode_enable_f(void)
3752{
3753 return 0x8U;
3754}
3755static inline u32 gr_gpcs_tpcs_sm_dbgr_control0_single_step_mode_disable_f(void)
3756{
3757 return 0x0U;
3758}
3759static inline u32 gr_gpcs_tpcs_sm_dbgr_control0_run_trigger_m(void)
3760{
3761 return 0x1U << 30U;
3762}
3763static inline u32 gr_gpcs_tpcs_sm_dbgr_control0_run_trigger_v(u32 r)
3764{
3765 return (r >> 30U) & 0x1U;
3766}
3767static inline u32 gr_gpcs_tpcs_sm_dbgr_control0_run_trigger_task_f(void)
3768{
3769 return 0x40000000U;
3770}
3771#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_ltc_gk20a.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_ltc_gk20a.h
new file mode 100644
index 00000000..efe7f98d
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_ltc_gk20a.h
@@ -0,0 +1,455 @@
1/*
2 * Copyright (c) 2012-2017, 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_ltc_gk20a_h_
57#define _hw_ltc_gk20a_h_
58
59static inline u32 ltc_pltcg_base_v(void)
60{
61 return 0x00140000U;
62}
63static inline u32 ltc_pltcg_extent_v(void)
64{
65 return 0x0017ffffU;
66}
67static inline u32 ltc_ltcs_lts0_cbc_ctrl1_r(void)
68{
69 return 0x001410c8U;
70}
71static inline u32 ltc_ltc0_lts0_dstg_cfg0_r(void)
72{
73 return 0x00141200U;
74}
75static inline u32 ltc_ltcs_ltss_dstg_cfg0_r(void)
76{
77 return 0x0017ea00U;
78}
79static inline u32 ltc_ltc0_lts0_tstg_cfg1_r(void)
80{
81 return 0x00141104U;
82}
83static inline u32 ltc_ltc0_lts0_tstg_cfg1_active_ways_v(u32 r)
84{
85 return (r >> 0U) & 0xffffU;
86}
87static inline u32 ltc_ltc0_lts0_tstg_cfg1_active_sets_v(u32 r)
88{
89 return (r >> 16U) & 0x3U;
90}
91static inline u32 ltc_ltc0_lts0_tstg_cfg1_active_sets_all_v(void)
92{
93 return 0x00000000U;
94}
95static inline u32 ltc_ltc0_lts0_tstg_cfg1_active_sets_half_v(void)
96{
97 return 0x00000001U;
98}
99static inline u32 ltc_ltc0_lts0_tstg_cfg1_active_sets_quarter_v(void)
100{
101 return 0x00000002U;
102}
103static inline u32 ltc_ltcs_ltss_cbc_ctrl1_r(void)
104{
105 return 0x0017e8c8U;
106}
107static inline u32 ltc_ltcs_ltss_cbc_ctrl1_clean_active_f(void)
108{
109 return 0x1U;
110}
111static inline u32 ltc_ltcs_ltss_cbc_ctrl1_invalidate_active_f(void)
112{
113 return 0x2U;
114}
115static inline u32 ltc_ltcs_ltss_cbc_ctrl1_clear_v(u32 r)
116{
117 return (r >> 2U) & 0x1U;
118}
119static inline u32 ltc_ltcs_ltss_cbc_ctrl1_clear_active_v(void)
120{
121 return 0x00000001U;
122}
123static inline u32 ltc_ltcs_ltss_cbc_ctrl1_clear_active_f(void)
124{
125 return 0x4U;
126}
127static inline u32 ltc_ltc0_lts0_cbc_ctrl1_r(void)
128{
129 return 0x001410c8U;
130}
131static inline u32 ltc_ltcs_ltss_cbc_ctrl2_r(void)
132{
133 return 0x0017e8ccU;
134}
135static inline u32 ltc_ltcs_ltss_cbc_ctrl2_clear_lower_bound_f(u32 v)
136{
137 return (v & 0x1ffffU) << 0U;
138}
139static inline u32 ltc_ltcs_ltss_cbc_ctrl3_r(void)
140{
141 return 0x0017e8d0U;
142}
143static inline u32 ltc_ltcs_ltss_cbc_ctrl3_clear_upper_bound_f(u32 v)
144{
145 return (v & 0x1ffffU) << 0U;
146}
147static inline u32 ltc_ltcs_ltss_cbc_ctrl3_clear_upper_bound_init_v(void)
148{
149 return 0x0001ffffU;
150}
151static inline u32 ltc_ltcs_ltss_cbc_base_r(void)
152{
153 return 0x0017e8d4U;
154}
155static inline u32 ltc_ltcs_ltss_cbc_base_alignment_shift_v(void)
156{
157 return 0x0000000bU;
158}
159static inline u32 ltc_ltcs_ltss_cbc_base_address_v(u32 r)
160{
161 return (r >> 0U) & 0x3ffffffU;
162}
163static inline u32 ltc_ltcs_ltss_cbc_param_r(void)
164{
165 return 0x0017e8dcU;
166}
167static inline u32 ltc_ltcs_ltss_cbc_param_comptags_per_cache_line_v(u32 r)
168{
169 return (r >> 0U) & 0xffffU;
170}
171static inline u32 ltc_ltcs_ltss_cbc_param_cache_line_size_v(u32 r)
172{
173 return (r >> 24U) & 0xfU;
174}
175static inline u32 ltc_ltcs_ltss_cbc_param_slices_per_fbp_v(u32 r)
176{
177 return (r >> 28U) & 0xfU;
178}
179static inline u32 ltc_ltcs_ltss_tstg_set_mgmt_r(void)
180{
181 return 0x0017e91cU;
182}
183static inline u32 ltc_ltcs_ltss_tstg_set_mgmt_max_ways_evict_last_f(u32 v)
184{
185 return (v & 0x1fU) << 16U;
186}
187static inline u32 ltc_ltcs_ltss_dstg_zbc_index_r(void)
188{
189 return 0x0017ea44U;
190}
191static inline u32 ltc_ltcs_ltss_dstg_zbc_index_address_f(u32 v)
192{
193 return (v & 0xfU) << 0U;
194}
195static inline u32 ltc_ltcs_ltss_dstg_zbc_color_clear_value_r(u32 i)
196{
197 return 0x0017ea48U + i*4U;
198}
199static inline u32 ltc_ltcs_ltss_dstg_zbc_color_clear_value__size_1_v(void)
200{
201 return 0x00000004U;
202}
203static inline u32 ltc_ltcs_ltss_dstg_zbc_depth_clear_value_r(void)
204{
205 return 0x0017ea58U;
206}
207static inline u32 ltc_ltcs_ltss_dstg_zbc_depth_clear_value_field_s(void)
208{
209 return 32U;
210}
211static inline u32 ltc_ltcs_ltss_dstg_zbc_depth_clear_value_field_f(u32 v)
212{
213 return (v & 0xffffffffU) << 0U;
214}
215static inline u32 ltc_ltcs_ltss_dstg_zbc_depth_clear_value_field_m(void)
216{
217 return 0xffffffffU << 0U;
218}
219static inline u32 ltc_ltcs_ltss_dstg_zbc_depth_clear_value_field_v(u32 r)
220{
221 return (r >> 0U) & 0xffffffffU;
222}
223static inline u32 ltc_ltcs_ltss_tstg_set_mgmt_2_r(void)
224{
225 return 0x0017e924U;
226}
227static inline u32 ltc_ltcs_ltss_tstg_set_mgmt_2_l2_bypass_mode_enabled_f(void)
228{
229 return 0x10000000U;
230}
231static inline u32 ltc_ltcs_ltss_g_elpg_r(void)
232{
233 return 0x0017e828U;
234}
235static inline u32 ltc_ltcs_ltss_g_elpg_flush_v(u32 r)
236{
237 return (r >> 0U) & 0x1U;
238}
239static inline u32 ltc_ltcs_ltss_g_elpg_flush_pending_v(void)
240{
241 return 0x00000001U;
242}
243static inline u32 ltc_ltcs_ltss_g_elpg_flush_pending_f(void)
244{
245 return 0x1U;
246}
247static inline u32 ltc_ltc0_ltss_g_elpg_r(void)
248{
249 return 0x00140828U;
250}
251static inline u32 ltc_ltc0_ltss_g_elpg_flush_v(u32 r)
252{
253 return (r >> 0U) & 0x1U;
254}
255static inline u32 ltc_ltc0_ltss_g_elpg_flush_pending_v(void)
256{
257 return 0x00000001U;
258}
259static inline u32 ltc_ltc0_ltss_g_elpg_flush_pending_f(void)
260{
261 return 0x1U;
262}
263static inline u32 ltc_ltc0_ltss_intr_r(void)
264{
265 return 0x00140820U;
266}
267static inline u32 ltc_ltcs_ltss_intr_r(void)
268{
269 return 0x0017e820U;
270}
271static inline u32 ltc_ltcs_ltss_intr_en_evicted_cb_m(void)
272{
273 return 0x1U << 20U;
274}
275static inline u32 ltc_ltcs_ltss_intr_en_illegal_compstat_m(void)
276{
277 return 0x1U << 21U;
278}
279static inline u32 ltc_ltc0_lts0_intr_r(void)
280{
281 return 0x00141020U;
282}
283static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_r(void)
284{
285 return 0x0017e910U;
286}
287static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_invalidate_v(u32 r)
288{
289 return (r >> 0U) & 0x1U;
290}
291static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_invalidate_pending_v(void)
292{
293 return 0x00000001U;
294}
295static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_invalidate_pending_f(void)
296{
297 return 0x1U;
298}
299static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_max_cycles_between_invalidates_v(u32 r)
300{
301 return (r >> 8U) & 0xfU;
302}
303static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_max_cycles_between_invalidates_3_v(void)
304{
305 return 0x00000003U;
306}
307static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_max_cycles_between_invalidates_3_f(void)
308{
309 return 0x300U;
310}
311static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_invalidate_evict_last_class_v(u32 r)
312{
313 return (r >> 28U) & 0x1U;
314}
315static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_invalidate_evict_last_class_true_v(void)
316{
317 return 0x00000001U;
318}
319static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_invalidate_evict_last_class_true_f(void)
320{
321 return 0x10000000U;
322}
323static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_invalidate_evict_normal_class_v(u32 r)
324{
325 return (r >> 29U) & 0x1U;
326}
327static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_invalidate_evict_normal_class_true_v(void)
328{
329 return 0x00000001U;
330}
331static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_invalidate_evict_normal_class_true_f(void)
332{
333 return 0x20000000U;
334}
335static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_invalidate_evict_first_class_v(u32 r)
336{
337 return (r >> 30U) & 0x1U;
338}
339static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_invalidate_evict_first_class_true_v(void)
340{
341 return 0x00000001U;
342}
343static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_invalidate_evict_first_class_true_f(void)
344{
345 return 0x40000000U;
346}
347static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_r(void)
348{
349 return 0x0017e914U;
350}
351static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_v(u32 r)
352{
353 return (r >> 0U) & 0x1U;
354}
355static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_pending_v(void)
356{
357 return 0x00000001U;
358}
359static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_pending_f(void)
360{
361 return 0x1U;
362}
363static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_max_cycles_between_cleans_v(u32 r)
364{
365 return (r >> 8U) & 0xfU;
366}
367static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_max_cycles_between_cleans_3_v(void)
368{
369 return 0x00000003U;
370}
371static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_max_cycles_between_cleans_3_f(void)
372{
373 return 0x300U;
374}
375static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_wait_for_fb_to_pull_v(u32 r)
376{
377 return (r >> 16U) & 0x1U;
378}
379static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_wait_for_fb_to_pull_true_v(void)
380{
381 return 0x00000001U;
382}
383static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_wait_for_fb_to_pull_true_f(void)
384{
385 return 0x10000U;
386}
387static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_evict_last_class_v(u32 r)
388{
389 return (r >> 28U) & 0x1U;
390}
391static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_evict_last_class_true_v(void)
392{
393 return 0x00000001U;
394}
395static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_evict_last_class_true_f(void)
396{
397 return 0x10000000U;
398}
399static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_evict_normal_class_v(u32 r)
400{
401 return (r >> 29U) & 0x1U;
402}
403static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_evict_normal_class_true_v(void)
404{
405 return 0x00000001U;
406}
407static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_evict_normal_class_true_f(void)
408{
409 return 0x20000000U;
410}
411static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_evict_first_class_v(u32 r)
412{
413 return (r >> 30U) & 0x1U;
414}
415static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_evict_first_class_true_v(void)
416{
417 return 0x00000001U;
418}
419static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_evict_first_class_true_f(void)
420{
421 return 0x40000000U;
422}
423static inline u32 ltc_ltc0_ltss_tstg_cmgmt0_r(void)
424{
425 return 0x00140910U;
426}
427static inline u32 ltc_ltc0_ltss_tstg_cmgmt0_invalidate_v(u32 r)
428{
429 return (r >> 0U) & 0x1U;
430}
431static inline u32 ltc_ltc0_ltss_tstg_cmgmt0_invalidate_pending_v(void)
432{
433 return 0x00000001U;
434}
435static inline u32 ltc_ltc0_ltss_tstg_cmgmt0_invalidate_pending_f(void)
436{
437 return 0x1U;
438}
439static inline u32 ltc_ltc0_ltss_tstg_cmgmt1_r(void)
440{
441 return 0x00140914U;
442}
443static inline u32 ltc_ltc0_ltss_tstg_cmgmt1_clean_v(u32 r)
444{
445 return (r >> 0U) & 0x1U;
446}
447static inline u32 ltc_ltc0_ltss_tstg_cmgmt1_clean_pending_v(void)
448{
449 return 0x00000001U;
450}
451static inline u32 ltc_ltc0_ltss_tstg_cmgmt1_clean_pending_f(void)
452{
453 return 0x1U;
454}
455#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_mc_gk20a.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_mc_gk20a.h
new file mode 100644
index 00000000..3ca2a290
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_mc_gk20a.h
@@ -0,0 +1,291 @@
1/*
2 * Copyright (c) 2012-2017, 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_mc_gk20a_h_
57#define _hw_mc_gk20a_h_
58
59static inline u32 mc_boot_0_r(void)
60{
61 return 0x00000000U;
62}
63static inline u32 mc_boot_0_architecture_v(u32 r)
64{
65 return (r >> 24U) & 0x1fU;
66}
67static inline u32 mc_boot_0_implementation_v(u32 r)
68{
69 return (r >> 20U) & 0xfU;
70}
71static inline u32 mc_boot_0_major_revision_v(u32 r)
72{
73 return (r >> 4U) & 0xfU;
74}
75static inline u32 mc_boot_0_minor_revision_v(u32 r)
76{
77 return (r >> 0U) & 0xfU;
78}
79static inline u32 mc_intr_0_r(void)
80{
81 return 0x00000100U;
82}
83static inline u32 mc_intr_0_pfifo_pending_f(void)
84{
85 return 0x100U;
86}
87static inline u32 mc_intr_0_pgraph_pending_f(void)
88{
89 return 0x1000U;
90}
91static inline u32 mc_intr_0_pmu_pending_f(void)
92{
93 return 0x1000000U;
94}
95static inline u32 mc_intr_0_ltc_pending_f(void)
96{
97 return 0x2000000U;
98}
99static inline u32 mc_intr_0_priv_ring_pending_f(void)
100{
101 return 0x40000000U;
102}
103static inline u32 mc_intr_0_pbus_pending_f(void)
104{
105 return 0x10000000U;
106}
107static inline u32 mc_intr_1_r(void)
108{
109 return 0x00000104U;
110}
111static inline u32 mc_intr_mask_0_r(void)
112{
113 return 0x00000640U;
114}
115static inline u32 mc_intr_mask_0_pmu_enabled_f(void)
116{
117 return 0x1000000U;
118}
119static inline u32 mc_intr_en_0_r(void)
120{
121 return 0x00000140U;
122}
123static inline u32 mc_intr_en_0_inta_disabled_f(void)
124{
125 return 0x0U;
126}
127static inline u32 mc_intr_en_0_inta_hardware_f(void)
128{
129 return 0x1U;
130}
131static inline u32 mc_intr_mask_1_r(void)
132{
133 return 0x00000644U;
134}
135static inline u32 mc_intr_mask_1_pmu_s(void)
136{
137 return 1U;
138}
139static inline u32 mc_intr_mask_1_pmu_f(u32 v)
140{
141 return (v & 0x1U) << 24U;
142}
143static inline u32 mc_intr_mask_1_pmu_m(void)
144{
145 return 0x1U << 24U;
146}
147static inline u32 mc_intr_mask_1_pmu_v(u32 r)
148{
149 return (r >> 24U) & 0x1U;
150}
151static inline u32 mc_intr_mask_1_pmu_enabled_f(void)
152{
153 return 0x1000000U;
154}
155static inline u32 mc_intr_en_1_r(void)
156{
157 return 0x00000144U;
158}
159static inline u32 mc_intr_en_1_inta_disabled_f(void)
160{
161 return 0x0U;
162}
163static inline u32 mc_intr_en_1_inta_hardware_f(void)
164{
165 return 0x1U;
166}
167static inline u32 mc_enable_r(void)
168{
169 return 0x00000200U;
170}
171static inline u32 mc_enable_xbar_enabled_f(void)
172{
173 return 0x4U;
174}
175static inline u32 mc_enable_l2_enabled_f(void)
176{
177 return 0x8U;
178}
179static inline u32 mc_enable_pmedia_s(void)
180{
181 return 1U;
182}
183static inline u32 mc_enable_pmedia_f(u32 v)
184{
185 return (v & 0x1U) << 4U;
186}
187static inline u32 mc_enable_pmedia_m(void)
188{
189 return 0x1U << 4U;
190}
191static inline u32 mc_enable_pmedia_v(u32 r)
192{
193 return (r >> 4U) & 0x1U;
194}
195static inline u32 mc_enable_priv_ring_enabled_f(void)
196{
197 return 0x20U;
198}
199static inline u32 mc_enable_ce0_m(void)
200{
201 return 0x1U << 6U;
202}
203static inline u32 mc_enable_pfifo_enabled_f(void)
204{
205 return 0x100U;
206}
207static inline u32 mc_enable_pgraph_enabled_f(void)
208{
209 return 0x1000U;
210}
211static inline u32 mc_enable_pwr_v(u32 r)
212{
213 return (r >> 13U) & 0x1U;
214}
215static inline u32 mc_enable_pwr_disabled_v(void)
216{
217 return 0x00000000U;
218}
219static inline u32 mc_enable_pwr_enabled_f(void)
220{
221 return 0x2000U;
222}
223static inline u32 mc_enable_pfb_enabled_f(void)
224{
225 return 0x100000U;
226}
227static inline u32 mc_enable_ce2_m(void)
228{
229 return 0x1U << 21U;
230}
231static inline u32 mc_enable_ce2_enabled_f(void)
232{
233 return 0x200000U;
234}
235static inline u32 mc_enable_blg_enabled_f(void)
236{
237 return 0x8000000U;
238}
239static inline u32 mc_enable_perfmon_enabled_f(void)
240{
241 return 0x10000000U;
242}
243static inline u32 mc_enable_hub_enabled_f(void)
244{
245 return 0x20000000U;
246}
247static inline u32 mc_enable_pb_r(void)
248{
249 return 0x00000204U;
250}
251static inline u32 mc_enable_pb_0_s(void)
252{
253 return 1U;
254}
255static inline u32 mc_enable_pb_0_f(u32 v)
256{
257 return (v & 0x1U) << 0U;
258}
259static inline u32 mc_enable_pb_0_m(void)
260{
261 return 0x1U << 0U;
262}
263static inline u32 mc_enable_pb_0_v(u32 r)
264{
265 return (r >> 0U) & 0x1U;
266}
267static inline u32 mc_enable_pb_0_enabled_v(void)
268{
269 return 0x00000001U;
270}
271static inline u32 mc_enable_pb_sel_f(u32 v, u32 i)
272{
273 return (v & 0x1U) << (0U + i*1U);
274}
275static inline u32 mc_elpg_enable_r(void)
276{
277 return 0x0000020cU;
278}
279static inline u32 mc_elpg_enable_xbar_enabled_f(void)
280{
281 return 0x4U;
282}
283static inline u32 mc_elpg_enable_pfb_enabled_f(void)
284{
285 return 0x100000U;
286}
287static inline u32 mc_elpg_enable_hub_enabled_f(void)
288{
289 return 0x20000000U;
290}
291#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_pbdma_gk20a.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_pbdma_gk20a.h
new file mode 100644
index 00000000..338edef2
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_pbdma_gk20a.h
@@ -0,0 +1,567 @@
1/*
2 * Copyright (c) 2012-2017, 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_pbdma_gk20a_h_
57#define _hw_pbdma_gk20a_h_
58
59static inline u32 pbdma_gp_entry1_r(void)
60{
61 return 0x10000004U;
62}
63static inline u32 pbdma_gp_entry1_get_hi_v(u32 r)
64{
65 return (r >> 0U) & 0xffU;
66}
67static inline u32 pbdma_gp_entry1_length_f(u32 v)
68{
69 return (v & 0x1fffffU) << 10U;
70}
71static inline u32 pbdma_gp_entry1_length_v(u32 r)
72{
73 return (r >> 10U) & 0x1fffffU;
74}
75static inline u32 pbdma_gp_base_r(u32 i)
76{
77 return 0x00040048U + i*8192U;
78}
79static inline u32 pbdma_gp_base__size_1_v(void)
80{
81 return 0x00000001U;
82}
83static inline u32 pbdma_gp_base_offset_f(u32 v)
84{
85 return (v & 0x1fffffffU) << 3U;
86}
87static inline u32 pbdma_gp_base_rsvd_s(void)
88{
89 return 3U;
90}
91static inline u32 pbdma_gp_base_hi_r(u32 i)
92{
93 return 0x0004004cU + i*8192U;
94}
95static inline u32 pbdma_gp_base_hi_offset_f(u32 v)
96{
97 return (v & 0xffU) << 0U;
98}
99static inline u32 pbdma_gp_base_hi_limit2_f(u32 v)
100{
101 return (v & 0x1fU) << 16U;
102}
103static inline u32 pbdma_gp_fetch_r(u32 i)
104{
105 return 0x00040050U + i*8192U;
106}
107static inline u32 pbdma_gp_get_r(u32 i)
108{
109 return 0x00040014U + i*8192U;
110}
111static inline u32 pbdma_gp_put_r(u32 i)
112{
113 return 0x00040000U + i*8192U;
114}
115static inline u32 pbdma_timeout_r(u32 i)
116{
117 return 0x0004012cU + i*8192U;
118}
119static inline u32 pbdma_timeout__size_1_v(void)
120{
121 return 0x00000001U;
122}
123static inline u32 pbdma_timeout_period_m(void)
124{
125 return 0xffffffffU << 0U;
126}
127static inline u32 pbdma_timeout_period_max_f(void)
128{
129 return 0xffffffffU;
130}
131static inline u32 pbdma_pb_fetch_r(u32 i)
132{
133 return 0x00040054U + i*8192U;
134}
135static inline u32 pbdma_pb_fetch_hi_r(u32 i)
136{
137 return 0x00040058U + i*8192U;
138}
139static inline u32 pbdma_get_r(u32 i)
140{
141 return 0x00040018U + i*8192U;
142}
143static inline u32 pbdma_get_hi_r(u32 i)
144{
145 return 0x0004001cU + i*8192U;
146}
147static inline u32 pbdma_put_r(u32 i)
148{
149 return 0x0004005cU + i*8192U;
150}
151static inline u32 pbdma_put_hi_r(u32 i)
152{
153 return 0x00040060U + i*8192U;
154}
155static inline u32 pbdma_formats_r(u32 i)
156{
157 return 0x0004009cU + i*8192U;
158}
159static inline u32 pbdma_formats_gp_fermi0_f(void)
160{
161 return 0x0U;
162}
163static inline u32 pbdma_formats_pb_fermi1_f(void)
164{
165 return 0x100U;
166}
167static inline u32 pbdma_formats_mp_fermi0_f(void)
168{
169 return 0x0U;
170}
171static inline u32 pbdma_pb_header_r(u32 i)
172{
173 return 0x00040084U + i*8192U;
174}
175static inline u32 pbdma_pb_header_priv_user_f(void)
176{
177 return 0x0U;
178}
179static inline u32 pbdma_pb_header_method_zero_f(void)
180{
181 return 0x0U;
182}
183static inline u32 pbdma_pb_header_subchannel_zero_f(void)
184{
185 return 0x0U;
186}
187static inline u32 pbdma_pb_header_level_main_f(void)
188{
189 return 0x0U;
190}
191static inline u32 pbdma_pb_header_first_true_f(void)
192{
193 return 0x400000U;
194}
195static inline u32 pbdma_pb_header_type_inc_f(void)
196{
197 return 0x20000000U;
198}
199static inline u32 pbdma_pb_header_type_non_inc_f(void)
200{
201 return 0x60000000U;
202}
203static inline u32 pbdma_hdr_shadow_r(u32 i)
204{
205 return 0x00040118U + i*8192U;
206}
207static inline u32 pbdma_gp_shadow_0_r(u32 i)
208{
209 return 0x00040110U + i*8192U;
210}
211static inline u32 pbdma_gp_shadow_1_r(u32 i)
212{
213 return 0x00040114U + i*8192U;
214}
215static inline u32 pbdma_subdevice_r(u32 i)
216{
217 return 0x00040094U + i*8192U;
218}
219static inline u32 pbdma_subdevice_id_f(u32 v)
220{
221 return (v & 0xfffU) << 0U;
222}
223static inline u32 pbdma_subdevice_status_active_f(void)
224{
225 return 0x10000000U;
226}
227static inline u32 pbdma_subdevice_channel_dma_enable_f(void)
228{
229 return 0x20000000U;
230}
231static inline u32 pbdma_method0_r(u32 i)
232{
233 return 0x000400c0U + i*8192U;
234}
235static inline u32 pbdma_method0_addr_f(u32 v)
236{
237 return (v & 0xfffU) << 2U;
238}
239static inline u32 pbdma_method0_addr_v(u32 r)
240{
241 return (r >> 2U) & 0xfffU;
242}
243static inline u32 pbdma_method0_subch_v(u32 r)
244{
245 return (r >> 16U) & 0x7U;
246}
247static inline u32 pbdma_method0_first_true_f(void)
248{
249 return 0x400000U;
250}
251static inline u32 pbdma_method0_valid_true_f(void)
252{
253 return 0x80000000U;
254}
255static inline u32 pbdma_method1_r(u32 i)
256{
257 return 0x000400c8U + i*8192U;
258}
259static inline u32 pbdma_method2_r(u32 i)
260{
261 return 0x000400d0U + i*8192U;
262}
263static inline u32 pbdma_method3_r(u32 i)
264{
265 return 0x000400d8U + i*8192U;
266}
267static inline u32 pbdma_data0_r(u32 i)
268{
269 return 0x000400c4U + i*8192U;
270}
271static inline u32 pbdma_target_r(u32 i)
272{
273 return 0x000400acU + i*8192U;
274}
275static inline u32 pbdma_target_engine_sw_f(void)
276{
277 return 0x1fU;
278}
279static inline u32 pbdma_acquire_r(u32 i)
280{
281 return 0x00040030U + i*8192U;
282}
283static inline u32 pbdma_acquire_retry_man_2_f(void)
284{
285 return 0x2U;
286}
287static inline u32 pbdma_acquire_retry_exp_2_f(void)
288{
289 return 0x100U;
290}
291static inline u32 pbdma_acquire_timeout_exp_f(u32 v)
292{
293 return (v & 0xfU) << 11U;
294}
295static inline u32 pbdma_acquire_timeout_exp_max_v(void)
296{
297 return 0x0000000fU;
298}
299static inline u32 pbdma_acquire_timeout_exp_max_f(void)
300{
301 return 0x7800U;
302}
303static inline u32 pbdma_acquire_timeout_man_f(u32 v)
304{
305 return (v & 0xffffU) << 15U;
306}
307static inline u32 pbdma_acquire_timeout_man_max_v(void)
308{
309 return 0x0000ffffU;
310}
311static inline u32 pbdma_acquire_timeout_man_max_f(void)
312{
313 return 0x7fff8000U;
314}
315static inline u32 pbdma_acquire_timeout_en_enable_f(void)
316{
317 return 0x80000000U;
318}
319static inline u32 pbdma_acquire_timeout_en_disable_f(void)
320{
321 return 0x0U;
322}
323static inline u32 pbdma_status_r(u32 i)
324{
325 return 0x00040100U + i*8192U;
326}
327static inline u32 pbdma_channel_r(u32 i)
328{
329 return 0x00040120U + i*8192U;
330}
331static inline u32 pbdma_signature_r(u32 i)
332{
333 return 0x00040010U + i*8192U;
334}
335static inline u32 pbdma_signature_hw_valid_f(void)
336{
337 return 0xfaceU;
338}
339static inline u32 pbdma_signature_sw_zero_f(void)
340{
341 return 0x0U;
342}
343static inline u32 pbdma_userd_r(u32 i)
344{
345 return 0x00040008U + i*8192U;
346}
347static inline u32 pbdma_userd_target_vid_mem_f(void)
348{
349 return 0x0U;
350}
351static inline u32 pbdma_userd_target_sys_mem_coh_f(void)
352{
353 return 0x2U;
354}
355static inline u32 pbdma_userd_target_sys_mem_ncoh_f(void)
356{
357 return 0x3U;
358}
359static inline u32 pbdma_userd_addr_f(u32 v)
360{
361 return (v & 0x7fffffU) << 9U;
362}
363static inline u32 pbdma_userd_hi_r(u32 i)
364{
365 return 0x0004000cU + i*8192U;
366}
367static inline u32 pbdma_userd_hi_addr_f(u32 v)
368{
369 return (v & 0xffU) << 0U;
370}
371static inline u32 pbdma_hce_ctrl_r(u32 i)
372{
373 return 0x000400e4U + i*8192U;
374}
375static inline u32 pbdma_hce_ctrl_hce_priv_mode_yes_f(void)
376{
377 return 0x20U;
378}
379static inline u32 pbdma_intr_0_r(u32 i)
380{
381 return 0x00040108U + i*8192U;
382}
383static inline u32 pbdma_intr_0_memreq_v(u32 r)
384{
385 return (r >> 0U) & 0x1U;
386}
387static inline u32 pbdma_intr_0_memreq_pending_f(void)
388{
389 return 0x1U;
390}
391static inline u32 pbdma_intr_0_memack_timeout_pending_f(void)
392{
393 return 0x2U;
394}
395static inline u32 pbdma_intr_0_memack_extra_pending_f(void)
396{
397 return 0x4U;
398}
399static inline u32 pbdma_intr_0_memdat_timeout_pending_f(void)
400{
401 return 0x8U;
402}
403static inline u32 pbdma_intr_0_memdat_extra_pending_f(void)
404{
405 return 0x10U;
406}
407static inline u32 pbdma_intr_0_memflush_pending_f(void)
408{
409 return 0x20U;
410}
411static inline u32 pbdma_intr_0_memop_pending_f(void)
412{
413 return 0x40U;
414}
415static inline u32 pbdma_intr_0_lbconnect_pending_f(void)
416{
417 return 0x80U;
418}
419static inline u32 pbdma_intr_0_lbreq_pending_f(void)
420{
421 return 0x100U;
422}
423static inline u32 pbdma_intr_0_lback_timeout_pending_f(void)
424{
425 return 0x200U;
426}
427static inline u32 pbdma_intr_0_lback_extra_pending_f(void)
428{
429 return 0x400U;
430}
431static inline u32 pbdma_intr_0_lbdat_timeout_pending_f(void)
432{
433 return 0x800U;
434}
435static inline u32 pbdma_intr_0_lbdat_extra_pending_f(void)
436{
437 return 0x1000U;
438}
439static inline u32 pbdma_intr_0_gpfifo_pending_f(void)
440{
441 return 0x2000U;
442}
443static inline u32 pbdma_intr_0_gpptr_pending_f(void)
444{
445 return 0x4000U;
446}
447static inline u32 pbdma_intr_0_gpentry_pending_f(void)
448{
449 return 0x8000U;
450}
451static inline u32 pbdma_intr_0_gpcrc_pending_f(void)
452{
453 return 0x10000U;
454}
455static inline u32 pbdma_intr_0_pbptr_pending_f(void)
456{
457 return 0x20000U;
458}
459static inline u32 pbdma_intr_0_pbentry_pending_f(void)
460{
461 return 0x40000U;
462}
463static inline u32 pbdma_intr_0_pbcrc_pending_f(void)
464{
465 return 0x80000U;
466}
467static inline u32 pbdma_intr_0_xbarconnect_pending_f(void)
468{
469 return 0x100000U;
470}
471static inline u32 pbdma_intr_0_method_pending_f(void)
472{
473 return 0x200000U;
474}
475static inline u32 pbdma_intr_0_methodcrc_pending_f(void)
476{
477 return 0x400000U;
478}
479static inline u32 pbdma_intr_0_device_pending_f(void)
480{
481 return 0x800000U;
482}
483static inline u32 pbdma_intr_0_semaphore_pending_f(void)
484{
485 return 0x2000000U;
486}
487static inline u32 pbdma_intr_0_acquire_pending_f(void)
488{
489 return 0x4000000U;
490}
491static inline u32 pbdma_intr_0_pri_pending_f(void)
492{
493 return 0x8000000U;
494}
495static inline u32 pbdma_intr_0_no_ctxsw_seg_pending_f(void)
496{
497 return 0x20000000U;
498}
499static inline u32 pbdma_intr_0_pbseg_pending_f(void)
500{
501 return 0x40000000U;
502}
503static inline u32 pbdma_intr_0_signature_pending_f(void)
504{
505 return 0x80000000U;
506}
507static inline u32 pbdma_intr_1_r(u32 i)
508{
509 return 0x00040148U + i*8192U;
510}
511static inline u32 pbdma_intr_en_0_r(u32 i)
512{
513 return 0x0004010cU + i*8192U;
514}
515static inline u32 pbdma_intr_en_0_lbreq_enabled_f(void)
516{
517 return 0x100U;
518}
519static inline u32 pbdma_intr_en_1_r(u32 i)
520{
521 return 0x0004014cU + i*8192U;
522}
523static inline u32 pbdma_intr_stall_r(u32 i)
524{
525 return 0x0004013cU + i*8192U;
526}
527static inline u32 pbdma_intr_stall_lbreq_enabled_f(void)
528{
529 return 0x100U;
530}
531static inline u32 pbdma_udma_nop_r(void)
532{
533 return 0x00000008U;
534}
535static inline u32 pbdma_syncpointa_r(u32 i)
536{
537 return 0x000400a4U + i*8192U;
538}
539static inline u32 pbdma_syncpointa_payload_v(u32 r)
540{
541 return (r >> 0U) & 0xffffffffU;
542}
543static inline u32 pbdma_syncpointb_r(u32 i)
544{
545 return 0x000400a8U + i*8192U;
546}
547static inline u32 pbdma_syncpointb_op_v(u32 r)
548{
549 return (r >> 0U) & 0x3U;
550}
551static inline u32 pbdma_syncpointb_op_wait_v(void)
552{
553 return 0x00000000U;
554}
555static inline u32 pbdma_syncpointb_wait_switch_v(u32 r)
556{
557 return (r >> 4U) & 0x1U;
558}
559static inline u32 pbdma_syncpointb_wait_switch_en_v(void)
560{
561 return 0x00000001U;
562}
563static inline u32 pbdma_syncpointb_syncpt_index_v(u32 r)
564{
565 return (r >> 8U) & 0xffU;
566}
567#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_perf_gk20a.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_perf_gk20a.h
new file mode 100644
index 00000000..a93560fb
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_perf_gk20a.h
@@ -0,0 +1,211 @@
1/*
2 * Copyright (c) 2015-2017, 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_perf_gk20a_h_
57#define _hw_perf_gk20a_h_
58
59static inline u32 perf_pmasys_control_r(void)
60{
61 return 0x001b4000U;
62}
63static inline u32 perf_pmasys_control_membuf_status_v(u32 r)
64{
65 return (r >> 4U) & 0x1U;
66}
67static inline u32 perf_pmasys_control_membuf_status_overflowed_v(void)
68{
69 return 0x00000001U;
70}
71static inline u32 perf_pmasys_control_membuf_status_overflowed_f(void)
72{
73 return 0x10U;
74}
75static inline u32 perf_pmasys_control_membuf_clear_status_f(u32 v)
76{
77 return (v & 0x1U) << 5U;
78}
79static inline u32 perf_pmasys_control_membuf_clear_status_v(u32 r)
80{
81 return (r >> 5U) & 0x1U;
82}
83static inline u32 perf_pmasys_control_membuf_clear_status_doit_v(void)
84{
85 return 0x00000001U;
86}
87static inline u32 perf_pmasys_control_membuf_clear_status_doit_f(void)
88{
89 return 0x20U;
90}
91static inline u32 perf_pmasys_mem_block_r(void)
92{
93 return 0x001b4070U;
94}
95static inline u32 perf_pmasys_mem_block_base_f(u32 v)
96{
97 return (v & 0xfffffffU) << 0U;
98}
99static inline u32 perf_pmasys_mem_block_target_f(u32 v)
100{
101 return (v & 0x3U) << 28U;
102}
103static inline u32 perf_pmasys_mem_block_target_v(u32 r)
104{
105 return (r >> 28U) & 0x3U;
106}
107static inline u32 perf_pmasys_mem_block_target_lfb_v(void)
108{
109 return 0x00000000U;
110}
111static inline u32 perf_pmasys_mem_block_target_lfb_f(void)
112{
113 return 0x0U;
114}
115static inline u32 perf_pmasys_mem_block_target_sys_coh_v(void)
116{
117 return 0x00000002U;
118}
119static inline u32 perf_pmasys_mem_block_target_sys_coh_f(void)
120{
121 return 0x20000000U;
122}
123static inline u32 perf_pmasys_mem_block_target_sys_ncoh_v(void)
124{
125 return 0x00000003U;
126}
127static inline u32 perf_pmasys_mem_block_target_sys_ncoh_f(void)
128{
129 return 0x30000000U;
130}
131static inline u32 perf_pmasys_mem_block_valid_f(u32 v)
132{
133 return (v & 0x1U) << 31U;
134}
135static inline u32 perf_pmasys_mem_block_valid_v(u32 r)
136{
137 return (r >> 31U) & 0x1U;
138}
139static inline u32 perf_pmasys_mem_block_valid_true_v(void)
140{
141 return 0x00000001U;
142}
143static inline u32 perf_pmasys_mem_block_valid_true_f(void)
144{
145 return 0x80000000U;
146}
147static inline u32 perf_pmasys_mem_block_valid_false_v(void)
148{
149 return 0x00000000U;
150}
151static inline u32 perf_pmasys_mem_block_valid_false_f(void)
152{
153 return 0x0U;
154}
155static inline u32 perf_pmasys_outbase_r(void)
156{
157 return 0x001b4074U;
158}
159static inline u32 perf_pmasys_outbase_ptr_f(u32 v)
160{
161 return (v & 0x7ffffffU) << 5U;
162}
163static inline u32 perf_pmasys_outbaseupper_r(void)
164{
165 return 0x001b4078U;
166}
167static inline u32 perf_pmasys_outbaseupper_ptr_f(u32 v)
168{
169 return (v & 0xffU) << 0U;
170}
171static inline u32 perf_pmasys_outsize_r(void)
172{
173 return 0x001b407cU;
174}
175static inline u32 perf_pmasys_outsize_numbytes_f(u32 v)
176{
177 return (v & 0x7ffffffU) << 5U;
178}
179static inline u32 perf_pmasys_mem_bytes_r(void)
180{
181 return 0x001b4084U;
182}
183static inline u32 perf_pmasys_mem_bytes_numbytes_f(u32 v)
184{
185 return (v & 0xfffffffU) << 4U;
186}
187static inline u32 perf_pmasys_mem_bump_r(void)
188{
189 return 0x001b4088U;
190}
191static inline u32 perf_pmasys_mem_bump_numbytes_f(u32 v)
192{
193 return (v & 0xfffffffU) << 4U;
194}
195static inline u32 perf_pmasys_enginestatus_r(void)
196{
197 return 0x001b40a4U;
198}
199static inline u32 perf_pmasys_enginestatus_rbufempty_f(u32 v)
200{
201 return (v & 0x1U) << 4U;
202}
203static inline u32 perf_pmasys_enginestatus_rbufempty_empty_v(void)
204{
205 return 0x00000001U;
206}
207static inline u32 perf_pmasys_enginestatus_rbufempty_empty_f(void)
208{
209 return 0x10U;
210}
211#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_pram_gk20a.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_pram_gk20a.h
new file mode 100644
index 00000000..10923e2b
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_pram_gk20a.h
@@ -0,0 +1,63 @@
1/*
2 * Copyright (c) 2016-2017, 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_pram_gk20a_h_
57#define _hw_pram_gk20a_h_
58
59static inline u32 pram_data032_r(u32 i)
60{
61 return 0x00700000U + i*4U;
62}
63#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_pri_ringmaster_gk20a.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_pri_ringmaster_gk20a.h
new file mode 100644
index 00000000..ca2775eb
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_pri_ringmaster_gk20a.h
@@ -0,0 +1,159 @@
1/*
2 * Copyright (c) 2012-2017, 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_pri_ringmaster_gk20a_h_
57#define _hw_pri_ringmaster_gk20a_h_
58
59static inline u32 pri_ringmaster_command_r(void)
60{
61 return 0x0012004cU;
62}
63static inline u32 pri_ringmaster_command_cmd_m(void)
64{
65 return 0x3fU << 0U;
66}
67static inline u32 pri_ringmaster_command_cmd_v(u32 r)
68{
69 return (r >> 0U) & 0x3fU;
70}
71static inline u32 pri_ringmaster_command_cmd_no_cmd_v(void)
72{
73 return 0x00000000U;
74}
75static inline u32 pri_ringmaster_command_cmd_start_ring_f(void)
76{
77 return 0x1U;
78}
79static inline u32 pri_ringmaster_command_cmd_ack_interrupt_f(void)
80{
81 return 0x2U;
82}
83static inline u32 pri_ringmaster_command_cmd_enumerate_stations_f(void)
84{
85 return 0x3U;
86}
87static inline u32 pri_ringmaster_command_cmd_enumerate_stations_bc_grp_all_f(void)
88{
89 return 0x0U;
90}
91static inline u32 pri_ringmaster_command_data_r(void)
92{
93 return 0x00120048U;
94}
95static inline u32 pri_ringmaster_start_results_r(void)
96{
97 return 0x00120050U;
98}
99static inline u32 pri_ringmaster_start_results_connectivity_v(u32 r)
100{
101 return (r >> 0U) & 0x1U;
102}
103static inline u32 pri_ringmaster_start_results_connectivity_pass_v(void)
104{
105 return 0x00000001U;
106}
107static inline u32 pri_ringmaster_intr_status0_r(void)
108{
109 return 0x00120058U;
110}
111static inline u32 pri_ringmaster_intr_status0_ring_start_conn_fault_v(u32 r)
112{
113 return (r >> 0U) & 0x1U;
114}
115static inline u32 pri_ringmaster_intr_status0_disconnect_fault_v(u32 r)
116{
117 return (r >> 1U) & 0x1U;
118}
119static inline u32 pri_ringmaster_intr_status0_overflow_fault_v(u32 r)
120{
121 return (r >> 2U) & 0x1U;
122}
123static inline u32 pri_ringmaster_intr_status0_gbl_write_error_sys_v(u32 r)
124{
125 return (r >> 8U) & 0x1U;
126}
127static inline u32 pri_ringmaster_intr_status1_r(void)
128{
129 return 0x0012005cU;
130}
131static inline u32 pri_ringmaster_global_ctl_r(void)
132{
133 return 0x00120060U;
134}
135static inline u32 pri_ringmaster_global_ctl_ring_reset_asserted_f(void)
136{
137 return 0x1U;
138}
139static inline u32 pri_ringmaster_global_ctl_ring_reset_deasserted_f(void)
140{
141 return 0x0U;
142}
143static inline u32 pri_ringmaster_enum_fbp_r(void)
144{
145 return 0x00120074U;
146}
147static inline u32 pri_ringmaster_enum_fbp_count_v(u32 r)
148{
149 return (r >> 0U) & 0x1fU;
150}
151static inline u32 pri_ringmaster_enum_gpc_r(void)
152{
153 return 0x00120078U;
154}
155static inline u32 pri_ringmaster_enum_gpc_count_v(u32 r)
156{
157 return (r >> 0U) & 0x1fU;
158}
159#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_pri_ringstation_fbp_gk20a.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_pri_ringstation_fbp_gk20a.h
new file mode 100644
index 00000000..06e08bd5
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_pri_ringstation_fbp_gk20a.h
@@ -0,0 +1,231 @@
1/*
2 * drivers/video/tegra/host/gk20a/hw_pri_ringstation_fbp_gk20a.h
3 *
4 * Copyright (c) 2012-2013, 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 /*
26 * Function naming determines intended use:
27 *
28 * <x>_r(void) : Returns the offset for register <x>.
29 *
30 * <x>_w(void) : Returns the word offset for word (4 byte) element <x>.
31 *
32 * <x>_<y>_s(void) : Returns size of field <y> of register <x> in bits.
33 *
34 * <x>_<y>_f(u32 v) : Returns a value based on 'v' which has been shifted
35 * and masked to place it at field <y> of register <x>. This value
36 * can be |'d with others to produce a full register value for
37 * register <x>.
38 *
39 * <x>_<y>_m(void) : Returns a mask for field <y> of register <x>. This
40 * value can be ~'d and then &'d to clear the value of field <y> for
41 * register <x>.
42 *
43 * <x>_<y>_<z>_f(void) : Returns the constant value <z> after being shifted
44 * to place it at field <y> of register <x>. This value can be |'d
45 * with others to produce a full register value for <x>.
46 *
47 * <x>_<y>_v(u32 r) : Returns the value of field <y> from a full register
48 * <x> value 'r' after being shifted to place its LSB at bit 0.
49 * This value is suitable for direct comparison with other unshifted
50 * values appropriate for use in field <y> of register <x>.
51 *
52 * <x>_<y>_<z>_v(void) : Returns the constant value for <z> defined for
53 * field <y> of register <x>. This value is suitable for direct
54 * comparison with unshifted values appropriate for use in field <y>
55 * of register <x>.
56 */
57
58#ifndef __hw_pri_ringstation_fbp_gk20a_h__
59#define __hw_pri_ringstation_fbp_gk20a_h__
60/*This file is autogenerated. Do not edit. */
61
62static inline u32 pri_ringstation_fbp_master_config_r(u32 i)
63{
64 return 0x00124300+((i)*4);
65}
66static inline u32 pri_ringstation_fbp_master_config__size_1_v(void)
67{
68 return 64;
69}
70static inline u32 pri_ringstation_fbp_master_config_timeout_s(void)
71{
72 return 18;
73}
74static inline u32 pri_ringstation_fbp_master_config_timeout_f(u32 v)
75{
76 return (v & 0x3ffff) << 0;
77}
78static inline u32 pri_ringstation_fbp_master_config_timeout_m(void)
79{
80 return 0x3ffff << 0;
81}
82static inline u32 pri_ringstation_fbp_master_config_timeout_v(u32 r)
83{
84 return (r >> 0) & 0x3ffff;
85}
86static inline u32 pri_ringstation_fbp_master_config_timeout_i_v(void)
87{
88 return 0x00000064;
89}
90static inline u32 pri_ringstation_fbp_master_config_timeout_i_f(void)
91{
92 return 0x64;
93}
94static inline u32 pri_ringstation_fbp_master_config_fs_action_s(void)
95{
96 return 1;
97}
98static inline u32 pri_ringstation_fbp_master_config_fs_action_f(u32 v)
99{
100 return (v & 0x1) << 30;
101}
102static inline u32 pri_ringstation_fbp_master_config_fs_action_m(void)
103{
104 return 0x1 << 30;
105}
106static inline u32 pri_ringstation_fbp_master_config_fs_action_v(u32 r)
107{
108 return (r >> 30) & 0x1;
109}
110static inline u32 pri_ringstation_fbp_master_config_fs_action_error_v(void)
111{
112 return 0x00000000;
113}
114static inline u32 pri_ringstation_fbp_master_config_fs_action_error_f(void)
115{
116 return 0x0;
117}
118static inline u32 pri_ringstation_fbp_master_config_fs_action_soldier_on_v(void)
119{
120 return 0x00000001;
121}
122static inline u32 pri_ringstation_fbp_master_config_fs_action_soldier_on_f(void)
123{
124 return 0x40000000;
125}
126static inline u32 pri_ringstation_fbp_master_config_reset_action_s(void)
127{
128 return 1;
129}
130static inline u32 pri_ringstation_fbp_master_config_reset_action_f(u32 v)
131{
132 return (v & 0x1) << 31;
133}
134static inline u32 pri_ringstation_fbp_master_config_reset_action_m(void)
135{
136 return 0x1 << 31;
137}
138static inline u32 pri_ringstation_fbp_master_config_reset_action_v(u32 r)
139{
140 return (r >> 31) & 0x1;
141}
142static inline u32 pri_ringstation_fbp_master_config_reset_action_error_v(void)
143{
144 return 0x00000000;
145}
146static inline u32 pri_ringstation_fbp_master_config_reset_action_error_f(void)
147{
148 return 0x0;
149}
150static inline u32 pri_ringstation_fbp_master_config_reset_action_soldier_on_v(void)
151{
152 return 0x00000001;
153}
154static inline u32 pri_ringstation_fbp_master_config_reset_action_soldier_on_f(void)
155{
156 return 0x80000000;
157}
158static inline u32 pri_ringstation_fbp_master_config_setup_clocks_s(void)
159{
160 return 3;
161}
162static inline u32 pri_ringstation_fbp_master_config_setup_clocks_f(u32 v)
163{
164 return (v & 0x7) << 20;
165}
166static inline u32 pri_ringstation_fbp_master_config_setup_clocks_m(void)
167{
168 return 0x7 << 20;
169}
170static inline u32 pri_ringstation_fbp_master_config_setup_clocks_v(u32 r)
171{
172 return (r >> 20) & 0x7;
173}
174static inline u32 pri_ringstation_fbp_master_config_setup_clocks_i_v(void)
175{
176 return 0x00000000;
177}
178static inline u32 pri_ringstation_fbp_master_config_setup_clocks_i_f(void)
179{
180 return 0x0;
181}
182static inline u32 pri_ringstation_fbp_master_config_wait_clocks_s(void)
183{
184 return 3;
185}
186static inline u32 pri_ringstation_fbp_master_config_wait_clocks_f(u32 v)
187{
188 return (v & 0x7) << 24;
189}
190static inline u32 pri_ringstation_fbp_master_config_wait_clocks_m(void)
191{
192 return 0x7 << 24;
193}
194static inline u32 pri_ringstation_fbp_master_config_wait_clocks_v(u32 r)
195{
196 return (r >> 24) & 0x7;
197}
198static inline u32 pri_ringstation_fbp_master_config_wait_clocks_i_v(void)
199{
200 return 0x00000000;
201}
202static inline u32 pri_ringstation_fbp_master_config_wait_clocks_i_f(void)
203{
204 return 0x0;
205}
206static inline u32 pri_ringstation_fbp_master_config_hold_clocks_s(void)
207{
208 return 3;
209}
210static inline u32 pri_ringstation_fbp_master_config_hold_clocks_f(u32 v)
211{
212 return (v & 0x7) << 27;
213}
214static inline u32 pri_ringstation_fbp_master_config_hold_clocks_m(void)
215{
216 return 0x7 << 27;
217}
218static inline u32 pri_ringstation_fbp_master_config_hold_clocks_v(u32 r)
219{
220 return (r >> 27) & 0x7;
221}
222static inline u32 pri_ringstation_fbp_master_config_hold_clocks_i_v(void)
223{
224 return 0x00000000;
225}
226static inline u32 pri_ringstation_fbp_master_config_hold_clocks_i_f(void)
227{
228 return 0x0;
229}
230
231#endif /* __hw_pri_ringstation_fbp_gk20a_h__ */
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_pri_ringstation_gpc_gk20a.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_pri_ringstation_gpc_gk20a.h
new file mode 100644
index 00000000..6b57429e
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_pri_ringstation_gpc_gk20a.h
@@ -0,0 +1,79 @@
1/*
2 * Copyright (c) 2012-2017, 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_pri_ringstation_gpc_gk20a_h_
57#define _hw_pri_ringstation_gpc_gk20a_h_
58
59static inline u32 pri_ringstation_gpc_master_config_r(u32 i)
60{
61 return 0x00128300U + i*4U;
62}
63static inline u32 pri_ringstation_gpc_gpc0_priv_error_adr_r(void)
64{
65 return 0x00128120U;
66}
67static inline u32 pri_ringstation_gpc_gpc0_priv_error_wrdat_r(void)
68{
69 return 0x00128124U;
70}
71static inline u32 pri_ringstation_gpc_gpc0_priv_error_info_r(void)
72{
73 return 0x00128128U;
74}
75static inline u32 pri_ringstation_gpc_gpc0_priv_error_code_r(void)
76{
77 return 0x0012812cU;
78}
79#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_pri_ringstation_sys_gk20a.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_pri_ringstation_sys_gk20a.h
new file mode 100644
index 00000000..e4d5c3ba
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_pri_ringstation_sys_gk20a.h
@@ -0,0 +1,91 @@
1/*
2 * Copyright (c) 2012-2017, 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_pri_ringstation_sys_gk20a_h_
57#define _hw_pri_ringstation_sys_gk20a_h_
58
59static inline u32 pri_ringstation_sys_master_config_r(u32 i)
60{
61 return 0x00122300U + i*4U;
62}
63static inline u32 pri_ringstation_sys_decode_config_r(void)
64{
65 return 0x00122204U;
66}
67static inline u32 pri_ringstation_sys_decode_config_ring_m(void)
68{
69 return 0x7U << 0U;
70}
71static inline u32 pri_ringstation_sys_decode_config_ring_drop_on_ring_not_started_f(void)
72{
73 return 0x1U;
74}
75static inline u32 pri_ringstation_sys_priv_error_adr_r(void)
76{
77 return 0x00122120U;
78}
79static inline u32 pri_ringstation_sys_priv_error_wrdat_r(void)
80{
81 return 0x00122124U;
82}
83static inline u32 pri_ringstation_sys_priv_error_info_r(void)
84{
85 return 0x00122128U;
86}
87static inline u32 pri_ringstation_sys_priv_error_code_r(void)
88{
89 return 0x0012212cU;
90}
91#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_proj_gk20a.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_proj_gk20a.h
new file mode 100644
index 00000000..5ef03f5a
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_proj_gk20a.h
@@ -0,0 +1,163 @@
1/*
2 * Copyright (c) 2012-2017, 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_proj_gk20a_h_
57#define _hw_proj_gk20a_h_
58
59static inline u32 proj_gpc_base_v(void)
60{
61 return 0x00500000U;
62}
63static inline u32 proj_gpc_shared_base_v(void)
64{
65 return 0x00418000U;
66}
67static inline u32 proj_gpc_stride_v(void)
68{
69 return 0x00008000U;
70}
71static inline u32 proj_ltc_stride_v(void)
72{
73 return 0x00002000U;
74}
75static inline u32 proj_lts_stride_v(void)
76{
77 return 0x00000400U;
78}
79static inline u32 proj_fbpa_stride_v(void)
80{
81 return 0x00001000U;
82}
83static inline u32 proj_ppc_in_gpc_base_v(void)
84{
85 return 0x00003000U;
86}
87static inline u32 proj_ppc_in_gpc_shared_base_v(void)
88{
89 return 0x00003e00U;
90}
91static inline u32 proj_ppc_in_gpc_stride_v(void)
92{
93 return 0x00000200U;
94}
95static inline u32 proj_rop_base_v(void)
96{
97 return 0x00410000U;
98}
99static inline u32 proj_rop_shared_base_v(void)
100{
101 return 0x00408800U;
102}
103static inline u32 proj_rop_stride_v(void)
104{
105 return 0x00000400U;
106}
107static inline u32 proj_tpc_in_gpc_base_v(void)
108{
109 return 0x00004000U;
110}
111static inline u32 proj_tpc_in_gpc_stride_v(void)
112{
113 return 0x00000800U;
114}
115static inline u32 proj_tpc_in_gpc_shared_base_v(void)
116{
117 return 0x00001800U;
118}
119static inline u32 proj_host_num_engines_v(void)
120{
121 return 0x00000002U;
122}
123static inline u32 proj_host_num_pbdma_v(void)
124{
125 return 0x00000001U;
126}
127static inline u32 proj_scal_litter_num_tpc_per_gpc_v(void)
128{
129 return 0x00000001U;
130}
131static inline u32 proj_scal_litter_num_fbps_v(void)
132{
133 return 0x00000001U;
134}
135static inline u32 proj_scal_litter_num_fbpas_v(void)
136{
137 return 0x00000001U;
138}
139static inline u32 proj_scal_litter_num_gpcs_v(void)
140{
141 return 0x00000001U;
142}
143static inline u32 proj_scal_litter_num_pes_per_gpc_v(void)
144{
145 return 0x00000001U;
146}
147static inline u32 proj_scal_litter_num_tpcs_per_pes_v(void)
148{
149 return 0x00000001U;
150}
151static inline u32 proj_scal_litter_num_zcull_banks_v(void)
152{
153 return 0x00000004U;
154}
155static inline u32 proj_scal_max_gpcs_v(void)
156{
157 return 0x00000020U;
158}
159static inline u32 proj_scal_max_tpc_per_gpc_v(void)
160{
161 return 0x00000008U;
162}
163#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_pwr_gk20a.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_pwr_gk20a.h
new file mode 100644
index 00000000..71b73d2a
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_pwr_gk20a.h
@@ -0,0 +1,783 @@
1/*
2 * Copyright (c) 2012-2017, 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_pwr_gk20a_h_
57#define _hw_pwr_gk20a_h_
58
59static inline u32 pwr_falcon_irqsset_r(void)
60{
61 return 0x0010a000U;
62}
63static inline u32 pwr_falcon_irqsset_swgen0_set_f(void)
64{
65 return 0x40U;
66}
67static inline u32 pwr_falcon_irqsclr_r(void)
68{
69 return 0x0010a004U;
70}
71static inline u32 pwr_falcon_irqstat_r(void)
72{
73 return 0x0010a008U;
74}
75static inline u32 pwr_falcon_irqstat_halt_true_f(void)
76{
77 return 0x10U;
78}
79static inline u32 pwr_falcon_irqstat_exterr_true_f(void)
80{
81 return 0x20U;
82}
83static inline u32 pwr_falcon_irqstat_swgen0_true_f(void)
84{
85 return 0x40U;
86}
87static inline u32 pwr_falcon_irqmode_r(void)
88{
89 return 0x0010a00cU;
90}
91static inline u32 pwr_falcon_irqmset_r(void)
92{
93 return 0x0010a010U;
94}
95static inline u32 pwr_falcon_irqmset_gptmr_f(u32 v)
96{
97 return (v & 0x1U) << 0U;
98}
99static inline u32 pwr_falcon_irqmset_wdtmr_f(u32 v)
100{
101 return (v & 0x1U) << 1U;
102}
103static inline u32 pwr_falcon_irqmset_mthd_f(u32 v)
104{
105 return (v & 0x1U) << 2U;
106}
107static inline u32 pwr_falcon_irqmset_ctxsw_f(u32 v)
108{
109 return (v & 0x1U) << 3U;
110}
111static inline u32 pwr_falcon_irqmset_halt_f(u32 v)
112{
113 return (v & 0x1U) << 4U;
114}
115static inline u32 pwr_falcon_irqmset_exterr_f(u32 v)
116{
117 return (v & 0x1U) << 5U;
118}
119static inline u32 pwr_falcon_irqmset_swgen0_f(u32 v)
120{
121 return (v & 0x1U) << 6U;
122}
123static inline u32 pwr_falcon_irqmset_swgen1_f(u32 v)
124{
125 return (v & 0x1U) << 7U;
126}
127static inline u32 pwr_falcon_irqmclr_r(void)
128{
129 return 0x0010a014U;
130}
131static inline u32 pwr_falcon_irqmclr_gptmr_f(u32 v)
132{
133 return (v & 0x1U) << 0U;
134}
135static inline u32 pwr_falcon_irqmclr_wdtmr_f(u32 v)
136{
137 return (v & 0x1U) << 1U;
138}
139static inline u32 pwr_falcon_irqmclr_mthd_f(u32 v)
140{
141 return (v & 0x1U) << 2U;
142}
143static inline u32 pwr_falcon_irqmclr_ctxsw_f(u32 v)
144{
145 return (v & 0x1U) << 3U;
146}
147static inline u32 pwr_falcon_irqmclr_halt_f(u32 v)
148{
149 return (v & 0x1U) << 4U;
150}
151static inline u32 pwr_falcon_irqmclr_exterr_f(u32 v)
152{
153 return (v & 0x1U) << 5U;
154}
155static inline u32 pwr_falcon_irqmclr_swgen0_f(u32 v)
156{
157 return (v & 0x1U) << 6U;
158}
159static inline u32 pwr_falcon_irqmclr_swgen1_f(u32 v)
160{
161 return (v & 0x1U) << 7U;
162}
163static inline u32 pwr_falcon_irqmclr_ext_f(u32 v)
164{
165 return (v & 0xffU) << 8U;
166}
167static inline u32 pwr_falcon_irqmask_r(void)
168{
169 return 0x0010a018U;
170}
171static inline u32 pwr_falcon_irqdest_r(void)
172{
173 return 0x0010a01cU;
174}
175static inline u32 pwr_falcon_irqdest_host_gptmr_f(u32 v)
176{
177 return (v & 0x1U) << 0U;
178}
179static inline u32 pwr_falcon_irqdest_host_wdtmr_f(u32 v)
180{
181 return (v & 0x1U) << 1U;
182}
183static inline u32 pwr_falcon_irqdest_host_mthd_f(u32 v)
184{
185 return (v & 0x1U) << 2U;
186}
187static inline u32 pwr_falcon_irqdest_host_ctxsw_f(u32 v)
188{
189 return (v & 0x1U) << 3U;
190}
191static inline u32 pwr_falcon_irqdest_host_halt_f(u32 v)
192{
193 return (v & 0x1U) << 4U;
194}
195static inline u32 pwr_falcon_irqdest_host_exterr_f(u32 v)
196{
197 return (v & 0x1U) << 5U;
198}
199static inline u32 pwr_falcon_irqdest_host_swgen0_f(u32 v)
200{
201 return (v & 0x1U) << 6U;
202}
203static inline u32 pwr_falcon_irqdest_host_swgen1_f(u32 v)
204{
205 return (v & 0x1U) << 7U;
206}
207static inline u32 pwr_falcon_irqdest_host_ext_f(u32 v)
208{
209 return (v & 0xffU) << 8U;
210}
211static inline u32 pwr_falcon_irqdest_target_gptmr_f(u32 v)
212{
213 return (v & 0x1U) << 16U;
214}
215static inline u32 pwr_falcon_irqdest_target_wdtmr_f(u32 v)
216{
217 return (v & 0x1U) << 17U;
218}
219static inline u32 pwr_falcon_irqdest_target_mthd_f(u32 v)
220{
221 return (v & 0x1U) << 18U;
222}
223static inline u32 pwr_falcon_irqdest_target_ctxsw_f(u32 v)
224{
225 return (v & 0x1U) << 19U;
226}
227static inline u32 pwr_falcon_irqdest_target_halt_f(u32 v)
228{
229 return (v & 0x1U) << 20U;
230}
231static inline u32 pwr_falcon_irqdest_target_exterr_f(u32 v)
232{
233 return (v & 0x1U) << 21U;
234}
235static inline u32 pwr_falcon_irqdest_target_swgen0_f(u32 v)
236{
237 return (v & 0x1U) << 22U;
238}
239static inline u32 pwr_falcon_irqdest_target_swgen1_f(u32 v)
240{
241 return (v & 0x1U) << 23U;
242}
243static inline u32 pwr_falcon_irqdest_target_ext_f(u32 v)
244{
245 return (v & 0xffU) << 24U;
246}
247static inline u32 pwr_falcon_curctx_r(void)
248{
249 return 0x0010a050U;
250}
251static inline u32 pwr_falcon_nxtctx_r(void)
252{
253 return 0x0010a054U;
254}
255static inline u32 pwr_falcon_mailbox0_r(void)
256{
257 return 0x0010a040U;
258}
259static inline u32 pwr_falcon_mailbox1_r(void)
260{
261 return 0x0010a044U;
262}
263static inline u32 pwr_falcon_itfen_r(void)
264{
265 return 0x0010a048U;
266}
267static inline u32 pwr_falcon_itfen_ctxen_enable_f(void)
268{
269 return 0x1U;
270}
271static inline u32 pwr_falcon_idlestate_r(void)
272{
273 return 0x0010a04cU;
274}
275static inline u32 pwr_falcon_idlestate_falcon_busy_v(u32 r)
276{
277 return (r >> 0U) & 0x1U;
278}
279static inline u32 pwr_falcon_idlestate_ext_busy_v(u32 r)
280{
281 return (r >> 1U) & 0x7fffU;
282}
283static inline u32 pwr_falcon_os_r(void)
284{
285 return 0x0010a080U;
286}
287static inline u32 pwr_falcon_engctl_r(void)
288{
289 return 0x0010a0a4U;
290}
291static inline u32 pwr_falcon_cpuctl_r(void)
292{
293 return 0x0010a100U;
294}
295static inline u32 pwr_falcon_cpuctl_startcpu_f(u32 v)
296{
297 return (v & 0x1U) << 1U;
298}
299static inline u32 pwr_falcon_cpuctl_halt_intr_f(u32 v)
300{
301 return (v & 0x1U) << 4U;
302}
303static inline u32 pwr_falcon_cpuctl_halt_intr_m(void)
304{
305 return 0x1U << 4U;
306}
307static inline u32 pwr_falcon_cpuctl_halt_intr_v(u32 r)
308{
309 return (r >> 4U) & 0x1U;
310}
311static inline u32 pwr_falcon_imemc_r(u32 i)
312{
313 return 0x0010a180U + i*16U;
314}
315static inline u32 pwr_falcon_imemc_offs_f(u32 v)
316{
317 return (v & 0x3fU) << 2U;
318}
319static inline u32 pwr_falcon_imemc_blk_f(u32 v)
320{
321 return (v & 0xffU) << 8U;
322}
323static inline u32 pwr_falcon_imemc_aincw_f(u32 v)
324{
325 return (v & 0x1U) << 24U;
326}
327static inline u32 pwr_falcon_imemd_r(u32 i)
328{
329 return 0x0010a184U + i*16U;
330}
331static inline u32 pwr_falcon_imemt_r(u32 i)
332{
333 return 0x0010a188U + i*16U;
334}
335static inline u32 pwr_falcon_bootvec_r(void)
336{
337 return 0x0010a104U;
338}
339static inline u32 pwr_falcon_bootvec_vec_f(u32 v)
340{
341 return (v & 0xffffffffU) << 0U;
342}
343static inline u32 pwr_falcon_dmactl_r(void)
344{
345 return 0x0010a10cU;
346}
347static inline u32 pwr_falcon_dmactl_dmem_scrubbing_m(void)
348{
349 return 0x1U << 1U;
350}
351static inline u32 pwr_falcon_dmactl_imem_scrubbing_m(void)
352{
353 return 0x1U << 2U;
354}
355static inline u32 pwr_falcon_hwcfg_r(void)
356{
357 return 0x0010a108U;
358}
359static inline u32 pwr_falcon_hwcfg_imem_size_v(u32 r)
360{
361 return (r >> 0U) & 0x1ffU;
362}
363static inline u32 pwr_falcon_hwcfg_dmem_size_v(u32 r)
364{
365 return (r >> 9U) & 0x1ffU;
366}
367static inline u32 pwr_falcon_dmatrfbase_r(void)
368{
369 return 0x0010a110U;
370}
371static inline u32 pwr_falcon_dmatrfmoffs_r(void)
372{
373 return 0x0010a114U;
374}
375static inline u32 pwr_falcon_dmatrfcmd_r(void)
376{
377 return 0x0010a118U;
378}
379static inline u32 pwr_falcon_dmatrfcmd_imem_f(u32 v)
380{
381 return (v & 0x1U) << 4U;
382}
383static inline u32 pwr_falcon_dmatrfcmd_write_f(u32 v)
384{
385 return (v & 0x1U) << 5U;
386}
387static inline u32 pwr_falcon_dmatrfcmd_size_f(u32 v)
388{
389 return (v & 0x7U) << 8U;
390}
391static inline u32 pwr_falcon_dmatrfcmd_ctxdma_f(u32 v)
392{
393 return (v & 0x7U) << 12U;
394}
395static inline u32 pwr_falcon_dmatrffboffs_r(void)
396{
397 return 0x0010a11cU;
398}
399static inline u32 pwr_falcon_exterraddr_r(void)
400{
401 return 0x0010a168U;
402}
403static inline u32 pwr_falcon_exterrstat_r(void)
404{
405 return 0x0010a16cU;
406}
407static inline u32 pwr_falcon_exterrstat_valid_m(void)
408{
409 return 0x1U << 31U;
410}
411static inline u32 pwr_falcon_exterrstat_valid_v(u32 r)
412{
413 return (r >> 31U) & 0x1U;
414}
415static inline u32 pwr_falcon_exterrstat_valid_true_v(void)
416{
417 return 0x00000001U;
418}
419static inline u32 pwr_pmu_falcon_icd_cmd_r(void)
420{
421 return 0x0010a200U;
422}
423static inline u32 pwr_pmu_falcon_icd_cmd_opc_s(void)
424{
425 return 4U;
426}
427static inline u32 pwr_pmu_falcon_icd_cmd_opc_f(u32 v)
428{
429 return (v & 0xfU) << 0U;
430}
431static inline u32 pwr_pmu_falcon_icd_cmd_opc_m(void)
432{
433 return 0xfU << 0U;
434}
435static inline u32 pwr_pmu_falcon_icd_cmd_opc_v(u32 r)
436{
437 return (r >> 0U) & 0xfU;
438}
439static inline u32 pwr_pmu_falcon_icd_cmd_opc_rreg_f(void)
440{
441 return 0x8U;
442}
443static inline u32 pwr_pmu_falcon_icd_cmd_opc_rstat_f(void)
444{
445 return 0xeU;
446}
447static inline u32 pwr_pmu_falcon_icd_cmd_idx_f(u32 v)
448{
449 return (v & 0x1fU) << 8U;
450}
451static inline u32 pwr_pmu_falcon_icd_rdata_r(void)
452{
453 return 0x0010a20cU;
454}
455static inline u32 pwr_falcon_dmemc_r(u32 i)
456{
457 return 0x0010a1c0U + i*8U;
458}
459static inline u32 pwr_falcon_dmemc_offs_f(u32 v)
460{
461 return (v & 0x3fU) << 2U;
462}
463static inline u32 pwr_falcon_dmemc_offs_m(void)
464{
465 return 0x3fU << 2U;
466}
467static inline u32 pwr_falcon_dmemc_blk_f(u32 v)
468{
469 return (v & 0xffU) << 8U;
470}
471static inline u32 pwr_falcon_dmemc_blk_m(void)
472{
473 return 0xffU << 8U;
474}
475static inline u32 pwr_falcon_dmemc_aincw_f(u32 v)
476{
477 return (v & 0x1U) << 24U;
478}
479static inline u32 pwr_falcon_dmemc_aincr_f(u32 v)
480{
481 return (v & 0x1U) << 25U;
482}
483static inline u32 pwr_falcon_dmemd_r(u32 i)
484{
485 return 0x0010a1c4U + i*8U;
486}
487static inline u32 pwr_pmu_new_instblk_r(void)
488{
489 return 0x0010a480U;
490}
491static inline u32 pwr_pmu_new_instblk_ptr_f(u32 v)
492{
493 return (v & 0xfffffffU) << 0U;
494}
495static inline u32 pwr_pmu_new_instblk_target_fb_f(void)
496{
497 return 0x0U;
498}
499static inline u32 pwr_pmu_new_instblk_target_sys_coh_f(void)
500{
501 return 0x20000000U;
502}
503static inline u32 pwr_pmu_new_instblk_target_sys_ncoh_f(void)
504{
505 return 0x30000000U;
506}
507static inline u32 pwr_pmu_new_instblk_valid_f(u32 v)
508{
509 return (v & 0x1U) << 30U;
510}
511static inline u32 pwr_pmu_mutex_id_r(void)
512{
513 return 0x0010a488U;
514}
515static inline u32 pwr_pmu_mutex_id_value_v(u32 r)
516{
517 return (r >> 0U) & 0xffU;
518}
519static inline u32 pwr_pmu_mutex_id_value_init_v(void)
520{
521 return 0x00000000U;
522}
523static inline u32 pwr_pmu_mutex_id_value_not_avail_v(void)
524{
525 return 0x000000ffU;
526}
527static inline u32 pwr_pmu_mutex_id_release_r(void)
528{
529 return 0x0010a48cU;
530}
531static inline u32 pwr_pmu_mutex_id_release_value_f(u32 v)
532{
533 return (v & 0xffU) << 0U;
534}
535static inline u32 pwr_pmu_mutex_id_release_value_m(void)
536{
537 return 0xffU << 0U;
538}
539static inline u32 pwr_pmu_mutex_id_release_value_init_v(void)
540{
541 return 0x00000000U;
542}
543static inline u32 pwr_pmu_mutex_id_release_value_init_f(void)
544{
545 return 0x0U;
546}
547static inline u32 pwr_pmu_mutex_r(u32 i)
548{
549 return 0x0010a580U + i*4U;
550}
551static inline u32 pwr_pmu_mutex__size_1_v(void)
552{
553 return 0x00000010U;
554}
555static inline u32 pwr_pmu_mutex_value_f(u32 v)
556{
557 return (v & 0xffU) << 0U;
558}
559static inline u32 pwr_pmu_mutex_value_v(u32 r)
560{
561 return (r >> 0U) & 0xffU;
562}
563static inline u32 pwr_pmu_mutex_value_initial_lock_f(void)
564{
565 return 0x0U;
566}
567static inline u32 pwr_pmu_queue_head_r(u32 i)
568{
569 return 0x0010a4a0U + i*4U;
570}
571static inline u32 pwr_pmu_queue_head__size_1_v(void)
572{
573 return 0x00000004U;
574}
575static inline u32 pwr_pmu_queue_head_address_f(u32 v)
576{
577 return (v & 0xffffffffU) << 0U;
578}
579static inline u32 pwr_pmu_queue_head_address_v(u32 r)
580{
581 return (r >> 0U) & 0xffffffffU;
582}
583static inline u32 pwr_pmu_queue_tail_r(u32 i)
584{
585 return 0x0010a4b0U + i*4U;
586}
587static inline u32 pwr_pmu_queue_tail__size_1_v(void)
588{
589 return 0x00000004U;
590}
591static inline u32 pwr_pmu_queue_tail_address_f(u32 v)
592{
593 return (v & 0xffffffffU) << 0U;
594}
595static inline u32 pwr_pmu_queue_tail_address_v(u32 r)
596{
597 return (r >> 0U) & 0xffffffffU;
598}
599static inline u32 pwr_pmu_msgq_head_r(void)
600{
601 return 0x0010a4c8U;
602}
603static inline u32 pwr_pmu_msgq_head_val_f(u32 v)
604{
605 return (v & 0xffffffffU) << 0U;
606}
607static inline u32 pwr_pmu_msgq_head_val_v(u32 r)
608{
609 return (r >> 0U) & 0xffffffffU;
610}
611static inline u32 pwr_pmu_msgq_tail_r(void)
612{
613 return 0x0010a4ccU;
614}
615static inline u32 pwr_pmu_msgq_tail_val_f(u32 v)
616{
617 return (v & 0xffffffffU) << 0U;
618}
619static inline u32 pwr_pmu_msgq_tail_val_v(u32 r)
620{
621 return (r >> 0U) & 0xffffffffU;
622}
623static inline u32 pwr_pmu_idle_mask_r(u32 i)
624{
625 return 0x0010a504U + i*16U;
626}
627static inline u32 pwr_pmu_idle_mask_gr_enabled_f(void)
628{
629 return 0x1U;
630}
631static inline u32 pwr_pmu_idle_mask_ce_2_enabled_f(void)
632{
633 return 0x200000U;
634}
635static inline u32 pwr_pmu_idle_count_r(u32 i)
636{
637 return 0x0010a508U + i*16U;
638}
639static inline u32 pwr_pmu_idle_count_value_f(u32 v)
640{
641 return (v & 0x7fffffffU) << 0U;
642}
643static inline u32 pwr_pmu_idle_count_value_v(u32 r)
644{
645 return (r >> 0U) & 0x7fffffffU;
646}
647static inline u32 pwr_pmu_idle_count_reset_f(u32 v)
648{
649 return (v & 0x1U) << 31U;
650}
651static inline u32 pwr_pmu_idle_ctrl_r(u32 i)
652{
653 return 0x0010a50cU + i*16U;
654}
655static inline u32 pwr_pmu_idle_ctrl_value_m(void)
656{
657 return 0x3U << 0U;
658}
659static inline u32 pwr_pmu_idle_ctrl_value_busy_f(void)
660{
661 return 0x2U;
662}
663static inline u32 pwr_pmu_idle_ctrl_value_always_f(void)
664{
665 return 0x3U;
666}
667static inline u32 pwr_pmu_idle_ctrl_filter_m(void)
668{
669 return 0x1U << 2U;
670}
671static inline u32 pwr_pmu_idle_ctrl_filter_disabled_f(void)
672{
673 return 0x0U;
674}
675static inline u32 pwr_pmu_idle_mask_supp_r(u32 i)
676{
677 return 0x0010a9f0U + i*8U;
678}
679static inline u32 pwr_pmu_idle_mask_1_supp_r(u32 i)
680{
681 return 0x0010a9f4U + i*8U;
682}
683static inline u32 pwr_pmu_idle_ctrl_supp_r(u32 i)
684{
685 return 0x0010aa30U + i*8U;
686}
687static inline u32 pwr_pmu_debug_r(u32 i)
688{
689 return 0x0010a5c0U + i*4U;
690}
691static inline u32 pwr_pmu_debug__size_1_v(void)
692{
693 return 0x00000004U;
694}
695static inline u32 pwr_pmu_mailbox_r(u32 i)
696{
697 return 0x0010a450U + i*4U;
698}
699static inline u32 pwr_pmu_mailbox__size_1_v(void)
700{
701 return 0x0000000cU;
702}
703static inline u32 pwr_pmu_bar0_addr_r(void)
704{
705 return 0x0010a7a0U;
706}
707static inline u32 pwr_pmu_bar0_data_r(void)
708{
709 return 0x0010a7a4U;
710}
711static inline u32 pwr_pmu_bar0_ctl_r(void)
712{
713 return 0x0010a7acU;
714}
715static inline u32 pwr_pmu_bar0_timeout_r(void)
716{
717 return 0x0010a7a8U;
718}
719static inline u32 pwr_pmu_bar0_fecs_error_r(void)
720{
721 return 0x0010a988U;
722}
723static inline u32 pwr_pmu_bar0_error_status_r(void)
724{
725 return 0x0010a7b0U;
726}
727static inline u32 pwr_pmu_pg_idlefilth_r(u32 i)
728{
729 return 0x0010a6c0U + i*4U;
730}
731static inline u32 pwr_pmu_pg_ppuidlefilth_r(u32 i)
732{
733 return 0x0010a6e8U + i*4U;
734}
735static inline u32 pwr_pmu_pg_idle_cnt_r(u32 i)
736{
737 return 0x0010a710U + i*4U;
738}
739static inline u32 pwr_pmu_pg_intren_r(u32 i)
740{
741 return 0x0010a760U + i*4U;
742}
743static inline u32 pwr_fbif_transcfg_r(u32 i)
744{
745 return 0x0010a600U + i*4U;
746}
747static inline u32 pwr_fbif_transcfg_target_local_fb_f(void)
748{
749 return 0x0U;
750}
751static inline u32 pwr_fbif_transcfg_target_coherent_sysmem_f(void)
752{
753 return 0x1U;
754}
755static inline u32 pwr_fbif_transcfg_target_noncoherent_sysmem_f(void)
756{
757 return 0x2U;
758}
759static inline u32 pwr_fbif_transcfg_mem_type_s(void)
760{
761 return 1U;
762}
763static inline u32 pwr_fbif_transcfg_mem_type_f(u32 v)
764{
765 return (v & 0x1U) << 2U;
766}
767static inline u32 pwr_fbif_transcfg_mem_type_m(void)
768{
769 return 0x1U << 2U;
770}
771static inline u32 pwr_fbif_transcfg_mem_type_v(u32 r)
772{
773 return (r >> 2U) & 0x1U;
774}
775static inline u32 pwr_fbif_transcfg_mem_type_virtual_f(void)
776{
777 return 0x0U;
778}
779static inline u32 pwr_fbif_transcfg_mem_type_physical_f(void)
780{
781 return 0x4U;
782}
783#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_ram_gk20a.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_ram_gk20a.h
new file mode 100644
index 00000000..ed385d9e
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_ram_gk20a.h
@@ -0,0 +1,443 @@
1/*
2 * Copyright (c) 2012-2017, 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_ram_gk20a_h_
57#define _hw_ram_gk20a_h_
58
59static inline u32 ram_in_ramfc_s(void)
60{
61 return 4096U;
62}
63static inline u32 ram_in_ramfc_w(void)
64{
65 return 0U;
66}
67static inline u32 ram_in_page_dir_base_target_f(u32 v)
68{
69 return (v & 0x3U) << 0U;
70}
71static inline u32 ram_in_page_dir_base_target_w(void)
72{
73 return 128U;
74}
75static inline u32 ram_in_page_dir_base_target_vid_mem_f(void)
76{
77 return 0x0U;
78}
79static inline u32 ram_in_page_dir_base_target_sys_mem_coh_f(void)
80{
81 return 0x2U;
82}
83static inline u32 ram_in_page_dir_base_target_sys_mem_ncoh_f(void)
84{
85 return 0x3U;
86}
87static inline u32 ram_in_page_dir_base_vol_w(void)
88{
89 return 128U;
90}
91static inline u32 ram_in_page_dir_base_vol_true_f(void)
92{
93 return 0x4U;
94}
95static inline u32 ram_in_page_dir_base_lo_f(u32 v)
96{
97 return (v & 0xfffffU) << 12U;
98}
99static inline u32 ram_in_page_dir_base_lo_w(void)
100{
101 return 128U;
102}
103static inline u32 ram_in_page_dir_base_hi_f(u32 v)
104{
105 return (v & 0xffU) << 0U;
106}
107static inline u32 ram_in_page_dir_base_hi_w(void)
108{
109 return 129U;
110}
111static inline u32 ram_in_adr_limit_lo_f(u32 v)
112{
113 return (v & 0xfffffU) << 12U;
114}
115static inline u32 ram_in_adr_limit_lo_w(void)
116{
117 return 130U;
118}
119static inline u32 ram_in_adr_limit_hi_f(u32 v)
120{
121 return (v & 0xffU) << 0U;
122}
123static inline u32 ram_in_adr_limit_hi_w(void)
124{
125 return 131U;
126}
127static inline u32 ram_in_engine_cs_w(void)
128{
129 return 132U;
130}
131static inline u32 ram_in_engine_cs_wfi_v(void)
132{
133 return 0x00000000U;
134}
135static inline u32 ram_in_engine_cs_wfi_f(void)
136{
137 return 0x0U;
138}
139static inline u32 ram_in_engine_cs_fg_v(void)
140{
141 return 0x00000001U;
142}
143static inline u32 ram_in_engine_cs_fg_f(void)
144{
145 return 0x8U;
146}
147static inline u32 ram_in_gr_cs_w(void)
148{
149 return 132U;
150}
151static inline u32 ram_in_gr_cs_wfi_f(void)
152{
153 return 0x0U;
154}
155static inline u32 ram_in_gr_wfi_target_w(void)
156{
157 return 132U;
158}
159static inline u32 ram_in_gr_wfi_mode_w(void)
160{
161 return 132U;
162}
163static inline u32 ram_in_gr_wfi_mode_physical_v(void)
164{
165 return 0x00000000U;
166}
167static inline u32 ram_in_gr_wfi_mode_physical_f(void)
168{
169 return 0x0U;
170}
171static inline u32 ram_in_gr_wfi_mode_virtual_v(void)
172{
173 return 0x00000001U;
174}
175static inline u32 ram_in_gr_wfi_mode_virtual_f(void)
176{
177 return 0x4U;
178}
179static inline u32 ram_in_gr_wfi_ptr_lo_f(u32 v)
180{
181 return (v & 0xfffffU) << 12U;
182}
183static inline u32 ram_in_gr_wfi_ptr_lo_w(void)
184{
185 return 132U;
186}
187static inline u32 ram_in_gr_wfi_ptr_hi_f(u32 v)
188{
189 return (v & 0xffU) << 0U;
190}
191static inline u32 ram_in_gr_wfi_ptr_hi_w(void)
192{
193 return 133U;
194}
195static inline u32 ram_in_base_shift_v(void)
196{
197 return 0x0000000cU;
198}
199static inline u32 ram_in_alloc_size_v(void)
200{
201 return 0x00001000U;
202}
203static inline u32 ram_fc_size_val_v(void)
204{
205 return 0x00000200U;
206}
207static inline u32 ram_fc_gp_put_w(void)
208{
209 return 0U;
210}
211static inline u32 ram_fc_userd_w(void)
212{
213 return 2U;
214}
215static inline u32 ram_fc_userd_hi_w(void)
216{
217 return 3U;
218}
219static inline u32 ram_fc_signature_w(void)
220{
221 return 4U;
222}
223static inline u32 ram_fc_gp_get_w(void)
224{
225 return 5U;
226}
227static inline u32 ram_fc_pb_get_w(void)
228{
229 return 6U;
230}
231static inline u32 ram_fc_pb_get_hi_w(void)
232{
233 return 7U;
234}
235static inline u32 ram_fc_pb_top_level_get_w(void)
236{
237 return 8U;
238}
239static inline u32 ram_fc_pb_top_level_get_hi_w(void)
240{
241 return 9U;
242}
243static inline u32 ram_fc_acquire_w(void)
244{
245 return 12U;
246}
247static inline u32 ram_fc_semaphorea_w(void)
248{
249 return 14U;
250}
251static inline u32 ram_fc_semaphoreb_w(void)
252{
253 return 15U;
254}
255static inline u32 ram_fc_semaphorec_w(void)
256{
257 return 16U;
258}
259static inline u32 ram_fc_semaphored_w(void)
260{
261 return 17U;
262}
263static inline u32 ram_fc_gp_base_w(void)
264{
265 return 18U;
266}
267static inline u32 ram_fc_gp_base_hi_w(void)
268{
269 return 19U;
270}
271static inline u32 ram_fc_gp_fetch_w(void)
272{
273 return 20U;
274}
275static inline u32 ram_fc_pb_fetch_w(void)
276{
277 return 21U;
278}
279static inline u32 ram_fc_pb_fetch_hi_w(void)
280{
281 return 22U;
282}
283static inline u32 ram_fc_pb_put_w(void)
284{
285 return 23U;
286}
287static inline u32 ram_fc_pb_put_hi_w(void)
288{
289 return 24U;
290}
291static inline u32 ram_fc_pb_header_w(void)
292{
293 return 33U;
294}
295static inline u32 ram_fc_pb_count_w(void)
296{
297 return 34U;
298}
299static inline u32 ram_fc_subdevice_w(void)
300{
301 return 37U;
302}
303static inline u32 ram_fc_formats_w(void)
304{
305 return 39U;
306}
307static inline u32 ram_fc_syncpointa_w(void)
308{
309 return 41U;
310}
311static inline u32 ram_fc_syncpointb_w(void)
312{
313 return 42U;
314}
315static inline u32 ram_fc_target_w(void)
316{
317 return 43U;
318}
319static inline u32 ram_fc_hce_ctrl_w(void)
320{
321 return 57U;
322}
323static inline u32 ram_fc_chid_w(void)
324{
325 return 58U;
326}
327static inline u32 ram_fc_chid_id_f(u32 v)
328{
329 return (v & 0xfffU) << 0U;
330}
331static inline u32 ram_fc_chid_id_w(void)
332{
333 return 0U;
334}
335static inline u32 ram_fc_runlist_timeslice_w(void)
336{
337 return 62U;
338}
339static inline u32 ram_fc_pb_timeslice_w(void)
340{
341 return 63U;
342}
343static inline u32 ram_userd_base_shift_v(void)
344{
345 return 0x00000009U;
346}
347static inline u32 ram_userd_chan_size_v(void)
348{
349 return 0x00000200U;
350}
351static inline u32 ram_userd_put_w(void)
352{
353 return 16U;
354}
355static inline u32 ram_userd_get_w(void)
356{
357 return 17U;
358}
359static inline u32 ram_userd_ref_w(void)
360{
361 return 18U;
362}
363static inline u32 ram_userd_put_hi_w(void)
364{
365 return 19U;
366}
367static inline u32 ram_userd_ref_threshold_w(void)
368{
369 return 20U;
370}
371static inline u32 ram_userd_top_level_get_w(void)
372{
373 return 22U;
374}
375static inline u32 ram_userd_top_level_get_hi_w(void)
376{
377 return 23U;
378}
379static inline u32 ram_userd_get_hi_w(void)
380{
381 return 24U;
382}
383static inline u32 ram_userd_gp_get_w(void)
384{
385 return 34U;
386}
387static inline u32 ram_userd_gp_put_w(void)
388{
389 return 35U;
390}
391static inline u32 ram_userd_gp_top_level_get_w(void)
392{
393 return 22U;
394}
395static inline u32 ram_userd_gp_top_level_get_hi_w(void)
396{
397 return 23U;
398}
399static inline u32 ram_rl_entry_size_v(void)
400{
401 return 0x00000008U;
402}
403static inline u32 ram_rl_entry_chid_f(u32 v)
404{
405 return (v & 0xfffU) << 0U;
406}
407static inline u32 ram_rl_entry_id_f(u32 v)
408{
409 return (v & 0xfffU) << 0U;
410}
411static inline u32 ram_rl_entry_type_f(u32 v)
412{
413 return (v & 0x1U) << 13U;
414}
415static inline u32 ram_rl_entry_type_chid_f(void)
416{
417 return 0x0U;
418}
419static inline u32 ram_rl_entry_type_tsg_f(void)
420{
421 return 0x2000U;
422}
423static inline u32 ram_rl_entry_timeslice_scale_f(u32 v)
424{
425 return (v & 0xfU) << 14U;
426}
427static inline u32 ram_rl_entry_timeslice_scale_3_f(void)
428{
429 return 0xc000U;
430}
431static inline u32 ram_rl_entry_timeslice_timeout_f(u32 v)
432{
433 return (v & 0xffU) << 18U;
434}
435static inline u32 ram_rl_entry_timeslice_timeout_128_f(void)
436{
437 return 0x2000000U;
438}
439static inline u32 ram_rl_entry_tsg_length_f(u32 v)
440{
441 return (v & 0x3fU) << 26U;
442}
443#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_sim_gk20a.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_sim_gk20a.h
new file mode 100644
index 00000000..9d68b35b
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_sim_gk20a.h
@@ -0,0 +1,2153 @@
1/*
2 * Copyright (c) 2012-2017, NVIDIA Corporation.
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 /*
24 * Function naming determines intended use:
25 *
26 * <x>_r(void) : Returns the offset for register <x>.
27 *
28 * <x>_w(void) : Returns the word offset for word (4 byte) element <x>.
29 *
30 * <x>_<y>_s(void) : Returns size of field <y> of register <x> in bits.
31 *
32 * <x>_<y>_f(u32 v) : Returns a value based on 'v' which has been shifted
33 * and masked to place it at field <y> of register <x>. This value
34 * can be |'d with others to produce a full register value for
35 * register <x>.
36 *
37 * <x>_<y>_m(void) : Returns a mask for field <y> of register <x>. This
38 * value can be ~'d and then &'d to clear the value of field <y> for
39 * register <x>.
40 *
41 * <x>_<y>_<z>_f(void) : Returns the constant value <z> after being shifted
42 * to place it at field <y> of register <x>. This value can be |'d
43 * with others to produce a full register value for <x>.
44 *
45 * <x>_<y>_v(u32 r) : Returns the value of field <y> from a full register
46 * <x> value 'r' after being shifted to place its LSB at bit 0.
47 * This value is suitable for direct comparison with other unshifted
48 * values appropriate for use in field <y> of register <x>.
49 *
50 * <x>_<y>_<z>_v(void) : Returns the constant value for <z> defined for
51 * field <y> of register <x>. This value is suitable for direct
52 * comparison with unshifted values appropriate for use in field <y>
53 * of register <x>.
54 */
55
56#ifndef __hw_sim_gk20a_h__
57#define __hw_sim_gk20a_h__
58/*This file is autogenerated. Do not edit. */
59
60static inline u32 sim_send_ring_r(void)
61{
62 return 0x00000000;
63}
64static inline u32 sim_send_ring_target_s(void)
65{
66 return 2;
67}
68static inline u32 sim_send_ring_target_f(u32 v)
69{
70 return (v & 0x3) << 0;
71}
72static inline u32 sim_send_ring_target_m(void)
73{
74 return 0x3 << 0;
75}
76static inline u32 sim_send_ring_target_v(u32 r)
77{
78 return (r >> 0) & 0x3;
79}
80static inline u32 sim_send_ring_target_phys_init_v(void)
81{
82 return 0x00000001;
83}
84static inline u32 sim_send_ring_target_phys_init_f(void)
85{
86 return 0x1;
87}
88static inline u32 sim_send_ring_target_phys__init_v(void)
89{
90 return 0x00000001;
91}
92static inline u32 sim_send_ring_target_phys__init_f(void)
93{
94 return 0x1;
95}
96static inline u32 sim_send_ring_target_phys__prod_v(void)
97{
98 return 0x00000001;
99}
100static inline u32 sim_send_ring_target_phys__prod_f(void)
101{
102 return 0x1;
103}
104static inline u32 sim_send_ring_target_phys_nvm_v(void)
105{
106 return 0x00000001;
107}
108static inline u32 sim_send_ring_target_phys_nvm_f(void)
109{
110 return 0x1;
111}
112static inline u32 sim_send_ring_target_phys_pci_v(void)
113{
114 return 0x00000002;
115}
116static inline u32 sim_send_ring_target_phys_pci_f(void)
117{
118 return 0x2;
119}
120static inline u32 sim_send_ring_target_phys_pci_coherent_v(void)
121{
122 return 0x00000003;
123}
124static inline u32 sim_send_ring_target_phys_pci_coherent_f(void)
125{
126 return 0x3;
127}
128static inline u32 sim_send_ring_status_s(void)
129{
130 return 1;
131}
132static inline u32 sim_send_ring_status_f(u32 v)
133{
134 return (v & 0x1) << 3;
135}
136static inline u32 sim_send_ring_status_m(void)
137{
138 return 0x1 << 3;
139}
140static inline u32 sim_send_ring_status_v(u32 r)
141{
142 return (r >> 3) & 0x1;
143}
144static inline u32 sim_send_ring_status_init_v(void)
145{
146 return 0x00000000;
147}
148static inline u32 sim_send_ring_status_init_f(void)
149{
150 return 0x0;
151}
152static inline u32 sim_send_ring_status__init_v(void)
153{
154 return 0x00000000;
155}
156static inline u32 sim_send_ring_status__init_f(void)
157{
158 return 0x0;
159}
160static inline u32 sim_send_ring_status__prod_v(void)
161{
162 return 0x00000000;
163}
164static inline u32 sim_send_ring_status__prod_f(void)
165{
166 return 0x0;
167}
168static inline u32 sim_send_ring_status_invalid_v(void)
169{
170 return 0x00000000;
171}
172static inline u32 sim_send_ring_status_invalid_f(void)
173{
174 return 0x0;
175}
176static inline u32 sim_send_ring_status_valid_v(void)
177{
178 return 0x00000001;
179}
180static inline u32 sim_send_ring_status_valid_f(void)
181{
182 return 0x8;
183}
184static inline u32 sim_send_ring_size_s(void)
185{
186 return 2;
187}
188static inline u32 sim_send_ring_size_f(u32 v)
189{
190 return (v & 0x3) << 4;
191}
192static inline u32 sim_send_ring_size_m(void)
193{
194 return 0x3 << 4;
195}
196static inline u32 sim_send_ring_size_v(u32 r)
197{
198 return (r >> 4) & 0x3;
199}
200static inline u32 sim_send_ring_size_init_v(void)
201{
202 return 0x00000000;
203}
204static inline u32 sim_send_ring_size_init_f(void)
205{
206 return 0x0;
207}
208static inline u32 sim_send_ring_size__init_v(void)
209{
210 return 0x00000000;
211}
212static inline u32 sim_send_ring_size__init_f(void)
213{
214 return 0x0;
215}
216static inline u32 sim_send_ring_size__prod_v(void)
217{
218 return 0x00000000;
219}
220static inline u32 sim_send_ring_size__prod_f(void)
221{
222 return 0x0;
223}
224static inline u32 sim_send_ring_size_4kb_v(void)
225{
226 return 0x00000000;
227}
228static inline u32 sim_send_ring_size_4kb_f(void)
229{
230 return 0x0;
231}
232static inline u32 sim_send_ring_size_8kb_v(void)
233{
234 return 0x00000001;
235}
236static inline u32 sim_send_ring_size_8kb_f(void)
237{
238 return 0x10;
239}
240static inline u32 sim_send_ring_size_12kb_v(void)
241{
242 return 0x00000002;
243}
244static inline u32 sim_send_ring_size_12kb_f(void)
245{
246 return 0x20;
247}
248static inline u32 sim_send_ring_size_16kb_v(void)
249{
250 return 0x00000003;
251}
252static inline u32 sim_send_ring_size_16kb_f(void)
253{
254 return 0x30;
255}
256static inline u32 sim_send_ring_gp_in_ring_s(void)
257{
258 return 1;
259}
260static inline u32 sim_send_ring_gp_in_ring_f(u32 v)
261{
262 return (v & 0x1) << 11;
263}
264static inline u32 sim_send_ring_gp_in_ring_m(void)
265{
266 return 0x1 << 11;
267}
268static inline u32 sim_send_ring_gp_in_ring_v(u32 r)
269{
270 return (r >> 11) & 0x1;
271}
272static inline u32 sim_send_ring_gp_in_ring__init_v(void)
273{
274 return 0x00000000;
275}
276static inline u32 sim_send_ring_gp_in_ring__init_f(void)
277{
278 return 0x0;
279}
280static inline u32 sim_send_ring_gp_in_ring__prod_v(void)
281{
282 return 0x00000000;
283}
284static inline u32 sim_send_ring_gp_in_ring__prod_f(void)
285{
286 return 0x0;
287}
288static inline u32 sim_send_ring_gp_in_ring_no_v(void)
289{
290 return 0x00000000;
291}
292static inline u32 sim_send_ring_gp_in_ring_no_f(void)
293{
294 return 0x0;
295}
296static inline u32 sim_send_ring_gp_in_ring_yes_v(void)
297{
298 return 0x00000001;
299}
300static inline u32 sim_send_ring_gp_in_ring_yes_f(void)
301{
302 return 0x800;
303}
304static inline u32 sim_send_ring_addr_lo_s(void)
305{
306 return 20;
307}
308static inline u32 sim_send_ring_addr_lo_f(u32 v)
309{
310 return (v & 0xfffff) << 12;
311}
312static inline u32 sim_send_ring_addr_lo_m(void)
313{
314 return 0xfffff << 12;
315}
316static inline u32 sim_send_ring_addr_lo_v(u32 r)
317{
318 return (r >> 12) & 0xfffff;
319}
320static inline u32 sim_send_ring_addr_lo__init_v(void)
321{
322 return 0x00000000;
323}
324static inline u32 sim_send_ring_addr_lo__init_f(void)
325{
326 return 0x0;
327}
328static inline u32 sim_send_ring_addr_lo__prod_v(void)
329{
330 return 0x00000000;
331}
332static inline u32 sim_send_ring_addr_lo__prod_f(void)
333{
334 return 0x0;
335}
336static inline u32 sim_send_ring_hi_r(void)
337{
338 return 0x00000004;
339}
340static inline u32 sim_send_ring_hi_addr_s(void)
341{
342 return 20;
343}
344static inline u32 sim_send_ring_hi_addr_f(u32 v)
345{
346 return (v & 0xfffff) << 0;
347}
348static inline u32 sim_send_ring_hi_addr_m(void)
349{
350 return 0xfffff << 0;
351}
352static inline u32 sim_send_ring_hi_addr_v(u32 r)
353{
354 return (r >> 0) & 0xfffff;
355}
356static inline u32 sim_send_ring_hi_addr__init_v(void)
357{
358 return 0x00000000;
359}
360static inline u32 sim_send_ring_hi_addr__init_f(void)
361{
362 return 0x0;
363}
364static inline u32 sim_send_ring_hi_addr__prod_v(void)
365{
366 return 0x00000000;
367}
368static inline u32 sim_send_ring_hi_addr__prod_f(void)
369{
370 return 0x0;
371}
372static inline u32 sim_send_put_r(void)
373{
374 return 0x00000008;
375}
376static inline u32 sim_send_put_pointer_s(void)
377{
378 return 29;
379}
380static inline u32 sim_send_put_pointer_f(u32 v)
381{
382 return (v & 0x1fffffff) << 3;
383}
384static inline u32 sim_send_put_pointer_m(void)
385{
386 return 0x1fffffff << 3;
387}
388static inline u32 sim_send_put_pointer_v(u32 r)
389{
390 return (r >> 3) & 0x1fffffff;
391}
392static inline u32 sim_send_get_r(void)
393{
394 return 0x0000000c;
395}
396static inline u32 sim_send_get_pointer_s(void)
397{
398 return 29;
399}
400static inline u32 sim_send_get_pointer_f(u32 v)
401{
402 return (v & 0x1fffffff) << 3;
403}
404static inline u32 sim_send_get_pointer_m(void)
405{
406 return 0x1fffffff << 3;
407}
408static inline u32 sim_send_get_pointer_v(u32 r)
409{
410 return (r >> 3) & 0x1fffffff;
411}
412static inline u32 sim_recv_ring_r(void)
413{
414 return 0x00000010;
415}
416static inline u32 sim_recv_ring_target_s(void)
417{
418 return 2;
419}
420static inline u32 sim_recv_ring_target_f(u32 v)
421{
422 return (v & 0x3) << 0;
423}
424static inline u32 sim_recv_ring_target_m(void)
425{
426 return 0x3 << 0;
427}
428static inline u32 sim_recv_ring_target_v(u32 r)
429{
430 return (r >> 0) & 0x3;
431}
432static inline u32 sim_recv_ring_target_phys_init_v(void)
433{
434 return 0x00000001;
435}
436static inline u32 sim_recv_ring_target_phys_init_f(void)
437{
438 return 0x1;
439}
440static inline u32 sim_recv_ring_target_phys__init_v(void)
441{
442 return 0x00000001;
443}
444static inline u32 sim_recv_ring_target_phys__init_f(void)
445{
446 return 0x1;
447}
448static inline u32 sim_recv_ring_target_phys__prod_v(void)
449{
450 return 0x00000001;
451}
452static inline u32 sim_recv_ring_target_phys__prod_f(void)
453{
454 return 0x1;
455}
456static inline u32 sim_recv_ring_target_phys_nvm_v(void)
457{
458 return 0x00000001;
459}
460static inline u32 sim_recv_ring_target_phys_nvm_f(void)
461{
462 return 0x1;
463}
464static inline u32 sim_recv_ring_target_phys_pci_v(void)
465{
466 return 0x00000002;
467}
468static inline u32 sim_recv_ring_target_phys_pci_f(void)
469{
470 return 0x2;
471}
472static inline u32 sim_recv_ring_target_phys_pci_coherent_v(void)
473{
474 return 0x00000003;
475}
476static inline u32 sim_recv_ring_target_phys_pci_coherent_f(void)
477{
478 return 0x3;
479}
480static inline u32 sim_recv_ring_status_s(void)
481{
482 return 1;
483}
484static inline u32 sim_recv_ring_status_f(u32 v)
485{
486 return (v & 0x1) << 3;
487}
488static inline u32 sim_recv_ring_status_m(void)
489{
490 return 0x1 << 3;
491}
492static inline u32 sim_recv_ring_status_v(u32 r)
493{
494 return (r >> 3) & 0x1;
495}
496static inline u32 sim_recv_ring_status_init_v(void)
497{
498 return 0x00000000;
499}
500static inline u32 sim_recv_ring_status_init_f(void)
501{
502 return 0x0;
503}
504static inline u32 sim_recv_ring_status__init_v(void)
505{
506 return 0x00000000;
507}
508static inline u32 sim_recv_ring_status__init_f(void)
509{
510 return 0x0;
511}
512static inline u32 sim_recv_ring_status__prod_v(void)
513{
514 return 0x00000000;
515}
516static inline u32 sim_recv_ring_status__prod_f(void)
517{
518 return 0x0;
519}
520static inline u32 sim_recv_ring_status_invalid_v(void)
521{
522 return 0x00000000;
523}
524static inline u32 sim_recv_ring_status_invalid_f(void)
525{
526 return 0x0;
527}
528static inline u32 sim_recv_ring_status_valid_v(void)
529{
530 return 0x00000001;
531}
532static inline u32 sim_recv_ring_status_valid_f(void)
533{
534 return 0x8;
535}
536static inline u32 sim_recv_ring_size_s(void)
537{
538 return 2;
539}
540static inline u32 sim_recv_ring_size_f(u32 v)
541{
542 return (v & 0x3) << 4;
543}
544static inline u32 sim_recv_ring_size_m(void)
545{
546 return 0x3 << 4;
547}
548static inline u32 sim_recv_ring_size_v(u32 r)
549{
550 return (r >> 4) & 0x3;
551}
552static inline u32 sim_recv_ring_size_init_v(void)
553{
554 return 0x00000000;
555}
556static inline u32 sim_recv_ring_size_init_f(void)
557{
558 return 0x0;
559}
560static inline u32 sim_recv_ring_size__init_v(void)
561{
562 return 0x00000000;
563}
564static inline u32 sim_recv_ring_size__init_f(void)
565{
566 return 0x0;
567}
568static inline u32 sim_recv_ring_size__prod_v(void)
569{
570 return 0x00000000;
571}
572static inline u32 sim_recv_ring_size__prod_f(void)
573{
574 return 0x0;
575}
576static inline u32 sim_recv_ring_size_4kb_v(void)
577{
578 return 0x00000000;
579}
580static inline u32 sim_recv_ring_size_4kb_f(void)
581{
582 return 0x0;
583}
584static inline u32 sim_recv_ring_size_8kb_v(void)
585{
586 return 0x00000001;
587}
588static inline u32 sim_recv_ring_size_8kb_f(void)
589{
590 return 0x10;
591}
592static inline u32 sim_recv_ring_size_12kb_v(void)
593{
594 return 0x00000002;
595}
596static inline u32 sim_recv_ring_size_12kb_f(void)
597{
598 return 0x20;
599}
600static inline u32 sim_recv_ring_size_16kb_v(void)
601{
602 return 0x00000003;
603}
604static inline u32 sim_recv_ring_size_16kb_f(void)
605{
606 return 0x30;
607}
608static inline u32 sim_recv_ring_gp_in_ring_s(void)
609{
610 return 1;
611}
612static inline u32 sim_recv_ring_gp_in_ring_f(u32 v)
613{
614 return (v & 0x1) << 11;
615}
616static inline u32 sim_recv_ring_gp_in_ring_m(void)
617{
618 return 0x1 << 11;
619}
620static inline u32 sim_recv_ring_gp_in_ring_v(u32 r)
621{
622 return (r >> 11) & 0x1;
623}
624static inline u32 sim_recv_ring_gp_in_ring__init_v(void)
625{
626 return 0x00000000;
627}
628static inline u32 sim_recv_ring_gp_in_ring__init_f(void)
629{
630 return 0x0;
631}
632static inline u32 sim_recv_ring_gp_in_ring__prod_v(void)
633{
634 return 0x00000000;
635}
636static inline u32 sim_recv_ring_gp_in_ring__prod_f(void)
637{
638 return 0x0;
639}
640static inline u32 sim_recv_ring_gp_in_ring_no_v(void)
641{
642 return 0x00000000;
643}
644static inline u32 sim_recv_ring_gp_in_ring_no_f(void)
645{
646 return 0x0;
647}
648static inline u32 sim_recv_ring_gp_in_ring_yes_v(void)
649{
650 return 0x00000001;
651}
652static inline u32 sim_recv_ring_gp_in_ring_yes_f(void)
653{
654 return 0x800;
655}
656static inline u32 sim_recv_ring_addr_lo_s(void)
657{
658 return 20;
659}
660static inline u32 sim_recv_ring_addr_lo_f(u32 v)
661{
662 return (v & 0xfffff) << 12;
663}
664static inline u32 sim_recv_ring_addr_lo_m(void)
665{
666 return 0xfffff << 12;
667}
668static inline u32 sim_recv_ring_addr_lo_v(u32 r)
669{
670 return (r >> 12) & 0xfffff;
671}
672static inline u32 sim_recv_ring_addr_lo__init_v(void)
673{
674 return 0x00000000;
675}
676static inline u32 sim_recv_ring_addr_lo__init_f(void)
677{
678 return 0x0;
679}
680static inline u32 sim_recv_ring_addr_lo__prod_v(void)
681{
682 return 0x00000000;
683}
684static inline u32 sim_recv_ring_addr_lo__prod_f(void)
685{
686 return 0x0;
687}
688static inline u32 sim_recv_ring_hi_r(void)
689{
690 return 0x00000014;
691}
692static inline u32 sim_recv_ring_hi_addr_s(void)
693{
694 return 20;
695}
696static inline u32 sim_recv_ring_hi_addr_f(u32 v)
697{
698 return (v & 0xfffff) << 0;
699}
700static inline u32 sim_recv_ring_hi_addr_m(void)
701{
702 return 0xfffff << 0;
703}
704static inline u32 sim_recv_ring_hi_addr_v(u32 r)
705{
706 return (r >> 0) & 0xfffff;
707}
708static inline u32 sim_recv_ring_hi_addr__init_v(void)
709{
710 return 0x00000000;
711}
712static inline u32 sim_recv_ring_hi_addr__init_f(void)
713{
714 return 0x0;
715}
716static inline u32 sim_recv_ring_hi_addr__prod_v(void)
717{
718 return 0x00000000;
719}
720static inline u32 sim_recv_ring_hi_addr__prod_f(void)
721{
722 return 0x0;
723}
724static inline u32 sim_recv_put_r(void)
725{
726 return 0x00000018;
727}
728static inline u32 sim_recv_put_pointer_s(void)
729{
730 return 11;
731}
732static inline u32 sim_recv_put_pointer_f(u32 v)
733{
734 return (v & 0x7ff) << 3;
735}
736static inline u32 sim_recv_put_pointer_m(void)
737{
738 return 0x7ff << 3;
739}
740static inline u32 sim_recv_put_pointer_v(u32 r)
741{
742 return (r >> 3) & 0x7ff;
743}
744static inline u32 sim_recv_get_r(void)
745{
746 return 0x0000001c;
747}
748static inline u32 sim_recv_get_pointer_s(void)
749{
750 return 11;
751}
752static inline u32 sim_recv_get_pointer_f(u32 v)
753{
754 return (v & 0x7ff) << 3;
755}
756static inline u32 sim_recv_get_pointer_m(void)
757{
758 return 0x7ff << 3;
759}
760static inline u32 sim_recv_get_pointer_v(u32 r)
761{
762 return (r >> 3) & 0x7ff;
763}
764static inline u32 sim_config_r(void)
765{
766 return 0x00000020;
767}
768static inline u32 sim_config_mode_s(void)
769{
770 return 1;
771}
772static inline u32 sim_config_mode_f(u32 v)
773{
774 return (v & 0x1) << 0;
775}
776static inline u32 sim_config_mode_m(void)
777{
778 return 0x1 << 0;
779}
780static inline u32 sim_config_mode_v(u32 r)
781{
782 return (r >> 0) & 0x1;
783}
784static inline u32 sim_config_mode_disabled_v(void)
785{
786 return 0x00000000;
787}
788static inline u32 sim_config_mode_disabled_f(void)
789{
790 return 0x0;
791}
792static inline u32 sim_config_mode_enabled_v(void)
793{
794 return 0x00000001;
795}
796static inline u32 sim_config_mode_enabled_f(void)
797{
798 return 0x1;
799}
800static inline u32 sim_config_channels_s(void)
801{
802 return 7;
803}
804static inline u32 sim_config_channels_f(u32 v)
805{
806 return (v & 0x7f) << 1;
807}
808static inline u32 sim_config_channels_m(void)
809{
810 return 0x7f << 1;
811}
812static inline u32 sim_config_channels_v(u32 r)
813{
814 return (r >> 1) & 0x7f;
815}
816static inline u32 sim_config_channels_none_v(void)
817{
818 return 0x00000000;
819}
820static inline u32 sim_config_channels_none_f(void)
821{
822 return 0x0;
823}
824static inline u32 sim_config_cached_only_s(void)
825{
826 return 1;
827}
828static inline u32 sim_config_cached_only_f(u32 v)
829{
830 return (v & 0x1) << 8;
831}
832static inline u32 sim_config_cached_only_m(void)
833{
834 return 0x1 << 8;
835}
836static inline u32 sim_config_cached_only_v(u32 r)
837{
838 return (r >> 8) & 0x1;
839}
840static inline u32 sim_config_cached_only_disabled_v(void)
841{
842 return 0x00000000;
843}
844static inline u32 sim_config_cached_only_disabled_f(void)
845{
846 return 0x0;
847}
848static inline u32 sim_config_cached_only_enabled_v(void)
849{
850 return 0x00000001;
851}
852static inline u32 sim_config_cached_only_enabled_f(void)
853{
854 return 0x100;
855}
856static inline u32 sim_config_validity_s(void)
857{
858 return 2;
859}
860static inline u32 sim_config_validity_f(u32 v)
861{
862 return (v & 0x3) << 9;
863}
864static inline u32 sim_config_validity_m(void)
865{
866 return 0x3 << 9;
867}
868static inline u32 sim_config_validity_v(u32 r)
869{
870 return (r >> 9) & 0x3;
871}
872static inline u32 sim_config_validity__init_v(void)
873{
874 return 0x00000001;
875}
876static inline u32 sim_config_validity__init_f(void)
877{
878 return 0x200;
879}
880static inline u32 sim_config_validity_valid_v(void)
881{
882 return 0x00000001;
883}
884static inline u32 sim_config_validity_valid_f(void)
885{
886 return 0x200;
887}
888static inline u32 sim_config_simulation_s(void)
889{
890 return 2;
891}
892static inline u32 sim_config_simulation_f(u32 v)
893{
894 return (v & 0x3) << 12;
895}
896static inline u32 sim_config_simulation_m(void)
897{
898 return 0x3 << 12;
899}
900static inline u32 sim_config_simulation_v(u32 r)
901{
902 return (r >> 12) & 0x3;
903}
904static inline u32 sim_config_simulation_disabled_v(void)
905{
906 return 0x00000000;
907}
908static inline u32 sim_config_simulation_disabled_f(void)
909{
910 return 0x0;
911}
912static inline u32 sim_config_simulation_fmodel_v(void)
913{
914 return 0x00000001;
915}
916static inline u32 sim_config_simulation_fmodel_f(void)
917{
918 return 0x1000;
919}
920static inline u32 sim_config_simulation_rtlsim_v(void)
921{
922 return 0x00000002;
923}
924static inline u32 sim_config_simulation_rtlsim_f(void)
925{
926 return 0x2000;
927}
928static inline u32 sim_config_secondary_display_s(void)
929{
930 return 1;
931}
932static inline u32 sim_config_secondary_display_f(u32 v)
933{
934 return (v & 0x1) << 14;
935}
936static inline u32 sim_config_secondary_display_m(void)
937{
938 return 0x1 << 14;
939}
940static inline u32 sim_config_secondary_display_v(u32 r)
941{
942 return (r >> 14) & 0x1;
943}
944static inline u32 sim_config_secondary_display_disabled_v(void)
945{
946 return 0x00000000;
947}
948static inline u32 sim_config_secondary_display_disabled_f(void)
949{
950 return 0x0;
951}
952static inline u32 sim_config_secondary_display_enabled_v(void)
953{
954 return 0x00000001;
955}
956static inline u32 sim_config_secondary_display_enabled_f(void)
957{
958 return 0x4000;
959}
960static inline u32 sim_config_num_heads_s(void)
961{
962 return 8;
963}
964static inline u32 sim_config_num_heads_f(u32 v)
965{
966 return (v & 0xff) << 17;
967}
968static inline u32 sim_config_num_heads_m(void)
969{
970 return 0xff << 17;
971}
972static inline u32 sim_config_num_heads_v(u32 r)
973{
974 return (r >> 17) & 0xff;
975}
976static inline u32 sim_event_ring_r(void)
977{
978 return 0x00000030;
979}
980static inline u32 sim_event_ring_target_s(void)
981{
982 return 2;
983}
984static inline u32 sim_event_ring_target_f(u32 v)
985{
986 return (v & 0x3) << 0;
987}
988static inline u32 sim_event_ring_target_m(void)
989{
990 return 0x3 << 0;
991}
992static inline u32 sim_event_ring_target_v(u32 r)
993{
994 return (r >> 0) & 0x3;
995}
996static inline u32 sim_event_ring_target_phys_init_v(void)
997{
998 return 0x00000001;
999}
1000static inline u32 sim_event_ring_target_phys_init_f(void)
1001{
1002 return 0x1;
1003}
1004static inline u32 sim_event_ring_target_phys__init_v(void)
1005{
1006 return 0x00000001;
1007}
1008static inline u32 sim_event_ring_target_phys__init_f(void)
1009{
1010 return 0x1;
1011}
1012static inline u32 sim_event_ring_target_phys__prod_v(void)
1013{
1014 return 0x00000001;
1015}
1016static inline u32 sim_event_ring_target_phys__prod_f(void)
1017{
1018 return 0x1;
1019}
1020static inline u32 sim_event_ring_target_phys_nvm_v(void)
1021{
1022 return 0x00000001;
1023}
1024static inline u32 sim_event_ring_target_phys_nvm_f(void)
1025{
1026 return 0x1;
1027}
1028static inline u32 sim_event_ring_target_phys_pci_v(void)
1029{
1030 return 0x00000002;
1031}
1032static inline u32 sim_event_ring_target_phys_pci_f(void)
1033{
1034 return 0x2;
1035}
1036static inline u32 sim_event_ring_target_phys_pci_coherent_v(void)
1037{
1038 return 0x00000003;
1039}
1040static inline u32 sim_event_ring_target_phys_pci_coherent_f(void)
1041{
1042 return 0x3;
1043}
1044static inline u32 sim_event_ring_status_s(void)
1045{
1046 return 1;
1047}
1048static inline u32 sim_event_ring_status_f(u32 v)
1049{
1050 return (v & 0x1) << 3;
1051}
1052static inline u32 sim_event_ring_status_m(void)
1053{
1054 return 0x1 << 3;
1055}
1056static inline u32 sim_event_ring_status_v(u32 r)
1057{
1058 return (r >> 3) & 0x1;
1059}
1060static inline u32 sim_event_ring_status_init_v(void)
1061{
1062 return 0x00000000;
1063}
1064static inline u32 sim_event_ring_status_init_f(void)
1065{
1066 return 0x0;
1067}
1068static inline u32 sim_event_ring_status__init_v(void)
1069{
1070 return 0x00000000;
1071}
1072static inline u32 sim_event_ring_status__init_f(void)
1073{
1074 return 0x0;
1075}
1076static inline u32 sim_event_ring_status__prod_v(void)
1077{
1078 return 0x00000000;
1079}
1080static inline u32 sim_event_ring_status__prod_f(void)
1081{
1082 return 0x0;
1083}
1084static inline u32 sim_event_ring_status_invalid_v(void)
1085{
1086 return 0x00000000;
1087}
1088static inline u32 sim_event_ring_status_invalid_f(void)
1089{
1090 return 0x0;
1091}
1092static inline u32 sim_event_ring_status_valid_v(void)
1093{
1094 return 0x00000001;
1095}
1096static inline u32 sim_event_ring_status_valid_f(void)
1097{
1098 return 0x8;
1099}
1100static inline u32 sim_event_ring_size_s(void)
1101{
1102 return 2;
1103}
1104static inline u32 sim_event_ring_size_f(u32 v)
1105{
1106 return (v & 0x3) << 4;
1107}
1108static inline u32 sim_event_ring_size_m(void)
1109{
1110 return 0x3 << 4;
1111}
1112static inline u32 sim_event_ring_size_v(u32 r)
1113{
1114 return (r >> 4) & 0x3;
1115}
1116static inline u32 sim_event_ring_size_init_v(void)
1117{
1118 return 0x00000000;
1119}
1120static inline u32 sim_event_ring_size_init_f(void)
1121{
1122 return 0x0;
1123}
1124static inline u32 sim_event_ring_size__init_v(void)
1125{
1126 return 0x00000000;
1127}
1128static inline u32 sim_event_ring_size__init_f(void)
1129{
1130 return 0x0;
1131}
1132static inline u32 sim_event_ring_size__prod_v(void)
1133{
1134 return 0x00000000;
1135}
1136static inline u32 sim_event_ring_size__prod_f(void)
1137{
1138 return 0x0;
1139}
1140static inline u32 sim_event_ring_size_4kb_v(void)
1141{
1142 return 0x00000000;
1143}
1144static inline u32 sim_event_ring_size_4kb_f(void)
1145{
1146 return 0x0;
1147}
1148static inline u32 sim_event_ring_size_8kb_v(void)
1149{
1150 return 0x00000001;
1151}
1152static inline u32 sim_event_ring_size_8kb_f(void)
1153{
1154 return 0x10;
1155}
1156static inline u32 sim_event_ring_size_12kb_v(void)
1157{
1158 return 0x00000002;
1159}
1160static inline u32 sim_event_ring_size_12kb_f(void)
1161{
1162 return 0x20;
1163}
1164static inline u32 sim_event_ring_size_16kb_v(void)
1165{
1166 return 0x00000003;
1167}
1168static inline u32 sim_event_ring_size_16kb_f(void)
1169{
1170 return 0x30;
1171}
1172static inline u32 sim_event_ring_gp_in_ring_s(void)
1173{
1174 return 1;
1175}
1176static inline u32 sim_event_ring_gp_in_ring_f(u32 v)
1177{
1178 return (v & 0x1) << 11;
1179}
1180static inline u32 sim_event_ring_gp_in_ring_m(void)
1181{
1182 return 0x1 << 11;
1183}
1184static inline u32 sim_event_ring_gp_in_ring_v(u32 r)
1185{
1186 return (r >> 11) & 0x1;
1187}
1188static inline u32 sim_event_ring_gp_in_ring__init_v(void)
1189{
1190 return 0x00000000;
1191}
1192static inline u32 sim_event_ring_gp_in_ring__init_f(void)
1193{
1194 return 0x0;
1195}
1196static inline u32 sim_event_ring_gp_in_ring__prod_v(void)
1197{
1198 return 0x00000000;
1199}
1200static inline u32 sim_event_ring_gp_in_ring__prod_f(void)
1201{
1202 return 0x0;
1203}
1204static inline u32 sim_event_ring_gp_in_ring_no_v(void)
1205{
1206 return 0x00000000;
1207}
1208static inline u32 sim_event_ring_gp_in_ring_no_f(void)
1209{
1210 return 0x0;
1211}
1212static inline u32 sim_event_ring_gp_in_ring_yes_v(void)
1213{
1214 return 0x00000001;
1215}
1216static inline u32 sim_event_ring_gp_in_ring_yes_f(void)
1217{
1218 return 0x800;
1219}
1220static inline u32 sim_event_ring_addr_lo_s(void)
1221{
1222 return 20;
1223}
1224static inline u32 sim_event_ring_addr_lo_f(u32 v)
1225{
1226 return (v & 0xfffff) << 12;
1227}
1228static inline u32 sim_event_ring_addr_lo_m(void)
1229{
1230 return 0xfffff << 12;
1231}
1232static inline u32 sim_event_ring_addr_lo_v(u32 r)
1233{
1234 return (r >> 12) & 0xfffff;
1235}
1236static inline u32 sim_event_ring_addr_lo__init_v(void)
1237{
1238 return 0x00000000;
1239}
1240static inline u32 sim_event_ring_addr_lo__init_f(void)
1241{
1242 return 0x0;
1243}
1244static inline u32 sim_event_ring_addr_lo__prod_v(void)
1245{
1246 return 0x00000000;
1247}
1248static inline u32 sim_event_ring_addr_lo__prod_f(void)
1249{
1250 return 0x0;
1251}
1252static inline u32 sim_event_ring_hi_v(void)
1253{
1254 return 0x00000034;
1255}
1256static inline u32 sim_event_ring_hi_addr_s(void)
1257{
1258 return 20;
1259}
1260static inline u32 sim_event_ring_hi_addr_f(u32 v)
1261{
1262 return (v & 0xfffff) << 0;
1263}
1264static inline u32 sim_event_ring_hi_addr_m(void)
1265{
1266 return 0xfffff << 0;
1267}
1268static inline u32 sim_event_ring_hi_addr_v(u32 r)
1269{
1270 return (r >> 0) & 0xfffff;
1271}
1272static inline u32 sim_event_ring_hi_addr__init_v(void)
1273{
1274 return 0x00000000;
1275}
1276static inline u32 sim_event_ring_hi_addr__init_f(void)
1277{
1278 return 0x0;
1279}
1280static inline u32 sim_event_ring_hi_addr__prod_v(void)
1281{
1282 return 0x00000000;
1283}
1284static inline u32 sim_event_ring_hi_addr__prod_f(void)
1285{
1286 return 0x0;
1287}
1288static inline u32 sim_event_put_r(void)
1289{
1290 return 0x00000038;
1291}
1292static inline u32 sim_event_put_pointer_s(void)
1293{
1294 return 30;
1295}
1296static inline u32 sim_event_put_pointer_f(u32 v)
1297{
1298 return (v & 0x3fffffff) << 2;
1299}
1300static inline u32 sim_event_put_pointer_m(void)
1301{
1302 return 0x3fffffff << 2;
1303}
1304static inline u32 sim_event_put_pointer_v(u32 r)
1305{
1306 return (r >> 2) & 0x3fffffff;
1307}
1308static inline u32 sim_event_get_r(void)
1309{
1310 return 0x0000003c;
1311}
1312static inline u32 sim_event_get_pointer_s(void)
1313{
1314 return 30;
1315}
1316static inline u32 sim_event_get_pointer_f(u32 v)
1317{
1318 return (v & 0x3fffffff) << 2;
1319}
1320static inline u32 sim_event_get_pointer_m(void)
1321{
1322 return 0x3fffffff << 2;
1323}
1324static inline u32 sim_event_get_pointer_v(u32 r)
1325{
1326 return (r >> 2) & 0x3fffffff;
1327}
1328static inline u32 sim_status_r(void)
1329{
1330 return 0x00000028;
1331}
1332static inline u32 sim_status_send_put_s(void)
1333{
1334 return 1;
1335}
1336static inline u32 sim_status_send_put_f(u32 v)
1337{
1338 return (v & 0x1) << 0;
1339}
1340static inline u32 sim_status_send_put_m(void)
1341{
1342 return 0x1 << 0;
1343}
1344static inline u32 sim_status_send_put_v(u32 r)
1345{
1346 return (r >> 0) & 0x1;
1347}
1348static inline u32 sim_status_send_put__init_v(void)
1349{
1350 return 0x00000000;
1351}
1352static inline u32 sim_status_send_put__init_f(void)
1353{
1354 return 0x0;
1355}
1356static inline u32 sim_status_send_put_idle_v(void)
1357{
1358 return 0x00000000;
1359}
1360static inline u32 sim_status_send_put_idle_f(void)
1361{
1362 return 0x0;
1363}
1364static inline u32 sim_status_send_put_pending_v(void)
1365{
1366 return 0x00000001;
1367}
1368static inline u32 sim_status_send_put_pending_f(void)
1369{
1370 return 0x1;
1371}
1372static inline u32 sim_status_send_get_s(void)
1373{
1374 return 1;
1375}
1376static inline u32 sim_status_send_get_f(u32 v)
1377{
1378 return (v & 0x1) << 1;
1379}
1380static inline u32 sim_status_send_get_m(void)
1381{
1382 return 0x1 << 1;
1383}
1384static inline u32 sim_status_send_get_v(u32 r)
1385{
1386 return (r >> 1) & 0x1;
1387}
1388static inline u32 sim_status_send_get__init_v(void)
1389{
1390 return 0x00000000;
1391}
1392static inline u32 sim_status_send_get__init_f(void)
1393{
1394 return 0x0;
1395}
1396static inline u32 sim_status_send_get_idle_v(void)
1397{
1398 return 0x00000000;
1399}
1400static inline u32 sim_status_send_get_idle_f(void)
1401{
1402 return 0x0;
1403}
1404static inline u32 sim_status_send_get_pending_v(void)
1405{
1406 return 0x00000001;
1407}
1408static inline u32 sim_status_send_get_pending_f(void)
1409{
1410 return 0x2;
1411}
1412static inline u32 sim_status_send_get_clear_v(void)
1413{
1414 return 0x00000001;
1415}
1416static inline u32 sim_status_send_get_clear_f(void)
1417{
1418 return 0x2;
1419}
1420static inline u32 sim_status_recv_put_s(void)
1421{
1422 return 1;
1423}
1424static inline u32 sim_status_recv_put_f(u32 v)
1425{
1426 return (v & 0x1) << 2;
1427}
1428static inline u32 sim_status_recv_put_m(void)
1429{
1430 return 0x1 << 2;
1431}
1432static inline u32 sim_status_recv_put_v(u32 r)
1433{
1434 return (r >> 2) & 0x1;
1435}
1436static inline u32 sim_status_recv_put__init_v(void)
1437{
1438 return 0x00000000;
1439}
1440static inline u32 sim_status_recv_put__init_f(void)
1441{
1442 return 0x0;
1443}
1444static inline u32 sim_status_recv_put_idle_v(void)
1445{
1446 return 0x00000000;
1447}
1448static inline u32 sim_status_recv_put_idle_f(void)
1449{
1450 return 0x0;
1451}
1452static inline u32 sim_status_recv_put_pending_v(void)
1453{
1454 return 0x00000001;
1455}
1456static inline u32 sim_status_recv_put_pending_f(void)
1457{
1458 return 0x4;
1459}
1460static inline u32 sim_status_recv_put_clear_v(void)
1461{
1462 return 0x00000001;
1463}
1464static inline u32 sim_status_recv_put_clear_f(void)
1465{
1466 return 0x4;
1467}
1468static inline u32 sim_status_recv_get_s(void)
1469{
1470 return 1;
1471}
1472static inline u32 sim_status_recv_get_f(u32 v)
1473{
1474 return (v & 0x1) << 3;
1475}
1476static inline u32 sim_status_recv_get_m(void)
1477{
1478 return 0x1 << 3;
1479}
1480static inline u32 sim_status_recv_get_v(u32 r)
1481{
1482 return (r >> 3) & 0x1;
1483}
1484static inline u32 sim_status_recv_get__init_v(void)
1485{
1486 return 0x00000000;
1487}
1488static inline u32 sim_status_recv_get__init_f(void)
1489{
1490 return 0x0;
1491}
1492static inline u32 sim_status_recv_get_idle_v(void)
1493{
1494 return 0x00000000;
1495}
1496static inline u32 sim_status_recv_get_idle_f(void)
1497{
1498 return 0x0;
1499}
1500static inline u32 sim_status_recv_get_pending_v(void)
1501{
1502 return 0x00000001;
1503}
1504static inline u32 sim_status_recv_get_pending_f(void)
1505{
1506 return 0x8;
1507}
1508static inline u32 sim_status_event_put_s(void)
1509{
1510 return 1;
1511}
1512static inline u32 sim_status_event_put_f(u32 v)
1513{
1514 return (v & 0x1) << 4;
1515}
1516static inline u32 sim_status_event_put_m(void)
1517{
1518 return 0x1 << 4;
1519}
1520static inline u32 sim_status_event_put_v(u32 r)
1521{
1522 return (r >> 4) & 0x1;
1523}
1524static inline u32 sim_status_event_put__init_v(void)
1525{
1526 return 0x00000000;
1527}
1528static inline u32 sim_status_event_put__init_f(void)
1529{
1530 return 0x0;
1531}
1532static inline u32 sim_status_event_put_idle_v(void)
1533{
1534 return 0x00000000;
1535}
1536static inline u32 sim_status_event_put_idle_f(void)
1537{
1538 return 0x0;
1539}
1540static inline u32 sim_status_event_put_pending_v(void)
1541{
1542 return 0x00000001;
1543}
1544static inline u32 sim_status_event_put_pending_f(void)
1545{
1546 return 0x10;
1547}
1548static inline u32 sim_status_event_put_clear_v(void)
1549{
1550 return 0x00000001;
1551}
1552static inline u32 sim_status_event_put_clear_f(void)
1553{
1554 return 0x10;
1555}
1556static inline u32 sim_status_event_get_s(void)
1557{
1558 return 1;
1559}
1560static inline u32 sim_status_event_get_f(u32 v)
1561{
1562 return (v & 0x1) << 5;
1563}
1564static inline u32 sim_status_event_get_m(void)
1565{
1566 return 0x1 << 5;
1567}
1568static inline u32 sim_status_event_get_v(u32 r)
1569{
1570 return (r >> 5) & 0x1;
1571}
1572static inline u32 sim_status_event_get__init_v(void)
1573{
1574 return 0x00000000;
1575}
1576static inline u32 sim_status_event_get__init_f(void)
1577{
1578 return 0x0;
1579}
1580static inline u32 sim_status_event_get_idle_v(void)
1581{
1582 return 0x00000000;
1583}
1584static inline u32 sim_status_event_get_idle_f(void)
1585{
1586 return 0x0;
1587}
1588static inline u32 sim_status_event_get_pending_v(void)
1589{
1590 return 0x00000001;
1591}
1592static inline u32 sim_status_event_get_pending_f(void)
1593{
1594 return 0x20;
1595}
1596static inline u32 sim_control_r(void)
1597{
1598 return 0x0000002c;
1599}
1600static inline u32 sim_control_send_put_s(void)
1601{
1602 return 1;
1603}
1604static inline u32 sim_control_send_put_f(u32 v)
1605{
1606 return (v & 0x1) << 0;
1607}
1608static inline u32 sim_control_send_put_m(void)
1609{
1610 return 0x1 << 0;
1611}
1612static inline u32 sim_control_send_put_v(u32 r)
1613{
1614 return (r >> 0) & 0x1;
1615}
1616static inline u32 sim_control_send_put__init_v(void)
1617{
1618 return 0x00000000;
1619}
1620static inline u32 sim_control_send_put__init_f(void)
1621{
1622 return 0x0;
1623}
1624static inline u32 sim_control_send_put_disabled_v(void)
1625{
1626 return 0x00000000;
1627}
1628static inline u32 sim_control_send_put_disabled_f(void)
1629{
1630 return 0x0;
1631}
1632static inline u32 sim_control_send_put_enabled_v(void)
1633{
1634 return 0x00000001;
1635}
1636static inline u32 sim_control_send_put_enabled_f(void)
1637{
1638 return 0x1;
1639}
1640static inline u32 sim_control_send_get_s(void)
1641{
1642 return 1;
1643}
1644static inline u32 sim_control_send_get_f(u32 v)
1645{
1646 return (v & 0x1) << 1;
1647}
1648static inline u32 sim_control_send_get_m(void)
1649{
1650 return 0x1 << 1;
1651}
1652static inline u32 sim_control_send_get_v(u32 r)
1653{
1654 return (r >> 1) & 0x1;
1655}
1656static inline u32 sim_control_send_get__init_v(void)
1657{
1658 return 0x00000000;
1659}
1660static inline u32 sim_control_send_get__init_f(void)
1661{
1662 return 0x0;
1663}
1664static inline u32 sim_control_send_get_disabled_v(void)
1665{
1666 return 0x00000000;
1667}
1668static inline u32 sim_control_send_get_disabled_f(void)
1669{
1670 return 0x0;
1671}
1672static inline u32 sim_control_send_get_enabled_v(void)
1673{
1674 return 0x00000001;
1675}
1676static inline u32 sim_control_send_get_enabled_f(void)
1677{
1678 return 0x2;
1679}
1680static inline u32 sim_control_recv_put_s(void)
1681{
1682 return 1;
1683}
1684static inline u32 sim_control_recv_put_f(u32 v)
1685{
1686 return (v & 0x1) << 2;
1687}
1688static inline u32 sim_control_recv_put_m(void)
1689{
1690 return 0x1 << 2;
1691}
1692static inline u32 sim_control_recv_put_v(u32 r)
1693{
1694 return (r >> 2) & 0x1;
1695}
1696static inline u32 sim_control_recv_put__init_v(void)
1697{
1698 return 0x00000000;
1699}
1700static inline u32 sim_control_recv_put__init_f(void)
1701{
1702 return 0x0;
1703}
1704static inline u32 sim_control_recv_put_disabled_v(void)
1705{
1706 return 0x00000000;
1707}
1708static inline u32 sim_control_recv_put_disabled_f(void)
1709{
1710 return 0x0;
1711}
1712static inline u32 sim_control_recv_put_enabled_v(void)
1713{
1714 return 0x00000001;
1715}
1716static inline u32 sim_control_recv_put_enabled_f(void)
1717{
1718 return 0x4;
1719}
1720static inline u32 sim_control_recv_get_s(void)
1721{
1722 return 1;
1723}
1724static inline u32 sim_control_recv_get_f(u32 v)
1725{
1726 return (v & 0x1) << 3;
1727}
1728static inline u32 sim_control_recv_get_m(void)
1729{
1730 return 0x1 << 3;
1731}
1732static inline u32 sim_control_recv_get_v(u32 r)
1733{
1734 return (r >> 3) & 0x1;
1735}
1736static inline u32 sim_control_recv_get__init_v(void)
1737{
1738 return 0x00000000;
1739}
1740static inline u32 sim_control_recv_get__init_f(void)
1741{
1742 return 0x0;
1743}
1744static inline u32 sim_control_recv_get_disabled_v(void)
1745{
1746 return 0x00000000;
1747}
1748static inline u32 sim_control_recv_get_disabled_f(void)
1749{
1750 return 0x0;
1751}
1752static inline u32 sim_control_recv_get_enabled_v(void)
1753{
1754 return 0x00000001;
1755}
1756static inline u32 sim_control_recv_get_enabled_f(void)
1757{
1758 return 0x8;
1759}
1760static inline u32 sim_control_event_put_s(void)
1761{
1762 return 1;
1763}
1764static inline u32 sim_control_event_put_f(u32 v)
1765{
1766 return (v & 0x1) << 4;
1767}
1768static inline u32 sim_control_event_put_m(void)
1769{
1770 return 0x1 << 4;
1771}
1772static inline u32 sim_control_event_put_v(u32 r)
1773{
1774 return (r >> 4) & 0x1;
1775}
1776static inline u32 sim_control_event_put__init_v(void)
1777{
1778 return 0x00000000;
1779}
1780static inline u32 sim_control_event_put__init_f(void)
1781{
1782 return 0x0;
1783}
1784static inline u32 sim_control_event_put_disabled_v(void)
1785{
1786 return 0x00000000;
1787}
1788static inline u32 sim_control_event_put_disabled_f(void)
1789{
1790 return 0x0;
1791}
1792static inline u32 sim_control_event_put_enabled_v(void)
1793{
1794 return 0x00000001;
1795}
1796static inline u32 sim_control_event_put_enabled_f(void)
1797{
1798 return 0x10;
1799}
1800static inline u32 sim_control_event_get_s(void)
1801{
1802 return 1;
1803}
1804static inline u32 sim_control_event_get_f(u32 v)
1805{
1806 return (v & 0x1) << 5;
1807}
1808static inline u32 sim_control_event_get_m(void)
1809{
1810 return 0x1 << 5;
1811}
1812static inline u32 sim_control_event_get_v(u32 r)
1813{
1814 return (r >> 5) & 0x1;
1815}
1816static inline u32 sim_control_event_get__init_v(void)
1817{
1818 return 0x00000000;
1819}
1820static inline u32 sim_control_event_get__init_f(void)
1821{
1822 return 0x0;
1823}
1824static inline u32 sim_control_event_get_disabled_v(void)
1825{
1826 return 0x00000000;
1827}
1828static inline u32 sim_control_event_get_disabled_f(void)
1829{
1830 return 0x0;
1831}
1832static inline u32 sim_control_event_get_enabled_v(void)
1833{
1834 return 0x00000001;
1835}
1836static inline u32 sim_control_event_get_enabled_f(void)
1837{
1838 return 0x20;
1839}
1840static inline u32 sim_dma_r(void)
1841{
1842 return 0x00000000;
1843}
1844static inline u32 sim_dma_target_s(void)
1845{
1846 return 2;
1847}
1848static inline u32 sim_dma_target_f(u32 v)
1849{
1850 return (v & 0x3) << 0;
1851}
1852static inline u32 sim_dma_target_m(void)
1853{
1854 return 0x3 << 0;
1855}
1856static inline u32 sim_dma_target_v(u32 r)
1857{
1858 return (r >> 0) & 0x3;
1859}
1860static inline u32 sim_dma_target_phys_init_v(void)
1861{
1862 return 0x00000001;
1863}
1864static inline u32 sim_dma_target_phys_init_f(void)
1865{
1866 return 0x1;
1867}
1868static inline u32 sim_dma_target_phys__init_v(void)
1869{
1870 return 0x00000001;
1871}
1872static inline u32 sim_dma_target_phys__init_f(void)
1873{
1874 return 0x1;
1875}
1876static inline u32 sim_dma_target_phys__prod_v(void)
1877{
1878 return 0x00000001;
1879}
1880static inline u32 sim_dma_target_phys__prod_f(void)
1881{
1882 return 0x1;
1883}
1884static inline u32 sim_dma_target_phys_nvm_v(void)
1885{
1886 return 0x00000001;
1887}
1888static inline u32 sim_dma_target_phys_nvm_f(void)
1889{
1890 return 0x1;
1891}
1892static inline u32 sim_dma_target_phys_pci_v(void)
1893{
1894 return 0x00000002;
1895}
1896static inline u32 sim_dma_target_phys_pci_f(void)
1897{
1898 return 0x2;
1899}
1900static inline u32 sim_dma_target_phys_pci_coherent_v(void)
1901{
1902 return 0x00000003;
1903}
1904static inline u32 sim_dma_target_phys_pci_coherent_f(void)
1905{
1906 return 0x3;
1907}
1908static inline u32 sim_dma_status_s(void)
1909{
1910 return 1;
1911}
1912static inline u32 sim_dma_status_f(u32 v)
1913{
1914 return (v & 0x1) << 3;
1915}
1916static inline u32 sim_dma_status_m(void)
1917{
1918 return 0x1 << 3;
1919}
1920static inline u32 sim_dma_status_v(u32 r)
1921{
1922 return (r >> 3) & 0x1;
1923}
1924static inline u32 sim_dma_status_init_v(void)
1925{
1926 return 0x00000000;
1927}
1928static inline u32 sim_dma_status_init_f(void)
1929{
1930 return 0x0;
1931}
1932static inline u32 sim_dma_status__init_v(void)
1933{
1934 return 0x00000000;
1935}
1936static inline u32 sim_dma_status__init_f(void)
1937{
1938 return 0x0;
1939}
1940static inline u32 sim_dma_status__prod_v(void)
1941{
1942 return 0x00000000;
1943}
1944static inline u32 sim_dma_status__prod_f(void)
1945{
1946 return 0x0;
1947}
1948static inline u32 sim_dma_status_invalid_v(void)
1949{
1950 return 0x00000000;
1951}
1952static inline u32 sim_dma_status_invalid_f(void)
1953{
1954 return 0x0;
1955}
1956static inline u32 sim_dma_status_valid_v(void)
1957{
1958 return 0x00000001;
1959}
1960static inline u32 sim_dma_status_valid_f(void)
1961{
1962 return 0x8;
1963}
1964static inline u32 sim_dma_size_s(void)
1965{
1966 return 2;
1967}
1968static inline u32 sim_dma_size_f(u32 v)
1969{
1970 return (v & 0x3) << 4;
1971}
1972static inline u32 sim_dma_size_m(void)
1973{
1974 return 0x3 << 4;
1975}
1976static inline u32 sim_dma_size_v(u32 r)
1977{
1978 return (r >> 4) & 0x3;
1979}
1980static inline u32 sim_dma_size_init_v(void)
1981{
1982 return 0x00000000;
1983}
1984static inline u32 sim_dma_size_init_f(void)
1985{
1986 return 0x0;
1987}
1988static inline u32 sim_dma_size__init_v(void)
1989{
1990 return 0x00000000;
1991}
1992static inline u32 sim_dma_size__init_f(void)
1993{
1994 return 0x0;
1995}
1996static inline u32 sim_dma_size__prod_v(void)
1997{
1998 return 0x00000000;
1999}
2000static inline u32 sim_dma_size__prod_f(void)
2001{
2002 return 0x0;
2003}
2004static inline u32 sim_dma_size_4kb_v(void)
2005{
2006 return 0x00000000;
2007}
2008static inline u32 sim_dma_size_4kb_f(void)
2009{
2010 return 0x0;
2011}
2012static inline u32 sim_dma_size_8kb_v(void)
2013{
2014 return 0x00000001;
2015}
2016static inline u32 sim_dma_size_8kb_f(void)
2017{
2018 return 0x10;
2019}
2020static inline u32 sim_dma_size_12kb_v(void)
2021{
2022 return 0x00000002;
2023}
2024static inline u32 sim_dma_size_12kb_f(void)
2025{
2026 return 0x20;
2027}
2028static inline u32 sim_dma_size_16kb_v(void)
2029{
2030 return 0x00000003;
2031}
2032static inline u32 sim_dma_size_16kb_f(void)
2033{
2034 return 0x30;
2035}
2036static inline u32 sim_dma_addr_lo_s(void)
2037{
2038 return 20;
2039}
2040static inline u32 sim_dma_addr_lo_f(u32 v)
2041{
2042 return (v & 0xfffff) << 12;
2043}
2044static inline u32 sim_dma_addr_lo_m(void)
2045{
2046 return 0xfffff << 12;
2047}
2048static inline u32 sim_dma_addr_lo_v(u32 r)
2049{
2050 return (r >> 12) & 0xfffff;
2051}
2052static inline u32 sim_dma_addr_lo__init_v(void)
2053{
2054 return 0x00000000;
2055}
2056static inline u32 sim_dma_addr_lo__init_f(void)
2057{
2058 return 0x0;
2059}
2060static inline u32 sim_dma_addr_lo__prod_v(void)
2061{
2062 return 0x00000000;
2063}
2064static inline u32 sim_dma_addr_lo__prod_f(void)
2065{
2066 return 0x0;
2067}
2068static inline u32 sim_dma_hi_r(void)
2069{
2070 return 0x00000004;
2071}
2072static inline u32 sim_dma_hi_addr_s(void)
2073{
2074 return 20;
2075}
2076static inline u32 sim_dma_hi_addr_f(u32 v)
2077{
2078 return (v & 0xfffff) << 0;
2079}
2080static inline u32 sim_dma_hi_addr_m(void)
2081{
2082 return 0xfffff << 0;
2083}
2084static inline u32 sim_dma_hi_addr_v(u32 r)
2085{
2086 return (r >> 0) & 0xfffff;
2087}
2088static inline u32 sim_dma_hi_addr__init_v(void)
2089{
2090 return 0x00000000;
2091}
2092static inline u32 sim_dma_hi_addr__init_f(void)
2093{
2094 return 0x0;
2095}
2096static inline u32 sim_dma_hi_addr__prod_v(void)
2097{
2098 return 0x00000000;
2099}
2100static inline u32 sim_dma_hi_addr__prod_f(void)
2101{
2102 return 0x0;
2103}
2104static inline u32 sim_msg_signature_r(void)
2105{
2106 return 0x00000000;
2107}
2108static inline u32 sim_msg_signature_valid_v(void)
2109{
2110 return 0x43505256;
2111}
2112static inline u32 sim_msg_length_r(void)
2113{
2114 return 0x00000004;
2115}
2116static inline u32 sim_msg_function_r(void)
2117{
2118 return 0x00000008;
2119}
2120static inline u32 sim_msg_function_sim_escape_read_v(void)
2121{
2122 return 0x00000023;
2123}
2124static inline u32 sim_msg_function_sim_escape_write_v(void)
2125{
2126 return 0x00000024;
2127}
2128static inline u32 sim_msg_result_r(void)
2129{
2130 return 0x0000000c;
2131}
2132static inline u32 sim_msg_result_success_v(void)
2133{
2134 return 0x00000000;
2135}
2136static inline u32 sim_msg_result_rpc_pending_v(void)
2137{
2138 return 0xFFFFFFFF;
2139}
2140static inline u32 sim_msg_sequence_r(void)
2141{
2142 return 0x00000010;
2143}
2144static inline u32 sim_msg_spare_r(void)
2145{
2146 return 0x00000014;
2147}
2148static inline u32 sim_msg_spare__init_v(void)
2149{
2150 return 0x00000000;
2151}
2152
2153#endif /* __hw_sim_gk20a_h__ */
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_therm_gk20a.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_therm_gk20a.h
new file mode 100644
index 00000000..075c9bcc
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_therm_gk20a.h
@@ -0,0 +1,367 @@
1/*
2 * Copyright (c) 2012-2017, 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_therm_gk20a_h_
57#define _hw_therm_gk20a_h_
58
59static inline u32 therm_use_a_r(void)
60{
61 return 0x00020798U;
62}
63static inline u32 therm_use_a_ext_therm_0_enable_f(void)
64{
65 return 0x1U;
66}
67static inline u32 therm_use_a_ext_therm_1_enable_f(void)
68{
69 return 0x2U;
70}
71static inline u32 therm_use_a_ext_therm_2_enable_f(void)
72{
73 return 0x4U;
74}
75static inline u32 therm_evt_ext_therm_0_r(void)
76{
77 return 0x00020700U;
78}
79static inline u32 therm_evt_ext_therm_0_slow_factor_f(u32 v)
80{
81 return (v & 0x3fU) << 8U;
82}
83static inline u32 therm_evt_ext_therm_0_slow_factor_init_v(void)
84{
85 return 0x00000000U;
86}
87static inline u32 therm_evt_ext_therm_0_priority_f(u32 v)
88{
89 return (v & 0x1fU) << 24U;
90}
91static inline u32 therm_evt_ext_therm_1_r(void)
92{
93 return 0x00020704U;
94}
95static inline u32 therm_evt_ext_therm_1_slow_factor_f(u32 v)
96{
97 return (v & 0x3fU) << 8U;
98}
99static inline u32 therm_evt_ext_therm_1_slow_factor_init_v(void)
100{
101 return 0x00000000U;
102}
103static inline u32 therm_evt_ext_therm_1_priority_f(u32 v)
104{
105 return (v & 0x1fU) << 24U;
106}
107static inline u32 therm_evt_ext_therm_2_r(void)
108{
109 return 0x00020708U;
110}
111static inline u32 therm_evt_ext_therm_2_slow_factor_f(u32 v)
112{
113 return (v & 0x3fU) << 8U;
114}
115static inline u32 therm_evt_ext_therm_2_slow_factor_init_v(void)
116{
117 return 0x00000000U;
118}
119static inline u32 therm_evt_ext_therm_2_priority_f(u32 v)
120{
121 return (v & 0x1fU) << 24U;
122}
123static inline u32 therm_weight_1_r(void)
124{
125 return 0x00020024U;
126}
127static inline u32 therm_config1_r(void)
128{
129 return 0x00020050U;
130}
131static inline u32 therm_config2_r(void)
132{
133 return 0x00020130U;
134}
135static inline u32 therm_config2_slowdown_factor_extended_f(u32 v)
136{
137 return (v & 0x1U) << 24U;
138}
139static inline u32 therm_config2_grad_enable_f(u32 v)
140{
141 return (v & 0x1U) << 31U;
142}
143static inline u32 therm_gate_ctrl_r(u32 i)
144{
145 return 0x00020200U + i*4U;
146}
147static inline u32 therm_gate_ctrl_eng_clk_m(void)
148{
149 return 0x3U << 0U;
150}
151static inline u32 therm_gate_ctrl_eng_clk_run_f(void)
152{
153 return 0x0U;
154}
155static inline u32 therm_gate_ctrl_eng_clk_auto_f(void)
156{
157 return 0x1U;
158}
159static inline u32 therm_gate_ctrl_eng_clk_stop_f(void)
160{
161 return 0x2U;
162}
163static inline u32 therm_gate_ctrl_blk_clk_m(void)
164{
165 return 0x3U << 2U;
166}
167static inline u32 therm_gate_ctrl_blk_clk_run_f(void)
168{
169 return 0x0U;
170}
171static inline u32 therm_gate_ctrl_blk_clk_auto_f(void)
172{
173 return 0x4U;
174}
175static inline u32 therm_gate_ctrl_eng_pwr_m(void)
176{
177 return 0x3U << 4U;
178}
179static inline u32 therm_gate_ctrl_eng_pwr_auto_f(void)
180{
181 return 0x10U;
182}
183static inline u32 therm_gate_ctrl_eng_pwr_off_v(void)
184{
185 return 0x00000002U;
186}
187static inline u32 therm_gate_ctrl_eng_pwr_off_f(void)
188{
189 return 0x20U;
190}
191static inline u32 therm_gate_ctrl_eng_idle_filt_exp_f(u32 v)
192{
193 return (v & 0x1fU) << 8U;
194}
195static inline u32 therm_gate_ctrl_eng_idle_filt_exp_m(void)
196{
197 return 0x1fU << 8U;
198}
199static inline u32 therm_gate_ctrl_eng_idle_filt_mant_f(u32 v)
200{
201 return (v & 0x7U) << 13U;
202}
203static inline u32 therm_gate_ctrl_eng_idle_filt_mant_m(void)
204{
205 return 0x7U << 13U;
206}
207static inline u32 therm_gate_ctrl_eng_delay_before_f(u32 v)
208{
209 return (v & 0xfU) << 16U;
210}
211static inline u32 therm_gate_ctrl_eng_delay_before_m(void)
212{
213 return 0xfU << 16U;
214}
215static inline u32 therm_gate_ctrl_eng_delay_after_f(u32 v)
216{
217 return (v & 0xfU) << 20U;
218}
219static inline u32 therm_gate_ctrl_eng_delay_after_m(void)
220{
221 return 0xfU << 20U;
222}
223static inline u32 therm_fecs_idle_filter_r(void)
224{
225 return 0x00020288U;
226}
227static inline u32 therm_fecs_idle_filter_value_m(void)
228{
229 return 0xffffffffU << 0U;
230}
231static inline u32 therm_hubmmu_idle_filter_r(void)
232{
233 return 0x0002028cU;
234}
235static inline u32 therm_hubmmu_idle_filter_value_m(void)
236{
237 return 0xffffffffU << 0U;
238}
239static inline u32 therm_clk_slowdown_r(u32 i)
240{
241 return 0x00020160U + i*4U;
242}
243static inline u32 therm_clk_slowdown_idle_factor_f(u32 v)
244{
245 return (v & 0x3fU) << 16U;
246}
247static inline u32 therm_clk_slowdown_idle_factor_m(void)
248{
249 return 0x3fU << 16U;
250}
251static inline u32 therm_clk_slowdown_idle_factor_v(u32 r)
252{
253 return (r >> 16U) & 0x3fU;
254}
255static inline u32 therm_clk_slowdown_idle_factor_disabled_f(void)
256{
257 return 0x0U;
258}
259static inline u32 therm_grad_stepping_table_r(u32 i)
260{
261 return 0x000202c8U + i*4U;
262}
263static inline u32 therm_grad_stepping_table_slowdown_factor0_f(u32 v)
264{
265 return (v & 0x3fU) << 0U;
266}
267static inline u32 therm_grad_stepping_table_slowdown_factor0_m(void)
268{
269 return 0x3fU << 0U;
270}
271static inline u32 therm_grad_stepping_table_slowdown_factor0_fpdiv_by1p5_f(void)
272{
273 return 0x1U;
274}
275static inline u32 therm_grad_stepping_table_slowdown_factor0_fpdiv_by2_f(void)
276{
277 return 0x2U;
278}
279static inline u32 therm_grad_stepping_table_slowdown_factor0_fpdiv_by4_f(void)
280{
281 return 0x6U;
282}
283static inline u32 therm_grad_stepping_table_slowdown_factor0_fpdiv_by8_f(void)
284{
285 return 0xeU;
286}
287static inline u32 therm_grad_stepping_table_slowdown_factor1_f(u32 v)
288{
289 return (v & 0x3fU) << 6U;
290}
291static inline u32 therm_grad_stepping_table_slowdown_factor1_m(void)
292{
293 return 0x3fU << 6U;
294}
295static inline u32 therm_grad_stepping_table_slowdown_factor2_f(u32 v)
296{
297 return (v & 0x3fU) << 12U;
298}
299static inline u32 therm_grad_stepping_table_slowdown_factor2_m(void)
300{
301 return 0x3fU << 12U;
302}
303static inline u32 therm_grad_stepping_table_slowdown_factor3_f(u32 v)
304{
305 return (v & 0x3fU) << 18U;
306}
307static inline u32 therm_grad_stepping_table_slowdown_factor3_m(void)
308{
309 return 0x3fU << 18U;
310}
311static inline u32 therm_grad_stepping_table_slowdown_factor4_f(u32 v)
312{
313 return (v & 0x3fU) << 24U;
314}
315static inline u32 therm_grad_stepping_table_slowdown_factor4_m(void)
316{
317 return 0x3fU << 24U;
318}
319static inline u32 therm_grad_stepping0_r(void)
320{
321 return 0x000202c0U;
322}
323static inline u32 therm_grad_stepping0_feature_s(void)
324{
325 return 1U;
326}
327static inline u32 therm_grad_stepping0_feature_f(u32 v)
328{
329 return (v & 0x1U) << 0U;
330}
331static inline u32 therm_grad_stepping0_feature_m(void)
332{
333 return 0x1U << 0U;
334}
335static inline u32 therm_grad_stepping0_feature_v(u32 r)
336{
337 return (r >> 0U) & 0x1U;
338}
339static inline u32 therm_grad_stepping0_feature_enable_f(void)
340{
341 return 0x1U;
342}
343static inline u32 therm_grad_stepping1_r(void)
344{
345 return 0x000202c4U;
346}
347static inline u32 therm_grad_stepping1_pdiv_duration_f(u32 v)
348{
349 return (v & 0x1ffffU) << 0U;
350}
351static inline u32 therm_clk_timing_r(u32 i)
352{
353 return 0x000203c0U + i*4U;
354}
355static inline u32 therm_clk_timing_grad_slowdown_f(u32 v)
356{
357 return (v & 0x1U) << 16U;
358}
359static inline u32 therm_clk_timing_grad_slowdown_m(void)
360{
361 return 0x1U << 16U;
362}
363static inline u32 therm_clk_timing_grad_slowdown_enabled_f(void)
364{
365 return 0x10000U;
366}
367#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_timer_gk20a.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_timer_gk20a.h
new file mode 100644
index 00000000..f0dbfc30
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_timer_gk20a.h
@@ -0,0 +1,127 @@
1/*
2 * Copyright (c) 2013-2017, 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_timer_gk20a_h_
57#define _hw_timer_gk20a_h_
58
59static inline u32 timer_pri_timeout_r(void)
60{
61 return 0x00009080U;
62}
63static inline u32 timer_pri_timeout_period_f(u32 v)
64{
65 return (v & 0xffffffU) << 0U;
66}
67static inline u32 timer_pri_timeout_period_m(void)
68{
69 return 0xffffffU << 0U;
70}
71static inline u32 timer_pri_timeout_period_v(u32 r)
72{
73 return (r >> 0U) & 0xffffffU;
74}
75static inline u32 timer_pri_timeout_en_f(u32 v)
76{
77 return (v & 0x1U) << 31U;
78}
79static inline u32 timer_pri_timeout_en_m(void)
80{
81 return 0x1U << 31U;
82}
83static inline u32 timer_pri_timeout_en_v(u32 r)
84{
85 return (r >> 31U) & 0x1U;
86}
87static inline u32 timer_pri_timeout_en_en_enabled_f(void)
88{
89 return 0x80000000U;
90}
91static inline u32 timer_pri_timeout_en_en_disabled_f(void)
92{
93 return 0x0U;
94}
95static inline u32 timer_pri_timeout_save_0_r(void)
96{
97 return 0x00009084U;
98}
99static inline u32 timer_pri_timeout_save_0_fecs_tgt_v(u32 r)
100{
101 return (r >> 31) & 0x1;
102}
103static inline u32 timer_pri_timeout_save_0_addr_v(u32 r)
104{
105 return (r >> 2) & 0x3fffff;
106}
107static inline u32 timer_pri_timeout_save_0_write_v(u32 r)
108{
109 return (r >> 1) & 0x1;
110}
111static inline u32 timer_pri_timeout_save_1_r(void)
112{
113 return 0x00009088U;
114}
115static inline u32 timer_pri_timeout_fecs_errcode_r(void)
116{
117 return 0x0000908cU;
118}
119static inline u32 timer_time_0_r(void)
120{
121 return 0x00009400U;
122}
123static inline u32 timer_time_1_r(void)
124{
125 return 0x00009410U;
126}
127#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_top_gk20a.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_top_gk20a.h
new file mode 100644
index 00000000..be7fa4a6
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_top_gk20a.h
@@ -0,0 +1,211 @@
1/*
2 * Copyright (c) 2012-2017, 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_top_gk20a_h_
57#define _hw_top_gk20a_h_
58
59static inline u32 top_num_gpcs_r(void)
60{
61 return 0x00022430U;
62}
63static inline u32 top_num_gpcs_value_v(u32 r)
64{
65 return (r >> 0U) & 0x1fU;
66}
67static inline u32 top_tpc_per_gpc_r(void)
68{
69 return 0x00022434U;
70}
71static inline u32 top_tpc_per_gpc_value_v(u32 r)
72{
73 return (r >> 0U) & 0x1fU;
74}
75static inline u32 top_num_fbps_r(void)
76{
77 return 0x00022438U;
78}
79static inline u32 top_num_fbps_value_v(u32 r)
80{
81 return (r >> 0U) & 0x1fU;
82}
83static inline u32 top_device_info_r(u32 i)
84{
85 return 0x00022700U + i*4U;
86}
87static inline u32 top_device_info__size_1_v(void)
88{
89 return 0x00000040U;
90}
91static inline u32 top_device_info_chain_v(u32 r)
92{
93 return (r >> 31U) & 0x1U;
94}
95static inline u32 top_device_info_chain_enable_v(void)
96{
97 return 0x00000001U;
98}
99static inline u32 top_device_info_engine_enum_v(u32 r)
100{
101 return (r >> 26U) & 0xfU;
102}
103static inline u32 top_device_info_runlist_enum_v(u32 r)
104{
105 return (r >> 21U) & 0xfU;
106}
107static inline u32 top_device_info_intr_enum_v(u32 r)
108{
109 return (r >> 15U) & 0x1fU;
110}
111static inline u32 top_device_info_reset_enum_v(u32 r)
112{
113 return (r >> 9U) & 0x1fU;
114}
115static inline u32 top_device_info_type_enum_v(u32 r)
116{
117 return (r >> 2U) & 0x1fffffffU;
118}
119static inline u32 top_device_info_type_enum_graphics_v(void)
120{
121 return 0x00000000U;
122}
123static inline u32 top_device_info_type_enum_graphics_f(void)
124{
125 return 0x0U;
126}
127static inline u32 top_device_info_type_enum_copy0_v(void)
128{
129 return 0x00000001U;
130}
131static inline u32 top_device_info_type_enum_copy0_f(void)
132{
133 return 0x4U;
134}
135static inline u32 top_device_info_type_enum_copy1_v(void)
136{
137 return 0x00000002U;
138}
139static inline u32 top_device_info_type_enum_copy1_f(void)
140{
141 return 0x8U;
142}
143static inline u32 top_device_info_type_enum_copy2_v(void)
144{
145 return 0x00000003U;
146}
147static inline u32 top_device_info_type_enum_copy2_f(void)
148{
149 return 0xcU;
150}
151static inline u32 top_device_info_engine_v(u32 r)
152{
153 return (r >> 5U) & 0x1U;
154}
155static inline u32 top_device_info_runlist_v(u32 r)
156{
157 return (r >> 4U) & 0x1U;
158}
159static inline u32 top_device_info_intr_v(u32 r)
160{
161 return (r >> 3U) & 0x1U;
162}
163static inline u32 top_device_info_reset_v(u32 r)
164{
165 return (r >> 2U) & 0x1U;
166}
167static inline u32 top_device_info_entry_v(u32 r)
168{
169 return (r >> 0U) & 0x3U;
170}
171static inline u32 top_device_info_entry_not_valid_v(void)
172{
173 return 0x00000000U;
174}
175static inline u32 top_device_info_entry_enum_v(void)
176{
177 return 0x00000002U;
178}
179static inline u32 top_device_info_entry_engine_type_v(void)
180{
181 return 0x00000003U;
182}
183static inline u32 top_device_info_entry_data_v(void)
184{
185 return 0x00000001U;
186}
187static inline u32 top_fs_status_fbp_r(void)
188{
189 return 0x00022548U;
190}
191static inline u32 top_fs_status_fbp_cluster_v(u32 r)
192{
193 return (r >> 0U) & 0xffffU;
194}
195static inline u32 top_fs_status_fbp_cluster_enable_v(void)
196{
197 return 0x00000000U;
198}
199static inline u32 top_fs_status_fbp_cluster_enable_f(void)
200{
201 return 0x0U;
202}
203static inline u32 top_fs_status_fbp_cluster_disable_v(void)
204{
205 return 0x00000001U;
206}
207static inline u32 top_fs_status_fbp_cluster_disable_f(void)
208{
209 return 0x1U;
210}
211#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_trim_gk20a.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_trim_gk20a.h
new file mode 100644
index 00000000..f28c21f1
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_trim_gk20a.h
@@ -0,0 +1,315 @@
1/*
2 * Copyright (c) 2012-2017, 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_trim_gk20a_h_
57#define _hw_trim_gk20a_h_
58
59static inline u32 trim_sys_gpcpll_cfg_r(void)
60{
61 return 0x00137000U;
62}
63static inline u32 trim_sys_gpcpll_cfg_enable_m(void)
64{
65 return 0x1U << 0U;
66}
67static inline u32 trim_sys_gpcpll_cfg_enable_v(u32 r)
68{
69 return (r >> 0U) & 0x1U;
70}
71static inline u32 trim_sys_gpcpll_cfg_enable_no_f(void)
72{
73 return 0x0U;
74}
75static inline u32 trim_sys_gpcpll_cfg_enable_yes_f(void)
76{
77 return 0x1U;
78}
79static inline u32 trim_sys_gpcpll_cfg_iddq_m(void)
80{
81 return 0x1U << 1U;
82}
83static inline u32 trim_sys_gpcpll_cfg_iddq_v(u32 r)
84{
85 return (r >> 1U) & 0x1U;
86}
87static inline u32 trim_sys_gpcpll_cfg_iddq_power_on_v(void)
88{
89 return 0x00000000U;
90}
91static inline u32 trim_sys_gpcpll_cfg_enb_lckdet_m(void)
92{
93 return 0x1U << 4U;
94}
95static inline u32 trim_sys_gpcpll_cfg_enb_lckdet_power_on_f(void)
96{
97 return 0x0U;
98}
99static inline u32 trim_sys_gpcpll_cfg_enb_lckdet_power_off_f(void)
100{
101 return 0x10U;
102}
103static inline u32 trim_sys_gpcpll_cfg_pll_lock_v(u32 r)
104{
105 return (r >> 17U) & 0x1U;
106}
107static inline u32 trim_sys_gpcpll_cfg_pll_lock_true_f(void)
108{
109 return 0x20000U;
110}
111static inline u32 trim_sys_gpcpll_coeff_r(void)
112{
113 return 0x00137004U;
114}
115static inline u32 trim_sys_gpcpll_coeff_mdiv_f(u32 v)
116{
117 return (v & 0xffU) << 0U;
118}
119static inline u32 trim_sys_gpcpll_coeff_mdiv_m(void)
120{
121 return 0xffU << 0U;
122}
123static inline u32 trim_sys_gpcpll_coeff_mdiv_v(u32 r)
124{
125 return (r >> 0U) & 0xffU;
126}
127static inline u32 trim_sys_gpcpll_coeff_ndiv_f(u32 v)
128{
129 return (v & 0xffU) << 8U;
130}
131static inline u32 trim_sys_gpcpll_coeff_ndiv_m(void)
132{
133 return 0xffU << 8U;
134}
135static inline u32 trim_sys_gpcpll_coeff_ndiv_v(u32 r)
136{
137 return (r >> 8U) & 0xffU;
138}
139static inline u32 trim_sys_gpcpll_coeff_pldiv_f(u32 v)
140{
141 return (v & 0x3fU) << 16U;
142}
143static inline u32 trim_sys_gpcpll_coeff_pldiv_m(void)
144{
145 return 0x3fU << 16U;
146}
147static inline u32 trim_sys_gpcpll_coeff_pldiv_v(u32 r)
148{
149 return (r >> 16U) & 0x3fU;
150}
151static inline u32 trim_sys_sel_vco_r(void)
152{
153 return 0x00137100U;
154}
155static inline u32 trim_sys_sel_vco_gpc2clk_out_m(void)
156{
157 return 0x1U << 0U;
158}
159static inline u32 trim_sys_sel_vco_gpc2clk_out_init_v(void)
160{
161 return 0x00000000U;
162}
163static inline u32 trim_sys_sel_vco_gpc2clk_out_init_f(void)
164{
165 return 0x0U;
166}
167static inline u32 trim_sys_sel_vco_gpc2clk_out_bypass_f(void)
168{
169 return 0x0U;
170}
171static inline u32 trim_sys_sel_vco_gpc2clk_out_vco_f(void)
172{
173 return 0x1U;
174}
175static inline u32 trim_sys_gpc2clk_out_r(void)
176{
177 return 0x00137250U;
178}
179static inline u32 trim_sys_gpc2clk_out_bypdiv_s(void)
180{
181 return 6U;
182}
183static inline u32 trim_sys_gpc2clk_out_bypdiv_f(u32 v)
184{
185 return (v & 0x3fU) << 0U;
186}
187static inline u32 trim_sys_gpc2clk_out_bypdiv_m(void)
188{
189 return 0x3fU << 0U;
190}
191static inline u32 trim_sys_gpc2clk_out_bypdiv_v(u32 r)
192{
193 return (r >> 0U) & 0x3fU;
194}
195static inline u32 trim_sys_gpc2clk_out_bypdiv_by31_f(void)
196{
197 return 0x3cU;
198}
199static inline u32 trim_sys_gpc2clk_out_vcodiv_s(void)
200{
201 return 6U;
202}
203static inline u32 trim_sys_gpc2clk_out_vcodiv_f(u32 v)
204{
205 return (v & 0x3fU) << 8U;
206}
207static inline u32 trim_sys_gpc2clk_out_vcodiv_m(void)
208{
209 return 0x3fU << 8U;
210}
211static inline u32 trim_sys_gpc2clk_out_vcodiv_v(u32 r)
212{
213 return (r >> 8U) & 0x3fU;
214}
215static inline u32 trim_sys_gpc2clk_out_vcodiv_by1_f(void)
216{
217 return 0x0U;
218}
219static inline u32 trim_sys_gpc2clk_out_sdiv14_m(void)
220{
221 return 0x1U << 31U;
222}
223static inline u32 trim_sys_gpc2clk_out_sdiv14_indiv4_mode_f(void)
224{
225 return 0x80000000U;
226}
227static inline u32 trim_gpc_clk_cntr_ncgpcclk_cfg_r(u32 i)
228{
229 return 0x00134124U + i*512U;
230}
231static inline u32 trim_gpc_clk_cntr_ncgpcclk_cfg_noofipclks_f(u32 v)
232{
233 return (v & 0x3fffU) << 0U;
234}
235static inline u32 trim_gpc_clk_cntr_ncgpcclk_cfg_write_en_asserted_f(void)
236{
237 return 0x10000U;
238}
239static inline u32 trim_gpc_clk_cntr_ncgpcclk_cfg_enable_asserted_f(void)
240{
241 return 0x100000U;
242}
243static inline u32 trim_gpc_clk_cntr_ncgpcclk_cfg_reset_asserted_f(void)
244{
245 return 0x1000000U;
246}
247static inline u32 trim_gpc_clk_cntr_ncgpcclk_cnt_r(u32 i)
248{
249 return 0x00134128U + i*512U;
250}
251static inline u32 trim_gpc_clk_cntr_ncgpcclk_cnt_value_v(u32 r)
252{
253 return (r >> 0U) & 0xfffffU;
254}
255static inline u32 trim_sys_gpcpll_cfg2_r(void)
256{
257 return 0x0013700cU;
258}
259static inline u32 trim_sys_gpcpll_cfg2_pll_stepa_f(u32 v)
260{
261 return (v & 0xffU) << 24U;
262}
263static inline u32 trim_sys_gpcpll_cfg2_pll_stepa_m(void)
264{
265 return 0xffU << 24U;
266}
267static inline u32 trim_sys_gpcpll_cfg3_r(void)
268{
269 return 0x00137018U;
270}
271static inline u32 trim_sys_gpcpll_cfg3_pll_stepb_f(u32 v)
272{
273 return (v & 0xffU) << 16U;
274}
275static inline u32 trim_sys_gpcpll_cfg3_pll_stepb_m(void)
276{
277 return 0xffU << 16U;
278}
279static inline u32 trim_sys_gpcpll_ndiv_slowdown_r(void)
280{
281 return 0x0013701cU;
282}
283static inline u32 trim_sys_gpcpll_ndiv_slowdown_slowdown_using_pll_m(void)
284{
285 return 0x1U << 22U;
286}
287static inline u32 trim_sys_gpcpll_ndiv_slowdown_slowdown_using_pll_yes_f(void)
288{
289 return 0x400000U;
290}
291static inline u32 trim_sys_gpcpll_ndiv_slowdown_slowdown_using_pll_no_f(void)
292{
293 return 0x0U;
294}
295static inline u32 trim_sys_gpcpll_ndiv_slowdown_en_dynramp_m(void)
296{
297 return 0x1U << 31U;
298}
299static inline u32 trim_sys_gpcpll_ndiv_slowdown_en_dynramp_yes_f(void)
300{
301 return 0x80000000U;
302}
303static inline u32 trim_sys_gpcpll_ndiv_slowdown_en_dynramp_no_f(void)
304{
305 return 0x0U;
306}
307static inline u32 trim_gpc_bcast_gpcpll_ndiv_slowdown_debug_r(void)
308{
309 return 0x001328a0U;
310}
311static inline u32 trim_gpc_bcast_gpcpll_ndiv_slowdown_debug_pll_dynramp_done_synced_v(u32 r)
312{
313 return (r >> 24U) & 0x1U;
314}
315#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_bus_gm20b.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_bus_gm20b.h
new file mode 100644
index 00000000..15cddae2
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_bus_gm20b.h
@@ -0,0 +1,223 @@
1/*
2 * Copyright (c) 2014-2017, 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_bus_gm20b_h_
57#define _hw_bus_gm20b_h_
58
59static inline u32 bus_bar0_window_r(void)
60{
61 return 0x00001700U;
62}
63static inline u32 bus_bar0_window_base_f(u32 v)
64{
65 return (v & 0xffffffU) << 0U;
66}
67static inline u32 bus_bar0_window_target_vid_mem_f(void)
68{
69 return 0x0U;
70}
71static inline u32 bus_bar0_window_target_sys_mem_coherent_f(void)
72{
73 return 0x2000000U;
74}
75static inline u32 bus_bar0_window_target_sys_mem_noncoherent_f(void)
76{
77 return 0x3000000U;
78}
79static inline u32 bus_bar0_window_target_bar0_window_base_shift_v(void)
80{
81 return 0x00000010U;
82}
83static inline u32 bus_bar1_block_r(void)
84{
85 return 0x00001704U;
86}
87static inline u32 bus_bar1_block_ptr_f(u32 v)
88{
89 return (v & 0xfffffffU) << 0U;
90}
91static inline u32 bus_bar1_block_target_vid_mem_f(void)
92{
93 return 0x0U;
94}
95static inline u32 bus_bar1_block_target_sys_mem_coh_f(void)
96{
97 return 0x20000000U;
98}
99static inline u32 bus_bar1_block_target_sys_mem_ncoh_f(void)
100{
101 return 0x30000000U;
102}
103static inline u32 bus_bar1_block_mode_virtual_f(void)
104{
105 return 0x80000000U;
106}
107static inline u32 bus_bar2_block_r(void)
108{
109 return 0x00001714U;
110}
111static inline u32 bus_bar2_block_ptr_f(u32 v)
112{
113 return (v & 0xfffffffU) << 0U;
114}
115static inline u32 bus_bar2_block_target_vid_mem_f(void)
116{
117 return 0x0U;
118}
119static inline u32 bus_bar2_block_target_sys_mem_coh_f(void)
120{
121 return 0x20000000U;
122}
123static inline u32 bus_bar2_block_target_sys_mem_ncoh_f(void)
124{
125 return 0x30000000U;
126}
127static inline u32 bus_bar2_block_mode_virtual_f(void)
128{
129 return 0x80000000U;
130}
131static inline u32 bus_bar1_block_ptr_shift_v(void)
132{
133 return 0x0000000cU;
134}
135static inline u32 bus_bar2_block_ptr_shift_v(void)
136{
137 return 0x0000000cU;
138}
139static inline u32 bus_bind_status_r(void)
140{
141 return 0x00001710U;
142}
143static inline u32 bus_bind_status_bar1_pending_v(u32 r)
144{
145 return (r >> 0U) & 0x1U;
146}
147static inline u32 bus_bind_status_bar1_pending_empty_f(void)
148{
149 return 0x0U;
150}
151static inline u32 bus_bind_status_bar1_pending_busy_f(void)
152{
153 return 0x1U;
154}
155static inline u32 bus_bind_status_bar1_outstanding_v(u32 r)
156{
157 return (r >> 1U) & 0x1U;
158}
159static inline u32 bus_bind_status_bar1_outstanding_false_f(void)
160{
161 return 0x0U;
162}
163static inline u32 bus_bind_status_bar1_outstanding_true_f(void)
164{
165 return 0x2U;
166}
167static inline u32 bus_bind_status_bar2_pending_v(u32 r)
168{
169 return (r >> 2U) & 0x1U;
170}
171static inline u32 bus_bind_status_bar2_pending_empty_f(void)
172{
173 return 0x0U;
174}
175static inline u32 bus_bind_status_bar2_pending_busy_f(void)
176{
177 return 0x4U;
178}
179static inline u32 bus_bind_status_bar2_outstanding_v(u32 r)
180{
181 return (r >> 3U) & 0x1U;
182}
183static inline u32 bus_bind_status_bar2_outstanding_false_f(void)
184{
185 return 0x0U;
186}
187static inline u32 bus_bind_status_bar2_outstanding_true_f(void)
188{
189 return 0x8U;
190}
191static inline u32 bus_intr_0_r(void)
192{
193 return 0x00001100U;
194}
195static inline u32 bus_intr_0_pri_squash_m(void)
196{
197 return 0x1U << 1U;
198}
199static inline u32 bus_intr_0_pri_fecserr_m(void)
200{
201 return 0x1U << 2U;
202}
203static inline u32 bus_intr_0_pri_timeout_m(void)
204{
205 return 0x1U << 3U;
206}
207static inline u32 bus_intr_en_0_r(void)
208{
209 return 0x00001140U;
210}
211static inline u32 bus_intr_en_0_pri_squash_m(void)
212{
213 return 0x1U << 1U;
214}
215static inline u32 bus_intr_en_0_pri_fecserr_m(void)
216{
217 return 0x1U << 2U;
218}
219static inline u32 bus_intr_en_0_pri_timeout_m(void)
220{
221 return 0x1U << 3U;
222}
223#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_ccsr_gm20b.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_ccsr_gm20b.h
new file mode 100644
index 00000000..adfce723
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_ccsr_gm20b.h
@@ -0,0 +1,163 @@
1/*
2 * Copyright (c) 2014-2017, 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_ccsr_gm20b_h_
57#define _hw_ccsr_gm20b_h_
58
59static inline u32 ccsr_channel_inst_r(u32 i)
60{
61 return 0x00800000U + i*8U;
62}
63static inline u32 ccsr_channel_inst__size_1_v(void)
64{
65 return 0x00000200U;
66}
67static inline u32 ccsr_channel_inst_ptr_f(u32 v)
68{
69 return (v & 0xfffffffU) << 0U;
70}
71static inline u32 ccsr_channel_inst_target_vid_mem_f(void)
72{
73 return 0x0U;
74}
75static inline u32 ccsr_channel_inst_target_sys_mem_coh_f(void)
76{
77 return 0x20000000U;
78}
79static inline u32 ccsr_channel_inst_target_sys_mem_ncoh_f(void)
80{
81 return 0x30000000U;
82}
83static inline u32 ccsr_channel_inst_bind_false_f(void)
84{
85 return 0x0U;
86}
87static inline u32 ccsr_channel_inst_bind_true_f(void)
88{
89 return 0x80000000U;
90}
91static inline u32 ccsr_channel_r(u32 i)
92{
93 return 0x00800004U + i*8U;
94}
95static inline u32 ccsr_channel__size_1_v(void)
96{
97 return 0x00000200U;
98}
99static inline u32 ccsr_channel_enable_v(u32 r)
100{
101 return (r >> 0U) & 0x1U;
102}
103static inline u32 ccsr_channel_enable_set_f(u32 v)
104{
105 return (v & 0x1U) << 10U;
106}
107static inline u32 ccsr_channel_enable_set_true_f(void)
108{
109 return 0x400U;
110}
111static inline u32 ccsr_channel_enable_clr_true_f(void)
112{
113 return 0x800U;
114}
115static inline u32 ccsr_channel_status_v(u32 r)
116{
117 return (r >> 24U) & 0xfU;
118}
119static inline u32 ccsr_channel_status_pending_ctx_reload_v(void)
120{
121 return 0x00000002U;
122}
123static inline u32 ccsr_channel_status_pending_acq_ctx_reload_v(void)
124{
125 return 0x00000004U;
126}
127static inline u32 ccsr_channel_status_on_pbdma_ctx_reload_v(void)
128{
129 return 0x0000000aU;
130}
131static inline u32 ccsr_channel_status_on_pbdma_and_eng_ctx_reload_v(void)
132{
133 return 0x0000000bU;
134}
135static inline u32 ccsr_channel_status_on_eng_ctx_reload_v(void)
136{
137 return 0x0000000cU;
138}
139static inline u32 ccsr_channel_status_on_eng_pending_ctx_reload_v(void)
140{
141 return 0x0000000dU;
142}
143static inline u32 ccsr_channel_status_on_eng_pending_acq_ctx_reload_v(void)
144{
145 return 0x0000000eU;
146}
147static inline u32 ccsr_channel_next_v(u32 r)
148{
149 return (r >> 1U) & 0x1U;
150}
151static inline u32 ccsr_channel_next_true_v(void)
152{
153 return 0x00000001U;
154}
155static inline u32 ccsr_channel_force_ctx_reload_true_f(void)
156{
157 return 0x100U;
158}
159static inline u32 ccsr_channel_busy_v(u32 r)
160{
161 return (r >> 28U) & 0x1U;
162}
163#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_ce2_gm20b.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_ce2_gm20b.h
new file mode 100644
index 00000000..fb741a77
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_ce2_gm20b.h
@@ -0,0 +1,87 @@
1/*
2 * Copyright (c) 2015-2017, 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_ce2_gm20b_h_
57#define _hw_ce2_gm20b_h_
58
59static inline u32 ce2_intr_status_r(void)
60{
61 return 0x00106908U;
62}
63static inline u32 ce2_intr_status_blockpipe_pending_f(void)
64{
65 return 0x1U;
66}
67static inline u32 ce2_intr_status_blockpipe_reset_f(void)
68{
69 return 0x1U;
70}
71static inline u32 ce2_intr_status_nonblockpipe_pending_f(void)
72{
73 return 0x2U;
74}
75static inline u32 ce2_intr_status_nonblockpipe_reset_f(void)
76{
77 return 0x2U;
78}
79static inline u32 ce2_intr_status_launcherr_pending_f(void)
80{
81 return 0x4U;
82}
83static inline u32 ce2_intr_status_launcherr_reset_f(void)
84{
85 return 0x4U;
86}
87#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_ctxsw_prog_gm20b.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_ctxsw_prog_gm20b.h
new file mode 100644
index 00000000..b60dfc36
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_ctxsw_prog_gm20b.h
@@ -0,0 +1,471 @@
1/*
2 * Copyright (c) 2014-2017, 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_ctxsw_prog_gm20b_h_
57#define _hw_ctxsw_prog_gm20b_h_
58
59static inline u32 ctxsw_prog_fecs_header_v(void)
60{
61 return 0x00000100U;
62}
63static inline u32 ctxsw_prog_main_image_num_gpcs_o(void)
64{
65 return 0x00000008U;
66}
67static inline u32 ctxsw_prog_main_image_ctl_o(void)
68{
69 return 0x0000000cU;
70}
71static inline u32 ctxsw_prog_main_image_ctl_cde_enabled_f(void)
72{
73 return 0x400U;
74}
75static inline u32 ctxsw_prog_main_image_ctl_cde_disabled_f(void)
76{
77 return 0x0U;
78}
79static inline u32 ctxsw_prog_main_image_patch_count_o(void)
80{
81 return 0x00000010U;
82}
83static inline u32 ctxsw_prog_main_image_context_id_o(void)
84{
85 return 0x000000f0U;
86}
87static inline u32 ctxsw_prog_main_image_patch_adr_lo_o(void)
88{
89 return 0x00000014U;
90}
91static inline u32 ctxsw_prog_main_image_patch_adr_hi_o(void)
92{
93 return 0x00000018U;
94}
95static inline u32 ctxsw_prog_main_image_zcull_o(void)
96{
97 return 0x0000001cU;
98}
99static inline u32 ctxsw_prog_main_image_zcull_mode_no_ctxsw_v(void)
100{
101 return 0x00000001U;
102}
103static inline u32 ctxsw_prog_main_image_zcull_mode_separate_buffer_v(void)
104{
105 return 0x00000002U;
106}
107static inline u32 ctxsw_prog_main_image_zcull_ptr_o(void)
108{
109 return 0x00000020U;
110}
111static inline u32 ctxsw_prog_main_image_pm_o(void)
112{
113 return 0x00000028U;
114}
115static inline u32 ctxsw_prog_main_image_pm_mode_m(void)
116{
117 return 0x7U << 0U;
118}
119static inline u32 ctxsw_prog_main_image_pm_mode_no_ctxsw_f(void)
120{
121 return 0x0U;
122}
123static inline u32 ctxsw_prog_main_image_pm_smpc_mode_m(void)
124{
125 return 0x7U << 3U;
126}
127static inline u32 ctxsw_prog_main_image_pm_smpc_mode_ctxsw_f(void)
128{
129 return 0x8U;
130}
131static inline u32 ctxsw_prog_main_image_pm_smpc_mode_no_ctxsw_f(void)
132{
133 return 0x0U;
134}
135static inline u32 ctxsw_prog_main_image_pm_pc_sampling_f(u32 v)
136{
137 return (v & 0x1U) << 6U;
138}
139static inline u32 ctxsw_prog_main_image_pm_pc_sampling_m(void)
140{
141 return 0x1U << 6U;
142}
143static inline u32 ctxsw_prog_main_image_pm_ptr_o(void)
144{
145 return 0x0000002cU;
146}
147static inline u32 ctxsw_prog_main_image_num_save_ops_o(void)
148{
149 return 0x000000f4U;
150}
151static inline u32 ctxsw_prog_main_image_num_restore_ops_o(void)
152{
153 return 0x000000f8U;
154}
155static inline u32 ctxsw_prog_main_image_magic_value_o(void)
156{
157 return 0x000000fcU;
158}
159static inline u32 ctxsw_prog_main_image_magic_value_v_value_v(void)
160{
161 return 0x600dc0deU;
162}
163static inline u32 ctxsw_prog_local_priv_register_ctl_o(void)
164{
165 return 0x0000000cU;
166}
167static inline u32 ctxsw_prog_local_priv_register_ctl_offset_v(u32 r)
168{
169 return (r >> 0U) & 0xffffU;
170}
171static inline u32 ctxsw_prog_local_image_ppc_info_o(void)
172{
173 return 0x000000f4U;
174}
175static inline u32 ctxsw_prog_local_image_ppc_info_num_ppcs_v(u32 r)
176{
177 return (r >> 0U) & 0xffffU;
178}
179static inline u32 ctxsw_prog_local_image_ppc_info_ppc_mask_v(u32 r)
180{
181 return (r >> 16U) & 0xffffU;
182}
183static inline u32 ctxsw_prog_local_image_num_tpcs_o(void)
184{
185 return 0x000000f8U;
186}
187static inline u32 ctxsw_prog_local_magic_value_o(void)
188{
189 return 0x000000fcU;
190}
191static inline u32 ctxsw_prog_local_magic_value_v_value_v(void)
192{
193 return 0xad0becabU;
194}
195static inline u32 ctxsw_prog_main_extended_buffer_ctl_o(void)
196{
197 return 0x000000ecU;
198}
199static inline u32 ctxsw_prog_main_extended_buffer_ctl_offset_v(u32 r)
200{
201 return (r >> 0U) & 0xffffU;
202}
203static inline u32 ctxsw_prog_main_extended_buffer_ctl_size_v(u32 r)
204{
205 return (r >> 16U) & 0xffU;
206}
207static inline u32 ctxsw_prog_extended_buffer_segments_size_in_bytes_v(void)
208{
209 return 0x00000100U;
210}
211static inline u32 ctxsw_prog_extended_marker_size_in_bytes_v(void)
212{
213 return 0x00000004U;
214}
215static inline u32 ctxsw_prog_extended_sm_dsm_perf_counter_register_stride_v(void)
216{
217 return 0x00000000U;
218}
219static inline u32 ctxsw_prog_extended_sm_dsm_perf_counter_control_register_stride_v(void)
220{
221 return 0x00000002U;
222}
223static inline u32 ctxsw_prog_main_image_priv_access_map_config_o(void)
224{
225 return 0x000000a0U;
226}
227static inline u32 ctxsw_prog_main_image_priv_access_map_config_mode_s(void)
228{
229 return 2U;
230}
231static inline u32 ctxsw_prog_main_image_priv_access_map_config_mode_f(u32 v)
232{
233 return (v & 0x3U) << 0U;
234}
235static inline u32 ctxsw_prog_main_image_priv_access_map_config_mode_m(void)
236{
237 return 0x3U << 0U;
238}
239static inline u32 ctxsw_prog_main_image_priv_access_map_config_mode_v(u32 r)
240{
241 return (r >> 0U) & 0x3U;
242}
243static inline u32 ctxsw_prog_main_image_priv_access_map_config_mode_allow_all_f(void)
244{
245 return 0x0U;
246}
247static inline u32 ctxsw_prog_main_image_priv_access_map_config_mode_use_map_f(void)
248{
249 return 0x2U;
250}
251static inline u32 ctxsw_prog_main_image_priv_access_map_addr_lo_o(void)
252{
253 return 0x000000a4U;
254}
255static inline u32 ctxsw_prog_main_image_priv_access_map_addr_hi_o(void)
256{
257 return 0x000000a8U;
258}
259static inline u32 ctxsw_prog_main_image_misc_options_o(void)
260{
261 return 0x0000003cU;
262}
263static inline u32 ctxsw_prog_main_image_misc_options_verif_features_m(void)
264{
265 return 0x1U << 3U;
266}
267static inline u32 ctxsw_prog_main_image_misc_options_verif_features_disabled_f(void)
268{
269 return 0x0U;
270}
271static inline u32 ctxsw_prog_main_image_context_timestamp_buffer_control_o(void)
272{
273 return 0x000000acU;
274}
275static inline u32 ctxsw_prog_main_image_context_timestamp_buffer_control_num_records_f(u32 v)
276{
277 return (v & 0xffffU) << 0U;
278}
279static inline u32 ctxsw_prog_main_image_context_timestamp_buffer_ptr_hi_o(void)
280{
281 return 0x000000b0U;
282}
283static inline u32 ctxsw_prog_main_image_context_timestamp_buffer_ptr_hi_v_m(void)
284{
285 return 0xfffffffU << 0U;
286}
287static inline u32 ctxsw_prog_main_image_context_timestamp_buffer_ptr_hi_target_m(void)
288{
289 return 0x3U << 28U;
290}
291static inline u32 ctxsw_prog_main_image_context_timestamp_buffer_ptr_hi_target_vid_mem_f(void)
292{
293 return 0x0U;
294}
295static inline u32 ctxsw_prog_main_image_context_timestamp_buffer_ptr_hi_target_sys_mem_coherent_f(void)
296{
297 return 0x20000000U;
298}
299static inline u32 ctxsw_prog_main_image_context_timestamp_buffer_ptr_hi_target_sys_mem_noncoherent_f(void)
300{
301 return 0x30000000U;
302}
303static inline u32 ctxsw_prog_main_image_context_timestamp_buffer_ptr_o(void)
304{
305 return 0x000000b4U;
306}
307static inline u32 ctxsw_prog_main_image_context_timestamp_buffer_ptr_v_f(u32 v)
308{
309 return (v & 0xffffffffU) << 0U;
310}
311static inline u32 ctxsw_prog_record_timestamp_record_size_in_bytes_v(void)
312{
313 return 0x00000080U;
314}
315static inline u32 ctxsw_prog_record_timestamp_record_size_in_words_v(void)
316{
317 return 0x00000020U;
318}
319static inline u32 ctxsw_prog_record_timestamp_magic_value_lo_o(void)
320{
321 return 0x00000000U;
322}
323static inline u32 ctxsw_prog_record_timestamp_magic_value_lo_v_value_v(void)
324{
325 return 0x00000000U;
326}
327static inline u32 ctxsw_prog_record_timestamp_magic_value_hi_o(void)
328{
329 return 0x00000004U;
330}
331static inline u32 ctxsw_prog_record_timestamp_magic_value_hi_v_value_v(void)
332{
333 return 0x600dbeefU;
334}
335static inline u32 ctxsw_prog_record_timestamp_context_id_o(void)
336{
337 return 0x00000008U;
338}
339static inline u32 ctxsw_prog_record_timestamp_context_ptr_o(void)
340{
341 return 0x0000000cU;
342}
343static inline u32 ctxsw_prog_record_timestamp_new_context_id_o(void)
344{
345 return 0x00000010U;
346}
347static inline u32 ctxsw_prog_record_timestamp_new_context_ptr_o(void)
348{
349 return 0x00000014U;
350}
351static inline u32 ctxsw_prog_record_timestamp_timestamp_lo_o(void)
352{
353 return 0x00000018U;
354}
355static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_o(void)
356{
357 return 0x0000001cU;
358}
359static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_v_f(u32 v)
360{
361 return (v & 0xffffffU) << 0U;
362}
363static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_v_v(u32 r)
364{
365 return (r >> 0U) & 0xffffffU;
366}
367static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_f(u32 v)
368{
369 return (v & 0xffU) << 24U;
370}
371static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_m(void)
372{
373 return 0xffU << 24U;
374}
375static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_v(u32 r)
376{
377 return (r >> 24U) & 0xffU;
378}
379static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_ctxsw_req_by_host_v(void)
380{
381 return 0x00000001U;
382}
383static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_ctxsw_req_by_host_f(void)
384{
385 return 0x1000000U;
386}
387static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_fe_ack_v(void)
388{
389 return 0x00000002U;
390}
391static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_fe_ack_f(void)
392{
393 return 0x2000000U;
394}
395static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_fe_ack_wfi_v(void)
396{
397 return 0x0000000aU;
398}
399static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_fe_ack_wfi_f(void)
400{
401 return 0xa000000U;
402}
403static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_fe_ack_gfxp_v(void)
404{
405 return 0x0000000bU;
406}
407static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_fe_ack_gfxp_f(void)
408{
409 return 0xb000000U;
410}
411static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_fe_ack_ctap_v(void)
412{
413 return 0x0000000cU;
414}
415static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_fe_ack_ctap_f(void)
416{
417 return 0xc000000U;
418}
419static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_fe_ack_cilp_v(void)
420{
421 return 0x0000000dU;
422}
423static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_fe_ack_cilp_f(void)
424{
425 return 0xd000000U;
426}
427static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_save_end_v(void)
428{
429 return 0x00000003U;
430}
431static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_save_end_f(void)
432{
433 return 0x3000000U;
434}
435static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_restore_start_v(void)
436{
437 return 0x00000004U;
438}
439static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_restore_start_f(void)
440{
441 return 0x4000000U;
442}
443static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_context_start_v(void)
444{
445 return 0x00000005U;
446}
447static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_context_start_f(void)
448{
449 return 0x5000000U;
450}
451static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_invalid_timestamp_v(void)
452{
453 return 0x000000ffU;
454}
455static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_invalid_timestamp_f(void)
456{
457 return 0xff000000U;
458}
459static inline u32 ctxsw_prog_main_image_preemption_options_o(void)
460{
461 return 0x00000060U;
462}
463static inline u32 ctxsw_prog_main_image_preemption_options_control_f(u32 v)
464{
465 return (v & 0x3U) << 0U;
466}
467static inline u32 ctxsw_prog_main_image_preemption_options_control_cta_enabled_f(void)
468{
469 return 0x1U;
470}
471#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_falcon_gm20b.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_falcon_gm20b.h
new file mode 100644
index 00000000..a17c9a9a
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_falcon_gm20b.h
@@ -0,0 +1,595 @@
1/*
2 * Copyright (c) 2017, 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_falcon_gm20b_h_
57#define _hw_falcon_gm20b_h_
58
59static inline u32 falcon_falcon_irqsset_r(void)
60{
61 return 0x00000000U;
62}
63static inline u32 falcon_falcon_irqsset_swgen0_set_f(void)
64{
65 return 0x40U;
66}
67static inline u32 falcon_falcon_irqsclr_r(void)
68{
69 return 0x00000004U;
70}
71static inline u32 falcon_falcon_irqstat_r(void)
72{
73 return 0x00000008U;
74}
75static inline u32 falcon_falcon_irqstat_halt_true_f(void)
76{
77 return 0x10U;
78}
79static inline u32 falcon_falcon_irqstat_exterr_true_f(void)
80{
81 return 0x20U;
82}
83static inline u32 falcon_falcon_irqstat_swgen0_true_f(void)
84{
85 return 0x40U;
86}
87static inline u32 falcon_falcon_irqmode_r(void)
88{
89 return 0x0000000cU;
90}
91static inline u32 falcon_falcon_irqmset_r(void)
92{
93 return 0x00000010U;
94}
95static inline u32 falcon_falcon_irqmset_gptmr_f(u32 v)
96{
97 return (v & 0x1U) << 0U;
98}
99static inline u32 falcon_falcon_irqmset_wdtmr_f(u32 v)
100{
101 return (v & 0x1U) << 1U;
102}
103static inline u32 falcon_falcon_irqmset_mthd_f(u32 v)
104{
105 return (v & 0x1U) << 2U;
106}
107static inline u32 falcon_falcon_irqmset_ctxsw_f(u32 v)
108{
109 return (v & 0x1U) << 3U;
110}
111static inline u32 falcon_falcon_irqmset_halt_f(u32 v)
112{
113 return (v & 0x1U) << 4U;
114}
115static inline u32 falcon_falcon_irqmset_exterr_f(u32 v)
116{
117 return (v & 0x1U) << 5U;
118}
119static inline u32 falcon_falcon_irqmset_swgen0_f(u32 v)
120{
121 return (v & 0x1U) << 6U;
122}
123static inline u32 falcon_falcon_irqmset_swgen1_f(u32 v)
124{
125 return (v & 0x1U) << 7U;
126}
127static inline u32 falcon_falcon_irqmclr_r(void)
128{
129 return 0x00000014U;
130}
131static inline u32 falcon_falcon_irqmclr_gptmr_f(u32 v)
132{
133 return (v & 0x1U) << 0U;
134}
135static inline u32 falcon_falcon_irqmclr_wdtmr_f(u32 v)
136{
137 return (v & 0x1U) << 1U;
138}
139static inline u32 falcon_falcon_irqmclr_mthd_f(u32 v)
140{
141 return (v & 0x1U) << 2U;
142}
143static inline u32 falcon_falcon_irqmclr_ctxsw_f(u32 v)
144{
145 return (v & 0x1U) << 3U;
146}
147static inline u32 falcon_falcon_irqmclr_halt_f(u32 v)
148{
149 return (v & 0x1U) << 4U;
150}
151static inline u32 falcon_falcon_irqmclr_exterr_f(u32 v)
152{
153 return (v & 0x1U) << 5U;
154}
155static inline u32 falcon_falcon_irqmclr_swgen0_f(u32 v)
156{
157 return (v & 0x1U) << 6U;
158}
159static inline u32 falcon_falcon_irqmclr_swgen1_f(u32 v)
160{
161 return (v & 0x1U) << 7U;
162}
163static inline u32 falcon_falcon_irqmclr_ext_f(u32 v)
164{
165 return (v & 0xffU) << 8U;
166}
167static inline u32 falcon_falcon_irqmask_r(void)
168{
169 return 0x00000018U;
170}
171static inline u32 falcon_falcon_irqdest_r(void)
172{
173 return 0x0000001cU;
174}
175static inline u32 falcon_falcon_irqdest_host_gptmr_f(u32 v)
176{
177 return (v & 0x1U) << 0U;
178}
179static inline u32 falcon_falcon_irqdest_host_wdtmr_f(u32 v)
180{
181 return (v & 0x1U) << 1U;
182}
183static inline u32 falcon_falcon_irqdest_host_mthd_f(u32 v)
184{
185 return (v & 0x1U) << 2U;
186}
187static inline u32 falcon_falcon_irqdest_host_ctxsw_f(u32 v)
188{
189 return (v & 0x1U) << 3U;
190}
191static inline u32 falcon_falcon_irqdest_host_halt_f(u32 v)
192{
193 return (v & 0x1U) << 4U;
194}
195static inline u32 falcon_falcon_irqdest_host_exterr_f(u32 v)
196{
197 return (v & 0x1U) << 5U;
198}
199static inline u32 falcon_falcon_irqdest_host_swgen0_f(u32 v)
200{
201 return (v & 0x1U) << 6U;
202}
203static inline u32 falcon_falcon_irqdest_host_swgen1_f(u32 v)
204{
205 return (v & 0x1U) << 7U;
206}
207static inline u32 falcon_falcon_irqdest_host_ext_f(u32 v)
208{
209 return (v & 0xffU) << 8U;
210}
211static inline u32 falcon_falcon_irqdest_target_gptmr_f(u32 v)
212{
213 return (v & 0x1U) << 16U;
214}
215static inline u32 falcon_falcon_irqdest_target_wdtmr_f(u32 v)
216{
217 return (v & 0x1U) << 17U;
218}
219static inline u32 falcon_falcon_irqdest_target_mthd_f(u32 v)
220{
221 return (v & 0x1U) << 18U;
222}
223static inline u32 falcon_falcon_irqdest_target_ctxsw_f(u32 v)
224{
225 return (v & 0x1U) << 19U;
226}
227static inline u32 falcon_falcon_irqdest_target_halt_f(u32 v)
228{
229 return (v & 0x1U) << 20U;
230}
231static inline u32 falcon_falcon_irqdest_target_exterr_f(u32 v)
232{
233 return (v & 0x1U) << 21U;
234}
235static inline u32 falcon_falcon_irqdest_target_swgen0_f(u32 v)
236{
237 return (v & 0x1U) << 22U;
238}
239static inline u32 falcon_falcon_irqdest_target_swgen1_f(u32 v)
240{
241 return (v & 0x1U) << 23U;
242}
243static inline u32 falcon_falcon_irqdest_target_ext_f(u32 v)
244{
245 return (v & 0xffU) << 24U;
246}
247static inline u32 falcon_falcon_curctx_r(void)
248{
249 return 0x00000050U;
250}
251static inline u32 falcon_falcon_nxtctx_r(void)
252{
253 return 0x00000054U;
254}
255static inline u32 falcon_falcon_mailbox0_r(void)
256{
257 return 0x00000040U;
258}
259static inline u32 falcon_falcon_mailbox1_r(void)
260{
261 return 0x00000044U;
262}
263static inline u32 falcon_falcon_itfen_r(void)
264{
265 return 0x00000048U;
266}
267static inline u32 falcon_falcon_itfen_ctxen_enable_f(void)
268{
269 return 0x1U;
270}
271static inline u32 falcon_falcon_idlestate_r(void)
272{
273 return 0x0000004cU;
274}
275static inline u32 falcon_falcon_idlestate_falcon_busy_v(u32 r)
276{
277 return (r >> 0U) & 0x1U;
278}
279static inline u32 falcon_falcon_idlestate_ext_busy_v(u32 r)
280{
281 return (r >> 1U) & 0x7fffU;
282}
283static inline u32 falcon_falcon_os_r(void)
284{
285 return 0x00000080U;
286}
287static inline u32 falcon_falcon_engctl_r(void)
288{
289 return 0x000000a4U;
290}
291static inline u32 falcon_falcon_cpuctl_r(void)
292{
293 return 0x00000100U;
294}
295static inline u32 falcon_falcon_cpuctl_startcpu_f(u32 v)
296{
297 return (v & 0x1U) << 1U;
298}
299static inline u32 falcon_falcon_cpuctl_sreset_f(u32 v)
300{
301 return (v & 0x1U) << 2U;
302}
303static inline u32 falcon_falcon_cpuctl_hreset_f(u32 v)
304{
305 return (v & 0x1U) << 3U;
306}
307static inline u32 falcon_falcon_cpuctl_halt_intr_f(u32 v)
308{
309 return (v & 0x1U) << 4U;
310}
311static inline u32 falcon_falcon_cpuctl_halt_intr_m(void)
312{
313 return 0x1U << 4U;
314}
315static inline u32 falcon_falcon_cpuctl_halt_intr_v(u32 r)
316{
317 return (r >> 4U) & 0x1U;
318}
319static inline u32 falcon_falcon_cpuctl_stopped_m(void)
320{
321 return 0x1U << 5U;
322}
323static inline u32 falcon_falcon_cpuctl_cpuctl_alias_en_f(u32 v)
324{
325 return (v & 0x1U) << 6U;
326}
327static inline u32 falcon_falcon_cpuctl_cpuctl_alias_en_m(void)
328{
329 return 0x1U << 6U;
330}
331static inline u32 falcon_falcon_cpuctl_cpuctl_alias_en_v(u32 r)
332{
333 return (r >> 6U) & 0x1U;
334}
335static inline u32 falcon_falcon_cpuctl_alias_r(void)
336{
337 return 0x00000130U;
338}
339static inline u32 falcon_falcon_cpuctl_alias_startcpu_f(u32 v)
340{
341 return (v & 0x1U) << 1U;
342}
343static inline u32 falcon_falcon_imemc_r(u32 i)
344{
345 return 0x00000180U + i*16U;
346}
347static inline u32 falcon_falcon_imemc_offs_f(u32 v)
348{
349 return (v & 0x3fU) << 2U;
350}
351static inline u32 falcon_falcon_imemc_blk_f(u32 v)
352{
353 return (v & 0xffU) << 8U;
354}
355static inline u32 falcon_falcon_imemc_aincw_f(u32 v)
356{
357 return (v & 0x1U) << 24U;
358}
359static inline u32 falcon_falcon_imemd_r(u32 i)
360{
361 return 0x00000184U + i*16U;
362}
363static inline u32 falcon_falcon_imemt_r(u32 i)
364{
365 return 0x00000188U + i*16U;
366}
367static inline u32 falcon_falcon_sctl_r(void)
368{
369 return 0x00000240U;
370}
371static inline u32 falcon_falcon_mmu_phys_sec_r(void)
372{
373 return 0x00100ce4U;
374}
375static inline u32 falcon_falcon_bootvec_r(void)
376{
377 return 0x00000104U;
378}
379static inline u32 falcon_falcon_bootvec_vec_f(u32 v)
380{
381 return (v & 0xffffffffU) << 0U;
382}
383static inline u32 falcon_falcon_dmactl_r(void)
384{
385 return 0x0000010cU;
386}
387static inline u32 falcon_falcon_dmactl_dmem_scrubbing_m(void)
388{
389 return 0x1U << 1U;
390}
391static inline u32 falcon_falcon_dmactl_imem_scrubbing_m(void)
392{
393 return 0x1U << 2U;
394}
395static inline u32 falcon_falcon_dmactl_require_ctx_f(u32 v)
396{
397 return (v & 0x1U) << 0U;
398}
399static inline u32 falcon_falcon_hwcfg_r(void)
400{
401 return 0x00000108U;
402}
403static inline u32 falcon_falcon_hwcfg_imem_size_v(u32 r)
404{
405 return (r >> 0U) & 0x1ffU;
406}
407static inline u32 falcon_falcon_hwcfg_dmem_size_v(u32 r)
408{
409 return (r >> 9U) & 0x1ffU;
410}
411static inline u32 falcon_falcon_dmatrfbase_r(void)
412{
413 return 0x00000110U;
414}
415static inline u32 falcon_falcon_dmatrfmoffs_r(void)
416{
417 return 0x00000114U;
418}
419static inline u32 falcon_falcon_dmatrfcmd_r(void)
420{
421 return 0x00000118U;
422}
423static inline u32 falcon_falcon_dmatrfcmd_imem_f(u32 v)
424{
425 return (v & 0x1U) << 4U;
426}
427static inline u32 falcon_falcon_dmatrfcmd_write_f(u32 v)
428{
429 return (v & 0x1U) << 5U;
430}
431static inline u32 falcon_falcon_dmatrfcmd_size_f(u32 v)
432{
433 return (v & 0x7U) << 8U;
434}
435static inline u32 falcon_falcon_dmatrfcmd_ctxdma_f(u32 v)
436{
437 return (v & 0x7U) << 12U;
438}
439static inline u32 falcon_falcon_dmatrffboffs_r(void)
440{
441 return 0x0000011cU;
442}
443static inline u32 falcon_falcon_imctl_debug_r(void)
444{
445 return 0x0000015cU;
446}
447static inline u32 falcon_falcon_imctl_debug_addr_blk_f(u32 v)
448{
449 return (v & 0xffffffU) << 0U;
450}
451static inline u32 falcon_falcon_imctl_debug_cmd_f(u32 v)
452{
453 return (v & 0x7U) << 24U;
454}
455static inline u32 falcon_falcon_imstat_r(void)
456{
457 return 0x00000144U;
458}
459static inline u32 falcon_falcon_traceidx_r(void)
460{
461 return 0x00000148U;
462}
463static inline u32 falcon_falcon_traceidx_maxidx_v(u32 r)
464{
465 return (r >> 16U) & 0xffU;
466}
467static inline u32 falcon_falcon_traceidx_idx_f(u32 v)
468{
469 return (v & 0xffU) << 0U;
470}
471static inline u32 falcon_falcon_tracepc_r(void)
472{
473 return 0x0000014cU;
474}
475static inline u32 falcon_falcon_tracepc_pc_v(u32 r)
476{
477 return (r >> 0U) & 0xffffffU;
478}
479static inline u32 falcon_falcon_exterraddr_r(void)
480{
481 return 0x00000168U;
482}
483static inline u32 falcon_falcon_exterrstat_r(void)
484{
485 return 0x0000016cU;
486}
487static inline u32 falcon_falcon_exterrstat_valid_m(void)
488{
489 return 0x1U << 31U;
490}
491static inline u32 falcon_falcon_exterrstat_valid_v(u32 r)
492{
493 return (r >> 31U) & 0x1U;
494}
495static inline u32 falcon_falcon_exterrstat_valid_true_v(void)
496{
497 return 0x00000001U;
498}
499static inline u32 falcon_falcon_icd_cmd_r(void)
500{
501 return 0x00000200U;
502}
503static inline u32 falcon_falcon_icd_cmd_opc_s(void)
504{
505 return 4U;
506}
507static inline u32 falcon_falcon_icd_cmd_opc_f(u32 v)
508{
509 return (v & 0xfU) << 0U;
510}
511static inline u32 falcon_falcon_icd_cmd_opc_m(void)
512{
513 return 0xfU << 0U;
514}
515static inline u32 falcon_falcon_icd_cmd_opc_v(u32 r)
516{
517 return (r >> 0U) & 0xfU;
518}
519static inline u32 falcon_falcon_icd_cmd_opc_rreg_f(void)
520{
521 return 0x8U;
522}
523static inline u32 falcon_falcon_icd_cmd_opc_rstat_f(void)
524{
525 return 0xeU;
526}
527static inline u32 falcon_falcon_icd_cmd_idx_f(u32 v)
528{
529 return (v & 0x1fU) << 8U;
530}
531static inline u32 falcon_falcon_icd_rdata_r(void)
532{
533 return 0x0000020cU;
534}
535static inline u32 falcon_falcon_dmemc_r(u32 i)
536{
537 return 0x000001c0U + i*8U;
538}
539static inline u32 falcon_falcon_dmemc_offs_f(u32 v)
540{
541 return (v & 0x3fU) << 2U;
542}
543static inline u32 falcon_falcon_dmemc_offs_m(void)
544{
545 return 0x3fU << 2U;
546}
547static inline u32 falcon_falcon_dmemc_blk_f(u32 v)
548{
549 return (v & 0xffU) << 8U;
550}
551static inline u32 falcon_falcon_dmemc_blk_m(void)
552{
553 return 0xffU << 8U;
554}
555static inline u32 falcon_falcon_dmemc_aincw_f(u32 v)
556{
557 return (v & 0x1U) << 24U;
558}
559static inline u32 falcon_falcon_dmemc_aincr_f(u32 v)
560{
561 return (v & 0x1U) << 25U;
562}
563static inline u32 falcon_falcon_dmemd_r(u32 i)
564{
565 return 0x000001c4U + i*8U;
566}
567static inline u32 falcon_falcon_debug1_r(void)
568{
569 return 0x00000090U;
570}
571static inline u32 falcon_falcon_debug1_ctxsw_mode_s(void)
572{
573 return 1U;
574}
575static inline u32 falcon_falcon_debug1_ctxsw_mode_f(u32 v)
576{
577 return (v & 0x1U) << 16U;
578}
579static inline u32 falcon_falcon_debug1_ctxsw_mode_m(void)
580{
581 return 0x1U << 16U;
582}
583static inline u32 falcon_falcon_debug1_ctxsw_mode_v(u32 r)
584{
585 return (r >> 16U) & 0x1U;
586}
587static inline u32 falcon_falcon_debug1_ctxsw_mode_init_f(void)
588{
589 return 0x0U;
590}
591static inline u32 falcon_falcon_debuginfo_r(void)
592{
593 return 0x00000094U;
594}
595#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_fb_gm20b.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_fb_gm20b.h
new file mode 100644
index 00000000..531d0400
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_fb_gm20b.h
@@ -0,0 +1,351 @@
1/*
2 * Copyright (c) 2014-2017, 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_fb_gm20b_h_
57#define _hw_fb_gm20b_h_
58
59static inline u32 fb_fbhub_num_active_ltcs_r(void)
60{
61 return 0x00100800U;
62}
63static inline u32 fb_mmu_ctrl_r(void)
64{
65 return 0x00100c80U;
66}
67static inline u32 fb_mmu_ctrl_vm_pg_size_f(u32 v)
68{
69 return (v & 0x1U) << 0U;
70}
71static inline u32 fb_mmu_ctrl_vm_pg_size_128kb_f(void)
72{
73 return 0x0U;
74}
75static inline u32 fb_mmu_ctrl_vm_pg_size_64kb_f(void)
76{
77 return 0x1U;
78}
79static inline u32 fb_mmu_ctrl_pri_fifo_empty_v(u32 r)
80{
81 return (r >> 15U) & 0x1U;
82}
83static inline u32 fb_mmu_ctrl_pri_fifo_empty_false_f(void)
84{
85 return 0x0U;
86}
87static inline u32 fb_mmu_ctrl_pri_fifo_space_v(u32 r)
88{
89 return (r >> 16U) & 0xffU;
90}
91static inline u32 fb_mmu_ctrl_use_pdb_big_page_size_v(u32 r)
92{
93 return (r >> 11U) & 0x1U;
94}
95static inline u32 fb_mmu_ctrl_use_pdb_big_page_size_true_f(void)
96{
97 return 0x800U;
98}
99static inline u32 fb_mmu_ctrl_use_pdb_big_page_size_false_f(void)
100{
101 return 0x0U;
102}
103static inline u32 fb_mmu_ctrl_use_full_comp_tag_line_v(u32 r)
104{
105 return (r >> 12U) & 0x1U;
106}
107static inline u32 fb_mmu_ctrl_use_full_comp_tag_line_true_f(void)
108{
109 return 0x1000U;
110}
111static inline u32 fb_priv_mmu_phy_secure_r(void)
112{
113 return 0x00100ce4U;
114}
115static inline u32 fb_mmu_invalidate_pdb_r(void)
116{
117 return 0x00100cb8U;
118}
119static inline u32 fb_mmu_invalidate_pdb_aperture_vid_mem_f(void)
120{
121 return 0x0U;
122}
123static inline u32 fb_mmu_invalidate_pdb_aperture_sys_mem_f(void)
124{
125 return 0x2U;
126}
127static inline u32 fb_mmu_invalidate_pdb_addr_f(u32 v)
128{
129 return (v & 0xfffffffU) << 4U;
130}
131static inline u32 fb_mmu_invalidate_r(void)
132{
133 return 0x00100cbcU;
134}
135static inline u32 fb_mmu_invalidate_all_va_true_f(void)
136{
137 return 0x1U;
138}
139static inline u32 fb_mmu_invalidate_all_pdb_true_f(void)
140{
141 return 0x2U;
142}
143static inline u32 fb_mmu_invalidate_trigger_s(void)
144{
145 return 1U;
146}
147static inline u32 fb_mmu_invalidate_trigger_f(u32 v)
148{
149 return (v & 0x1U) << 31U;
150}
151static inline u32 fb_mmu_invalidate_trigger_m(void)
152{
153 return 0x1U << 31U;
154}
155static inline u32 fb_mmu_invalidate_trigger_v(u32 r)
156{
157 return (r >> 31U) & 0x1U;
158}
159static inline u32 fb_mmu_invalidate_trigger_true_f(void)
160{
161 return 0x80000000U;
162}
163static inline u32 fb_mmu_debug_wr_r(void)
164{
165 return 0x00100cc8U;
166}
167static inline u32 fb_mmu_debug_wr_aperture_s(void)
168{
169 return 2U;
170}
171static inline u32 fb_mmu_debug_wr_aperture_f(u32 v)
172{
173 return (v & 0x3U) << 0U;
174}
175static inline u32 fb_mmu_debug_wr_aperture_m(void)
176{
177 return 0x3U << 0U;
178}
179static inline u32 fb_mmu_debug_wr_aperture_v(u32 r)
180{
181 return (r >> 0U) & 0x3U;
182}
183static inline u32 fb_mmu_debug_wr_aperture_vid_mem_f(void)
184{
185 return 0x0U;
186}
187static inline u32 fb_mmu_debug_wr_aperture_sys_mem_coh_f(void)
188{
189 return 0x2U;
190}
191static inline u32 fb_mmu_debug_wr_aperture_sys_mem_ncoh_f(void)
192{
193 return 0x3U;
194}
195static inline u32 fb_mmu_debug_wr_vol_false_f(void)
196{
197 return 0x0U;
198}
199static inline u32 fb_mmu_debug_wr_vol_true_v(void)
200{
201 return 0x00000001U;
202}
203static inline u32 fb_mmu_debug_wr_vol_true_f(void)
204{
205 return 0x4U;
206}
207static inline u32 fb_mmu_debug_wr_addr_f(u32 v)
208{
209 return (v & 0xfffffffU) << 4U;
210}
211static inline u32 fb_mmu_debug_wr_addr_alignment_v(void)
212{
213 return 0x0000000cU;
214}
215static inline u32 fb_mmu_debug_rd_r(void)
216{
217 return 0x00100cccU;
218}
219static inline u32 fb_mmu_debug_rd_aperture_vid_mem_f(void)
220{
221 return 0x0U;
222}
223static inline u32 fb_mmu_debug_rd_aperture_sys_mem_coh_f(void)
224{
225 return 0x2U;
226}
227static inline u32 fb_mmu_debug_rd_aperture_sys_mem_ncoh_f(void)
228{
229 return 0x3U;
230}
231static inline u32 fb_mmu_debug_rd_vol_false_f(void)
232{
233 return 0x0U;
234}
235static inline u32 fb_mmu_debug_rd_addr_f(u32 v)
236{
237 return (v & 0xfffffffU) << 4U;
238}
239static inline u32 fb_mmu_debug_rd_addr_alignment_v(void)
240{
241 return 0x0000000cU;
242}
243static inline u32 fb_mmu_debug_ctrl_r(void)
244{
245 return 0x00100cc4U;
246}
247static inline u32 fb_mmu_debug_ctrl_debug_v(u32 r)
248{
249 return (r >> 16U) & 0x1U;
250}
251static inline u32 fb_mmu_debug_ctrl_debug_m(void)
252{
253 return 0x1U << 16U;
254}
255static inline u32 fb_mmu_debug_ctrl_debug_enabled_v(void)
256{
257 return 0x00000001U;
258}
259static inline u32 fb_mmu_debug_ctrl_debug_enabled_f(void)
260{
261 return 0x10000U;
262}
263static inline u32 fb_mmu_debug_ctrl_debug_disabled_v(void)
264{
265 return 0x00000000U;
266}
267static inline u32 fb_mmu_debug_ctrl_debug_disabled_f(void)
268{
269 return 0x0U;
270}
271static inline u32 fb_mmu_vpr_info_r(void)
272{
273 return 0x00100cd0U;
274}
275static inline u32 fb_mmu_vpr_info_index_f(u32 v)
276{
277 return (v & 0x3U) << 0U;
278}
279static inline u32 fb_mmu_vpr_info_index_v(u32 r)
280{
281 return (r >> 0U) & 0x3U;
282}
283static inline u32 fb_mmu_vpr_info_index_addr_lo_v(void)
284{
285 return 0x00000000U;
286}
287static inline u32 fb_mmu_vpr_info_index_addr_hi_v(void)
288{
289 return 0x00000001U;
290}
291static inline u32 fb_mmu_vpr_info_index_cya_lo_v(void)
292{
293 return 0x00000002U;
294}
295static inline u32 fb_mmu_vpr_info_index_cya_hi_v(void)
296{
297 return 0x00000003U;
298}
299static inline u32 fb_mmu_vpr_info_fetch_f(u32 v)
300{
301 return (v & 0x1U) << 2U;
302}
303static inline u32 fb_mmu_vpr_info_fetch_v(u32 r)
304{
305 return (r >> 2U) & 0x1U;
306}
307static inline u32 fb_mmu_vpr_info_fetch_false_v(void)
308{
309 return 0x00000000U;
310}
311static inline u32 fb_mmu_vpr_info_fetch_true_v(void)
312{
313 return 0x00000001U;
314}
315static inline u32 fb_mmu_wpr_info_r(void)
316{
317 return 0x00100cd4U;
318}
319static inline u32 fb_mmu_wpr_info_index_f(u32 v)
320{
321 return (v & 0xfU) << 0U;
322}
323static inline u32 fb_mmu_wpr_info_index_allow_read_v(void)
324{
325 return 0x00000000U;
326}
327static inline u32 fb_mmu_wpr_info_index_allow_write_v(void)
328{
329 return 0x00000001U;
330}
331static inline u32 fb_mmu_wpr_info_index_wpr1_addr_lo_v(void)
332{
333 return 0x00000002U;
334}
335static inline u32 fb_mmu_wpr_info_index_wpr1_addr_hi_v(void)
336{
337 return 0x00000003U;
338}
339static inline u32 fb_mmu_wpr_info_index_wpr2_addr_lo_v(void)
340{
341 return 0x00000004U;
342}
343static inline u32 fb_mmu_wpr_info_index_wpr2_addr_hi_v(void)
344{
345 return 0x00000005U;
346}
347static inline u32 fb_niso_flush_sysmem_addr_r(void)
348{
349 return 0x00100c10U;
350}
351#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_fifo_gm20b.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_fifo_gm20b.h
new file mode 100644
index 00000000..d32506dd
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_fifo_gm20b.h
@@ -0,0 +1,571 @@
1/*
2 * Copyright (c) 2014-2017, 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_fifo_gm20b_h_
57#define _hw_fifo_gm20b_h_
58
59static inline u32 fifo_bar1_base_r(void)
60{
61 return 0x00002254U;
62}
63static inline u32 fifo_bar1_base_ptr_f(u32 v)
64{
65 return (v & 0xfffffffU) << 0U;
66}
67static inline u32 fifo_bar1_base_ptr_align_shift_v(void)
68{
69 return 0x0000000cU;
70}
71static inline u32 fifo_bar1_base_valid_false_f(void)
72{
73 return 0x0U;
74}
75static inline u32 fifo_bar1_base_valid_true_f(void)
76{
77 return 0x10000000U;
78}
79static inline u32 fifo_runlist_base_r(void)
80{
81 return 0x00002270U;
82}
83static inline u32 fifo_runlist_base_ptr_f(u32 v)
84{
85 return (v & 0xfffffffU) << 0U;
86}
87static inline u32 fifo_runlist_base_target_vid_mem_f(void)
88{
89 return 0x0U;
90}
91static inline u32 fifo_runlist_base_target_sys_mem_coh_f(void)
92{
93 return 0x20000000U;
94}
95static inline u32 fifo_runlist_base_target_sys_mem_ncoh_f(void)
96{
97 return 0x30000000U;
98}
99static inline u32 fifo_runlist_r(void)
100{
101 return 0x00002274U;
102}
103static inline u32 fifo_runlist_engine_f(u32 v)
104{
105 return (v & 0xfU) << 20U;
106}
107static inline u32 fifo_eng_runlist_base_r(u32 i)
108{
109 return 0x00002280U + i*8U;
110}
111static inline u32 fifo_eng_runlist_base__size_1_v(void)
112{
113 return 0x00000001U;
114}
115static inline u32 fifo_eng_runlist_r(u32 i)
116{
117 return 0x00002284U + i*8U;
118}
119static inline u32 fifo_eng_runlist__size_1_v(void)
120{
121 return 0x00000001U;
122}
123static inline u32 fifo_eng_runlist_length_f(u32 v)
124{
125 return (v & 0xffffU) << 0U;
126}
127static inline u32 fifo_eng_runlist_length_max_v(void)
128{
129 return 0x0000ffffU;
130}
131static inline u32 fifo_eng_runlist_pending_true_f(void)
132{
133 return 0x100000U;
134}
135static inline u32 fifo_pb_timeslice_r(u32 i)
136{
137 return 0x00002350U + i*4U;
138}
139static inline u32 fifo_pb_timeslice_timeout_16_f(void)
140{
141 return 0x10U;
142}
143static inline u32 fifo_pb_timeslice_timescale_0_f(void)
144{
145 return 0x0U;
146}
147static inline u32 fifo_pb_timeslice_enable_true_f(void)
148{
149 return 0x10000000U;
150}
151static inline u32 fifo_pbdma_map_r(u32 i)
152{
153 return 0x00002390U + i*4U;
154}
155static inline u32 fifo_intr_0_r(void)
156{
157 return 0x00002100U;
158}
159static inline u32 fifo_intr_0_bind_error_pending_f(void)
160{
161 return 0x1U;
162}
163static inline u32 fifo_intr_0_bind_error_reset_f(void)
164{
165 return 0x1U;
166}
167static inline u32 fifo_intr_0_sched_error_pending_f(void)
168{
169 return 0x100U;
170}
171static inline u32 fifo_intr_0_sched_error_reset_f(void)
172{
173 return 0x100U;
174}
175static inline u32 fifo_intr_0_chsw_error_pending_f(void)
176{
177 return 0x10000U;
178}
179static inline u32 fifo_intr_0_chsw_error_reset_f(void)
180{
181 return 0x10000U;
182}
183static inline u32 fifo_intr_0_fb_flush_timeout_pending_f(void)
184{
185 return 0x800000U;
186}
187static inline u32 fifo_intr_0_fb_flush_timeout_reset_f(void)
188{
189 return 0x800000U;
190}
191static inline u32 fifo_intr_0_lb_error_pending_f(void)
192{
193 return 0x1000000U;
194}
195static inline u32 fifo_intr_0_lb_error_reset_f(void)
196{
197 return 0x1000000U;
198}
199static inline u32 fifo_intr_0_dropped_mmu_fault_pending_f(void)
200{
201 return 0x8000000U;
202}
203static inline u32 fifo_intr_0_dropped_mmu_fault_reset_f(void)
204{
205 return 0x8000000U;
206}
207static inline u32 fifo_intr_0_mmu_fault_pending_f(void)
208{
209 return 0x10000000U;
210}
211static inline u32 fifo_intr_0_pbdma_intr_pending_f(void)
212{
213 return 0x20000000U;
214}
215static inline u32 fifo_intr_0_runlist_event_pending_f(void)
216{
217 return 0x40000000U;
218}
219static inline u32 fifo_intr_0_channel_intr_pending_f(void)
220{
221 return 0x80000000U;
222}
223static inline u32 fifo_intr_en_0_r(void)
224{
225 return 0x00002140U;
226}
227static inline u32 fifo_intr_en_0_sched_error_f(u32 v)
228{
229 return (v & 0x1U) << 8U;
230}
231static inline u32 fifo_intr_en_0_sched_error_m(void)
232{
233 return 0x1U << 8U;
234}
235static inline u32 fifo_intr_en_0_mmu_fault_f(u32 v)
236{
237 return (v & 0x1U) << 28U;
238}
239static inline u32 fifo_intr_en_0_mmu_fault_m(void)
240{
241 return 0x1U << 28U;
242}
243static inline u32 fifo_intr_en_1_r(void)
244{
245 return 0x00002528U;
246}
247static inline u32 fifo_intr_bind_error_r(void)
248{
249 return 0x0000252cU;
250}
251static inline u32 fifo_intr_sched_error_r(void)
252{
253 return 0x0000254cU;
254}
255static inline u32 fifo_intr_sched_error_code_f(u32 v)
256{
257 return (v & 0xffU) << 0U;
258}
259static inline u32 fifo_intr_sched_error_code_ctxsw_timeout_v(void)
260{
261 return 0x0000000aU;
262}
263static inline u32 fifo_intr_chsw_error_r(void)
264{
265 return 0x0000256cU;
266}
267static inline u32 fifo_intr_mmu_fault_id_r(void)
268{
269 return 0x0000259cU;
270}
271static inline u32 fifo_intr_mmu_fault_eng_id_graphics_v(void)
272{
273 return 0x00000000U;
274}
275static inline u32 fifo_intr_mmu_fault_eng_id_graphics_f(void)
276{
277 return 0x0U;
278}
279static inline u32 fifo_intr_mmu_fault_inst_r(u32 i)
280{
281 return 0x00002800U + i*16U;
282}
283static inline u32 fifo_intr_mmu_fault_inst_ptr_v(u32 r)
284{
285 return (r >> 0U) & 0xfffffffU;
286}
287static inline u32 fifo_intr_mmu_fault_inst_ptr_align_shift_v(void)
288{
289 return 0x0000000cU;
290}
291static inline u32 fifo_intr_mmu_fault_lo_r(u32 i)
292{
293 return 0x00002804U + i*16U;
294}
295static inline u32 fifo_intr_mmu_fault_hi_r(u32 i)
296{
297 return 0x00002808U + i*16U;
298}
299static inline u32 fifo_intr_mmu_fault_info_r(u32 i)
300{
301 return 0x0000280cU + i*16U;
302}
303static inline u32 fifo_intr_mmu_fault_info_type_v(u32 r)
304{
305 return (r >> 0U) & 0xfU;
306}
307static inline u32 fifo_intr_mmu_fault_info_write_v(u32 r)
308{
309 return (r >> 7U) & 0x1U;
310}
311static inline u32 fifo_intr_mmu_fault_info_engine_subid_v(u32 r)
312{
313 return (r >> 6U) & 0x1U;
314}
315static inline u32 fifo_intr_mmu_fault_info_engine_subid_gpc_v(void)
316{
317 return 0x00000000U;
318}
319static inline u32 fifo_intr_mmu_fault_info_engine_subid_hub_v(void)
320{
321 return 0x00000001U;
322}
323static inline u32 fifo_intr_mmu_fault_info_client_v(u32 r)
324{
325 return (r >> 8U) & 0x3fU;
326}
327static inline u32 fifo_intr_pbdma_id_r(void)
328{
329 return 0x000025a0U;
330}
331static inline u32 fifo_intr_pbdma_id_status_f(u32 v, u32 i)
332{
333 return (v & 0x1U) << (0U + i*1U);
334}
335static inline u32 fifo_intr_pbdma_id_status_v(u32 r, u32 i)
336{
337 return (r >> (0U + i*1U)) & 0x1U;
338}
339static inline u32 fifo_intr_pbdma_id_status__size_1_v(void)
340{
341 return 0x00000001U;
342}
343static inline u32 fifo_intr_runlist_r(void)
344{
345 return 0x00002a00U;
346}
347static inline u32 fifo_fb_timeout_r(void)
348{
349 return 0x00002a04U;
350}
351static inline u32 fifo_fb_timeout_period_m(void)
352{
353 return 0x3fffffffU << 0U;
354}
355static inline u32 fifo_fb_timeout_period_max_f(void)
356{
357 return 0x3fffffffU;
358}
359static inline u32 fifo_error_sched_disable_r(void)
360{
361 return 0x0000262cU;
362}
363static inline u32 fifo_sched_disable_r(void)
364{
365 return 0x00002630U;
366}
367static inline u32 fifo_sched_disable_runlist_f(u32 v, u32 i)
368{
369 return (v & 0x1U) << (0U + i*1U);
370}
371static inline u32 fifo_sched_disable_runlist_m(u32 i)
372{
373 return 0x1U << (0U + i*1U);
374}
375static inline u32 fifo_sched_disable_true_v(void)
376{
377 return 0x00000001U;
378}
379static inline u32 fifo_preempt_r(void)
380{
381 return 0x00002634U;
382}
383static inline u32 fifo_preempt_pending_true_f(void)
384{
385 return 0x100000U;
386}
387static inline u32 fifo_preempt_type_channel_f(void)
388{
389 return 0x0U;
390}
391static inline u32 fifo_preempt_type_tsg_f(void)
392{
393 return 0x1000000U;
394}
395static inline u32 fifo_preempt_chid_f(u32 v)
396{
397 return (v & 0xfffU) << 0U;
398}
399static inline u32 fifo_preempt_id_f(u32 v)
400{
401 return (v & 0xfffU) << 0U;
402}
403static inline u32 fifo_trigger_mmu_fault_r(u32 i)
404{
405 return 0x00002a30U + i*4U;
406}
407static inline u32 fifo_trigger_mmu_fault_id_f(u32 v)
408{
409 return (v & 0x1fU) << 0U;
410}
411static inline u32 fifo_trigger_mmu_fault_enable_f(u32 v)
412{
413 return (v & 0x1U) << 8U;
414}
415static inline u32 fifo_engine_status_r(u32 i)
416{
417 return 0x00002640U + i*8U;
418}
419static inline u32 fifo_engine_status__size_1_v(void)
420{
421 return 0x00000002U;
422}
423static inline u32 fifo_engine_status_id_v(u32 r)
424{
425 return (r >> 0U) & 0xfffU;
426}
427static inline u32 fifo_engine_status_id_type_v(u32 r)
428{
429 return (r >> 12U) & 0x1U;
430}
431static inline u32 fifo_engine_status_id_type_chid_v(void)
432{
433 return 0x00000000U;
434}
435static inline u32 fifo_engine_status_id_type_tsgid_v(void)
436{
437 return 0x00000001U;
438}
439static inline u32 fifo_engine_status_ctx_status_v(u32 r)
440{
441 return (r >> 13U) & 0x7U;
442}
443static inline u32 fifo_engine_status_ctx_status_invalid_v(void)
444{
445 return 0x00000000U;
446}
447static inline u32 fifo_engine_status_ctx_status_valid_v(void)
448{
449 return 0x00000001U;
450}
451static inline u32 fifo_engine_status_ctx_status_ctxsw_load_v(void)
452{
453 return 0x00000005U;
454}
455static inline u32 fifo_engine_status_ctx_status_ctxsw_save_v(void)
456{
457 return 0x00000006U;
458}
459static inline u32 fifo_engine_status_ctx_status_ctxsw_switch_v(void)
460{
461 return 0x00000007U;
462}
463static inline u32 fifo_engine_status_next_id_v(u32 r)
464{
465 return (r >> 16U) & 0xfffU;
466}
467static inline u32 fifo_engine_status_next_id_type_v(u32 r)
468{
469 return (r >> 28U) & 0x1U;
470}
471static inline u32 fifo_engine_status_next_id_type_chid_v(void)
472{
473 return 0x00000000U;
474}
475static inline u32 fifo_engine_status_faulted_v(u32 r)
476{
477 return (r >> 30U) & 0x1U;
478}
479static inline u32 fifo_engine_status_faulted_true_v(void)
480{
481 return 0x00000001U;
482}
483static inline u32 fifo_engine_status_engine_v(u32 r)
484{
485 return (r >> 31U) & 0x1U;
486}
487static inline u32 fifo_engine_status_engine_idle_v(void)
488{
489 return 0x00000000U;
490}
491static inline u32 fifo_engine_status_engine_busy_v(void)
492{
493 return 0x00000001U;
494}
495static inline u32 fifo_engine_status_ctxsw_v(u32 r)
496{
497 return (r >> 15U) & 0x1U;
498}
499static inline u32 fifo_engine_status_ctxsw_in_progress_v(void)
500{
501 return 0x00000001U;
502}
503static inline u32 fifo_engine_status_ctxsw_in_progress_f(void)
504{
505 return 0x8000U;
506}
507static inline u32 fifo_pbdma_status_r(u32 i)
508{
509 return 0x00003080U + i*4U;
510}
511static inline u32 fifo_pbdma_status__size_1_v(void)
512{
513 return 0x00000001U;
514}
515static inline u32 fifo_pbdma_status_id_v(u32 r)
516{
517 return (r >> 0U) & 0xfffU;
518}
519static inline u32 fifo_pbdma_status_id_type_v(u32 r)
520{
521 return (r >> 12U) & 0x1U;
522}
523static inline u32 fifo_pbdma_status_id_type_chid_v(void)
524{
525 return 0x00000000U;
526}
527static inline u32 fifo_pbdma_status_id_type_tsgid_v(void)
528{
529 return 0x00000001U;
530}
531static inline u32 fifo_pbdma_status_chan_status_v(u32 r)
532{
533 return (r >> 13U) & 0x7U;
534}
535static inline u32 fifo_pbdma_status_chan_status_valid_v(void)
536{
537 return 0x00000001U;
538}
539static inline u32 fifo_pbdma_status_chan_status_chsw_load_v(void)
540{
541 return 0x00000005U;
542}
543static inline u32 fifo_pbdma_status_chan_status_chsw_save_v(void)
544{
545 return 0x00000006U;
546}
547static inline u32 fifo_pbdma_status_chan_status_chsw_switch_v(void)
548{
549 return 0x00000007U;
550}
551static inline u32 fifo_pbdma_status_next_id_v(u32 r)
552{
553 return (r >> 16U) & 0xfffU;
554}
555static inline u32 fifo_pbdma_status_next_id_type_v(u32 r)
556{
557 return (r >> 28U) & 0x1U;
558}
559static inline u32 fifo_pbdma_status_next_id_type_chid_v(void)
560{
561 return 0x00000000U;
562}
563static inline u32 fifo_pbdma_status_chsw_v(u32 r)
564{
565 return (r >> 15U) & 0x1U;
566}
567static inline u32 fifo_pbdma_status_chsw_in_progress_v(void)
568{
569 return 0x00000001U;
570}
571#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_flush_gm20b.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_flush_gm20b.h
new file mode 100644
index 00000000..3b5801b6
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_flush_gm20b.h
@@ -0,0 +1,187 @@
1/*
2 * Copyright (c) 2014-2017, 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_flush_gm20b_h_
57#define _hw_flush_gm20b_h_
58
59static inline u32 flush_l2_system_invalidate_r(void)
60{
61 return 0x00070004U;
62}
63static inline u32 flush_l2_system_invalidate_pending_v(u32 r)
64{
65 return (r >> 0U) & 0x1U;
66}
67static inline u32 flush_l2_system_invalidate_pending_busy_v(void)
68{
69 return 0x00000001U;
70}
71static inline u32 flush_l2_system_invalidate_pending_busy_f(void)
72{
73 return 0x1U;
74}
75static inline u32 flush_l2_system_invalidate_outstanding_v(u32 r)
76{
77 return (r >> 1U) & 0x1U;
78}
79static inline u32 flush_l2_system_invalidate_outstanding_true_v(void)
80{
81 return 0x00000001U;
82}
83static inline u32 flush_l2_flush_dirty_r(void)
84{
85 return 0x00070010U;
86}
87static inline u32 flush_l2_flush_dirty_pending_v(u32 r)
88{
89 return (r >> 0U) & 0x1U;
90}
91static inline u32 flush_l2_flush_dirty_pending_empty_v(void)
92{
93 return 0x00000000U;
94}
95static inline u32 flush_l2_flush_dirty_pending_empty_f(void)
96{
97 return 0x0U;
98}
99static inline u32 flush_l2_flush_dirty_pending_busy_v(void)
100{
101 return 0x00000001U;
102}
103static inline u32 flush_l2_flush_dirty_pending_busy_f(void)
104{
105 return 0x1U;
106}
107static inline u32 flush_l2_flush_dirty_outstanding_v(u32 r)
108{
109 return (r >> 1U) & 0x1U;
110}
111static inline u32 flush_l2_flush_dirty_outstanding_false_v(void)
112{
113 return 0x00000000U;
114}
115static inline u32 flush_l2_flush_dirty_outstanding_false_f(void)
116{
117 return 0x0U;
118}
119static inline u32 flush_l2_flush_dirty_outstanding_true_v(void)
120{
121 return 0x00000001U;
122}
123static inline u32 flush_l2_clean_comptags_r(void)
124{
125 return 0x0007000cU;
126}
127static inline u32 flush_l2_clean_comptags_pending_v(u32 r)
128{
129 return (r >> 0U) & 0x1U;
130}
131static inline u32 flush_l2_clean_comptags_pending_empty_v(void)
132{
133 return 0x00000000U;
134}
135static inline u32 flush_l2_clean_comptags_pending_empty_f(void)
136{
137 return 0x0U;
138}
139static inline u32 flush_l2_clean_comptags_pending_busy_v(void)
140{
141 return 0x00000001U;
142}
143static inline u32 flush_l2_clean_comptags_pending_busy_f(void)
144{
145 return 0x1U;
146}
147static inline u32 flush_l2_clean_comptags_outstanding_v(u32 r)
148{
149 return (r >> 1U) & 0x1U;
150}
151static inline u32 flush_l2_clean_comptags_outstanding_false_v(void)
152{
153 return 0x00000000U;
154}
155static inline u32 flush_l2_clean_comptags_outstanding_false_f(void)
156{
157 return 0x0U;
158}
159static inline u32 flush_l2_clean_comptags_outstanding_true_v(void)
160{
161 return 0x00000001U;
162}
163static inline u32 flush_fb_flush_r(void)
164{
165 return 0x00070000U;
166}
167static inline u32 flush_fb_flush_pending_v(u32 r)
168{
169 return (r >> 0U) & 0x1U;
170}
171static inline u32 flush_fb_flush_pending_busy_v(void)
172{
173 return 0x00000001U;
174}
175static inline u32 flush_fb_flush_pending_busy_f(void)
176{
177 return 0x1U;
178}
179static inline u32 flush_fb_flush_outstanding_v(u32 r)
180{
181 return (r >> 1U) & 0x1U;
182}
183static inline u32 flush_fb_flush_outstanding_true_v(void)
184{
185 return 0x00000001U;
186}
187#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_fuse_gm20b.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_fuse_gm20b.h
new file mode 100644
index 00000000..99b4b3f3
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_fuse_gm20b.h
@@ -0,0 +1,143 @@
1/*
2 * Copyright (c) 2014-2017, 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_fuse_gm20b_h_
57#define _hw_fuse_gm20b_h_
58
59static inline u32 fuse_status_opt_tpc_gpc_r(u32 i)
60{
61 return 0x00021c38U + i*4U;
62}
63static inline u32 fuse_ctrl_opt_tpc_gpc_r(u32 i)
64{
65 return 0x00021838U + i*4U;
66}
67static inline u32 fuse_ctrl_opt_ram_svop_pdp_r(void)
68{
69 return 0x00021944U;
70}
71static inline u32 fuse_ctrl_opt_ram_svop_pdp_data_f(u32 v)
72{
73 return (v & 0x3U) << 0U;
74}
75static inline u32 fuse_ctrl_opt_ram_svop_pdp_data_m(void)
76{
77 return 0x3U << 0U;
78}
79static inline u32 fuse_ctrl_opt_ram_svop_pdp_data_v(u32 r)
80{
81 return (r >> 0U) & 0x3U;
82}
83static inline u32 fuse_ctrl_opt_ram_svop_pdp_override_r(void)
84{
85 return 0x00021948U;
86}
87static inline u32 fuse_ctrl_opt_ram_svop_pdp_override_data_f(u32 v)
88{
89 return (v & 0x1U) << 0U;
90}
91static inline u32 fuse_ctrl_opt_ram_svop_pdp_override_data_m(void)
92{
93 return 0x1U << 0U;
94}
95static inline u32 fuse_ctrl_opt_ram_svop_pdp_override_data_v(u32 r)
96{
97 return (r >> 0U) & 0x1U;
98}
99static inline u32 fuse_ctrl_opt_ram_svop_pdp_override_data_yes_f(void)
100{
101 return 0x1U;
102}
103static inline u32 fuse_ctrl_opt_ram_svop_pdp_override_data_no_f(void)
104{
105 return 0x0U;
106}
107static inline u32 fuse_status_opt_fbio_r(void)
108{
109 return 0x00021c14U;
110}
111static inline u32 fuse_status_opt_fbio_data_f(u32 v)
112{
113 return (v & 0xffffU) << 0U;
114}
115static inline u32 fuse_status_opt_fbio_data_m(void)
116{
117 return 0xffffU << 0U;
118}
119static inline u32 fuse_status_opt_fbio_data_v(u32 r)
120{
121 return (r >> 0U) & 0xffffU;
122}
123static inline u32 fuse_status_opt_rop_l2_fbp_r(u32 i)
124{
125 return 0x00021d70U + i*4U;
126}
127static inline u32 fuse_status_opt_fbp_r(void)
128{
129 return 0x00021d38U;
130}
131static inline u32 fuse_status_opt_fbp_idx_v(u32 r, u32 i)
132{
133 return (r >> (0U + i*1U)) & 0x1U;
134}
135static inline u32 fuse_opt_sec_debug_en_r(void)
136{
137 return 0x00021218U;
138}
139static inline u32 fuse_opt_priv_sec_en_r(void)
140{
141 return 0x00021434U;
142}
143#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_gmmu_gm20b.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_gmmu_gm20b.h
new file mode 100644
index 00000000..e11ac246
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_gmmu_gm20b.h
@@ -0,0 +1,1207 @@
1/*
2 * Copyright (c) 2014-2017, 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_gmmu_gm20b_h_
57#define _hw_gmmu_gm20b_h_
58
59static inline u32 gmmu_pde_aperture_big_w(void)
60{
61 return 0U;
62}
63static inline u32 gmmu_pde_aperture_big_invalid_f(void)
64{
65 return 0x0U;
66}
67static inline u32 gmmu_pde_aperture_big_video_memory_f(void)
68{
69 return 0x1U;
70}
71static inline u32 gmmu_pde_aperture_big_sys_mem_coh_f(void)
72{
73 return 0x2U;
74}
75static inline u32 gmmu_pde_aperture_big_sys_mem_ncoh_f(void)
76{
77 return 0x3U;
78}
79static inline u32 gmmu_pde_size_w(void)
80{
81 return 0U;
82}
83static inline u32 gmmu_pde_size_full_f(void)
84{
85 return 0x0U;
86}
87static inline u32 gmmu_pde_address_big_sys_f(u32 v)
88{
89 return (v & 0xfffffffU) << 4U;
90}
91static inline u32 gmmu_pde_address_big_sys_w(void)
92{
93 return 0U;
94}
95static inline u32 gmmu_pde_aperture_small_w(void)
96{
97 return 1U;
98}
99static inline u32 gmmu_pde_aperture_small_invalid_f(void)
100{
101 return 0x0U;
102}
103static inline u32 gmmu_pde_aperture_small_video_memory_f(void)
104{
105 return 0x1U;
106}
107static inline u32 gmmu_pde_aperture_small_sys_mem_coh_f(void)
108{
109 return 0x2U;
110}
111static inline u32 gmmu_pde_aperture_small_sys_mem_ncoh_f(void)
112{
113 return 0x3U;
114}
115static inline u32 gmmu_pde_vol_small_w(void)
116{
117 return 1U;
118}
119static inline u32 gmmu_pde_vol_small_true_f(void)
120{
121 return 0x4U;
122}
123static inline u32 gmmu_pde_vol_small_false_f(void)
124{
125 return 0x0U;
126}
127static inline u32 gmmu_pde_vol_big_w(void)
128{
129 return 1U;
130}
131static inline u32 gmmu_pde_vol_big_true_f(void)
132{
133 return 0x8U;
134}
135static inline u32 gmmu_pde_vol_big_false_f(void)
136{
137 return 0x0U;
138}
139static inline u32 gmmu_pde_address_small_sys_f(u32 v)
140{
141 return (v & 0xfffffffU) << 4U;
142}
143static inline u32 gmmu_pde_address_small_sys_w(void)
144{
145 return 1U;
146}
147static inline u32 gmmu_pde_address_shift_v(void)
148{
149 return 0x0000000cU;
150}
151static inline u32 gmmu_pde__size_v(void)
152{
153 return 0x00000008U;
154}
155static inline u32 gmmu_pte__size_v(void)
156{
157 return 0x00000008U;
158}
159static inline u32 gmmu_pte_valid_w(void)
160{
161 return 0U;
162}
163static inline u32 gmmu_pte_valid_true_f(void)
164{
165 return 0x1U;
166}
167static inline u32 gmmu_pte_valid_false_f(void)
168{
169 return 0x0U;
170}
171static inline u32 gmmu_pte_privilege_w(void)
172{
173 return 0U;
174}
175static inline u32 gmmu_pte_privilege_true_f(void)
176{
177 return 0x2U;
178}
179static inline u32 gmmu_pte_privilege_false_f(void)
180{
181 return 0x0U;
182}
183static inline u32 gmmu_pte_address_sys_f(u32 v)
184{
185 return (v & 0xfffffffU) << 4U;
186}
187static inline u32 gmmu_pte_address_sys_w(void)
188{
189 return 0U;
190}
191static inline u32 gmmu_pte_address_vid_f(u32 v)
192{
193 return (v & 0x1ffffffU) << 4U;
194}
195static inline u32 gmmu_pte_address_vid_w(void)
196{
197 return 0U;
198}
199static inline u32 gmmu_pte_vol_w(void)
200{
201 return 1U;
202}
203static inline u32 gmmu_pte_vol_true_f(void)
204{
205 return 0x1U;
206}
207static inline u32 gmmu_pte_vol_false_f(void)
208{
209 return 0x0U;
210}
211static inline u32 gmmu_pte_aperture_w(void)
212{
213 return 1U;
214}
215static inline u32 gmmu_pte_aperture_video_memory_f(void)
216{
217 return 0x0U;
218}
219static inline u32 gmmu_pte_aperture_sys_mem_coh_f(void)
220{
221 return 0x4U;
222}
223static inline u32 gmmu_pte_aperture_sys_mem_ncoh_f(void)
224{
225 return 0x6U;
226}
227static inline u32 gmmu_pte_read_only_w(void)
228{
229 return 0U;
230}
231static inline u32 gmmu_pte_read_only_true_f(void)
232{
233 return 0x4U;
234}
235static inline u32 gmmu_pte_write_disable_w(void)
236{
237 return 1U;
238}
239static inline u32 gmmu_pte_write_disable_true_f(void)
240{
241 return 0x80000000U;
242}
243static inline u32 gmmu_pte_read_disable_w(void)
244{
245 return 1U;
246}
247static inline u32 gmmu_pte_read_disable_true_f(void)
248{
249 return 0x40000000U;
250}
251static inline u32 gmmu_pte_comptagline_s(void)
252{
253 return 17U;
254}
255static inline u32 gmmu_pte_comptagline_f(u32 v)
256{
257 return (v & 0x1ffffU) << 12U;
258}
259static inline u32 gmmu_pte_comptagline_w(void)
260{
261 return 1U;
262}
263static inline u32 gmmu_pte_address_shift_v(void)
264{
265 return 0x0000000cU;
266}
267static inline u32 gmmu_pte_kind_f(u32 v)
268{
269 return (v & 0xffU) << 4U;
270}
271static inline u32 gmmu_pte_kind_w(void)
272{
273 return 1U;
274}
275static inline u32 gmmu_pte_kind_invalid_v(void)
276{
277 return 0x000000ffU;
278}
279static inline u32 gmmu_pte_kind_pitch_v(void)
280{
281 return 0x00000000U;
282}
283static inline u32 gmmu_pte_kind_z16_v(void)
284{
285 return 0x00000001U;
286}
287static inline u32 gmmu_pte_kind_z16_2c_v(void)
288{
289 return 0x00000002U;
290}
291static inline u32 gmmu_pte_kind_z16_ms2_2c_v(void)
292{
293 return 0x00000003U;
294}
295static inline u32 gmmu_pte_kind_z16_ms4_2c_v(void)
296{
297 return 0x00000004U;
298}
299static inline u32 gmmu_pte_kind_z16_ms8_2c_v(void)
300{
301 return 0x00000005U;
302}
303static inline u32 gmmu_pte_kind_z16_ms16_2c_v(void)
304{
305 return 0x00000006U;
306}
307static inline u32 gmmu_pte_kind_z16_2z_v(void)
308{
309 return 0x00000007U;
310}
311static inline u32 gmmu_pte_kind_z16_ms2_2z_v(void)
312{
313 return 0x00000008U;
314}
315static inline u32 gmmu_pte_kind_z16_ms4_2z_v(void)
316{
317 return 0x00000009U;
318}
319static inline u32 gmmu_pte_kind_z16_ms8_2z_v(void)
320{
321 return 0x0000000aU;
322}
323static inline u32 gmmu_pte_kind_z16_ms16_2z_v(void)
324{
325 return 0x0000000bU;
326}
327static inline u32 gmmu_pte_kind_z16_4cz_v(void)
328{
329 return 0x0000000cU;
330}
331static inline u32 gmmu_pte_kind_z16_ms2_4cz_v(void)
332{
333 return 0x0000000dU;
334}
335static inline u32 gmmu_pte_kind_z16_ms4_4cz_v(void)
336{
337 return 0x0000000eU;
338}
339static inline u32 gmmu_pte_kind_z16_ms8_4cz_v(void)
340{
341 return 0x0000000fU;
342}
343static inline u32 gmmu_pte_kind_z16_ms16_4cz_v(void)
344{
345 return 0x00000010U;
346}
347static inline u32 gmmu_pte_kind_s8z24_v(void)
348{
349 return 0x00000011U;
350}
351static inline u32 gmmu_pte_kind_s8z24_1z_v(void)
352{
353 return 0x00000012U;
354}
355static inline u32 gmmu_pte_kind_s8z24_ms2_1z_v(void)
356{
357 return 0x00000013U;
358}
359static inline u32 gmmu_pte_kind_s8z24_ms4_1z_v(void)
360{
361 return 0x00000014U;
362}
363static inline u32 gmmu_pte_kind_s8z24_ms8_1z_v(void)
364{
365 return 0x00000015U;
366}
367static inline u32 gmmu_pte_kind_s8z24_ms16_1z_v(void)
368{
369 return 0x00000016U;
370}
371static inline u32 gmmu_pte_kind_s8z24_2cz_v(void)
372{
373 return 0x00000017U;
374}
375static inline u32 gmmu_pte_kind_s8z24_ms2_2cz_v(void)
376{
377 return 0x00000018U;
378}
379static inline u32 gmmu_pte_kind_s8z24_ms4_2cz_v(void)
380{
381 return 0x00000019U;
382}
383static inline u32 gmmu_pte_kind_s8z24_ms8_2cz_v(void)
384{
385 return 0x0000001aU;
386}
387static inline u32 gmmu_pte_kind_s8z24_ms16_2cz_v(void)
388{
389 return 0x0000001bU;
390}
391static inline u32 gmmu_pte_kind_s8z24_2cs_v(void)
392{
393 return 0x0000001cU;
394}
395static inline u32 gmmu_pte_kind_s8z24_ms2_2cs_v(void)
396{
397 return 0x0000001dU;
398}
399static inline u32 gmmu_pte_kind_s8z24_ms4_2cs_v(void)
400{
401 return 0x0000001eU;
402}
403static inline u32 gmmu_pte_kind_s8z24_ms8_2cs_v(void)
404{
405 return 0x0000001fU;
406}
407static inline u32 gmmu_pte_kind_s8z24_ms16_2cs_v(void)
408{
409 return 0x00000020U;
410}
411static inline u32 gmmu_pte_kind_s8z24_4cszv_v(void)
412{
413 return 0x00000021U;
414}
415static inline u32 gmmu_pte_kind_s8z24_ms2_4cszv_v(void)
416{
417 return 0x00000022U;
418}
419static inline u32 gmmu_pte_kind_s8z24_ms4_4cszv_v(void)
420{
421 return 0x00000023U;
422}
423static inline u32 gmmu_pte_kind_s8z24_ms8_4cszv_v(void)
424{
425 return 0x00000024U;
426}
427static inline u32 gmmu_pte_kind_s8z24_ms16_4cszv_v(void)
428{
429 return 0x00000025U;
430}
431static inline u32 gmmu_pte_kind_v8z24_ms4_vc12_v(void)
432{
433 return 0x00000026U;
434}
435static inline u32 gmmu_pte_kind_v8z24_ms4_vc4_v(void)
436{
437 return 0x00000027U;
438}
439static inline u32 gmmu_pte_kind_v8z24_ms8_vc8_v(void)
440{
441 return 0x00000028U;
442}
443static inline u32 gmmu_pte_kind_v8z24_ms8_vc24_v(void)
444{
445 return 0x00000029U;
446}
447static inline u32 gmmu_pte_kind_v8z24_ms4_vc12_1zv_v(void)
448{
449 return 0x0000002eU;
450}
451static inline u32 gmmu_pte_kind_v8z24_ms4_vc4_1zv_v(void)
452{
453 return 0x0000002fU;
454}
455static inline u32 gmmu_pte_kind_v8z24_ms8_vc8_1zv_v(void)
456{
457 return 0x00000030U;
458}
459static inline u32 gmmu_pte_kind_v8z24_ms8_vc24_1zv_v(void)
460{
461 return 0x00000031U;
462}
463static inline u32 gmmu_pte_kind_v8z24_ms4_vc12_2cs_v(void)
464{
465 return 0x00000032U;
466}
467static inline u32 gmmu_pte_kind_v8z24_ms4_vc4_2cs_v(void)
468{
469 return 0x00000033U;
470}
471static inline u32 gmmu_pte_kind_v8z24_ms8_vc8_2cs_v(void)
472{
473 return 0x00000034U;
474}
475static inline u32 gmmu_pte_kind_v8z24_ms8_vc24_2cs_v(void)
476{
477 return 0x00000035U;
478}
479static inline u32 gmmu_pte_kind_v8z24_ms4_vc12_2czv_v(void)
480{
481 return 0x0000003aU;
482}
483static inline u32 gmmu_pte_kind_v8z24_ms4_vc4_2czv_v(void)
484{
485 return 0x0000003bU;
486}
487static inline u32 gmmu_pte_kind_v8z24_ms8_vc8_2czv_v(void)
488{
489 return 0x0000003cU;
490}
491static inline u32 gmmu_pte_kind_v8z24_ms8_vc24_2czv_v(void)
492{
493 return 0x0000003dU;
494}
495static inline u32 gmmu_pte_kind_v8z24_ms4_vc12_2zv_v(void)
496{
497 return 0x0000003eU;
498}
499static inline u32 gmmu_pte_kind_v8z24_ms4_vc4_2zv_v(void)
500{
501 return 0x0000003fU;
502}
503static inline u32 gmmu_pte_kind_v8z24_ms8_vc8_2zv_v(void)
504{
505 return 0x00000040U;
506}
507static inline u32 gmmu_pte_kind_v8z24_ms8_vc24_2zv_v(void)
508{
509 return 0x00000041U;
510}
511static inline u32 gmmu_pte_kind_v8z24_ms4_vc12_4cszv_v(void)
512{
513 return 0x00000042U;
514}
515static inline u32 gmmu_pte_kind_v8z24_ms4_vc4_4cszv_v(void)
516{
517 return 0x00000043U;
518}
519static inline u32 gmmu_pte_kind_v8z24_ms8_vc8_4cszv_v(void)
520{
521 return 0x00000044U;
522}
523static inline u32 gmmu_pte_kind_v8z24_ms8_vc24_4cszv_v(void)
524{
525 return 0x00000045U;
526}
527static inline u32 gmmu_pte_kind_z24s8_v(void)
528{
529 return 0x00000046U;
530}
531static inline u32 gmmu_pte_kind_z24s8_1z_v(void)
532{
533 return 0x00000047U;
534}
535static inline u32 gmmu_pte_kind_z24s8_ms2_1z_v(void)
536{
537 return 0x00000048U;
538}
539static inline u32 gmmu_pte_kind_z24s8_ms4_1z_v(void)
540{
541 return 0x00000049U;
542}
543static inline u32 gmmu_pte_kind_z24s8_ms8_1z_v(void)
544{
545 return 0x0000004aU;
546}
547static inline u32 gmmu_pte_kind_z24s8_ms16_1z_v(void)
548{
549 return 0x0000004bU;
550}
551static inline u32 gmmu_pte_kind_z24s8_2cs_v(void)
552{
553 return 0x0000004cU;
554}
555static inline u32 gmmu_pte_kind_z24s8_ms2_2cs_v(void)
556{
557 return 0x0000004dU;
558}
559static inline u32 gmmu_pte_kind_z24s8_ms4_2cs_v(void)
560{
561 return 0x0000004eU;
562}
563static inline u32 gmmu_pte_kind_z24s8_ms8_2cs_v(void)
564{
565 return 0x0000004fU;
566}
567static inline u32 gmmu_pte_kind_z24s8_ms16_2cs_v(void)
568{
569 return 0x00000050U;
570}
571static inline u32 gmmu_pte_kind_z24s8_2cz_v(void)
572{
573 return 0x00000051U;
574}
575static inline u32 gmmu_pte_kind_z24s8_ms2_2cz_v(void)
576{
577 return 0x00000052U;
578}
579static inline u32 gmmu_pte_kind_z24s8_ms4_2cz_v(void)
580{
581 return 0x00000053U;
582}
583static inline u32 gmmu_pte_kind_z24s8_ms8_2cz_v(void)
584{
585 return 0x00000054U;
586}
587static inline u32 gmmu_pte_kind_z24s8_ms16_2cz_v(void)
588{
589 return 0x00000055U;
590}
591static inline u32 gmmu_pte_kind_z24s8_4cszv_v(void)
592{
593 return 0x00000056U;
594}
595static inline u32 gmmu_pte_kind_z24s8_ms2_4cszv_v(void)
596{
597 return 0x00000057U;
598}
599static inline u32 gmmu_pte_kind_z24s8_ms4_4cszv_v(void)
600{
601 return 0x00000058U;
602}
603static inline u32 gmmu_pte_kind_z24s8_ms8_4cszv_v(void)
604{
605 return 0x00000059U;
606}
607static inline u32 gmmu_pte_kind_z24s8_ms16_4cszv_v(void)
608{
609 return 0x0000005aU;
610}
611static inline u32 gmmu_pte_kind_z24v8_ms4_vc12_v(void)
612{
613 return 0x0000005bU;
614}
615static inline u32 gmmu_pte_kind_z24v8_ms4_vc4_v(void)
616{
617 return 0x0000005cU;
618}
619static inline u32 gmmu_pte_kind_z24v8_ms8_vc8_v(void)
620{
621 return 0x0000005dU;
622}
623static inline u32 gmmu_pte_kind_z24v8_ms8_vc24_v(void)
624{
625 return 0x0000005eU;
626}
627static inline u32 gmmu_pte_kind_z24v8_ms4_vc12_1zv_v(void)
628{
629 return 0x00000063U;
630}
631static inline u32 gmmu_pte_kind_z24v8_ms4_vc4_1zv_v(void)
632{
633 return 0x00000064U;
634}
635static inline u32 gmmu_pte_kind_z24v8_ms8_vc8_1zv_v(void)
636{
637 return 0x00000065U;
638}
639static inline u32 gmmu_pte_kind_z24v8_ms8_vc24_1zv_v(void)
640{
641 return 0x00000066U;
642}
643static inline u32 gmmu_pte_kind_z24v8_ms4_vc12_2cs_v(void)
644{
645 return 0x00000067U;
646}
647static inline u32 gmmu_pte_kind_z24v8_ms4_vc4_2cs_v(void)
648{
649 return 0x00000068U;
650}
651static inline u32 gmmu_pte_kind_z24v8_ms8_vc8_2cs_v(void)
652{
653 return 0x00000069U;
654}
655static inline u32 gmmu_pte_kind_z24v8_ms8_vc24_2cs_v(void)
656{
657 return 0x0000006aU;
658}
659static inline u32 gmmu_pte_kind_z24v8_ms4_vc12_2czv_v(void)
660{
661 return 0x0000006fU;
662}
663static inline u32 gmmu_pte_kind_z24v8_ms4_vc4_2czv_v(void)
664{
665 return 0x00000070U;
666}
667static inline u32 gmmu_pte_kind_z24v8_ms8_vc8_2czv_v(void)
668{
669 return 0x00000071U;
670}
671static inline u32 gmmu_pte_kind_z24v8_ms8_vc24_2czv_v(void)
672{
673 return 0x00000072U;
674}
675static inline u32 gmmu_pte_kind_z24v8_ms4_vc12_2zv_v(void)
676{
677 return 0x00000073U;
678}
679static inline u32 gmmu_pte_kind_z24v8_ms4_vc4_2zv_v(void)
680{
681 return 0x00000074U;
682}
683static inline u32 gmmu_pte_kind_z24v8_ms8_vc8_2zv_v(void)
684{
685 return 0x00000075U;
686}
687static inline u32 gmmu_pte_kind_z24v8_ms8_vc24_2zv_v(void)
688{
689 return 0x00000076U;
690}
691static inline u32 gmmu_pte_kind_z24v8_ms4_vc12_4cszv_v(void)
692{
693 return 0x00000077U;
694}
695static inline u32 gmmu_pte_kind_z24v8_ms4_vc4_4cszv_v(void)
696{
697 return 0x00000078U;
698}
699static inline u32 gmmu_pte_kind_z24v8_ms8_vc8_4cszv_v(void)
700{
701 return 0x00000079U;
702}
703static inline u32 gmmu_pte_kind_z24v8_ms8_vc24_4cszv_v(void)
704{
705 return 0x0000007aU;
706}
707static inline u32 gmmu_pte_kind_zf32_v(void)
708{
709 return 0x0000007bU;
710}
711static inline u32 gmmu_pte_kind_zf32_1z_v(void)
712{
713 return 0x0000007cU;
714}
715static inline u32 gmmu_pte_kind_zf32_ms2_1z_v(void)
716{
717 return 0x0000007dU;
718}
719static inline u32 gmmu_pte_kind_zf32_ms4_1z_v(void)
720{
721 return 0x0000007eU;
722}
723static inline u32 gmmu_pte_kind_zf32_ms8_1z_v(void)
724{
725 return 0x0000007fU;
726}
727static inline u32 gmmu_pte_kind_zf32_ms16_1z_v(void)
728{
729 return 0x00000080U;
730}
731static inline u32 gmmu_pte_kind_zf32_2cs_v(void)
732{
733 return 0x00000081U;
734}
735static inline u32 gmmu_pte_kind_zf32_ms2_2cs_v(void)
736{
737 return 0x00000082U;
738}
739static inline u32 gmmu_pte_kind_zf32_ms4_2cs_v(void)
740{
741 return 0x00000083U;
742}
743static inline u32 gmmu_pte_kind_zf32_ms8_2cs_v(void)
744{
745 return 0x00000084U;
746}
747static inline u32 gmmu_pte_kind_zf32_ms16_2cs_v(void)
748{
749 return 0x00000085U;
750}
751static inline u32 gmmu_pte_kind_zf32_2cz_v(void)
752{
753 return 0x00000086U;
754}
755static inline u32 gmmu_pte_kind_zf32_ms2_2cz_v(void)
756{
757 return 0x00000087U;
758}
759static inline u32 gmmu_pte_kind_zf32_ms4_2cz_v(void)
760{
761 return 0x00000088U;
762}
763static inline u32 gmmu_pte_kind_zf32_ms8_2cz_v(void)
764{
765 return 0x00000089U;
766}
767static inline u32 gmmu_pte_kind_zf32_ms16_2cz_v(void)
768{
769 return 0x0000008aU;
770}
771static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms4_vc12_v(void)
772{
773 return 0x0000008bU;
774}
775static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms4_vc4_v(void)
776{
777 return 0x0000008cU;
778}
779static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms8_vc8_v(void)
780{
781 return 0x0000008dU;
782}
783static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms8_vc24_v(void)
784{
785 return 0x0000008eU;
786}
787static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms4_vc12_1cs_v(void)
788{
789 return 0x0000008fU;
790}
791static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms4_vc4_1cs_v(void)
792{
793 return 0x00000090U;
794}
795static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms8_vc8_1cs_v(void)
796{
797 return 0x00000091U;
798}
799static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms8_vc24_1cs_v(void)
800{
801 return 0x00000092U;
802}
803static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms4_vc12_1zv_v(void)
804{
805 return 0x00000097U;
806}
807static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms4_vc4_1zv_v(void)
808{
809 return 0x00000098U;
810}
811static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms8_vc8_1zv_v(void)
812{
813 return 0x00000099U;
814}
815static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms8_vc24_1zv_v(void)
816{
817 return 0x0000009aU;
818}
819static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms4_vc12_1czv_v(void)
820{
821 return 0x0000009bU;
822}
823static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms4_vc4_1czv_v(void)
824{
825 return 0x0000009cU;
826}
827static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms8_vc8_1czv_v(void)
828{
829 return 0x0000009dU;
830}
831static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms8_vc24_1czv_v(void)
832{
833 return 0x0000009eU;
834}
835static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms4_vc12_2cs_v(void)
836{
837 return 0x0000009fU;
838}
839static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms4_vc4_2cs_v(void)
840{
841 return 0x000000a0U;
842}
843static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms8_vc8_2cs_v(void)
844{
845 return 0x000000a1U;
846}
847static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms8_vc24_2cs_v(void)
848{
849 return 0x000000a2U;
850}
851static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms4_vc12_2cszv_v(void)
852{
853 return 0x000000a3U;
854}
855static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms4_vc4_2cszv_v(void)
856{
857 return 0x000000a4U;
858}
859static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms8_vc8_2cszv_v(void)
860{
861 return 0x000000a5U;
862}
863static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms8_vc24_2cszv_v(void)
864{
865 return 0x000000a6U;
866}
867static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms4_vc12_v(void)
868{
869 return 0x000000a7U;
870}
871static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms4_vc4_v(void)
872{
873 return 0x000000a8U;
874}
875static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms8_vc8_v(void)
876{
877 return 0x000000a9U;
878}
879static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms8_vc24_v(void)
880{
881 return 0x000000aaU;
882}
883static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms4_vc12_1cs_v(void)
884{
885 return 0x000000abU;
886}
887static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms4_vc4_1cs_v(void)
888{
889 return 0x000000acU;
890}
891static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms8_vc8_1cs_v(void)
892{
893 return 0x000000adU;
894}
895static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms8_vc24_1cs_v(void)
896{
897 return 0x000000aeU;
898}
899static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms4_vc12_1zv_v(void)
900{
901 return 0x000000b3U;
902}
903static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms4_vc4_1zv_v(void)
904{
905 return 0x000000b4U;
906}
907static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms8_vc8_1zv_v(void)
908{
909 return 0x000000b5U;
910}
911static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms8_vc24_1zv_v(void)
912{
913 return 0x000000b6U;
914}
915static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms4_vc12_1czv_v(void)
916{
917 return 0x000000b7U;
918}
919static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms4_vc4_1czv_v(void)
920{
921 return 0x000000b8U;
922}
923static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms8_vc8_1czv_v(void)
924{
925 return 0x000000b9U;
926}
927static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms8_vc24_1czv_v(void)
928{
929 return 0x000000baU;
930}
931static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms4_vc12_2cs_v(void)
932{
933 return 0x000000bbU;
934}
935static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms4_vc4_2cs_v(void)
936{
937 return 0x000000bcU;
938}
939static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms8_vc8_2cs_v(void)
940{
941 return 0x000000bdU;
942}
943static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms8_vc24_2cs_v(void)
944{
945 return 0x000000beU;
946}
947static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms4_vc12_2cszv_v(void)
948{
949 return 0x000000bfU;
950}
951static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms4_vc4_2cszv_v(void)
952{
953 return 0x000000c0U;
954}
955static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms8_vc8_2cszv_v(void)
956{
957 return 0x000000c1U;
958}
959static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms8_vc24_2cszv_v(void)
960{
961 return 0x000000c2U;
962}
963static inline u32 gmmu_pte_kind_zf32_x24s8_v(void)
964{
965 return 0x000000c3U;
966}
967static inline u32 gmmu_pte_kind_zf32_x24s8_1cs_v(void)
968{
969 return 0x000000c4U;
970}
971static inline u32 gmmu_pte_kind_zf32_x24s8_ms2_1cs_v(void)
972{
973 return 0x000000c5U;
974}
975static inline u32 gmmu_pte_kind_zf32_x24s8_ms4_1cs_v(void)
976{
977 return 0x000000c6U;
978}
979static inline u32 gmmu_pte_kind_zf32_x24s8_ms8_1cs_v(void)
980{
981 return 0x000000c7U;
982}
983static inline u32 gmmu_pte_kind_zf32_x24s8_ms16_1cs_v(void)
984{
985 return 0x000000c8U;
986}
987static inline u32 gmmu_pte_kind_zf32_x24s8_2cszv_v(void)
988{
989 return 0x000000ceU;
990}
991static inline u32 gmmu_pte_kind_zf32_x24s8_ms2_2cszv_v(void)
992{
993 return 0x000000cfU;
994}
995static inline u32 gmmu_pte_kind_zf32_x24s8_ms4_2cszv_v(void)
996{
997 return 0x000000d0U;
998}
999static inline u32 gmmu_pte_kind_zf32_x24s8_ms8_2cszv_v(void)
1000{
1001 return 0x000000d1U;
1002}
1003static inline u32 gmmu_pte_kind_zf32_x24s8_ms16_2cszv_v(void)
1004{
1005 return 0x000000d2U;
1006}
1007static inline u32 gmmu_pte_kind_zf32_x24s8_2cs_v(void)
1008{
1009 return 0x000000d3U;
1010}
1011static inline u32 gmmu_pte_kind_zf32_x24s8_ms2_2cs_v(void)
1012{
1013 return 0x000000d4U;
1014}
1015static inline u32 gmmu_pte_kind_zf32_x24s8_ms4_2cs_v(void)
1016{
1017 return 0x000000d5U;
1018}
1019static inline u32 gmmu_pte_kind_zf32_x24s8_ms8_2cs_v(void)
1020{
1021 return 0x000000d6U;
1022}
1023static inline u32 gmmu_pte_kind_zf32_x24s8_ms16_2cs_v(void)
1024{
1025 return 0x000000d7U;
1026}
1027static inline u32 gmmu_pte_kind_generic_16bx2_v(void)
1028{
1029 return 0x000000feU;
1030}
1031static inline u32 gmmu_pte_kind_c32_2c_v(void)
1032{
1033 return 0x000000d8U;
1034}
1035static inline u32 gmmu_pte_kind_c32_2cbr_v(void)
1036{
1037 return 0x000000d9U;
1038}
1039static inline u32 gmmu_pte_kind_c32_2cba_v(void)
1040{
1041 return 0x000000daU;
1042}
1043static inline u32 gmmu_pte_kind_c32_2cra_v(void)
1044{
1045 return 0x000000dbU;
1046}
1047static inline u32 gmmu_pte_kind_c32_2bra_v(void)
1048{
1049 return 0x000000dcU;
1050}
1051static inline u32 gmmu_pte_kind_c32_ms2_2c_v(void)
1052{
1053 return 0x000000ddU;
1054}
1055static inline u32 gmmu_pte_kind_c32_ms2_2cbr_v(void)
1056{
1057 return 0x000000deU;
1058}
1059static inline u32 gmmu_pte_kind_c32_ms2_2cra_v(void)
1060{
1061 return 0x000000ccU;
1062}
1063static inline u32 gmmu_pte_kind_c32_ms4_2c_v(void)
1064{
1065 return 0x000000dfU;
1066}
1067static inline u32 gmmu_pte_kind_c32_ms4_2cbr_v(void)
1068{
1069 return 0x000000e0U;
1070}
1071static inline u32 gmmu_pte_kind_c32_ms4_2cba_v(void)
1072{
1073 return 0x000000e1U;
1074}
1075static inline u32 gmmu_pte_kind_c32_ms4_2cra_v(void)
1076{
1077 return 0x000000e2U;
1078}
1079static inline u32 gmmu_pte_kind_c32_ms4_2bra_v(void)
1080{
1081 return 0x000000e3U;
1082}
1083static inline u32 gmmu_pte_kind_c32_ms8_ms16_2c_v(void)
1084{
1085 return 0x000000e4U;
1086}
1087static inline u32 gmmu_pte_kind_c32_ms8_ms16_2cra_v(void)
1088{
1089 return 0x000000e5U;
1090}
1091static inline u32 gmmu_pte_kind_c64_2c_v(void)
1092{
1093 return 0x000000e6U;
1094}
1095static inline u32 gmmu_pte_kind_c64_2cbr_v(void)
1096{
1097 return 0x000000e7U;
1098}
1099static inline u32 gmmu_pte_kind_c64_2cba_v(void)
1100{
1101 return 0x000000e8U;
1102}
1103static inline u32 gmmu_pte_kind_c64_2cra_v(void)
1104{
1105 return 0x000000e9U;
1106}
1107static inline u32 gmmu_pte_kind_c64_2bra_v(void)
1108{
1109 return 0x000000eaU;
1110}
1111static inline u32 gmmu_pte_kind_c64_ms2_2c_v(void)
1112{
1113 return 0x000000ebU;
1114}
1115static inline u32 gmmu_pte_kind_c64_ms2_2cbr_v(void)
1116{
1117 return 0x000000ecU;
1118}
1119static inline u32 gmmu_pte_kind_c64_ms2_2cra_v(void)
1120{
1121 return 0x000000cdU;
1122}
1123static inline u32 gmmu_pte_kind_c64_ms4_2c_v(void)
1124{
1125 return 0x000000edU;
1126}
1127static inline u32 gmmu_pte_kind_c64_ms4_2cbr_v(void)
1128{
1129 return 0x000000eeU;
1130}
1131static inline u32 gmmu_pte_kind_c64_ms4_2cba_v(void)
1132{
1133 return 0x000000efU;
1134}
1135static inline u32 gmmu_pte_kind_c64_ms4_2cra_v(void)
1136{
1137 return 0x000000f0U;
1138}
1139static inline u32 gmmu_pte_kind_c64_ms4_2bra_v(void)
1140{
1141 return 0x000000f1U;
1142}
1143static inline u32 gmmu_pte_kind_c64_ms8_ms16_2c_v(void)
1144{
1145 return 0x000000f2U;
1146}
1147static inline u32 gmmu_pte_kind_c64_ms8_ms16_2cra_v(void)
1148{
1149 return 0x000000f3U;
1150}
1151static inline u32 gmmu_pte_kind_c128_2c_v(void)
1152{
1153 return 0x000000f4U;
1154}
1155static inline u32 gmmu_pte_kind_c128_2cr_v(void)
1156{
1157 return 0x000000f5U;
1158}
1159static inline u32 gmmu_pte_kind_c128_ms2_2c_v(void)
1160{
1161 return 0x000000f6U;
1162}
1163static inline u32 gmmu_pte_kind_c128_ms2_2cr_v(void)
1164{
1165 return 0x000000f7U;
1166}
1167static inline u32 gmmu_pte_kind_c128_ms4_2c_v(void)
1168{
1169 return 0x000000f8U;
1170}
1171static inline u32 gmmu_pte_kind_c128_ms4_2cr_v(void)
1172{
1173 return 0x000000f9U;
1174}
1175static inline u32 gmmu_pte_kind_c128_ms8_ms16_2c_v(void)
1176{
1177 return 0x000000faU;
1178}
1179static inline u32 gmmu_pte_kind_c128_ms8_ms16_2cr_v(void)
1180{
1181 return 0x000000fbU;
1182}
1183static inline u32 gmmu_pte_kind_x8c24_v(void)
1184{
1185 return 0x000000fcU;
1186}
1187static inline u32 gmmu_pte_kind_pitch_no_swizzle_v(void)
1188{
1189 return 0x000000fdU;
1190}
1191static inline u32 gmmu_pte_kind_smsked_message_v(void)
1192{
1193 return 0x000000caU;
1194}
1195static inline u32 gmmu_pte_kind_smhost_message_v(void)
1196{
1197 return 0x000000cbU;
1198}
1199static inline u32 gmmu_pte_kind_s8_v(void)
1200{
1201 return 0x0000002aU;
1202}
1203static inline u32 gmmu_pte_kind_s8_2s_v(void)
1204{
1205 return 0x0000002bU;
1206}
1207#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_gr_gm20b.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_gr_gm20b.h
new file mode 100644
index 00000000..d9776b7c
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_gr_gm20b.h
@@ -0,0 +1,3891 @@
1/*
2 * Copyright (c) 2014-2017, 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_gr_gm20b_h_
57#define _hw_gr_gm20b_h_
58
59static inline u32 gr_intr_r(void)
60{
61 return 0x00400100U;
62}
63static inline u32 gr_intr_notify_pending_f(void)
64{
65 return 0x1U;
66}
67static inline u32 gr_intr_notify_reset_f(void)
68{
69 return 0x1U;
70}
71static inline u32 gr_intr_semaphore_pending_f(void)
72{
73 return 0x2U;
74}
75static inline u32 gr_intr_semaphore_reset_f(void)
76{
77 return 0x2U;
78}
79static inline u32 gr_intr_illegal_method_pending_f(void)
80{
81 return 0x10U;
82}
83static inline u32 gr_intr_illegal_method_reset_f(void)
84{
85 return 0x10U;
86}
87static inline u32 gr_intr_illegal_notify_pending_f(void)
88{
89 return 0x40U;
90}
91static inline u32 gr_intr_illegal_notify_reset_f(void)
92{
93 return 0x40U;
94}
95static inline u32 gr_intr_firmware_method_f(u32 v)
96{
97 return (v & 0x1U) << 8U;
98}
99static inline u32 gr_intr_firmware_method_pending_f(void)
100{
101 return 0x100U;
102}
103static inline u32 gr_intr_firmware_method_reset_f(void)
104{
105 return 0x100U;
106}
107static inline u32 gr_intr_illegal_class_pending_f(void)
108{
109 return 0x20U;
110}
111static inline u32 gr_intr_illegal_class_reset_f(void)
112{
113 return 0x20U;
114}
115static inline u32 gr_intr_fecs_error_pending_f(void)
116{
117 return 0x80000U;
118}
119static inline u32 gr_intr_fecs_error_reset_f(void)
120{
121 return 0x80000U;
122}
123static inline u32 gr_intr_class_error_pending_f(void)
124{
125 return 0x100000U;
126}
127static inline u32 gr_intr_class_error_reset_f(void)
128{
129 return 0x100000U;
130}
131static inline u32 gr_intr_exception_pending_f(void)
132{
133 return 0x200000U;
134}
135static inline u32 gr_intr_exception_reset_f(void)
136{
137 return 0x200000U;
138}
139static inline u32 gr_fecs_intr_r(void)
140{
141 return 0x00400144U;
142}
143static inline u32 gr_class_error_r(void)
144{
145 return 0x00400110U;
146}
147static inline u32 gr_class_error_code_v(u32 r)
148{
149 return (r >> 0U) & 0xffffU;
150}
151static inline u32 gr_intr_nonstall_r(void)
152{
153 return 0x00400120U;
154}
155static inline u32 gr_intr_nonstall_trap_pending_f(void)
156{
157 return 0x2U;
158}
159static inline u32 gr_intr_en_r(void)
160{
161 return 0x0040013cU;
162}
163static inline u32 gr_exception_r(void)
164{
165 return 0x00400108U;
166}
167static inline u32 gr_exception_fe_m(void)
168{
169 return 0x1U << 0U;
170}
171static inline u32 gr_exception_gpc_m(void)
172{
173 return 0x1U << 24U;
174}
175static inline u32 gr_exception_memfmt_m(void)
176{
177 return 0x1U << 1U;
178}
179static inline u32 gr_exception_ds_m(void)
180{
181 return 0x1U << 4U;
182}
183static inline u32 gr_exception_sked_m(void)
184{
185 return 0x1U << 8U;
186}
187static inline u32 gr_exception1_r(void)
188{
189 return 0x00400118U;
190}
191static inline u32 gr_exception1_gpc_0_pending_f(void)
192{
193 return 0x1U;
194}
195static inline u32 gr_exception2_r(void)
196{
197 return 0x0040011cU;
198}
199static inline u32 gr_exception_en_r(void)
200{
201 return 0x00400138U;
202}
203static inline u32 gr_exception_en_fe_m(void)
204{
205 return 0x1U << 0U;
206}
207static inline u32 gr_exception1_en_r(void)
208{
209 return 0x00400130U;
210}
211static inline u32 gr_exception2_en_r(void)
212{
213 return 0x00400134U;
214}
215static inline u32 gr_gpfifo_ctl_r(void)
216{
217 return 0x00400500U;
218}
219static inline u32 gr_gpfifo_ctl_access_f(u32 v)
220{
221 return (v & 0x1U) << 0U;
222}
223static inline u32 gr_gpfifo_ctl_access_disabled_f(void)
224{
225 return 0x0U;
226}
227static inline u32 gr_gpfifo_ctl_access_enabled_f(void)
228{
229 return 0x1U;
230}
231static inline u32 gr_gpfifo_ctl_semaphore_access_f(u32 v)
232{
233 return (v & 0x1U) << 16U;
234}
235static inline u32 gr_gpfifo_ctl_semaphore_access_enabled_v(void)
236{
237 return 0x00000001U;
238}
239static inline u32 gr_gpfifo_ctl_semaphore_access_enabled_f(void)
240{
241 return 0x10000U;
242}
243static inline u32 gr_gpfifo_status_r(void)
244{
245 return 0x00400504U;
246}
247static inline u32 gr_trapped_addr_r(void)
248{
249 return 0x00400704U;
250}
251static inline u32 gr_trapped_addr_mthd_v(u32 r)
252{
253 return (r >> 2U) & 0xfffU;
254}
255static inline u32 gr_trapped_addr_subch_v(u32 r)
256{
257 return (r >> 16U) & 0x7U;
258}
259static inline u32 gr_trapped_addr_mme_generated_v(u32 r)
260{
261 return (r >> 20U) & 0x1U;
262}
263static inline u32 gr_trapped_addr_datahigh_v(u32 r)
264{
265 return (r >> 24U) & 0x1U;
266}
267static inline u32 gr_trapped_addr_priv_v(u32 r)
268{
269 return (r >> 28U) & 0x1U;
270}
271static inline u32 gr_trapped_addr_status_v(u32 r)
272{
273 return (r >> 31U) & 0x1U;
274}
275static inline u32 gr_trapped_data_lo_r(void)
276{
277 return 0x00400708U;
278}
279static inline u32 gr_trapped_data_hi_r(void)
280{
281 return 0x0040070cU;
282}
283static inline u32 gr_trapped_data_mme_r(void)
284{
285 return 0x00400710U;
286}
287static inline u32 gr_trapped_data_mme_pc_v(u32 r)
288{
289 return (r >> 0U) & 0x7ffU;
290}
291static inline u32 gr_status_r(void)
292{
293 return 0x00400700U;
294}
295static inline u32 gr_status_fe_method_upper_v(u32 r)
296{
297 return (r >> 1U) & 0x1U;
298}
299static inline u32 gr_status_fe_method_lower_v(u32 r)
300{
301 return (r >> 2U) & 0x1U;
302}
303static inline u32 gr_status_fe_method_lower_idle_v(void)
304{
305 return 0x00000000U;
306}
307static inline u32 gr_status_fe_gi_v(u32 r)
308{
309 return (r >> 21U) & 0x1U;
310}
311static inline u32 gr_status_mask_r(void)
312{
313 return 0x00400610U;
314}
315static inline u32 gr_status_1_r(void)
316{
317 return 0x00400604U;
318}
319static inline u32 gr_status_2_r(void)
320{
321 return 0x00400608U;
322}
323static inline u32 gr_engine_status_r(void)
324{
325 return 0x0040060cU;
326}
327static inline u32 gr_engine_status_value_busy_f(void)
328{
329 return 0x1U;
330}
331static inline u32 gr_pri_be0_becs_be_exception_r(void)
332{
333 return 0x00410204U;
334}
335static inline u32 gr_pri_be0_becs_be_exception_en_r(void)
336{
337 return 0x00410208U;
338}
339static inline u32 gr_pri_gpc0_gpccs_gpc_exception_r(void)
340{
341 return 0x00502c90U;
342}
343static inline u32 gr_pri_gpc0_gpccs_gpc_exception_en_r(void)
344{
345 return 0x00502c94U;
346}
347static inline u32 gr_pri_gpc0_tpc0_tpccs_tpc_exception_r(void)
348{
349 return 0x00504508U;
350}
351static inline u32 gr_pri_gpc0_tpc0_tpccs_tpc_exception_en_r(void)
352{
353 return 0x0050450cU;
354}
355static inline u32 gr_activity_0_r(void)
356{
357 return 0x00400380U;
358}
359static inline u32 gr_activity_1_r(void)
360{
361 return 0x00400384U;
362}
363static inline u32 gr_activity_2_r(void)
364{
365 return 0x00400388U;
366}
367static inline u32 gr_activity_4_r(void)
368{
369 return 0x00400390U;
370}
371static inline u32 gr_pri_gpc0_gcc_dbg_r(void)
372{
373 return 0x00501000U;
374}
375static inline u32 gr_pri_gpcs_gcc_dbg_r(void)
376{
377 return 0x00419000U;
378}
379static inline u32 gr_pri_gpcs_gcc_dbg_invalidate_m(void)
380{
381 return 0x1U << 1U;
382}
383static inline u32 gr_pri_gpc0_tpc0_sm_cache_control_r(void)
384{
385 return 0x005046a4U;
386}
387static inline u32 gr_pri_gpcs_tpcs_sm_cache_control_r(void)
388{
389 return 0x00419ea4U;
390}
391static inline u32 gr_pri_gpcs_tpcs_sm_cache_control_invalidate_cache_m(void)
392{
393 return 0x1U << 0U;
394}
395static inline u32 gr_pri_sked_activity_r(void)
396{
397 return 0x00407054U;
398}
399static inline u32 gr_pri_gpc0_gpccs_gpc_activity0_r(void)
400{
401 return 0x00502c80U;
402}
403static inline u32 gr_pri_gpc0_gpccs_gpc_activity1_r(void)
404{
405 return 0x00502c84U;
406}
407static inline u32 gr_pri_gpc0_gpccs_gpc_activity2_r(void)
408{
409 return 0x00502c88U;
410}
411static inline u32 gr_pri_gpc0_gpccs_gpc_activity3_r(void)
412{
413 return 0x00502c8cU;
414}
415static inline u32 gr_pri_gpc0_tpc0_tpccs_tpc_activity_0_r(void)
416{
417 return 0x00504500U;
418}
419static inline u32 gr_pri_gpc0_tpc1_tpccs_tpc_activity_0_r(void)
420{
421 return 0x00504d00U;
422}
423static inline u32 gr_pri_gpc0_tpcs_tpccs_tpc_activity_0_r(void)
424{
425 return 0x00501d00U;
426}
427static inline u32 gr_pri_gpcs_gpccs_gpc_activity_0_r(void)
428{
429 return 0x0041ac80U;
430}
431static inline u32 gr_pri_gpcs_gpccs_gpc_activity_1_r(void)
432{
433 return 0x0041ac84U;
434}
435static inline u32 gr_pri_gpcs_gpccs_gpc_activity_2_r(void)
436{
437 return 0x0041ac88U;
438}
439static inline u32 gr_pri_gpcs_gpccs_gpc_activity_3_r(void)
440{
441 return 0x0041ac8cU;
442}
443static inline u32 gr_pri_gpcs_tpc0_tpccs_tpc_activity_0_r(void)
444{
445 return 0x0041c500U;
446}
447static inline u32 gr_pri_gpcs_tpc1_tpccs_tpc_activity_0_r(void)
448{
449 return 0x0041cd00U;
450}
451static inline u32 gr_pri_gpcs_tpcs_tpccs_tpc_activity_0_r(void)
452{
453 return 0x00419d00U;
454}
455static inline u32 gr_pri_be0_becs_be_activity0_r(void)
456{
457 return 0x00410200U;
458}
459static inline u32 gr_pri_be1_becs_be_activity0_r(void)
460{
461 return 0x00410600U;
462}
463static inline u32 gr_pri_bes_becs_be_activity0_r(void)
464{
465 return 0x00408a00U;
466}
467static inline u32 gr_pri_ds_mpipe_status_r(void)
468{
469 return 0x00405858U;
470}
471static inline u32 gr_pri_fe_go_idle_on_status_r(void)
472{
473 return 0x00404150U;
474}
475static inline u32 gr_pri_fe_go_idle_check_r(void)
476{
477 return 0x00404158U;
478}
479static inline u32 gr_pri_fe_go_idle_info_r(void)
480{
481 return 0x00404194U;
482}
483static inline u32 gr_pri_gpc0_tpc0_tex_m_tex_subunits_status_r(void)
484{
485 return 0x00504238U;
486}
487static inline u32 gr_pri_be0_crop_status1_r(void)
488{
489 return 0x00410134U;
490}
491static inline u32 gr_pri_bes_crop_status1_r(void)
492{
493 return 0x00408934U;
494}
495static inline u32 gr_pri_be0_zrop_status_r(void)
496{
497 return 0x00410048U;
498}
499static inline u32 gr_pri_be0_zrop_status2_r(void)
500{
501 return 0x0041004cU;
502}
503static inline u32 gr_pri_bes_zrop_status_r(void)
504{
505 return 0x00408848U;
506}
507static inline u32 gr_pri_bes_zrop_status2_r(void)
508{
509 return 0x0040884cU;
510}
511static inline u32 gr_pipe_bundle_address_r(void)
512{
513 return 0x00400200U;
514}
515static inline u32 gr_pipe_bundle_address_value_v(u32 r)
516{
517 return (r >> 0U) & 0xffffU;
518}
519static inline u32 gr_pipe_bundle_data_r(void)
520{
521 return 0x00400204U;
522}
523static inline u32 gr_pipe_bundle_config_r(void)
524{
525 return 0x00400208U;
526}
527static inline u32 gr_pipe_bundle_config_override_pipe_mode_disabled_f(void)
528{
529 return 0x0U;
530}
531static inline u32 gr_pipe_bundle_config_override_pipe_mode_enabled_f(void)
532{
533 return 0x80000000U;
534}
535static inline u32 gr_fe_hww_esr_r(void)
536{
537 return 0x00404000U;
538}
539static inline u32 gr_fe_hww_esr_reset_active_f(void)
540{
541 return 0x40000000U;
542}
543static inline u32 gr_fe_hww_esr_en_enable_f(void)
544{
545 return 0x80000000U;
546}
547static inline u32 gr_fe_go_idle_timeout_r(void)
548{
549 return 0x00404154U;
550}
551static inline u32 gr_fe_go_idle_timeout_count_f(u32 v)
552{
553 return (v & 0xffffffffU) << 0U;
554}
555static inline u32 gr_fe_go_idle_timeout_count_disabled_f(void)
556{
557 return 0x0U;
558}
559static inline u32 gr_fe_go_idle_timeout_count_prod_f(void)
560{
561 return 0x800U;
562}
563static inline u32 gr_fe_object_table_r(u32 i)
564{
565 return 0x00404200U + i*4U;
566}
567static inline u32 gr_fe_object_table_nvclass_v(u32 r)
568{
569 return (r >> 0U) & 0xffffU;
570}
571static inline u32 gr_fe_tpc_fs_r(void)
572{
573 return 0x004041c4U;
574}
575static inline u32 gr_pri_mme_shadow_raw_index_r(void)
576{
577 return 0x00404488U;
578}
579static inline u32 gr_pri_mme_shadow_raw_index_write_trigger_f(void)
580{
581 return 0x80000000U;
582}
583static inline u32 gr_pri_mme_shadow_raw_data_r(void)
584{
585 return 0x0040448cU;
586}
587static inline u32 gr_mme_hww_esr_r(void)
588{
589 return 0x00404490U;
590}
591static inline u32 gr_mme_hww_esr_reset_active_f(void)
592{
593 return 0x40000000U;
594}
595static inline u32 gr_mme_hww_esr_en_enable_f(void)
596{
597 return 0x80000000U;
598}
599static inline u32 gr_memfmt_hww_esr_r(void)
600{
601 return 0x00404600U;
602}
603static inline u32 gr_memfmt_hww_esr_reset_active_f(void)
604{
605 return 0x40000000U;
606}
607static inline u32 gr_memfmt_hww_esr_en_enable_f(void)
608{
609 return 0x80000000U;
610}
611static inline u32 gr_fecs_cpuctl_r(void)
612{
613 return 0x00409100U;
614}
615static inline u32 gr_fecs_cpuctl_startcpu_f(u32 v)
616{
617 return (v & 0x1U) << 1U;
618}
619static inline u32 gr_fecs_cpuctl_alias_r(void)
620{
621 return 0x00409130U;
622}
623static inline u32 gr_fecs_cpuctl_alias_startcpu_f(u32 v)
624{
625 return (v & 0x1U) << 1U;
626}
627static inline u32 gr_fecs_dmactl_r(void)
628{
629 return 0x0040910cU;
630}
631static inline u32 gr_fecs_dmactl_require_ctx_f(u32 v)
632{
633 return (v & 0x1U) << 0U;
634}
635static inline u32 gr_fecs_dmactl_dmem_scrubbing_m(void)
636{
637 return 0x1U << 1U;
638}
639static inline u32 gr_fecs_dmactl_imem_scrubbing_m(void)
640{
641 return 0x1U << 2U;
642}
643static inline u32 gr_fecs_os_r(void)
644{
645 return 0x00409080U;
646}
647static inline u32 gr_fecs_idlestate_r(void)
648{
649 return 0x0040904cU;
650}
651static inline u32 gr_fecs_mailbox0_r(void)
652{
653 return 0x00409040U;
654}
655static inline u32 gr_fecs_mailbox1_r(void)
656{
657 return 0x00409044U;
658}
659static inline u32 gr_fecs_irqstat_r(void)
660{
661 return 0x00409008U;
662}
663static inline u32 gr_fecs_irqmode_r(void)
664{
665 return 0x0040900cU;
666}
667static inline u32 gr_fecs_irqmask_r(void)
668{
669 return 0x00409018U;
670}
671static inline u32 gr_fecs_irqdest_r(void)
672{
673 return 0x0040901cU;
674}
675static inline u32 gr_fecs_curctx_r(void)
676{
677 return 0x00409050U;
678}
679static inline u32 gr_fecs_nxtctx_r(void)
680{
681 return 0x00409054U;
682}
683static inline u32 gr_fecs_engctl_r(void)
684{
685 return 0x004090a4U;
686}
687static inline u32 gr_fecs_debug1_r(void)
688{
689 return 0x00409090U;
690}
691static inline u32 gr_fecs_debuginfo_r(void)
692{
693 return 0x00409094U;
694}
695static inline u32 gr_fecs_icd_cmd_r(void)
696{
697 return 0x00409200U;
698}
699static inline u32 gr_fecs_icd_cmd_opc_s(void)
700{
701 return 4U;
702}
703static inline u32 gr_fecs_icd_cmd_opc_f(u32 v)
704{
705 return (v & 0xfU) << 0U;
706}
707static inline u32 gr_fecs_icd_cmd_opc_m(void)
708{
709 return 0xfU << 0U;
710}
711static inline u32 gr_fecs_icd_cmd_opc_v(u32 r)
712{
713 return (r >> 0U) & 0xfU;
714}
715static inline u32 gr_fecs_icd_cmd_opc_rreg_f(void)
716{
717 return 0x8U;
718}
719static inline u32 gr_fecs_icd_cmd_opc_rstat_f(void)
720{
721 return 0xeU;
722}
723static inline u32 gr_fecs_icd_cmd_idx_f(u32 v)
724{
725 return (v & 0x1fU) << 8U;
726}
727static inline u32 gr_fecs_icd_rdata_r(void)
728{
729 return 0x0040920cU;
730}
731static inline u32 gr_fecs_imemc_r(u32 i)
732{
733 return 0x00409180U + i*16U;
734}
735static inline u32 gr_fecs_imemc_offs_f(u32 v)
736{
737 return (v & 0x3fU) << 2U;
738}
739static inline u32 gr_fecs_imemc_blk_f(u32 v)
740{
741 return (v & 0xffU) << 8U;
742}
743static inline u32 gr_fecs_imemc_aincw_f(u32 v)
744{
745 return (v & 0x1U) << 24U;
746}
747static inline u32 gr_fecs_imemd_r(u32 i)
748{
749 return 0x00409184U + i*16U;
750}
751static inline u32 gr_fecs_imemt_r(u32 i)
752{
753 return 0x00409188U + i*16U;
754}
755static inline u32 gr_fecs_imemt_tag_f(u32 v)
756{
757 return (v & 0xffffU) << 0U;
758}
759static inline u32 gr_fecs_dmemc_r(u32 i)
760{
761 return 0x004091c0U + i*8U;
762}
763static inline u32 gr_fecs_dmemc_offs_s(void)
764{
765 return 6U;
766}
767static inline u32 gr_fecs_dmemc_offs_f(u32 v)
768{
769 return (v & 0x3fU) << 2U;
770}
771static inline u32 gr_fecs_dmemc_offs_m(void)
772{
773 return 0x3fU << 2U;
774}
775static inline u32 gr_fecs_dmemc_offs_v(u32 r)
776{
777 return (r >> 2U) & 0x3fU;
778}
779static inline u32 gr_fecs_dmemc_blk_f(u32 v)
780{
781 return (v & 0xffU) << 8U;
782}
783static inline u32 gr_fecs_dmemc_aincw_f(u32 v)
784{
785 return (v & 0x1U) << 24U;
786}
787static inline u32 gr_fecs_dmemd_r(u32 i)
788{
789 return 0x004091c4U + i*8U;
790}
791static inline u32 gr_fecs_dmatrfbase_r(void)
792{
793 return 0x00409110U;
794}
795static inline u32 gr_fecs_dmatrfmoffs_r(void)
796{
797 return 0x00409114U;
798}
799static inline u32 gr_fecs_dmatrffboffs_r(void)
800{
801 return 0x0040911cU;
802}
803static inline u32 gr_fecs_dmatrfcmd_r(void)
804{
805 return 0x00409118U;
806}
807static inline u32 gr_fecs_dmatrfcmd_imem_f(u32 v)
808{
809 return (v & 0x1U) << 4U;
810}
811static inline u32 gr_fecs_dmatrfcmd_write_f(u32 v)
812{
813 return (v & 0x1U) << 5U;
814}
815static inline u32 gr_fecs_dmatrfcmd_size_f(u32 v)
816{
817 return (v & 0x7U) << 8U;
818}
819static inline u32 gr_fecs_dmatrfcmd_ctxdma_f(u32 v)
820{
821 return (v & 0x7U) << 12U;
822}
823static inline u32 gr_fecs_bootvec_r(void)
824{
825 return 0x00409104U;
826}
827static inline u32 gr_fecs_bootvec_vec_f(u32 v)
828{
829 return (v & 0xffffffffU) << 0U;
830}
831static inline u32 gr_fecs_falcon_hwcfg_r(void)
832{
833 return 0x00409108U;
834}
835static inline u32 gr_gpcs_gpccs_falcon_hwcfg_r(void)
836{
837 return 0x0041a108U;
838}
839static inline u32 gr_fecs_falcon_rm_r(void)
840{
841 return 0x00409084U;
842}
843static inline u32 gr_fecs_current_ctx_r(void)
844{
845 return 0x00409b00U;
846}
847static inline u32 gr_fecs_current_ctx_ptr_f(u32 v)
848{
849 return (v & 0xfffffffU) << 0U;
850}
851static inline u32 gr_fecs_current_ctx_ptr_v(u32 r)
852{
853 return (r >> 0U) & 0xfffffffU;
854}
855static inline u32 gr_fecs_current_ctx_target_s(void)
856{
857 return 2U;
858}
859static inline u32 gr_fecs_current_ctx_target_f(u32 v)
860{
861 return (v & 0x3U) << 28U;
862}
863static inline u32 gr_fecs_current_ctx_target_m(void)
864{
865 return 0x3U << 28U;
866}
867static inline u32 gr_fecs_current_ctx_target_v(u32 r)
868{
869 return (r >> 28U) & 0x3U;
870}
871static inline u32 gr_fecs_current_ctx_target_vid_mem_f(void)
872{
873 return 0x0U;
874}
875static inline u32 gr_fecs_current_ctx_target_sys_mem_coh_f(void)
876{
877 return 0x20000000U;
878}
879static inline u32 gr_fecs_current_ctx_target_sys_mem_ncoh_f(void)
880{
881 return 0x30000000U;
882}
883static inline u32 gr_fecs_current_ctx_valid_s(void)
884{
885 return 1U;
886}
887static inline u32 gr_fecs_current_ctx_valid_f(u32 v)
888{
889 return (v & 0x1U) << 31U;
890}
891static inline u32 gr_fecs_current_ctx_valid_m(void)
892{
893 return 0x1U << 31U;
894}
895static inline u32 gr_fecs_current_ctx_valid_v(u32 r)
896{
897 return (r >> 31U) & 0x1U;
898}
899static inline u32 gr_fecs_current_ctx_valid_false_f(void)
900{
901 return 0x0U;
902}
903static inline u32 gr_fecs_method_data_r(void)
904{
905 return 0x00409500U;
906}
907static inline u32 gr_fecs_method_push_r(void)
908{
909 return 0x00409504U;
910}
911static inline u32 gr_fecs_method_push_adr_f(u32 v)
912{
913 return (v & 0xfffU) << 0U;
914}
915static inline u32 gr_fecs_method_push_adr_bind_pointer_v(void)
916{
917 return 0x00000003U;
918}
919static inline u32 gr_fecs_method_push_adr_bind_pointer_f(void)
920{
921 return 0x3U;
922}
923static inline u32 gr_fecs_method_push_adr_discover_image_size_v(void)
924{
925 return 0x00000010U;
926}
927static inline u32 gr_fecs_method_push_adr_wfi_golden_save_v(void)
928{
929 return 0x00000009U;
930}
931static inline u32 gr_fecs_method_push_adr_restore_golden_v(void)
932{
933 return 0x00000015U;
934}
935static inline u32 gr_fecs_method_push_adr_discover_zcull_image_size_v(void)
936{
937 return 0x00000016U;
938}
939static inline u32 gr_fecs_method_push_adr_discover_pm_image_size_v(void)
940{
941 return 0x00000025U;
942}
943static inline u32 gr_fecs_method_push_adr_discover_reglist_image_size_v(void)
944{
945 return 0x00000030U;
946}
947static inline u32 gr_fecs_method_push_adr_set_reglist_bind_instance_v(void)
948{
949 return 0x00000031U;
950}
951static inline u32 gr_fecs_method_push_adr_set_reglist_virtual_address_v(void)
952{
953 return 0x00000032U;
954}
955static inline u32 gr_fecs_method_push_adr_stop_ctxsw_v(void)
956{
957 return 0x00000038U;
958}
959static inline u32 gr_fecs_method_push_adr_start_ctxsw_v(void)
960{
961 return 0x00000039U;
962}
963static inline u32 gr_fecs_method_push_adr_set_watchdog_timeout_f(void)
964{
965 return 0x21U;
966}
967static inline u32 gr_fecs_method_push_adr_write_timestamp_record_v(void)
968{
969 return 0x0000003dU;
970}
971static inline u32 gr_fecs_method_push_adr_halt_pipeline_v(void)
972{
973 return 0x00000004U;
974}
975static inline u32 gr_fecs_host_int_status_r(void)
976{
977 return 0x00409c18U;
978}
979static inline u32 gr_fecs_host_int_status_fault_during_ctxsw_f(u32 v)
980{
981 return (v & 0x1U) << 16U;
982}
983static inline u32 gr_fecs_host_int_status_umimp_firmware_method_f(u32 v)
984{
985 return (v & 0x1U) << 17U;
986}
987static inline u32 gr_fecs_host_int_status_umimp_illegal_method_f(u32 v)
988{
989 return (v & 0x1U) << 18U;
990}
991static inline u32 gr_fecs_host_int_status_ctxsw_intr_f(u32 v)
992{
993 return (v & 0xffffU) << 0U;
994}
995static inline u32 gr_fecs_host_int_clear_r(void)
996{
997 return 0x00409c20U;
998}
999static inline u32 gr_fecs_host_int_clear_ctxsw_intr1_f(u32 v)
1000{
1001 return (v & 0x1U) << 1U;
1002}
1003static inline u32 gr_fecs_host_int_clear_ctxsw_intr1_clear_f(void)
1004{
1005 return 0x2U;
1006}
1007static inline u32 gr_fecs_host_int_enable_r(void)
1008{
1009 return 0x00409c24U;
1010}
1011static inline u32 gr_fecs_host_int_enable_ctxsw_intr1_enable_f(void)
1012{
1013 return 0x2U;
1014}
1015static inline u32 gr_fecs_host_int_enable_fault_during_ctxsw_enable_f(void)
1016{
1017 return 0x10000U;
1018}
1019static inline u32 gr_fecs_host_int_enable_umimp_firmware_method_enable_f(void)
1020{
1021 return 0x20000U;
1022}
1023static inline u32 gr_fecs_host_int_enable_umimp_illegal_method_enable_f(void)
1024{
1025 return 0x40000U;
1026}
1027static inline u32 gr_fecs_host_int_enable_watchdog_enable_f(void)
1028{
1029 return 0x80000U;
1030}
1031static inline u32 gr_fecs_ctxsw_reset_ctl_r(void)
1032{
1033 return 0x00409614U;
1034}
1035static inline u32 gr_fecs_ctxsw_reset_ctl_sys_halt_disabled_f(void)
1036{
1037 return 0x0U;
1038}
1039static inline u32 gr_fecs_ctxsw_reset_ctl_gpc_halt_disabled_f(void)
1040{
1041 return 0x0U;
1042}
1043static inline u32 gr_fecs_ctxsw_reset_ctl_be_halt_disabled_f(void)
1044{
1045 return 0x0U;
1046}
1047static inline u32 gr_fecs_ctxsw_reset_ctl_sys_engine_reset_disabled_f(void)
1048{
1049 return 0x10U;
1050}
1051static inline u32 gr_fecs_ctxsw_reset_ctl_gpc_engine_reset_disabled_f(void)
1052{
1053 return 0x20U;
1054}
1055static inline u32 gr_fecs_ctxsw_reset_ctl_be_engine_reset_disabled_f(void)
1056{
1057 return 0x40U;
1058}
1059static inline u32 gr_fecs_ctxsw_reset_ctl_sys_context_reset_enabled_f(void)
1060{
1061 return 0x0U;
1062}
1063static inline u32 gr_fecs_ctxsw_reset_ctl_sys_context_reset_disabled_f(void)
1064{
1065 return 0x100U;
1066}
1067static inline u32 gr_fecs_ctxsw_reset_ctl_gpc_context_reset_enabled_f(void)
1068{
1069 return 0x0U;
1070}
1071static inline u32 gr_fecs_ctxsw_reset_ctl_gpc_context_reset_disabled_f(void)
1072{
1073 return 0x200U;
1074}
1075static inline u32 gr_fecs_ctxsw_reset_ctl_be_context_reset_s(void)
1076{
1077 return 1U;
1078}
1079static inline u32 gr_fecs_ctxsw_reset_ctl_be_context_reset_f(u32 v)
1080{
1081 return (v & 0x1U) << 10U;
1082}
1083static inline u32 gr_fecs_ctxsw_reset_ctl_be_context_reset_m(void)
1084{
1085 return 0x1U << 10U;
1086}
1087static inline u32 gr_fecs_ctxsw_reset_ctl_be_context_reset_v(u32 r)
1088{
1089 return (r >> 10U) & 0x1U;
1090}
1091static inline u32 gr_fecs_ctxsw_reset_ctl_be_context_reset_enabled_f(void)
1092{
1093 return 0x0U;
1094}
1095static inline u32 gr_fecs_ctxsw_reset_ctl_be_context_reset_disabled_f(void)
1096{
1097 return 0x400U;
1098}
1099static inline u32 gr_fecs_ctx_state_store_major_rev_id_r(void)
1100{
1101 return 0x0040960cU;
1102}
1103static inline u32 gr_fecs_ctxsw_mailbox_r(u32 i)
1104{
1105 return 0x00409800U + i*4U;
1106}
1107static inline u32 gr_fecs_ctxsw_mailbox__size_1_v(void)
1108{
1109 return 0x00000010U;
1110}
1111static inline u32 gr_fecs_ctxsw_mailbox_value_f(u32 v)
1112{
1113 return (v & 0xffffffffU) << 0U;
1114}
1115static inline u32 gr_fecs_ctxsw_mailbox_value_pass_v(void)
1116{
1117 return 0x00000001U;
1118}
1119static inline u32 gr_fecs_ctxsw_mailbox_value_fail_v(void)
1120{
1121 return 0x00000002U;
1122}
1123static inline u32 gr_fecs_ctxsw_mailbox_set_r(u32 i)
1124{
1125 return 0x004098c0U + i*4U;
1126}
1127static inline u32 gr_fecs_ctxsw_mailbox_set_value_f(u32 v)
1128{
1129 return (v & 0xffffffffU) << 0U;
1130}
1131static inline u32 gr_fecs_ctxsw_mailbox_clear_r(u32 i)
1132{
1133 return 0x00409840U + i*4U;
1134}
1135static inline u32 gr_fecs_ctxsw_mailbox_clear_value_f(u32 v)
1136{
1137 return (v & 0xffffffffU) << 0U;
1138}
1139static inline u32 gr_fecs_fs_r(void)
1140{
1141 return 0x00409604U;
1142}
1143static inline u32 gr_fecs_fs_num_available_gpcs_s(void)
1144{
1145 return 5U;
1146}
1147static inline u32 gr_fecs_fs_num_available_gpcs_f(u32 v)
1148{
1149 return (v & 0x1fU) << 0U;
1150}
1151static inline u32 gr_fecs_fs_num_available_gpcs_m(void)
1152{
1153 return 0x1fU << 0U;
1154}
1155static inline u32 gr_fecs_fs_num_available_gpcs_v(u32 r)
1156{
1157 return (r >> 0U) & 0x1fU;
1158}
1159static inline u32 gr_fecs_fs_num_available_fbps_s(void)
1160{
1161 return 5U;
1162}
1163static inline u32 gr_fecs_fs_num_available_fbps_f(u32 v)
1164{
1165 return (v & 0x1fU) << 16U;
1166}
1167static inline u32 gr_fecs_fs_num_available_fbps_m(void)
1168{
1169 return 0x1fU << 16U;
1170}
1171static inline u32 gr_fecs_fs_num_available_fbps_v(u32 r)
1172{
1173 return (r >> 16U) & 0x1fU;
1174}
1175static inline u32 gr_fecs_cfg_r(void)
1176{
1177 return 0x00409620U;
1178}
1179static inline u32 gr_fecs_cfg_imem_sz_v(u32 r)
1180{
1181 return (r >> 0U) & 0xffU;
1182}
1183static inline u32 gr_fecs_rc_lanes_r(void)
1184{
1185 return 0x00409880U;
1186}
1187static inline u32 gr_fecs_rc_lanes_num_chains_s(void)
1188{
1189 return 6U;
1190}
1191static inline u32 gr_fecs_rc_lanes_num_chains_f(u32 v)
1192{
1193 return (v & 0x3fU) << 0U;
1194}
1195static inline u32 gr_fecs_rc_lanes_num_chains_m(void)
1196{
1197 return 0x3fU << 0U;
1198}
1199static inline u32 gr_fecs_rc_lanes_num_chains_v(u32 r)
1200{
1201 return (r >> 0U) & 0x3fU;
1202}
1203static inline u32 gr_fecs_ctxsw_status_1_r(void)
1204{
1205 return 0x00409400U;
1206}
1207static inline u32 gr_fecs_ctxsw_status_1_arb_busy_s(void)
1208{
1209 return 1U;
1210}
1211static inline u32 gr_fecs_ctxsw_status_1_arb_busy_f(u32 v)
1212{
1213 return (v & 0x1U) << 12U;
1214}
1215static inline u32 gr_fecs_ctxsw_status_1_arb_busy_m(void)
1216{
1217 return 0x1U << 12U;
1218}
1219static inline u32 gr_fecs_ctxsw_status_1_arb_busy_v(u32 r)
1220{
1221 return (r >> 12U) & 0x1U;
1222}
1223static inline u32 gr_fecs_arb_ctx_adr_r(void)
1224{
1225 return 0x00409a24U;
1226}
1227static inline u32 gr_fecs_new_ctx_r(void)
1228{
1229 return 0x00409b04U;
1230}
1231static inline u32 gr_fecs_new_ctx_ptr_s(void)
1232{
1233 return 28U;
1234}
1235static inline u32 gr_fecs_new_ctx_ptr_f(u32 v)
1236{
1237 return (v & 0xfffffffU) << 0U;
1238}
1239static inline u32 gr_fecs_new_ctx_ptr_m(void)
1240{
1241 return 0xfffffffU << 0U;
1242}
1243static inline u32 gr_fecs_new_ctx_ptr_v(u32 r)
1244{
1245 return (r >> 0U) & 0xfffffffU;
1246}
1247static inline u32 gr_fecs_new_ctx_target_s(void)
1248{
1249 return 2U;
1250}
1251static inline u32 gr_fecs_new_ctx_target_f(u32 v)
1252{
1253 return (v & 0x3U) << 28U;
1254}
1255static inline u32 gr_fecs_new_ctx_target_m(void)
1256{
1257 return 0x3U << 28U;
1258}
1259static inline u32 gr_fecs_new_ctx_target_v(u32 r)
1260{
1261 return (r >> 28U) & 0x3U;
1262}
1263static inline u32 gr_fecs_new_ctx_target_vid_mem_f(void)
1264{
1265 return 0x0U;
1266}
1267static inline u32 gr_fecs_new_ctx_target_sys_mem_ncoh_f(void)
1268{
1269 return 0x30000000U;
1270}
1271static inline u32 gr_fecs_new_ctx_valid_s(void)
1272{
1273 return 1U;
1274}
1275static inline u32 gr_fecs_new_ctx_valid_f(u32 v)
1276{
1277 return (v & 0x1U) << 31U;
1278}
1279static inline u32 gr_fecs_new_ctx_valid_m(void)
1280{
1281 return 0x1U << 31U;
1282}
1283static inline u32 gr_fecs_new_ctx_valid_v(u32 r)
1284{
1285 return (r >> 31U) & 0x1U;
1286}
1287static inline u32 gr_fecs_arb_ctx_ptr_r(void)
1288{
1289 return 0x00409a0cU;
1290}
1291static inline u32 gr_fecs_arb_ctx_ptr_ptr_s(void)
1292{
1293 return 28U;
1294}
1295static inline u32 gr_fecs_arb_ctx_ptr_ptr_f(u32 v)
1296{
1297 return (v & 0xfffffffU) << 0U;
1298}
1299static inline u32 gr_fecs_arb_ctx_ptr_ptr_m(void)
1300{
1301 return 0xfffffffU << 0U;
1302}
1303static inline u32 gr_fecs_arb_ctx_ptr_ptr_v(u32 r)
1304{
1305 return (r >> 0U) & 0xfffffffU;
1306}
1307static inline u32 gr_fecs_arb_ctx_ptr_target_s(void)
1308{
1309 return 2U;
1310}
1311static inline u32 gr_fecs_arb_ctx_ptr_target_f(u32 v)
1312{
1313 return (v & 0x3U) << 28U;
1314}
1315static inline u32 gr_fecs_arb_ctx_ptr_target_m(void)
1316{
1317 return 0x3U << 28U;
1318}
1319static inline u32 gr_fecs_arb_ctx_ptr_target_v(u32 r)
1320{
1321 return (r >> 28U) & 0x3U;
1322}
1323static inline u32 gr_fecs_arb_ctx_ptr_target_vid_mem_f(void)
1324{
1325 return 0x0U;
1326}
1327static inline u32 gr_fecs_arb_ctx_ptr_target_sys_mem_ncoh_f(void)
1328{
1329 return 0x30000000U;
1330}
1331static inline u32 gr_fecs_arb_ctx_cmd_r(void)
1332{
1333 return 0x00409a10U;
1334}
1335static inline u32 gr_fecs_arb_ctx_cmd_cmd_s(void)
1336{
1337 return 5U;
1338}
1339static inline u32 gr_fecs_arb_ctx_cmd_cmd_f(u32 v)
1340{
1341 return (v & 0x1fU) << 0U;
1342}
1343static inline u32 gr_fecs_arb_ctx_cmd_cmd_m(void)
1344{
1345 return 0x1fU << 0U;
1346}
1347static inline u32 gr_fecs_arb_ctx_cmd_cmd_v(u32 r)
1348{
1349 return (r >> 0U) & 0x1fU;
1350}
1351static inline u32 gr_fecs_ctxsw_status_fe_0_r(void)
1352{
1353 return 0x00409c00U;
1354}
1355static inline u32 gr_gpc0_gpccs_ctxsw_status_gpc_0_r(void)
1356{
1357 return 0x00502c04U;
1358}
1359static inline u32 gr_gpc0_gpccs_ctxsw_status_1_r(void)
1360{
1361 return 0x00502400U;
1362}
1363static inline u32 gr_fecs_ctxsw_idlestate_r(void)
1364{
1365 return 0x00409420U;
1366}
1367static inline u32 gr_gpc0_gpccs_ctxsw_idlestate_r(void)
1368{
1369 return 0x00502420U;
1370}
1371static inline u32 gr_rstr2d_gpc_map0_r(void)
1372{
1373 return 0x0040780cU;
1374}
1375static inline u32 gr_rstr2d_gpc_map1_r(void)
1376{
1377 return 0x00407810U;
1378}
1379static inline u32 gr_rstr2d_gpc_map2_r(void)
1380{
1381 return 0x00407814U;
1382}
1383static inline u32 gr_rstr2d_gpc_map3_r(void)
1384{
1385 return 0x00407818U;
1386}
1387static inline u32 gr_rstr2d_gpc_map4_r(void)
1388{
1389 return 0x0040781cU;
1390}
1391static inline u32 gr_rstr2d_gpc_map5_r(void)
1392{
1393 return 0x00407820U;
1394}
1395static inline u32 gr_rstr2d_map_table_cfg_r(void)
1396{
1397 return 0x004078bcU;
1398}
1399static inline u32 gr_rstr2d_map_table_cfg_row_offset_f(u32 v)
1400{
1401 return (v & 0xffU) << 0U;
1402}
1403static inline u32 gr_rstr2d_map_table_cfg_num_entries_f(u32 v)
1404{
1405 return (v & 0xffU) << 8U;
1406}
1407static inline u32 gr_pd_hww_esr_r(void)
1408{
1409 return 0x00406018U;
1410}
1411static inline u32 gr_pd_hww_esr_reset_active_f(void)
1412{
1413 return 0x40000000U;
1414}
1415static inline u32 gr_pd_hww_esr_en_enable_f(void)
1416{
1417 return 0x80000000U;
1418}
1419static inline u32 gr_pd_num_tpc_per_gpc_r(u32 i)
1420{
1421 return 0x00406028U + i*4U;
1422}
1423static inline u32 gr_pd_num_tpc_per_gpc__size_1_v(void)
1424{
1425 return 0x00000004U;
1426}
1427static inline u32 gr_pd_num_tpc_per_gpc_count0_f(u32 v)
1428{
1429 return (v & 0xfU) << 0U;
1430}
1431static inline u32 gr_pd_num_tpc_per_gpc_count1_f(u32 v)
1432{
1433 return (v & 0xfU) << 4U;
1434}
1435static inline u32 gr_pd_num_tpc_per_gpc_count2_f(u32 v)
1436{
1437 return (v & 0xfU) << 8U;
1438}
1439static inline u32 gr_pd_num_tpc_per_gpc_count3_f(u32 v)
1440{
1441 return (v & 0xfU) << 12U;
1442}
1443static inline u32 gr_pd_num_tpc_per_gpc_count4_f(u32 v)
1444{
1445 return (v & 0xfU) << 16U;
1446}
1447static inline u32 gr_pd_num_tpc_per_gpc_count5_f(u32 v)
1448{
1449 return (v & 0xfU) << 20U;
1450}
1451static inline u32 gr_pd_num_tpc_per_gpc_count6_f(u32 v)
1452{
1453 return (v & 0xfU) << 24U;
1454}
1455static inline u32 gr_pd_num_tpc_per_gpc_count7_f(u32 v)
1456{
1457 return (v & 0xfU) << 28U;
1458}
1459static inline u32 gr_pd_ab_dist_cfg0_r(void)
1460{
1461 return 0x004064c0U;
1462}
1463static inline u32 gr_pd_ab_dist_cfg0_timeslice_enable_en_f(void)
1464{
1465 return 0x80000000U;
1466}
1467static inline u32 gr_pd_ab_dist_cfg0_timeslice_enable_dis_f(void)
1468{
1469 return 0x0U;
1470}
1471static inline u32 gr_pd_ab_dist_cfg1_r(void)
1472{
1473 return 0x004064c4U;
1474}
1475static inline u32 gr_pd_ab_dist_cfg1_max_batches_init_f(void)
1476{
1477 return 0xffffU;
1478}
1479static inline u32 gr_pd_ab_dist_cfg1_max_output_f(u32 v)
1480{
1481 return (v & 0xffffU) << 16U;
1482}
1483static inline u32 gr_pd_ab_dist_cfg1_max_output_granularity_v(void)
1484{
1485 return 0x00000080U;
1486}
1487static inline u32 gr_pd_ab_dist_cfg2_r(void)
1488{
1489 return 0x004064c8U;
1490}
1491static inline u32 gr_pd_ab_dist_cfg2_token_limit_f(u32 v)
1492{
1493 return (v & 0xfffU) << 0U;
1494}
1495static inline u32 gr_pd_ab_dist_cfg2_token_limit_init_v(void)
1496{
1497 return 0x000001c0U;
1498}
1499static inline u32 gr_pd_ab_dist_cfg2_state_limit_f(u32 v)
1500{
1501 return (v & 0xfffU) << 16U;
1502}
1503static inline u32 gr_pd_ab_dist_cfg2_state_limit_scc_bundle_granularity_v(void)
1504{
1505 return 0x00000020U;
1506}
1507static inline u32 gr_pd_ab_dist_cfg2_state_limit_min_gpm_fifo_depths_v(void)
1508{
1509 return 0x00000182U;
1510}
1511static inline u32 gr_pd_pagepool_r(void)
1512{
1513 return 0x004064ccU;
1514}
1515static inline u32 gr_pd_pagepool_total_pages_f(u32 v)
1516{
1517 return (v & 0xffU) << 0U;
1518}
1519static inline u32 gr_pd_pagepool_valid_true_f(void)
1520{
1521 return 0x80000000U;
1522}
1523static inline u32 gr_pd_dist_skip_table_r(u32 i)
1524{
1525 return 0x004064d0U + i*4U;
1526}
1527static inline u32 gr_pd_dist_skip_table__size_1_v(void)
1528{
1529 return 0x00000008U;
1530}
1531static inline u32 gr_pd_dist_skip_table_gpc_4n0_mask_f(u32 v)
1532{
1533 return (v & 0xffU) << 0U;
1534}
1535static inline u32 gr_pd_dist_skip_table_gpc_4n1_mask_f(u32 v)
1536{
1537 return (v & 0xffU) << 8U;
1538}
1539static inline u32 gr_pd_dist_skip_table_gpc_4n2_mask_f(u32 v)
1540{
1541 return (v & 0xffU) << 16U;
1542}
1543static inline u32 gr_pd_dist_skip_table_gpc_4n3_mask_f(u32 v)
1544{
1545 return (v & 0xffU) << 24U;
1546}
1547static inline u32 gr_ds_debug_r(void)
1548{
1549 return 0x00405800U;
1550}
1551static inline u32 gr_ds_debug_timeslice_mode_disable_f(void)
1552{
1553 return 0x0U;
1554}
1555static inline u32 gr_ds_debug_timeslice_mode_enable_f(void)
1556{
1557 return 0x8000000U;
1558}
1559static inline u32 gr_ds_zbc_color_r_r(void)
1560{
1561 return 0x00405804U;
1562}
1563static inline u32 gr_ds_zbc_color_r_val_f(u32 v)
1564{
1565 return (v & 0xffffffffU) << 0U;
1566}
1567static inline u32 gr_ds_zbc_color_g_r(void)
1568{
1569 return 0x00405808U;
1570}
1571static inline u32 gr_ds_zbc_color_g_val_f(u32 v)
1572{
1573 return (v & 0xffffffffU) << 0U;
1574}
1575static inline u32 gr_ds_zbc_color_b_r(void)
1576{
1577 return 0x0040580cU;
1578}
1579static inline u32 gr_ds_zbc_color_b_val_f(u32 v)
1580{
1581 return (v & 0xffffffffU) << 0U;
1582}
1583static inline u32 gr_ds_zbc_color_a_r(void)
1584{
1585 return 0x00405810U;
1586}
1587static inline u32 gr_ds_zbc_color_a_val_f(u32 v)
1588{
1589 return (v & 0xffffffffU) << 0U;
1590}
1591static inline u32 gr_ds_zbc_color_fmt_r(void)
1592{
1593 return 0x00405814U;
1594}
1595static inline u32 gr_ds_zbc_color_fmt_val_f(u32 v)
1596{
1597 return (v & 0x7fU) << 0U;
1598}
1599static inline u32 gr_ds_zbc_color_fmt_val_invalid_f(void)
1600{
1601 return 0x0U;
1602}
1603static inline u32 gr_ds_zbc_color_fmt_val_zero_v(void)
1604{
1605 return 0x00000001U;
1606}
1607static inline u32 gr_ds_zbc_color_fmt_val_unorm_one_v(void)
1608{
1609 return 0x00000002U;
1610}
1611static inline u32 gr_ds_zbc_color_fmt_val_rf32_gf32_bf32_af32_v(void)
1612{
1613 return 0x00000004U;
1614}
1615static inline u32 gr_ds_zbc_color_fmt_val_a8_b8_g8_r8_v(void)
1616{
1617 return 0x00000028U;
1618}
1619static inline u32 gr_ds_zbc_z_r(void)
1620{
1621 return 0x00405818U;
1622}
1623static inline u32 gr_ds_zbc_z_val_s(void)
1624{
1625 return 32U;
1626}
1627static inline u32 gr_ds_zbc_z_val_f(u32 v)
1628{
1629 return (v & 0xffffffffU) << 0U;
1630}
1631static inline u32 gr_ds_zbc_z_val_m(void)
1632{
1633 return 0xffffffffU << 0U;
1634}
1635static inline u32 gr_ds_zbc_z_val_v(u32 r)
1636{
1637 return (r >> 0U) & 0xffffffffU;
1638}
1639static inline u32 gr_ds_zbc_z_val__init_v(void)
1640{
1641 return 0x00000000U;
1642}
1643static inline u32 gr_ds_zbc_z_val__init_f(void)
1644{
1645 return 0x0U;
1646}
1647static inline u32 gr_ds_zbc_z_fmt_r(void)
1648{
1649 return 0x0040581cU;
1650}
1651static inline u32 gr_ds_zbc_z_fmt_val_f(u32 v)
1652{
1653 return (v & 0x1U) << 0U;
1654}
1655static inline u32 gr_ds_zbc_z_fmt_val_invalid_f(void)
1656{
1657 return 0x0U;
1658}
1659static inline u32 gr_ds_zbc_z_fmt_val_fp32_v(void)
1660{
1661 return 0x00000001U;
1662}
1663static inline u32 gr_ds_zbc_tbl_index_r(void)
1664{
1665 return 0x00405820U;
1666}
1667static inline u32 gr_ds_zbc_tbl_index_val_f(u32 v)
1668{
1669 return (v & 0xfU) << 0U;
1670}
1671static inline u32 gr_ds_zbc_tbl_ld_r(void)
1672{
1673 return 0x00405824U;
1674}
1675static inline u32 gr_ds_zbc_tbl_ld_select_c_f(void)
1676{
1677 return 0x0U;
1678}
1679static inline u32 gr_ds_zbc_tbl_ld_select_z_f(void)
1680{
1681 return 0x1U;
1682}
1683static inline u32 gr_ds_zbc_tbl_ld_action_write_f(void)
1684{
1685 return 0x0U;
1686}
1687static inline u32 gr_ds_zbc_tbl_ld_trigger_active_f(void)
1688{
1689 return 0x4U;
1690}
1691static inline u32 gr_ds_tga_constraintlogic_r(void)
1692{
1693 return 0x00405830U;
1694}
1695static inline u32 gr_ds_tga_constraintlogic_beta_cbsize_f(u32 v)
1696{
1697 return (v & 0xffffU) << 16U;
1698}
1699static inline u32 gr_ds_tga_constraintlogic_alpha_cbsize_f(u32 v)
1700{
1701 return (v & 0xffffU) << 0U;
1702}
1703static inline u32 gr_ds_hww_esr_r(void)
1704{
1705 return 0x00405840U;
1706}
1707static inline u32 gr_ds_hww_esr_reset_s(void)
1708{
1709 return 1U;
1710}
1711static inline u32 gr_ds_hww_esr_reset_f(u32 v)
1712{
1713 return (v & 0x1U) << 30U;
1714}
1715static inline u32 gr_ds_hww_esr_reset_m(void)
1716{
1717 return 0x1U << 30U;
1718}
1719static inline u32 gr_ds_hww_esr_reset_v(u32 r)
1720{
1721 return (r >> 30U) & 0x1U;
1722}
1723static inline u32 gr_ds_hww_esr_reset_task_v(void)
1724{
1725 return 0x00000001U;
1726}
1727static inline u32 gr_ds_hww_esr_reset_task_f(void)
1728{
1729 return 0x40000000U;
1730}
1731static inline u32 gr_ds_hww_esr_en_enabled_f(void)
1732{
1733 return 0x80000000U;
1734}
1735static inline u32 gr_ds_hww_esr_2_r(void)
1736{
1737 return 0x00405848U;
1738}
1739static inline u32 gr_ds_hww_esr_2_reset_s(void)
1740{
1741 return 1U;
1742}
1743static inline u32 gr_ds_hww_esr_2_reset_f(u32 v)
1744{
1745 return (v & 0x1U) << 30U;
1746}
1747static inline u32 gr_ds_hww_esr_2_reset_m(void)
1748{
1749 return 0x1U << 30U;
1750}
1751static inline u32 gr_ds_hww_esr_2_reset_v(u32 r)
1752{
1753 return (r >> 30U) & 0x1U;
1754}
1755static inline u32 gr_ds_hww_esr_2_reset_task_v(void)
1756{
1757 return 0x00000001U;
1758}
1759static inline u32 gr_ds_hww_esr_2_reset_task_f(void)
1760{
1761 return 0x40000000U;
1762}
1763static inline u32 gr_ds_hww_esr_2_en_enabled_f(void)
1764{
1765 return 0x80000000U;
1766}
1767static inline u32 gr_ds_hww_report_mask_r(void)
1768{
1769 return 0x00405844U;
1770}
1771static inline u32 gr_ds_hww_report_mask_sph0_err_report_f(void)
1772{
1773 return 0x1U;
1774}
1775static inline u32 gr_ds_hww_report_mask_sph1_err_report_f(void)
1776{
1777 return 0x2U;
1778}
1779static inline u32 gr_ds_hww_report_mask_sph2_err_report_f(void)
1780{
1781 return 0x4U;
1782}
1783static inline u32 gr_ds_hww_report_mask_sph3_err_report_f(void)
1784{
1785 return 0x8U;
1786}
1787static inline u32 gr_ds_hww_report_mask_sph4_err_report_f(void)
1788{
1789 return 0x10U;
1790}
1791static inline u32 gr_ds_hww_report_mask_sph5_err_report_f(void)
1792{
1793 return 0x20U;
1794}
1795static inline u32 gr_ds_hww_report_mask_sph6_err_report_f(void)
1796{
1797 return 0x40U;
1798}
1799static inline u32 gr_ds_hww_report_mask_sph7_err_report_f(void)
1800{
1801 return 0x80U;
1802}
1803static inline u32 gr_ds_hww_report_mask_sph8_err_report_f(void)
1804{
1805 return 0x100U;
1806}
1807static inline u32 gr_ds_hww_report_mask_sph9_err_report_f(void)
1808{
1809 return 0x200U;
1810}
1811static inline u32 gr_ds_hww_report_mask_sph10_err_report_f(void)
1812{
1813 return 0x400U;
1814}
1815static inline u32 gr_ds_hww_report_mask_sph11_err_report_f(void)
1816{
1817 return 0x800U;
1818}
1819static inline u32 gr_ds_hww_report_mask_sph12_err_report_f(void)
1820{
1821 return 0x1000U;
1822}
1823static inline u32 gr_ds_hww_report_mask_sph13_err_report_f(void)
1824{
1825 return 0x2000U;
1826}
1827static inline u32 gr_ds_hww_report_mask_sph14_err_report_f(void)
1828{
1829 return 0x4000U;
1830}
1831static inline u32 gr_ds_hww_report_mask_sph15_err_report_f(void)
1832{
1833 return 0x8000U;
1834}
1835static inline u32 gr_ds_hww_report_mask_sph16_err_report_f(void)
1836{
1837 return 0x10000U;
1838}
1839static inline u32 gr_ds_hww_report_mask_sph17_err_report_f(void)
1840{
1841 return 0x20000U;
1842}
1843static inline u32 gr_ds_hww_report_mask_sph18_err_report_f(void)
1844{
1845 return 0x40000U;
1846}
1847static inline u32 gr_ds_hww_report_mask_sph19_err_report_f(void)
1848{
1849 return 0x80000U;
1850}
1851static inline u32 gr_ds_hww_report_mask_sph20_err_report_f(void)
1852{
1853 return 0x100000U;
1854}
1855static inline u32 gr_ds_hww_report_mask_sph21_err_report_f(void)
1856{
1857 return 0x200000U;
1858}
1859static inline u32 gr_ds_hww_report_mask_sph22_err_report_f(void)
1860{
1861 return 0x400000U;
1862}
1863static inline u32 gr_ds_hww_report_mask_sph23_err_report_f(void)
1864{
1865 return 0x800000U;
1866}
1867static inline u32 gr_ds_hww_report_mask_2_r(void)
1868{
1869 return 0x0040584cU;
1870}
1871static inline u32 gr_ds_hww_report_mask_2_sph24_err_report_f(void)
1872{
1873 return 0x1U;
1874}
1875static inline u32 gr_ds_num_tpc_per_gpc_r(u32 i)
1876{
1877 return 0x00405870U + i*4U;
1878}
1879static inline u32 gr_scc_bundle_cb_base_r(void)
1880{
1881 return 0x00408004U;
1882}
1883static inline u32 gr_scc_bundle_cb_base_addr_39_8_f(u32 v)
1884{
1885 return (v & 0xffffffffU) << 0U;
1886}
1887static inline u32 gr_scc_bundle_cb_base_addr_39_8_align_bits_v(void)
1888{
1889 return 0x00000008U;
1890}
1891static inline u32 gr_scc_bundle_cb_size_r(void)
1892{
1893 return 0x00408008U;
1894}
1895static inline u32 gr_scc_bundle_cb_size_div_256b_f(u32 v)
1896{
1897 return (v & 0x7ffU) << 0U;
1898}
1899static inline u32 gr_scc_bundle_cb_size_div_256b__prod_v(void)
1900{
1901 return 0x00000018U;
1902}
1903static inline u32 gr_scc_bundle_cb_size_div_256b_byte_granularity_v(void)
1904{
1905 return 0x00000100U;
1906}
1907static inline u32 gr_scc_bundle_cb_size_valid_false_v(void)
1908{
1909 return 0x00000000U;
1910}
1911static inline u32 gr_scc_bundle_cb_size_valid_false_f(void)
1912{
1913 return 0x0U;
1914}
1915static inline u32 gr_scc_bundle_cb_size_valid_true_f(void)
1916{
1917 return 0x80000000U;
1918}
1919static inline u32 gr_scc_pagepool_base_r(void)
1920{
1921 return 0x0040800cU;
1922}
1923static inline u32 gr_scc_pagepool_base_addr_39_8_f(u32 v)
1924{
1925 return (v & 0xffffffffU) << 0U;
1926}
1927static inline u32 gr_scc_pagepool_base_addr_39_8_align_bits_v(void)
1928{
1929 return 0x00000008U;
1930}
1931static inline u32 gr_scc_pagepool_r(void)
1932{
1933 return 0x00408010U;
1934}
1935static inline u32 gr_scc_pagepool_total_pages_f(u32 v)
1936{
1937 return (v & 0xffU) << 0U;
1938}
1939static inline u32 gr_scc_pagepool_total_pages_hwmax_v(void)
1940{
1941 return 0x00000000U;
1942}
1943static inline u32 gr_scc_pagepool_total_pages_hwmax_value_v(void)
1944{
1945 return 0x00000080U;
1946}
1947static inline u32 gr_scc_pagepool_total_pages_byte_granularity_v(void)
1948{
1949 return 0x00000100U;
1950}
1951static inline u32 gr_scc_pagepool_max_valid_pages_s(void)
1952{
1953 return 8U;
1954}
1955static inline u32 gr_scc_pagepool_max_valid_pages_f(u32 v)
1956{
1957 return (v & 0xffU) << 8U;
1958}
1959static inline u32 gr_scc_pagepool_max_valid_pages_m(void)
1960{
1961 return 0xffU << 8U;
1962}
1963static inline u32 gr_scc_pagepool_max_valid_pages_v(u32 r)
1964{
1965 return (r >> 8U) & 0xffU;
1966}
1967static inline u32 gr_scc_pagepool_valid_true_f(void)
1968{
1969 return 0x80000000U;
1970}
1971static inline u32 gr_scc_init_r(void)
1972{
1973 return 0x0040802cU;
1974}
1975static inline u32 gr_scc_init_ram_trigger_f(void)
1976{
1977 return 0x1U;
1978}
1979static inline u32 gr_scc_hww_esr_r(void)
1980{
1981 return 0x00408030U;
1982}
1983static inline u32 gr_scc_hww_esr_reset_active_f(void)
1984{
1985 return 0x40000000U;
1986}
1987static inline u32 gr_scc_hww_esr_en_enable_f(void)
1988{
1989 return 0x80000000U;
1990}
1991static inline u32 gr_sked_hww_esr_r(void)
1992{
1993 return 0x00407020U;
1994}
1995static inline u32 gr_sked_hww_esr_reset_active_f(void)
1996{
1997 return 0x40000000U;
1998}
1999static inline u32 gr_cwd_fs_r(void)
2000{
2001 return 0x00405b00U;
2002}
2003static inline u32 gr_cwd_fs_num_gpcs_f(u32 v)
2004{
2005 return (v & 0xffU) << 0U;
2006}
2007static inline u32 gr_cwd_fs_num_tpcs_f(u32 v)
2008{
2009 return (v & 0xffU) << 8U;
2010}
2011static inline u32 gr_cwd_gpc_tpc_id_r(u32 i)
2012{
2013 return 0x00405b60U + i*4U;
2014}
2015static inline u32 gr_cwd_gpc_tpc_id_tpc0_s(void)
2016{
2017 return 4U;
2018}
2019static inline u32 gr_cwd_gpc_tpc_id_tpc0_f(u32 v)
2020{
2021 return (v & 0xfU) << 0U;
2022}
2023static inline u32 gr_cwd_gpc_tpc_id_gpc0_s(void)
2024{
2025 return 4U;
2026}
2027static inline u32 gr_cwd_gpc_tpc_id_gpc0_f(u32 v)
2028{
2029 return (v & 0xfU) << 4U;
2030}
2031static inline u32 gr_cwd_gpc_tpc_id_tpc1_f(u32 v)
2032{
2033 return (v & 0xfU) << 8U;
2034}
2035static inline u32 gr_cwd_sm_id_r(u32 i)
2036{
2037 return 0x00405ba0U + i*4U;
2038}
2039static inline u32 gr_cwd_sm_id__size_1_v(void)
2040{
2041 return 0x00000006U;
2042}
2043static inline u32 gr_cwd_sm_id_tpc0_f(u32 v)
2044{
2045 return (v & 0xffU) << 0U;
2046}
2047static inline u32 gr_cwd_sm_id_tpc1_f(u32 v)
2048{
2049 return (v & 0xffU) << 8U;
2050}
2051static inline u32 gr_gpc0_fs_gpc_r(void)
2052{
2053 return 0x00502608U;
2054}
2055static inline u32 gr_gpc0_fs_gpc_num_available_tpcs_v(u32 r)
2056{
2057 return (r >> 0U) & 0x1fU;
2058}
2059static inline u32 gr_gpc0_fs_gpc_num_available_zculls_v(u32 r)
2060{
2061 return (r >> 16U) & 0x1fU;
2062}
2063static inline u32 gr_gpc0_cfg_r(void)
2064{
2065 return 0x00502620U;
2066}
2067static inline u32 gr_gpc0_cfg_imem_sz_v(u32 r)
2068{
2069 return (r >> 0U) & 0xffU;
2070}
2071static inline u32 gr_gpccs_rc_lanes_r(void)
2072{
2073 return 0x00502880U;
2074}
2075static inline u32 gr_gpccs_rc_lanes_num_chains_s(void)
2076{
2077 return 6U;
2078}
2079static inline u32 gr_gpccs_rc_lanes_num_chains_f(u32 v)
2080{
2081 return (v & 0x3fU) << 0U;
2082}
2083static inline u32 gr_gpccs_rc_lanes_num_chains_m(void)
2084{
2085 return 0x3fU << 0U;
2086}
2087static inline u32 gr_gpccs_rc_lanes_num_chains_v(u32 r)
2088{
2089 return (r >> 0U) & 0x3fU;
2090}
2091static inline u32 gr_gpccs_rc_lane_size_r(u32 i)
2092{
2093 return 0x00502910U + i*0U;
2094}
2095static inline u32 gr_gpccs_rc_lane_size__size_1_v(void)
2096{
2097 return 0x00000010U;
2098}
2099static inline u32 gr_gpccs_rc_lane_size_v_s(void)
2100{
2101 return 24U;
2102}
2103static inline u32 gr_gpccs_rc_lane_size_v_f(u32 v)
2104{
2105 return (v & 0xffffffU) << 0U;
2106}
2107static inline u32 gr_gpccs_rc_lane_size_v_m(void)
2108{
2109 return 0xffffffU << 0U;
2110}
2111static inline u32 gr_gpccs_rc_lane_size_v_v(u32 r)
2112{
2113 return (r >> 0U) & 0xffffffU;
2114}
2115static inline u32 gr_gpccs_rc_lane_size_v_0_v(void)
2116{
2117 return 0x00000000U;
2118}
2119static inline u32 gr_gpccs_rc_lane_size_v_0_f(void)
2120{
2121 return 0x0U;
2122}
2123static inline u32 gr_gpc0_zcull_fs_r(void)
2124{
2125 return 0x00500910U;
2126}
2127static inline u32 gr_gpc0_zcull_fs_num_sms_f(u32 v)
2128{
2129 return (v & 0x1ffU) << 0U;
2130}
2131static inline u32 gr_gpc0_zcull_fs_num_active_banks_f(u32 v)
2132{
2133 return (v & 0xfU) << 16U;
2134}
2135static inline u32 gr_gpc0_zcull_ram_addr_r(void)
2136{
2137 return 0x00500914U;
2138}
2139static inline u32 gr_gpc0_zcull_ram_addr_tiles_per_hypertile_row_per_gpc_f(u32 v)
2140{
2141 return (v & 0xfU) << 0U;
2142}
2143static inline u32 gr_gpc0_zcull_ram_addr_row_offset_f(u32 v)
2144{
2145 return (v & 0xfU) << 8U;
2146}
2147static inline u32 gr_gpc0_zcull_sm_num_rcp_r(void)
2148{
2149 return 0x00500918U;
2150}
2151static inline u32 gr_gpc0_zcull_sm_num_rcp_conservative_f(u32 v)
2152{
2153 return (v & 0xffffffU) << 0U;
2154}
2155static inline u32 gr_gpc0_zcull_sm_num_rcp_conservative__max_v(void)
2156{
2157 return 0x00800000U;
2158}
2159static inline u32 gr_gpc0_zcull_total_ram_size_r(void)
2160{
2161 return 0x00500920U;
2162}
2163static inline u32 gr_gpc0_zcull_total_ram_size_num_aliquots_f(u32 v)
2164{
2165 return (v & 0xffffU) << 0U;
2166}
2167static inline u32 gr_gpc0_zcull_zcsize_r(u32 i)
2168{
2169 return 0x00500a04U + i*32U;
2170}
2171static inline u32 gr_gpc0_zcull_zcsize_height_subregion__multiple_v(void)
2172{
2173 return 0x00000040U;
2174}
2175static inline u32 gr_gpc0_zcull_zcsize_width_subregion__multiple_v(void)
2176{
2177 return 0x00000010U;
2178}
2179static inline u32 gr_gpc0_gpm_pd_sm_id_r(u32 i)
2180{
2181 return 0x00500c10U + i*4U;
2182}
2183static inline u32 gr_gpc0_gpm_pd_sm_id_id_f(u32 v)
2184{
2185 return (v & 0xffU) << 0U;
2186}
2187static inline u32 gr_gpc0_gpm_pd_pes_tpc_id_mask_r(u32 i)
2188{
2189 return 0x00500c30U + i*4U;
2190}
2191static inline u32 gr_gpc0_gpm_pd_pes_tpc_id_mask_mask_v(u32 r)
2192{
2193 return (r >> 0U) & 0xffU;
2194}
2195static inline u32 gr_gpc0_tpc0_pe_cfg_smid_r(void)
2196{
2197 return 0x00504088U;
2198}
2199static inline u32 gr_gpc0_tpc0_pe_cfg_smid_value_f(u32 v)
2200{
2201 return (v & 0xffffU) << 0U;
2202}
2203static inline u32 gr_gpc0_tpc0_sm_cfg_r(void)
2204{
2205 return 0x00504698U;
2206}
2207static inline u32 gr_gpc0_tpc0_sm_cfg_sm_id_f(u32 v)
2208{
2209 return (v & 0xffffU) << 0U;
2210}
2211static inline u32 gr_gpc0_tpc0_sm_cfg_sm_id_v(u32 r)
2212{
2213 return (r >> 0U) & 0xffffU;
2214}
2215static inline u32 gr_gpc0_tpc0_sm_arch_r(void)
2216{
2217 return 0x0050469cU;
2218}
2219static inline u32 gr_gpc0_tpc0_sm_arch_warp_count_v(u32 r)
2220{
2221 return (r >> 0U) & 0xffU;
2222}
2223static inline u32 gr_gpc0_tpc0_sm_arch_spa_version_v(u32 r)
2224{
2225 return (r >> 8U) & 0xfffU;
2226}
2227static inline u32 gr_gpc0_tpc0_sm_arch_sm_version_v(u32 r)
2228{
2229 return (r >> 20U) & 0xfffU;
2230}
2231static inline u32 gr_gpc0_ppc0_pes_vsc_strem_r(void)
2232{
2233 return 0x00503018U;
2234}
2235static inline u32 gr_gpc0_ppc0_pes_vsc_strem_master_pe_m(void)
2236{
2237 return 0x1U << 0U;
2238}
2239static inline u32 gr_gpc0_ppc0_pes_vsc_strem_master_pe_true_f(void)
2240{
2241 return 0x1U;
2242}
2243static inline u32 gr_gpc0_ppc0_cbm_beta_cb_size_r(void)
2244{
2245 return 0x005030c0U;
2246}
2247static inline u32 gr_gpc0_ppc0_cbm_beta_cb_size_v_f(u32 v)
2248{
2249 return (v & 0xffffU) << 0U;
2250}
2251static inline u32 gr_gpc0_ppc0_cbm_beta_cb_size_v_m(void)
2252{
2253 return 0xffffU << 0U;
2254}
2255static inline u32 gr_gpc0_ppc0_cbm_beta_cb_size_v_default_v(void)
2256{
2257 return 0x00000400U;
2258}
2259static inline u32 gr_gpc0_ppc0_cbm_beta_cb_size_v_granularity_v(void)
2260{
2261 return 0x00000020U;
2262}
2263static inline u32 gr_gpc0_ppc0_cbm_beta_cb_offset_r(void)
2264{
2265 return 0x005030f4U;
2266}
2267static inline u32 gr_gpc0_ppc0_cbm_alpha_cb_size_r(void)
2268{
2269 return 0x005030e4U;
2270}
2271static inline u32 gr_gpc0_ppc0_cbm_alpha_cb_size_v_f(u32 v)
2272{
2273 return (v & 0xffffU) << 0U;
2274}
2275static inline u32 gr_gpc0_ppc0_cbm_alpha_cb_size_v_m(void)
2276{
2277 return 0xffffU << 0U;
2278}
2279static inline u32 gr_gpc0_ppc0_cbm_alpha_cb_size_v_default_v(void)
2280{
2281 return 0x00000800U;
2282}
2283static inline u32 gr_gpc0_ppc0_cbm_alpha_cb_size_v_granularity_v(void)
2284{
2285 return 0x00000020U;
2286}
2287static inline u32 gr_gpc0_ppc0_cbm_alpha_cb_offset_r(void)
2288{
2289 return 0x005030f8U;
2290}
2291static inline u32 gr_gpcs_tpcs_tex_m_dbg2_r(void)
2292{
2293 return 0x00419a3cU;
2294}
2295static inline u32 gr_gpcs_tpcs_tex_m_dbg2_lg_rd_coalesce_en_f(u32 v)
2296{
2297 return (v & 0x1U) << 2U;
2298}
2299static inline u32 gr_gpcs_tpcs_tex_m_dbg2_lg_rd_coalesce_en_m(void)
2300{
2301 return 0x1U << 2U;
2302}
2303static inline u32 gr_gpcs_tpcs_tex_m_dbg2_su_rd_coalesce_en_f(u32 v)
2304{
2305 return (v & 0x1U) << 4U;
2306}
2307static inline u32 gr_gpcs_tpcs_tex_m_dbg2_su_rd_coalesce_en_m(void)
2308{
2309 return 0x1U << 4U;
2310}
2311static inline u32 gr_gpccs_falcon_addr_r(void)
2312{
2313 return 0x0041a0acU;
2314}
2315static inline u32 gr_gpccs_falcon_addr_lsb_s(void)
2316{
2317 return 6U;
2318}
2319static inline u32 gr_gpccs_falcon_addr_lsb_f(u32 v)
2320{
2321 return (v & 0x3fU) << 0U;
2322}
2323static inline u32 gr_gpccs_falcon_addr_lsb_m(void)
2324{
2325 return 0x3fU << 0U;
2326}
2327static inline u32 gr_gpccs_falcon_addr_lsb_v(u32 r)
2328{
2329 return (r >> 0U) & 0x3fU;
2330}
2331static inline u32 gr_gpccs_falcon_addr_lsb_init_v(void)
2332{
2333 return 0x00000000U;
2334}
2335static inline u32 gr_gpccs_falcon_addr_lsb_init_f(void)
2336{
2337 return 0x0U;
2338}
2339static inline u32 gr_gpccs_falcon_addr_msb_s(void)
2340{
2341 return 6U;
2342}
2343static inline u32 gr_gpccs_falcon_addr_msb_f(u32 v)
2344{
2345 return (v & 0x3fU) << 6U;
2346}
2347static inline u32 gr_gpccs_falcon_addr_msb_m(void)
2348{
2349 return 0x3fU << 6U;
2350}
2351static inline u32 gr_gpccs_falcon_addr_msb_v(u32 r)
2352{
2353 return (r >> 6U) & 0x3fU;
2354}
2355static inline u32 gr_gpccs_falcon_addr_msb_init_v(void)
2356{
2357 return 0x00000000U;
2358}
2359static inline u32 gr_gpccs_falcon_addr_msb_init_f(void)
2360{
2361 return 0x0U;
2362}
2363static inline u32 gr_gpccs_falcon_addr_ext_s(void)
2364{
2365 return 12U;
2366}
2367static inline u32 gr_gpccs_falcon_addr_ext_f(u32 v)
2368{
2369 return (v & 0xfffU) << 0U;
2370}
2371static inline u32 gr_gpccs_falcon_addr_ext_m(void)
2372{
2373 return 0xfffU << 0U;
2374}
2375static inline u32 gr_gpccs_falcon_addr_ext_v(u32 r)
2376{
2377 return (r >> 0U) & 0xfffU;
2378}
2379static inline u32 gr_gpccs_cpuctl_r(void)
2380{
2381 return 0x0041a100U;
2382}
2383static inline u32 gr_gpccs_cpuctl_startcpu_f(u32 v)
2384{
2385 return (v & 0x1U) << 1U;
2386}
2387static inline u32 gr_gpccs_dmactl_r(void)
2388{
2389 return 0x0041a10cU;
2390}
2391static inline u32 gr_gpccs_dmactl_require_ctx_f(u32 v)
2392{
2393 return (v & 0x1U) << 0U;
2394}
2395static inline u32 gr_gpccs_dmactl_dmem_scrubbing_m(void)
2396{
2397 return 0x1U << 1U;
2398}
2399static inline u32 gr_gpccs_dmactl_imem_scrubbing_m(void)
2400{
2401 return 0x1U << 2U;
2402}
2403static inline u32 gr_gpccs_imemc_r(u32 i)
2404{
2405 return 0x0041a180U + i*16U;
2406}
2407static inline u32 gr_gpccs_imemc_offs_f(u32 v)
2408{
2409 return (v & 0x3fU) << 2U;
2410}
2411static inline u32 gr_gpccs_imemc_blk_f(u32 v)
2412{
2413 return (v & 0xffU) << 8U;
2414}
2415static inline u32 gr_gpccs_imemc_aincw_f(u32 v)
2416{
2417 return (v & 0x1U) << 24U;
2418}
2419static inline u32 gr_gpccs_imemd_r(u32 i)
2420{
2421 return 0x0041a184U + i*16U;
2422}
2423static inline u32 gr_gpccs_imemt_r(u32 i)
2424{
2425 return 0x0041a188U + i*16U;
2426}
2427static inline u32 gr_gpccs_imemt__size_1_v(void)
2428{
2429 return 0x00000004U;
2430}
2431static inline u32 gr_gpccs_imemt_tag_f(u32 v)
2432{
2433 return (v & 0xffffU) << 0U;
2434}
2435static inline u32 gr_gpccs_dmemc_r(u32 i)
2436{
2437 return 0x0041a1c0U + i*8U;
2438}
2439static inline u32 gr_gpccs_dmemc_offs_f(u32 v)
2440{
2441 return (v & 0x3fU) << 2U;
2442}
2443static inline u32 gr_gpccs_dmemc_blk_f(u32 v)
2444{
2445 return (v & 0xffU) << 8U;
2446}
2447static inline u32 gr_gpccs_dmemc_aincw_f(u32 v)
2448{
2449 return (v & 0x1U) << 24U;
2450}
2451static inline u32 gr_gpccs_dmemd_r(u32 i)
2452{
2453 return 0x0041a1c4U + i*8U;
2454}
2455static inline u32 gr_gpccs_ctxsw_mailbox_r(u32 i)
2456{
2457 return 0x0041a800U + i*4U;
2458}
2459static inline u32 gr_gpccs_ctxsw_mailbox_value_f(u32 v)
2460{
2461 return (v & 0xffffffffU) << 0U;
2462}
2463static inline u32 gr_gpcs_swdx_bundle_cb_base_r(void)
2464{
2465 return 0x00418e24U;
2466}
2467static inline u32 gr_gpcs_swdx_bundle_cb_base_addr_39_8_s(void)
2468{
2469 return 32U;
2470}
2471static inline u32 gr_gpcs_swdx_bundle_cb_base_addr_39_8_f(u32 v)
2472{
2473 return (v & 0xffffffffU) << 0U;
2474}
2475static inline u32 gr_gpcs_swdx_bundle_cb_base_addr_39_8_m(void)
2476{
2477 return 0xffffffffU << 0U;
2478}
2479static inline u32 gr_gpcs_swdx_bundle_cb_base_addr_39_8_v(u32 r)
2480{
2481 return (r >> 0U) & 0xffffffffU;
2482}
2483static inline u32 gr_gpcs_swdx_bundle_cb_base_addr_39_8_init_v(void)
2484{
2485 return 0x00000000U;
2486}
2487static inline u32 gr_gpcs_swdx_bundle_cb_base_addr_39_8_init_f(void)
2488{
2489 return 0x0U;
2490}
2491static inline u32 gr_gpcs_swdx_bundle_cb_size_r(void)
2492{
2493 return 0x00418e28U;
2494}
2495static inline u32 gr_gpcs_swdx_bundle_cb_size_div_256b_s(void)
2496{
2497 return 11U;
2498}
2499static inline u32 gr_gpcs_swdx_bundle_cb_size_div_256b_f(u32 v)
2500{
2501 return (v & 0x7ffU) << 0U;
2502}
2503static inline u32 gr_gpcs_swdx_bundle_cb_size_div_256b_m(void)
2504{
2505 return 0x7ffU << 0U;
2506}
2507static inline u32 gr_gpcs_swdx_bundle_cb_size_div_256b_v(u32 r)
2508{
2509 return (r >> 0U) & 0x7ffU;
2510}
2511static inline u32 gr_gpcs_swdx_bundle_cb_size_div_256b_init_v(void)
2512{
2513 return 0x00000018U;
2514}
2515static inline u32 gr_gpcs_swdx_bundle_cb_size_div_256b_init_f(void)
2516{
2517 return 0x18U;
2518}
2519static inline u32 gr_gpcs_swdx_bundle_cb_size_valid_s(void)
2520{
2521 return 1U;
2522}
2523static inline u32 gr_gpcs_swdx_bundle_cb_size_valid_f(u32 v)
2524{
2525 return (v & 0x1U) << 31U;
2526}
2527static inline u32 gr_gpcs_swdx_bundle_cb_size_valid_m(void)
2528{
2529 return 0x1U << 31U;
2530}
2531static inline u32 gr_gpcs_swdx_bundle_cb_size_valid_v(u32 r)
2532{
2533 return (r >> 31U) & 0x1U;
2534}
2535static inline u32 gr_gpcs_swdx_bundle_cb_size_valid_false_v(void)
2536{
2537 return 0x00000000U;
2538}
2539static inline u32 gr_gpcs_swdx_bundle_cb_size_valid_false_f(void)
2540{
2541 return 0x0U;
2542}
2543static inline u32 gr_gpcs_swdx_bundle_cb_size_valid_true_v(void)
2544{
2545 return 0x00000001U;
2546}
2547static inline u32 gr_gpcs_swdx_bundle_cb_size_valid_true_f(void)
2548{
2549 return 0x80000000U;
2550}
2551static inline u32 gr_gpcs_swdx_tc_beta_cb_size_r(u32 i)
2552{
2553 return 0x00418ea0U + i*4U;
2554}
2555static inline u32 gr_gpcs_swdx_tc_beta_cb_size_v_f(u32 v)
2556{
2557 return (v & 0xffffU) << 0U;
2558}
2559static inline u32 gr_gpcs_swdx_tc_beta_cb_size_v_m(void)
2560{
2561 return 0xffffU << 0U;
2562}
2563static inline u32 gr_gpcs_swdx_tc_beta_cb_size_div3_f(u32 v)
2564{
2565 return (v & 0xffffU) << 16U;
2566}
2567static inline u32 gr_gpcs_swdx_tc_beta_cb_size_div3_m(void)
2568{
2569 return 0xffffU << 16U;
2570}
2571static inline u32 gr_gpcs_swdx_rm_pagepool_r(void)
2572{
2573 return 0x00418e30U;
2574}
2575static inline u32 gr_gpcs_swdx_rm_pagepool_total_pages_f(u32 v)
2576{
2577 return (v & 0xffU) << 0U;
2578}
2579static inline u32 gr_gpcs_swdx_rm_pagepool_valid_true_f(void)
2580{
2581 return 0x80000000U;
2582}
2583static inline u32 gr_gpcs_setup_attrib_cb_base_r(void)
2584{
2585 return 0x00418810U;
2586}
2587static inline u32 gr_gpcs_setup_attrib_cb_base_addr_39_12_f(u32 v)
2588{
2589 return (v & 0xfffffffU) << 0U;
2590}
2591static inline u32 gr_gpcs_setup_attrib_cb_base_addr_39_12_align_bits_v(void)
2592{
2593 return 0x0000000cU;
2594}
2595static inline u32 gr_gpcs_setup_attrib_cb_base_valid_true_f(void)
2596{
2597 return 0x80000000U;
2598}
2599static inline u32 gr_crstr_gpc_map0_r(void)
2600{
2601 return 0x00418b08U;
2602}
2603static inline u32 gr_crstr_gpc_map0_tile0_f(u32 v)
2604{
2605 return (v & 0x7U) << 0U;
2606}
2607static inline u32 gr_crstr_gpc_map0_tile1_f(u32 v)
2608{
2609 return (v & 0x7U) << 5U;
2610}
2611static inline u32 gr_crstr_gpc_map0_tile2_f(u32 v)
2612{
2613 return (v & 0x7U) << 10U;
2614}
2615static inline u32 gr_crstr_gpc_map0_tile3_f(u32 v)
2616{
2617 return (v & 0x7U) << 15U;
2618}
2619static inline u32 gr_crstr_gpc_map0_tile4_f(u32 v)
2620{
2621 return (v & 0x7U) << 20U;
2622}
2623static inline u32 gr_crstr_gpc_map0_tile5_f(u32 v)
2624{
2625 return (v & 0x7U) << 25U;
2626}
2627static inline u32 gr_crstr_gpc_map1_r(void)
2628{
2629 return 0x00418b0cU;
2630}
2631static inline u32 gr_crstr_gpc_map1_tile6_f(u32 v)
2632{
2633 return (v & 0x7U) << 0U;
2634}
2635static inline u32 gr_crstr_gpc_map1_tile7_f(u32 v)
2636{
2637 return (v & 0x7U) << 5U;
2638}
2639static inline u32 gr_crstr_gpc_map1_tile8_f(u32 v)
2640{
2641 return (v & 0x7U) << 10U;
2642}
2643static inline u32 gr_crstr_gpc_map1_tile9_f(u32 v)
2644{
2645 return (v & 0x7U) << 15U;
2646}
2647static inline u32 gr_crstr_gpc_map1_tile10_f(u32 v)
2648{
2649 return (v & 0x7U) << 20U;
2650}
2651static inline u32 gr_crstr_gpc_map1_tile11_f(u32 v)
2652{
2653 return (v & 0x7U) << 25U;
2654}
2655static inline u32 gr_crstr_gpc_map2_r(void)
2656{
2657 return 0x00418b10U;
2658}
2659static inline u32 gr_crstr_gpc_map2_tile12_f(u32 v)
2660{
2661 return (v & 0x7U) << 0U;
2662}
2663static inline u32 gr_crstr_gpc_map2_tile13_f(u32 v)
2664{
2665 return (v & 0x7U) << 5U;
2666}
2667static inline u32 gr_crstr_gpc_map2_tile14_f(u32 v)
2668{
2669 return (v & 0x7U) << 10U;
2670}
2671static inline u32 gr_crstr_gpc_map2_tile15_f(u32 v)
2672{
2673 return (v & 0x7U) << 15U;
2674}
2675static inline u32 gr_crstr_gpc_map2_tile16_f(u32 v)
2676{
2677 return (v & 0x7U) << 20U;
2678}
2679static inline u32 gr_crstr_gpc_map2_tile17_f(u32 v)
2680{
2681 return (v & 0x7U) << 25U;
2682}
2683static inline u32 gr_crstr_gpc_map3_r(void)
2684{
2685 return 0x00418b14U;
2686}
2687static inline u32 gr_crstr_gpc_map3_tile18_f(u32 v)
2688{
2689 return (v & 0x7U) << 0U;
2690}
2691static inline u32 gr_crstr_gpc_map3_tile19_f(u32 v)
2692{
2693 return (v & 0x7U) << 5U;
2694}
2695static inline u32 gr_crstr_gpc_map3_tile20_f(u32 v)
2696{
2697 return (v & 0x7U) << 10U;
2698}
2699static inline u32 gr_crstr_gpc_map3_tile21_f(u32 v)
2700{
2701 return (v & 0x7U) << 15U;
2702}
2703static inline u32 gr_crstr_gpc_map3_tile22_f(u32 v)
2704{
2705 return (v & 0x7U) << 20U;
2706}
2707static inline u32 gr_crstr_gpc_map3_tile23_f(u32 v)
2708{
2709 return (v & 0x7U) << 25U;
2710}
2711static inline u32 gr_crstr_gpc_map4_r(void)
2712{
2713 return 0x00418b18U;
2714}
2715static inline u32 gr_crstr_gpc_map4_tile24_f(u32 v)
2716{
2717 return (v & 0x7U) << 0U;
2718}
2719static inline u32 gr_crstr_gpc_map4_tile25_f(u32 v)
2720{
2721 return (v & 0x7U) << 5U;
2722}
2723static inline u32 gr_crstr_gpc_map4_tile26_f(u32 v)
2724{
2725 return (v & 0x7U) << 10U;
2726}
2727static inline u32 gr_crstr_gpc_map4_tile27_f(u32 v)
2728{
2729 return (v & 0x7U) << 15U;
2730}
2731static inline u32 gr_crstr_gpc_map4_tile28_f(u32 v)
2732{
2733 return (v & 0x7U) << 20U;
2734}
2735static inline u32 gr_crstr_gpc_map4_tile29_f(u32 v)
2736{
2737 return (v & 0x7U) << 25U;
2738}
2739static inline u32 gr_crstr_gpc_map5_r(void)
2740{
2741 return 0x00418b1cU;
2742}
2743static inline u32 gr_crstr_gpc_map5_tile30_f(u32 v)
2744{
2745 return (v & 0x7U) << 0U;
2746}
2747static inline u32 gr_crstr_gpc_map5_tile31_f(u32 v)
2748{
2749 return (v & 0x7U) << 5U;
2750}
2751static inline u32 gr_crstr_gpc_map5_tile32_f(u32 v)
2752{
2753 return (v & 0x7U) << 10U;
2754}
2755static inline u32 gr_crstr_gpc_map5_tile33_f(u32 v)
2756{
2757 return (v & 0x7U) << 15U;
2758}
2759static inline u32 gr_crstr_gpc_map5_tile34_f(u32 v)
2760{
2761 return (v & 0x7U) << 20U;
2762}
2763static inline u32 gr_crstr_gpc_map5_tile35_f(u32 v)
2764{
2765 return (v & 0x7U) << 25U;
2766}
2767static inline u32 gr_crstr_map_table_cfg_r(void)
2768{
2769 return 0x00418bb8U;
2770}
2771static inline u32 gr_crstr_map_table_cfg_row_offset_f(u32 v)
2772{
2773 return (v & 0xffU) << 0U;
2774}
2775static inline u32 gr_crstr_map_table_cfg_num_entries_f(u32 v)
2776{
2777 return (v & 0xffU) << 8U;
2778}
2779static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map0_r(void)
2780{
2781 return 0x00418980U;
2782}
2783static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map0_tile_0_f(u32 v)
2784{
2785 return (v & 0x7U) << 0U;
2786}
2787static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map0_tile_1_f(u32 v)
2788{
2789 return (v & 0x7U) << 4U;
2790}
2791static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map0_tile_2_f(u32 v)
2792{
2793 return (v & 0x7U) << 8U;
2794}
2795static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map0_tile_3_f(u32 v)
2796{
2797 return (v & 0x7U) << 12U;
2798}
2799static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map0_tile_4_f(u32 v)
2800{
2801 return (v & 0x7U) << 16U;
2802}
2803static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map0_tile_5_f(u32 v)
2804{
2805 return (v & 0x7U) << 20U;
2806}
2807static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map0_tile_6_f(u32 v)
2808{
2809 return (v & 0x7U) << 24U;
2810}
2811static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map0_tile_7_f(u32 v)
2812{
2813 return (v & 0x7U) << 28U;
2814}
2815static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map1_r(void)
2816{
2817 return 0x00418984U;
2818}
2819static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map1_tile_8_f(u32 v)
2820{
2821 return (v & 0x7U) << 0U;
2822}
2823static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map1_tile_9_f(u32 v)
2824{
2825 return (v & 0x7U) << 4U;
2826}
2827static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map1_tile_10_f(u32 v)
2828{
2829 return (v & 0x7U) << 8U;
2830}
2831static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map1_tile_11_f(u32 v)
2832{
2833 return (v & 0x7U) << 12U;
2834}
2835static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map1_tile_12_f(u32 v)
2836{
2837 return (v & 0x7U) << 16U;
2838}
2839static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map1_tile_13_f(u32 v)
2840{
2841 return (v & 0x7U) << 20U;
2842}
2843static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map1_tile_14_f(u32 v)
2844{
2845 return (v & 0x7U) << 24U;
2846}
2847static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map1_tile_15_f(u32 v)
2848{
2849 return (v & 0x7U) << 28U;
2850}
2851static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map2_r(void)
2852{
2853 return 0x00418988U;
2854}
2855static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map2_tile_16_f(u32 v)
2856{
2857 return (v & 0x7U) << 0U;
2858}
2859static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map2_tile_17_f(u32 v)
2860{
2861 return (v & 0x7U) << 4U;
2862}
2863static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map2_tile_18_f(u32 v)
2864{
2865 return (v & 0x7U) << 8U;
2866}
2867static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map2_tile_19_f(u32 v)
2868{
2869 return (v & 0x7U) << 12U;
2870}
2871static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map2_tile_20_f(u32 v)
2872{
2873 return (v & 0x7U) << 16U;
2874}
2875static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map2_tile_21_f(u32 v)
2876{
2877 return (v & 0x7U) << 20U;
2878}
2879static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map2_tile_22_f(u32 v)
2880{
2881 return (v & 0x7U) << 24U;
2882}
2883static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map2_tile_23_s(void)
2884{
2885 return 3U;
2886}
2887static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map2_tile_23_f(u32 v)
2888{
2889 return (v & 0x7U) << 28U;
2890}
2891static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map2_tile_23_m(void)
2892{
2893 return 0x7U << 28U;
2894}
2895static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map2_tile_23_v(u32 r)
2896{
2897 return (r >> 28U) & 0x7U;
2898}
2899static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map3_r(void)
2900{
2901 return 0x0041898cU;
2902}
2903static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map3_tile_24_f(u32 v)
2904{
2905 return (v & 0x7U) << 0U;
2906}
2907static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map3_tile_25_f(u32 v)
2908{
2909 return (v & 0x7U) << 4U;
2910}
2911static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map3_tile_26_f(u32 v)
2912{
2913 return (v & 0x7U) << 8U;
2914}
2915static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map3_tile_27_f(u32 v)
2916{
2917 return (v & 0x7U) << 12U;
2918}
2919static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map3_tile_28_f(u32 v)
2920{
2921 return (v & 0x7U) << 16U;
2922}
2923static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map3_tile_29_f(u32 v)
2924{
2925 return (v & 0x7U) << 20U;
2926}
2927static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map3_tile_30_f(u32 v)
2928{
2929 return (v & 0x7U) << 24U;
2930}
2931static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map3_tile_31_f(u32 v)
2932{
2933 return (v & 0x7U) << 28U;
2934}
2935static inline u32 gr_gpcs_gpm_pd_cfg_r(void)
2936{
2937 return 0x00418c6cU;
2938}
2939static inline u32 gr_gpcs_gpm_pd_cfg_timeslice_mode_disable_f(void)
2940{
2941 return 0x0U;
2942}
2943static inline u32 gr_gpcs_gpm_pd_cfg_timeslice_mode_enable_f(void)
2944{
2945 return 0x1U;
2946}
2947static inline u32 gr_gpcs_gcc_pagepool_base_r(void)
2948{
2949 return 0x00419004U;
2950}
2951static inline u32 gr_gpcs_gcc_pagepool_base_addr_39_8_f(u32 v)
2952{
2953 return (v & 0xffffffffU) << 0U;
2954}
2955static inline u32 gr_gpcs_gcc_pagepool_r(void)
2956{
2957 return 0x00419008U;
2958}
2959static inline u32 gr_gpcs_gcc_pagepool_total_pages_f(u32 v)
2960{
2961 return (v & 0xffU) << 0U;
2962}
2963static inline u32 gr_gpcs_tpcs_pe_vaf_r(void)
2964{
2965 return 0x0041980cU;
2966}
2967static inline u32 gr_gpcs_tpcs_pe_vaf_fast_mode_switch_true_f(void)
2968{
2969 return 0x10U;
2970}
2971static inline u32 gr_gpcs_tpcs_pe_pin_cb_global_base_addr_r(void)
2972{
2973 return 0x00419848U;
2974}
2975static inline u32 gr_gpcs_tpcs_pe_pin_cb_global_base_addr_v_f(u32 v)
2976{
2977 return (v & 0xfffffffU) << 0U;
2978}
2979static inline u32 gr_gpcs_tpcs_pe_pin_cb_global_base_addr_valid_f(u32 v)
2980{
2981 return (v & 0x1U) << 28U;
2982}
2983static inline u32 gr_gpcs_tpcs_pe_pin_cb_global_base_addr_valid_true_f(void)
2984{
2985 return 0x10000000U;
2986}
2987static inline u32 gr_gpcs_tpcs_mpc_vtg_debug_r(void)
2988{
2989 return 0x00419c00U;
2990}
2991static inline u32 gr_gpcs_tpcs_mpc_vtg_debug_timeslice_mode_disabled_f(void)
2992{
2993 return 0x0U;
2994}
2995static inline u32 gr_gpcs_tpcs_mpc_vtg_debug_timeslice_mode_enabled_f(void)
2996{
2997 return 0x8U;
2998}
2999static inline u32 gr_gpcs_tpcs_mpc_vtg_cb_global_base_addr_r(void)
3000{
3001 return 0x00419c2cU;
3002}
3003static inline u32 gr_gpcs_tpcs_mpc_vtg_cb_global_base_addr_v_f(u32 v)
3004{
3005 return (v & 0xfffffffU) << 0U;
3006}
3007static inline u32 gr_gpcs_tpcs_mpc_vtg_cb_global_base_addr_valid_f(u32 v)
3008{
3009 return (v & 0x1U) << 28U;
3010}
3011static inline u32 gr_gpcs_tpcs_mpc_vtg_cb_global_base_addr_valid_true_f(void)
3012{
3013 return 0x10000000U;
3014}
3015static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_r(void)
3016{
3017 return 0x00419e44U;
3018}
3019static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_stack_error_report_f(void)
3020{
3021 return 0x2U;
3022}
3023static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_api_stack_error_report_f(void)
3024{
3025 return 0x4U;
3026}
3027static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_ret_empty_stack_error_report_f(void)
3028{
3029 return 0x8U;
3030}
3031static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_pc_wrap_report_f(void)
3032{
3033 return 0x10U;
3034}
3035static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_misaligned_pc_report_f(void)
3036{
3037 return 0x20U;
3038}
3039static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_pc_overflow_report_f(void)
3040{
3041 return 0x40U;
3042}
3043static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_misaligned_immc_addr_report_f(void)
3044{
3045 return 0x80U;
3046}
3047static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_misaligned_reg_report_f(void)
3048{
3049 return 0x100U;
3050}
3051static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_illegal_instr_encoding_report_f(void)
3052{
3053 return 0x200U;
3054}
3055static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_illegal_sph_instr_combo_report_f(void)
3056{
3057 return 0x400U;
3058}
3059static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_illegal_instr_param_report_f(void)
3060{
3061 return 0x800U;
3062}
3063static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_invalid_const_addr_report_f(void)
3064{
3065 return 0x1000U;
3066}
3067static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_oor_reg_report_f(void)
3068{
3069 return 0x2000U;
3070}
3071static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_oor_addr_report_f(void)
3072{
3073 return 0x4000U;
3074}
3075static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_misaligned_addr_report_f(void)
3076{
3077 return 0x8000U;
3078}
3079static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_invalid_addr_space_report_f(void)
3080{
3081 return 0x10000U;
3082}
3083static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_illegal_instr_param2_report_f(void)
3084{
3085 return 0x20000U;
3086}
3087static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_invalid_const_addr_ldc_report_f(void)
3088{
3089 return 0x40000U;
3090}
3091static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_mmu_fault_report_f(void)
3092{
3093 return 0x800000U;
3094}
3095static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_stack_overflow_report_f(void)
3096{
3097 return 0x400000U;
3098}
3099static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_geometry_sm_error_report_f(void)
3100{
3101 return 0x80000U;
3102}
3103static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_divergent_report_f(void)
3104{
3105 return 0x100000U;
3106}
3107static inline u32 gr_gpc0_tpc0_sm_hww_warp_esr_report_mask_r(void)
3108{
3109 return 0x00504644U;
3110}
3111static inline u32 gr_gpcs_tpcs_sm_hww_global_esr_report_mask_r(void)
3112{
3113 return 0x00419e4cU;
3114}
3115static inline u32 gr_gpcs_tpcs_sm_hww_global_esr_report_mask_sm_to_sm_fault_report_f(void)
3116{
3117 return 0x1U;
3118}
3119static inline u32 gr_gpcs_tpcs_sm_hww_global_esr_report_mask_l1_error_report_f(void)
3120{
3121 return 0x2U;
3122}
3123static inline u32 gr_gpcs_tpcs_sm_hww_global_esr_report_mask_multiple_warp_errors_report_f(void)
3124{
3125 return 0x4U;
3126}
3127static inline u32 gr_gpcs_tpcs_sm_hww_global_esr_report_mask_physical_stack_overflow_error_report_f(void)
3128{
3129 return 0x8U;
3130}
3131static inline u32 gr_gpcs_tpcs_sm_hww_global_esr_report_mask_bpt_int_report_f(void)
3132{
3133 return 0x10U;
3134}
3135static inline u32 gr_gpcs_tpcs_sm_hww_global_esr_report_mask_bpt_pause_report_f(void)
3136{
3137 return 0x20U;
3138}
3139static inline u32 gr_gpcs_tpcs_sm_hww_global_esr_report_mask_single_step_complete_report_f(void)
3140{
3141 return 0x40U;
3142}
3143static inline u32 gr_gpc0_tpc0_sm_hww_global_esr_report_mask_r(void)
3144{
3145 return 0x0050464cU;
3146}
3147static inline u32 gr_gpcs_tpcs_tpccs_tpc_exception_en_r(void)
3148{
3149 return 0x00419d0cU;
3150}
3151static inline u32 gr_gpcs_tpcs_tpccs_tpc_exception_en_sm_enabled_f(void)
3152{
3153 return 0x2U;
3154}
3155static inline u32 gr_gpcs_tpcs_tpccs_tpc_exception_en_tex_enabled_f(void)
3156{
3157 return 0x1U;
3158}
3159static inline u32 gr_gpc0_tpc0_tpccs_tpc_exception_en_r(void)
3160{
3161 return 0x0050450cU;
3162}
3163static inline u32 gr_gpc0_tpc0_tpccs_tpc_exception_en_sm_enabled_f(void)
3164{
3165 return 0x2U;
3166}
3167static inline u32 gr_gpc0_tpc0_tpccs_tpc_exception_en_sm_v(u32 r)
3168{
3169 return (r >> 1U) & 0x1U;
3170}
3171static inline u32 gr_gpcs_gpccs_gpc_exception_en_r(void)
3172{
3173 return 0x0041ac94U;
3174}
3175static inline u32 gr_gpcs_gpccs_gpc_exception_en_tpc_f(u32 v)
3176{
3177 return (v & 0xffU) << 16U;
3178}
3179static inline u32 gr_gpc0_gpccs_gpc_exception_r(void)
3180{
3181 return 0x00502c90U;
3182}
3183static inline u32 gr_gpc0_gpccs_gpc_exception_gcc_v(u32 r)
3184{
3185 return (r >> 2U) & 0x1U;
3186}
3187static inline u32 gr_gpc0_gpccs_gpc_exception_tpc_v(u32 r)
3188{
3189 return (r >> 16U) & 0xffU;
3190}
3191static inline u32 gr_gpc0_gpccs_gpc_exception_tpc_0_pending_v(void)
3192{
3193 return 0x00000001U;
3194}
3195static inline u32 gr_gpc0_tpc0_tpccs_tpc_exception_r(void)
3196{
3197 return 0x00504508U;
3198}
3199static inline u32 gr_gpc0_tpc0_tpccs_tpc_exception_tex_v(u32 r)
3200{
3201 return (r >> 0U) & 0x1U;
3202}
3203static inline u32 gr_gpc0_tpc0_tpccs_tpc_exception_tex_pending_v(void)
3204{
3205 return 0x00000001U;
3206}
3207static inline u32 gr_gpc0_tpc0_tpccs_tpc_exception_sm_v(u32 r)
3208{
3209 return (r >> 1U) & 0x1U;
3210}
3211static inline u32 gr_gpc0_tpc0_tpccs_tpc_exception_sm_pending_v(void)
3212{
3213 return 0x00000001U;
3214}
3215static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_r(void)
3216{
3217 return 0x00504610U;
3218}
3219static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_debugger_mode_m(void)
3220{
3221 return 0x1U << 0U;
3222}
3223static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_debugger_mode_v(u32 r)
3224{
3225 return (r >> 0U) & 0x1U;
3226}
3227static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_debugger_mode_on_v(void)
3228{
3229 return 0x00000001U;
3230}
3231static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_debugger_mode_on_f(void)
3232{
3233 return 0x1U;
3234}
3235static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_debugger_mode_off_v(void)
3236{
3237 return 0x00000000U;
3238}
3239static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_debugger_mode_off_f(void)
3240{
3241 return 0x0U;
3242}
3243static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_stop_trigger_enable_f(void)
3244{
3245 return 0x80000000U;
3246}
3247static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_stop_trigger_disable_f(void)
3248{
3249 return 0x0U;
3250}
3251static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_single_step_mode_enable_f(void)
3252{
3253 return 0x8U;
3254}
3255static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_single_step_mode_disable_f(void)
3256{
3257 return 0x0U;
3258}
3259static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_run_trigger_task_f(void)
3260{
3261 return 0x40000000U;
3262}
3263static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_stop_on_any_warp_m(void)
3264{
3265 return 0x1U << 1U;
3266}
3267static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_stop_on_any_warp_v(u32 r)
3268{
3269 return (r >> 1U) & 0x1U;
3270}
3271static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_stop_on_any_warp_disable_f(void)
3272{
3273 return 0x0U;
3274}
3275static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_stop_on_any_sm_m(void)
3276{
3277 return 0x1U << 2U;
3278}
3279static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_stop_on_any_sm_v(u32 r)
3280{
3281 return (r >> 2U) & 0x1U;
3282}
3283static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_stop_on_any_sm_disable_f(void)
3284{
3285 return 0x0U;
3286}
3287static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_stop_on_any_sm_stop_on_any_warp_disable_v(void)
3288{
3289 return 0x00000000U;
3290}
3291static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_stop_on_any_sm_stop_on_any_sm_disable_v(void)
3292{
3293 return 0x00000000U;
3294}
3295static inline u32 gr_gpc0_tpc0_sm_warp_valid_mask_r(void)
3296{
3297 return 0x00504614U;
3298}
3299static inline u32 gr_gpc0_tpc0_sm_warp_valid_mask_1_r(void)
3300{
3301 return 0x00504618U;
3302}
3303static inline u32 gr_gpc0_tpc0_sm_warp_valid_mask_2_r(void)
3304{
3305 return 0x0050461cU;
3306}
3307static inline u32 gr_gpc0_tpc0_sm_dbgr_bpt_pause_mask_r(void)
3308{
3309 return 0x00504624U;
3310}
3311static inline u32 gr_gpc0_tpc0_sm_dbgr_bpt_pause_mask_1_r(void)
3312{
3313 return 0x00504628U;
3314}
3315static inline u32 gr_gpc0_tpc0_sm_dbgr_bpt_pause_mask_2_r(void)
3316{
3317 return 0x00504750U;
3318}
3319static inline u32 gr_gpc0_tpc0_sm_dbgr_bpt_trap_mask_r(void)
3320{
3321 return 0x00504634U;
3322}
3323static inline u32 gr_gpc0_tpc0_sm_dbgr_bpt_trap_mask_1_r(void)
3324{
3325 return 0x00504638U;
3326}
3327static inline u32 gr_gpc0_tpc0_sm_dbgr_bpt_trap_mask_2_r(void)
3328{
3329 return 0x00504758U;
3330}
3331static inline u32 gr_gpcs_tpcs_sm_dbgr_bpt_pause_mask_r(void)
3332{
3333 return 0x00419e24U;
3334}
3335static inline u32 gr_gpc0_tpc0_sm_dbgr_status0_r(void)
3336{
3337 return 0x0050460cU;
3338}
3339static inline u32 gr_gpc0_tpc0_sm_dbgr_status0_sm_in_trap_mode_v(u32 r)
3340{
3341 return (r >> 0U) & 0x1U;
3342}
3343static inline u32 gr_gpc0_tpc0_sm_dbgr_status0_locked_down_v(u32 r)
3344{
3345 return (r >> 4U) & 0x1U;
3346}
3347static inline u32 gr_gpc0_tpc0_sm_dbgr_status0_locked_down_true_v(void)
3348{
3349 return 0x00000001U;
3350}
3351static inline u32 gr_gpcs_tpcs_sm_hww_global_esr_r(void)
3352{
3353 return 0x00419e50U;
3354}
3355static inline u32 gr_gpcs_tpcs_sm_hww_global_esr_bpt_int_pending_f(void)
3356{
3357 return 0x10U;
3358}
3359static inline u32 gr_gpcs_tpcs_sm_hww_global_esr_bpt_pause_pending_f(void)
3360{
3361 return 0x20U;
3362}
3363static inline u32 gr_gpcs_tpcs_sm_hww_global_esr_single_step_complete_pending_f(void)
3364{
3365 return 0x40U;
3366}
3367static inline u32 gr_gpcs_tpcs_sm_hww_global_esr_sm_to_sm_fault_pending_f(void)
3368{
3369 return 0x1U;
3370}
3371static inline u32 gr_gpcs_tpcs_sm_hww_global_esr_l1_error_pending_f(void)
3372{
3373 return 0x2U;
3374}
3375static inline u32 gr_gpcs_tpcs_sm_hww_global_esr_multiple_warp_errors_pending_f(void)
3376{
3377 return 0x4U;
3378}
3379static inline u32 gr_gpcs_tpcs_sm_hww_global_esr_physical_stack_overflow_error_pending_f(void)
3380{
3381 return 0x8U;
3382}
3383static inline u32 gr_gpcs_tpcs_sm_hww_global_esr_timeout_error_pending_f(void)
3384{
3385 return 0x80000000U;
3386}
3387static inline u32 gr_gpc0_tpc0_sm_hww_global_esr_r(void)
3388{
3389 return 0x00504650U;
3390}
3391static inline u32 gr_gpc0_tpc0_sm_hww_global_esr_bpt_int_pending_f(void)
3392{
3393 return 0x10U;
3394}
3395static inline u32 gr_gpc0_tpc0_sm_hww_global_esr_bpt_pause_pending_f(void)
3396{
3397 return 0x20U;
3398}
3399static inline u32 gr_gpc0_tpc0_sm_hww_global_esr_single_step_complete_pending_f(void)
3400{
3401 return 0x40U;
3402}
3403static inline u32 gr_gpc0_tpc0_sm_hww_global_esr_sm_to_sm_fault_pending_f(void)
3404{
3405 return 0x1U;
3406}
3407static inline u32 gr_gpc0_tpc0_sm_hww_global_esr_l1_error_pending_f(void)
3408{
3409 return 0x2U;
3410}
3411static inline u32 gr_gpc0_tpc0_sm_hww_global_esr_multiple_warp_errors_pending_f(void)
3412{
3413 return 0x4U;
3414}
3415static inline u32 gr_gpc0_tpc0_sm_hww_global_esr_physical_stack_overflow_error_pending_f(void)
3416{
3417 return 0x8U;
3418}
3419static inline u32 gr_gpc0_tpc0_sm_hww_global_esr_timeout_error_pending_f(void)
3420{
3421 return 0x80000000U;
3422}
3423static inline u32 gr_gpc0_tpc0_tex_m_hww_esr_r(void)
3424{
3425 return 0x00504224U;
3426}
3427static inline u32 gr_gpc0_tpc0_tex_m_hww_esr_intr_pending_f(void)
3428{
3429 return 0x1U;
3430}
3431static inline u32 gr_gpc0_tpc0_sm_hww_warp_esr_r(void)
3432{
3433 return 0x00504648U;
3434}
3435static inline u32 gr_gpc0_tpc0_sm_hww_warp_esr_error_v(u32 r)
3436{
3437 return (r >> 0U) & 0xffffU;
3438}
3439static inline u32 gr_gpc0_tpc0_sm_hww_warp_esr_error_none_v(void)
3440{
3441 return 0x00000000U;
3442}
3443static inline u32 gr_gpc0_tpc0_sm_hww_warp_esr_error_none_f(void)
3444{
3445 return 0x0U;
3446}
3447static inline u32 gr_gpc0_tpc0_sm_hww_warp_esr_pc_r(void)
3448{
3449 return 0x00504654U;
3450}
3451static inline u32 gr_gpc0_tpc0_sm_halfctl_ctrl_r(void)
3452{
3453 return 0x00504770U;
3454}
3455static inline u32 gr_gpcs_tpcs_sm_halfctl_ctrl_r(void)
3456{
3457 return 0x00419f70U;
3458}
3459static inline u32 gr_gpcs_tpcs_sm_halfctl_ctrl_sctl_read_quad_ctl_m(void)
3460{
3461 return 0x1U << 4U;
3462}
3463static inline u32 gr_gpcs_tpcs_sm_halfctl_ctrl_sctl_read_quad_ctl_f(u32 v)
3464{
3465 return (v & 0x1U) << 4U;
3466}
3467static inline u32 gr_gpc0_tpc0_sm_debug_sfe_control_r(void)
3468{
3469 return 0x0050477cU;
3470}
3471static inline u32 gr_gpcs_tpcs_sm_debug_sfe_control_r(void)
3472{
3473 return 0x00419f7cU;
3474}
3475static inline u32 gr_gpcs_tpcs_sm_debug_sfe_control_read_half_ctl_m(void)
3476{
3477 return 0x1U << 0U;
3478}
3479static inline u32 gr_gpcs_tpcs_sm_debug_sfe_control_read_half_ctl_f(u32 v)
3480{
3481 return (v & 0x1U) << 0U;
3482}
3483static inline u32 gr_gpcs_tpcs_pes_vsc_vpc_r(void)
3484{
3485 return 0x0041be08U;
3486}
3487static inline u32 gr_gpcs_tpcs_pes_vsc_vpc_fast_mode_switch_true_f(void)
3488{
3489 return 0x4U;
3490}
3491static inline u32 gr_ppcs_wwdx_map_gpc_map0_r(void)
3492{
3493 return 0x0041bf00U;
3494}
3495static inline u32 gr_ppcs_wwdx_map_gpc_map1_r(void)
3496{
3497 return 0x0041bf04U;
3498}
3499static inline u32 gr_ppcs_wwdx_map_gpc_map2_r(void)
3500{
3501 return 0x0041bf08U;
3502}
3503static inline u32 gr_ppcs_wwdx_map_gpc_map3_r(void)
3504{
3505 return 0x0041bf0cU;
3506}
3507static inline u32 gr_ppcs_wwdx_map_gpc_map4_r(void)
3508{
3509 return 0x0041bf10U;
3510}
3511static inline u32 gr_ppcs_wwdx_map_gpc_map5_r(void)
3512{
3513 return 0x0041bf14U;
3514}
3515static inline u32 gr_ppcs_wwdx_map_table_cfg_r(void)
3516{
3517 return 0x0041bfd0U;
3518}
3519static inline u32 gr_ppcs_wwdx_map_table_cfg_row_offset_f(u32 v)
3520{
3521 return (v & 0xffU) << 0U;
3522}
3523static inline u32 gr_ppcs_wwdx_map_table_cfg_num_entries_f(u32 v)
3524{
3525 return (v & 0xffU) << 8U;
3526}
3527static inline u32 gr_ppcs_wwdx_map_table_cfg_normalized_num_entries_f(u32 v)
3528{
3529 return (v & 0x1fU) << 16U;
3530}
3531static inline u32 gr_ppcs_wwdx_map_table_cfg_normalized_shift_value_f(u32 v)
3532{
3533 return (v & 0x7U) << 21U;
3534}
3535static inline u32 gr_ppcs_wwdx_map_table_cfg_coeff5_mod_value_f(u32 v)
3536{
3537 return (v & 0x1fU) << 24U;
3538}
3539static inline u32 gr_gpcs_ppcs_wwdx_sm_num_rcp_r(void)
3540{
3541 return 0x0041bfd4U;
3542}
3543static inline u32 gr_gpcs_ppcs_wwdx_sm_num_rcp_conservative_f(u32 v)
3544{
3545 return (v & 0xffffffU) << 0U;
3546}
3547static inline u32 gr_ppcs_wwdx_map_table_cfg2_r(void)
3548{
3549 return 0x0041bfe4U;
3550}
3551static inline u32 gr_ppcs_wwdx_map_table_cfg2_coeff6_mod_value_f(u32 v)
3552{
3553 return (v & 0x1fU) << 0U;
3554}
3555static inline u32 gr_ppcs_wwdx_map_table_cfg2_coeff7_mod_value_f(u32 v)
3556{
3557 return (v & 0x1fU) << 5U;
3558}
3559static inline u32 gr_ppcs_wwdx_map_table_cfg2_coeff8_mod_value_f(u32 v)
3560{
3561 return (v & 0x1fU) << 10U;
3562}
3563static inline u32 gr_ppcs_wwdx_map_table_cfg2_coeff9_mod_value_f(u32 v)
3564{
3565 return (v & 0x1fU) << 15U;
3566}
3567static inline u32 gr_ppcs_wwdx_map_table_cfg2_coeff10_mod_value_f(u32 v)
3568{
3569 return (v & 0x1fU) << 20U;
3570}
3571static inline u32 gr_ppcs_wwdx_map_table_cfg2_coeff11_mod_value_f(u32 v)
3572{
3573 return (v & 0x1fU) << 25U;
3574}
3575static inline u32 gr_bes_zrop_settings_r(void)
3576{
3577 return 0x00408850U;
3578}
3579static inline u32 gr_bes_zrop_settings_num_active_ltcs_f(u32 v)
3580{
3581 return (v & 0xfU) << 0U;
3582}
3583static inline u32 gr_be0_crop_debug3_r(void)
3584{
3585 return 0x00410108U;
3586}
3587static inline u32 gr_bes_crop_debug3_r(void)
3588{
3589 return 0x00408908U;
3590}
3591static inline u32 gr_bes_crop_debug3_comp_vdc_4to2_disable_m(void)
3592{
3593 return 0x1U << 31U;
3594}
3595static inline u32 gr_bes_crop_settings_r(void)
3596{
3597 return 0x00408958U;
3598}
3599static inline u32 gr_bes_crop_settings_num_active_ltcs_f(u32 v)
3600{
3601 return (v & 0xfU) << 0U;
3602}
3603static inline u32 gr_zcull_bytes_per_aliquot_per_gpu_v(void)
3604{
3605 return 0x00000020U;
3606}
3607static inline u32 gr_zcull_save_restore_header_bytes_per_gpc_v(void)
3608{
3609 return 0x00000020U;
3610}
3611static inline u32 gr_zcull_save_restore_subregion_header_bytes_per_gpc_v(void)
3612{
3613 return 0x000000c0U;
3614}
3615static inline u32 gr_zcull_subregion_qty_v(void)
3616{
3617 return 0x00000010U;
3618}
3619static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter_control_sel0_r(void)
3620{
3621 return 0x00504604U;
3622}
3623static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter_control_sel1_r(void)
3624{
3625 return 0x00504608U;
3626}
3627static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter_control0_r(void)
3628{
3629 return 0x0050465cU;
3630}
3631static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter_control1_r(void)
3632{
3633 return 0x00504660U;
3634}
3635static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter_control2_r(void)
3636{
3637 return 0x00504664U;
3638}
3639static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter_control3_r(void)
3640{
3641 return 0x00504668U;
3642}
3643static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter_control4_r(void)
3644{
3645 return 0x0050466cU;
3646}
3647static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter_control5_r(void)
3648{
3649 return 0x00504658U;
3650}
3651static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter0_control_r(void)
3652{
3653 return 0x00504730U;
3654}
3655static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter1_control_r(void)
3656{
3657 return 0x00504734U;
3658}
3659static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter2_control_r(void)
3660{
3661 return 0x00504738U;
3662}
3663static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter3_control_r(void)
3664{
3665 return 0x0050473cU;
3666}
3667static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter4_control_r(void)
3668{
3669 return 0x00504740U;
3670}
3671static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter5_control_r(void)
3672{
3673 return 0x00504744U;
3674}
3675static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter6_control_r(void)
3676{
3677 return 0x00504748U;
3678}
3679static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter7_control_r(void)
3680{
3681 return 0x0050474cU;
3682}
3683static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter_status_s1_r(void)
3684{
3685 return 0x00504678U;
3686}
3687static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter_status1_r(void)
3688{
3689 return 0x00504694U;
3690}
3691static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter0_s0_r(void)
3692{
3693 return 0x005046f0U;
3694}
3695static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter0_s1_r(void)
3696{
3697 return 0x00504700U;
3698}
3699static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter1_s0_r(void)
3700{
3701 return 0x005046f4U;
3702}
3703static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter1_s1_r(void)
3704{
3705 return 0x00504704U;
3706}
3707static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter2_s0_r(void)
3708{
3709 return 0x005046f8U;
3710}
3711static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter2_s1_r(void)
3712{
3713 return 0x00504708U;
3714}
3715static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter3_s0_r(void)
3716{
3717 return 0x005046fcU;
3718}
3719static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter3_s1_r(void)
3720{
3721 return 0x0050470cU;
3722}
3723static inline u32 gr_fe_pwr_mode_r(void)
3724{
3725 return 0x00404170U;
3726}
3727static inline u32 gr_fe_pwr_mode_mode_auto_f(void)
3728{
3729 return 0x0U;
3730}
3731static inline u32 gr_fe_pwr_mode_mode_force_on_f(void)
3732{
3733 return 0x2U;
3734}
3735static inline u32 gr_fe_pwr_mode_req_v(u32 r)
3736{
3737 return (r >> 4U) & 0x1U;
3738}
3739static inline u32 gr_fe_pwr_mode_req_send_f(void)
3740{
3741 return 0x10U;
3742}
3743static inline u32 gr_fe_pwr_mode_req_done_v(void)
3744{
3745 return 0x00000000U;
3746}
3747static inline u32 gr_gpcs_pri_mmu_ctrl_r(void)
3748{
3749 return 0x00418880U;
3750}
3751static inline u32 gr_gpcs_pri_mmu_ctrl_vm_pg_size_m(void)
3752{
3753 return 0x1U << 0U;
3754}
3755static inline u32 gr_gpcs_pri_mmu_ctrl_use_pdb_big_page_size_m(void)
3756{
3757 return 0x1U << 11U;
3758}
3759static inline u32 gr_gpcs_pri_mmu_ctrl_use_full_comp_tag_line_m(void)
3760{
3761 return 0x1U << 12U;
3762}
3763static inline u32 gr_gpcs_pri_mmu_ctrl_vol_fault_m(void)
3764{
3765 return 0x1U << 1U;
3766}
3767static inline u32 gr_gpcs_pri_mmu_ctrl_comp_fault_m(void)
3768{
3769 return 0x1U << 2U;
3770}
3771static inline u32 gr_gpcs_pri_mmu_ctrl_miss_gran_m(void)
3772{
3773 return 0x3U << 3U;
3774}
3775static inline u32 gr_gpcs_pri_mmu_ctrl_cache_mode_m(void)
3776{
3777 return 0x3U << 5U;
3778}
3779static inline u32 gr_gpcs_pri_mmu_ctrl_mmu_aperture_m(void)
3780{
3781 return 0x3U << 28U;
3782}
3783static inline u32 gr_gpcs_pri_mmu_ctrl_mmu_vol_m(void)
3784{
3785 return 0x1U << 30U;
3786}
3787static inline u32 gr_gpcs_pri_mmu_ctrl_mmu_disable_m(void)
3788{
3789 return 0x1U << 31U;
3790}
3791static inline u32 gr_gpcs_pri_mmu_pm_unit_mask_r(void)
3792{
3793 return 0x00418890U;
3794}
3795static inline u32 gr_gpcs_pri_mmu_pm_req_mask_r(void)
3796{
3797 return 0x00418894U;
3798}
3799static inline u32 gr_gpcs_pri_mmu_debug_ctrl_r(void)
3800{
3801 return 0x004188b0U;
3802}
3803static inline u32 gr_gpcs_pri_mmu_debug_ctrl_debug_m(void)
3804{
3805 return 0x1U << 16U;
3806}
3807static inline u32 gr_gpcs_pri_mmu_debug_ctrl_debug_v(u32 r)
3808{
3809 return (r >> 16U) & 0x1U;
3810}
3811static inline u32 gr_gpcs_pri_mmu_debug_ctrl_debug_enabled_v(void)
3812{
3813 return 0x00000001U;
3814}
3815static inline u32 gr_gpcs_pri_mmu_debug_ctrl_debug_enabled_f(void)
3816{
3817 return 0x10000U;
3818}
3819static inline u32 gr_gpcs_pri_mmu_debug_ctrl_debug_disabled_v(void)
3820{
3821 return 0x00000000U;
3822}
3823static inline u32 gr_gpcs_pri_mmu_debug_ctrl_debug_disabled_f(void)
3824{
3825 return 0x0U;
3826}
3827static inline u32 gr_gpcs_pri_mmu_debug_wr_r(void)
3828{
3829 return 0x004188b4U;
3830}
3831static inline u32 gr_gpcs_pri_mmu_debug_rd_r(void)
3832{
3833 return 0x004188b8U;
3834}
3835static inline u32 gr_gpcs_mmu_num_active_ltcs_r(void)
3836{
3837 return 0x004188acU;
3838}
3839static inline u32 gr_gpcs_tpcs_sm_dbgr_control0_r(void)
3840{
3841 return 0x00419e10U;
3842}
3843static inline u32 gr_gpcs_tpcs_sm_dbgr_control0_debugger_mode_f(u32 v)
3844{
3845 return (v & 0x1U) << 0U;
3846}
3847static inline u32 gr_gpcs_tpcs_sm_dbgr_control0_debugger_mode_on_v(void)
3848{
3849 return 0x00000001U;
3850}
3851static inline u32 gr_gpcs_tpcs_sm_dbgr_control0_stop_trigger_m(void)
3852{
3853 return 0x1U << 31U;
3854}
3855static inline u32 gr_gpcs_tpcs_sm_dbgr_control0_stop_trigger_v(u32 r)
3856{
3857 return (r >> 31U) & 0x1U;
3858}
3859static inline u32 gr_gpcs_tpcs_sm_dbgr_control0_stop_trigger_enable_f(void)
3860{
3861 return 0x80000000U;
3862}
3863static inline u32 gr_gpcs_tpcs_sm_dbgr_control0_stop_trigger_disable_f(void)
3864{
3865 return 0x0U;
3866}
3867static inline u32 gr_gpcs_tpcs_sm_dbgr_control0_single_step_mode_m(void)
3868{
3869 return 0x1U << 3U;
3870}
3871static inline u32 gr_gpcs_tpcs_sm_dbgr_control0_single_step_mode_enable_f(void)
3872{
3873 return 0x8U;
3874}
3875static inline u32 gr_gpcs_tpcs_sm_dbgr_control0_single_step_mode_disable_f(void)
3876{
3877 return 0x0U;
3878}
3879static inline u32 gr_gpcs_tpcs_sm_dbgr_control0_run_trigger_m(void)
3880{
3881 return 0x1U << 30U;
3882}
3883static inline u32 gr_gpcs_tpcs_sm_dbgr_control0_run_trigger_v(u32 r)
3884{
3885 return (r >> 30U) & 0x1U;
3886}
3887static inline u32 gr_gpcs_tpcs_sm_dbgr_control0_run_trigger_task_f(void)
3888{
3889 return 0x40000000U;
3890}
3891#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_ltc_gm20b.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_ltc_gm20b.h
new file mode 100644
index 00000000..2c3ebb45
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_ltc_gm20b.h
@@ -0,0 +1,527 @@
1/*
2 * Copyright (c) 2014-2017, 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_ltc_gm20b_h_
57#define _hw_ltc_gm20b_h_
58
59static inline u32 ltc_pltcg_base_v(void)
60{
61 return 0x00140000U;
62}
63static inline u32 ltc_pltcg_extent_v(void)
64{
65 return 0x0017ffffU;
66}
67static inline u32 ltc_ltc0_ltss_v(void)
68{
69 return 0x00140200U;
70}
71static inline u32 ltc_ltc0_lts0_v(void)
72{
73 return 0x00140400U;
74}
75static inline u32 ltc_ltcs_ltss_v(void)
76{
77 return 0x0017e200U;
78}
79static inline u32 ltc_ltcs_lts0_cbc_ctrl1_r(void)
80{
81 return 0x0014046cU;
82}
83static inline u32 ltc_ltc0_lts0_dstg_cfg0_r(void)
84{
85 return 0x00140518U;
86}
87static inline u32 ltc_ltcs_ltss_dstg_cfg0_r(void)
88{
89 return 0x0017e318U;
90}
91static inline u32 ltc_ltcs_ltss_dstg_cfg0_vdc_4to2_disable_m(void)
92{
93 return 0x1U << 15U;
94}
95static inline u32 ltc_ltc0_lts0_tstg_cfg1_r(void)
96{
97 return 0x00140494U;
98}
99static inline u32 ltc_ltc0_lts0_tstg_cfg1_active_ways_v(u32 r)
100{
101 return (r >> 0U) & 0xffffU;
102}
103static inline u32 ltc_ltc0_lts0_tstg_cfg1_active_sets_v(u32 r)
104{
105 return (r >> 16U) & 0x3U;
106}
107static inline u32 ltc_ltc0_lts0_tstg_cfg1_active_sets_all_v(void)
108{
109 return 0x00000000U;
110}
111static inline u32 ltc_ltc0_lts0_tstg_cfg1_active_sets_half_v(void)
112{
113 return 0x00000001U;
114}
115static inline u32 ltc_ltc0_lts0_tstg_cfg1_active_sets_quarter_v(void)
116{
117 return 0x00000002U;
118}
119static inline u32 ltc_ltcs_ltss_cbc_ctrl1_r(void)
120{
121 return 0x0017e26cU;
122}
123static inline u32 ltc_ltcs_ltss_cbc_ctrl1_clean_active_f(void)
124{
125 return 0x1U;
126}
127static inline u32 ltc_ltcs_ltss_cbc_ctrl1_invalidate_active_f(void)
128{
129 return 0x2U;
130}
131static inline u32 ltc_ltcs_ltss_cbc_ctrl1_clear_v(u32 r)
132{
133 return (r >> 2U) & 0x1U;
134}
135static inline u32 ltc_ltcs_ltss_cbc_ctrl1_clear_active_v(void)
136{
137 return 0x00000001U;
138}
139static inline u32 ltc_ltcs_ltss_cbc_ctrl1_clear_active_f(void)
140{
141 return 0x4U;
142}
143static inline u32 ltc_ltc0_lts0_cbc_ctrl1_r(void)
144{
145 return 0x0014046cU;
146}
147static inline u32 ltc_ltcs_ltss_cbc_ctrl2_r(void)
148{
149 return 0x0017e270U;
150}
151static inline u32 ltc_ltcs_ltss_cbc_ctrl2_clear_lower_bound_f(u32 v)
152{
153 return (v & 0x1ffffU) << 0U;
154}
155static inline u32 ltc_ltcs_ltss_cbc_ctrl3_r(void)
156{
157 return 0x0017e274U;
158}
159static inline u32 ltc_ltcs_ltss_cbc_ctrl3_clear_upper_bound_f(u32 v)
160{
161 return (v & 0x1ffffU) << 0U;
162}
163static inline u32 ltc_ltcs_ltss_cbc_ctrl3_clear_upper_bound_init_v(void)
164{
165 return 0x0001ffffU;
166}
167static inline u32 ltc_ltcs_ltss_cbc_base_r(void)
168{
169 return 0x0017e278U;
170}
171static inline u32 ltc_ltcs_ltss_cbc_base_alignment_shift_v(void)
172{
173 return 0x0000000bU;
174}
175static inline u32 ltc_ltcs_ltss_cbc_base_address_v(u32 r)
176{
177 return (r >> 0U) & 0x3ffffffU;
178}
179static inline u32 ltc_ltcs_ltss_cbc_num_active_ltcs_r(void)
180{
181 return 0x0017e27cU;
182}
183static inline u32 ltc_ltcs_misc_ltc_num_active_ltcs_r(void)
184{
185 return 0x0017e000U;
186}
187static inline u32 ltc_ltcs_ltss_cbc_param_r(void)
188{
189 return 0x0017e280U;
190}
191static inline u32 ltc_ltcs_ltss_cbc_param_comptags_per_cache_line_v(u32 r)
192{
193 return (r >> 0U) & 0xffffU;
194}
195static inline u32 ltc_ltcs_ltss_cbc_param_cache_line_size_v(u32 r)
196{
197 return (r >> 24U) & 0xfU;
198}
199static inline u32 ltc_ltcs_ltss_cbc_param_slices_per_ltc_v(u32 r)
200{
201 return (r >> 28U) & 0xfU;
202}
203static inline u32 ltc_ltcs_ltss_tstg_set_mgmt_r(void)
204{
205 return 0x0017e2acU;
206}
207static inline u32 ltc_ltcs_ltss_tstg_set_mgmt_max_ways_evict_last_f(u32 v)
208{
209 return (v & 0x1fU) << 16U;
210}
211static inline u32 ltc_ltcs_ltss_dstg_zbc_index_r(void)
212{
213 return 0x0017e338U;
214}
215static inline u32 ltc_ltcs_ltss_dstg_zbc_index_address_f(u32 v)
216{
217 return (v & 0xfU) << 0U;
218}
219static inline u32 ltc_ltcs_ltss_dstg_zbc_color_clear_value_r(u32 i)
220{
221 return 0x0017e33cU + i*4U;
222}
223static inline u32 ltc_ltcs_ltss_dstg_zbc_color_clear_value__size_1_v(void)
224{
225 return 0x00000004U;
226}
227static inline u32 ltc_ltcs_ltss_dstg_zbc_depth_clear_value_r(void)
228{
229 return 0x0017e34cU;
230}
231static inline u32 ltc_ltcs_ltss_dstg_zbc_depth_clear_value_field_s(void)
232{
233 return 32U;
234}
235static inline u32 ltc_ltcs_ltss_dstg_zbc_depth_clear_value_field_f(u32 v)
236{
237 return (v & 0xffffffffU) << 0U;
238}
239static inline u32 ltc_ltcs_ltss_dstg_zbc_depth_clear_value_field_m(void)
240{
241 return 0xffffffffU << 0U;
242}
243static inline u32 ltc_ltcs_ltss_dstg_zbc_depth_clear_value_field_v(u32 r)
244{
245 return (r >> 0U) & 0xffffffffU;
246}
247static inline u32 ltc_ltcs_ltss_tstg_set_mgmt_2_r(void)
248{
249 return 0x0017e2b0U;
250}
251static inline u32 ltc_ltcs_ltss_tstg_set_mgmt_2_l2_bypass_mode_enabled_f(void)
252{
253 return 0x10000000U;
254}
255static inline u32 ltc_ltcs_ltss_g_elpg_r(void)
256{
257 return 0x0017e214U;
258}
259static inline u32 ltc_ltcs_ltss_g_elpg_flush_v(u32 r)
260{
261 return (r >> 0U) & 0x1U;
262}
263static inline u32 ltc_ltcs_ltss_g_elpg_flush_pending_v(void)
264{
265 return 0x00000001U;
266}
267static inline u32 ltc_ltcs_ltss_g_elpg_flush_pending_f(void)
268{
269 return 0x1U;
270}
271static inline u32 ltc_ltc0_ltss_g_elpg_r(void)
272{
273 return 0x00140214U;
274}
275static inline u32 ltc_ltc0_ltss_g_elpg_flush_v(u32 r)
276{
277 return (r >> 0U) & 0x1U;
278}
279static inline u32 ltc_ltc0_ltss_g_elpg_flush_pending_v(void)
280{
281 return 0x00000001U;
282}
283static inline u32 ltc_ltc0_ltss_g_elpg_flush_pending_f(void)
284{
285 return 0x1U;
286}
287static inline u32 ltc_ltc1_ltss_g_elpg_r(void)
288{
289 return 0x00142214U;
290}
291static inline u32 ltc_ltc1_ltss_g_elpg_flush_v(u32 r)
292{
293 return (r >> 0U) & 0x1U;
294}
295static inline u32 ltc_ltc1_ltss_g_elpg_flush_pending_v(void)
296{
297 return 0x00000001U;
298}
299static inline u32 ltc_ltc1_ltss_g_elpg_flush_pending_f(void)
300{
301 return 0x1U;
302}
303static inline u32 ltc_ltcs_ltss_intr_r(void)
304{
305 return 0x0017e20cU;
306}
307static inline u32 ltc_ltcs_ltss_intr_en_evicted_cb_m(void)
308{
309 return 0x1U << 20U;
310}
311static inline u32 ltc_ltcs_ltss_intr_en_illegal_compstat_access_m(void)
312{
313 return 0x1U << 30U;
314}
315static inline u32 ltc_ltcs_ltss_intr_en_illegal_compstat_m(void)
316{
317 return 0x1U << 21U;
318}
319static inline u32 ltc_ltc0_lts0_intr_r(void)
320{
321 return 0x0014040cU;
322}
323static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_r(void)
324{
325 return 0x0017e2a0U;
326}
327static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_invalidate_v(u32 r)
328{
329 return (r >> 0U) & 0x1U;
330}
331static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_invalidate_pending_v(void)
332{
333 return 0x00000001U;
334}
335static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_invalidate_pending_f(void)
336{
337 return 0x1U;
338}
339static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_max_cycles_between_invalidates_v(u32 r)
340{
341 return (r >> 8U) & 0xfU;
342}
343static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_max_cycles_between_invalidates_3_v(void)
344{
345 return 0x00000003U;
346}
347static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_max_cycles_between_invalidates_3_f(void)
348{
349 return 0x300U;
350}
351static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_invalidate_evict_last_class_v(u32 r)
352{
353 return (r >> 28U) & 0x1U;
354}
355static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_invalidate_evict_last_class_true_v(void)
356{
357 return 0x00000001U;
358}
359static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_invalidate_evict_last_class_true_f(void)
360{
361 return 0x10000000U;
362}
363static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_invalidate_evict_normal_class_v(u32 r)
364{
365 return (r >> 29U) & 0x1U;
366}
367static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_invalidate_evict_normal_class_true_v(void)
368{
369 return 0x00000001U;
370}
371static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_invalidate_evict_normal_class_true_f(void)
372{
373 return 0x20000000U;
374}
375static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_invalidate_evict_first_class_v(u32 r)
376{
377 return (r >> 30U) & 0x1U;
378}
379static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_invalidate_evict_first_class_true_v(void)
380{
381 return 0x00000001U;
382}
383static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_invalidate_evict_first_class_true_f(void)
384{
385 return 0x40000000U;
386}
387static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_r(void)
388{
389 return 0x0017e2a4U;
390}
391static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_v(u32 r)
392{
393 return (r >> 0U) & 0x1U;
394}
395static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_pending_v(void)
396{
397 return 0x00000001U;
398}
399static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_pending_f(void)
400{
401 return 0x1U;
402}
403static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_max_cycles_between_cleans_v(u32 r)
404{
405 return (r >> 8U) & 0xfU;
406}
407static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_max_cycles_between_cleans_3_v(void)
408{
409 return 0x00000003U;
410}
411static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_max_cycles_between_cleans_3_f(void)
412{
413 return 0x300U;
414}
415static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_wait_for_fb_to_pull_v(u32 r)
416{
417 return (r >> 16U) & 0x1U;
418}
419static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_wait_for_fb_to_pull_true_v(void)
420{
421 return 0x00000001U;
422}
423static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_wait_for_fb_to_pull_true_f(void)
424{
425 return 0x10000U;
426}
427static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_evict_last_class_v(u32 r)
428{
429 return (r >> 28U) & 0x1U;
430}
431static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_evict_last_class_true_v(void)
432{
433 return 0x00000001U;
434}
435static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_evict_last_class_true_f(void)
436{
437 return 0x10000000U;
438}
439static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_evict_normal_class_v(u32 r)
440{
441 return (r >> 29U) & 0x1U;
442}
443static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_evict_normal_class_true_v(void)
444{
445 return 0x00000001U;
446}
447static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_evict_normal_class_true_f(void)
448{
449 return 0x20000000U;
450}
451static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_evict_first_class_v(u32 r)
452{
453 return (r >> 30U) & 0x1U;
454}
455static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_evict_first_class_true_v(void)
456{
457 return 0x00000001U;
458}
459static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_evict_first_class_true_f(void)
460{
461 return 0x40000000U;
462}
463static inline u32 ltc_ltc0_ltss_tstg_cmgmt0_r(void)
464{
465 return 0x001402a0U;
466}
467static inline u32 ltc_ltc0_ltss_tstg_cmgmt0_invalidate_v(u32 r)
468{
469 return (r >> 0U) & 0x1U;
470}
471static inline u32 ltc_ltc0_ltss_tstg_cmgmt0_invalidate_pending_v(void)
472{
473 return 0x00000001U;
474}
475static inline u32 ltc_ltc0_ltss_tstg_cmgmt0_invalidate_pending_f(void)
476{
477 return 0x1U;
478}
479static inline u32 ltc_ltc0_ltss_tstg_cmgmt1_r(void)
480{
481 return 0x001402a4U;
482}
483static inline u32 ltc_ltc0_ltss_tstg_cmgmt1_clean_v(u32 r)
484{
485 return (r >> 0U) & 0x1U;
486}
487static inline u32 ltc_ltc0_ltss_tstg_cmgmt1_clean_pending_v(void)
488{
489 return 0x00000001U;
490}
491static inline u32 ltc_ltc0_ltss_tstg_cmgmt1_clean_pending_f(void)
492{
493 return 0x1U;
494}
495static inline u32 ltc_ltc1_ltss_tstg_cmgmt0_r(void)
496{
497 return 0x001422a0U;
498}
499static inline u32 ltc_ltc1_ltss_tstg_cmgmt0_invalidate_v(u32 r)
500{
501 return (r >> 0U) & 0x1U;
502}
503static inline u32 ltc_ltc1_ltss_tstg_cmgmt0_invalidate_pending_v(void)
504{
505 return 0x00000001U;
506}
507static inline u32 ltc_ltc1_ltss_tstg_cmgmt0_invalidate_pending_f(void)
508{
509 return 0x1U;
510}
511static inline u32 ltc_ltc1_ltss_tstg_cmgmt1_r(void)
512{
513 return 0x001422a4U;
514}
515static inline u32 ltc_ltc1_ltss_tstg_cmgmt1_clean_v(u32 r)
516{
517 return (r >> 0U) & 0x1U;
518}
519static inline u32 ltc_ltc1_ltss_tstg_cmgmt1_clean_pending_v(void)
520{
521 return 0x00000001U;
522}
523static inline u32 ltc_ltc1_ltss_tstg_cmgmt1_clean_pending_f(void)
524{
525 return 0x1U;
526}
527#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_mc_gm20b.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_mc_gm20b.h
new file mode 100644
index 00000000..0264803f
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_mc_gm20b.h
@@ -0,0 +1,287 @@
1/*
2 * Copyright (c) 2014-2017, 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_mc_gm20b_h_
57#define _hw_mc_gm20b_h_
58
59static inline u32 mc_boot_0_r(void)
60{
61 return 0x00000000U;
62}
63static inline u32 mc_boot_0_architecture_v(u32 r)
64{
65 return (r >> 24U) & 0x1fU;
66}
67static inline u32 mc_boot_0_implementation_v(u32 r)
68{
69 return (r >> 20U) & 0xfU;
70}
71static inline u32 mc_boot_0_major_revision_v(u32 r)
72{
73 return (r >> 4U) & 0xfU;
74}
75static inline u32 mc_boot_0_minor_revision_v(u32 r)
76{
77 return (r >> 0U) & 0xfU;
78}
79static inline u32 mc_intr_r(u32 i)
80{
81 return 0x00000100U + i*4U;
82}
83static inline u32 mc_intr_pfifo_pending_f(void)
84{
85 return 0x100U;
86}
87static inline u32 mc_intr_pmu_pending_f(void)
88{
89 return 0x1000000U;
90}
91static inline u32 mc_intr_ltc_pending_f(void)
92{
93 return 0x2000000U;
94}
95static inline u32 mc_intr_priv_ring_pending_f(void)
96{
97 return 0x40000000U;
98}
99static inline u32 mc_intr_pbus_pending_f(void)
100{
101 return 0x10000000U;
102}
103static inline u32 mc_intr_mask_0_r(void)
104{
105 return 0x00000640U;
106}
107static inline u32 mc_intr_mask_0_pmu_enabled_f(void)
108{
109 return 0x1000000U;
110}
111static inline u32 mc_intr_en_0_r(void)
112{
113 return 0x00000140U;
114}
115static inline u32 mc_intr_en_0_inta_disabled_f(void)
116{
117 return 0x0U;
118}
119static inline u32 mc_intr_en_0_inta_hardware_f(void)
120{
121 return 0x1U;
122}
123static inline u32 mc_intr_mask_1_r(void)
124{
125 return 0x00000644U;
126}
127static inline u32 mc_intr_mask_1_pmu_s(void)
128{
129 return 1U;
130}
131static inline u32 mc_intr_mask_1_pmu_f(u32 v)
132{
133 return (v & 0x1U) << 24U;
134}
135static inline u32 mc_intr_mask_1_pmu_m(void)
136{
137 return 0x1U << 24U;
138}
139static inline u32 mc_intr_mask_1_pmu_v(u32 r)
140{
141 return (r >> 24U) & 0x1U;
142}
143static inline u32 mc_intr_mask_1_pmu_enabled_f(void)
144{
145 return 0x1000000U;
146}
147static inline u32 mc_intr_en_1_r(void)
148{
149 return 0x00000144U;
150}
151static inline u32 mc_intr_en_1_inta_disabled_f(void)
152{
153 return 0x0U;
154}
155static inline u32 mc_intr_en_1_inta_hardware_f(void)
156{
157 return 0x1U;
158}
159static inline u32 mc_enable_r(void)
160{
161 return 0x00000200U;
162}
163static inline u32 mc_enable_xbar_enabled_f(void)
164{
165 return 0x4U;
166}
167static inline u32 mc_enable_l2_enabled_f(void)
168{
169 return 0x8U;
170}
171static inline u32 mc_enable_pmedia_s(void)
172{
173 return 1U;
174}
175static inline u32 mc_enable_pmedia_f(u32 v)
176{
177 return (v & 0x1U) << 4U;
178}
179static inline u32 mc_enable_pmedia_m(void)
180{
181 return 0x1U << 4U;
182}
183static inline u32 mc_enable_pmedia_v(u32 r)
184{
185 return (r >> 4U) & 0x1U;
186}
187static inline u32 mc_enable_priv_ring_enabled_f(void)
188{
189 return 0x20U;
190}
191static inline u32 mc_enable_ce0_m(void)
192{
193 return 0x1U << 6U;
194}
195static inline u32 mc_enable_pfifo_enabled_f(void)
196{
197 return 0x100U;
198}
199static inline u32 mc_enable_pgraph_enabled_f(void)
200{
201 return 0x1000U;
202}
203static inline u32 mc_enable_pwr_v(u32 r)
204{
205 return (r >> 13U) & 0x1U;
206}
207static inline u32 mc_enable_pwr_disabled_v(void)
208{
209 return 0x00000000U;
210}
211static inline u32 mc_enable_pwr_enabled_f(void)
212{
213 return 0x2000U;
214}
215static inline u32 mc_enable_pfb_enabled_f(void)
216{
217 return 0x100000U;
218}
219static inline u32 mc_enable_ce2_m(void)
220{
221 return 0x1U << 21U;
222}
223static inline u32 mc_enable_ce2_enabled_f(void)
224{
225 return 0x200000U;
226}
227static inline u32 mc_enable_blg_enabled_f(void)
228{
229 return 0x8000000U;
230}
231static inline u32 mc_enable_perfmon_enabled_f(void)
232{
233 return 0x10000000U;
234}
235static inline u32 mc_enable_hub_enabled_f(void)
236{
237 return 0x20000000U;
238}
239static inline u32 mc_intr_ltc_r(void)
240{
241 return 0x0000017cU;
242}
243static inline u32 mc_enable_pb_r(void)
244{
245 return 0x00000204U;
246}
247static inline u32 mc_enable_pb_0_s(void)
248{
249 return 1U;
250}
251static inline u32 mc_enable_pb_0_f(u32 v)
252{
253 return (v & 0x1U) << 0U;
254}
255static inline u32 mc_enable_pb_0_m(void)
256{
257 return 0x1U << 0U;
258}
259static inline u32 mc_enable_pb_0_v(u32 r)
260{
261 return (r >> 0U) & 0x1U;
262}
263static inline u32 mc_enable_pb_0_enabled_v(void)
264{
265 return 0x00000001U;
266}
267static inline u32 mc_enable_pb_sel_f(u32 v, u32 i)
268{
269 return (v & 0x1U) << (0U + i*1U);
270}
271static inline u32 mc_elpg_enable_r(void)
272{
273 return 0x0000020cU;
274}
275static inline u32 mc_elpg_enable_xbar_enabled_f(void)
276{
277 return 0x4U;
278}
279static inline u32 mc_elpg_enable_pfb_enabled_f(void)
280{
281 return 0x100000U;
282}
283static inline u32 mc_elpg_enable_hub_enabled_f(void)
284{
285 return 0x20000000U;
286}
287#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_pbdma_gm20b.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_pbdma_gm20b.h
new file mode 100644
index 00000000..b8d7bbe4
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_pbdma_gm20b.h
@@ -0,0 +1,571 @@
1/*
2 * Copyright (c) 2014-2017, 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_pbdma_gm20b_h_
57#define _hw_pbdma_gm20b_h_
58
59static inline u32 pbdma_gp_entry1_r(void)
60{
61 return 0x10000004U;
62}
63static inline u32 pbdma_gp_entry1_get_hi_v(u32 r)
64{
65 return (r >> 0U) & 0xffU;
66}
67static inline u32 pbdma_gp_entry1_length_f(u32 v)
68{
69 return (v & 0x1fffffU) << 10U;
70}
71static inline u32 pbdma_gp_entry1_length_v(u32 r)
72{
73 return (r >> 10U) & 0x1fffffU;
74}
75static inline u32 pbdma_gp_base_r(u32 i)
76{
77 return 0x00040048U + i*8192U;
78}
79static inline u32 pbdma_gp_base__size_1_v(void)
80{
81 return 0x00000001U;
82}
83static inline u32 pbdma_gp_base_offset_f(u32 v)
84{
85 return (v & 0x1fffffffU) << 3U;
86}
87static inline u32 pbdma_gp_base_rsvd_s(void)
88{
89 return 3U;
90}
91static inline u32 pbdma_gp_base_hi_r(u32 i)
92{
93 return 0x0004004cU + i*8192U;
94}
95static inline u32 pbdma_gp_base_hi_offset_f(u32 v)
96{
97 return (v & 0xffU) << 0U;
98}
99static inline u32 pbdma_gp_base_hi_limit2_f(u32 v)
100{
101 return (v & 0x1fU) << 16U;
102}
103static inline u32 pbdma_gp_fetch_r(u32 i)
104{
105 return 0x00040050U + i*8192U;
106}
107static inline u32 pbdma_gp_get_r(u32 i)
108{
109 return 0x00040014U + i*8192U;
110}
111static inline u32 pbdma_gp_put_r(u32 i)
112{
113 return 0x00040000U + i*8192U;
114}
115static inline u32 pbdma_pb_fetch_r(u32 i)
116{
117 return 0x00040054U + i*8192U;
118}
119static inline u32 pbdma_pb_fetch_hi_r(u32 i)
120{
121 return 0x00040058U + i*8192U;
122}
123static inline u32 pbdma_get_r(u32 i)
124{
125 return 0x00040018U + i*8192U;
126}
127static inline u32 pbdma_get_hi_r(u32 i)
128{
129 return 0x0004001cU + i*8192U;
130}
131static inline u32 pbdma_put_r(u32 i)
132{
133 return 0x0004005cU + i*8192U;
134}
135static inline u32 pbdma_put_hi_r(u32 i)
136{
137 return 0x00040060U + i*8192U;
138}
139static inline u32 pbdma_formats_r(u32 i)
140{
141 return 0x0004009cU + i*8192U;
142}
143static inline u32 pbdma_formats_gp_fermi0_f(void)
144{
145 return 0x0U;
146}
147static inline u32 pbdma_formats_pb_fermi1_f(void)
148{
149 return 0x100U;
150}
151static inline u32 pbdma_formats_mp_fermi0_f(void)
152{
153 return 0x0U;
154}
155static inline u32 pbdma_pb_header_r(u32 i)
156{
157 return 0x00040084U + i*8192U;
158}
159static inline u32 pbdma_pb_header_priv_user_f(void)
160{
161 return 0x0U;
162}
163static inline u32 pbdma_pb_header_method_zero_f(void)
164{
165 return 0x0U;
166}
167static inline u32 pbdma_pb_header_subchannel_zero_f(void)
168{
169 return 0x0U;
170}
171static inline u32 pbdma_pb_header_level_main_f(void)
172{
173 return 0x0U;
174}
175static inline u32 pbdma_pb_header_first_true_f(void)
176{
177 return 0x400000U;
178}
179static inline u32 pbdma_pb_header_type_inc_f(void)
180{
181 return 0x20000000U;
182}
183static inline u32 pbdma_pb_header_type_non_inc_f(void)
184{
185 return 0x60000000U;
186}
187static inline u32 pbdma_hdr_shadow_r(u32 i)
188{
189 return 0x00040118U + i*8192U;
190}
191static inline u32 pbdma_gp_shadow_0_r(u32 i)
192{
193 return 0x00040110U + i*8192U;
194}
195static inline u32 pbdma_gp_shadow_1_r(u32 i)
196{
197 return 0x00040114U + i*8192U;
198}
199static inline u32 pbdma_subdevice_r(u32 i)
200{
201 return 0x00040094U + i*8192U;
202}
203static inline u32 pbdma_subdevice_id_f(u32 v)
204{
205 return (v & 0xfffU) << 0U;
206}
207static inline u32 pbdma_subdevice_status_active_f(void)
208{
209 return 0x10000000U;
210}
211static inline u32 pbdma_subdevice_channel_dma_enable_f(void)
212{
213 return 0x20000000U;
214}
215static inline u32 pbdma_method0_r(u32 i)
216{
217 return 0x000400c0U + i*8192U;
218}
219static inline u32 pbdma_method0_fifo_size_v(void)
220{
221 return 0x00000004U;
222}
223static inline u32 pbdma_method0_addr_f(u32 v)
224{
225 return (v & 0xfffU) << 2U;
226}
227static inline u32 pbdma_method0_addr_v(u32 r)
228{
229 return (r >> 2U) & 0xfffU;
230}
231static inline u32 pbdma_method0_subch_v(u32 r)
232{
233 return (r >> 16U) & 0x7U;
234}
235static inline u32 pbdma_method0_first_true_f(void)
236{
237 return 0x400000U;
238}
239static inline u32 pbdma_method0_valid_true_f(void)
240{
241 return 0x80000000U;
242}
243static inline u32 pbdma_method1_r(u32 i)
244{
245 return 0x000400c8U + i*8192U;
246}
247static inline u32 pbdma_method2_r(u32 i)
248{
249 return 0x000400d0U + i*8192U;
250}
251static inline u32 pbdma_method3_r(u32 i)
252{
253 return 0x000400d8U + i*8192U;
254}
255static inline u32 pbdma_data0_r(u32 i)
256{
257 return 0x000400c4U + i*8192U;
258}
259static inline u32 pbdma_target_r(u32 i)
260{
261 return 0x000400acU + i*8192U;
262}
263static inline u32 pbdma_target_engine_sw_f(void)
264{
265 return 0x1fU;
266}
267static inline u32 pbdma_acquire_r(u32 i)
268{
269 return 0x00040030U + i*8192U;
270}
271static inline u32 pbdma_acquire_retry_man_2_f(void)
272{
273 return 0x2U;
274}
275static inline u32 pbdma_acquire_retry_exp_2_f(void)
276{
277 return 0x100U;
278}
279static inline u32 pbdma_acquire_timeout_exp_f(u32 v)
280{
281 return (v & 0xfU) << 11U;
282}
283static inline u32 pbdma_acquire_timeout_exp_max_v(void)
284{
285 return 0x0000000fU;
286}
287static inline u32 pbdma_acquire_timeout_exp_max_f(void)
288{
289 return 0x7800U;
290}
291static inline u32 pbdma_acquire_timeout_man_f(u32 v)
292{
293 return (v & 0xffffU) << 15U;
294}
295static inline u32 pbdma_acquire_timeout_man_max_v(void)
296{
297 return 0x0000ffffU;
298}
299static inline u32 pbdma_acquire_timeout_man_max_f(void)
300{
301 return 0x7fff8000U;
302}
303static inline u32 pbdma_acquire_timeout_en_enable_f(void)
304{
305 return 0x80000000U;
306}
307static inline u32 pbdma_acquire_timeout_en_disable_f(void)
308{
309 return 0x0U;
310}
311static inline u32 pbdma_status_r(u32 i)
312{
313 return 0x00040100U + i*8192U;
314}
315static inline u32 pbdma_channel_r(u32 i)
316{
317 return 0x00040120U + i*8192U;
318}
319static inline u32 pbdma_signature_r(u32 i)
320{
321 return 0x00040010U + i*8192U;
322}
323static inline u32 pbdma_signature_hw_valid_f(void)
324{
325 return 0xfaceU;
326}
327static inline u32 pbdma_signature_sw_zero_f(void)
328{
329 return 0x0U;
330}
331static inline u32 pbdma_userd_r(u32 i)
332{
333 return 0x00040008U + i*8192U;
334}
335static inline u32 pbdma_userd_target_vid_mem_f(void)
336{
337 return 0x0U;
338}
339static inline u32 pbdma_userd_target_sys_mem_coh_f(void)
340{
341 return 0x2U;
342}
343static inline u32 pbdma_userd_target_sys_mem_ncoh_f(void)
344{
345 return 0x3U;
346}
347static inline u32 pbdma_userd_addr_f(u32 v)
348{
349 return (v & 0x7fffffU) << 9U;
350}
351static inline u32 pbdma_userd_hi_r(u32 i)
352{
353 return 0x0004000cU + i*8192U;
354}
355static inline u32 pbdma_userd_hi_addr_f(u32 v)
356{
357 return (v & 0xffU) << 0U;
358}
359static inline u32 pbdma_hce_ctrl_r(u32 i)
360{
361 return 0x000400e4U + i*8192U;
362}
363static inline u32 pbdma_hce_ctrl_hce_priv_mode_yes_f(void)
364{
365 return 0x20U;
366}
367static inline u32 pbdma_intr_0_r(u32 i)
368{
369 return 0x00040108U + i*8192U;
370}
371static inline u32 pbdma_intr_0_memreq_v(u32 r)
372{
373 return (r >> 0U) & 0x1U;
374}
375static inline u32 pbdma_intr_0_memreq_pending_f(void)
376{
377 return 0x1U;
378}
379static inline u32 pbdma_intr_0_memack_timeout_pending_f(void)
380{
381 return 0x2U;
382}
383static inline u32 pbdma_intr_0_memack_extra_pending_f(void)
384{
385 return 0x4U;
386}
387static inline u32 pbdma_intr_0_memdat_timeout_pending_f(void)
388{
389 return 0x8U;
390}
391static inline u32 pbdma_intr_0_memdat_extra_pending_f(void)
392{
393 return 0x10U;
394}
395static inline u32 pbdma_intr_0_memflush_pending_f(void)
396{
397 return 0x20U;
398}
399static inline u32 pbdma_intr_0_memop_pending_f(void)
400{
401 return 0x40U;
402}
403static inline u32 pbdma_intr_0_lbconnect_pending_f(void)
404{
405 return 0x80U;
406}
407static inline u32 pbdma_intr_0_lbreq_pending_f(void)
408{
409 return 0x100U;
410}
411static inline u32 pbdma_intr_0_lback_timeout_pending_f(void)
412{
413 return 0x200U;
414}
415static inline u32 pbdma_intr_0_lback_extra_pending_f(void)
416{
417 return 0x400U;
418}
419static inline u32 pbdma_intr_0_lbdat_timeout_pending_f(void)
420{
421 return 0x800U;
422}
423static inline u32 pbdma_intr_0_lbdat_extra_pending_f(void)
424{
425 return 0x1000U;
426}
427static inline u32 pbdma_intr_0_gpfifo_pending_f(void)
428{
429 return 0x2000U;
430}
431static inline u32 pbdma_intr_0_gpptr_pending_f(void)
432{
433 return 0x4000U;
434}
435static inline u32 pbdma_intr_0_gpentry_pending_f(void)
436{
437 return 0x8000U;
438}
439static inline u32 pbdma_intr_0_gpcrc_pending_f(void)
440{
441 return 0x10000U;
442}
443static inline u32 pbdma_intr_0_pbptr_pending_f(void)
444{
445 return 0x20000U;
446}
447static inline u32 pbdma_intr_0_pbentry_pending_f(void)
448{
449 return 0x40000U;
450}
451static inline u32 pbdma_intr_0_pbcrc_pending_f(void)
452{
453 return 0x80000U;
454}
455static inline u32 pbdma_intr_0_xbarconnect_pending_f(void)
456{
457 return 0x100000U;
458}
459static inline u32 pbdma_intr_0_method_pending_f(void)
460{
461 return 0x200000U;
462}
463static inline u32 pbdma_intr_0_methodcrc_pending_f(void)
464{
465 return 0x400000U;
466}
467static inline u32 pbdma_intr_0_device_pending_f(void)
468{
469 return 0x800000U;
470}
471static inline u32 pbdma_intr_0_semaphore_pending_f(void)
472{
473 return 0x2000000U;
474}
475static inline u32 pbdma_intr_0_acquire_pending_f(void)
476{
477 return 0x4000000U;
478}
479static inline u32 pbdma_intr_0_pri_pending_f(void)
480{
481 return 0x8000000U;
482}
483static inline u32 pbdma_intr_0_no_ctxsw_seg_pending_f(void)
484{
485 return 0x20000000U;
486}
487static inline u32 pbdma_intr_0_pbseg_pending_f(void)
488{
489 return 0x40000000U;
490}
491static inline u32 pbdma_intr_0_signature_pending_f(void)
492{
493 return 0x80000000U;
494}
495static inline u32 pbdma_intr_1_r(u32 i)
496{
497 return 0x00040148U + i*8192U;
498}
499static inline u32 pbdma_intr_en_0_r(u32 i)
500{
501 return 0x0004010cU + i*8192U;
502}
503static inline u32 pbdma_intr_en_0_lbreq_enabled_f(void)
504{
505 return 0x100U;
506}
507static inline u32 pbdma_intr_en_1_r(u32 i)
508{
509 return 0x0004014cU + i*8192U;
510}
511static inline u32 pbdma_intr_stall_r(u32 i)
512{
513 return 0x0004013cU + i*8192U;
514}
515static inline u32 pbdma_intr_stall_lbreq_enabled_f(void)
516{
517 return 0x100U;
518}
519static inline u32 pbdma_udma_nop_r(void)
520{
521 return 0x00000008U;
522}
523static inline u32 pbdma_syncpointa_r(u32 i)
524{
525 return 0x000400a4U + i*8192U;
526}
527static inline u32 pbdma_syncpointa_payload_v(u32 r)
528{
529 return (r >> 0U) & 0xffffffffU;
530}
531static inline u32 pbdma_syncpointb_r(u32 i)
532{
533 return 0x000400a8U + i*8192U;
534}
535static inline u32 pbdma_syncpointb_op_v(u32 r)
536{
537 return (r >> 0U) & 0x3U;
538}
539static inline u32 pbdma_syncpointb_op_wait_v(void)
540{
541 return 0x00000000U;
542}
543static inline u32 pbdma_syncpointb_wait_switch_v(u32 r)
544{
545 return (r >> 4U) & 0x1U;
546}
547static inline u32 pbdma_syncpointb_wait_switch_en_v(void)
548{
549 return 0x00000001U;
550}
551static inline u32 pbdma_syncpointb_syncpt_index_v(u32 r)
552{
553 return (r >> 8U) & 0xffU;
554}
555static inline u32 pbdma_runlist_timeslice_r(u32 i)
556{
557 return 0x000400f8U + i*8192U;
558}
559static inline u32 pbdma_runlist_timeslice_timeout_128_f(void)
560{
561 return 0x80U;
562}
563static inline u32 pbdma_runlist_timeslice_timescale_3_f(void)
564{
565 return 0x3000U;
566}
567static inline u32 pbdma_runlist_timeslice_enable_true_f(void)
568{
569 return 0x10000000U;
570}
571#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_perf_gm20b.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_perf_gm20b.h
new file mode 100644
index 00000000..ae34cabd
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_perf_gm20b.h
@@ -0,0 +1,211 @@
1/*
2 * Copyright (c) 2015-2017, 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_perf_gm20b_h_
57#define _hw_perf_gm20b_h_
58
59static inline u32 perf_pmasys_control_r(void)
60{
61 return 0x001b4000U;
62}
63static inline u32 perf_pmasys_control_membuf_status_v(u32 r)
64{
65 return (r >> 4U) & 0x1U;
66}
67static inline u32 perf_pmasys_control_membuf_status_overflowed_v(void)
68{
69 return 0x00000001U;
70}
71static inline u32 perf_pmasys_control_membuf_status_overflowed_f(void)
72{
73 return 0x10U;
74}
75static inline u32 perf_pmasys_control_membuf_clear_status_f(u32 v)
76{
77 return (v & 0x1U) << 5U;
78}
79static inline u32 perf_pmasys_control_membuf_clear_status_v(u32 r)
80{
81 return (r >> 5U) & 0x1U;
82}
83static inline u32 perf_pmasys_control_membuf_clear_status_doit_v(void)
84{
85 return 0x00000001U;
86}
87static inline u32 perf_pmasys_control_membuf_clear_status_doit_f(void)
88{
89 return 0x20U;
90}
91static inline u32 perf_pmasys_mem_block_r(void)
92{
93 return 0x001b4070U;
94}
95static inline u32 perf_pmasys_mem_block_base_f(u32 v)
96{
97 return (v & 0xfffffffU) << 0U;
98}
99static inline u32 perf_pmasys_mem_block_target_f(u32 v)
100{
101 return (v & 0x3U) << 28U;
102}
103static inline u32 perf_pmasys_mem_block_target_v(u32 r)
104{
105 return (r >> 28U) & 0x3U;
106}
107static inline u32 perf_pmasys_mem_block_target_lfb_v(void)
108{
109 return 0x00000000U;
110}
111static inline u32 perf_pmasys_mem_block_target_lfb_f(void)
112{
113 return 0x0U;
114}
115static inline u32 perf_pmasys_mem_block_target_sys_coh_v(void)
116{
117 return 0x00000002U;
118}
119static inline u32 perf_pmasys_mem_block_target_sys_coh_f(void)
120{
121 return 0x20000000U;
122}
123static inline u32 perf_pmasys_mem_block_target_sys_ncoh_v(void)
124{
125 return 0x00000003U;
126}
127static inline u32 perf_pmasys_mem_block_target_sys_ncoh_f(void)
128{
129 return 0x30000000U;
130}
131static inline u32 perf_pmasys_mem_block_valid_f(u32 v)
132{
133 return (v & 0x1U) << 31U;
134}
135static inline u32 perf_pmasys_mem_block_valid_v(u32 r)
136{
137 return (r >> 31U) & 0x1U;
138}
139static inline u32 perf_pmasys_mem_block_valid_true_v(void)
140{
141 return 0x00000001U;
142}
143static inline u32 perf_pmasys_mem_block_valid_true_f(void)
144{
145 return 0x80000000U;
146}
147static inline u32 perf_pmasys_mem_block_valid_false_v(void)
148{
149 return 0x00000000U;
150}
151static inline u32 perf_pmasys_mem_block_valid_false_f(void)
152{
153 return 0x0U;
154}
155static inline u32 perf_pmasys_outbase_r(void)
156{
157 return 0x001b4074U;
158}
159static inline u32 perf_pmasys_outbase_ptr_f(u32 v)
160{
161 return (v & 0x7ffffffU) << 5U;
162}
163static inline u32 perf_pmasys_outbaseupper_r(void)
164{
165 return 0x001b4078U;
166}
167static inline u32 perf_pmasys_outbaseupper_ptr_f(u32 v)
168{
169 return (v & 0xffU) << 0U;
170}
171static inline u32 perf_pmasys_outsize_r(void)
172{
173 return 0x001b407cU;
174}
175static inline u32 perf_pmasys_outsize_numbytes_f(u32 v)
176{
177 return (v & 0x7ffffffU) << 5U;
178}
179static inline u32 perf_pmasys_mem_bytes_r(void)
180{
181 return 0x001b4084U;
182}
183static inline u32 perf_pmasys_mem_bytes_numbytes_f(u32 v)
184{
185 return (v & 0xfffffffU) << 4U;
186}
187static inline u32 perf_pmasys_mem_bump_r(void)
188{
189 return 0x001b4088U;
190}
191static inline u32 perf_pmasys_mem_bump_numbytes_f(u32 v)
192{
193 return (v & 0xfffffffU) << 4U;
194}
195static inline u32 perf_pmasys_enginestatus_r(void)
196{
197 return 0x001b40a4U;
198}
199static inline u32 perf_pmasys_enginestatus_rbufempty_f(u32 v)
200{
201 return (v & 0x1U) << 4U;
202}
203static inline u32 perf_pmasys_enginestatus_rbufempty_empty_v(void)
204{
205 return 0x00000001U;
206}
207static inline u32 perf_pmasys_enginestatus_rbufempty_empty_f(void)
208{
209 return 0x10U;
210}
211#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_pram_gm20b.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_pram_gm20b.h
new file mode 100644
index 00000000..47a6bfa8
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_pram_gm20b.h
@@ -0,0 +1,63 @@
1/*
2 * Copyright (c) 2016-2017, 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_pram_gm20b_h_
57#define _hw_pram_gm20b_h_
58
59static inline u32 pram_data032_r(u32 i)
60{
61 return 0x00700000U + i*4U;
62}
63#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_pri_ringmaster_gm20b.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_pri_ringmaster_gm20b.h
new file mode 100644
index 00000000..c6f08ed3
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_pri_ringmaster_gm20b.h
@@ -0,0 +1,167 @@
1/*
2 * Copyright (c) 2014-2017, 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_pri_ringmaster_gm20b_h_
57#define _hw_pri_ringmaster_gm20b_h_
58
59static inline u32 pri_ringmaster_command_r(void)
60{
61 return 0x0012004cU;
62}
63static inline u32 pri_ringmaster_command_cmd_m(void)
64{
65 return 0x3fU << 0U;
66}
67static inline u32 pri_ringmaster_command_cmd_v(u32 r)
68{
69 return (r >> 0U) & 0x3fU;
70}
71static inline u32 pri_ringmaster_command_cmd_no_cmd_v(void)
72{
73 return 0x00000000U;
74}
75static inline u32 pri_ringmaster_command_cmd_start_ring_f(void)
76{
77 return 0x1U;
78}
79static inline u32 pri_ringmaster_command_cmd_ack_interrupt_f(void)
80{
81 return 0x2U;
82}
83static inline u32 pri_ringmaster_command_cmd_enumerate_stations_f(void)
84{
85 return 0x3U;
86}
87static inline u32 pri_ringmaster_command_cmd_enumerate_stations_bc_grp_all_f(void)
88{
89 return 0x0U;
90}
91static inline u32 pri_ringmaster_command_data_r(void)
92{
93 return 0x00120048U;
94}
95static inline u32 pri_ringmaster_start_results_r(void)
96{
97 return 0x00120050U;
98}
99static inline u32 pri_ringmaster_start_results_connectivity_v(u32 r)
100{
101 return (r >> 0U) & 0x1U;
102}
103static inline u32 pri_ringmaster_start_results_connectivity_pass_v(void)
104{
105 return 0x00000001U;
106}
107static inline u32 pri_ringmaster_intr_status0_r(void)
108{
109 return 0x00120058U;
110}
111static inline u32 pri_ringmaster_intr_status0_ring_start_conn_fault_v(u32 r)
112{
113 return (r >> 0U) & 0x1U;
114}
115static inline u32 pri_ringmaster_intr_status0_disconnect_fault_v(u32 r)
116{
117 return (r >> 1U) & 0x1U;
118}
119static inline u32 pri_ringmaster_intr_status0_overflow_fault_v(u32 r)
120{
121 return (r >> 2U) & 0x1U;
122}
123static inline u32 pri_ringmaster_intr_status0_gbl_write_error_sys_v(u32 r)
124{
125 return (r >> 8U) & 0x1U;
126}
127static inline u32 pri_ringmaster_intr_status1_r(void)
128{
129 return 0x0012005cU;
130}
131static inline u32 pri_ringmaster_global_ctl_r(void)
132{
133 return 0x00120060U;
134}
135static inline u32 pri_ringmaster_global_ctl_ring_reset_asserted_f(void)
136{
137 return 0x1U;
138}
139static inline u32 pri_ringmaster_global_ctl_ring_reset_deasserted_f(void)
140{
141 return 0x0U;
142}
143static inline u32 pri_ringmaster_enum_fbp_r(void)
144{
145 return 0x00120074U;
146}
147static inline u32 pri_ringmaster_enum_fbp_count_v(u32 r)
148{
149 return (r >> 0U) & 0x1fU;
150}
151static inline u32 pri_ringmaster_enum_gpc_r(void)
152{
153 return 0x00120078U;
154}
155static inline u32 pri_ringmaster_enum_gpc_count_v(u32 r)
156{
157 return (r >> 0U) & 0x1fU;
158}
159static inline u32 pri_ringmaster_enum_ltc_r(void)
160{
161 return 0x0012006cU;
162}
163static inline u32 pri_ringmaster_enum_ltc_count_v(u32 r)
164{
165 return (r >> 0U) & 0x1fU;
166}
167#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_pri_ringstation_gpc_gm20b.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_pri_ringstation_gpc_gm20b.h
new file mode 100644
index 00000000..8d1ffb2b
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_pri_ringstation_gpc_gm20b.h
@@ -0,0 +1,79 @@
1/*
2 * Copyright (c) 2017, 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_pri_ringstation_gpc_gm20b_h_
57#define _hw_pri_ringstation_gpc_gm20b_h_
58
59static inline u32 pri_ringstation_gpc_master_config_r(u32 i)
60{
61 return 0x00128300U + i*4U;
62}
63static inline u32 pri_ringstation_gpc_gpc0_priv_error_adr_r(void)
64{
65 return 0x00128120U;
66}
67static inline u32 pri_ringstation_gpc_gpc0_priv_error_wrdat_r(void)
68{
69 return 0x00128124U;
70}
71static inline u32 pri_ringstation_gpc_gpc0_priv_error_info_r(void)
72{
73 return 0x00128128U;
74}
75static inline u32 pri_ringstation_gpc_gpc0_priv_error_code_r(void)
76{
77 return 0x0012812cU;
78}
79#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_pri_ringstation_sys_gm20b.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_pri_ringstation_sys_gm20b.h
new file mode 100644
index 00000000..ac1d2456
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_pri_ringstation_sys_gm20b.h
@@ -0,0 +1,91 @@
1/*
2 * Copyright (c) 2014-2017, 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_pri_ringstation_sys_gm20b_h_
57#define _hw_pri_ringstation_sys_gm20b_h_
58
59static inline u32 pri_ringstation_sys_master_config_r(u32 i)
60{
61 return 0x00122300U + i*4U;
62}
63static inline u32 pri_ringstation_sys_decode_config_r(void)
64{
65 return 0x00122204U;
66}
67static inline u32 pri_ringstation_sys_decode_config_ring_m(void)
68{
69 return 0x7U << 0U;
70}
71static inline u32 pri_ringstation_sys_decode_config_ring_drop_on_ring_not_started_f(void)
72{
73 return 0x1U;
74}
75static inline u32 pri_ringstation_sys_priv_error_adr_r(void)
76{
77 return 0x00122120U;
78}
79static inline u32 pri_ringstation_sys_priv_error_wrdat_r(void)
80{
81 return 0x00122124U;
82}
83static inline u32 pri_ringstation_sys_priv_error_info_r(void)
84{
85 return 0x00122128U;
86}
87static inline u32 pri_ringstation_sys_priv_error_code_r(void)
88{
89 return 0x0012212cU;
90}
91#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_proj_gm20b.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_proj_gm20b.h
new file mode 100644
index 00000000..d44cc463
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_proj_gm20b.h
@@ -0,0 +1,167 @@
1/*
2 * Copyright (c) 2014-2017, 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_proj_gm20b_h_
57#define _hw_proj_gm20b_h_
58
59static inline u32 proj_gpc_base_v(void)
60{
61 return 0x00500000U;
62}
63static inline u32 proj_gpc_shared_base_v(void)
64{
65 return 0x00418000U;
66}
67static inline u32 proj_gpc_stride_v(void)
68{
69 return 0x00008000U;
70}
71static inline u32 proj_ltc_stride_v(void)
72{
73 return 0x00002000U;
74}
75static inline u32 proj_lts_stride_v(void)
76{
77 return 0x00000200U;
78}
79static inline u32 proj_fbpa_stride_v(void)
80{
81 return 0x00001000U;
82}
83static inline u32 proj_ppc_in_gpc_base_v(void)
84{
85 return 0x00003000U;
86}
87static inline u32 proj_ppc_in_gpc_shared_base_v(void)
88{
89 return 0x00003e00U;
90}
91static inline u32 proj_ppc_in_gpc_stride_v(void)
92{
93 return 0x00000200U;
94}
95static inline u32 proj_rop_base_v(void)
96{
97 return 0x00410000U;
98}
99static inline u32 proj_rop_shared_base_v(void)
100{
101 return 0x00408800U;
102}
103static inline u32 proj_rop_stride_v(void)
104{
105 return 0x00000400U;
106}
107static inline u32 proj_tpc_in_gpc_base_v(void)
108{
109 return 0x00004000U;
110}
111static inline u32 proj_tpc_in_gpc_stride_v(void)
112{
113 return 0x00000800U;
114}
115static inline u32 proj_tpc_in_gpc_shared_base_v(void)
116{
117 return 0x00001800U;
118}
119static inline u32 proj_host_num_engines_v(void)
120{
121 return 0x00000002U;
122}
123static inline u32 proj_host_num_pbdma_v(void)
124{
125 return 0x00000001U;
126}
127static inline u32 proj_scal_litter_num_tpc_per_gpc_v(void)
128{
129 return 0x00000002U;
130}
131static inline u32 proj_scal_litter_num_sm_per_tpc_v(void)
132{
133 return 0x00000001U;
134}
135static inline u32 proj_scal_litter_num_fbps_v(void)
136{
137 return 0x00000001U;
138}
139static inline u32 proj_scal_litter_num_fbpas_v(void)
140{
141 return 0x00000001U;
142}
143static inline u32 proj_scal_litter_num_gpcs_v(void)
144{
145 return 0x00000001U;
146}
147static inline u32 proj_scal_litter_num_pes_per_gpc_v(void)
148{
149 return 0x00000001U;
150}
151static inline u32 proj_scal_litter_num_tpcs_per_pes_v(void)
152{
153 return 0x00000002U;
154}
155static inline u32 proj_scal_litter_num_zcull_banks_v(void)
156{
157 return 0x00000004U;
158}
159static inline u32 proj_scal_max_gpcs_v(void)
160{
161 return 0x00000020U;
162}
163static inline u32 proj_scal_max_tpc_per_gpc_v(void)
164{
165 return 0x00000008U;
166}
167#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_pwr_gm20b.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_pwr_gm20b.h
new file mode 100644
index 00000000..fa232644
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_pwr_gm20b.h
@@ -0,0 +1,827 @@
1/*
2 * Copyright (c) 2014-2017, 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_pwr_gm20b_h_
57#define _hw_pwr_gm20b_h_
58
59static inline u32 pwr_falcon_irqsset_r(void)
60{
61 return 0x0010a000U;
62}
63static inline u32 pwr_falcon_irqsset_swgen0_set_f(void)
64{
65 return 0x40U;
66}
67static inline u32 pwr_falcon_irqsclr_r(void)
68{
69 return 0x0010a004U;
70}
71static inline u32 pwr_falcon_irqstat_r(void)
72{
73 return 0x0010a008U;
74}
75static inline u32 pwr_falcon_irqstat_halt_true_f(void)
76{
77 return 0x10U;
78}
79static inline u32 pwr_falcon_irqstat_exterr_true_f(void)
80{
81 return 0x20U;
82}
83static inline u32 pwr_falcon_irqstat_swgen0_true_f(void)
84{
85 return 0x40U;
86}
87static inline u32 pwr_falcon_irqmode_r(void)
88{
89 return 0x0010a00cU;
90}
91static inline u32 pwr_falcon_irqmset_r(void)
92{
93 return 0x0010a010U;
94}
95static inline u32 pwr_falcon_irqmset_gptmr_f(u32 v)
96{
97 return (v & 0x1U) << 0U;
98}
99static inline u32 pwr_falcon_irqmset_wdtmr_f(u32 v)
100{
101 return (v & 0x1U) << 1U;
102}
103static inline u32 pwr_falcon_irqmset_mthd_f(u32 v)
104{
105 return (v & 0x1U) << 2U;
106}
107static inline u32 pwr_falcon_irqmset_ctxsw_f(u32 v)
108{
109 return (v & 0x1U) << 3U;
110}
111static inline u32 pwr_falcon_irqmset_halt_f(u32 v)
112{
113 return (v & 0x1U) << 4U;
114}
115static inline u32 pwr_falcon_irqmset_exterr_f(u32 v)
116{
117 return (v & 0x1U) << 5U;
118}
119static inline u32 pwr_falcon_irqmset_swgen0_f(u32 v)
120{
121 return (v & 0x1U) << 6U;
122}
123static inline u32 pwr_falcon_irqmset_swgen1_f(u32 v)
124{
125 return (v & 0x1U) << 7U;
126}
127static inline u32 pwr_falcon_irqmclr_r(void)
128{
129 return 0x0010a014U;
130}
131static inline u32 pwr_falcon_irqmclr_gptmr_f(u32 v)
132{
133 return (v & 0x1U) << 0U;
134}
135static inline u32 pwr_falcon_irqmclr_wdtmr_f(u32 v)
136{
137 return (v & 0x1U) << 1U;
138}
139static inline u32 pwr_falcon_irqmclr_mthd_f(u32 v)
140{
141 return (v & 0x1U) << 2U;
142}
143static inline u32 pwr_falcon_irqmclr_ctxsw_f(u32 v)
144{
145 return (v & 0x1U) << 3U;
146}
147static inline u32 pwr_falcon_irqmclr_halt_f(u32 v)
148{
149 return (v & 0x1U) << 4U;
150}
151static inline u32 pwr_falcon_irqmclr_exterr_f(u32 v)
152{
153 return (v & 0x1U) << 5U;
154}
155static inline u32 pwr_falcon_irqmclr_swgen0_f(u32 v)
156{
157 return (v & 0x1U) << 6U;
158}
159static inline u32 pwr_falcon_irqmclr_swgen1_f(u32 v)
160{
161 return (v & 0x1U) << 7U;
162}
163static inline u32 pwr_falcon_irqmclr_ext_f(u32 v)
164{
165 return (v & 0xffU) << 8U;
166}
167static inline u32 pwr_falcon_irqmask_r(void)
168{
169 return 0x0010a018U;
170}
171static inline u32 pwr_falcon_irqdest_r(void)
172{
173 return 0x0010a01cU;
174}
175static inline u32 pwr_falcon_irqdest_host_gptmr_f(u32 v)
176{
177 return (v & 0x1U) << 0U;
178}
179static inline u32 pwr_falcon_irqdest_host_wdtmr_f(u32 v)
180{
181 return (v & 0x1U) << 1U;
182}
183static inline u32 pwr_falcon_irqdest_host_mthd_f(u32 v)
184{
185 return (v & 0x1U) << 2U;
186}
187static inline u32 pwr_falcon_irqdest_host_ctxsw_f(u32 v)
188{
189 return (v & 0x1U) << 3U;
190}
191static inline u32 pwr_falcon_irqdest_host_halt_f(u32 v)
192{
193 return (v & 0x1U) << 4U;
194}
195static inline u32 pwr_falcon_irqdest_host_exterr_f(u32 v)
196{
197 return (v & 0x1U) << 5U;
198}
199static inline u32 pwr_falcon_irqdest_host_swgen0_f(u32 v)
200{
201 return (v & 0x1U) << 6U;
202}
203static inline u32 pwr_falcon_irqdest_host_swgen1_f(u32 v)
204{
205 return (v & 0x1U) << 7U;
206}
207static inline u32 pwr_falcon_irqdest_host_ext_f(u32 v)
208{
209 return (v & 0xffU) << 8U;
210}
211static inline u32 pwr_falcon_irqdest_target_gptmr_f(u32 v)
212{
213 return (v & 0x1U) << 16U;
214}
215static inline u32 pwr_falcon_irqdest_target_wdtmr_f(u32 v)
216{
217 return (v & 0x1U) << 17U;
218}
219static inline u32 pwr_falcon_irqdest_target_mthd_f(u32 v)
220{
221 return (v & 0x1U) << 18U;
222}
223static inline u32 pwr_falcon_irqdest_target_ctxsw_f(u32 v)
224{
225 return (v & 0x1U) << 19U;
226}
227static inline u32 pwr_falcon_irqdest_target_halt_f(u32 v)
228{
229 return (v & 0x1U) << 20U;
230}
231static inline u32 pwr_falcon_irqdest_target_exterr_f(u32 v)
232{
233 return (v & 0x1U) << 21U;
234}
235static inline u32 pwr_falcon_irqdest_target_swgen0_f(u32 v)
236{
237 return (v & 0x1U) << 22U;
238}
239static inline u32 pwr_falcon_irqdest_target_swgen1_f(u32 v)
240{
241 return (v & 0x1U) << 23U;
242}
243static inline u32 pwr_falcon_irqdest_target_ext_f(u32 v)
244{
245 return (v & 0xffU) << 24U;
246}
247static inline u32 pwr_falcon_curctx_r(void)
248{
249 return 0x0010a050U;
250}
251static inline u32 pwr_falcon_nxtctx_r(void)
252{
253 return 0x0010a054U;
254}
255static inline u32 pwr_falcon_mailbox0_r(void)
256{
257 return 0x0010a040U;
258}
259static inline u32 pwr_falcon_mailbox1_r(void)
260{
261 return 0x0010a044U;
262}
263static inline u32 pwr_falcon_itfen_r(void)
264{
265 return 0x0010a048U;
266}
267static inline u32 pwr_falcon_itfen_ctxen_enable_f(void)
268{
269 return 0x1U;
270}
271static inline u32 pwr_falcon_idlestate_r(void)
272{
273 return 0x0010a04cU;
274}
275static inline u32 pwr_falcon_idlestate_falcon_busy_v(u32 r)
276{
277 return (r >> 0U) & 0x1U;
278}
279static inline u32 pwr_falcon_idlestate_ext_busy_v(u32 r)
280{
281 return (r >> 1U) & 0x7fffU;
282}
283static inline u32 pwr_falcon_os_r(void)
284{
285 return 0x0010a080U;
286}
287static inline u32 pwr_falcon_engctl_r(void)
288{
289 return 0x0010a0a4U;
290}
291static inline u32 pwr_falcon_cpuctl_r(void)
292{
293 return 0x0010a100U;
294}
295static inline u32 pwr_falcon_cpuctl_startcpu_f(u32 v)
296{
297 return (v & 0x1U) << 1U;
298}
299static inline u32 pwr_falcon_cpuctl_halt_intr_f(u32 v)
300{
301 return (v & 0x1U) << 4U;
302}
303static inline u32 pwr_falcon_cpuctl_halt_intr_m(void)
304{
305 return 0x1U << 4U;
306}
307static inline u32 pwr_falcon_cpuctl_halt_intr_v(u32 r)
308{
309 return (r >> 4U) & 0x1U;
310}
311static inline u32 pwr_falcon_cpuctl_cpuctl_alias_en_f(u32 v)
312{
313 return (v & 0x1U) << 6U;
314}
315static inline u32 pwr_falcon_cpuctl_cpuctl_alias_en_m(void)
316{
317 return 0x1U << 6U;
318}
319static inline u32 pwr_falcon_cpuctl_cpuctl_alias_en_v(u32 r)
320{
321 return (r >> 6U) & 0x1U;
322}
323static inline u32 pwr_falcon_cpuctl_alias_r(void)
324{
325 return 0x0010a130U;
326}
327static inline u32 pwr_falcon_cpuctl_alias_startcpu_f(u32 v)
328{
329 return (v & 0x1U) << 1U;
330}
331static inline u32 pwr_pmu_scpctl_stat_r(void)
332{
333 return 0x0010ac08U;
334}
335static inline u32 pwr_pmu_scpctl_stat_debug_mode_f(u32 v)
336{
337 return (v & 0x1U) << 20U;
338}
339static inline u32 pwr_pmu_scpctl_stat_debug_mode_m(void)
340{
341 return 0x1U << 20U;
342}
343static inline u32 pwr_pmu_scpctl_stat_debug_mode_v(u32 r)
344{
345 return (r >> 20U) & 0x1U;
346}
347static inline u32 pwr_falcon_imemc_r(u32 i)
348{
349 return 0x0010a180U + i*16U;
350}
351static inline u32 pwr_falcon_imemc_offs_f(u32 v)
352{
353 return (v & 0x3fU) << 2U;
354}
355static inline u32 pwr_falcon_imemc_blk_f(u32 v)
356{
357 return (v & 0xffU) << 8U;
358}
359static inline u32 pwr_falcon_imemc_aincw_f(u32 v)
360{
361 return (v & 0x1U) << 24U;
362}
363static inline u32 pwr_falcon_imemd_r(u32 i)
364{
365 return 0x0010a184U + i*16U;
366}
367static inline u32 pwr_falcon_imemt_r(u32 i)
368{
369 return 0x0010a188U + i*16U;
370}
371static inline u32 pwr_falcon_sctl_r(void)
372{
373 return 0x0010a240U;
374}
375static inline u32 pwr_falcon_mmu_phys_sec_r(void)
376{
377 return 0x00100ce4U;
378}
379static inline u32 pwr_falcon_bootvec_r(void)
380{
381 return 0x0010a104U;
382}
383static inline u32 pwr_falcon_bootvec_vec_f(u32 v)
384{
385 return (v & 0xffffffffU) << 0U;
386}
387static inline u32 pwr_falcon_dmactl_r(void)
388{
389 return 0x0010a10cU;
390}
391static inline u32 pwr_falcon_dmactl_dmem_scrubbing_m(void)
392{
393 return 0x1U << 1U;
394}
395static inline u32 pwr_falcon_dmactl_imem_scrubbing_m(void)
396{
397 return 0x1U << 2U;
398}
399static inline u32 pwr_falcon_hwcfg_r(void)
400{
401 return 0x0010a108U;
402}
403static inline u32 pwr_falcon_hwcfg_imem_size_v(u32 r)
404{
405 return (r >> 0U) & 0x1ffU;
406}
407static inline u32 pwr_falcon_hwcfg_dmem_size_v(u32 r)
408{
409 return (r >> 9U) & 0x1ffU;
410}
411static inline u32 pwr_falcon_dmatrfbase_r(void)
412{
413 return 0x0010a110U;
414}
415static inline u32 pwr_falcon_dmatrfmoffs_r(void)
416{
417 return 0x0010a114U;
418}
419static inline u32 pwr_falcon_dmatrfcmd_r(void)
420{
421 return 0x0010a118U;
422}
423static inline u32 pwr_falcon_dmatrfcmd_imem_f(u32 v)
424{
425 return (v & 0x1U) << 4U;
426}
427static inline u32 pwr_falcon_dmatrfcmd_write_f(u32 v)
428{
429 return (v & 0x1U) << 5U;
430}
431static inline u32 pwr_falcon_dmatrfcmd_size_f(u32 v)
432{
433 return (v & 0x7U) << 8U;
434}
435static inline u32 pwr_falcon_dmatrfcmd_ctxdma_f(u32 v)
436{
437 return (v & 0x7U) << 12U;
438}
439static inline u32 pwr_falcon_dmatrffboffs_r(void)
440{
441 return 0x0010a11cU;
442}
443static inline u32 pwr_falcon_exterraddr_r(void)
444{
445 return 0x0010a168U;
446}
447static inline u32 pwr_falcon_exterrstat_r(void)
448{
449 return 0x0010a16cU;
450}
451static inline u32 pwr_falcon_exterrstat_valid_m(void)
452{
453 return 0x1U << 31U;
454}
455static inline u32 pwr_falcon_exterrstat_valid_v(u32 r)
456{
457 return (r >> 31U) & 0x1U;
458}
459static inline u32 pwr_falcon_exterrstat_valid_true_v(void)
460{
461 return 0x00000001U;
462}
463static inline u32 pwr_pmu_falcon_icd_cmd_r(void)
464{
465 return 0x0010a200U;
466}
467static inline u32 pwr_pmu_falcon_icd_cmd_opc_s(void)
468{
469 return 4U;
470}
471static inline u32 pwr_pmu_falcon_icd_cmd_opc_f(u32 v)
472{
473 return (v & 0xfU) << 0U;
474}
475static inline u32 pwr_pmu_falcon_icd_cmd_opc_m(void)
476{
477 return 0xfU << 0U;
478}
479static inline u32 pwr_pmu_falcon_icd_cmd_opc_v(u32 r)
480{
481 return (r >> 0U) & 0xfU;
482}
483static inline u32 pwr_pmu_falcon_icd_cmd_opc_rreg_f(void)
484{
485 return 0x8U;
486}
487static inline u32 pwr_pmu_falcon_icd_cmd_opc_rstat_f(void)
488{
489 return 0xeU;
490}
491static inline u32 pwr_pmu_falcon_icd_cmd_idx_f(u32 v)
492{
493 return (v & 0x1fU) << 8U;
494}
495static inline u32 pwr_pmu_falcon_icd_rdata_r(void)
496{
497 return 0x0010a20cU;
498}
499static inline u32 pwr_falcon_dmemc_r(u32 i)
500{
501 return 0x0010a1c0U + i*8U;
502}
503static inline u32 pwr_falcon_dmemc_offs_f(u32 v)
504{
505 return (v & 0x3fU) << 2U;
506}
507static inline u32 pwr_falcon_dmemc_offs_m(void)
508{
509 return 0x3fU << 2U;
510}
511static inline u32 pwr_falcon_dmemc_blk_f(u32 v)
512{
513 return (v & 0xffU) << 8U;
514}
515static inline u32 pwr_falcon_dmemc_blk_m(void)
516{
517 return 0xffU << 8U;
518}
519static inline u32 pwr_falcon_dmemc_aincw_f(u32 v)
520{
521 return (v & 0x1U) << 24U;
522}
523static inline u32 pwr_falcon_dmemc_aincr_f(u32 v)
524{
525 return (v & 0x1U) << 25U;
526}
527static inline u32 pwr_falcon_dmemd_r(u32 i)
528{
529 return 0x0010a1c4U + i*8U;
530}
531static inline u32 pwr_pmu_new_instblk_r(void)
532{
533 return 0x0010a480U;
534}
535static inline u32 pwr_pmu_new_instblk_ptr_f(u32 v)
536{
537 return (v & 0xfffffffU) << 0U;
538}
539static inline u32 pwr_pmu_new_instblk_target_fb_f(void)
540{
541 return 0x0U;
542}
543static inline u32 pwr_pmu_new_instblk_target_sys_coh_f(void)
544{
545 return 0x20000000U;
546}
547static inline u32 pwr_pmu_new_instblk_target_sys_ncoh_f(void)
548{
549 return 0x30000000U;
550}
551static inline u32 pwr_pmu_new_instblk_valid_f(u32 v)
552{
553 return (v & 0x1U) << 30U;
554}
555static inline u32 pwr_pmu_mutex_id_r(void)
556{
557 return 0x0010a488U;
558}
559static inline u32 pwr_pmu_mutex_id_value_v(u32 r)
560{
561 return (r >> 0U) & 0xffU;
562}
563static inline u32 pwr_pmu_mutex_id_value_init_v(void)
564{
565 return 0x00000000U;
566}
567static inline u32 pwr_pmu_mutex_id_value_not_avail_v(void)
568{
569 return 0x000000ffU;
570}
571static inline u32 pwr_pmu_mutex_id_release_r(void)
572{
573 return 0x0010a48cU;
574}
575static inline u32 pwr_pmu_mutex_id_release_value_f(u32 v)
576{
577 return (v & 0xffU) << 0U;
578}
579static inline u32 pwr_pmu_mutex_id_release_value_m(void)
580{
581 return 0xffU << 0U;
582}
583static inline u32 pwr_pmu_mutex_id_release_value_init_v(void)
584{
585 return 0x00000000U;
586}
587static inline u32 pwr_pmu_mutex_id_release_value_init_f(void)
588{
589 return 0x0U;
590}
591static inline u32 pwr_pmu_mutex_r(u32 i)
592{
593 return 0x0010a580U + i*4U;
594}
595static inline u32 pwr_pmu_mutex__size_1_v(void)
596{
597 return 0x00000010U;
598}
599static inline u32 pwr_pmu_mutex_value_f(u32 v)
600{
601 return (v & 0xffU) << 0U;
602}
603static inline u32 pwr_pmu_mutex_value_v(u32 r)
604{
605 return (r >> 0U) & 0xffU;
606}
607static inline u32 pwr_pmu_mutex_value_initial_lock_f(void)
608{
609 return 0x0U;
610}
611static inline u32 pwr_pmu_queue_head_r(u32 i)
612{
613 return 0x0010a4a0U + i*4U;
614}
615static inline u32 pwr_pmu_queue_head__size_1_v(void)
616{
617 return 0x00000004U;
618}
619static inline u32 pwr_pmu_queue_head_address_f(u32 v)
620{
621 return (v & 0xffffffffU) << 0U;
622}
623static inline u32 pwr_pmu_queue_head_address_v(u32 r)
624{
625 return (r >> 0U) & 0xffffffffU;
626}
627static inline u32 pwr_pmu_queue_tail_r(u32 i)
628{
629 return 0x0010a4b0U + i*4U;
630}
631static inline u32 pwr_pmu_queue_tail__size_1_v(void)
632{
633 return 0x00000004U;
634}
635static inline u32 pwr_pmu_queue_tail_address_f(u32 v)
636{
637 return (v & 0xffffffffU) << 0U;
638}
639static inline u32 pwr_pmu_queue_tail_address_v(u32 r)
640{
641 return (r >> 0U) & 0xffffffffU;
642}
643static inline u32 pwr_pmu_msgq_head_r(void)
644{
645 return 0x0010a4c8U;
646}
647static inline u32 pwr_pmu_msgq_head_val_f(u32 v)
648{
649 return (v & 0xffffffffU) << 0U;
650}
651static inline u32 pwr_pmu_msgq_head_val_v(u32 r)
652{
653 return (r >> 0U) & 0xffffffffU;
654}
655static inline u32 pwr_pmu_msgq_tail_r(void)
656{
657 return 0x0010a4ccU;
658}
659static inline u32 pwr_pmu_msgq_tail_val_f(u32 v)
660{
661 return (v & 0xffffffffU) << 0U;
662}
663static inline u32 pwr_pmu_msgq_tail_val_v(u32 r)
664{
665 return (r >> 0U) & 0xffffffffU;
666}
667static inline u32 pwr_pmu_idle_mask_r(u32 i)
668{
669 return 0x0010a504U + i*16U;
670}
671static inline u32 pwr_pmu_idle_mask_gr_enabled_f(void)
672{
673 return 0x1U;
674}
675static inline u32 pwr_pmu_idle_mask_ce_2_enabled_f(void)
676{
677 return 0x200000U;
678}
679static inline u32 pwr_pmu_idle_count_r(u32 i)
680{
681 return 0x0010a508U + i*16U;
682}
683static inline u32 pwr_pmu_idle_count_value_f(u32 v)
684{
685 return (v & 0x7fffffffU) << 0U;
686}
687static inline u32 pwr_pmu_idle_count_value_v(u32 r)
688{
689 return (r >> 0U) & 0x7fffffffU;
690}
691static inline u32 pwr_pmu_idle_count_reset_f(u32 v)
692{
693 return (v & 0x1U) << 31U;
694}
695static inline u32 pwr_pmu_idle_ctrl_r(u32 i)
696{
697 return 0x0010a50cU + i*16U;
698}
699static inline u32 pwr_pmu_idle_ctrl_value_m(void)
700{
701 return 0x3U << 0U;
702}
703static inline u32 pwr_pmu_idle_ctrl_value_busy_f(void)
704{
705 return 0x2U;
706}
707static inline u32 pwr_pmu_idle_ctrl_value_always_f(void)
708{
709 return 0x3U;
710}
711static inline u32 pwr_pmu_idle_ctrl_filter_m(void)
712{
713 return 0x1U << 2U;
714}
715static inline u32 pwr_pmu_idle_ctrl_filter_disabled_f(void)
716{
717 return 0x0U;
718}
719static inline u32 pwr_pmu_idle_mask_supp_r(u32 i)
720{
721 return 0x0010a9f0U + i*8U;
722}
723static inline u32 pwr_pmu_idle_mask_1_supp_r(u32 i)
724{
725 return 0x0010a9f4U + i*8U;
726}
727static inline u32 pwr_pmu_idle_ctrl_supp_r(u32 i)
728{
729 return 0x0010aa30U + i*8U;
730}
731static inline u32 pwr_pmu_debug_r(u32 i)
732{
733 return 0x0010a5c0U + i*4U;
734}
735static inline u32 pwr_pmu_debug__size_1_v(void)
736{
737 return 0x00000004U;
738}
739static inline u32 pwr_pmu_mailbox_r(u32 i)
740{
741 return 0x0010a450U + i*4U;
742}
743static inline u32 pwr_pmu_mailbox__size_1_v(void)
744{
745 return 0x0000000cU;
746}
747static inline u32 pwr_pmu_bar0_addr_r(void)
748{
749 return 0x0010a7a0U;
750}
751static inline u32 pwr_pmu_bar0_data_r(void)
752{
753 return 0x0010a7a4U;
754}
755static inline u32 pwr_pmu_bar0_ctl_r(void)
756{
757 return 0x0010a7acU;
758}
759static inline u32 pwr_pmu_bar0_timeout_r(void)
760{
761 return 0x0010a7a8U;
762}
763static inline u32 pwr_pmu_bar0_fecs_error_r(void)
764{
765 return 0x0010a988U;
766}
767static inline u32 pwr_pmu_bar0_error_status_r(void)
768{
769 return 0x0010a7b0U;
770}
771static inline u32 pwr_pmu_pg_idlefilth_r(u32 i)
772{
773 return 0x0010a6c0U + i*4U;
774}
775static inline u32 pwr_pmu_pg_ppuidlefilth_r(u32 i)
776{
777 return 0x0010a6e8U + i*4U;
778}
779static inline u32 pwr_pmu_pg_idle_cnt_r(u32 i)
780{
781 return 0x0010a710U + i*4U;
782}
783static inline u32 pwr_pmu_pg_intren_r(u32 i)
784{
785 return 0x0010a760U + i*4U;
786}
787static inline u32 pwr_fbif_transcfg_r(u32 i)
788{
789 return 0x0010ae00U + i*4U;
790}
791static inline u32 pwr_fbif_transcfg_target_local_fb_f(void)
792{
793 return 0x0U;
794}
795static inline u32 pwr_fbif_transcfg_target_coherent_sysmem_f(void)
796{
797 return 0x1U;
798}
799static inline u32 pwr_fbif_transcfg_target_noncoherent_sysmem_f(void)
800{
801 return 0x2U;
802}
803static inline u32 pwr_fbif_transcfg_mem_type_s(void)
804{
805 return 1U;
806}
807static inline u32 pwr_fbif_transcfg_mem_type_f(u32 v)
808{
809 return (v & 0x1U) << 2U;
810}
811static inline u32 pwr_fbif_transcfg_mem_type_m(void)
812{
813 return 0x1U << 2U;
814}
815static inline u32 pwr_fbif_transcfg_mem_type_v(u32 r)
816{
817 return (r >> 2U) & 0x1U;
818}
819static inline u32 pwr_fbif_transcfg_mem_type_virtual_f(void)
820{
821 return 0x0U;
822}
823static inline u32 pwr_fbif_transcfg_mem_type_physical_f(void)
824{
825 return 0x4U;
826}
827#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_ram_gm20b.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_ram_gm20b.h
new file mode 100644
index 00000000..2414abf0
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_ram_gm20b.h
@@ -0,0 +1,459 @@
1/*
2 * Copyright (c) 2014-2017, 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_ram_gm20b_h_
57#define _hw_ram_gm20b_h_
58
59static inline u32 ram_in_ramfc_s(void)
60{
61 return 4096U;
62}
63static inline u32 ram_in_ramfc_w(void)
64{
65 return 0U;
66}
67static inline u32 ram_in_page_dir_base_target_f(u32 v)
68{
69 return (v & 0x3U) << 0U;
70}
71static inline u32 ram_in_page_dir_base_target_w(void)
72{
73 return 128U;
74}
75static inline u32 ram_in_page_dir_base_target_vid_mem_f(void)
76{
77 return 0x0U;
78}
79static inline u32 ram_in_page_dir_base_target_sys_mem_coh_f(void)
80{
81 return 0x2U;
82}
83static inline u32 ram_in_page_dir_base_target_sys_mem_ncoh_f(void)
84{
85 return 0x3U;
86}
87static inline u32 ram_in_page_dir_base_vol_w(void)
88{
89 return 128U;
90}
91static inline u32 ram_in_page_dir_base_vol_true_f(void)
92{
93 return 0x4U;
94}
95static inline u32 ram_in_big_page_size_f(u32 v)
96{
97 return (v & 0x1U) << 11U;
98}
99static inline u32 ram_in_big_page_size_m(void)
100{
101 return 0x1U << 11U;
102}
103static inline u32 ram_in_big_page_size_w(void)
104{
105 return 128U;
106}
107static inline u32 ram_in_big_page_size_128kb_f(void)
108{
109 return 0x0U;
110}
111static inline u32 ram_in_big_page_size_64kb_f(void)
112{
113 return 0x800U;
114}
115static inline u32 ram_in_page_dir_base_lo_f(u32 v)
116{
117 return (v & 0xfffffU) << 12U;
118}
119static inline u32 ram_in_page_dir_base_lo_w(void)
120{
121 return 128U;
122}
123static inline u32 ram_in_page_dir_base_hi_f(u32 v)
124{
125 return (v & 0xffU) << 0U;
126}
127static inline u32 ram_in_page_dir_base_hi_w(void)
128{
129 return 129U;
130}
131static inline u32 ram_in_adr_limit_lo_f(u32 v)
132{
133 return (v & 0xfffffU) << 12U;
134}
135static inline u32 ram_in_adr_limit_lo_w(void)
136{
137 return 130U;
138}
139static inline u32 ram_in_adr_limit_hi_f(u32 v)
140{
141 return (v & 0xffU) << 0U;
142}
143static inline u32 ram_in_adr_limit_hi_w(void)
144{
145 return 131U;
146}
147static inline u32 ram_in_engine_cs_w(void)
148{
149 return 132U;
150}
151static inline u32 ram_in_engine_cs_wfi_v(void)
152{
153 return 0x00000000U;
154}
155static inline u32 ram_in_engine_cs_wfi_f(void)
156{
157 return 0x0U;
158}
159static inline u32 ram_in_engine_cs_fg_v(void)
160{
161 return 0x00000001U;
162}
163static inline u32 ram_in_engine_cs_fg_f(void)
164{
165 return 0x8U;
166}
167static inline u32 ram_in_gr_cs_w(void)
168{
169 return 132U;
170}
171static inline u32 ram_in_gr_cs_wfi_f(void)
172{
173 return 0x0U;
174}
175static inline u32 ram_in_gr_wfi_target_w(void)
176{
177 return 132U;
178}
179static inline u32 ram_in_gr_wfi_mode_w(void)
180{
181 return 132U;
182}
183static inline u32 ram_in_gr_wfi_mode_physical_v(void)
184{
185 return 0x00000000U;
186}
187static inline u32 ram_in_gr_wfi_mode_physical_f(void)
188{
189 return 0x0U;
190}
191static inline u32 ram_in_gr_wfi_mode_virtual_v(void)
192{
193 return 0x00000001U;
194}
195static inline u32 ram_in_gr_wfi_mode_virtual_f(void)
196{
197 return 0x4U;
198}
199static inline u32 ram_in_gr_wfi_ptr_lo_f(u32 v)
200{
201 return (v & 0xfffffU) << 12U;
202}
203static inline u32 ram_in_gr_wfi_ptr_lo_w(void)
204{
205 return 132U;
206}
207static inline u32 ram_in_gr_wfi_ptr_hi_f(u32 v)
208{
209 return (v & 0xffU) << 0U;
210}
211static inline u32 ram_in_gr_wfi_ptr_hi_w(void)
212{
213 return 133U;
214}
215static inline u32 ram_in_base_shift_v(void)
216{
217 return 0x0000000cU;
218}
219static inline u32 ram_in_alloc_size_v(void)
220{
221 return 0x00001000U;
222}
223static inline u32 ram_fc_size_val_v(void)
224{
225 return 0x00000200U;
226}
227static inline u32 ram_fc_gp_put_w(void)
228{
229 return 0U;
230}
231static inline u32 ram_fc_userd_w(void)
232{
233 return 2U;
234}
235static inline u32 ram_fc_userd_hi_w(void)
236{
237 return 3U;
238}
239static inline u32 ram_fc_signature_w(void)
240{
241 return 4U;
242}
243static inline u32 ram_fc_gp_get_w(void)
244{
245 return 5U;
246}
247static inline u32 ram_fc_pb_get_w(void)
248{
249 return 6U;
250}
251static inline u32 ram_fc_pb_get_hi_w(void)
252{
253 return 7U;
254}
255static inline u32 ram_fc_pb_top_level_get_w(void)
256{
257 return 8U;
258}
259static inline u32 ram_fc_pb_top_level_get_hi_w(void)
260{
261 return 9U;
262}
263static inline u32 ram_fc_acquire_w(void)
264{
265 return 12U;
266}
267static inline u32 ram_fc_semaphorea_w(void)
268{
269 return 14U;
270}
271static inline u32 ram_fc_semaphoreb_w(void)
272{
273 return 15U;
274}
275static inline u32 ram_fc_semaphorec_w(void)
276{
277 return 16U;
278}
279static inline u32 ram_fc_semaphored_w(void)
280{
281 return 17U;
282}
283static inline u32 ram_fc_gp_base_w(void)
284{
285 return 18U;
286}
287static inline u32 ram_fc_gp_base_hi_w(void)
288{
289 return 19U;
290}
291static inline u32 ram_fc_gp_fetch_w(void)
292{
293 return 20U;
294}
295static inline u32 ram_fc_pb_fetch_w(void)
296{
297 return 21U;
298}
299static inline u32 ram_fc_pb_fetch_hi_w(void)
300{
301 return 22U;
302}
303static inline u32 ram_fc_pb_put_w(void)
304{
305 return 23U;
306}
307static inline u32 ram_fc_pb_put_hi_w(void)
308{
309 return 24U;
310}
311static inline u32 ram_fc_pb_header_w(void)
312{
313 return 33U;
314}
315static inline u32 ram_fc_pb_count_w(void)
316{
317 return 34U;
318}
319static inline u32 ram_fc_subdevice_w(void)
320{
321 return 37U;
322}
323static inline u32 ram_fc_formats_w(void)
324{
325 return 39U;
326}
327static inline u32 ram_fc_syncpointa_w(void)
328{
329 return 41U;
330}
331static inline u32 ram_fc_syncpointb_w(void)
332{
333 return 42U;
334}
335static inline u32 ram_fc_target_w(void)
336{
337 return 43U;
338}
339static inline u32 ram_fc_hce_ctrl_w(void)
340{
341 return 57U;
342}
343static inline u32 ram_fc_chid_w(void)
344{
345 return 58U;
346}
347static inline u32 ram_fc_chid_id_f(u32 v)
348{
349 return (v & 0xfffU) << 0U;
350}
351static inline u32 ram_fc_chid_id_w(void)
352{
353 return 0U;
354}
355static inline u32 ram_fc_runlist_timeslice_w(void)
356{
357 return 62U;
358}
359static inline u32 ram_userd_base_shift_v(void)
360{
361 return 0x00000009U;
362}
363static inline u32 ram_userd_chan_size_v(void)
364{
365 return 0x00000200U;
366}
367static inline u32 ram_userd_put_w(void)
368{
369 return 16U;
370}
371static inline u32 ram_userd_get_w(void)
372{
373 return 17U;
374}
375static inline u32 ram_userd_ref_w(void)
376{
377 return 18U;
378}
379static inline u32 ram_userd_put_hi_w(void)
380{
381 return 19U;
382}
383static inline u32 ram_userd_ref_threshold_w(void)
384{
385 return 20U;
386}
387static inline u32 ram_userd_top_level_get_w(void)
388{
389 return 22U;
390}
391static inline u32 ram_userd_top_level_get_hi_w(void)
392{
393 return 23U;
394}
395static inline u32 ram_userd_get_hi_w(void)
396{
397 return 24U;
398}
399static inline u32 ram_userd_gp_get_w(void)
400{
401 return 34U;
402}
403static inline u32 ram_userd_gp_put_w(void)
404{
405 return 35U;
406}
407static inline u32 ram_userd_gp_top_level_get_w(void)
408{
409 return 22U;
410}
411static inline u32 ram_userd_gp_top_level_get_hi_w(void)
412{
413 return 23U;
414}
415static inline u32 ram_rl_entry_size_v(void)
416{
417 return 0x00000008U;
418}
419static inline u32 ram_rl_entry_chid_f(u32 v)
420{
421 return (v & 0xfffU) << 0U;
422}
423static inline u32 ram_rl_entry_id_f(u32 v)
424{
425 return (v & 0xfffU) << 0U;
426}
427static inline u32 ram_rl_entry_type_f(u32 v)
428{
429 return (v & 0x1U) << 13U;
430}
431static inline u32 ram_rl_entry_type_chid_f(void)
432{
433 return 0x0U;
434}
435static inline u32 ram_rl_entry_type_tsg_f(void)
436{
437 return 0x2000U;
438}
439static inline u32 ram_rl_entry_timeslice_scale_f(u32 v)
440{
441 return (v & 0xfU) << 14U;
442}
443static inline u32 ram_rl_entry_timeslice_scale_3_f(void)
444{
445 return 0xc000U;
446}
447static inline u32 ram_rl_entry_timeslice_timeout_f(u32 v)
448{
449 return (v & 0xffU) << 18U;
450}
451static inline u32 ram_rl_entry_timeslice_timeout_128_f(void)
452{
453 return 0x2000000U;
454}
455static inline u32 ram_rl_entry_tsg_length_f(u32 v)
456{
457 return (v & 0x3fU) << 26U;
458}
459#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_therm_gm20b.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_therm_gm20b.h
new file mode 100644
index 00000000..fc1cd517
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_therm_gm20b.h
@@ -0,0 +1,355 @@
1/*
2 * Copyright (c) 2014-2017, 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_therm_gm20b_h_
57#define _hw_therm_gm20b_h_
58
59static inline u32 therm_use_a_r(void)
60{
61 return 0x00020798U;
62}
63static inline u32 therm_use_a_ext_therm_0_enable_f(void)
64{
65 return 0x1U;
66}
67static inline u32 therm_use_a_ext_therm_1_enable_f(void)
68{
69 return 0x2U;
70}
71static inline u32 therm_use_a_ext_therm_2_enable_f(void)
72{
73 return 0x4U;
74}
75static inline u32 therm_evt_ext_therm_0_r(void)
76{
77 return 0x00020700U;
78}
79static inline u32 therm_evt_ext_therm_0_slow_factor_f(u32 v)
80{
81 return (v & 0x3fU) << 8U;
82}
83static inline u32 therm_evt_ext_therm_0_slow_factor_init_v(void)
84{
85 return 0x00000000U;
86}
87static inline u32 therm_evt_ext_therm_1_r(void)
88{
89 return 0x00020704U;
90}
91static inline u32 therm_evt_ext_therm_1_slow_factor_f(u32 v)
92{
93 return (v & 0x3fU) << 8U;
94}
95static inline u32 therm_evt_ext_therm_1_slow_factor_init_v(void)
96{
97 return 0x00000000U;
98}
99static inline u32 therm_evt_ext_therm_2_r(void)
100{
101 return 0x00020708U;
102}
103static inline u32 therm_evt_ext_therm_2_slow_factor_f(u32 v)
104{
105 return (v & 0x3fU) << 8U;
106}
107static inline u32 therm_evt_ext_therm_2_slow_factor_init_v(void)
108{
109 return 0x00000000U;
110}
111static inline u32 therm_weight_1_r(void)
112{
113 return 0x00020024U;
114}
115static inline u32 therm_config1_r(void)
116{
117 return 0x00020050U;
118}
119static inline u32 therm_config2_r(void)
120{
121 return 0x00020130U;
122}
123static inline u32 therm_config2_slowdown_factor_extended_f(u32 v)
124{
125 return (v & 0x1U) << 24U;
126}
127static inline u32 therm_config2_grad_enable_f(u32 v)
128{
129 return (v & 0x1U) << 31U;
130}
131static inline u32 therm_gate_ctrl_r(u32 i)
132{
133 return 0x00020200U + i*4U;
134}
135static inline u32 therm_gate_ctrl_eng_clk_m(void)
136{
137 return 0x3U << 0U;
138}
139static inline u32 therm_gate_ctrl_eng_clk_run_f(void)
140{
141 return 0x0U;
142}
143static inline u32 therm_gate_ctrl_eng_clk_auto_f(void)
144{
145 return 0x1U;
146}
147static inline u32 therm_gate_ctrl_eng_clk_stop_f(void)
148{
149 return 0x2U;
150}
151static inline u32 therm_gate_ctrl_blk_clk_m(void)
152{
153 return 0x3U << 2U;
154}
155static inline u32 therm_gate_ctrl_blk_clk_run_f(void)
156{
157 return 0x0U;
158}
159static inline u32 therm_gate_ctrl_blk_clk_auto_f(void)
160{
161 return 0x4U;
162}
163static inline u32 therm_gate_ctrl_eng_pwr_m(void)
164{
165 return 0x3U << 4U;
166}
167static inline u32 therm_gate_ctrl_eng_pwr_auto_f(void)
168{
169 return 0x10U;
170}
171static inline u32 therm_gate_ctrl_eng_pwr_off_v(void)
172{
173 return 0x00000002U;
174}
175static inline u32 therm_gate_ctrl_eng_pwr_off_f(void)
176{
177 return 0x20U;
178}
179static inline u32 therm_gate_ctrl_eng_idle_filt_exp_f(u32 v)
180{
181 return (v & 0x1fU) << 8U;
182}
183static inline u32 therm_gate_ctrl_eng_idle_filt_exp_m(void)
184{
185 return 0x1fU << 8U;
186}
187static inline u32 therm_gate_ctrl_eng_idle_filt_mant_f(u32 v)
188{
189 return (v & 0x7U) << 13U;
190}
191static inline u32 therm_gate_ctrl_eng_idle_filt_mant_m(void)
192{
193 return 0x7U << 13U;
194}
195static inline u32 therm_gate_ctrl_eng_delay_before_f(u32 v)
196{
197 return (v & 0xfU) << 16U;
198}
199static inline u32 therm_gate_ctrl_eng_delay_before_m(void)
200{
201 return 0xfU << 16U;
202}
203static inline u32 therm_gate_ctrl_eng_delay_after_f(u32 v)
204{
205 return (v & 0xfU) << 20U;
206}
207static inline u32 therm_gate_ctrl_eng_delay_after_m(void)
208{
209 return 0xfU << 20U;
210}
211static inline u32 therm_fecs_idle_filter_r(void)
212{
213 return 0x00020288U;
214}
215static inline u32 therm_fecs_idle_filter_value_m(void)
216{
217 return 0xffffffffU << 0U;
218}
219static inline u32 therm_hubmmu_idle_filter_r(void)
220{
221 return 0x0002028cU;
222}
223static inline u32 therm_hubmmu_idle_filter_value_m(void)
224{
225 return 0xffffffffU << 0U;
226}
227static inline u32 therm_clk_slowdown_r(u32 i)
228{
229 return 0x00020160U + i*4U;
230}
231static inline u32 therm_clk_slowdown_idle_factor_f(u32 v)
232{
233 return (v & 0x3fU) << 16U;
234}
235static inline u32 therm_clk_slowdown_idle_factor_m(void)
236{
237 return 0x3fU << 16U;
238}
239static inline u32 therm_clk_slowdown_idle_factor_v(u32 r)
240{
241 return (r >> 16U) & 0x3fU;
242}
243static inline u32 therm_clk_slowdown_idle_factor_disabled_f(void)
244{
245 return 0x0U;
246}
247static inline u32 therm_grad_stepping_table_r(u32 i)
248{
249 return 0x000202c8U + i*4U;
250}
251static inline u32 therm_grad_stepping_table_slowdown_factor0_f(u32 v)
252{
253 return (v & 0x3fU) << 0U;
254}
255static inline u32 therm_grad_stepping_table_slowdown_factor0_m(void)
256{
257 return 0x3fU << 0U;
258}
259static inline u32 therm_grad_stepping_table_slowdown_factor0_fpdiv_by1p5_f(void)
260{
261 return 0x1U;
262}
263static inline u32 therm_grad_stepping_table_slowdown_factor0_fpdiv_by2_f(void)
264{
265 return 0x2U;
266}
267static inline u32 therm_grad_stepping_table_slowdown_factor0_fpdiv_by4_f(void)
268{
269 return 0x6U;
270}
271static inline u32 therm_grad_stepping_table_slowdown_factor0_fpdiv_by8_f(void)
272{
273 return 0xeU;
274}
275static inline u32 therm_grad_stepping_table_slowdown_factor1_f(u32 v)
276{
277 return (v & 0x3fU) << 6U;
278}
279static inline u32 therm_grad_stepping_table_slowdown_factor1_m(void)
280{
281 return 0x3fU << 6U;
282}
283static inline u32 therm_grad_stepping_table_slowdown_factor2_f(u32 v)
284{
285 return (v & 0x3fU) << 12U;
286}
287static inline u32 therm_grad_stepping_table_slowdown_factor2_m(void)
288{
289 return 0x3fU << 12U;
290}
291static inline u32 therm_grad_stepping_table_slowdown_factor3_f(u32 v)
292{
293 return (v & 0x3fU) << 18U;
294}
295static inline u32 therm_grad_stepping_table_slowdown_factor3_m(void)
296{
297 return 0x3fU << 18U;
298}
299static inline u32 therm_grad_stepping_table_slowdown_factor4_f(u32 v)
300{
301 return (v & 0x3fU) << 24U;
302}
303static inline u32 therm_grad_stepping_table_slowdown_factor4_m(void)
304{
305 return 0x3fU << 24U;
306}
307static inline u32 therm_grad_stepping0_r(void)
308{
309 return 0x000202c0U;
310}
311static inline u32 therm_grad_stepping0_feature_s(void)
312{
313 return 1U;
314}
315static inline u32 therm_grad_stepping0_feature_f(u32 v)
316{
317 return (v & 0x1U) << 0U;
318}
319static inline u32 therm_grad_stepping0_feature_m(void)
320{
321 return 0x1U << 0U;
322}
323static inline u32 therm_grad_stepping0_feature_v(u32 r)
324{
325 return (r >> 0U) & 0x1U;
326}
327static inline u32 therm_grad_stepping0_feature_enable_f(void)
328{
329 return 0x1U;
330}
331static inline u32 therm_grad_stepping1_r(void)
332{
333 return 0x000202c4U;
334}
335static inline u32 therm_grad_stepping1_pdiv_duration_f(u32 v)
336{
337 return (v & 0x1ffffU) << 0U;
338}
339static inline u32 therm_clk_timing_r(u32 i)
340{
341 return 0x000203c0U + i*4U;
342}
343static inline u32 therm_clk_timing_grad_slowdown_f(u32 v)
344{
345 return (v & 0x1U) << 16U;
346}
347static inline u32 therm_clk_timing_grad_slowdown_m(void)
348{
349 return 0x1U << 16U;
350}
351static inline u32 therm_clk_timing_grad_slowdown_enabled_f(void)
352{
353 return 0x10000U;
354}
355#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_timer_gm20b.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_timer_gm20b.h
new file mode 100644
index 00000000..38548645
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_timer_gm20b.h
@@ -0,0 +1,115 @@
1/*
2 * Copyright (c) 2016-2017, 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_timer_gm20b_h_
57#define _hw_timer_gm20b_h_
58
59static inline u32 timer_pri_timeout_r(void)
60{
61 return 0x00009080U;
62}
63static inline u32 timer_pri_timeout_period_f(u32 v)
64{
65 return (v & 0xffffffU) << 0U;
66}
67static inline u32 timer_pri_timeout_period_m(void)
68{
69 return 0xffffffU << 0U;
70}
71static inline u32 timer_pri_timeout_period_v(u32 r)
72{
73 return (r >> 0U) & 0xffffffU;
74}
75static inline u32 timer_pri_timeout_en_f(u32 v)
76{
77 return (v & 0x1U) << 31U;
78}
79static inline u32 timer_pri_timeout_en_m(void)
80{
81 return 0x1U << 31U;
82}
83static inline u32 timer_pri_timeout_en_v(u32 r)
84{
85 return (r >> 31U) & 0x1U;
86}
87static inline u32 timer_pri_timeout_en_en_enabled_f(void)
88{
89 return 0x80000000U;
90}
91static inline u32 timer_pri_timeout_en_en_disabled_f(void)
92{
93 return 0x0U;
94}
95static inline u32 timer_pri_timeout_save_0_r(void)
96{
97 return 0x00009084U;
98}
99static inline u32 timer_pri_timeout_save_1_r(void)
100{
101 return 0x00009088U;
102}
103static inline u32 timer_pri_timeout_fecs_errcode_r(void)
104{
105 return 0x0000908cU;
106}
107static inline u32 timer_time_0_r(void)
108{
109 return 0x00009400U;
110}
111static inline u32 timer_time_1_r(void)
112{
113 return 0x00009410U;
114}
115#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_top_gm20b.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_top_gm20b.h
new file mode 100644
index 00000000..6d48839e
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_top_gm20b.h
@@ -0,0 +1,235 @@
1/*
2 * Copyright (c) 2014-2017, 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_top_gm20b_h_
57#define _hw_top_gm20b_h_
58
59static inline u32 top_num_gpcs_r(void)
60{
61 return 0x00022430U;
62}
63static inline u32 top_num_gpcs_value_v(u32 r)
64{
65 return (r >> 0U) & 0x1fU;
66}
67static inline u32 top_tpc_per_gpc_r(void)
68{
69 return 0x00022434U;
70}
71static inline u32 top_tpc_per_gpc_value_v(u32 r)
72{
73 return (r >> 0U) & 0x1fU;
74}
75static inline u32 top_num_fbps_r(void)
76{
77 return 0x00022438U;
78}
79static inline u32 top_num_fbps_value_v(u32 r)
80{
81 return (r >> 0U) & 0x1fU;
82}
83static inline u32 top_ltc_per_fbp_r(void)
84{
85 return 0x00022450U;
86}
87static inline u32 top_ltc_per_fbp_value_v(u32 r)
88{
89 return (r >> 0U) & 0x1fU;
90}
91static inline u32 top_slices_per_ltc_r(void)
92{
93 return 0x0002245cU;
94}
95static inline u32 top_slices_per_ltc_value_v(u32 r)
96{
97 return (r >> 0U) & 0x1fU;
98}
99static inline u32 top_num_ltcs_r(void)
100{
101 return 0x00022454U;
102}
103static inline u32 top_device_info_r(u32 i)
104{
105 return 0x00022700U + i*4U;
106}
107static inline u32 top_device_info__size_1_v(void)
108{
109 return 0x00000040U;
110}
111static inline u32 top_device_info_chain_v(u32 r)
112{
113 return (r >> 31U) & 0x1U;
114}
115static inline u32 top_device_info_chain_enable_v(void)
116{
117 return 0x00000001U;
118}
119static inline u32 top_device_info_engine_enum_v(u32 r)
120{
121 return (r >> 26U) & 0xfU;
122}
123static inline u32 top_device_info_runlist_enum_v(u32 r)
124{
125 return (r >> 21U) & 0xfU;
126}
127static inline u32 top_device_info_intr_enum_v(u32 r)
128{
129 return (r >> 15U) & 0x1fU;
130}
131static inline u32 top_device_info_reset_enum_v(u32 r)
132{
133 return (r >> 9U) & 0x1fU;
134}
135static inline u32 top_device_info_type_enum_v(u32 r)
136{
137 return (r >> 2U) & 0x1fffffffU;
138}
139static inline u32 top_device_info_type_enum_graphics_v(void)
140{
141 return 0x00000000U;
142}
143static inline u32 top_device_info_type_enum_graphics_f(void)
144{
145 return 0x0U;
146}
147static inline u32 top_device_info_type_enum_copy0_v(void)
148{
149 return 0x00000001U;
150}
151static inline u32 top_device_info_type_enum_copy0_f(void)
152{
153 return 0x4U;
154}
155static inline u32 top_device_info_type_enum_copy1_v(void)
156{
157 return 0x00000002U;
158}
159static inline u32 top_device_info_type_enum_copy1_f(void)
160{
161 return 0x8U;
162}
163static inline u32 top_device_info_type_enum_copy2_v(void)
164{
165 return 0x00000003U;
166}
167static inline u32 top_device_info_type_enum_copy2_f(void)
168{
169 return 0xcU;
170}
171static inline u32 top_device_info_engine_v(u32 r)
172{
173 return (r >> 5U) & 0x1U;
174}
175static inline u32 top_device_info_runlist_v(u32 r)
176{
177 return (r >> 4U) & 0x1U;
178}
179static inline u32 top_device_info_intr_v(u32 r)
180{
181 return (r >> 3U) & 0x1U;
182}
183static inline u32 top_device_info_reset_v(u32 r)
184{
185 return (r >> 2U) & 0x1U;
186}
187static inline u32 top_device_info_entry_v(u32 r)
188{
189 return (r >> 0U) & 0x3U;
190}
191static inline u32 top_device_info_entry_not_valid_v(void)
192{
193 return 0x00000000U;
194}
195static inline u32 top_device_info_entry_enum_v(void)
196{
197 return 0x00000002U;
198}
199static inline u32 top_device_info_entry_engine_type_v(void)
200{
201 return 0x00000003U;
202}
203static inline u32 top_device_info_entry_data_v(void)
204{
205 return 0x00000001U;
206}
207static inline u32 top_device_info_data_type_v(u32 r)
208{
209 return (r >> 30U) & 0x1U;
210}
211static inline u32 top_device_info_data_type_enum2_v(void)
212{
213 return 0x00000000U;
214}
215static inline u32 top_device_info_data_pri_base_v(u32 r)
216{
217 return (r >> 12U) & 0x7ffU;
218}
219static inline u32 top_device_info_data_pri_base_align_v(void)
220{
221 return 0x0000000cU;
222}
223static inline u32 top_device_info_data_fault_id_enum_v(u32 r)
224{
225 return (r >> 3U) & 0x1fU;
226}
227static inline u32 top_device_info_data_fault_id_v(u32 r)
228{
229 return (r >> 2U) & 0x1U;
230}
231static inline u32 top_device_info_data_fault_id_valid_v(void)
232{
233 return 0x00000001U;
234}
235#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_trim_gm20b.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_trim_gm20b.h
new file mode 100644
index 00000000..8f0a77a5
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_trim_gm20b.h
@@ -0,0 +1,503 @@
1/*
2 * Copyright (c) 2014-2017, 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_trim_gm20b_h_
57#define _hw_trim_gm20b_h_
58
59static inline u32 trim_sys_gpcpll_cfg_r(void)
60{
61 return 0x00137000U;
62}
63static inline u32 trim_sys_gpcpll_cfg_enable_m(void)
64{
65 return 0x1U << 0U;
66}
67static inline u32 trim_sys_gpcpll_cfg_enable_v(u32 r)
68{
69 return (r >> 0U) & 0x1U;
70}
71static inline u32 trim_sys_gpcpll_cfg_enable_no_f(void)
72{
73 return 0x0U;
74}
75static inline u32 trim_sys_gpcpll_cfg_enable_yes_f(void)
76{
77 return 0x1U;
78}
79static inline u32 trim_sys_gpcpll_cfg_iddq_m(void)
80{
81 return 0x1U << 1U;
82}
83static inline u32 trim_sys_gpcpll_cfg_iddq_v(u32 r)
84{
85 return (r >> 1U) & 0x1U;
86}
87static inline u32 trim_sys_gpcpll_cfg_iddq_power_on_v(void)
88{
89 return 0x00000000U;
90}
91static inline u32 trim_sys_gpcpll_cfg_sync_mode_m(void)
92{
93 return 0x1U << 2U;
94}
95static inline u32 trim_sys_gpcpll_cfg_sync_mode_v(u32 r)
96{
97 return (r >> 2U) & 0x1U;
98}
99static inline u32 trim_sys_gpcpll_cfg_sync_mode_enable_f(void)
100{
101 return 0x4U;
102}
103static inline u32 trim_sys_gpcpll_cfg_sync_mode_disable_f(void)
104{
105 return 0x0U;
106}
107static inline u32 trim_sys_gpcpll_cfg_enb_lckdet_m(void)
108{
109 return 0x1U << 4U;
110}
111static inline u32 trim_sys_gpcpll_cfg_enb_lckdet_power_on_f(void)
112{
113 return 0x0U;
114}
115static inline u32 trim_sys_gpcpll_cfg_enb_lckdet_power_off_f(void)
116{
117 return 0x10U;
118}
119static inline u32 trim_sys_gpcpll_cfg_pll_lock_v(u32 r)
120{
121 return (r >> 17U) & 0x1U;
122}
123static inline u32 trim_sys_gpcpll_cfg_pll_lock_true_f(void)
124{
125 return 0x20000U;
126}
127static inline u32 trim_sys_gpcpll_coeff_r(void)
128{
129 return 0x00137004U;
130}
131static inline u32 trim_sys_gpcpll_coeff_mdiv_f(u32 v)
132{
133 return (v & 0xffU) << 0U;
134}
135static inline u32 trim_sys_gpcpll_coeff_mdiv_m(void)
136{
137 return 0xffU << 0U;
138}
139static inline u32 trim_sys_gpcpll_coeff_mdiv_v(u32 r)
140{
141 return (r >> 0U) & 0xffU;
142}
143static inline u32 trim_sys_gpcpll_coeff_ndiv_f(u32 v)
144{
145 return (v & 0xffU) << 8U;
146}
147static inline u32 trim_sys_gpcpll_coeff_ndiv_m(void)
148{
149 return 0xffU << 8U;
150}
151static inline u32 trim_sys_gpcpll_coeff_ndiv_v(u32 r)
152{
153 return (r >> 8U) & 0xffU;
154}
155static inline u32 trim_sys_gpcpll_coeff_pldiv_f(u32 v)
156{
157 return (v & 0x3fU) << 16U;
158}
159static inline u32 trim_sys_gpcpll_coeff_pldiv_m(void)
160{
161 return 0x3fU << 16U;
162}
163static inline u32 trim_sys_gpcpll_coeff_pldiv_v(u32 r)
164{
165 return (r >> 16U) & 0x3fU;
166}
167static inline u32 trim_sys_sel_vco_r(void)
168{
169 return 0x00137100U;
170}
171static inline u32 trim_sys_sel_vco_gpc2clk_out_m(void)
172{
173 return 0x1U << 0U;
174}
175static inline u32 trim_sys_sel_vco_gpc2clk_out_init_v(void)
176{
177 return 0x00000000U;
178}
179static inline u32 trim_sys_sel_vco_gpc2clk_out_init_f(void)
180{
181 return 0x0U;
182}
183static inline u32 trim_sys_sel_vco_gpc2clk_out_bypass_f(void)
184{
185 return 0x0U;
186}
187static inline u32 trim_sys_sel_vco_gpc2clk_out_vco_f(void)
188{
189 return 0x1U;
190}
191static inline u32 trim_sys_gpc2clk_out_r(void)
192{
193 return 0x00137250U;
194}
195static inline u32 trim_sys_gpc2clk_out_bypdiv_s(void)
196{
197 return 6U;
198}
199static inline u32 trim_sys_gpc2clk_out_bypdiv_f(u32 v)
200{
201 return (v & 0x3fU) << 0U;
202}
203static inline u32 trim_sys_gpc2clk_out_bypdiv_m(void)
204{
205 return 0x3fU << 0U;
206}
207static inline u32 trim_sys_gpc2clk_out_bypdiv_v(u32 r)
208{
209 return (r >> 0U) & 0x3fU;
210}
211static inline u32 trim_sys_gpc2clk_out_bypdiv_by31_f(void)
212{
213 return 0x3cU;
214}
215static inline u32 trim_sys_gpc2clk_out_vcodiv_s(void)
216{
217 return 6U;
218}
219static inline u32 trim_sys_gpc2clk_out_vcodiv_f(u32 v)
220{
221 return (v & 0x3fU) << 8U;
222}
223static inline u32 trim_sys_gpc2clk_out_vcodiv_m(void)
224{
225 return 0x3fU << 8U;
226}
227static inline u32 trim_sys_gpc2clk_out_vcodiv_v(u32 r)
228{
229 return (r >> 8U) & 0x3fU;
230}
231static inline u32 trim_sys_gpc2clk_out_vcodiv_by1_f(void)
232{
233 return 0x0U;
234}
235static inline u32 trim_sys_gpc2clk_out_sdiv14_m(void)
236{
237 return 0x1U << 31U;
238}
239static inline u32 trim_sys_gpc2clk_out_sdiv14_indiv4_mode_f(void)
240{
241 return 0x80000000U;
242}
243static inline u32 trim_gpc_clk_cntr_ncgpcclk_cfg_r(u32 i)
244{
245 return 0x00134124U + i*512U;
246}
247static inline u32 trim_gpc_clk_cntr_ncgpcclk_cfg_noofipclks_f(u32 v)
248{
249 return (v & 0x3fffU) << 0U;
250}
251static inline u32 trim_gpc_clk_cntr_ncgpcclk_cfg_write_en_asserted_f(void)
252{
253 return 0x10000U;
254}
255static inline u32 trim_gpc_clk_cntr_ncgpcclk_cfg_enable_asserted_f(void)
256{
257 return 0x100000U;
258}
259static inline u32 trim_gpc_clk_cntr_ncgpcclk_cfg_reset_asserted_f(void)
260{
261 return 0x1000000U;
262}
263static inline u32 trim_gpc_clk_cntr_ncgpcclk_cnt_r(u32 i)
264{
265 return 0x00134128U + i*512U;
266}
267static inline u32 trim_gpc_clk_cntr_ncgpcclk_cnt_value_v(u32 r)
268{
269 return (r >> 0U) & 0xfffffU;
270}
271static inline u32 trim_sys_gpcpll_cfg2_r(void)
272{
273 return 0x0013700cU;
274}
275static inline u32 trim_sys_gpcpll_cfg2_sdm_din_f(u32 v)
276{
277 return (v & 0xffU) << 0U;
278}
279static inline u32 trim_sys_gpcpll_cfg2_sdm_din_m(void)
280{
281 return 0xffU << 0U;
282}
283static inline u32 trim_sys_gpcpll_cfg2_sdm_din_v(u32 r)
284{
285 return (r >> 0U) & 0xffU;
286}
287static inline u32 trim_sys_gpcpll_cfg2_sdm_din_new_f(u32 v)
288{
289 return (v & 0xffU) << 8U;
290}
291static inline u32 trim_sys_gpcpll_cfg2_sdm_din_new_m(void)
292{
293 return 0xffU << 8U;
294}
295static inline u32 trim_sys_gpcpll_cfg2_sdm_din_new_v(u32 r)
296{
297 return (r >> 8U) & 0xffU;
298}
299static inline u32 trim_sys_gpcpll_cfg2_pll_stepa_f(u32 v)
300{
301 return (v & 0xffU) << 24U;
302}
303static inline u32 trim_sys_gpcpll_cfg2_pll_stepa_m(void)
304{
305 return 0xffU << 24U;
306}
307static inline u32 trim_sys_gpcpll_cfg3_r(void)
308{
309 return 0x00137018U;
310}
311static inline u32 trim_sys_gpcpll_cfg3_vco_ctrl_f(u32 v)
312{
313 return (v & 0x1ffU) << 0U;
314}
315static inline u32 trim_sys_gpcpll_cfg3_vco_ctrl_m(void)
316{
317 return 0x1ffU << 0U;
318}
319static inline u32 trim_sys_gpcpll_cfg3_pll_stepb_f(u32 v)
320{
321 return (v & 0xffU) << 16U;
322}
323static inline u32 trim_sys_gpcpll_cfg3_pll_stepb_m(void)
324{
325 return 0xffU << 16U;
326}
327static inline u32 trim_sys_gpcpll_cfg3_dfs_testout_v(u32 r)
328{
329 return (r >> 24U) & 0x7fU;
330}
331static inline u32 trim_sys_gpcpll_dvfs0_r(void)
332{
333 return 0x00137010U;
334}
335static inline u32 trim_sys_gpcpll_dvfs0_dfs_coeff_f(u32 v)
336{
337 return (v & 0x7fU) << 0U;
338}
339static inline u32 trim_sys_gpcpll_dvfs0_dfs_coeff_m(void)
340{
341 return 0x7fU << 0U;
342}
343static inline u32 trim_sys_gpcpll_dvfs0_dfs_coeff_v(u32 r)
344{
345 return (r >> 0U) & 0x7fU;
346}
347static inline u32 trim_sys_gpcpll_dvfs0_dfs_det_max_f(u32 v)
348{
349 return (v & 0x7fU) << 8U;
350}
351static inline u32 trim_sys_gpcpll_dvfs0_dfs_det_max_m(void)
352{
353 return 0x7fU << 8U;
354}
355static inline u32 trim_sys_gpcpll_dvfs0_dfs_det_max_v(u32 r)
356{
357 return (r >> 8U) & 0x7fU;
358}
359static inline u32 trim_sys_gpcpll_dvfs0_dfs_dc_offset_f(u32 v)
360{
361 return (v & 0x3fU) << 16U;
362}
363static inline u32 trim_sys_gpcpll_dvfs0_dfs_dc_offset_m(void)
364{
365 return 0x3fU << 16U;
366}
367static inline u32 trim_sys_gpcpll_dvfs0_dfs_dc_offset_v(u32 r)
368{
369 return (r >> 16U) & 0x3fU;
370}
371static inline u32 trim_sys_gpcpll_dvfs0_mode_m(void)
372{
373 return 0x1U << 28U;
374}
375static inline u32 trim_sys_gpcpll_dvfs0_mode_dvfspll_f(void)
376{
377 return 0x0U;
378}
379static inline u32 trim_sys_gpcpll_dvfs1_r(void)
380{
381 return 0x00137014U;
382}
383static inline u32 trim_sys_gpcpll_dvfs1_dfs_ext_det_f(u32 v)
384{
385 return (v & 0x7fU) << 0U;
386}
387static inline u32 trim_sys_gpcpll_dvfs1_dfs_ext_det_m(void)
388{
389 return 0x7fU << 0U;
390}
391static inline u32 trim_sys_gpcpll_dvfs1_dfs_ext_det_v(u32 r)
392{
393 return (r >> 0U) & 0x7fU;
394}
395static inline u32 trim_sys_gpcpll_dvfs1_dfs_ext_strb_m(void)
396{
397 return 0x1U << 7U;
398}
399static inline u32 trim_sys_gpcpll_dvfs1_dfs_ext_cal_f(u32 v)
400{
401 return (v & 0x7fU) << 8U;
402}
403static inline u32 trim_sys_gpcpll_dvfs1_dfs_ext_cal_m(void)
404{
405 return 0x7fU << 8U;
406}
407static inline u32 trim_sys_gpcpll_dvfs1_dfs_ext_cal_v(u32 r)
408{
409 return (r >> 8U) & 0x7fU;
410}
411static inline u32 trim_sys_gpcpll_dvfs1_dfs_ext_sel_m(void)
412{
413 return 0x1U << 15U;
414}
415static inline u32 trim_sys_gpcpll_dvfs1_dfs_ctrl_f(u32 v)
416{
417 return (v & 0xfffU) << 16U;
418}
419static inline u32 trim_sys_gpcpll_dvfs1_dfs_ctrl_m(void)
420{
421 return 0xfffU << 16U;
422}
423static inline u32 trim_sys_gpcpll_dvfs1_dfs_ctrl_v(u32 r)
424{
425 return (r >> 16U) & 0xfffU;
426}
427static inline u32 trim_sys_gpcpll_dvfs1_en_sdm_m(void)
428{
429 return 0x1U << 28U;
430}
431static inline u32 trim_sys_gpcpll_dvfs1_en_dfs_m(void)
432{
433 return 0x1U << 29U;
434}
435static inline u32 trim_sys_gpcpll_dvfs1_en_dfs_cal_m(void)
436{
437 return 0x1U << 30U;
438}
439static inline u32 trim_sys_gpcpll_dvfs1_dfs_cal_done_v(u32 r)
440{
441 return (r >> 31U) & 0x1U;
442}
443static inline u32 trim_sys_gpcpll_dvfs2_r(void)
444{
445 return 0x00137020U;
446}
447static inline u32 trim_sys_gpcpll_ndiv_slowdown_r(void)
448{
449 return 0x0013701cU;
450}
451static inline u32 trim_sys_gpcpll_ndiv_slowdown_slowdown_using_pll_m(void)
452{
453 return 0x1U << 22U;
454}
455static inline u32 trim_sys_gpcpll_ndiv_slowdown_slowdown_using_pll_yes_f(void)
456{
457 return 0x400000U;
458}
459static inline u32 trim_sys_gpcpll_ndiv_slowdown_slowdown_using_pll_no_f(void)
460{
461 return 0x0U;
462}
463static inline u32 trim_sys_gpcpll_ndiv_slowdown_en_dynramp_m(void)
464{
465 return 0x1U << 31U;
466}
467static inline u32 trim_sys_gpcpll_ndiv_slowdown_en_dynramp_yes_f(void)
468{
469 return 0x80000000U;
470}
471static inline u32 trim_sys_gpcpll_ndiv_slowdown_en_dynramp_no_f(void)
472{
473 return 0x0U;
474}
475static inline u32 trim_gpc_bcast_gpcpll_ndiv_slowdown_debug_r(void)
476{
477 return 0x001328a0U;
478}
479static inline u32 trim_gpc_bcast_gpcpll_ndiv_slowdown_debug_pll_dynramp_done_synced_v(u32 r)
480{
481 return (r >> 24U) & 0x1U;
482}
483static inline u32 trim_gpc_bcast_gpcpll_dvfs2_r(void)
484{
485 return 0x00132820U;
486}
487static inline u32 trim_sys_bypassctrl_r(void)
488{
489 return 0x00137340U;
490}
491static inline u32 trim_sys_bypassctrl_gpcpll_m(void)
492{
493 return 0x1U << 0U;
494}
495static inline u32 trim_sys_bypassctrl_gpcpll_bypassclk_f(void)
496{
497 return 0x1U;
498}
499static inline u32 trim_sys_bypassctrl_gpcpll_vco_f(void)
500{
501 return 0x0U;
502}
503#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_bus_gp106.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_bus_gp106.h
new file mode 100644
index 00000000..ce3aafd6
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_bus_gp106.h
@@ -0,0 +1,223 @@
1/*
2 * Copyright (c) 2016-2017, 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_bus_gp106_h_
57#define _hw_bus_gp106_h_
58
59static inline u32 bus_bar0_window_r(void)
60{
61 return 0x00001700U;
62}
63static inline u32 bus_bar0_window_base_f(u32 v)
64{
65 return (v & 0xffffffU) << 0U;
66}
67static inline u32 bus_bar0_window_target_vid_mem_f(void)
68{
69 return 0x0U;
70}
71static inline u32 bus_bar0_window_target_sys_mem_coherent_f(void)
72{
73 return 0x2000000U;
74}
75static inline u32 bus_bar0_window_target_sys_mem_noncoherent_f(void)
76{
77 return 0x3000000U;
78}
79static inline u32 bus_bar0_window_target_bar0_window_base_shift_v(void)
80{
81 return 0x00000010U;
82}
83static inline u32 bus_bar1_block_r(void)
84{
85 return 0x00001704U;
86}
87static inline u32 bus_bar1_block_ptr_f(u32 v)
88{
89 return (v & 0xfffffffU) << 0U;
90}
91static inline u32 bus_bar1_block_target_vid_mem_f(void)
92{
93 return 0x0U;
94}
95static inline u32 bus_bar1_block_target_sys_mem_coh_f(void)
96{
97 return 0x20000000U;
98}
99static inline u32 bus_bar1_block_target_sys_mem_ncoh_f(void)
100{
101 return 0x30000000U;
102}
103static inline u32 bus_bar1_block_mode_virtual_f(void)
104{
105 return 0x80000000U;
106}
107static inline u32 bus_bar2_block_r(void)
108{
109 return 0x00001714U;
110}
111static inline u32 bus_bar2_block_ptr_f(u32 v)
112{
113 return (v & 0xfffffffU) << 0U;
114}
115static inline u32 bus_bar2_block_target_vid_mem_f(void)
116{
117 return 0x0U;
118}
119static inline u32 bus_bar2_block_target_sys_mem_coh_f(void)
120{
121 return 0x20000000U;
122}
123static inline u32 bus_bar2_block_target_sys_mem_ncoh_f(void)
124{
125 return 0x30000000U;
126}
127static inline u32 bus_bar2_block_mode_virtual_f(void)
128{
129 return 0x80000000U;
130}
131static inline u32 bus_bar1_block_ptr_shift_v(void)
132{
133 return 0x0000000cU;
134}
135static inline u32 bus_bar2_block_ptr_shift_v(void)
136{
137 return 0x0000000cU;
138}
139static inline u32 bus_bind_status_r(void)
140{
141 return 0x00001710U;
142}
143static inline u32 bus_bind_status_bar1_pending_v(u32 r)
144{
145 return (r >> 0U) & 0x1U;
146}
147static inline u32 bus_bind_status_bar1_pending_empty_f(void)
148{
149 return 0x0U;
150}
151static inline u32 bus_bind_status_bar1_pending_busy_f(void)
152{
153 return 0x1U;
154}
155static inline u32 bus_bind_status_bar1_outstanding_v(u32 r)
156{
157 return (r >> 1U) & 0x1U;
158}
159static inline u32 bus_bind_status_bar1_outstanding_false_f(void)
160{
161 return 0x0U;
162}
163static inline u32 bus_bind_status_bar1_outstanding_true_f(void)
164{
165 return 0x2U;
166}
167static inline u32 bus_bind_status_bar2_pending_v(u32 r)
168{
169 return (r >> 2U) & 0x1U;
170}
171static inline u32 bus_bind_status_bar2_pending_empty_f(void)
172{
173 return 0x0U;
174}
175static inline u32 bus_bind_status_bar2_pending_busy_f(void)
176{
177 return 0x4U;
178}
179static inline u32 bus_bind_status_bar2_outstanding_v(u32 r)
180{
181 return (r >> 3U) & 0x1U;
182}
183static inline u32 bus_bind_status_bar2_outstanding_false_f(void)
184{
185 return 0x0U;
186}
187static inline u32 bus_bind_status_bar2_outstanding_true_f(void)
188{
189 return 0x8U;
190}
191static inline u32 bus_intr_0_r(void)
192{
193 return 0x00001100U;
194}
195static inline u32 bus_intr_0_pri_squash_m(void)
196{
197 return 0x1U << 1U;
198}
199static inline u32 bus_intr_0_pri_fecserr_m(void)
200{
201 return 0x1U << 2U;
202}
203static inline u32 bus_intr_0_pri_timeout_m(void)
204{
205 return 0x1U << 3U;
206}
207static inline u32 bus_intr_en_0_r(void)
208{
209 return 0x00001140U;
210}
211static inline u32 bus_intr_en_0_pri_squash_m(void)
212{
213 return 0x1U << 1U;
214}
215static inline u32 bus_intr_en_0_pri_fecserr_m(void)
216{
217 return 0x1U << 2U;
218}
219static inline u32 bus_intr_en_0_pri_timeout_m(void)
220{
221 return 0x1U << 3U;
222}
223#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_ccsr_gp106.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_ccsr_gp106.h
new file mode 100644
index 00000000..cd637776
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_ccsr_gp106.h
@@ -0,0 +1,163 @@
1/*
2 * Copyright (c) 2016-2017, 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_ccsr_gp106_h_
57#define _hw_ccsr_gp106_h_
58
59static inline u32 ccsr_channel_inst_r(u32 i)
60{
61 return 0x00800000U + i*8U;
62}
63static inline u32 ccsr_channel_inst__size_1_v(void)
64{
65 return 0x00001000U;
66}
67static inline u32 ccsr_channel_inst_ptr_f(u32 v)
68{
69 return (v & 0xfffffffU) << 0U;
70}
71static inline u32 ccsr_channel_inst_target_vid_mem_f(void)
72{
73 return 0x0U;
74}
75static inline u32 ccsr_channel_inst_target_sys_mem_coh_f(void)
76{
77 return 0x20000000U;
78}
79static inline u32 ccsr_channel_inst_target_sys_mem_ncoh_f(void)
80{
81 return 0x30000000U;
82}
83static inline u32 ccsr_channel_inst_bind_false_f(void)
84{
85 return 0x0U;
86}
87static inline u32 ccsr_channel_inst_bind_true_f(void)
88{
89 return 0x80000000U;
90}
91static inline u32 ccsr_channel_r(u32 i)
92{
93 return 0x00800004U + i*8U;
94}
95static inline u32 ccsr_channel__size_1_v(void)
96{
97 return 0x00001000U;
98}
99static inline u32 ccsr_channel_enable_v(u32 r)
100{
101 return (r >> 0U) & 0x1U;
102}
103static inline u32 ccsr_channel_enable_set_f(u32 v)
104{
105 return (v & 0x1U) << 10U;
106}
107static inline u32 ccsr_channel_enable_set_true_f(void)
108{
109 return 0x400U;
110}
111static inline u32 ccsr_channel_enable_clr_true_f(void)
112{
113 return 0x800U;
114}
115static inline u32 ccsr_channel_status_v(u32 r)
116{
117 return (r >> 24U) & 0xfU;
118}
119static inline u32 ccsr_channel_status_pending_ctx_reload_v(void)
120{
121 return 0x00000002U;
122}
123static inline u32 ccsr_channel_status_pending_acq_ctx_reload_v(void)
124{
125 return 0x00000004U;
126}
127static inline u32 ccsr_channel_status_on_pbdma_ctx_reload_v(void)
128{
129 return 0x0000000aU;
130}
131static inline u32 ccsr_channel_status_on_pbdma_and_eng_ctx_reload_v(void)
132{
133 return 0x0000000bU;
134}
135static inline u32 ccsr_channel_status_on_eng_ctx_reload_v(void)
136{
137 return 0x0000000cU;
138}
139static inline u32 ccsr_channel_status_on_eng_pending_ctx_reload_v(void)
140{
141 return 0x0000000dU;
142}
143static inline u32 ccsr_channel_status_on_eng_pending_acq_ctx_reload_v(void)
144{
145 return 0x0000000eU;
146}
147static inline u32 ccsr_channel_next_v(u32 r)
148{
149 return (r >> 1U) & 0x1U;
150}
151static inline u32 ccsr_channel_next_true_v(void)
152{
153 return 0x00000001U;
154}
155static inline u32 ccsr_channel_force_ctx_reload_true_f(void)
156{
157 return 0x100U;
158}
159static inline u32 ccsr_channel_busy_v(u32 r)
160{
161 return (r >> 28U) & 0x1U;
162}
163#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_ce_gp106.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_ce_gp106.h
new file mode 100644
index 00000000..8892f42f
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_ce_gp106.h
@@ -0,0 +1,87 @@
1/*
2 * Copyright (c) 2016-2017, 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_ce_gp106_h_
57#define _hw_ce_gp106_h_
58
59static inline u32 ce_intr_status_r(u32 i)
60{
61 return 0x00104410U + i*128U;
62}
63static inline u32 ce_intr_status_blockpipe_pending_f(void)
64{
65 return 0x1U;
66}
67static inline u32 ce_intr_status_blockpipe_reset_f(void)
68{
69 return 0x1U;
70}
71static inline u32 ce_intr_status_nonblockpipe_pending_f(void)
72{
73 return 0x2U;
74}
75static inline u32 ce_intr_status_nonblockpipe_reset_f(void)
76{
77 return 0x2U;
78}
79static inline u32 ce_intr_status_launcherr_pending_f(void)
80{
81 return 0x4U;
82}
83static inline u32 ce_intr_status_launcherr_reset_f(void)
84{
85 return 0x4U;
86}
87#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_ctxsw_prog_gp106.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_ctxsw_prog_gp106.h
new file mode 100644
index 00000000..3387d236
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_ctxsw_prog_gp106.h
@@ -0,0 +1,295 @@
1/*
2 * Copyright (c) 2016-2017, 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_ctxsw_prog_gp106_h_
57#define _hw_ctxsw_prog_gp106_h_
58
59static inline u32 ctxsw_prog_fecs_header_v(void)
60{
61 return 0x00000100U;
62}
63static inline u32 ctxsw_prog_main_image_num_gpcs_o(void)
64{
65 return 0x00000008U;
66}
67static inline u32 ctxsw_prog_main_image_patch_count_o(void)
68{
69 return 0x00000010U;
70}
71static inline u32 ctxsw_prog_main_image_patch_adr_lo_o(void)
72{
73 return 0x00000014U;
74}
75static inline u32 ctxsw_prog_main_image_patch_adr_hi_o(void)
76{
77 return 0x00000018U;
78}
79static inline u32 ctxsw_prog_main_image_zcull_o(void)
80{
81 return 0x0000001cU;
82}
83static inline u32 ctxsw_prog_main_image_zcull_mode_no_ctxsw_v(void)
84{
85 return 0x00000001U;
86}
87static inline u32 ctxsw_prog_main_image_zcull_mode_separate_buffer_v(void)
88{
89 return 0x00000002U;
90}
91static inline u32 ctxsw_prog_main_image_zcull_ptr_o(void)
92{
93 return 0x00000020U;
94}
95static inline u32 ctxsw_prog_main_image_pm_o(void)
96{
97 return 0x00000028U;
98}
99static inline u32 ctxsw_prog_main_image_pm_mode_m(void)
100{
101 return 0x7U << 0U;
102}
103static inline u32 ctxsw_prog_main_image_pm_mode_no_ctxsw_f(void)
104{
105 return 0x0U;
106}
107static inline u32 ctxsw_prog_main_image_pm_smpc_mode_m(void)
108{
109 return 0x7U << 3U;
110}
111static inline u32 ctxsw_prog_main_image_pm_smpc_mode_ctxsw_f(void)
112{
113 return 0x8U;
114}
115static inline u32 ctxsw_prog_main_image_pm_smpc_mode_no_ctxsw_f(void)
116{
117 return 0x0U;
118}
119static inline u32 ctxsw_prog_main_image_pm_ptr_o(void)
120{
121 return 0x0000002cU;
122}
123static inline u32 ctxsw_prog_main_image_num_save_ops_o(void)
124{
125 return 0x000000f4U;
126}
127static inline u32 ctxsw_prog_main_image_num_wfi_save_ops_o(void)
128{
129 return 0x000000d0U;
130}
131static inline u32 ctxsw_prog_main_image_num_cta_save_ops_o(void)
132{
133 return 0x000000d4U;
134}
135static inline u32 ctxsw_prog_main_image_num_gfxp_save_ops_o(void)
136{
137 return 0x000000d8U;
138}
139static inline u32 ctxsw_prog_main_image_num_cilp_save_ops_o(void)
140{
141 return 0x000000dcU;
142}
143static inline u32 ctxsw_prog_main_image_num_restore_ops_o(void)
144{
145 return 0x000000f8U;
146}
147static inline u32 ctxsw_prog_main_image_magic_value_o(void)
148{
149 return 0x000000fcU;
150}
151static inline u32 ctxsw_prog_main_image_magic_value_v_value_v(void)
152{
153 return 0x600dc0deU;
154}
155static inline u32 ctxsw_prog_local_priv_register_ctl_o(void)
156{
157 return 0x0000000cU;
158}
159static inline u32 ctxsw_prog_local_priv_register_ctl_offset_v(u32 r)
160{
161 return (r >> 0U) & 0xffffU;
162}
163static inline u32 ctxsw_prog_local_image_ppc_info_o(void)
164{
165 return 0x000000f4U;
166}
167static inline u32 ctxsw_prog_local_image_ppc_info_num_ppcs_v(u32 r)
168{
169 return (r >> 0U) & 0xffffU;
170}
171static inline u32 ctxsw_prog_local_image_ppc_info_ppc_mask_v(u32 r)
172{
173 return (r >> 16U) & 0xffffU;
174}
175static inline u32 ctxsw_prog_local_image_num_tpcs_o(void)
176{
177 return 0x000000f8U;
178}
179static inline u32 ctxsw_prog_local_magic_value_o(void)
180{
181 return 0x000000fcU;
182}
183static inline u32 ctxsw_prog_local_magic_value_v_value_v(void)
184{
185 return 0xad0becabU;
186}
187static inline u32 ctxsw_prog_main_extended_buffer_ctl_o(void)
188{
189 return 0x000000ecU;
190}
191static inline u32 ctxsw_prog_main_extended_buffer_ctl_offset_v(u32 r)
192{
193 return (r >> 0U) & 0xffffU;
194}
195static inline u32 ctxsw_prog_main_extended_buffer_ctl_size_v(u32 r)
196{
197 return (r >> 16U) & 0xffU;
198}
199static inline u32 ctxsw_prog_extended_buffer_segments_size_in_bytes_v(void)
200{
201 return 0x00000100U;
202}
203static inline u32 ctxsw_prog_extended_marker_size_in_bytes_v(void)
204{
205 return 0x00000004U;
206}
207static inline u32 ctxsw_prog_extended_sm_dsm_perf_counter_register_stride_v(void)
208{
209 return 0x00000000U;
210}
211static inline u32 ctxsw_prog_extended_sm_dsm_perf_counter_control_register_stride_v(void)
212{
213 return 0x00000002U;
214}
215static inline u32 ctxsw_prog_main_image_priv_access_map_config_o(void)
216{
217 return 0x000000a0U;
218}
219static inline u32 ctxsw_prog_main_image_priv_access_map_config_mode_s(void)
220{
221 return 2U;
222}
223static inline u32 ctxsw_prog_main_image_priv_access_map_config_mode_f(u32 v)
224{
225 return (v & 0x3U) << 0U;
226}
227static inline u32 ctxsw_prog_main_image_priv_access_map_config_mode_m(void)
228{
229 return 0x3U << 0U;
230}
231static inline u32 ctxsw_prog_main_image_priv_access_map_config_mode_v(u32 r)
232{
233 return (r >> 0U) & 0x3U;
234}
235static inline u32 ctxsw_prog_main_image_priv_access_map_config_mode_allow_all_f(void)
236{
237 return 0x0U;
238}
239static inline u32 ctxsw_prog_main_image_priv_access_map_config_mode_use_map_f(void)
240{
241 return 0x2U;
242}
243static inline u32 ctxsw_prog_main_image_priv_access_map_addr_lo_o(void)
244{
245 return 0x000000a4U;
246}
247static inline u32 ctxsw_prog_main_image_priv_access_map_addr_hi_o(void)
248{
249 return 0x000000a8U;
250}
251static inline u32 ctxsw_prog_main_image_misc_options_o(void)
252{
253 return 0x0000003cU;
254}
255static inline u32 ctxsw_prog_main_image_misc_options_verif_features_m(void)
256{
257 return 0x1U << 3U;
258}
259static inline u32 ctxsw_prog_main_image_misc_options_verif_features_disabled_f(void)
260{
261 return 0x0U;
262}
263static inline u32 ctxsw_prog_main_image_graphics_preemption_options_o(void)
264{
265 return 0x00000080U;
266}
267static inline u32 ctxsw_prog_main_image_graphics_preemption_options_control_f(u32 v)
268{
269 return (v & 0x3U) << 0U;
270}
271static inline u32 ctxsw_prog_main_image_graphics_preemption_options_control_gfxp_f(void)
272{
273 return 0x1U;
274}
275static inline u32 ctxsw_prog_main_image_full_preemption_ptr_o(void)
276{
277 return 0x00000068U;
278}
279static inline u32 ctxsw_prog_main_image_compute_preemption_options_o(void)
280{
281 return 0x00000084U;
282}
283static inline u32 ctxsw_prog_main_image_compute_preemption_options_control_f(u32 v)
284{
285 return (v & 0x3U) << 0U;
286}
287static inline u32 ctxsw_prog_main_image_compute_preemption_options_control_cta_f(void)
288{
289 return 0x1U;
290}
291static inline u32 ctxsw_prog_main_image_compute_preemption_options_control_cilp_f(void)
292{
293 return 0x2U;
294}
295#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_falcon_gp106.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_falcon_gp106.h
new file mode 100644
index 00000000..6740b2a6
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_falcon_gp106.h
@@ -0,0 +1,599 @@
1/*
2 * Copyright (c) 2017, 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_falcon_gp106_h_
57#define _hw_falcon_gp106_h_
58
59static inline u32 falcon_falcon_irqsset_r(void)
60{
61 return 0x00000000U;
62}
63static inline u32 falcon_falcon_irqsset_swgen0_set_f(void)
64{
65 return 0x40U;
66}
67static inline u32 falcon_falcon_irqsclr_r(void)
68{
69 return 0x00000004U;
70}
71static inline u32 falcon_falcon_irqstat_r(void)
72{
73 return 0x00000008U;
74}
75static inline u32 falcon_falcon_irqstat_halt_true_f(void)
76{
77 return 0x10U;
78}
79static inline u32 falcon_falcon_irqstat_exterr_true_f(void)
80{
81 return 0x20U;
82}
83static inline u32 falcon_falcon_irqstat_swgen0_true_f(void)
84{
85 return 0x40U;
86}
87static inline u32 falcon_falcon_irqmode_r(void)
88{
89 return 0x0000000cU;
90}
91static inline u32 falcon_falcon_irqmset_r(void)
92{
93 return 0x00000010U;
94}
95static inline u32 falcon_falcon_irqmset_gptmr_f(u32 v)
96{
97 return (v & 0x1U) << 0U;
98}
99static inline u32 falcon_falcon_irqmset_wdtmr_f(u32 v)
100{
101 return (v & 0x1U) << 1U;
102}
103static inline u32 falcon_falcon_irqmset_mthd_f(u32 v)
104{
105 return (v & 0x1U) << 2U;
106}
107static inline u32 falcon_falcon_irqmset_ctxsw_f(u32 v)
108{
109 return (v & 0x1U) << 3U;
110}
111static inline u32 falcon_falcon_irqmset_halt_f(u32 v)
112{
113 return (v & 0x1U) << 4U;
114}
115static inline u32 falcon_falcon_irqmset_exterr_f(u32 v)
116{
117 return (v & 0x1U) << 5U;
118}
119static inline u32 falcon_falcon_irqmset_swgen0_f(u32 v)
120{
121 return (v & 0x1U) << 6U;
122}
123static inline u32 falcon_falcon_irqmset_swgen1_f(u32 v)
124{
125 return (v & 0x1U) << 7U;
126}
127static inline u32 falcon_falcon_irqmclr_r(void)
128{
129 return 0x00000014U;
130}
131static inline u32 falcon_falcon_irqmclr_gptmr_f(u32 v)
132{
133 return (v & 0x1U) << 0U;
134}
135static inline u32 falcon_falcon_irqmclr_wdtmr_f(u32 v)
136{
137 return (v & 0x1U) << 1U;
138}
139static inline u32 falcon_falcon_irqmclr_mthd_f(u32 v)
140{
141 return (v & 0x1U) << 2U;
142}
143static inline u32 falcon_falcon_irqmclr_ctxsw_f(u32 v)
144{
145 return (v & 0x1U) << 3U;
146}
147static inline u32 falcon_falcon_irqmclr_halt_f(u32 v)
148{
149 return (v & 0x1U) << 4U;
150}
151static inline u32 falcon_falcon_irqmclr_exterr_f(u32 v)
152{
153 return (v & 0x1U) << 5U;
154}
155static inline u32 falcon_falcon_irqmclr_swgen0_f(u32 v)
156{
157 return (v & 0x1U) << 6U;
158}
159static inline u32 falcon_falcon_irqmclr_swgen1_f(u32 v)
160{
161 return (v & 0x1U) << 7U;
162}
163static inline u32 falcon_falcon_irqmclr_ext_f(u32 v)
164{
165 return (v & 0xffU) << 8U;
166}
167static inline u32 falcon_falcon_irqmask_r(void)
168{
169 return 0x00000018U;
170}
171static inline u32 falcon_falcon_irqdest_r(void)
172{
173 return 0x0000001cU;
174}
175static inline u32 falcon_falcon_irqdest_host_gptmr_f(u32 v)
176{
177 return (v & 0x1U) << 0U;
178}
179static inline u32 falcon_falcon_irqdest_host_wdtmr_f(u32 v)
180{
181 return (v & 0x1U) << 1U;
182}
183static inline u32 falcon_falcon_irqdest_host_mthd_f(u32 v)
184{
185 return (v & 0x1U) << 2U;
186}
187static inline u32 falcon_falcon_irqdest_host_ctxsw_f(u32 v)
188{
189 return (v & 0x1U) << 3U;
190}
191static inline u32 falcon_falcon_irqdest_host_halt_f(u32 v)
192{
193 return (v & 0x1U) << 4U;
194}
195static inline u32 falcon_falcon_irqdest_host_exterr_f(u32 v)
196{
197 return (v & 0x1U) << 5U;
198}
199static inline u32 falcon_falcon_irqdest_host_swgen0_f(u32 v)
200{
201 return (v & 0x1U) << 6U;
202}
203static inline u32 falcon_falcon_irqdest_host_swgen1_f(u32 v)
204{
205 return (v & 0x1U) << 7U;
206}
207static inline u32 falcon_falcon_irqdest_host_ext_f(u32 v)
208{
209 return (v & 0xffU) << 8U;
210}
211static inline u32 falcon_falcon_irqdest_target_gptmr_f(u32 v)
212{
213 return (v & 0x1U) << 16U;
214}
215static inline u32 falcon_falcon_irqdest_target_wdtmr_f(u32 v)
216{
217 return (v & 0x1U) << 17U;
218}
219static inline u32 falcon_falcon_irqdest_target_mthd_f(u32 v)
220{
221 return (v & 0x1U) << 18U;
222}
223static inline u32 falcon_falcon_irqdest_target_ctxsw_f(u32 v)
224{
225 return (v & 0x1U) << 19U;
226}
227static inline u32 falcon_falcon_irqdest_target_halt_f(u32 v)
228{
229 return (v & 0x1U) << 20U;
230}
231static inline u32 falcon_falcon_irqdest_target_exterr_f(u32 v)
232{
233 return (v & 0x1U) << 21U;
234}
235static inline u32 falcon_falcon_irqdest_target_swgen0_f(u32 v)
236{
237 return (v & 0x1U) << 22U;
238}
239static inline u32 falcon_falcon_irqdest_target_swgen1_f(u32 v)
240{
241 return (v & 0x1U) << 23U;
242}
243static inline u32 falcon_falcon_irqdest_target_ext_f(u32 v)
244{
245 return (v & 0xffU) << 24U;
246}
247static inline u32 falcon_falcon_curctx_r(void)
248{
249 return 0x00000050U;
250}
251static inline u32 falcon_falcon_nxtctx_r(void)
252{
253 return 0x00000054U;
254}
255static inline u32 falcon_falcon_mailbox0_r(void)
256{
257 return 0x00000040U;
258}
259static inline u32 falcon_falcon_mailbox1_r(void)
260{
261 return 0x00000044U;
262}
263static inline u32 falcon_falcon_itfen_r(void)
264{
265 return 0x00000048U;
266}
267static inline u32 falcon_falcon_itfen_ctxen_enable_f(void)
268{
269 return 0x1U;
270}
271static inline u32 falcon_falcon_idlestate_r(void)
272{
273 return 0x0000004cU;
274}
275static inline u32 falcon_falcon_idlestate_falcon_busy_v(u32 r)
276{
277 return (r >> 0U) & 0x1U;
278}
279static inline u32 falcon_falcon_idlestate_ext_busy_v(u32 r)
280{
281 return (r >> 1U) & 0x7fffU;
282}
283static inline u32 falcon_falcon_os_r(void)
284{
285 return 0x00000080U;
286}
287static inline u32 falcon_falcon_engctl_r(void)
288{
289 return 0x000000a4U;
290}
291static inline u32 falcon_falcon_cpuctl_r(void)
292{
293 return 0x00000100U;
294}
295static inline u32 falcon_falcon_cpuctl_startcpu_f(u32 v)
296{
297 return (v & 0x1U) << 1U;
298}
299static inline u32 falcon_falcon_cpuctl_sreset_f(u32 v)
300{
301 return (v & 0x1U) << 2U;
302}
303static inline u32 falcon_falcon_cpuctl_hreset_f(u32 v)
304{
305 return (v & 0x1U) << 3U;
306}
307static inline u32 falcon_falcon_cpuctl_halt_intr_f(u32 v)
308{
309 return (v & 0x1U) << 4U;
310}
311static inline u32 falcon_falcon_cpuctl_halt_intr_m(void)
312{
313 return 0x1U << 4U;
314}
315static inline u32 falcon_falcon_cpuctl_halt_intr_v(u32 r)
316{
317 return (r >> 4U) & 0x1U;
318}
319static inline u32 falcon_falcon_cpuctl_stopped_m(void)
320{
321 return 0x1U << 5U;
322}
323static inline u32 falcon_falcon_cpuctl_cpuctl_alias_en_f(u32 v)
324{
325 return (v & 0x1U) << 6U;
326}
327static inline u32 falcon_falcon_cpuctl_cpuctl_alias_en_m(void)
328{
329 return 0x1U << 6U;
330}
331static inline u32 falcon_falcon_cpuctl_cpuctl_alias_en_v(u32 r)
332{
333 return (r >> 6U) & 0x1U;
334}
335static inline u32 falcon_falcon_cpuctl_alias_r(void)
336{
337 return 0x00000130U;
338}
339static inline u32 falcon_falcon_cpuctl_alias_startcpu_f(u32 v)
340{
341 return (v & 0x1U) << 1U;
342}
343static inline u32 falcon_falcon_imemc_r(u32 i)
344{
345 return 0x00000180U + i*16U;
346}
347static inline u32 falcon_falcon_imemc_offs_f(u32 v)
348{
349 return (v & 0x3fU) << 2U;
350}
351static inline u32 falcon_falcon_imemc_blk_f(u32 v)
352{
353 return (v & 0xffU) << 8U;
354}
355static inline u32 falcon_falcon_imemc_aincw_f(u32 v)
356{
357 return (v & 0x1U) << 24U;
358}
359static inline u32 falcon_falcon_imemd_r(u32 i)
360{
361 return 0x00000184U + i*16U;
362}
363static inline u32 falcon_falcon_imemt_r(u32 i)
364{
365 return 0x00000188U + i*16U;
366}
367static inline u32 falcon_falcon_sctl_r(void)
368{
369 return 0x00000240U;
370}
371static inline u32 falcon_falcon_mmu_phys_sec_r(void)
372{
373 return 0x00100ce4U;
374}
375static inline u32 falcon_falcon_bootvec_r(void)
376{
377 return 0x00000104U;
378}
379static inline u32 falcon_falcon_bootvec_vec_f(u32 v)
380{
381 return (v & 0xffffffffU) << 0U;
382}
383static inline u32 falcon_falcon_dmactl_r(void)
384{
385 return 0x0000010cU;
386}
387static inline u32 falcon_falcon_dmactl_dmem_scrubbing_m(void)
388{
389 return 0x1U << 1U;
390}
391static inline u32 falcon_falcon_dmactl_imem_scrubbing_m(void)
392{
393 return 0x1U << 2U;
394}
395static inline u32 falcon_falcon_dmactl_require_ctx_f(u32 v)
396{
397 return (v & 0x1U) << 0U;
398}
399static inline u32 falcon_falcon_hwcfg_r(void)
400{
401 return 0x00000108U;
402}
403static inline u32 falcon_falcon_hwcfg_imem_size_v(u32 r)
404{
405 return (r >> 0U) & 0x1ffU;
406}
407static inline u32 falcon_falcon_hwcfg_dmem_size_v(u32 r)
408{
409 return (r >> 9U) & 0x1ffU;
410}
411static inline u32 falcon_falcon_dmatrfbase_r(void)
412{
413 return 0x00000110U;
414}
415static inline u32 falcon_falcon_dmatrfbase1_r(void)
416{
417 return 0x00000128U;
418}
419static inline u32 falcon_falcon_dmatrfmoffs_r(void)
420{
421 return 0x00000114U;
422}
423static inline u32 falcon_falcon_dmatrfcmd_r(void)
424{
425 return 0x00000118U;
426}
427static inline u32 falcon_falcon_dmatrfcmd_imem_f(u32 v)
428{
429 return (v & 0x1U) << 4U;
430}
431static inline u32 falcon_falcon_dmatrfcmd_write_f(u32 v)
432{
433 return (v & 0x1U) << 5U;
434}
435static inline u32 falcon_falcon_dmatrfcmd_size_f(u32 v)
436{
437 return (v & 0x7U) << 8U;
438}
439static inline u32 falcon_falcon_dmatrfcmd_ctxdma_f(u32 v)
440{
441 return (v & 0x7U) << 12U;
442}
443static inline u32 falcon_falcon_dmatrffboffs_r(void)
444{
445 return 0x0000011cU;
446}
447static inline u32 falcon_falcon_imctl_debug_r(void)
448{
449 return 0x0000015cU;
450}
451static inline u32 falcon_falcon_imctl_debug_addr_blk_f(u32 v)
452{
453 return (v & 0xffffffU) << 0U;
454}
455static inline u32 falcon_falcon_imctl_debug_cmd_f(u32 v)
456{
457 return (v & 0x7U) << 24U;
458}
459static inline u32 falcon_falcon_imstat_r(void)
460{
461 return 0x00000144U;
462}
463static inline u32 falcon_falcon_traceidx_r(void)
464{
465 return 0x00000148U;
466}
467static inline u32 falcon_falcon_traceidx_maxidx_v(u32 r)
468{
469 return (r >> 16U) & 0xffU;
470}
471static inline u32 falcon_falcon_traceidx_idx_f(u32 v)
472{
473 return (v & 0xffU) << 0U;
474}
475static inline u32 falcon_falcon_tracepc_r(void)
476{
477 return 0x0000014cU;
478}
479static inline u32 falcon_falcon_tracepc_pc_v(u32 r)
480{
481 return (r >> 0U) & 0xffffffU;
482}
483static inline u32 falcon_falcon_exterraddr_r(void)
484{
485 return 0x00000168U;
486}
487static inline u32 falcon_falcon_exterrstat_r(void)
488{
489 return 0x0000016cU;
490}
491static inline u32 falcon_falcon_exterrstat_valid_m(void)
492{
493 return 0x1U << 31U;
494}
495static inline u32 falcon_falcon_exterrstat_valid_v(u32 r)
496{
497 return (r >> 31U) & 0x1U;
498}
499static inline u32 falcon_falcon_exterrstat_valid_true_v(void)
500{
501 return 0x00000001U;
502}
503static inline u32 falcon_falcon_icd_cmd_r(void)
504{
505 return 0x00000200U;
506}
507static inline u32 falcon_falcon_icd_cmd_opc_s(void)
508{
509 return 4U;
510}
511static inline u32 falcon_falcon_icd_cmd_opc_f(u32 v)
512{
513 return (v & 0xfU) << 0U;
514}
515static inline u32 falcon_falcon_icd_cmd_opc_m(void)
516{
517 return 0xfU << 0U;
518}
519static inline u32 falcon_falcon_icd_cmd_opc_v(u32 r)
520{
521 return (r >> 0U) & 0xfU;
522}
523static inline u32 falcon_falcon_icd_cmd_opc_rreg_f(void)
524{
525 return 0x8U;
526}
527static inline u32 falcon_falcon_icd_cmd_opc_rstat_f(void)
528{
529 return 0xeU;
530}
531static inline u32 falcon_falcon_icd_cmd_idx_f(u32 v)
532{
533 return (v & 0x1fU) << 8U;
534}
535static inline u32 falcon_falcon_icd_rdata_r(void)
536{
537 return 0x0000020cU;
538}
539static inline u32 falcon_falcon_dmemc_r(u32 i)
540{
541 return 0x000001c0U + i*8U;
542}
543static inline u32 falcon_falcon_dmemc_offs_f(u32 v)
544{
545 return (v & 0x3fU) << 2U;
546}
547static inline u32 falcon_falcon_dmemc_offs_m(void)
548{
549 return 0x3fU << 2U;
550}
551static inline u32 falcon_falcon_dmemc_blk_f(u32 v)
552{
553 return (v & 0xffU) << 8U;
554}
555static inline u32 falcon_falcon_dmemc_blk_m(void)
556{
557 return 0xffU << 8U;
558}
559static inline u32 falcon_falcon_dmemc_aincw_f(u32 v)
560{
561 return (v & 0x1U) << 24U;
562}
563static inline u32 falcon_falcon_dmemc_aincr_f(u32 v)
564{
565 return (v & 0x1U) << 25U;
566}
567static inline u32 falcon_falcon_dmemd_r(u32 i)
568{
569 return 0x000001c4U + i*8U;
570}
571static inline u32 falcon_falcon_debug1_r(void)
572{
573 return 0x00000090U;
574}
575static inline u32 falcon_falcon_debug1_ctxsw_mode_s(void)
576{
577 return 1U;
578}
579static inline u32 falcon_falcon_debug1_ctxsw_mode_f(u32 v)
580{
581 return (v & 0x1U) << 16U;
582}
583static inline u32 falcon_falcon_debug1_ctxsw_mode_m(void)
584{
585 return 0x1U << 16U;
586}
587static inline u32 falcon_falcon_debug1_ctxsw_mode_v(u32 r)
588{
589 return (r >> 16U) & 0x1U;
590}
591static inline u32 falcon_falcon_debug1_ctxsw_mode_init_f(void)
592{
593 return 0x0U;
594}
595static inline u32 falcon_falcon_debuginfo_r(void)
596{
597 return 0x00000094U;
598}
599#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_fb_gp106.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_fb_gp106.h
new file mode 100644
index 00000000..53288555
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_fb_gp106.h
@@ -0,0 +1,603 @@
1/*
2 * Copyright (c) 2016-2017, 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_fb_gp106_h_
57#define _hw_fb_gp106_h_
58
59static inline u32 fb_fbhub_num_active_ltcs_r(void)
60{
61 return 0x00100800U;
62}
63static inline u32 fb_mmu_ctrl_r(void)
64{
65 return 0x00100c80U;
66}
67static inline u32 fb_mmu_ctrl_vm_pg_size_f(u32 v)
68{
69 return (v & 0x1U) << 0U;
70}
71static inline u32 fb_mmu_ctrl_vm_pg_size_128kb_f(void)
72{
73 return 0x0U;
74}
75static inline u32 fb_mmu_ctrl_vm_pg_size_64kb_f(void)
76{
77 return 0x1U;
78}
79static inline u32 fb_mmu_ctrl_pri_fifo_empty_v(u32 r)
80{
81 return (r >> 15U) & 0x1U;
82}
83static inline u32 fb_mmu_ctrl_pri_fifo_empty_false_f(void)
84{
85 return 0x0U;
86}
87static inline u32 fb_mmu_ctrl_pri_fifo_space_v(u32 r)
88{
89 return (r >> 16U) & 0xffU;
90}
91static inline u32 fb_mmu_ctrl_use_pdb_big_page_size_v(u32 r)
92{
93 return (r >> 11U) & 0x1U;
94}
95static inline u32 fb_mmu_ctrl_use_pdb_big_page_size_true_f(void)
96{
97 return 0x800U;
98}
99static inline u32 fb_mmu_ctrl_use_pdb_big_page_size_false_f(void)
100{
101 return 0x0U;
102}
103static inline u32 fb_priv_mmu_phy_secure_r(void)
104{
105 return 0x00100ce4U;
106}
107static inline u32 fb_mmu_invalidate_pdb_r(void)
108{
109 return 0x00100cb8U;
110}
111static inline u32 fb_mmu_invalidate_pdb_aperture_vid_mem_f(void)
112{
113 return 0x0U;
114}
115static inline u32 fb_mmu_invalidate_pdb_aperture_sys_mem_f(void)
116{
117 return 0x2U;
118}
119static inline u32 fb_mmu_invalidate_pdb_addr_f(u32 v)
120{
121 return (v & 0xfffffffU) << 4U;
122}
123static inline u32 fb_mmu_invalidate_r(void)
124{
125 return 0x00100cbcU;
126}
127static inline u32 fb_mmu_invalidate_all_va_true_f(void)
128{
129 return 0x1U;
130}
131static inline u32 fb_mmu_invalidate_all_pdb_true_f(void)
132{
133 return 0x2U;
134}
135static inline u32 fb_mmu_invalidate_hubtlb_only_s(void)
136{
137 return 1U;
138}
139static inline u32 fb_mmu_invalidate_hubtlb_only_f(u32 v)
140{
141 return (v & 0x1U) << 2U;
142}
143static inline u32 fb_mmu_invalidate_hubtlb_only_m(void)
144{
145 return 0x1U << 2U;
146}
147static inline u32 fb_mmu_invalidate_hubtlb_only_v(u32 r)
148{
149 return (r >> 2U) & 0x1U;
150}
151static inline u32 fb_mmu_invalidate_hubtlb_only_true_f(void)
152{
153 return 0x4U;
154}
155static inline u32 fb_mmu_invalidate_replay_s(void)
156{
157 return 3U;
158}
159static inline u32 fb_mmu_invalidate_replay_f(u32 v)
160{
161 return (v & 0x7U) << 3U;
162}
163static inline u32 fb_mmu_invalidate_replay_m(void)
164{
165 return 0x7U << 3U;
166}
167static inline u32 fb_mmu_invalidate_replay_v(u32 r)
168{
169 return (r >> 3U) & 0x7U;
170}
171static inline u32 fb_mmu_invalidate_replay_none_f(void)
172{
173 return 0x0U;
174}
175static inline u32 fb_mmu_invalidate_replay_start_f(void)
176{
177 return 0x8U;
178}
179static inline u32 fb_mmu_invalidate_replay_start_ack_all_f(void)
180{
181 return 0x10U;
182}
183static inline u32 fb_mmu_invalidate_replay_cancel_targeted_f(void)
184{
185 return 0x18U;
186}
187static inline u32 fb_mmu_invalidate_replay_cancel_global_f(void)
188{
189 return 0x20U;
190}
191static inline u32 fb_mmu_invalidate_replay_cancel_f(void)
192{
193 return 0x20U;
194}
195static inline u32 fb_mmu_invalidate_sys_membar_s(void)
196{
197 return 1U;
198}
199static inline u32 fb_mmu_invalidate_sys_membar_f(u32 v)
200{
201 return (v & 0x1U) << 6U;
202}
203static inline u32 fb_mmu_invalidate_sys_membar_m(void)
204{
205 return 0x1U << 6U;
206}
207static inline u32 fb_mmu_invalidate_sys_membar_v(u32 r)
208{
209 return (r >> 6U) & 0x1U;
210}
211static inline u32 fb_mmu_invalidate_sys_membar_true_f(void)
212{
213 return 0x40U;
214}
215static inline u32 fb_mmu_invalidate_ack_s(void)
216{
217 return 2U;
218}
219static inline u32 fb_mmu_invalidate_ack_f(u32 v)
220{
221 return (v & 0x3U) << 7U;
222}
223static inline u32 fb_mmu_invalidate_ack_m(void)
224{
225 return 0x3U << 7U;
226}
227static inline u32 fb_mmu_invalidate_ack_v(u32 r)
228{
229 return (r >> 7U) & 0x3U;
230}
231static inline u32 fb_mmu_invalidate_ack_ack_none_required_f(void)
232{
233 return 0x0U;
234}
235static inline u32 fb_mmu_invalidate_ack_ack_intranode_f(void)
236{
237 return 0x100U;
238}
239static inline u32 fb_mmu_invalidate_ack_ack_globally_f(void)
240{
241 return 0x80U;
242}
243static inline u32 fb_mmu_invalidate_cancel_client_id_s(void)
244{
245 return 6U;
246}
247static inline u32 fb_mmu_invalidate_cancel_client_id_f(u32 v)
248{
249 return (v & 0x3fU) << 9U;
250}
251static inline u32 fb_mmu_invalidate_cancel_client_id_m(void)
252{
253 return 0x3fU << 9U;
254}
255static inline u32 fb_mmu_invalidate_cancel_client_id_v(u32 r)
256{
257 return (r >> 9U) & 0x3fU;
258}
259static inline u32 fb_mmu_invalidate_cancel_gpc_id_s(void)
260{
261 return 5U;
262}
263static inline u32 fb_mmu_invalidate_cancel_gpc_id_f(u32 v)
264{
265 return (v & 0x1fU) << 15U;
266}
267static inline u32 fb_mmu_invalidate_cancel_gpc_id_m(void)
268{
269 return 0x1fU << 15U;
270}
271static inline u32 fb_mmu_invalidate_cancel_gpc_id_v(u32 r)
272{
273 return (r >> 15U) & 0x1fU;
274}
275static inline u32 fb_mmu_invalidate_cancel_client_type_s(void)
276{
277 return 1U;
278}
279static inline u32 fb_mmu_invalidate_cancel_client_type_f(u32 v)
280{
281 return (v & 0x1U) << 20U;
282}
283static inline u32 fb_mmu_invalidate_cancel_client_type_m(void)
284{
285 return 0x1U << 20U;
286}
287static inline u32 fb_mmu_invalidate_cancel_client_type_v(u32 r)
288{
289 return (r >> 20U) & 0x1U;
290}
291static inline u32 fb_mmu_invalidate_cancel_client_type_gpc_f(void)
292{
293 return 0x0U;
294}
295static inline u32 fb_mmu_invalidate_cancel_client_type_hub_f(void)
296{
297 return 0x100000U;
298}
299static inline u32 fb_mmu_invalidate_cancel_cache_level_s(void)
300{
301 return 3U;
302}
303static inline u32 fb_mmu_invalidate_cancel_cache_level_f(u32 v)
304{
305 return (v & 0x7U) << 24U;
306}
307static inline u32 fb_mmu_invalidate_cancel_cache_level_m(void)
308{
309 return 0x7U << 24U;
310}
311static inline u32 fb_mmu_invalidate_cancel_cache_level_v(u32 r)
312{
313 return (r >> 24U) & 0x7U;
314}
315static inline u32 fb_mmu_invalidate_cancel_cache_level_all_f(void)
316{
317 return 0x0U;
318}
319static inline u32 fb_mmu_invalidate_cancel_cache_level_pte_only_f(void)
320{
321 return 0x1000000U;
322}
323static inline u32 fb_mmu_invalidate_cancel_cache_level_up_to_pde0_f(void)
324{
325 return 0x2000000U;
326}
327static inline u32 fb_mmu_invalidate_cancel_cache_level_up_to_pde1_f(void)
328{
329 return 0x3000000U;
330}
331static inline u32 fb_mmu_invalidate_cancel_cache_level_up_to_pde2_f(void)
332{
333 return 0x4000000U;
334}
335static inline u32 fb_mmu_invalidate_cancel_cache_level_up_to_pde3_f(void)
336{
337 return 0x5000000U;
338}
339static inline u32 fb_mmu_invalidate_cancel_cache_level_up_to_pde4_f(void)
340{
341 return 0x6000000U;
342}
343static inline u32 fb_mmu_invalidate_cancel_cache_level_up_to_pde5_f(void)
344{
345 return 0x7000000U;
346}
347static inline u32 fb_mmu_invalidate_trigger_s(void)
348{
349 return 1U;
350}
351static inline u32 fb_mmu_invalidate_trigger_f(u32 v)
352{
353 return (v & 0x1U) << 31U;
354}
355static inline u32 fb_mmu_invalidate_trigger_m(void)
356{
357 return 0x1U << 31U;
358}
359static inline u32 fb_mmu_invalidate_trigger_v(u32 r)
360{
361 return (r >> 31U) & 0x1U;
362}
363static inline u32 fb_mmu_invalidate_trigger_true_f(void)
364{
365 return 0x80000000U;
366}
367static inline u32 fb_mmu_debug_wr_r(void)
368{
369 return 0x00100cc8U;
370}
371static inline u32 fb_mmu_debug_wr_aperture_s(void)
372{
373 return 2U;
374}
375static inline u32 fb_mmu_debug_wr_aperture_f(u32 v)
376{
377 return (v & 0x3U) << 0U;
378}
379static inline u32 fb_mmu_debug_wr_aperture_m(void)
380{
381 return 0x3U << 0U;
382}
383static inline u32 fb_mmu_debug_wr_aperture_v(u32 r)
384{
385 return (r >> 0U) & 0x3U;
386}
387static inline u32 fb_mmu_debug_wr_aperture_vid_mem_f(void)
388{
389 return 0x0U;
390}
391static inline u32 fb_mmu_debug_wr_aperture_sys_mem_coh_f(void)
392{
393 return 0x2U;
394}
395static inline u32 fb_mmu_debug_wr_aperture_sys_mem_ncoh_f(void)
396{
397 return 0x3U;
398}
399static inline u32 fb_mmu_debug_wr_vol_false_f(void)
400{
401 return 0x0U;
402}
403static inline u32 fb_mmu_debug_wr_vol_true_v(void)
404{
405 return 0x00000001U;
406}
407static inline u32 fb_mmu_debug_wr_vol_true_f(void)
408{
409 return 0x4U;
410}
411static inline u32 fb_mmu_debug_wr_addr_f(u32 v)
412{
413 return (v & 0xfffffffU) << 4U;
414}
415static inline u32 fb_mmu_debug_wr_addr_alignment_v(void)
416{
417 return 0x0000000cU;
418}
419static inline u32 fb_mmu_debug_rd_r(void)
420{
421 return 0x00100cccU;
422}
423static inline u32 fb_mmu_debug_rd_aperture_vid_mem_f(void)
424{
425 return 0x0U;
426}
427static inline u32 fb_mmu_debug_rd_aperture_sys_mem_coh_f(void)
428{
429 return 0x2U;
430}
431static inline u32 fb_mmu_debug_rd_aperture_sys_mem_ncoh_f(void)
432{
433 return 0x3U;
434}
435static inline u32 fb_mmu_debug_rd_vol_false_f(void)
436{
437 return 0x0U;
438}
439static inline u32 fb_mmu_debug_rd_addr_f(u32 v)
440{
441 return (v & 0xfffffffU) << 4U;
442}
443static inline u32 fb_mmu_debug_rd_addr_alignment_v(void)
444{
445 return 0x0000000cU;
446}
447static inline u32 fb_mmu_debug_ctrl_r(void)
448{
449 return 0x00100cc4U;
450}
451static inline u32 fb_mmu_debug_ctrl_debug_v(u32 r)
452{
453 return (r >> 16U) & 0x1U;
454}
455static inline u32 fb_mmu_debug_ctrl_debug_m(void)
456{
457 return 0x1U << 16U;
458}
459static inline u32 fb_mmu_debug_ctrl_debug_enabled_v(void)
460{
461 return 0x00000001U;
462}
463static inline u32 fb_mmu_debug_ctrl_debug_enabled_f(void)
464{
465 return 0x10000U;
466}
467static inline u32 fb_mmu_debug_ctrl_debug_disabled_v(void)
468{
469 return 0x00000000U;
470}
471static inline u32 fb_mmu_debug_ctrl_debug_disabled_f(void)
472{
473 return 0x0U;
474}
475static inline u32 fb_mmu_vpr_info_r(void)
476{
477 return 0x00100cd0U;
478}
479static inline u32 fb_mmu_vpr_info_fetch_v(u32 r)
480{
481 return (r >> 2U) & 0x1U;
482}
483static inline u32 fb_mmu_vpr_info_fetch_false_v(void)
484{
485 return 0x00000000U;
486}
487static inline u32 fb_mmu_vpr_info_fetch_true_v(void)
488{
489 return 0x00000001U;
490}
491static inline u32 fb_mmu_priv_level_mask_r(void)
492{
493 return 0x00100cdcU;
494}
495static inline u32 fb_mmu_priv_level_mask_write_violation_m(void)
496{
497 return 0x1U << 7U;
498}
499static inline u32 fb_niso_flush_sysmem_addr_r(void)
500{
501 return 0x00100c10U;
502}
503static inline u32 fb_mmu_local_memory_range_r(void)
504{
505 return 0x00100ce0U;
506}
507static inline u32 fb_mmu_local_memory_range_lower_scale_v(u32 r)
508{
509 return (r >> 0U) & 0xfU;
510}
511static inline u32 fb_mmu_local_memory_range_lower_mag_v(u32 r)
512{
513 return (r >> 4U) & 0x3fU;
514}
515static inline u32 fb_mmu_local_memory_range_ecc_mode_v(u32 r)
516{
517 return (r >> 30U) & 0x1U;
518}
519static inline u32 fb_fbpa_fbio_delay_r(void)
520{
521 return 0x009a065cU;
522}
523static inline u32 fb_fbpa_fbio_delay_src_f(u32 v)
524{
525 return (v & 0xfU) << 0U;
526}
527static inline u32 fb_fbpa_fbio_delay_src_m(void)
528{
529 return 0xfU << 0U;
530}
531static inline u32 fb_fbpa_fbio_delay_src_v(u32 r)
532{
533 return (r >> 0U) & 0xfU;
534}
535static inline u32 fb_fbpa_fbio_delay_src_max_v(void)
536{
537 return 0x00000002U;
538}
539static inline u32 fb_fbpa_fbio_delay_priv_f(u32 v)
540{
541 return (v & 0xfU) << 4U;
542}
543static inline u32 fb_fbpa_fbio_delay_priv_m(void)
544{
545 return 0xfU << 4U;
546}
547static inline u32 fb_fbpa_fbio_delay_priv_v(u32 r)
548{
549 return (r >> 4U) & 0xfU;
550}
551static inline u32 fb_fbpa_fbio_delay_priv_max_v(void)
552{
553 return 0x00000002U;
554}
555static inline u32 fb_fbpa_fbio_cmd_delay_r(void)
556{
557 return 0x009a08e0U;
558}
559static inline u32 fb_fbpa_fbio_cmd_delay_cmd_src_f(u32 v)
560{
561 return (v & 0xfU) << 0U;
562}
563static inline u32 fb_fbpa_fbio_cmd_delay_cmd_src_m(void)
564{
565 return 0xfU << 0U;
566}
567static inline u32 fb_fbpa_fbio_cmd_delay_cmd_src_v(u32 r)
568{
569 return (r >> 0U) & 0xfU;
570}
571static inline u32 fb_fbpa_fbio_cmd_delay_cmd_src_max_v(void)
572{
573 return 0x00000001U;
574}
575static inline u32 fb_fbpa_fbio_cmd_delay_cmd_priv_f(u32 v)
576{
577 return (v & 0xfU) << 4U;
578}
579static inline u32 fb_fbpa_fbio_cmd_delay_cmd_priv_m(void)
580{
581 return 0xfU << 4U;
582}
583static inline u32 fb_fbpa_fbio_cmd_delay_cmd_priv_v(u32 r)
584{
585 return (r >> 4U) & 0xfU;
586}
587static inline u32 fb_fbpa_fbio_cmd_delay_cmd_priv_max_v(void)
588{
589 return 0x00000001U;
590}
591static inline u32 fb_niso_scrub_status_r(void)
592{
593 return 0x00100b20U;
594}
595static inline u32 fb_niso_scrub_status_flag_v(u32 r)
596{
597 return (r >> 0U) & 0x1U;
598}
599static inline u32 fb_fbpa_fbio_iref_byte_rx_ctrl_r(void)
600{
601 return 0x009a0eb0U;
602}
603#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_fbpa_gp106.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_fbpa_gp106.h
new file mode 100644
index 00000000..797a40c2
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_fbpa_gp106.h
@@ -0,0 +1,67 @@
1/*
2 * Copyright (c) 2016-2017, 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_fbpa_gp106_h_
57#define _hw_fbpa_gp106_h_
58
59static inline u32 fbpa_cstatus_r(void)
60{
61 return 0x009a020cU;
62}
63static inline u32 fbpa_cstatus_ramamount_v(u32 r)
64{
65 return (r >> 0U) & 0x1ffffU;
66}
67#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_fifo_gp106.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_fifo_gp106.h
new file mode 100644
index 00000000..804e9e4d
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_fifo_gp106.h
@@ -0,0 +1,695 @@
1/*
2 * Copyright (c) 2016-2017, 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_fifo_gp106_h_
57#define _hw_fifo_gp106_h_
58
59static inline u32 fifo_bar1_base_r(void)
60{
61 return 0x00002254U;
62}
63static inline u32 fifo_bar1_base_ptr_f(u32 v)
64{
65 return (v & 0xfffffffU) << 0U;
66}
67static inline u32 fifo_bar1_base_ptr_align_shift_v(void)
68{
69 return 0x0000000cU;
70}
71static inline u32 fifo_bar1_base_valid_false_f(void)
72{
73 return 0x0U;
74}
75static inline u32 fifo_bar1_base_valid_true_f(void)
76{
77 return 0x10000000U;
78}
79static inline u32 fifo_runlist_base_r(void)
80{
81 return 0x00002270U;
82}
83static inline u32 fifo_runlist_base_ptr_f(u32 v)
84{
85 return (v & 0xfffffffU) << 0U;
86}
87static inline u32 fifo_runlist_base_target_vid_mem_f(void)
88{
89 return 0x0U;
90}
91static inline u32 fifo_runlist_base_target_sys_mem_coh_f(void)
92{
93 return 0x20000000U;
94}
95static inline u32 fifo_runlist_base_target_sys_mem_ncoh_f(void)
96{
97 return 0x30000000U;
98}
99static inline u32 fifo_runlist_r(void)
100{
101 return 0x00002274U;
102}
103static inline u32 fifo_runlist_engine_f(u32 v)
104{
105 return (v & 0xfU) << 20U;
106}
107static inline u32 fifo_eng_runlist_base_r(u32 i)
108{
109 return 0x00002280U + i*8U;
110}
111static inline u32 fifo_eng_runlist_base__size_1_v(void)
112{
113 return 0x00000007U;
114}
115static inline u32 fifo_eng_runlist_r(u32 i)
116{
117 return 0x00002284U + i*8U;
118}
119static inline u32 fifo_eng_runlist__size_1_v(void)
120{
121 return 0x00000007U;
122}
123static inline u32 fifo_eng_runlist_length_f(u32 v)
124{
125 return (v & 0xffffU) << 0U;
126}
127static inline u32 fifo_eng_runlist_length_max_v(void)
128{
129 return 0x0000ffffU;
130}
131static inline u32 fifo_eng_runlist_pending_true_f(void)
132{
133 return 0x100000U;
134}
135static inline u32 fifo_pb_timeslice_r(u32 i)
136{
137 return 0x00002350U + i*4U;
138}
139static inline u32 fifo_pb_timeslice_timeout_16_f(void)
140{
141 return 0x10U;
142}
143static inline u32 fifo_pb_timeslice_timescale_0_f(void)
144{
145 return 0x0U;
146}
147static inline u32 fifo_pb_timeslice_enable_true_f(void)
148{
149 return 0x10000000U;
150}
151static inline u32 fifo_pbdma_map_r(u32 i)
152{
153 return 0x00002390U + i*4U;
154}
155static inline u32 fifo_intr_0_r(void)
156{
157 return 0x00002100U;
158}
159static inline u32 fifo_intr_0_bind_error_pending_f(void)
160{
161 return 0x1U;
162}
163static inline u32 fifo_intr_0_bind_error_reset_f(void)
164{
165 return 0x1U;
166}
167static inline u32 fifo_intr_0_sched_error_pending_f(void)
168{
169 return 0x100U;
170}
171static inline u32 fifo_intr_0_sched_error_reset_f(void)
172{
173 return 0x100U;
174}
175static inline u32 fifo_intr_0_chsw_error_pending_f(void)
176{
177 return 0x10000U;
178}
179static inline u32 fifo_intr_0_chsw_error_reset_f(void)
180{
181 return 0x10000U;
182}
183static inline u32 fifo_intr_0_fb_flush_timeout_pending_f(void)
184{
185 return 0x800000U;
186}
187static inline u32 fifo_intr_0_fb_flush_timeout_reset_f(void)
188{
189 return 0x800000U;
190}
191static inline u32 fifo_intr_0_lb_error_pending_f(void)
192{
193 return 0x1000000U;
194}
195static inline u32 fifo_intr_0_lb_error_reset_f(void)
196{
197 return 0x1000000U;
198}
199static inline u32 fifo_intr_0_replayable_fault_error_pending_f(void)
200{
201 return 0x2000000U;
202}
203static inline u32 fifo_intr_0_dropped_mmu_fault_pending_f(void)
204{
205 return 0x8000000U;
206}
207static inline u32 fifo_intr_0_dropped_mmu_fault_reset_f(void)
208{
209 return 0x8000000U;
210}
211static inline u32 fifo_intr_0_mmu_fault_pending_f(void)
212{
213 return 0x10000000U;
214}
215static inline u32 fifo_intr_0_pbdma_intr_pending_f(void)
216{
217 return 0x20000000U;
218}
219static inline u32 fifo_intr_0_runlist_event_pending_f(void)
220{
221 return 0x40000000U;
222}
223static inline u32 fifo_intr_0_channel_intr_pending_f(void)
224{
225 return 0x80000000U;
226}
227static inline u32 fifo_intr_en_0_r(void)
228{
229 return 0x00002140U;
230}
231static inline u32 fifo_intr_en_0_sched_error_f(u32 v)
232{
233 return (v & 0x1U) << 8U;
234}
235static inline u32 fifo_intr_en_0_sched_error_m(void)
236{
237 return 0x1U << 8U;
238}
239static inline u32 fifo_intr_en_0_mmu_fault_f(u32 v)
240{
241 return (v & 0x1U) << 28U;
242}
243static inline u32 fifo_intr_en_0_mmu_fault_m(void)
244{
245 return 0x1U << 28U;
246}
247static inline u32 fifo_intr_en_1_r(void)
248{
249 return 0x00002528U;
250}
251static inline u32 fifo_intr_bind_error_r(void)
252{
253 return 0x0000252cU;
254}
255static inline u32 fifo_intr_sched_error_r(void)
256{
257 return 0x0000254cU;
258}
259static inline u32 fifo_intr_sched_error_code_f(u32 v)
260{
261 return (v & 0xffU) << 0U;
262}
263static inline u32 fifo_intr_sched_error_code_ctxsw_timeout_v(void)
264{
265 return 0x0000000aU;
266}
267static inline u32 fifo_intr_chsw_error_r(void)
268{
269 return 0x0000256cU;
270}
271static inline u32 fifo_intr_mmu_fault_id_r(void)
272{
273 return 0x0000259cU;
274}
275static inline u32 fifo_intr_mmu_fault_eng_id_graphics_v(void)
276{
277 return 0x00000000U;
278}
279static inline u32 fifo_intr_mmu_fault_eng_id_graphics_f(void)
280{
281 return 0x0U;
282}
283static inline u32 fifo_intr_mmu_fault_inst_r(u32 i)
284{
285 return 0x00002800U + i*16U;
286}
287static inline u32 fifo_intr_mmu_fault_inst_ptr_v(u32 r)
288{
289 return (r >> 0U) & 0xfffffffU;
290}
291static inline u32 fifo_intr_mmu_fault_inst_ptr_align_shift_v(void)
292{
293 return 0x0000000cU;
294}
295static inline u32 fifo_intr_mmu_fault_lo_r(u32 i)
296{
297 return 0x00002804U + i*16U;
298}
299static inline u32 fifo_intr_mmu_fault_hi_r(u32 i)
300{
301 return 0x00002808U + i*16U;
302}
303static inline u32 fifo_intr_mmu_fault_info_r(u32 i)
304{
305 return 0x0000280cU + i*16U;
306}
307static inline u32 fifo_intr_mmu_fault_info_type_v(u32 r)
308{
309 return (r >> 0U) & 0x1fU;
310}
311static inline u32 fifo_intr_mmu_fault_info_client_type_v(u32 r)
312{
313 return (r >> 20U) & 0x1U;
314}
315static inline u32 fifo_intr_mmu_fault_info_client_type_gpc_v(void)
316{
317 return 0x00000000U;
318}
319static inline u32 fifo_intr_mmu_fault_info_client_type_hub_v(void)
320{
321 return 0x00000001U;
322}
323static inline u32 fifo_intr_mmu_fault_info_client_v(u32 r)
324{
325 return (r >> 8U) & 0x7fU;
326}
327static inline u32 fifo_intr_pbdma_id_r(void)
328{
329 return 0x000025a0U;
330}
331static inline u32 fifo_intr_pbdma_id_status_f(u32 v, u32 i)
332{
333 return (v & 0x1U) << (0U + i*1U);
334}
335static inline u32 fifo_intr_pbdma_id_status_v(u32 r, u32 i)
336{
337 return (r >> (0U + i*1U)) & 0x1U;
338}
339static inline u32 fifo_intr_pbdma_id_status__size_1_v(void)
340{
341 return 0x00000004U;
342}
343static inline u32 fifo_intr_runlist_r(void)
344{
345 return 0x00002a00U;
346}
347static inline u32 fifo_fb_timeout_r(void)
348{
349 return 0x00002a04U;
350}
351static inline u32 fifo_fb_timeout_period_m(void)
352{
353 return 0x3fffffffU << 0U;
354}
355static inline u32 fifo_fb_timeout_period_max_f(void)
356{
357 return 0x3fffffffU;
358}
359static inline u32 fifo_error_sched_disable_r(void)
360{
361 return 0x0000262cU;
362}
363static inline u32 fifo_sched_disable_r(void)
364{
365 return 0x00002630U;
366}
367static inline u32 fifo_sched_disable_runlist_f(u32 v, u32 i)
368{
369 return (v & 0x1U) << (0U + i*1U);
370}
371static inline u32 fifo_sched_disable_runlist_m(u32 i)
372{
373 return 0x1U << (0U + i*1U);
374}
375static inline u32 fifo_sched_disable_true_v(void)
376{
377 return 0x00000001U;
378}
379static inline u32 fifo_preempt_r(void)
380{
381 return 0x00002634U;
382}
383static inline u32 fifo_preempt_pending_true_f(void)
384{
385 return 0x100000U;
386}
387static inline u32 fifo_preempt_type_channel_f(void)
388{
389 return 0x0U;
390}
391static inline u32 fifo_preempt_type_tsg_f(void)
392{
393 return 0x1000000U;
394}
395static inline u32 fifo_preempt_chid_f(u32 v)
396{
397 return (v & 0xfffU) << 0U;
398}
399static inline u32 fifo_preempt_id_f(u32 v)
400{
401 return (v & 0xfffU) << 0U;
402}
403static inline u32 fifo_trigger_mmu_fault_r(u32 i)
404{
405 return 0x00002a30U + i*4U;
406}
407static inline u32 fifo_trigger_mmu_fault_id_f(u32 v)
408{
409 return (v & 0x1fU) << 0U;
410}
411static inline u32 fifo_trigger_mmu_fault_enable_f(u32 v)
412{
413 return (v & 0x1U) << 8U;
414}
415static inline u32 fifo_engine_status_r(u32 i)
416{
417 return 0x00002640U + i*8U;
418}
419static inline u32 fifo_engine_status__size_1_v(void)
420{
421 return 0x00000009U;
422}
423static inline u32 fifo_engine_status_id_v(u32 r)
424{
425 return (r >> 0U) & 0xfffU;
426}
427static inline u32 fifo_engine_status_id_type_v(u32 r)
428{
429 return (r >> 12U) & 0x1U;
430}
431static inline u32 fifo_engine_status_id_type_chid_v(void)
432{
433 return 0x00000000U;
434}
435static inline u32 fifo_engine_status_id_type_tsgid_v(void)
436{
437 return 0x00000001U;
438}
439static inline u32 fifo_engine_status_ctx_status_v(u32 r)
440{
441 return (r >> 13U) & 0x7U;
442}
443static inline u32 fifo_engine_status_ctx_status_invalid_v(void)
444{
445 return 0x00000000U;
446}
447static inline u32 fifo_engine_status_ctx_status_valid_v(void)
448{
449 return 0x00000001U;
450}
451static inline u32 fifo_engine_status_ctx_status_ctxsw_load_v(void)
452{
453 return 0x00000005U;
454}
455static inline u32 fifo_engine_status_ctx_status_ctxsw_save_v(void)
456{
457 return 0x00000006U;
458}
459static inline u32 fifo_engine_status_ctx_status_ctxsw_switch_v(void)
460{
461 return 0x00000007U;
462}
463static inline u32 fifo_engine_status_next_id_v(u32 r)
464{
465 return (r >> 16U) & 0xfffU;
466}
467static inline u32 fifo_engine_status_next_id_type_v(u32 r)
468{
469 return (r >> 28U) & 0x1U;
470}
471static inline u32 fifo_engine_status_next_id_type_chid_v(void)
472{
473 return 0x00000000U;
474}
475static inline u32 fifo_engine_status_faulted_v(u32 r)
476{
477 return (r >> 30U) & 0x1U;
478}
479static inline u32 fifo_engine_status_faulted_true_v(void)
480{
481 return 0x00000001U;
482}
483static inline u32 fifo_engine_status_engine_v(u32 r)
484{
485 return (r >> 31U) & 0x1U;
486}
487static inline u32 fifo_engine_status_engine_idle_v(void)
488{
489 return 0x00000000U;
490}
491static inline u32 fifo_engine_status_engine_busy_v(void)
492{
493 return 0x00000001U;
494}
495static inline u32 fifo_engine_status_ctxsw_v(u32 r)
496{
497 return (r >> 15U) & 0x1U;
498}
499static inline u32 fifo_engine_status_ctxsw_in_progress_v(void)
500{
501 return 0x00000001U;
502}
503static inline u32 fifo_engine_status_ctxsw_in_progress_f(void)
504{
505 return 0x8000U;
506}
507static inline u32 fifo_pbdma_status_r(u32 i)
508{
509 return 0x00003080U + i*4U;
510}
511static inline u32 fifo_pbdma_status__size_1_v(void)
512{
513 return 0x00000004U;
514}
515static inline u32 fifo_pbdma_status_id_v(u32 r)
516{
517 return (r >> 0U) & 0xfffU;
518}
519static inline u32 fifo_pbdma_status_id_type_v(u32 r)
520{
521 return (r >> 12U) & 0x1U;
522}
523static inline u32 fifo_pbdma_status_id_type_chid_v(void)
524{
525 return 0x00000000U;
526}
527static inline u32 fifo_pbdma_status_id_type_tsgid_v(void)
528{
529 return 0x00000001U;
530}
531static inline u32 fifo_pbdma_status_chan_status_v(u32 r)
532{
533 return (r >> 13U) & 0x7U;
534}
535static inline u32 fifo_pbdma_status_chan_status_valid_v(void)
536{
537 return 0x00000001U;
538}
539static inline u32 fifo_pbdma_status_chan_status_chsw_load_v(void)
540{
541 return 0x00000005U;
542}
543static inline u32 fifo_pbdma_status_chan_status_chsw_save_v(void)
544{
545 return 0x00000006U;
546}
547static inline u32 fifo_pbdma_status_chan_status_chsw_switch_v(void)
548{
549 return 0x00000007U;
550}
551static inline u32 fifo_pbdma_status_next_id_v(u32 r)
552{
553 return (r >> 16U) & 0xfffU;
554}
555static inline u32 fifo_pbdma_status_next_id_type_v(u32 r)
556{
557 return (r >> 28U) & 0x1U;
558}
559static inline u32 fifo_pbdma_status_next_id_type_chid_v(void)
560{
561 return 0x00000000U;
562}
563static inline u32 fifo_pbdma_status_chsw_v(u32 r)
564{
565 return (r >> 15U) & 0x1U;
566}
567static inline u32 fifo_pbdma_status_chsw_in_progress_v(void)
568{
569 return 0x00000001U;
570}
571static inline u32 fifo_replay_fault_buffer_lo_r(void)
572{
573 return 0x00002a70U;
574}
575static inline u32 fifo_replay_fault_buffer_lo_enable_v(u32 r)
576{
577 return (r >> 0U) & 0x1U;
578}
579static inline u32 fifo_replay_fault_buffer_lo_enable_true_v(void)
580{
581 return 0x00000001U;
582}
583static inline u32 fifo_replay_fault_buffer_lo_enable_false_v(void)
584{
585 return 0x00000000U;
586}
587static inline u32 fifo_replay_fault_buffer_lo_base_f(u32 v)
588{
589 return (v & 0xfffffU) << 12U;
590}
591static inline u32 fifo_replay_fault_buffer_lo_base_reset_v(void)
592{
593 return 0x00000000U;
594}
595static inline u32 fifo_replay_fault_buffer_hi_r(void)
596{
597 return 0x00002a74U;
598}
599static inline u32 fifo_replay_fault_buffer_hi_base_f(u32 v)
600{
601 return (v & 0xffU) << 0U;
602}
603static inline u32 fifo_replay_fault_buffer_hi_base_reset_v(void)
604{
605 return 0x00000000U;
606}
607static inline u32 fifo_replay_fault_buffer_size_r(void)
608{
609 return 0x00002a78U;
610}
611static inline u32 fifo_replay_fault_buffer_size_hw_f(u32 v)
612{
613 return (v & 0x3fffU) << 0U;
614}
615static inline u32 fifo_replay_fault_buffer_size_hw_entries_v(void)
616{
617 return 0x00001200U;
618}
619static inline u32 fifo_replay_fault_buffer_get_r(void)
620{
621 return 0x00002a7cU;
622}
623static inline u32 fifo_replay_fault_buffer_get_offset_hw_f(u32 v)
624{
625 return (v & 0x3fffU) << 0U;
626}
627static inline u32 fifo_replay_fault_buffer_get_offset_hw_init_v(void)
628{
629 return 0x00000000U;
630}
631static inline u32 fifo_replay_fault_buffer_put_r(void)
632{
633 return 0x00002a80U;
634}
635static inline u32 fifo_replay_fault_buffer_put_offset_hw_f(u32 v)
636{
637 return (v & 0x3fffU) << 0U;
638}
639static inline u32 fifo_replay_fault_buffer_put_offset_hw_init_v(void)
640{
641 return 0x00000000U;
642}
643static inline u32 fifo_replay_fault_buffer_info_r(void)
644{
645 return 0x00002a84U;
646}
647static inline u32 fifo_replay_fault_buffer_info_overflow_f(u32 v)
648{
649 return (v & 0x1U) << 0U;
650}
651static inline u32 fifo_replay_fault_buffer_info_overflow_false_v(void)
652{
653 return 0x00000000U;
654}
655static inline u32 fifo_replay_fault_buffer_info_overflow_true_v(void)
656{
657 return 0x00000001U;
658}
659static inline u32 fifo_replay_fault_buffer_info_overflow_clear_v(void)
660{
661 return 0x00000001U;
662}
663static inline u32 fifo_replay_fault_buffer_info_write_nack_f(u32 v)
664{
665 return (v & 0x1U) << 24U;
666}
667static inline u32 fifo_replay_fault_buffer_info_write_nack_false_v(void)
668{
669 return 0x00000000U;
670}
671static inline u32 fifo_replay_fault_buffer_info_write_nack_true_v(void)
672{
673 return 0x00000001U;
674}
675static inline u32 fifo_replay_fault_buffer_info_write_nack_clear_v(void)
676{
677 return 0x00000001U;
678}
679static inline u32 fifo_replay_fault_buffer_info_fault_while_buffer_disabled_f(u32 v)
680{
681 return (v & 0x1U) << 28U;
682}
683static inline u32 fifo_replay_fault_buffer_info_fault_while_buffer_disabled_false_v(void)
684{
685 return 0x00000000U;
686}
687static inline u32 fifo_replay_fault_buffer_info_fault_while_buffer_disabled_true_v(void)
688{
689 return 0x00000001U;
690}
691static inline u32 fifo_replay_fault_buffer_info_fault_while_buffer_disabled_clear_v(void)
692{
693 return 0x00000001U;
694}
695#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_flush_gp106.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_flush_gp106.h
new file mode 100644
index 00000000..c4e1c32b
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_flush_gp106.h
@@ -0,0 +1,187 @@
1/*
2 * Copyright (c) 2016-2017, 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_flush_gp106_h_
57#define _hw_flush_gp106_h_
58
59static inline u32 flush_l2_system_invalidate_r(void)
60{
61 return 0x00070004U;
62}
63static inline u32 flush_l2_system_invalidate_pending_v(u32 r)
64{
65 return (r >> 0U) & 0x1U;
66}
67static inline u32 flush_l2_system_invalidate_pending_busy_v(void)
68{
69 return 0x00000001U;
70}
71static inline u32 flush_l2_system_invalidate_pending_busy_f(void)
72{
73 return 0x1U;
74}
75static inline u32 flush_l2_system_invalidate_outstanding_v(u32 r)
76{
77 return (r >> 1U) & 0x1U;
78}
79static inline u32 flush_l2_system_invalidate_outstanding_true_v(void)
80{
81 return 0x00000001U;
82}
83static inline u32 flush_l2_flush_dirty_r(void)
84{
85 return 0x00070010U;
86}
87static inline u32 flush_l2_flush_dirty_pending_v(u32 r)
88{
89 return (r >> 0U) & 0x1U;
90}
91static inline u32 flush_l2_flush_dirty_pending_empty_v(void)
92{
93 return 0x00000000U;
94}
95static inline u32 flush_l2_flush_dirty_pending_empty_f(void)
96{
97 return 0x0U;
98}
99static inline u32 flush_l2_flush_dirty_pending_busy_v(void)
100{
101 return 0x00000001U;
102}
103static inline u32 flush_l2_flush_dirty_pending_busy_f(void)
104{
105 return 0x1U;
106}
107static inline u32 flush_l2_flush_dirty_outstanding_v(u32 r)
108{
109 return (r >> 1U) & 0x1U;
110}
111static inline u32 flush_l2_flush_dirty_outstanding_false_v(void)
112{
113 return 0x00000000U;
114}
115static inline u32 flush_l2_flush_dirty_outstanding_false_f(void)
116{
117 return 0x0U;
118}
119static inline u32 flush_l2_flush_dirty_outstanding_true_v(void)
120{
121 return 0x00000001U;
122}
123static inline u32 flush_l2_clean_comptags_r(void)
124{
125 return 0x0007000cU;
126}
127static inline u32 flush_l2_clean_comptags_pending_v(u32 r)
128{
129 return (r >> 0U) & 0x1U;
130}
131static inline u32 flush_l2_clean_comptags_pending_empty_v(void)
132{
133 return 0x00000000U;
134}
135static inline u32 flush_l2_clean_comptags_pending_empty_f(void)
136{
137 return 0x0U;
138}
139static inline u32 flush_l2_clean_comptags_pending_busy_v(void)
140{
141 return 0x00000001U;
142}
143static inline u32 flush_l2_clean_comptags_pending_busy_f(void)
144{
145 return 0x1U;
146}
147static inline u32 flush_l2_clean_comptags_outstanding_v(u32 r)
148{
149 return (r >> 1U) & 0x1U;
150}
151static inline u32 flush_l2_clean_comptags_outstanding_false_v(void)
152{
153 return 0x00000000U;
154}
155static inline u32 flush_l2_clean_comptags_outstanding_false_f(void)
156{
157 return 0x0U;
158}
159static inline u32 flush_l2_clean_comptags_outstanding_true_v(void)
160{
161 return 0x00000001U;
162}
163static inline u32 flush_fb_flush_r(void)
164{
165 return 0x00070000U;
166}
167static inline u32 flush_fb_flush_pending_v(u32 r)
168{
169 return (r >> 0U) & 0x1U;
170}
171static inline u32 flush_fb_flush_pending_busy_v(void)
172{
173 return 0x00000001U;
174}
175static inline u32 flush_fb_flush_pending_busy_f(void)
176{
177 return 0x1U;
178}
179static inline u32 flush_fb_flush_outstanding_v(u32 r)
180{
181 return (r >> 1U) & 0x1U;
182}
183static inline u32 flush_fb_flush_outstanding_true_v(void)
184{
185 return 0x00000001U;
186}
187#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_fuse_gp106.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_fuse_gp106.h
new file mode 100644
index 00000000..7d1fb075
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_fuse_gp106.h
@@ -0,0 +1,271 @@
1/*
2 * Copyright (c) 2016-2017, 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_fuse_gp106_h_
57#define _hw_fuse_gp106_h_
58
59static inline u32 fuse_status_opt_tpc_gpc_r(u32 i)
60{
61 return 0x00021c38U + i*4U;
62}
63static inline u32 fuse_ctrl_opt_tpc_gpc_r(u32 i)
64{
65 return 0x00021838U + i*4U;
66}
67static inline u32 fuse_ctrl_opt_ram_svop_pdp_r(void)
68{
69 return 0x00021944U;
70}
71static inline u32 fuse_ctrl_opt_ram_svop_pdp_data_f(u32 v)
72{
73 return (v & 0x3U) << 0U;
74}
75static inline u32 fuse_ctrl_opt_ram_svop_pdp_data_m(void)
76{
77 return 0x3U << 0U;
78}
79static inline u32 fuse_ctrl_opt_ram_svop_pdp_data_v(u32 r)
80{
81 return (r >> 0U) & 0x3U;
82}
83static inline u32 fuse_ctrl_opt_ram_svop_pdp_override_r(void)
84{
85 return 0x00021948U;
86}
87static inline u32 fuse_ctrl_opt_ram_svop_pdp_override_data_f(u32 v)
88{
89 return (v & 0x1U) << 0U;
90}
91static inline u32 fuse_ctrl_opt_ram_svop_pdp_override_data_m(void)
92{
93 return 0x1U << 0U;
94}
95static inline u32 fuse_ctrl_opt_ram_svop_pdp_override_data_v(u32 r)
96{
97 return (r >> 0U) & 0x1U;
98}
99static inline u32 fuse_ctrl_opt_ram_svop_pdp_override_data_yes_f(void)
100{
101 return 0x1U;
102}
103static inline u32 fuse_ctrl_opt_ram_svop_pdp_override_data_no_f(void)
104{
105 return 0x0U;
106}
107static inline u32 fuse_status_opt_fbio_r(void)
108{
109 return 0x00021c14U;
110}
111static inline u32 fuse_status_opt_fbio_data_f(u32 v)
112{
113 return (v & 0xffffU) << 0U;
114}
115static inline u32 fuse_status_opt_fbio_data_m(void)
116{
117 return 0xffffU << 0U;
118}
119static inline u32 fuse_status_opt_fbio_data_v(u32 r)
120{
121 return (r >> 0U) & 0xffffU;
122}
123static inline u32 fuse_status_opt_rop_l2_fbp_r(u32 i)
124{
125 return 0x00021d70U + i*4U;
126}
127static inline u32 fuse_status_opt_fbp_r(void)
128{
129 return 0x00021d38U;
130}
131static inline u32 fuse_status_opt_fbp_idx_v(u32 r, u32 i)
132{
133 return (r >> (0U + i*1U)) & 0x1U;
134}
135static inline u32 fuse_vin_cal_fuse_rev_r(void)
136{
137 return 0x0002164cU;
138}
139static inline u32 fuse_vin_cal_fuse_rev_data_v(u32 r)
140{
141 return (r >> 0U) & 0x3U;
142}
143static inline u32 fuse_vin_cal_gpc0_r(void)
144{
145 return 0x00021650U;
146}
147static inline u32 fuse_vin_cal_gpc0_icpt_int_data_s(void)
148{
149 return 12U;
150}
151static inline u32 fuse_vin_cal_gpc0_icpt_int_data_v(u32 r)
152{
153 return (r >> 16U) & 0xfffU;
154}
155static inline u32 fuse_vin_cal_gpc0_icpt_frac_data_s(void)
156{
157 return 2U;
158}
159static inline u32 fuse_vin_cal_gpc0_icpt_frac_data_v(u32 r)
160{
161 return (r >> 14U) & 0x3U;
162}
163static inline u32 fuse_vin_cal_gpc0_slope_int_data_s(void)
164{
165 return 4U;
166}
167static inline u32 fuse_vin_cal_gpc0_slope_int_data_v(u32 r)
168{
169 return (r >> 10U) & 0xfU;
170}
171static inline u32 fuse_vin_cal_gpc0_slope_frac_data_s(void)
172{
173 return 10U;
174}
175static inline u32 fuse_vin_cal_gpc0_slope_frac_data_v(u32 r)
176{
177 return (r >> 0U) & 0x3ffU;
178}
179static inline u32 fuse_vin_cal_gpc1_delta_r(void)
180{
181 return 0x00021654U;
182}
183static inline u32 fuse_vin_cal_gpc1_delta_icpt_int_data_s(void)
184{
185 return 8U;
186}
187static inline u32 fuse_vin_cal_gpc1_delta_icpt_int_data_v(u32 r)
188{
189 return (r >> 14U) & 0xffU;
190}
191static inline u32 fuse_vin_cal_gpc1_delta_icpt_frac_data_s(void)
192{
193 return 2U;
194}
195static inline u32 fuse_vin_cal_gpc1_delta_icpt_frac_data_v(u32 r)
196{
197 return (r >> 12U) & 0x3U;
198}
199static inline u32 fuse_vin_cal_gpc1_delta_icpt_sign_data_s(void)
200{
201 return 1U;
202}
203static inline u32 fuse_vin_cal_gpc1_delta_icpt_sign_data_v(u32 r)
204{
205 return (r >> 22U) & 0x1U;
206}
207static inline u32 fuse_vin_cal_gpc1_delta_slope_int_data_s(void)
208{
209 return 1U;
210}
211static inline u32 fuse_vin_cal_gpc1_delta_slope_int_data_v(u32 r)
212{
213 return (r >> 10U) & 0x1U;
214}
215static inline u32 fuse_vin_cal_gpc1_delta_slope_frac_data_s(void)
216{
217 return 10U;
218}
219static inline u32 fuse_vin_cal_gpc1_delta_slope_frac_data_v(u32 r)
220{
221 return (r >> 0U) & 0x3ffU;
222}
223static inline u32 fuse_vin_cal_gpc1_delta_slope_sign_data_s(void)
224{
225 return 1U;
226}
227static inline u32 fuse_vin_cal_gpc1_delta_slope_sign_data_v(u32 r)
228{
229 return (r >> 11U) & 0x1U;
230}
231static inline u32 fuse_vin_cal_gpc2_delta_r(void)
232{
233 return 0x00021658U;
234}
235static inline u32 fuse_vin_cal_gpc3_delta_r(void)
236{
237 return 0x0002165cU;
238}
239static inline u32 fuse_vin_cal_gpc4_delta_r(void)
240{
241 return 0x00021660U;
242}
243static inline u32 fuse_vin_cal_gpc5_delta_r(void)
244{
245 return 0x00021664U;
246}
247static inline u32 fuse_vin_cal_shared_delta_r(void)
248{
249 return 0x00021668U;
250}
251static inline u32 fuse_vin_cal_sram_delta_r(void)
252{
253 return 0x0002166cU;
254}
255static inline u32 fuse_vin_cal_sram_delta_icpt_int_data_s(void)
256{
257 return 9U;
258}
259static inline u32 fuse_vin_cal_sram_delta_icpt_int_data_v(u32 r)
260{
261 return (r >> 13U) & 0x1ffU;
262}
263static inline u32 fuse_vin_cal_sram_delta_icpt_frac_data_s(void)
264{
265 return 1U;
266}
267static inline u32 fuse_vin_cal_sram_delta_icpt_frac_data_v(u32 r)
268{
269 return (r >> 12U) & 0x1U;
270}
271#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_gc6_gp106.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_gc6_gp106.h
new file mode 100644
index 00000000..91e9d7b3
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_gc6_gp106.h
@@ -0,0 +1,62 @@
1/*
2 * Copyright (c) 2016, 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_gc6_gp106_h_
57#define _hw_gc6_gp106_h_
58static inline u32 gc6_sci_strap_r(void)
59{
60 return 0x00010ebb0;
61}
62#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_gmmu_gp106.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_gmmu_gp106.h
new file mode 100644
index 00000000..510dd5f2
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_gmmu_gp106.h
@@ -0,0 +1,1275 @@
1/*
2 * Copyright (c) 2016-2017, 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_gmmu_gp106_h_
57#define _hw_gmmu_gp106_h_
58
59static inline u32 gmmu_new_pde_is_pte_w(void)
60{
61 return 0U;
62}
63static inline u32 gmmu_new_pde_is_pte_false_f(void)
64{
65 return 0x0U;
66}
67static inline u32 gmmu_new_pde_aperture_w(void)
68{
69 return 0U;
70}
71static inline u32 gmmu_new_pde_aperture_invalid_f(void)
72{
73 return 0x0U;
74}
75static inline u32 gmmu_new_pde_aperture_video_memory_f(void)
76{
77 return 0x2U;
78}
79static inline u32 gmmu_new_pde_aperture_sys_mem_coh_f(void)
80{
81 return 0x4U;
82}
83static inline u32 gmmu_new_pde_aperture_sys_mem_ncoh_f(void)
84{
85 return 0x6U;
86}
87static inline u32 gmmu_new_pde_address_sys_f(u32 v)
88{
89 return (v & 0xffffffU) << 8U;
90}
91static inline u32 gmmu_new_pde_address_sys_w(void)
92{
93 return 0U;
94}
95static inline u32 gmmu_new_pde_vol_w(void)
96{
97 return 0U;
98}
99static inline u32 gmmu_new_pde_vol_true_f(void)
100{
101 return 0x8U;
102}
103static inline u32 gmmu_new_pde_vol_false_f(void)
104{
105 return 0x0U;
106}
107static inline u32 gmmu_new_pde_address_shift_v(void)
108{
109 return 0x0000000cU;
110}
111static inline u32 gmmu_new_pde__size_v(void)
112{
113 return 0x00000008U;
114}
115static inline u32 gmmu_new_dual_pde_is_pte_w(void)
116{
117 return 0U;
118}
119static inline u32 gmmu_new_dual_pde_is_pte_false_f(void)
120{
121 return 0x0U;
122}
123static inline u32 gmmu_new_dual_pde_aperture_big_w(void)
124{
125 return 0U;
126}
127static inline u32 gmmu_new_dual_pde_aperture_big_invalid_f(void)
128{
129 return 0x0U;
130}
131static inline u32 gmmu_new_dual_pde_aperture_big_video_memory_f(void)
132{
133 return 0x2U;
134}
135static inline u32 gmmu_new_dual_pde_aperture_big_sys_mem_coh_f(void)
136{
137 return 0x4U;
138}
139static inline u32 gmmu_new_dual_pde_aperture_big_sys_mem_ncoh_f(void)
140{
141 return 0x6U;
142}
143static inline u32 gmmu_new_dual_pde_address_big_sys_f(u32 v)
144{
145 return (v & 0xfffffffU) << 4U;
146}
147static inline u32 gmmu_new_dual_pde_address_big_sys_w(void)
148{
149 return 0U;
150}
151static inline u32 gmmu_new_dual_pde_aperture_small_w(void)
152{
153 return 2U;
154}
155static inline u32 gmmu_new_dual_pde_aperture_small_invalid_f(void)
156{
157 return 0x0U;
158}
159static inline u32 gmmu_new_dual_pde_aperture_small_video_memory_f(void)
160{
161 return 0x2U;
162}
163static inline u32 gmmu_new_dual_pde_aperture_small_sys_mem_coh_f(void)
164{
165 return 0x4U;
166}
167static inline u32 gmmu_new_dual_pde_aperture_small_sys_mem_ncoh_f(void)
168{
169 return 0x6U;
170}
171static inline u32 gmmu_new_dual_pde_vol_small_w(void)
172{
173 return 2U;
174}
175static inline u32 gmmu_new_dual_pde_vol_small_true_f(void)
176{
177 return 0x8U;
178}
179static inline u32 gmmu_new_dual_pde_vol_small_false_f(void)
180{
181 return 0x0U;
182}
183static inline u32 gmmu_new_dual_pde_vol_big_w(void)
184{
185 return 0U;
186}
187static inline u32 gmmu_new_dual_pde_vol_big_true_f(void)
188{
189 return 0x8U;
190}
191static inline u32 gmmu_new_dual_pde_vol_big_false_f(void)
192{
193 return 0x0U;
194}
195static inline u32 gmmu_new_dual_pde_address_small_sys_f(u32 v)
196{
197 return (v & 0xffffffU) << 8U;
198}
199static inline u32 gmmu_new_dual_pde_address_small_sys_w(void)
200{
201 return 2U;
202}
203static inline u32 gmmu_new_dual_pde_address_shift_v(void)
204{
205 return 0x0000000cU;
206}
207static inline u32 gmmu_new_dual_pde_address_big_shift_v(void)
208{
209 return 0x00000008U;
210}
211static inline u32 gmmu_new_dual_pde__size_v(void)
212{
213 return 0x00000010U;
214}
215static inline u32 gmmu_new_pte__size_v(void)
216{
217 return 0x00000008U;
218}
219static inline u32 gmmu_new_pte_valid_w(void)
220{
221 return 0U;
222}
223static inline u32 gmmu_new_pte_valid_true_f(void)
224{
225 return 0x1U;
226}
227static inline u32 gmmu_new_pte_valid_false_f(void)
228{
229 return 0x0U;
230}
231static inline u32 gmmu_new_pte_privilege_w(void)
232{
233 return 0U;
234}
235static inline u32 gmmu_new_pte_privilege_true_f(void)
236{
237 return 0x20U;
238}
239static inline u32 gmmu_new_pte_privilege_false_f(void)
240{
241 return 0x0U;
242}
243static inline u32 gmmu_new_pte_address_sys_f(u32 v)
244{
245 return (v & 0xffffffU) << 8U;
246}
247static inline u32 gmmu_new_pte_address_sys_w(void)
248{
249 return 0U;
250}
251static inline u32 gmmu_new_pte_address_vid_f(u32 v)
252{
253 return (v & 0xffffffU) << 8U;
254}
255static inline u32 gmmu_new_pte_address_vid_w(void)
256{
257 return 0U;
258}
259static inline u32 gmmu_new_pte_vol_w(void)
260{
261 return 0U;
262}
263static inline u32 gmmu_new_pte_vol_true_f(void)
264{
265 return 0x8U;
266}
267static inline u32 gmmu_new_pte_vol_false_f(void)
268{
269 return 0x0U;
270}
271static inline u32 gmmu_new_pte_aperture_w(void)
272{
273 return 0U;
274}
275static inline u32 gmmu_new_pte_aperture_video_memory_f(void)
276{
277 return 0x0U;
278}
279static inline u32 gmmu_new_pte_aperture_sys_mem_coh_f(void)
280{
281 return 0x4U;
282}
283static inline u32 gmmu_new_pte_aperture_sys_mem_ncoh_f(void)
284{
285 return 0x6U;
286}
287static inline u32 gmmu_new_pte_read_only_w(void)
288{
289 return 0U;
290}
291static inline u32 gmmu_new_pte_read_only_true_f(void)
292{
293 return 0x40U;
294}
295static inline u32 gmmu_new_pte_comptagline_f(u32 v)
296{
297 return (v & 0x3ffffU) << 4U;
298}
299static inline u32 gmmu_new_pte_comptagline_w(void)
300{
301 return 1U;
302}
303static inline u32 gmmu_new_pte_kind_f(u32 v)
304{
305 return (v & 0xffU) << 24U;
306}
307static inline u32 gmmu_new_pte_kind_w(void)
308{
309 return 1U;
310}
311static inline u32 gmmu_new_pte_address_shift_v(void)
312{
313 return 0x0000000cU;
314}
315static inline u32 gmmu_pte_kind_f(u32 v)
316{
317 return (v & 0xffU) << 4U;
318}
319static inline u32 gmmu_pte_kind_w(void)
320{
321 return 1U;
322}
323static inline u32 gmmu_pte_kind_invalid_v(void)
324{
325 return 0x000000ffU;
326}
327static inline u32 gmmu_pte_kind_pitch_v(void)
328{
329 return 0x00000000U;
330}
331static inline u32 gmmu_pte_kind_z16_v(void)
332{
333 return 0x00000001U;
334}
335static inline u32 gmmu_pte_kind_z16_2c_v(void)
336{
337 return 0x00000002U;
338}
339static inline u32 gmmu_pte_kind_z16_ms2_2c_v(void)
340{
341 return 0x00000003U;
342}
343static inline u32 gmmu_pte_kind_z16_ms4_2c_v(void)
344{
345 return 0x00000004U;
346}
347static inline u32 gmmu_pte_kind_z16_ms8_2c_v(void)
348{
349 return 0x00000005U;
350}
351static inline u32 gmmu_pte_kind_z16_ms16_2c_v(void)
352{
353 return 0x00000006U;
354}
355static inline u32 gmmu_pte_kind_z16_2z_v(void)
356{
357 return 0x00000007U;
358}
359static inline u32 gmmu_pte_kind_z16_ms2_2z_v(void)
360{
361 return 0x00000008U;
362}
363static inline u32 gmmu_pte_kind_z16_ms4_2z_v(void)
364{
365 return 0x00000009U;
366}
367static inline u32 gmmu_pte_kind_z16_ms8_2z_v(void)
368{
369 return 0x0000000aU;
370}
371static inline u32 gmmu_pte_kind_z16_ms16_2z_v(void)
372{
373 return 0x0000000bU;
374}
375static inline u32 gmmu_pte_kind_z16_2cz_v(void)
376{
377 return 0x00000036U;
378}
379static inline u32 gmmu_pte_kind_z16_ms2_2cz_v(void)
380{
381 return 0x00000037U;
382}
383static inline u32 gmmu_pte_kind_z16_ms4_2cz_v(void)
384{
385 return 0x00000038U;
386}
387static inline u32 gmmu_pte_kind_z16_ms8_2cz_v(void)
388{
389 return 0x00000039U;
390}
391static inline u32 gmmu_pte_kind_z16_ms16_2cz_v(void)
392{
393 return 0x0000005fU;
394}
395static inline u32 gmmu_pte_kind_z16_4cz_v(void)
396{
397 return 0x0000000cU;
398}
399static inline u32 gmmu_pte_kind_z16_ms2_4cz_v(void)
400{
401 return 0x0000000dU;
402}
403static inline u32 gmmu_pte_kind_z16_ms4_4cz_v(void)
404{
405 return 0x0000000eU;
406}
407static inline u32 gmmu_pte_kind_z16_ms8_4cz_v(void)
408{
409 return 0x0000000fU;
410}
411static inline u32 gmmu_pte_kind_z16_ms16_4cz_v(void)
412{
413 return 0x00000010U;
414}
415static inline u32 gmmu_pte_kind_s8z24_v(void)
416{
417 return 0x00000011U;
418}
419static inline u32 gmmu_pte_kind_s8z24_1z_v(void)
420{
421 return 0x00000012U;
422}
423static inline u32 gmmu_pte_kind_s8z24_ms2_1z_v(void)
424{
425 return 0x00000013U;
426}
427static inline u32 gmmu_pte_kind_s8z24_ms4_1z_v(void)
428{
429 return 0x00000014U;
430}
431static inline u32 gmmu_pte_kind_s8z24_ms8_1z_v(void)
432{
433 return 0x00000015U;
434}
435static inline u32 gmmu_pte_kind_s8z24_ms16_1z_v(void)
436{
437 return 0x00000016U;
438}
439static inline u32 gmmu_pte_kind_s8z24_2cz_v(void)
440{
441 return 0x00000017U;
442}
443static inline u32 gmmu_pte_kind_s8z24_ms2_2cz_v(void)
444{
445 return 0x00000018U;
446}
447static inline u32 gmmu_pte_kind_s8z24_ms4_2cz_v(void)
448{
449 return 0x00000019U;
450}
451static inline u32 gmmu_pte_kind_s8z24_ms8_2cz_v(void)
452{
453 return 0x0000001aU;
454}
455static inline u32 gmmu_pte_kind_s8z24_ms16_2cz_v(void)
456{
457 return 0x0000001bU;
458}
459static inline u32 gmmu_pte_kind_s8z24_2cs_v(void)
460{
461 return 0x0000001cU;
462}
463static inline u32 gmmu_pte_kind_s8z24_ms2_2cs_v(void)
464{
465 return 0x0000001dU;
466}
467static inline u32 gmmu_pte_kind_s8z24_ms4_2cs_v(void)
468{
469 return 0x0000001eU;
470}
471static inline u32 gmmu_pte_kind_s8z24_ms8_2cs_v(void)
472{
473 return 0x0000001fU;
474}
475static inline u32 gmmu_pte_kind_s8z24_ms16_2cs_v(void)
476{
477 return 0x00000020U;
478}
479static inline u32 gmmu_pte_kind_s8z24_4cszv_v(void)
480{
481 return 0x00000021U;
482}
483static inline u32 gmmu_pte_kind_s8z24_ms2_4cszv_v(void)
484{
485 return 0x00000022U;
486}
487static inline u32 gmmu_pte_kind_s8z24_ms4_4cszv_v(void)
488{
489 return 0x00000023U;
490}
491static inline u32 gmmu_pte_kind_s8z24_ms8_4cszv_v(void)
492{
493 return 0x00000024U;
494}
495static inline u32 gmmu_pte_kind_s8z24_ms16_4cszv_v(void)
496{
497 return 0x00000025U;
498}
499static inline u32 gmmu_pte_kind_v8z24_ms4_vc12_v(void)
500{
501 return 0x00000026U;
502}
503static inline u32 gmmu_pte_kind_v8z24_ms4_vc4_v(void)
504{
505 return 0x00000027U;
506}
507static inline u32 gmmu_pte_kind_v8z24_ms8_vc8_v(void)
508{
509 return 0x00000028U;
510}
511static inline u32 gmmu_pte_kind_v8z24_ms8_vc24_v(void)
512{
513 return 0x00000029U;
514}
515static inline u32 gmmu_pte_kind_v8z24_ms4_vc12_1zv_v(void)
516{
517 return 0x0000002eU;
518}
519static inline u32 gmmu_pte_kind_v8z24_ms4_vc4_1zv_v(void)
520{
521 return 0x0000002fU;
522}
523static inline u32 gmmu_pte_kind_v8z24_ms8_vc8_1zv_v(void)
524{
525 return 0x00000030U;
526}
527static inline u32 gmmu_pte_kind_v8z24_ms8_vc24_1zv_v(void)
528{
529 return 0x00000031U;
530}
531static inline u32 gmmu_pte_kind_v8z24_ms4_vc12_2cs_v(void)
532{
533 return 0x00000032U;
534}
535static inline u32 gmmu_pte_kind_v8z24_ms4_vc4_2cs_v(void)
536{
537 return 0x00000033U;
538}
539static inline u32 gmmu_pte_kind_v8z24_ms8_vc8_2cs_v(void)
540{
541 return 0x00000034U;
542}
543static inline u32 gmmu_pte_kind_v8z24_ms8_vc24_2cs_v(void)
544{
545 return 0x00000035U;
546}
547static inline u32 gmmu_pte_kind_v8z24_ms4_vc12_2czv_v(void)
548{
549 return 0x0000003aU;
550}
551static inline u32 gmmu_pte_kind_v8z24_ms4_vc4_2czv_v(void)
552{
553 return 0x0000003bU;
554}
555static inline u32 gmmu_pte_kind_v8z24_ms8_vc8_2czv_v(void)
556{
557 return 0x0000003cU;
558}
559static inline u32 gmmu_pte_kind_v8z24_ms8_vc24_2czv_v(void)
560{
561 return 0x0000003dU;
562}
563static inline u32 gmmu_pte_kind_v8z24_ms4_vc12_2zv_v(void)
564{
565 return 0x0000003eU;
566}
567static inline u32 gmmu_pte_kind_v8z24_ms4_vc4_2zv_v(void)
568{
569 return 0x0000003fU;
570}
571static inline u32 gmmu_pte_kind_v8z24_ms8_vc8_2zv_v(void)
572{
573 return 0x00000040U;
574}
575static inline u32 gmmu_pte_kind_v8z24_ms8_vc24_2zv_v(void)
576{
577 return 0x00000041U;
578}
579static inline u32 gmmu_pte_kind_v8z24_ms4_vc12_4cszv_v(void)
580{
581 return 0x00000042U;
582}
583static inline u32 gmmu_pte_kind_v8z24_ms4_vc4_4cszv_v(void)
584{
585 return 0x00000043U;
586}
587static inline u32 gmmu_pte_kind_v8z24_ms8_vc8_4cszv_v(void)
588{
589 return 0x00000044U;
590}
591static inline u32 gmmu_pte_kind_v8z24_ms8_vc24_4cszv_v(void)
592{
593 return 0x00000045U;
594}
595static inline u32 gmmu_pte_kind_z24s8_v(void)
596{
597 return 0x00000046U;
598}
599static inline u32 gmmu_pte_kind_z24s8_1z_v(void)
600{
601 return 0x00000047U;
602}
603static inline u32 gmmu_pte_kind_z24s8_ms2_1z_v(void)
604{
605 return 0x00000048U;
606}
607static inline u32 gmmu_pte_kind_z24s8_ms4_1z_v(void)
608{
609 return 0x00000049U;
610}
611static inline u32 gmmu_pte_kind_z24s8_ms8_1z_v(void)
612{
613 return 0x0000004aU;
614}
615static inline u32 gmmu_pte_kind_z24s8_ms16_1z_v(void)
616{
617 return 0x0000004bU;
618}
619static inline u32 gmmu_pte_kind_z24s8_2cs_v(void)
620{
621 return 0x0000004cU;
622}
623static inline u32 gmmu_pte_kind_z24s8_ms2_2cs_v(void)
624{
625 return 0x0000004dU;
626}
627static inline u32 gmmu_pte_kind_z24s8_ms4_2cs_v(void)
628{
629 return 0x0000004eU;
630}
631static inline u32 gmmu_pte_kind_z24s8_ms8_2cs_v(void)
632{
633 return 0x0000004fU;
634}
635static inline u32 gmmu_pte_kind_z24s8_ms16_2cs_v(void)
636{
637 return 0x00000050U;
638}
639static inline u32 gmmu_pte_kind_z24s8_2cz_v(void)
640{
641 return 0x00000051U;
642}
643static inline u32 gmmu_pte_kind_z24s8_ms2_2cz_v(void)
644{
645 return 0x00000052U;
646}
647static inline u32 gmmu_pte_kind_z24s8_ms4_2cz_v(void)
648{
649 return 0x00000053U;
650}
651static inline u32 gmmu_pte_kind_z24s8_ms8_2cz_v(void)
652{
653 return 0x00000054U;
654}
655static inline u32 gmmu_pte_kind_z24s8_ms16_2cz_v(void)
656{
657 return 0x00000055U;
658}
659static inline u32 gmmu_pte_kind_z24s8_4cszv_v(void)
660{
661 return 0x00000056U;
662}
663static inline u32 gmmu_pte_kind_z24s8_ms2_4cszv_v(void)
664{
665 return 0x00000057U;
666}
667static inline u32 gmmu_pte_kind_z24s8_ms4_4cszv_v(void)
668{
669 return 0x00000058U;
670}
671static inline u32 gmmu_pte_kind_z24s8_ms8_4cszv_v(void)
672{
673 return 0x00000059U;
674}
675static inline u32 gmmu_pte_kind_z24s8_ms16_4cszv_v(void)
676{
677 return 0x0000005aU;
678}
679static inline u32 gmmu_pte_kind_z24v8_ms4_vc12_v(void)
680{
681 return 0x0000005bU;
682}
683static inline u32 gmmu_pte_kind_z24v8_ms4_vc4_v(void)
684{
685 return 0x0000005cU;
686}
687static inline u32 gmmu_pte_kind_z24v8_ms8_vc8_v(void)
688{
689 return 0x0000005dU;
690}
691static inline u32 gmmu_pte_kind_z24v8_ms8_vc24_v(void)
692{
693 return 0x0000005eU;
694}
695static inline u32 gmmu_pte_kind_z24v8_ms4_vc12_1zv_v(void)
696{
697 return 0x00000063U;
698}
699static inline u32 gmmu_pte_kind_z24v8_ms4_vc4_1zv_v(void)
700{
701 return 0x00000064U;
702}
703static inline u32 gmmu_pte_kind_z24v8_ms8_vc8_1zv_v(void)
704{
705 return 0x00000065U;
706}
707static inline u32 gmmu_pte_kind_z24v8_ms8_vc24_1zv_v(void)
708{
709 return 0x00000066U;
710}
711static inline u32 gmmu_pte_kind_z24v8_ms4_vc12_2cs_v(void)
712{
713 return 0x00000067U;
714}
715static inline u32 gmmu_pte_kind_z24v8_ms4_vc4_2cs_v(void)
716{
717 return 0x00000068U;
718}
719static inline u32 gmmu_pte_kind_z24v8_ms8_vc8_2cs_v(void)
720{
721 return 0x00000069U;
722}
723static inline u32 gmmu_pte_kind_z24v8_ms8_vc24_2cs_v(void)
724{
725 return 0x0000006aU;
726}
727static inline u32 gmmu_pte_kind_z24v8_ms4_vc12_2czv_v(void)
728{
729 return 0x0000006fU;
730}
731static inline u32 gmmu_pte_kind_z24v8_ms4_vc4_2czv_v(void)
732{
733 return 0x00000070U;
734}
735static inline u32 gmmu_pte_kind_z24v8_ms8_vc8_2czv_v(void)
736{
737 return 0x00000071U;
738}
739static inline u32 gmmu_pte_kind_z24v8_ms8_vc24_2czv_v(void)
740{
741 return 0x00000072U;
742}
743static inline u32 gmmu_pte_kind_z24v8_ms4_vc12_2zv_v(void)
744{
745 return 0x00000073U;
746}
747static inline u32 gmmu_pte_kind_z24v8_ms4_vc4_2zv_v(void)
748{
749 return 0x00000074U;
750}
751static inline u32 gmmu_pte_kind_z24v8_ms8_vc8_2zv_v(void)
752{
753 return 0x00000075U;
754}
755static inline u32 gmmu_pte_kind_z24v8_ms8_vc24_2zv_v(void)
756{
757 return 0x00000076U;
758}
759static inline u32 gmmu_pte_kind_z24v8_ms4_vc12_4cszv_v(void)
760{
761 return 0x00000077U;
762}
763static inline u32 gmmu_pte_kind_z24v8_ms4_vc4_4cszv_v(void)
764{
765 return 0x00000078U;
766}
767static inline u32 gmmu_pte_kind_z24v8_ms8_vc8_4cszv_v(void)
768{
769 return 0x00000079U;
770}
771static inline u32 gmmu_pte_kind_z24v8_ms8_vc24_4cszv_v(void)
772{
773 return 0x0000007aU;
774}
775static inline u32 gmmu_pte_kind_zf32_v(void)
776{
777 return 0x0000007bU;
778}
779static inline u32 gmmu_pte_kind_zf32_1z_v(void)
780{
781 return 0x0000007cU;
782}
783static inline u32 gmmu_pte_kind_zf32_ms2_1z_v(void)
784{
785 return 0x0000007dU;
786}
787static inline u32 gmmu_pte_kind_zf32_ms4_1z_v(void)
788{
789 return 0x0000007eU;
790}
791static inline u32 gmmu_pte_kind_zf32_ms8_1z_v(void)
792{
793 return 0x0000007fU;
794}
795static inline u32 gmmu_pte_kind_zf32_ms16_1z_v(void)
796{
797 return 0x00000080U;
798}
799static inline u32 gmmu_pte_kind_zf32_2cs_v(void)
800{
801 return 0x00000081U;
802}
803static inline u32 gmmu_pte_kind_zf32_ms2_2cs_v(void)
804{
805 return 0x00000082U;
806}
807static inline u32 gmmu_pte_kind_zf32_ms4_2cs_v(void)
808{
809 return 0x00000083U;
810}
811static inline u32 gmmu_pte_kind_zf32_ms8_2cs_v(void)
812{
813 return 0x00000084U;
814}
815static inline u32 gmmu_pte_kind_zf32_ms16_2cs_v(void)
816{
817 return 0x00000085U;
818}
819static inline u32 gmmu_pte_kind_zf32_2cz_v(void)
820{
821 return 0x00000086U;
822}
823static inline u32 gmmu_pte_kind_zf32_ms2_2cz_v(void)
824{
825 return 0x00000087U;
826}
827static inline u32 gmmu_pte_kind_zf32_ms4_2cz_v(void)
828{
829 return 0x00000088U;
830}
831static inline u32 gmmu_pte_kind_zf32_ms8_2cz_v(void)
832{
833 return 0x00000089U;
834}
835static inline u32 gmmu_pte_kind_zf32_ms16_2cz_v(void)
836{
837 return 0x0000008aU;
838}
839static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms4_vc12_v(void)
840{
841 return 0x0000008bU;
842}
843static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms4_vc4_v(void)
844{
845 return 0x0000008cU;
846}
847static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms8_vc8_v(void)
848{
849 return 0x0000008dU;
850}
851static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms8_vc24_v(void)
852{
853 return 0x0000008eU;
854}
855static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms4_vc12_1cs_v(void)
856{
857 return 0x0000008fU;
858}
859static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms4_vc4_1cs_v(void)
860{
861 return 0x00000090U;
862}
863static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms8_vc8_1cs_v(void)
864{
865 return 0x00000091U;
866}
867static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms8_vc24_1cs_v(void)
868{
869 return 0x00000092U;
870}
871static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms4_vc12_1zv_v(void)
872{
873 return 0x00000097U;
874}
875static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms4_vc4_1zv_v(void)
876{
877 return 0x00000098U;
878}
879static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms8_vc8_1zv_v(void)
880{
881 return 0x00000099U;
882}
883static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms8_vc24_1zv_v(void)
884{
885 return 0x0000009aU;
886}
887static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms4_vc12_1czv_v(void)
888{
889 return 0x0000009bU;
890}
891static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms4_vc4_1czv_v(void)
892{
893 return 0x0000009cU;
894}
895static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms8_vc8_1czv_v(void)
896{
897 return 0x0000009dU;
898}
899static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms8_vc24_1czv_v(void)
900{
901 return 0x0000009eU;
902}
903static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms4_vc12_2cs_v(void)
904{
905 return 0x0000009fU;
906}
907static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms4_vc4_2cs_v(void)
908{
909 return 0x000000a0U;
910}
911static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms8_vc8_2cs_v(void)
912{
913 return 0x000000a1U;
914}
915static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms8_vc24_2cs_v(void)
916{
917 return 0x000000a2U;
918}
919static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms4_vc12_2cszv_v(void)
920{
921 return 0x000000a3U;
922}
923static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms4_vc4_2cszv_v(void)
924{
925 return 0x000000a4U;
926}
927static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms8_vc8_2cszv_v(void)
928{
929 return 0x000000a5U;
930}
931static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms8_vc24_2cszv_v(void)
932{
933 return 0x000000a6U;
934}
935static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms4_vc12_v(void)
936{
937 return 0x000000a7U;
938}
939static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms4_vc4_v(void)
940{
941 return 0x000000a8U;
942}
943static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms8_vc8_v(void)
944{
945 return 0x000000a9U;
946}
947static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms8_vc24_v(void)
948{
949 return 0x000000aaU;
950}
951static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms4_vc12_1cs_v(void)
952{
953 return 0x000000abU;
954}
955static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms4_vc4_1cs_v(void)
956{
957 return 0x000000acU;
958}
959static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms8_vc8_1cs_v(void)
960{
961 return 0x000000adU;
962}
963static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms8_vc24_1cs_v(void)
964{
965 return 0x000000aeU;
966}
967static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms4_vc12_1zv_v(void)
968{
969 return 0x000000b3U;
970}
971static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms4_vc4_1zv_v(void)
972{
973 return 0x000000b4U;
974}
975static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms8_vc8_1zv_v(void)
976{
977 return 0x000000b5U;
978}
979static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms8_vc24_1zv_v(void)
980{
981 return 0x000000b6U;
982}
983static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms4_vc12_1czv_v(void)
984{
985 return 0x000000b7U;
986}
987static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms4_vc4_1czv_v(void)
988{
989 return 0x000000b8U;
990}
991static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms8_vc8_1czv_v(void)
992{
993 return 0x000000b9U;
994}
995static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms8_vc24_1czv_v(void)
996{
997 return 0x000000baU;
998}
999static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms4_vc12_2cs_v(void)
1000{
1001 return 0x000000bbU;
1002}
1003static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms4_vc4_2cs_v(void)
1004{
1005 return 0x000000bcU;
1006}
1007static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms8_vc8_2cs_v(void)
1008{
1009 return 0x000000bdU;
1010}
1011static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms8_vc24_2cs_v(void)
1012{
1013 return 0x000000beU;
1014}
1015static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms4_vc12_2cszv_v(void)
1016{
1017 return 0x000000bfU;
1018}
1019static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms4_vc4_2cszv_v(void)
1020{
1021 return 0x000000c0U;
1022}
1023static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms8_vc8_2cszv_v(void)
1024{
1025 return 0x000000c1U;
1026}
1027static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms8_vc24_2cszv_v(void)
1028{
1029 return 0x000000c2U;
1030}
1031static inline u32 gmmu_pte_kind_zf32_x24s8_v(void)
1032{
1033 return 0x000000c3U;
1034}
1035static inline u32 gmmu_pte_kind_zf32_x24s8_1cs_v(void)
1036{
1037 return 0x000000c4U;
1038}
1039static inline u32 gmmu_pte_kind_zf32_x24s8_ms2_1cs_v(void)
1040{
1041 return 0x000000c5U;
1042}
1043static inline u32 gmmu_pte_kind_zf32_x24s8_ms4_1cs_v(void)
1044{
1045 return 0x000000c6U;
1046}
1047static inline u32 gmmu_pte_kind_zf32_x24s8_ms8_1cs_v(void)
1048{
1049 return 0x000000c7U;
1050}
1051static inline u32 gmmu_pte_kind_zf32_x24s8_ms16_1cs_v(void)
1052{
1053 return 0x000000c8U;
1054}
1055static inline u32 gmmu_pte_kind_zf32_x24s8_2cszv_v(void)
1056{
1057 return 0x000000ceU;
1058}
1059static inline u32 gmmu_pte_kind_zf32_x24s8_ms2_2cszv_v(void)
1060{
1061 return 0x000000cfU;
1062}
1063static inline u32 gmmu_pte_kind_zf32_x24s8_ms4_2cszv_v(void)
1064{
1065 return 0x000000d0U;
1066}
1067static inline u32 gmmu_pte_kind_zf32_x24s8_ms8_2cszv_v(void)
1068{
1069 return 0x000000d1U;
1070}
1071static inline u32 gmmu_pte_kind_zf32_x24s8_ms16_2cszv_v(void)
1072{
1073 return 0x000000d2U;
1074}
1075static inline u32 gmmu_pte_kind_zf32_x24s8_2cs_v(void)
1076{
1077 return 0x000000d3U;
1078}
1079static inline u32 gmmu_pte_kind_zf32_x24s8_ms2_2cs_v(void)
1080{
1081 return 0x000000d4U;
1082}
1083static inline u32 gmmu_pte_kind_zf32_x24s8_ms4_2cs_v(void)
1084{
1085 return 0x000000d5U;
1086}
1087static inline u32 gmmu_pte_kind_zf32_x24s8_ms8_2cs_v(void)
1088{
1089 return 0x000000d6U;
1090}
1091static inline u32 gmmu_pte_kind_zf32_x24s8_ms16_2cs_v(void)
1092{
1093 return 0x000000d7U;
1094}
1095static inline u32 gmmu_pte_kind_generic_16bx2_v(void)
1096{
1097 return 0x000000feU;
1098}
1099static inline u32 gmmu_pte_kind_c32_2c_v(void)
1100{
1101 return 0x000000d8U;
1102}
1103static inline u32 gmmu_pte_kind_c32_2cbr_v(void)
1104{
1105 return 0x000000d9U;
1106}
1107static inline u32 gmmu_pte_kind_c32_2cba_v(void)
1108{
1109 return 0x000000daU;
1110}
1111static inline u32 gmmu_pte_kind_c32_2cra_v(void)
1112{
1113 return 0x000000dbU;
1114}
1115static inline u32 gmmu_pte_kind_c32_2bra_v(void)
1116{
1117 return 0x000000dcU;
1118}
1119static inline u32 gmmu_pte_kind_c32_ms2_2c_v(void)
1120{
1121 return 0x000000ddU;
1122}
1123static inline u32 gmmu_pte_kind_c32_ms2_2cbr_v(void)
1124{
1125 return 0x000000deU;
1126}
1127static inline u32 gmmu_pte_kind_c32_ms4_2c_v(void)
1128{
1129 return 0x000000dfU;
1130}
1131static inline u32 gmmu_pte_kind_c32_ms4_2cbr_v(void)
1132{
1133 return 0x000000e0U;
1134}
1135static inline u32 gmmu_pte_kind_c32_ms4_2cba_v(void)
1136{
1137 return 0x000000e1U;
1138}
1139static inline u32 gmmu_pte_kind_c32_ms4_2cra_v(void)
1140{
1141 return 0x000000e2U;
1142}
1143static inline u32 gmmu_pte_kind_c32_ms4_2bra_v(void)
1144{
1145 return 0x000000e3U;
1146}
1147static inline u32 gmmu_pte_kind_c32_ms4_4cbra_v(void)
1148{
1149 return 0x0000002cU;
1150}
1151static inline u32 gmmu_pte_kind_c32_ms8_ms16_2c_v(void)
1152{
1153 return 0x000000e4U;
1154}
1155static inline u32 gmmu_pte_kind_c32_ms8_ms16_2cra_v(void)
1156{
1157 return 0x000000e5U;
1158}
1159static inline u32 gmmu_pte_kind_c64_2c_v(void)
1160{
1161 return 0x000000e6U;
1162}
1163static inline u32 gmmu_pte_kind_c64_2cbr_v(void)
1164{
1165 return 0x000000e7U;
1166}
1167static inline u32 gmmu_pte_kind_c64_2cba_v(void)
1168{
1169 return 0x000000e8U;
1170}
1171static inline u32 gmmu_pte_kind_c64_2cra_v(void)
1172{
1173 return 0x000000e9U;
1174}
1175static inline u32 gmmu_pte_kind_c64_2bra_v(void)
1176{
1177 return 0x000000eaU;
1178}
1179static inline u32 gmmu_pte_kind_c64_ms2_2c_v(void)
1180{
1181 return 0x000000ebU;
1182}
1183static inline u32 gmmu_pte_kind_c64_ms2_2cbr_v(void)
1184{
1185 return 0x000000ecU;
1186}
1187static inline u32 gmmu_pte_kind_c64_ms4_2c_v(void)
1188{
1189 return 0x000000edU;
1190}
1191static inline u32 gmmu_pte_kind_c64_ms4_2cbr_v(void)
1192{
1193 return 0x000000eeU;
1194}
1195static inline u32 gmmu_pte_kind_c64_ms4_2cba_v(void)
1196{
1197 return 0x000000efU;
1198}
1199static inline u32 gmmu_pte_kind_c64_ms4_2cra_v(void)
1200{
1201 return 0x000000f0U;
1202}
1203static inline u32 gmmu_pte_kind_c64_ms4_2bra_v(void)
1204{
1205 return 0x000000f1U;
1206}
1207static inline u32 gmmu_pte_kind_c64_ms4_4cbra_v(void)
1208{
1209 return 0x0000002dU;
1210}
1211static inline u32 gmmu_pte_kind_c64_ms8_ms16_2c_v(void)
1212{
1213 return 0x000000f2U;
1214}
1215static inline u32 gmmu_pte_kind_c64_ms8_ms16_2cra_v(void)
1216{
1217 return 0x000000f3U;
1218}
1219static inline u32 gmmu_pte_kind_c128_2c_v(void)
1220{
1221 return 0x000000f4U;
1222}
1223static inline u32 gmmu_pte_kind_c128_2cr_v(void)
1224{
1225 return 0x000000f5U;
1226}
1227static inline u32 gmmu_pte_kind_c128_ms2_2c_v(void)
1228{
1229 return 0x000000f6U;
1230}
1231static inline u32 gmmu_pte_kind_c128_ms2_2cr_v(void)
1232{
1233 return 0x000000f7U;
1234}
1235static inline u32 gmmu_pte_kind_c128_ms4_2c_v(void)
1236{
1237 return 0x000000f8U;
1238}
1239static inline u32 gmmu_pte_kind_c128_ms4_2cr_v(void)
1240{
1241 return 0x000000f9U;
1242}
1243static inline u32 gmmu_pte_kind_c128_ms8_ms16_2c_v(void)
1244{
1245 return 0x000000faU;
1246}
1247static inline u32 gmmu_pte_kind_c128_ms8_ms16_2cr_v(void)
1248{
1249 return 0x000000fbU;
1250}
1251static inline u32 gmmu_pte_kind_x8c24_v(void)
1252{
1253 return 0x000000fcU;
1254}
1255static inline u32 gmmu_pte_kind_pitch_no_swizzle_v(void)
1256{
1257 return 0x000000fdU;
1258}
1259static inline u32 gmmu_pte_kind_smsked_message_v(void)
1260{
1261 return 0x000000caU;
1262}
1263static inline u32 gmmu_pte_kind_smhost_message_v(void)
1264{
1265 return 0x000000cbU;
1266}
1267static inline u32 gmmu_pte_kind_s8_v(void)
1268{
1269 return 0x0000002aU;
1270}
1271static inline u32 gmmu_pte_kind_s8_2s_v(void)
1272{
1273 return 0x0000002bU;
1274}
1275#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_gr_gp106.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_gr_gp106.h
new file mode 100644
index 00000000..2da3ec41
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_gr_gp106.h
@@ -0,0 +1,4111 @@
1/*
2 * Copyright (c) 2016-2017, 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_gr_gp106_h_
57#define _hw_gr_gp106_h_
58
59static inline u32 gr_intr_r(void)
60{
61 return 0x00400100U;
62}
63static inline u32 gr_intr_notify_pending_f(void)
64{
65 return 0x1U;
66}
67static inline u32 gr_intr_notify_reset_f(void)
68{
69 return 0x1U;
70}
71static inline u32 gr_intr_semaphore_pending_f(void)
72{
73 return 0x2U;
74}
75static inline u32 gr_intr_semaphore_reset_f(void)
76{
77 return 0x2U;
78}
79static inline u32 gr_intr_illegal_method_pending_f(void)
80{
81 return 0x10U;
82}
83static inline u32 gr_intr_illegal_method_reset_f(void)
84{
85 return 0x10U;
86}
87static inline u32 gr_intr_illegal_notify_pending_f(void)
88{
89 return 0x40U;
90}
91static inline u32 gr_intr_illegal_notify_reset_f(void)
92{
93 return 0x40U;
94}
95static inline u32 gr_intr_firmware_method_f(u32 v)
96{
97 return (v & 0x1U) << 8U;
98}
99static inline u32 gr_intr_firmware_method_pending_f(void)
100{
101 return 0x100U;
102}
103static inline u32 gr_intr_firmware_method_reset_f(void)
104{
105 return 0x100U;
106}
107static inline u32 gr_intr_illegal_class_pending_f(void)
108{
109 return 0x20U;
110}
111static inline u32 gr_intr_illegal_class_reset_f(void)
112{
113 return 0x20U;
114}
115static inline u32 gr_intr_fecs_error_pending_f(void)
116{
117 return 0x80000U;
118}
119static inline u32 gr_intr_fecs_error_reset_f(void)
120{
121 return 0x80000U;
122}
123static inline u32 gr_intr_class_error_pending_f(void)
124{
125 return 0x100000U;
126}
127static inline u32 gr_intr_class_error_reset_f(void)
128{
129 return 0x100000U;
130}
131static inline u32 gr_intr_exception_pending_f(void)
132{
133 return 0x200000U;
134}
135static inline u32 gr_intr_exception_reset_f(void)
136{
137 return 0x200000U;
138}
139static inline u32 gr_fecs_intr_r(void)
140{
141 return 0x00400144U;
142}
143static inline u32 gr_class_error_r(void)
144{
145 return 0x00400110U;
146}
147static inline u32 gr_class_error_code_v(u32 r)
148{
149 return (r >> 0U) & 0xffffU;
150}
151static inline u32 gr_intr_nonstall_r(void)
152{
153 return 0x00400120U;
154}
155static inline u32 gr_intr_nonstall_trap_pending_f(void)
156{
157 return 0x2U;
158}
159static inline u32 gr_intr_en_r(void)
160{
161 return 0x0040013cU;
162}
163static inline u32 gr_exception_r(void)
164{
165 return 0x00400108U;
166}
167static inline u32 gr_exception_fe_m(void)
168{
169 return 0x1U << 0U;
170}
171static inline u32 gr_exception_gpc_m(void)
172{
173 return 0x1U << 24U;
174}
175static inline u32 gr_exception_memfmt_m(void)
176{
177 return 0x1U << 1U;
178}
179static inline u32 gr_exception_ds_m(void)
180{
181 return 0x1U << 4U;
182}
183static inline u32 gr_exception1_r(void)
184{
185 return 0x00400118U;
186}
187static inline u32 gr_exception1_gpc_0_pending_f(void)
188{
189 return 0x1U;
190}
191static inline u32 gr_exception2_r(void)
192{
193 return 0x0040011cU;
194}
195static inline u32 gr_exception_en_r(void)
196{
197 return 0x00400138U;
198}
199static inline u32 gr_exception_en_fe_m(void)
200{
201 return 0x1U << 0U;
202}
203static inline u32 gr_exception1_en_r(void)
204{
205 return 0x00400130U;
206}
207static inline u32 gr_exception2_en_r(void)
208{
209 return 0x00400134U;
210}
211static inline u32 gr_gpfifo_ctl_r(void)
212{
213 return 0x00400500U;
214}
215static inline u32 gr_gpfifo_ctl_access_f(u32 v)
216{
217 return (v & 0x1U) << 0U;
218}
219static inline u32 gr_gpfifo_ctl_access_disabled_f(void)
220{
221 return 0x0U;
222}
223static inline u32 gr_gpfifo_ctl_access_enabled_f(void)
224{
225 return 0x1U;
226}
227static inline u32 gr_gpfifo_ctl_semaphore_access_f(u32 v)
228{
229 return (v & 0x1U) << 16U;
230}
231static inline u32 gr_gpfifo_ctl_semaphore_access_enabled_v(void)
232{
233 return 0x00000001U;
234}
235static inline u32 gr_gpfifo_ctl_semaphore_access_enabled_f(void)
236{
237 return 0x10000U;
238}
239static inline u32 gr_gpfifo_status_r(void)
240{
241 return 0x00400504U;
242}
243static inline u32 gr_trapped_addr_r(void)
244{
245 return 0x00400704U;
246}
247static inline u32 gr_trapped_addr_mthd_v(u32 r)
248{
249 return (r >> 2U) & 0xfffU;
250}
251static inline u32 gr_trapped_addr_subch_v(u32 r)
252{
253 return (r >> 16U) & 0x7U;
254}
255static inline u32 gr_trapped_addr_mme_generated_v(u32 r)
256{
257 return (r >> 20U) & 0x1U;
258}
259static inline u32 gr_trapped_addr_datahigh_v(u32 r)
260{
261 return (r >> 24U) & 0x1U;
262}
263static inline u32 gr_trapped_addr_priv_v(u32 r)
264{
265 return (r >> 28U) & 0x1U;
266}
267static inline u32 gr_trapped_addr_status_v(u32 r)
268{
269 return (r >> 31U) & 0x1U;
270}
271static inline u32 gr_trapped_data_lo_r(void)
272{
273 return 0x00400708U;
274}
275static inline u32 gr_trapped_data_hi_r(void)
276{
277 return 0x0040070cU;
278}
279static inline u32 gr_trapped_data_mme_r(void)
280{
281 return 0x00400710U;
282}
283static inline u32 gr_trapped_data_mme_pc_v(u32 r)
284{
285 return (r >> 0U) & 0xfffU;
286}
287static inline u32 gr_status_r(void)
288{
289 return 0x00400700U;
290}
291static inline u32 gr_status_fe_method_upper_v(u32 r)
292{
293 return (r >> 1U) & 0x1U;
294}
295static inline u32 gr_status_fe_method_lower_v(u32 r)
296{
297 return (r >> 2U) & 0x1U;
298}
299static inline u32 gr_status_fe_method_lower_idle_v(void)
300{
301 return 0x00000000U;
302}
303static inline u32 gr_status_fe_gi_v(u32 r)
304{
305 return (r >> 21U) & 0x1U;
306}
307static inline u32 gr_status_mask_r(void)
308{
309 return 0x00400610U;
310}
311static inline u32 gr_status_1_r(void)
312{
313 return 0x00400604U;
314}
315static inline u32 gr_status_2_r(void)
316{
317 return 0x00400608U;
318}
319static inline u32 gr_engine_status_r(void)
320{
321 return 0x0040060cU;
322}
323static inline u32 gr_engine_status_value_busy_f(void)
324{
325 return 0x1U;
326}
327static inline u32 gr_pri_be0_becs_be_exception_r(void)
328{
329 return 0x00410204U;
330}
331static inline u32 gr_pri_be0_becs_be_exception_en_r(void)
332{
333 return 0x00410208U;
334}
335static inline u32 gr_pri_gpc0_gpccs_gpc_exception_r(void)
336{
337 return 0x00502c90U;
338}
339static inline u32 gr_pri_gpc0_gpccs_gpc_exception_en_r(void)
340{
341 return 0x00502c94U;
342}
343static inline u32 gr_pri_gpc0_tpc0_tpccs_tpc_exception_r(void)
344{
345 return 0x00504508U;
346}
347static inline u32 gr_pri_gpc0_tpc0_tpccs_tpc_exception_en_r(void)
348{
349 return 0x0050450cU;
350}
351static inline u32 gr_activity_0_r(void)
352{
353 return 0x00400380U;
354}
355static inline u32 gr_activity_1_r(void)
356{
357 return 0x00400384U;
358}
359static inline u32 gr_activity_2_r(void)
360{
361 return 0x00400388U;
362}
363static inline u32 gr_activity_4_r(void)
364{
365 return 0x00400390U;
366}
367static inline u32 gr_activity_4_gpc0_s(void)
368{
369 return 3U;
370}
371static inline u32 gr_activity_4_gpc0_f(u32 v)
372{
373 return (v & 0x7U) << 0U;
374}
375static inline u32 gr_activity_4_gpc0_m(void)
376{
377 return 0x7U << 0U;
378}
379static inline u32 gr_activity_4_gpc0_v(u32 r)
380{
381 return (r >> 0U) & 0x7U;
382}
383static inline u32 gr_activity_4_gpc0_empty_v(void)
384{
385 return 0x00000000U;
386}
387static inline u32 gr_activity_4_gpc0_preempted_v(void)
388{
389 return 0x00000004U;
390}
391static inline u32 gr_pri_gpc0_gcc_dbg_r(void)
392{
393 return 0x00501000U;
394}
395static inline u32 gr_pri_gpcs_gcc_dbg_r(void)
396{
397 return 0x00419000U;
398}
399static inline u32 gr_pri_gpcs_gcc_dbg_invalidate_m(void)
400{
401 return 0x1U << 1U;
402}
403static inline u32 gr_pri_gpc0_tpc0_sm_cache_control_r(void)
404{
405 return 0x005046a4U;
406}
407static inline u32 gr_pri_gpcs_tpcs_sm_cache_control_r(void)
408{
409 return 0x00419ea4U;
410}
411static inline u32 gr_pri_gpcs_tpcs_sm_cache_control_invalidate_cache_m(void)
412{
413 return 0x1U << 0U;
414}
415static inline u32 gr_pri_sked_activity_r(void)
416{
417 return 0x00407054U;
418}
419static inline u32 gr_pri_gpc0_gpccs_gpc_activity0_r(void)
420{
421 return 0x00502c80U;
422}
423static inline u32 gr_pri_gpc0_gpccs_gpc_activity1_r(void)
424{
425 return 0x00502c84U;
426}
427static inline u32 gr_pri_gpc0_gpccs_gpc_activity2_r(void)
428{
429 return 0x00502c88U;
430}
431static inline u32 gr_pri_gpc0_gpccs_gpc_activity3_r(void)
432{
433 return 0x00502c8cU;
434}
435static inline u32 gr_pri_gpc0_tpc0_tpccs_tpc_activity_0_r(void)
436{
437 return 0x00504500U;
438}
439static inline u32 gr_pri_gpc0_tpc1_tpccs_tpc_activity_0_r(void)
440{
441 return 0x00504d00U;
442}
443static inline u32 gr_pri_gpc0_tpcs_tpccs_tpc_activity_0_r(void)
444{
445 return 0x00501d00U;
446}
447static inline u32 gr_pri_gpcs_gpccs_gpc_activity_0_r(void)
448{
449 return 0x0041ac80U;
450}
451static inline u32 gr_pri_gpcs_gpccs_gpc_activity_1_r(void)
452{
453 return 0x0041ac84U;
454}
455static inline u32 gr_pri_gpcs_gpccs_gpc_activity_2_r(void)
456{
457 return 0x0041ac88U;
458}
459static inline u32 gr_pri_gpcs_gpccs_gpc_activity_3_r(void)
460{
461 return 0x0041ac8cU;
462}
463static inline u32 gr_pri_gpcs_tpc0_tpccs_tpc_activity_0_r(void)
464{
465 return 0x0041c500U;
466}
467static inline u32 gr_pri_gpcs_tpc1_tpccs_tpc_activity_0_r(void)
468{
469 return 0x0041cd00U;
470}
471static inline u32 gr_pri_gpcs_tpcs_tpccs_tpc_activity_0_r(void)
472{
473 return 0x00419d00U;
474}
475static inline u32 gr_pri_be0_becs_be_activity0_r(void)
476{
477 return 0x00410200U;
478}
479static inline u32 gr_pri_be1_becs_be_activity0_r(void)
480{
481 return 0x00410600U;
482}
483static inline u32 gr_pri_bes_becs_be_activity0_r(void)
484{
485 return 0x00408a00U;
486}
487static inline u32 gr_pri_ds_mpipe_status_r(void)
488{
489 return 0x00405858U;
490}
491static inline u32 gr_pri_fe_go_idle_info_r(void)
492{
493 return 0x00404194U;
494}
495static inline u32 gr_pri_gpc0_tpc0_tex_m_tex_subunits_status_r(void)
496{
497 return 0x00504238U;
498}
499static inline u32 gr_pri_gpc0_tpc0_sm_lrf_ecc_status_r(void)
500{
501 return 0x005046b8U;
502}
503static inline u32 gr_pri_gpc0_tpc0_sm_lrf_ecc_status_single_err_detected_qrfdp0_pending_f(void)
504{
505 return 0x10U;
506}
507static inline u32 gr_pri_gpc0_tpc0_sm_lrf_ecc_status_single_err_detected_qrfdp1_pending_f(void)
508{
509 return 0x20U;
510}
511static inline u32 gr_pri_gpc0_tpc0_sm_lrf_ecc_status_single_err_detected_qrfdp2_pending_f(void)
512{
513 return 0x40U;
514}
515static inline u32 gr_pri_gpc0_tpc0_sm_lrf_ecc_status_single_err_detected_qrfdp3_pending_f(void)
516{
517 return 0x80U;
518}
519static inline u32 gr_pri_gpc0_tpc0_sm_lrf_ecc_status_double_err_detected_qrfdp0_pending_f(void)
520{
521 return 0x100U;
522}
523static inline u32 gr_pri_gpc0_tpc0_sm_lrf_ecc_status_double_err_detected_qrfdp1_pending_f(void)
524{
525 return 0x200U;
526}
527static inline u32 gr_pri_gpc0_tpc0_sm_lrf_ecc_status_double_err_detected_qrfdp2_pending_f(void)
528{
529 return 0x400U;
530}
531static inline u32 gr_pri_gpc0_tpc0_sm_lrf_ecc_status_double_err_detected_qrfdp3_pending_f(void)
532{
533 return 0x800U;
534}
535static inline u32 gr_pri_gpc0_tpc0_sm_shm_ecc_status_r(void)
536{
537 return 0x005044a0U;
538}
539static inline u32 gr_pri_gpc0_tpc0_sm_shm_ecc_status_single_err_corrected_shm0_pending_f(void)
540{
541 return 0x1U;
542}
543static inline u32 gr_pri_gpc0_tpc0_sm_shm_ecc_status_single_err_corrected_shm1_pending_f(void)
544{
545 return 0x2U;
546}
547static inline u32 gr_pri_gpc0_tpc0_sm_shm_ecc_status_single_err_detected_shm0_pending_f(void)
548{
549 return 0x10U;
550}
551static inline u32 gr_pri_gpc0_tpc0_sm_shm_ecc_status_single_err_detected_shm1_pending_f(void)
552{
553 return 0x20U;
554}
555static inline u32 gr_pri_gpc0_tpc0_sm_shm_ecc_status_double_err_detected_shm0_pending_f(void)
556{
557 return 0x100U;
558}
559static inline u32 gr_pri_gpc0_tpc0_sm_shm_ecc_status_double_err_detected_shm1_pending_f(void)
560{
561 return 0x200U;
562}
563static inline u32 gr_pri_gpc0_tpc0_sm_lrf_ecc_single_err_count_r(void)
564{
565 return 0x005046bcU;
566}
567static inline u32 gr_pri_gpc0_tpc0_sm_lrf_ecc_double_err_count_r(void)
568{
569 return 0x005046c0U;
570}
571static inline u32 gr_pri_gpc0_tpc0_sm_shm_ecc_err_count_r(void)
572{
573 return 0x005044a4U;
574}
575static inline u32 gr_pri_gpc0_tpc0_sm_shm_ecc_err_count_single_corrected_m(void)
576{
577 return 0xffU << 0U;
578}
579static inline u32 gr_pri_gpc0_tpc0_sm_shm_ecc_err_count_single_corrected_v(u32 r)
580{
581 return (r >> 0U) & 0xffU;
582}
583static inline u32 gr_pri_gpc0_tpc0_sm_shm_ecc_err_count_single_detected_m(void)
584{
585 return 0xffU << 8U;
586}
587static inline u32 gr_pri_gpc0_tpc0_sm_shm_ecc_err_count_single_detected_v(u32 r)
588{
589 return (r >> 8U) & 0xffU;
590}
591static inline u32 gr_pri_gpc0_tpc0_sm_shm_ecc_err_count_double_detected_m(void)
592{
593 return 0xffU << 16U;
594}
595static inline u32 gr_pri_gpc0_tpc0_sm_shm_ecc_err_count_double_detected_v(u32 r)
596{
597 return (r >> 16U) & 0xffU;
598}
599static inline u32 gr_pri_gpc0_tpc0_tex_m_routing_r(void)
600{
601 return 0x005042c4U;
602}
603static inline u32 gr_pri_gpc0_tpc0_tex_m_routing_sel_default_f(void)
604{
605 return 0x0U;
606}
607static inline u32 gr_pri_gpc0_tpc0_tex_m_routing_sel_pipe0_f(void)
608{
609 return 0x1U;
610}
611static inline u32 gr_pri_gpc0_tpc0_tex_m_routing_sel_pipe1_f(void)
612{
613 return 0x2U;
614}
615static inline u32 gr_pri_be0_crop_status1_r(void)
616{
617 return 0x00410134U;
618}
619static inline u32 gr_pri_bes_crop_status1_r(void)
620{
621 return 0x00408934U;
622}
623static inline u32 gr_pri_be0_zrop_status_r(void)
624{
625 return 0x00410048U;
626}
627static inline u32 gr_pri_be0_zrop_status2_r(void)
628{
629 return 0x0041004cU;
630}
631static inline u32 gr_pri_bes_zrop_status_r(void)
632{
633 return 0x00408848U;
634}
635static inline u32 gr_pri_bes_zrop_status2_r(void)
636{
637 return 0x0040884cU;
638}
639static inline u32 gr_pipe_bundle_address_r(void)
640{
641 return 0x00400200U;
642}
643static inline u32 gr_pipe_bundle_address_value_v(u32 r)
644{
645 return (r >> 0U) & 0xffffU;
646}
647static inline u32 gr_pipe_bundle_data_r(void)
648{
649 return 0x00400204U;
650}
651static inline u32 gr_pipe_bundle_config_r(void)
652{
653 return 0x00400208U;
654}
655static inline u32 gr_pipe_bundle_config_override_pipe_mode_disabled_f(void)
656{
657 return 0x0U;
658}
659static inline u32 gr_pipe_bundle_config_override_pipe_mode_enabled_f(void)
660{
661 return 0x80000000U;
662}
663static inline u32 gr_fe_hww_esr_r(void)
664{
665 return 0x00404000U;
666}
667static inline u32 gr_fe_hww_esr_reset_active_f(void)
668{
669 return 0x40000000U;
670}
671static inline u32 gr_fe_hww_esr_en_enable_f(void)
672{
673 return 0x80000000U;
674}
675static inline u32 gr_fe_go_idle_timeout_r(void)
676{
677 return 0x00404154U;
678}
679static inline u32 gr_fe_go_idle_timeout_count_f(u32 v)
680{
681 return (v & 0xffffffffU) << 0U;
682}
683static inline u32 gr_fe_go_idle_timeout_count_disabled_f(void)
684{
685 return 0x0U;
686}
687static inline u32 gr_fe_go_idle_timeout_count_prod_f(void)
688{
689 return 0x1800U;
690}
691static inline u32 gr_fe_object_table_r(u32 i)
692{
693 return 0x00404200U + i*4U;
694}
695static inline u32 gr_fe_object_table_nvclass_v(u32 r)
696{
697 return (r >> 0U) & 0xffffU;
698}
699static inline u32 gr_fe_tpc_fs_r(void)
700{
701 return 0x004041c4U;
702}
703static inline u32 gr_pri_mme_shadow_raw_index_r(void)
704{
705 return 0x00404488U;
706}
707static inline u32 gr_pri_mme_shadow_raw_index_write_trigger_f(void)
708{
709 return 0x80000000U;
710}
711static inline u32 gr_pri_mme_shadow_raw_data_r(void)
712{
713 return 0x0040448cU;
714}
715static inline u32 gr_mme_hww_esr_r(void)
716{
717 return 0x00404490U;
718}
719static inline u32 gr_mme_hww_esr_reset_active_f(void)
720{
721 return 0x40000000U;
722}
723static inline u32 gr_mme_hww_esr_en_enable_f(void)
724{
725 return 0x80000000U;
726}
727static inline u32 gr_memfmt_hww_esr_r(void)
728{
729 return 0x00404600U;
730}
731static inline u32 gr_memfmt_hww_esr_reset_active_f(void)
732{
733 return 0x40000000U;
734}
735static inline u32 gr_memfmt_hww_esr_en_enable_f(void)
736{
737 return 0x80000000U;
738}
739static inline u32 gr_fecs_cpuctl_r(void)
740{
741 return 0x00409100U;
742}
743static inline u32 gr_fecs_cpuctl_startcpu_f(u32 v)
744{
745 return (v & 0x1U) << 1U;
746}
747static inline u32 gr_fecs_cpuctl_alias_r(void)
748{
749 return 0x00409130U;
750}
751static inline u32 gr_fecs_cpuctl_alias_startcpu_f(u32 v)
752{
753 return (v & 0x1U) << 1U;
754}
755static inline u32 gr_fecs_dmactl_r(void)
756{
757 return 0x0040910cU;
758}
759static inline u32 gr_fecs_dmactl_require_ctx_f(u32 v)
760{
761 return (v & 0x1U) << 0U;
762}
763static inline u32 gr_fecs_dmactl_dmem_scrubbing_m(void)
764{
765 return 0x1U << 1U;
766}
767static inline u32 gr_fecs_dmactl_imem_scrubbing_m(void)
768{
769 return 0x1U << 2U;
770}
771static inline u32 gr_fecs_os_r(void)
772{
773 return 0x00409080U;
774}
775static inline u32 gr_fecs_idlestate_r(void)
776{
777 return 0x0040904cU;
778}
779static inline u32 gr_fecs_mailbox0_r(void)
780{
781 return 0x00409040U;
782}
783static inline u32 gr_fecs_mailbox1_r(void)
784{
785 return 0x00409044U;
786}
787static inline u32 gr_fecs_irqstat_r(void)
788{
789 return 0x00409008U;
790}
791static inline u32 gr_fecs_irqmode_r(void)
792{
793 return 0x0040900cU;
794}
795static inline u32 gr_fecs_irqmask_r(void)
796{
797 return 0x00409018U;
798}
799static inline u32 gr_fecs_irqdest_r(void)
800{
801 return 0x0040901cU;
802}
803static inline u32 gr_fecs_curctx_r(void)
804{
805 return 0x00409050U;
806}
807static inline u32 gr_fecs_nxtctx_r(void)
808{
809 return 0x00409054U;
810}
811static inline u32 gr_fecs_engctl_r(void)
812{
813 return 0x004090a4U;
814}
815static inline u32 gr_fecs_debug1_r(void)
816{
817 return 0x00409090U;
818}
819static inline u32 gr_fecs_debuginfo_r(void)
820{
821 return 0x00409094U;
822}
823static inline u32 gr_fecs_icd_cmd_r(void)
824{
825 return 0x00409200U;
826}
827static inline u32 gr_fecs_icd_cmd_opc_s(void)
828{
829 return 4U;
830}
831static inline u32 gr_fecs_icd_cmd_opc_f(u32 v)
832{
833 return (v & 0xfU) << 0U;
834}
835static inline u32 gr_fecs_icd_cmd_opc_m(void)
836{
837 return 0xfU << 0U;
838}
839static inline u32 gr_fecs_icd_cmd_opc_v(u32 r)
840{
841 return (r >> 0U) & 0xfU;
842}
843static inline u32 gr_fecs_icd_cmd_opc_rreg_f(void)
844{
845 return 0x8U;
846}
847static inline u32 gr_fecs_icd_cmd_opc_rstat_f(void)
848{
849 return 0xeU;
850}
851static inline u32 gr_fecs_icd_cmd_idx_f(u32 v)
852{
853 return (v & 0x1fU) << 8U;
854}
855static inline u32 gr_fecs_icd_rdata_r(void)
856{
857 return 0x0040920cU;
858}
859static inline u32 gr_fecs_imemc_r(u32 i)
860{
861 return 0x00409180U + i*16U;
862}
863static inline u32 gr_fecs_imemc_offs_f(u32 v)
864{
865 return (v & 0x3fU) << 2U;
866}
867static inline u32 gr_fecs_imemc_blk_f(u32 v)
868{
869 return (v & 0xffU) << 8U;
870}
871static inline u32 gr_fecs_imemc_aincw_f(u32 v)
872{
873 return (v & 0x1U) << 24U;
874}
875static inline u32 gr_fecs_imemd_r(u32 i)
876{
877 return 0x00409184U + i*16U;
878}
879static inline u32 gr_fecs_imemt_r(u32 i)
880{
881 return 0x00409188U + i*16U;
882}
883static inline u32 gr_fecs_imemt_tag_f(u32 v)
884{
885 return (v & 0xffffU) << 0U;
886}
887static inline u32 gr_fecs_dmemc_r(u32 i)
888{
889 return 0x004091c0U + i*8U;
890}
891static inline u32 gr_fecs_dmemc_offs_s(void)
892{
893 return 6U;
894}
895static inline u32 gr_fecs_dmemc_offs_f(u32 v)
896{
897 return (v & 0x3fU) << 2U;
898}
899static inline u32 gr_fecs_dmemc_offs_m(void)
900{
901 return 0x3fU << 2U;
902}
903static inline u32 gr_fecs_dmemc_offs_v(u32 r)
904{
905 return (r >> 2U) & 0x3fU;
906}
907static inline u32 gr_fecs_dmemc_blk_f(u32 v)
908{
909 return (v & 0xffU) << 8U;
910}
911static inline u32 gr_fecs_dmemc_aincw_f(u32 v)
912{
913 return (v & 0x1U) << 24U;
914}
915static inline u32 gr_fecs_dmemd_r(u32 i)
916{
917 return 0x004091c4U + i*8U;
918}
919static inline u32 gr_fecs_dmatrfbase_r(void)
920{
921 return 0x00409110U;
922}
923static inline u32 gr_fecs_dmatrfmoffs_r(void)
924{
925 return 0x00409114U;
926}
927static inline u32 gr_fecs_dmatrffboffs_r(void)
928{
929 return 0x0040911cU;
930}
931static inline u32 gr_fecs_dmatrfcmd_r(void)
932{
933 return 0x00409118U;
934}
935static inline u32 gr_fecs_dmatrfcmd_imem_f(u32 v)
936{
937 return (v & 0x1U) << 4U;
938}
939static inline u32 gr_fecs_dmatrfcmd_write_f(u32 v)
940{
941 return (v & 0x1U) << 5U;
942}
943static inline u32 gr_fecs_dmatrfcmd_size_f(u32 v)
944{
945 return (v & 0x7U) << 8U;
946}
947static inline u32 gr_fecs_dmatrfcmd_ctxdma_f(u32 v)
948{
949 return (v & 0x7U) << 12U;
950}
951static inline u32 gr_fecs_bootvec_r(void)
952{
953 return 0x00409104U;
954}
955static inline u32 gr_fecs_bootvec_vec_f(u32 v)
956{
957 return (v & 0xffffffffU) << 0U;
958}
959static inline u32 gr_fecs_falcon_hwcfg_r(void)
960{
961 return 0x00409108U;
962}
963static inline u32 gr_gpcs_gpccs_falcon_hwcfg_r(void)
964{
965 return 0x0041a108U;
966}
967static inline u32 gr_fecs_falcon_rm_r(void)
968{
969 return 0x00409084U;
970}
971static inline u32 gr_fecs_current_ctx_r(void)
972{
973 return 0x00409b00U;
974}
975static inline u32 gr_fecs_current_ctx_ptr_f(u32 v)
976{
977 return (v & 0xfffffffU) << 0U;
978}
979static inline u32 gr_fecs_current_ctx_ptr_v(u32 r)
980{
981 return (r >> 0U) & 0xfffffffU;
982}
983static inline u32 gr_fecs_current_ctx_target_s(void)
984{
985 return 2U;
986}
987static inline u32 gr_fecs_current_ctx_target_f(u32 v)
988{
989 return (v & 0x3U) << 28U;
990}
991static inline u32 gr_fecs_current_ctx_target_m(void)
992{
993 return 0x3U << 28U;
994}
995static inline u32 gr_fecs_current_ctx_target_v(u32 r)
996{
997 return (r >> 28U) & 0x3U;
998}
999static inline u32 gr_fecs_current_ctx_target_vid_mem_f(void)
1000{
1001 return 0x0U;
1002}
1003static inline u32 gr_fecs_current_ctx_target_sys_mem_coh_f(void)
1004{
1005 return 0x20000000U;
1006}
1007static inline u32 gr_fecs_current_ctx_target_sys_mem_ncoh_f(void)
1008{
1009 return 0x30000000U;
1010}
1011static inline u32 gr_fecs_current_ctx_valid_s(void)
1012{
1013 return 1U;
1014}
1015static inline u32 gr_fecs_current_ctx_valid_f(u32 v)
1016{
1017 return (v & 0x1U) << 31U;
1018}
1019static inline u32 gr_fecs_current_ctx_valid_m(void)
1020{
1021 return 0x1U << 31U;
1022}
1023static inline u32 gr_fecs_current_ctx_valid_v(u32 r)
1024{
1025 return (r >> 31U) & 0x1U;
1026}
1027static inline u32 gr_fecs_current_ctx_valid_false_f(void)
1028{
1029 return 0x0U;
1030}
1031static inline u32 gr_fecs_method_data_r(void)
1032{
1033 return 0x00409500U;
1034}
1035static inline u32 gr_fecs_method_push_r(void)
1036{
1037 return 0x00409504U;
1038}
1039static inline u32 gr_fecs_method_push_adr_f(u32 v)
1040{
1041 return (v & 0xfffU) << 0U;
1042}
1043static inline u32 gr_fecs_method_push_adr_bind_pointer_v(void)
1044{
1045 return 0x00000003U;
1046}
1047static inline u32 gr_fecs_method_push_adr_bind_pointer_f(void)
1048{
1049 return 0x3U;
1050}
1051static inline u32 gr_fecs_method_push_adr_discover_image_size_v(void)
1052{
1053 return 0x00000010U;
1054}
1055static inline u32 gr_fecs_method_push_adr_wfi_golden_save_v(void)
1056{
1057 return 0x00000009U;
1058}
1059static inline u32 gr_fecs_method_push_adr_restore_golden_v(void)
1060{
1061 return 0x00000015U;
1062}
1063static inline u32 gr_fecs_method_push_adr_discover_zcull_image_size_v(void)
1064{
1065 return 0x00000016U;
1066}
1067static inline u32 gr_fecs_method_push_adr_discover_pm_image_size_v(void)
1068{
1069 return 0x00000025U;
1070}
1071static inline u32 gr_fecs_method_push_adr_discover_reglist_image_size_v(void)
1072{
1073 return 0x00000030U;
1074}
1075static inline u32 gr_fecs_method_push_adr_set_reglist_bind_instance_v(void)
1076{
1077 return 0x00000031U;
1078}
1079static inline u32 gr_fecs_method_push_adr_set_reglist_virtual_address_v(void)
1080{
1081 return 0x00000032U;
1082}
1083static inline u32 gr_fecs_method_push_adr_stop_ctxsw_v(void)
1084{
1085 return 0x00000038U;
1086}
1087static inline u32 gr_fecs_method_push_adr_start_ctxsw_v(void)
1088{
1089 return 0x00000039U;
1090}
1091static inline u32 gr_fecs_method_push_adr_set_watchdog_timeout_f(void)
1092{
1093 return 0x21U;
1094}
1095static inline u32 gr_fecs_method_push_adr_discover_preemption_image_size_v(void)
1096{
1097 return 0x0000001aU;
1098}
1099static inline u32 gr_fecs_method_push_adr_halt_pipeline_v(void)
1100{
1101 return 0x00000004U;
1102}
1103static inline u32 gr_fecs_host_int_status_r(void)
1104{
1105 return 0x00409c18U;
1106}
1107static inline u32 gr_fecs_host_int_status_fault_during_ctxsw_f(u32 v)
1108{
1109 return (v & 0x1U) << 16U;
1110}
1111static inline u32 gr_fecs_host_int_status_umimp_firmware_method_f(u32 v)
1112{
1113 return (v & 0x1U) << 17U;
1114}
1115static inline u32 gr_fecs_host_int_status_umimp_illegal_method_f(u32 v)
1116{
1117 return (v & 0x1U) << 18U;
1118}
1119static inline u32 gr_fecs_host_int_clear_r(void)
1120{
1121 return 0x00409c20U;
1122}
1123static inline u32 gr_fecs_host_int_enable_r(void)
1124{
1125 return 0x00409c24U;
1126}
1127static inline u32 gr_fecs_host_int_enable_fault_during_ctxsw_enable_f(void)
1128{
1129 return 0x10000U;
1130}
1131static inline u32 gr_fecs_host_int_enable_umimp_firmware_method_enable_f(void)
1132{
1133 return 0x20000U;
1134}
1135static inline u32 gr_fecs_host_int_enable_umimp_illegal_method_enable_f(void)
1136{
1137 return 0x40000U;
1138}
1139static inline u32 gr_fecs_host_int_enable_watchdog_enable_f(void)
1140{
1141 return 0x80000U;
1142}
1143static inline u32 gr_fecs_ctxsw_reset_ctl_r(void)
1144{
1145 return 0x00409614U;
1146}
1147static inline u32 gr_fecs_ctxsw_reset_ctl_sys_halt_disabled_f(void)
1148{
1149 return 0x0U;
1150}
1151static inline u32 gr_fecs_ctxsw_reset_ctl_gpc_halt_disabled_f(void)
1152{
1153 return 0x0U;
1154}
1155static inline u32 gr_fecs_ctxsw_reset_ctl_be_halt_disabled_f(void)
1156{
1157 return 0x0U;
1158}
1159static inline u32 gr_fecs_ctxsw_reset_ctl_sys_engine_reset_disabled_f(void)
1160{
1161 return 0x10U;
1162}
1163static inline u32 gr_fecs_ctxsw_reset_ctl_gpc_engine_reset_disabled_f(void)
1164{
1165 return 0x20U;
1166}
1167static inline u32 gr_fecs_ctxsw_reset_ctl_be_engine_reset_disabled_f(void)
1168{
1169 return 0x40U;
1170}
1171static inline u32 gr_fecs_ctxsw_reset_ctl_sys_context_reset_enabled_f(void)
1172{
1173 return 0x0U;
1174}
1175static inline u32 gr_fecs_ctxsw_reset_ctl_sys_context_reset_disabled_f(void)
1176{
1177 return 0x100U;
1178}
1179static inline u32 gr_fecs_ctxsw_reset_ctl_gpc_context_reset_enabled_f(void)
1180{
1181 return 0x0U;
1182}
1183static inline u32 gr_fecs_ctxsw_reset_ctl_gpc_context_reset_disabled_f(void)
1184{
1185 return 0x200U;
1186}
1187static inline u32 gr_fecs_ctxsw_reset_ctl_be_context_reset_s(void)
1188{
1189 return 1U;
1190}
1191static inline u32 gr_fecs_ctxsw_reset_ctl_be_context_reset_f(u32 v)
1192{
1193 return (v & 0x1U) << 10U;
1194}
1195static inline u32 gr_fecs_ctxsw_reset_ctl_be_context_reset_m(void)
1196{
1197 return 0x1U << 10U;
1198}
1199static inline u32 gr_fecs_ctxsw_reset_ctl_be_context_reset_v(u32 r)
1200{
1201 return (r >> 10U) & 0x1U;
1202}
1203static inline u32 gr_fecs_ctxsw_reset_ctl_be_context_reset_enabled_f(void)
1204{
1205 return 0x0U;
1206}
1207static inline u32 gr_fecs_ctxsw_reset_ctl_be_context_reset_disabled_f(void)
1208{
1209 return 0x400U;
1210}
1211static inline u32 gr_fecs_ctx_state_store_major_rev_id_r(void)
1212{
1213 return 0x0040960cU;
1214}
1215static inline u32 gr_fecs_ctxsw_mailbox_r(u32 i)
1216{
1217 return 0x00409800U + i*4U;
1218}
1219static inline u32 gr_fecs_ctxsw_mailbox__size_1_v(void)
1220{
1221 return 0x00000010U;
1222}
1223static inline u32 gr_fecs_ctxsw_mailbox_value_f(u32 v)
1224{
1225 return (v & 0xffffffffU) << 0U;
1226}
1227static inline u32 gr_fecs_ctxsw_mailbox_value_pass_v(void)
1228{
1229 return 0x00000001U;
1230}
1231static inline u32 gr_fecs_ctxsw_mailbox_value_fail_v(void)
1232{
1233 return 0x00000002U;
1234}
1235static inline u32 gr_fecs_ctxsw_mailbox_set_r(u32 i)
1236{
1237 return 0x004098c0U + i*4U;
1238}
1239static inline u32 gr_fecs_ctxsw_mailbox_set_value_f(u32 v)
1240{
1241 return (v & 0xffffffffU) << 0U;
1242}
1243static inline u32 gr_fecs_ctxsw_mailbox_clear_r(u32 i)
1244{
1245 return 0x00409840U + i*4U;
1246}
1247static inline u32 gr_fecs_ctxsw_mailbox_clear_value_f(u32 v)
1248{
1249 return (v & 0xffffffffU) << 0U;
1250}
1251static inline u32 gr_fecs_fs_r(void)
1252{
1253 return 0x00409604U;
1254}
1255static inline u32 gr_fecs_fs_num_available_gpcs_s(void)
1256{
1257 return 5U;
1258}
1259static inline u32 gr_fecs_fs_num_available_gpcs_f(u32 v)
1260{
1261 return (v & 0x1fU) << 0U;
1262}
1263static inline u32 gr_fecs_fs_num_available_gpcs_m(void)
1264{
1265 return 0x1fU << 0U;
1266}
1267static inline u32 gr_fecs_fs_num_available_gpcs_v(u32 r)
1268{
1269 return (r >> 0U) & 0x1fU;
1270}
1271static inline u32 gr_fecs_fs_num_available_fbps_s(void)
1272{
1273 return 5U;
1274}
1275static inline u32 gr_fecs_fs_num_available_fbps_f(u32 v)
1276{
1277 return (v & 0x1fU) << 16U;
1278}
1279static inline u32 gr_fecs_fs_num_available_fbps_m(void)
1280{
1281 return 0x1fU << 16U;
1282}
1283static inline u32 gr_fecs_fs_num_available_fbps_v(u32 r)
1284{
1285 return (r >> 16U) & 0x1fU;
1286}
1287static inline u32 gr_fecs_cfg_r(void)
1288{
1289 return 0x00409620U;
1290}
1291static inline u32 gr_fecs_cfg_imem_sz_v(u32 r)
1292{
1293 return (r >> 0U) & 0xffU;
1294}
1295static inline u32 gr_fecs_rc_lanes_r(void)
1296{
1297 return 0x00409880U;
1298}
1299static inline u32 gr_fecs_rc_lanes_num_chains_s(void)
1300{
1301 return 6U;
1302}
1303static inline u32 gr_fecs_rc_lanes_num_chains_f(u32 v)
1304{
1305 return (v & 0x3fU) << 0U;
1306}
1307static inline u32 gr_fecs_rc_lanes_num_chains_m(void)
1308{
1309 return 0x3fU << 0U;
1310}
1311static inline u32 gr_fecs_rc_lanes_num_chains_v(u32 r)
1312{
1313 return (r >> 0U) & 0x3fU;
1314}
1315static inline u32 gr_fecs_ctxsw_status_1_r(void)
1316{
1317 return 0x00409400U;
1318}
1319static inline u32 gr_fecs_ctxsw_status_1_arb_busy_s(void)
1320{
1321 return 1U;
1322}
1323static inline u32 gr_fecs_ctxsw_status_1_arb_busy_f(u32 v)
1324{
1325 return (v & 0x1U) << 12U;
1326}
1327static inline u32 gr_fecs_ctxsw_status_1_arb_busy_m(void)
1328{
1329 return 0x1U << 12U;
1330}
1331static inline u32 gr_fecs_ctxsw_status_1_arb_busy_v(u32 r)
1332{
1333 return (r >> 12U) & 0x1U;
1334}
1335static inline u32 gr_fecs_arb_ctx_adr_r(void)
1336{
1337 return 0x00409a24U;
1338}
1339static inline u32 gr_fecs_new_ctx_r(void)
1340{
1341 return 0x00409b04U;
1342}
1343static inline u32 gr_fecs_new_ctx_ptr_s(void)
1344{
1345 return 28U;
1346}
1347static inline u32 gr_fecs_new_ctx_ptr_f(u32 v)
1348{
1349 return (v & 0xfffffffU) << 0U;
1350}
1351static inline u32 gr_fecs_new_ctx_ptr_m(void)
1352{
1353 return 0xfffffffU << 0U;
1354}
1355static inline u32 gr_fecs_new_ctx_ptr_v(u32 r)
1356{
1357 return (r >> 0U) & 0xfffffffU;
1358}
1359static inline u32 gr_fecs_new_ctx_target_s(void)
1360{
1361 return 2U;
1362}
1363static inline u32 gr_fecs_new_ctx_target_f(u32 v)
1364{
1365 return (v & 0x3U) << 28U;
1366}
1367static inline u32 gr_fecs_new_ctx_target_m(void)
1368{
1369 return 0x3U << 28U;
1370}
1371static inline u32 gr_fecs_new_ctx_target_v(u32 r)
1372{
1373 return (r >> 28U) & 0x3U;
1374}
1375static inline u32 gr_fecs_new_ctx_target_vid_mem_f(void)
1376{
1377 return 0x0U;
1378}
1379static inline u32 gr_fecs_new_ctx_target_sys_mem_ncoh_f(void)
1380{
1381 return 0x30000000U;
1382}
1383static inline u32 gr_fecs_new_ctx_valid_s(void)
1384{
1385 return 1U;
1386}
1387static inline u32 gr_fecs_new_ctx_valid_f(u32 v)
1388{
1389 return (v & 0x1U) << 31U;
1390}
1391static inline u32 gr_fecs_new_ctx_valid_m(void)
1392{
1393 return 0x1U << 31U;
1394}
1395static inline u32 gr_fecs_new_ctx_valid_v(u32 r)
1396{
1397 return (r >> 31U) & 0x1U;
1398}
1399static inline u32 gr_fecs_arb_ctx_ptr_r(void)
1400{
1401 return 0x00409a0cU;
1402}
1403static inline u32 gr_fecs_arb_ctx_ptr_ptr_s(void)
1404{
1405 return 28U;
1406}
1407static inline u32 gr_fecs_arb_ctx_ptr_ptr_f(u32 v)
1408{
1409 return (v & 0xfffffffU) << 0U;
1410}
1411static inline u32 gr_fecs_arb_ctx_ptr_ptr_m(void)
1412{
1413 return 0xfffffffU << 0U;
1414}
1415static inline u32 gr_fecs_arb_ctx_ptr_ptr_v(u32 r)
1416{
1417 return (r >> 0U) & 0xfffffffU;
1418}
1419static inline u32 gr_fecs_arb_ctx_ptr_target_s(void)
1420{
1421 return 2U;
1422}
1423static inline u32 gr_fecs_arb_ctx_ptr_target_f(u32 v)
1424{
1425 return (v & 0x3U) << 28U;
1426}
1427static inline u32 gr_fecs_arb_ctx_ptr_target_m(void)
1428{
1429 return 0x3U << 28U;
1430}
1431static inline u32 gr_fecs_arb_ctx_ptr_target_v(u32 r)
1432{
1433 return (r >> 28U) & 0x3U;
1434}
1435static inline u32 gr_fecs_arb_ctx_ptr_target_vid_mem_f(void)
1436{
1437 return 0x0U;
1438}
1439static inline u32 gr_fecs_arb_ctx_ptr_target_sys_mem_ncoh_f(void)
1440{
1441 return 0x30000000U;
1442}
1443static inline u32 gr_fecs_arb_ctx_cmd_r(void)
1444{
1445 return 0x00409a10U;
1446}
1447static inline u32 gr_fecs_arb_ctx_cmd_cmd_s(void)
1448{
1449 return 5U;
1450}
1451static inline u32 gr_fecs_arb_ctx_cmd_cmd_f(u32 v)
1452{
1453 return (v & 0x1fU) << 0U;
1454}
1455static inline u32 gr_fecs_arb_ctx_cmd_cmd_m(void)
1456{
1457 return 0x1fU << 0U;
1458}
1459static inline u32 gr_fecs_arb_ctx_cmd_cmd_v(u32 r)
1460{
1461 return (r >> 0U) & 0x1fU;
1462}
1463static inline u32 gr_fecs_ctxsw_status_fe_0_r(void)
1464{
1465 return 0x00409c00U;
1466}
1467static inline u32 gr_gpc0_gpccs_ctxsw_status_gpc_0_r(void)
1468{
1469 return 0x00502c04U;
1470}
1471static inline u32 gr_gpc0_gpccs_ctxsw_status_1_r(void)
1472{
1473 return 0x00502400U;
1474}
1475static inline u32 gr_fecs_ctxsw_idlestate_r(void)
1476{
1477 return 0x00409420U;
1478}
1479static inline u32 gr_fecs_feature_override_ecc_r(void)
1480{
1481 return 0x00409658U;
1482}
1483static inline u32 gr_gpc0_gpccs_ctxsw_idlestate_r(void)
1484{
1485 return 0x00502420U;
1486}
1487static inline u32 gr_rstr2d_gpc_map0_r(void)
1488{
1489 return 0x0040780cU;
1490}
1491static inline u32 gr_rstr2d_gpc_map1_r(void)
1492{
1493 return 0x00407810U;
1494}
1495static inline u32 gr_rstr2d_gpc_map2_r(void)
1496{
1497 return 0x00407814U;
1498}
1499static inline u32 gr_rstr2d_gpc_map3_r(void)
1500{
1501 return 0x00407818U;
1502}
1503static inline u32 gr_rstr2d_gpc_map4_r(void)
1504{
1505 return 0x0040781cU;
1506}
1507static inline u32 gr_rstr2d_gpc_map5_r(void)
1508{
1509 return 0x00407820U;
1510}
1511static inline u32 gr_rstr2d_map_table_cfg_r(void)
1512{
1513 return 0x004078bcU;
1514}
1515static inline u32 gr_rstr2d_map_table_cfg_row_offset_f(u32 v)
1516{
1517 return (v & 0xffU) << 0U;
1518}
1519static inline u32 gr_rstr2d_map_table_cfg_num_entries_f(u32 v)
1520{
1521 return (v & 0xffU) << 8U;
1522}
1523static inline u32 gr_pd_hww_esr_r(void)
1524{
1525 return 0x00406018U;
1526}
1527static inline u32 gr_pd_hww_esr_reset_active_f(void)
1528{
1529 return 0x40000000U;
1530}
1531static inline u32 gr_pd_hww_esr_en_enable_f(void)
1532{
1533 return 0x80000000U;
1534}
1535static inline u32 gr_pd_num_tpc_per_gpc_r(u32 i)
1536{
1537 return 0x00406028U + i*4U;
1538}
1539static inline u32 gr_pd_num_tpc_per_gpc__size_1_v(void)
1540{
1541 return 0x00000004U;
1542}
1543static inline u32 gr_pd_num_tpc_per_gpc_count0_f(u32 v)
1544{
1545 return (v & 0xfU) << 0U;
1546}
1547static inline u32 gr_pd_num_tpc_per_gpc_count1_f(u32 v)
1548{
1549 return (v & 0xfU) << 4U;
1550}
1551static inline u32 gr_pd_num_tpc_per_gpc_count2_f(u32 v)
1552{
1553 return (v & 0xfU) << 8U;
1554}
1555static inline u32 gr_pd_num_tpc_per_gpc_count3_f(u32 v)
1556{
1557 return (v & 0xfU) << 12U;
1558}
1559static inline u32 gr_pd_num_tpc_per_gpc_count4_f(u32 v)
1560{
1561 return (v & 0xfU) << 16U;
1562}
1563static inline u32 gr_pd_num_tpc_per_gpc_count5_f(u32 v)
1564{
1565 return (v & 0xfU) << 20U;
1566}
1567static inline u32 gr_pd_num_tpc_per_gpc_count6_f(u32 v)
1568{
1569 return (v & 0xfU) << 24U;
1570}
1571static inline u32 gr_pd_num_tpc_per_gpc_count7_f(u32 v)
1572{
1573 return (v & 0xfU) << 28U;
1574}
1575static inline u32 gr_pd_ab_dist_cfg0_r(void)
1576{
1577 return 0x004064c0U;
1578}
1579static inline u32 gr_pd_ab_dist_cfg0_timeslice_enable_en_f(void)
1580{
1581 return 0x80000000U;
1582}
1583static inline u32 gr_pd_ab_dist_cfg0_timeslice_enable_dis_f(void)
1584{
1585 return 0x0U;
1586}
1587static inline u32 gr_pd_ab_dist_cfg1_r(void)
1588{
1589 return 0x004064c4U;
1590}
1591static inline u32 gr_pd_ab_dist_cfg1_max_batches_init_f(void)
1592{
1593 return 0xffffU;
1594}
1595static inline u32 gr_pd_ab_dist_cfg1_max_output_f(u32 v)
1596{
1597 return (v & 0xffffU) << 16U;
1598}
1599static inline u32 gr_pd_ab_dist_cfg1_max_output_granularity_v(void)
1600{
1601 return 0x00000080U;
1602}
1603static inline u32 gr_pd_ab_dist_cfg2_r(void)
1604{
1605 return 0x004064c8U;
1606}
1607static inline u32 gr_pd_ab_dist_cfg2_token_limit_f(u32 v)
1608{
1609 return (v & 0x1fffU) << 0U;
1610}
1611static inline u32 gr_pd_ab_dist_cfg2_token_limit_init_v(void)
1612{
1613 return 0x00000900U;
1614}
1615static inline u32 gr_pd_ab_dist_cfg2_state_limit_f(u32 v)
1616{
1617 return (v & 0x1fffU) << 16U;
1618}
1619static inline u32 gr_pd_ab_dist_cfg2_state_limit_scc_bundle_granularity_v(void)
1620{
1621 return 0x00000020U;
1622}
1623static inline u32 gr_pd_ab_dist_cfg2_state_limit_min_gpm_fifo_depths_v(void)
1624{
1625 return 0x00000900U;
1626}
1627static inline u32 gr_pd_dist_skip_table_r(u32 i)
1628{
1629 return 0x004064d0U + i*4U;
1630}
1631static inline u32 gr_pd_dist_skip_table__size_1_v(void)
1632{
1633 return 0x00000008U;
1634}
1635static inline u32 gr_pd_dist_skip_table_gpc_4n0_mask_f(u32 v)
1636{
1637 return (v & 0xffU) << 0U;
1638}
1639static inline u32 gr_pd_dist_skip_table_gpc_4n1_mask_f(u32 v)
1640{
1641 return (v & 0xffU) << 8U;
1642}
1643static inline u32 gr_pd_dist_skip_table_gpc_4n2_mask_f(u32 v)
1644{
1645 return (v & 0xffU) << 16U;
1646}
1647static inline u32 gr_pd_dist_skip_table_gpc_4n3_mask_f(u32 v)
1648{
1649 return (v & 0xffU) << 24U;
1650}
1651static inline u32 gr_ds_debug_r(void)
1652{
1653 return 0x00405800U;
1654}
1655static inline u32 gr_ds_debug_timeslice_mode_disable_f(void)
1656{
1657 return 0x0U;
1658}
1659static inline u32 gr_ds_debug_timeslice_mode_enable_f(void)
1660{
1661 return 0x8000000U;
1662}
1663static inline u32 gr_ds_zbc_color_r_r(void)
1664{
1665 return 0x00405804U;
1666}
1667static inline u32 gr_ds_zbc_color_r_val_f(u32 v)
1668{
1669 return (v & 0xffffffffU) << 0U;
1670}
1671static inline u32 gr_ds_zbc_color_g_r(void)
1672{
1673 return 0x00405808U;
1674}
1675static inline u32 gr_ds_zbc_color_g_val_f(u32 v)
1676{
1677 return (v & 0xffffffffU) << 0U;
1678}
1679static inline u32 gr_ds_zbc_color_b_r(void)
1680{
1681 return 0x0040580cU;
1682}
1683static inline u32 gr_ds_zbc_color_b_val_f(u32 v)
1684{
1685 return (v & 0xffffffffU) << 0U;
1686}
1687static inline u32 gr_ds_zbc_color_a_r(void)
1688{
1689 return 0x00405810U;
1690}
1691static inline u32 gr_ds_zbc_color_a_val_f(u32 v)
1692{
1693 return (v & 0xffffffffU) << 0U;
1694}
1695static inline u32 gr_ds_zbc_color_fmt_r(void)
1696{
1697 return 0x00405814U;
1698}
1699static inline u32 gr_ds_zbc_color_fmt_val_f(u32 v)
1700{
1701 return (v & 0x7fU) << 0U;
1702}
1703static inline u32 gr_ds_zbc_color_fmt_val_invalid_f(void)
1704{
1705 return 0x0U;
1706}
1707static inline u32 gr_ds_zbc_color_fmt_val_zero_v(void)
1708{
1709 return 0x00000001U;
1710}
1711static inline u32 gr_ds_zbc_color_fmt_val_unorm_one_v(void)
1712{
1713 return 0x00000002U;
1714}
1715static inline u32 gr_ds_zbc_color_fmt_val_rf32_gf32_bf32_af32_v(void)
1716{
1717 return 0x00000004U;
1718}
1719static inline u32 gr_ds_zbc_color_fmt_val_a8_b8_g8_r8_v(void)
1720{
1721 return 0x00000028U;
1722}
1723static inline u32 gr_ds_zbc_z_r(void)
1724{
1725 return 0x00405818U;
1726}
1727static inline u32 gr_ds_zbc_z_val_s(void)
1728{
1729 return 32U;
1730}
1731static inline u32 gr_ds_zbc_z_val_f(u32 v)
1732{
1733 return (v & 0xffffffffU) << 0U;
1734}
1735static inline u32 gr_ds_zbc_z_val_m(void)
1736{
1737 return 0xffffffffU << 0U;
1738}
1739static inline u32 gr_ds_zbc_z_val_v(u32 r)
1740{
1741 return (r >> 0U) & 0xffffffffU;
1742}
1743static inline u32 gr_ds_zbc_z_val__init_v(void)
1744{
1745 return 0x00000000U;
1746}
1747static inline u32 gr_ds_zbc_z_val__init_f(void)
1748{
1749 return 0x0U;
1750}
1751static inline u32 gr_ds_zbc_z_fmt_r(void)
1752{
1753 return 0x0040581cU;
1754}
1755static inline u32 gr_ds_zbc_z_fmt_val_f(u32 v)
1756{
1757 return (v & 0x1U) << 0U;
1758}
1759static inline u32 gr_ds_zbc_z_fmt_val_invalid_f(void)
1760{
1761 return 0x0U;
1762}
1763static inline u32 gr_ds_zbc_z_fmt_val_fp32_v(void)
1764{
1765 return 0x00000001U;
1766}
1767static inline u32 gr_ds_zbc_tbl_index_r(void)
1768{
1769 return 0x00405820U;
1770}
1771static inline u32 gr_ds_zbc_tbl_index_val_f(u32 v)
1772{
1773 return (v & 0xfU) << 0U;
1774}
1775static inline u32 gr_ds_zbc_tbl_ld_r(void)
1776{
1777 return 0x00405824U;
1778}
1779static inline u32 gr_ds_zbc_tbl_ld_select_c_f(void)
1780{
1781 return 0x0U;
1782}
1783static inline u32 gr_ds_zbc_tbl_ld_select_z_f(void)
1784{
1785 return 0x1U;
1786}
1787static inline u32 gr_ds_zbc_tbl_ld_action_write_f(void)
1788{
1789 return 0x0U;
1790}
1791static inline u32 gr_ds_zbc_tbl_ld_trigger_active_f(void)
1792{
1793 return 0x4U;
1794}
1795static inline u32 gr_ds_tga_constraintlogic_beta_r(void)
1796{
1797 return 0x00405830U;
1798}
1799static inline u32 gr_ds_tga_constraintlogic_beta_cbsize_f(u32 v)
1800{
1801 return (v & 0x3fffffU) << 0U;
1802}
1803static inline u32 gr_ds_tga_constraintlogic_alpha_r(void)
1804{
1805 return 0x0040585cU;
1806}
1807static inline u32 gr_ds_tga_constraintlogic_alpha_cbsize_f(u32 v)
1808{
1809 return (v & 0xffffU) << 0U;
1810}
1811static inline u32 gr_ds_hww_esr_r(void)
1812{
1813 return 0x00405840U;
1814}
1815static inline u32 gr_ds_hww_esr_reset_s(void)
1816{
1817 return 1U;
1818}
1819static inline u32 gr_ds_hww_esr_reset_f(u32 v)
1820{
1821 return (v & 0x1U) << 30U;
1822}
1823static inline u32 gr_ds_hww_esr_reset_m(void)
1824{
1825 return 0x1U << 30U;
1826}
1827static inline u32 gr_ds_hww_esr_reset_v(u32 r)
1828{
1829 return (r >> 30U) & 0x1U;
1830}
1831static inline u32 gr_ds_hww_esr_reset_task_v(void)
1832{
1833 return 0x00000001U;
1834}
1835static inline u32 gr_ds_hww_esr_reset_task_f(void)
1836{
1837 return 0x40000000U;
1838}
1839static inline u32 gr_ds_hww_esr_en_enabled_f(void)
1840{
1841 return 0x80000000U;
1842}
1843static inline u32 gr_ds_hww_esr_2_r(void)
1844{
1845 return 0x00405848U;
1846}
1847static inline u32 gr_ds_hww_esr_2_reset_s(void)
1848{
1849 return 1U;
1850}
1851static inline u32 gr_ds_hww_esr_2_reset_f(u32 v)
1852{
1853 return (v & 0x1U) << 30U;
1854}
1855static inline u32 gr_ds_hww_esr_2_reset_m(void)
1856{
1857 return 0x1U << 30U;
1858}
1859static inline u32 gr_ds_hww_esr_2_reset_v(u32 r)
1860{
1861 return (r >> 30U) & 0x1U;
1862}
1863static inline u32 gr_ds_hww_esr_2_reset_task_v(void)
1864{
1865 return 0x00000001U;
1866}
1867static inline u32 gr_ds_hww_esr_2_reset_task_f(void)
1868{
1869 return 0x40000000U;
1870}
1871static inline u32 gr_ds_hww_esr_2_en_enabled_f(void)
1872{
1873 return 0x80000000U;
1874}
1875static inline u32 gr_ds_hww_report_mask_r(void)
1876{
1877 return 0x00405844U;
1878}
1879static inline u32 gr_ds_hww_report_mask_sph0_err_report_f(void)
1880{
1881 return 0x1U;
1882}
1883static inline u32 gr_ds_hww_report_mask_sph1_err_report_f(void)
1884{
1885 return 0x2U;
1886}
1887static inline u32 gr_ds_hww_report_mask_sph2_err_report_f(void)
1888{
1889 return 0x4U;
1890}
1891static inline u32 gr_ds_hww_report_mask_sph3_err_report_f(void)
1892{
1893 return 0x8U;
1894}
1895static inline u32 gr_ds_hww_report_mask_sph4_err_report_f(void)
1896{
1897 return 0x10U;
1898}
1899static inline u32 gr_ds_hww_report_mask_sph5_err_report_f(void)
1900{
1901 return 0x20U;
1902}
1903static inline u32 gr_ds_hww_report_mask_sph6_err_report_f(void)
1904{
1905 return 0x40U;
1906}
1907static inline u32 gr_ds_hww_report_mask_sph7_err_report_f(void)
1908{
1909 return 0x80U;
1910}
1911static inline u32 gr_ds_hww_report_mask_sph8_err_report_f(void)
1912{
1913 return 0x100U;
1914}
1915static inline u32 gr_ds_hww_report_mask_sph9_err_report_f(void)
1916{
1917 return 0x200U;
1918}
1919static inline u32 gr_ds_hww_report_mask_sph10_err_report_f(void)
1920{
1921 return 0x400U;
1922}
1923static inline u32 gr_ds_hww_report_mask_sph11_err_report_f(void)
1924{
1925 return 0x800U;
1926}
1927static inline u32 gr_ds_hww_report_mask_sph12_err_report_f(void)
1928{
1929 return 0x1000U;
1930}
1931static inline u32 gr_ds_hww_report_mask_sph13_err_report_f(void)
1932{
1933 return 0x2000U;
1934}
1935static inline u32 gr_ds_hww_report_mask_sph14_err_report_f(void)
1936{
1937 return 0x4000U;
1938}
1939static inline u32 gr_ds_hww_report_mask_sph15_err_report_f(void)
1940{
1941 return 0x8000U;
1942}
1943static inline u32 gr_ds_hww_report_mask_sph16_err_report_f(void)
1944{
1945 return 0x10000U;
1946}
1947static inline u32 gr_ds_hww_report_mask_sph17_err_report_f(void)
1948{
1949 return 0x20000U;
1950}
1951static inline u32 gr_ds_hww_report_mask_sph18_err_report_f(void)
1952{
1953 return 0x40000U;
1954}
1955static inline u32 gr_ds_hww_report_mask_sph19_err_report_f(void)
1956{
1957 return 0x80000U;
1958}
1959static inline u32 gr_ds_hww_report_mask_sph20_err_report_f(void)
1960{
1961 return 0x100000U;
1962}
1963static inline u32 gr_ds_hww_report_mask_sph21_err_report_f(void)
1964{
1965 return 0x200000U;
1966}
1967static inline u32 gr_ds_hww_report_mask_sph22_err_report_f(void)
1968{
1969 return 0x400000U;
1970}
1971static inline u32 gr_ds_hww_report_mask_sph23_err_report_f(void)
1972{
1973 return 0x800000U;
1974}
1975static inline u32 gr_ds_hww_report_mask_2_r(void)
1976{
1977 return 0x0040584cU;
1978}
1979static inline u32 gr_ds_hww_report_mask_2_sph24_err_report_f(void)
1980{
1981 return 0x1U;
1982}
1983static inline u32 gr_ds_num_tpc_per_gpc_r(u32 i)
1984{
1985 return 0x00405870U + i*4U;
1986}
1987static inline u32 gr_scc_bundle_cb_base_r(void)
1988{
1989 return 0x00408004U;
1990}
1991static inline u32 gr_scc_bundle_cb_base_addr_39_8_f(u32 v)
1992{
1993 return (v & 0xffffffffU) << 0U;
1994}
1995static inline u32 gr_scc_bundle_cb_base_addr_39_8_align_bits_v(void)
1996{
1997 return 0x00000008U;
1998}
1999static inline u32 gr_scc_bundle_cb_size_r(void)
2000{
2001 return 0x00408008U;
2002}
2003static inline u32 gr_scc_bundle_cb_size_div_256b_f(u32 v)
2004{
2005 return (v & 0x7ffU) << 0U;
2006}
2007static inline u32 gr_scc_bundle_cb_size_div_256b__prod_v(void)
2008{
2009 return 0x00000030U;
2010}
2011static inline u32 gr_scc_bundle_cb_size_div_256b_byte_granularity_v(void)
2012{
2013 return 0x00000100U;
2014}
2015static inline u32 gr_scc_bundle_cb_size_valid_false_v(void)
2016{
2017 return 0x00000000U;
2018}
2019static inline u32 gr_scc_bundle_cb_size_valid_false_f(void)
2020{
2021 return 0x0U;
2022}
2023static inline u32 gr_scc_bundle_cb_size_valid_true_f(void)
2024{
2025 return 0x80000000U;
2026}
2027static inline u32 gr_scc_pagepool_base_r(void)
2028{
2029 return 0x0040800cU;
2030}
2031static inline u32 gr_scc_pagepool_base_addr_39_8_f(u32 v)
2032{
2033 return (v & 0xffffffffU) << 0U;
2034}
2035static inline u32 gr_scc_pagepool_base_addr_39_8_align_bits_v(void)
2036{
2037 return 0x00000008U;
2038}
2039static inline u32 gr_scc_pagepool_r(void)
2040{
2041 return 0x00408010U;
2042}
2043static inline u32 gr_scc_pagepool_total_pages_f(u32 v)
2044{
2045 return (v & 0x3ffU) << 0U;
2046}
2047static inline u32 gr_scc_pagepool_total_pages_hwmax_v(void)
2048{
2049 return 0x00000000U;
2050}
2051static inline u32 gr_scc_pagepool_total_pages_hwmax_value_v(void)
2052{
2053 return 0x00000200U;
2054}
2055static inline u32 gr_scc_pagepool_total_pages_byte_granularity_v(void)
2056{
2057 return 0x00000100U;
2058}
2059static inline u32 gr_scc_pagepool_max_valid_pages_s(void)
2060{
2061 return 10U;
2062}
2063static inline u32 gr_scc_pagepool_max_valid_pages_f(u32 v)
2064{
2065 return (v & 0x3ffU) << 10U;
2066}
2067static inline u32 gr_scc_pagepool_max_valid_pages_m(void)
2068{
2069 return 0x3ffU << 10U;
2070}
2071static inline u32 gr_scc_pagepool_max_valid_pages_v(u32 r)
2072{
2073 return (r >> 10U) & 0x3ffU;
2074}
2075static inline u32 gr_scc_pagepool_valid_true_f(void)
2076{
2077 return 0x80000000U;
2078}
2079static inline u32 gr_scc_init_r(void)
2080{
2081 return 0x0040802cU;
2082}
2083static inline u32 gr_scc_init_ram_trigger_f(void)
2084{
2085 return 0x1U;
2086}
2087static inline u32 gr_scc_hww_esr_r(void)
2088{
2089 return 0x00408030U;
2090}
2091static inline u32 gr_scc_hww_esr_reset_active_f(void)
2092{
2093 return 0x40000000U;
2094}
2095static inline u32 gr_scc_hww_esr_en_enable_f(void)
2096{
2097 return 0x80000000U;
2098}
2099static inline u32 gr_sked_hww_esr_r(void)
2100{
2101 return 0x00407020U;
2102}
2103static inline u32 gr_sked_hww_esr_reset_active_f(void)
2104{
2105 return 0x40000000U;
2106}
2107static inline u32 gr_cwd_fs_r(void)
2108{
2109 return 0x00405b00U;
2110}
2111static inline u32 gr_cwd_fs_num_gpcs_f(u32 v)
2112{
2113 return (v & 0xffU) << 0U;
2114}
2115static inline u32 gr_cwd_fs_num_tpcs_f(u32 v)
2116{
2117 return (v & 0xffU) << 8U;
2118}
2119static inline u32 gr_cwd_gpc_tpc_id_r(u32 i)
2120{
2121 return 0x00405b60U + i*4U;
2122}
2123static inline u32 gr_cwd_gpc_tpc_id_tpc0_s(void)
2124{
2125 return 4U;
2126}
2127static inline u32 gr_cwd_gpc_tpc_id_tpc0_f(u32 v)
2128{
2129 return (v & 0xfU) << 0U;
2130}
2131static inline u32 gr_cwd_gpc_tpc_id_gpc0_s(void)
2132{
2133 return 4U;
2134}
2135static inline u32 gr_cwd_gpc_tpc_id_gpc0_f(u32 v)
2136{
2137 return (v & 0xfU) << 4U;
2138}
2139static inline u32 gr_cwd_gpc_tpc_id_tpc1_f(u32 v)
2140{
2141 return (v & 0xfU) << 8U;
2142}
2143static inline u32 gr_cwd_sm_id_r(u32 i)
2144{
2145 return 0x00405ba0U + i*4U;
2146}
2147static inline u32 gr_cwd_sm_id__size_1_v(void)
2148{
2149 return 0x00000010U;
2150}
2151static inline u32 gr_cwd_sm_id_tpc0_f(u32 v)
2152{
2153 return (v & 0xffU) << 0U;
2154}
2155static inline u32 gr_cwd_sm_id_tpc1_f(u32 v)
2156{
2157 return (v & 0xffU) << 8U;
2158}
2159static inline u32 gr_gpc0_fs_gpc_r(void)
2160{
2161 return 0x00502608U;
2162}
2163static inline u32 gr_gpc0_fs_gpc_num_available_tpcs_v(u32 r)
2164{
2165 return (r >> 0U) & 0x1fU;
2166}
2167static inline u32 gr_gpc0_fs_gpc_num_available_zculls_v(u32 r)
2168{
2169 return (r >> 16U) & 0x1fU;
2170}
2171static inline u32 gr_gpc0_cfg_r(void)
2172{
2173 return 0x00502620U;
2174}
2175static inline u32 gr_gpc0_cfg_imem_sz_v(u32 r)
2176{
2177 return (r >> 0U) & 0xffU;
2178}
2179static inline u32 gr_gpccs_rc_lanes_r(void)
2180{
2181 return 0x00502880U;
2182}
2183static inline u32 gr_gpccs_rc_lanes_num_chains_s(void)
2184{
2185 return 6U;
2186}
2187static inline u32 gr_gpccs_rc_lanes_num_chains_f(u32 v)
2188{
2189 return (v & 0x3fU) << 0U;
2190}
2191static inline u32 gr_gpccs_rc_lanes_num_chains_m(void)
2192{
2193 return 0x3fU << 0U;
2194}
2195static inline u32 gr_gpccs_rc_lanes_num_chains_v(u32 r)
2196{
2197 return (r >> 0U) & 0x3fU;
2198}
2199static inline u32 gr_gpccs_rc_lane_size_r(void)
2200{
2201 return 0x00502910U;
2202}
2203static inline u32 gr_gpccs_rc_lane_size_v_s(void)
2204{
2205 return 24U;
2206}
2207static inline u32 gr_gpccs_rc_lane_size_v_f(u32 v)
2208{
2209 return (v & 0xffffffU) << 0U;
2210}
2211static inline u32 gr_gpccs_rc_lane_size_v_m(void)
2212{
2213 return 0xffffffU << 0U;
2214}
2215static inline u32 gr_gpccs_rc_lane_size_v_v(u32 r)
2216{
2217 return (r >> 0U) & 0xffffffU;
2218}
2219static inline u32 gr_gpccs_rc_lane_size_v_0_v(void)
2220{
2221 return 0x00000000U;
2222}
2223static inline u32 gr_gpccs_rc_lane_size_v_0_f(void)
2224{
2225 return 0x0U;
2226}
2227static inline u32 gr_gpc0_zcull_fs_r(void)
2228{
2229 return 0x00500910U;
2230}
2231static inline u32 gr_gpc0_zcull_fs_num_sms_f(u32 v)
2232{
2233 return (v & 0x1ffU) << 0U;
2234}
2235static inline u32 gr_gpc0_zcull_fs_num_active_banks_f(u32 v)
2236{
2237 return (v & 0xfU) << 16U;
2238}
2239static inline u32 gr_gpc0_zcull_ram_addr_r(void)
2240{
2241 return 0x00500914U;
2242}
2243static inline u32 gr_gpc0_zcull_ram_addr_tiles_per_hypertile_row_per_gpc_f(u32 v)
2244{
2245 return (v & 0xfU) << 0U;
2246}
2247static inline u32 gr_gpc0_zcull_ram_addr_row_offset_f(u32 v)
2248{
2249 return (v & 0xfU) << 8U;
2250}
2251static inline u32 gr_gpc0_zcull_sm_num_rcp_r(void)
2252{
2253 return 0x00500918U;
2254}
2255static inline u32 gr_gpc0_zcull_sm_num_rcp_conservative_f(u32 v)
2256{
2257 return (v & 0xffffffU) << 0U;
2258}
2259static inline u32 gr_gpc0_zcull_sm_num_rcp_conservative__max_v(void)
2260{
2261 return 0x00800000U;
2262}
2263static inline u32 gr_gpc0_zcull_total_ram_size_r(void)
2264{
2265 return 0x00500920U;
2266}
2267static inline u32 gr_gpc0_zcull_total_ram_size_num_aliquots_f(u32 v)
2268{
2269 return (v & 0xffffU) << 0U;
2270}
2271static inline u32 gr_gpc0_zcull_zcsize_r(u32 i)
2272{
2273 return 0x00500a04U + i*32U;
2274}
2275static inline u32 gr_gpc0_zcull_zcsize_height_subregion__multiple_v(void)
2276{
2277 return 0x00000040U;
2278}
2279static inline u32 gr_gpc0_zcull_zcsize_width_subregion__multiple_v(void)
2280{
2281 return 0x00000010U;
2282}
2283static inline u32 gr_gpc0_gpm_pd_sm_id_r(u32 i)
2284{
2285 return 0x00500c10U + i*4U;
2286}
2287static inline u32 gr_gpc0_gpm_pd_sm_id_id_f(u32 v)
2288{
2289 return (v & 0xffU) << 0U;
2290}
2291static inline u32 gr_gpc0_gpm_pd_pes_tpc_id_mask_r(u32 i)
2292{
2293 return 0x00500c30U + i*4U;
2294}
2295static inline u32 gr_gpc0_gpm_pd_pes_tpc_id_mask_mask_v(u32 r)
2296{
2297 return (r >> 0U) & 0xffU;
2298}
2299static inline u32 gr_gpc0_tpc0_pe_cfg_smid_r(void)
2300{
2301 return 0x00504088U;
2302}
2303static inline u32 gr_gpc0_tpc0_pe_cfg_smid_value_f(u32 v)
2304{
2305 return (v & 0xffffU) << 0U;
2306}
2307static inline u32 gr_gpc0_tpc0_sm_cfg_r(void)
2308{
2309 return 0x00504698U;
2310}
2311static inline u32 gr_gpc0_tpc0_sm_cfg_sm_id_f(u32 v)
2312{
2313 return (v & 0xffffU) << 0U;
2314}
2315static inline u32 gr_gpc0_tpc0_sm_arch_r(void)
2316{
2317 return 0x0050469cU;
2318}
2319static inline u32 gr_gpc0_tpc0_sm_arch_warp_count_v(u32 r)
2320{
2321 return (r >> 0U) & 0xffU;
2322}
2323static inline u32 gr_gpc0_tpc0_sm_arch_spa_version_v(u32 r)
2324{
2325 return (r >> 8U) & 0xfffU;
2326}
2327static inline u32 gr_gpc0_tpc0_sm_arch_sm_version_v(u32 r)
2328{
2329 return (r >> 20U) & 0xfffU;
2330}
2331static inline u32 gr_gpc0_ppc0_pes_vsc_strem_r(void)
2332{
2333 return 0x00503018U;
2334}
2335static inline u32 gr_gpc0_ppc0_pes_vsc_strem_master_pe_m(void)
2336{
2337 return 0x1U << 0U;
2338}
2339static inline u32 gr_gpc0_ppc0_pes_vsc_strem_master_pe_true_f(void)
2340{
2341 return 0x1U;
2342}
2343static inline u32 gr_gpc0_ppc0_cbm_beta_cb_size_r(void)
2344{
2345 return 0x005030c0U;
2346}
2347static inline u32 gr_gpc0_ppc0_cbm_beta_cb_size_v_f(u32 v)
2348{
2349 return (v & 0x3fffffU) << 0U;
2350}
2351static inline u32 gr_gpc0_ppc0_cbm_beta_cb_size_v_m(void)
2352{
2353 return 0x3fffffU << 0U;
2354}
2355static inline u32 gr_gpc0_ppc0_cbm_beta_cb_size_v_default_v(void)
2356{
2357 return 0x00000320U;
2358}
2359static inline u32 gr_gpc0_ppc0_cbm_beta_cb_size_v_gfxp_v(void)
2360{
2361 return 0x00000ba8U;
2362}
2363static inline u32 gr_gpc0_ppc0_cbm_beta_cb_size_v_granularity_v(void)
2364{
2365 return 0x00000020U;
2366}
2367static inline u32 gr_gpc0_ppc0_cbm_beta_cb_offset_r(void)
2368{
2369 return 0x005030f4U;
2370}
2371static inline u32 gr_gpc0_ppc0_cbm_alpha_cb_size_r(void)
2372{
2373 return 0x005030e4U;
2374}
2375static inline u32 gr_gpc0_ppc0_cbm_alpha_cb_size_v_f(u32 v)
2376{
2377 return (v & 0xffffU) << 0U;
2378}
2379static inline u32 gr_gpc0_ppc0_cbm_alpha_cb_size_v_m(void)
2380{
2381 return 0xffffU << 0U;
2382}
2383static inline u32 gr_gpc0_ppc0_cbm_alpha_cb_size_v_default_v(void)
2384{
2385 return 0x00000800U;
2386}
2387static inline u32 gr_gpc0_ppc0_cbm_alpha_cb_size_v_granularity_v(void)
2388{
2389 return 0x00000020U;
2390}
2391static inline u32 gr_gpc0_ppc0_cbm_alpha_cb_offset_r(void)
2392{
2393 return 0x005030f8U;
2394}
2395static inline u32 gr_gpc0_ppc0_cbm_beta_steady_state_cb_size_r(void)
2396{
2397 return 0x005030f0U;
2398}
2399static inline u32 gr_gpc0_ppc0_cbm_beta_steady_state_cb_size_v_f(u32 v)
2400{
2401 return (v & 0x3fffffU) << 0U;
2402}
2403static inline u32 gr_gpc0_ppc0_cbm_beta_steady_state_cb_size_v_default_v(void)
2404{
2405 return 0x00000320U;
2406}
2407static inline u32 gr_gpcs_tpcs_tex_rm_cb_0_r(void)
2408{
2409 return 0x00419b00U;
2410}
2411static inline u32 gr_gpcs_tpcs_tex_rm_cb_0_base_addr_43_12_f(u32 v)
2412{
2413 return (v & 0xffffffffU) << 0U;
2414}
2415static inline u32 gr_gpcs_tpcs_tex_rm_cb_1_r(void)
2416{
2417 return 0x00419b04U;
2418}
2419static inline u32 gr_gpcs_tpcs_tex_rm_cb_1_size_div_128b_s(void)
2420{
2421 return 21U;
2422}
2423static inline u32 gr_gpcs_tpcs_tex_rm_cb_1_size_div_128b_f(u32 v)
2424{
2425 return (v & 0x1fffffU) << 0U;
2426}
2427static inline u32 gr_gpcs_tpcs_tex_rm_cb_1_size_div_128b_m(void)
2428{
2429 return 0x1fffffU << 0U;
2430}
2431static inline u32 gr_gpcs_tpcs_tex_rm_cb_1_size_div_128b_v(u32 r)
2432{
2433 return (r >> 0U) & 0x1fffffU;
2434}
2435static inline u32 gr_gpcs_tpcs_tex_rm_cb_1_size_div_128b_granularity_f(void)
2436{
2437 return 0x80U;
2438}
2439static inline u32 gr_gpcs_tpcs_tex_rm_cb_1_valid_s(void)
2440{
2441 return 1U;
2442}
2443static inline u32 gr_gpcs_tpcs_tex_rm_cb_1_valid_f(u32 v)
2444{
2445 return (v & 0x1U) << 31U;
2446}
2447static inline u32 gr_gpcs_tpcs_tex_rm_cb_1_valid_m(void)
2448{
2449 return 0x1U << 31U;
2450}
2451static inline u32 gr_gpcs_tpcs_tex_rm_cb_1_valid_v(u32 r)
2452{
2453 return (r >> 31U) & 0x1U;
2454}
2455static inline u32 gr_gpcs_tpcs_tex_rm_cb_1_valid_true_f(void)
2456{
2457 return 0x80000000U;
2458}
2459static inline u32 gr_gpccs_falcon_addr_r(void)
2460{
2461 return 0x0041a0acU;
2462}
2463static inline u32 gr_gpccs_falcon_addr_lsb_s(void)
2464{
2465 return 6U;
2466}
2467static inline u32 gr_gpccs_falcon_addr_lsb_f(u32 v)
2468{
2469 return (v & 0x3fU) << 0U;
2470}
2471static inline u32 gr_gpccs_falcon_addr_lsb_m(void)
2472{
2473 return 0x3fU << 0U;
2474}
2475static inline u32 gr_gpccs_falcon_addr_lsb_v(u32 r)
2476{
2477 return (r >> 0U) & 0x3fU;
2478}
2479static inline u32 gr_gpccs_falcon_addr_lsb_init_v(void)
2480{
2481 return 0x00000000U;
2482}
2483static inline u32 gr_gpccs_falcon_addr_lsb_init_f(void)
2484{
2485 return 0x0U;
2486}
2487static inline u32 gr_gpccs_falcon_addr_msb_s(void)
2488{
2489 return 6U;
2490}
2491static inline u32 gr_gpccs_falcon_addr_msb_f(u32 v)
2492{
2493 return (v & 0x3fU) << 6U;
2494}
2495static inline u32 gr_gpccs_falcon_addr_msb_m(void)
2496{
2497 return 0x3fU << 6U;
2498}
2499static inline u32 gr_gpccs_falcon_addr_msb_v(u32 r)
2500{
2501 return (r >> 6U) & 0x3fU;
2502}
2503static inline u32 gr_gpccs_falcon_addr_msb_init_v(void)
2504{
2505 return 0x00000000U;
2506}
2507static inline u32 gr_gpccs_falcon_addr_msb_init_f(void)
2508{
2509 return 0x0U;
2510}
2511static inline u32 gr_gpccs_falcon_addr_ext_s(void)
2512{
2513 return 12U;
2514}
2515static inline u32 gr_gpccs_falcon_addr_ext_f(u32 v)
2516{
2517 return (v & 0xfffU) << 0U;
2518}
2519static inline u32 gr_gpccs_falcon_addr_ext_m(void)
2520{
2521 return 0xfffU << 0U;
2522}
2523static inline u32 gr_gpccs_falcon_addr_ext_v(u32 r)
2524{
2525 return (r >> 0U) & 0xfffU;
2526}
2527static inline u32 gr_gpccs_cpuctl_r(void)
2528{
2529 return 0x0041a100U;
2530}
2531static inline u32 gr_gpccs_cpuctl_startcpu_f(u32 v)
2532{
2533 return (v & 0x1U) << 1U;
2534}
2535static inline u32 gr_gpccs_dmactl_r(void)
2536{
2537 return 0x0041a10cU;
2538}
2539static inline u32 gr_gpccs_dmactl_require_ctx_f(u32 v)
2540{
2541 return (v & 0x1U) << 0U;
2542}
2543static inline u32 gr_gpccs_dmactl_dmem_scrubbing_m(void)
2544{
2545 return 0x1U << 1U;
2546}
2547static inline u32 gr_gpccs_dmactl_imem_scrubbing_m(void)
2548{
2549 return 0x1U << 2U;
2550}
2551static inline u32 gr_gpccs_imemc_r(u32 i)
2552{
2553 return 0x0041a180U + i*16U;
2554}
2555static inline u32 gr_gpccs_imemc_offs_f(u32 v)
2556{
2557 return (v & 0x3fU) << 2U;
2558}
2559static inline u32 gr_gpccs_imemc_blk_f(u32 v)
2560{
2561 return (v & 0xffU) << 8U;
2562}
2563static inline u32 gr_gpccs_imemc_aincw_f(u32 v)
2564{
2565 return (v & 0x1U) << 24U;
2566}
2567static inline u32 gr_gpccs_imemd_r(u32 i)
2568{
2569 return 0x0041a184U + i*16U;
2570}
2571static inline u32 gr_gpccs_imemt_r(u32 i)
2572{
2573 return 0x0041a188U + i*16U;
2574}
2575static inline u32 gr_gpccs_imemt__size_1_v(void)
2576{
2577 return 0x00000004U;
2578}
2579static inline u32 gr_gpccs_imemt_tag_f(u32 v)
2580{
2581 return (v & 0xffffU) << 0U;
2582}
2583static inline u32 gr_gpccs_dmemc_r(u32 i)
2584{
2585 return 0x0041a1c0U + i*8U;
2586}
2587static inline u32 gr_gpccs_dmemc_offs_f(u32 v)
2588{
2589 return (v & 0x3fU) << 2U;
2590}
2591static inline u32 gr_gpccs_dmemc_blk_f(u32 v)
2592{
2593 return (v & 0xffU) << 8U;
2594}
2595static inline u32 gr_gpccs_dmemc_aincw_f(u32 v)
2596{
2597 return (v & 0x1U) << 24U;
2598}
2599static inline u32 gr_gpccs_dmemd_r(u32 i)
2600{
2601 return 0x0041a1c4U + i*8U;
2602}
2603static inline u32 gr_gpccs_ctxsw_mailbox_r(u32 i)
2604{
2605 return 0x0041a800U + i*4U;
2606}
2607static inline u32 gr_gpccs_ctxsw_mailbox_value_f(u32 v)
2608{
2609 return (v & 0xffffffffU) << 0U;
2610}
2611static inline u32 gr_gpcs_swdx_bundle_cb_base_r(void)
2612{
2613 return 0x00418e24U;
2614}
2615static inline u32 gr_gpcs_swdx_bundle_cb_base_addr_39_8_s(void)
2616{
2617 return 32U;
2618}
2619static inline u32 gr_gpcs_swdx_bundle_cb_base_addr_39_8_f(u32 v)
2620{
2621 return (v & 0xffffffffU) << 0U;
2622}
2623static inline u32 gr_gpcs_swdx_bundle_cb_base_addr_39_8_m(void)
2624{
2625 return 0xffffffffU << 0U;
2626}
2627static inline u32 gr_gpcs_swdx_bundle_cb_base_addr_39_8_v(u32 r)
2628{
2629 return (r >> 0U) & 0xffffffffU;
2630}
2631static inline u32 gr_gpcs_swdx_bundle_cb_base_addr_39_8_init_v(void)
2632{
2633 return 0x00000000U;
2634}
2635static inline u32 gr_gpcs_swdx_bundle_cb_base_addr_39_8_init_f(void)
2636{
2637 return 0x0U;
2638}
2639static inline u32 gr_gpcs_swdx_bundle_cb_size_r(void)
2640{
2641 return 0x00418e28U;
2642}
2643static inline u32 gr_gpcs_swdx_bundle_cb_size_div_256b_s(void)
2644{
2645 return 11U;
2646}
2647static inline u32 gr_gpcs_swdx_bundle_cb_size_div_256b_f(u32 v)
2648{
2649 return (v & 0x7ffU) << 0U;
2650}
2651static inline u32 gr_gpcs_swdx_bundle_cb_size_div_256b_m(void)
2652{
2653 return 0x7ffU << 0U;
2654}
2655static inline u32 gr_gpcs_swdx_bundle_cb_size_div_256b_v(u32 r)
2656{
2657 return (r >> 0U) & 0x7ffU;
2658}
2659static inline u32 gr_gpcs_swdx_bundle_cb_size_div_256b_init_v(void)
2660{
2661 return 0x00000030U;
2662}
2663static inline u32 gr_gpcs_swdx_bundle_cb_size_div_256b_init_f(void)
2664{
2665 return 0x30U;
2666}
2667static inline u32 gr_gpcs_swdx_bundle_cb_size_valid_s(void)
2668{
2669 return 1U;
2670}
2671static inline u32 gr_gpcs_swdx_bundle_cb_size_valid_f(u32 v)
2672{
2673 return (v & 0x1U) << 31U;
2674}
2675static inline u32 gr_gpcs_swdx_bundle_cb_size_valid_m(void)
2676{
2677 return 0x1U << 31U;
2678}
2679static inline u32 gr_gpcs_swdx_bundle_cb_size_valid_v(u32 r)
2680{
2681 return (r >> 31U) & 0x1U;
2682}
2683static inline u32 gr_gpcs_swdx_bundle_cb_size_valid_false_v(void)
2684{
2685 return 0x00000000U;
2686}
2687static inline u32 gr_gpcs_swdx_bundle_cb_size_valid_false_f(void)
2688{
2689 return 0x0U;
2690}
2691static inline u32 gr_gpcs_swdx_bundle_cb_size_valid_true_v(void)
2692{
2693 return 0x00000001U;
2694}
2695static inline u32 gr_gpcs_swdx_bundle_cb_size_valid_true_f(void)
2696{
2697 return 0x80000000U;
2698}
2699static inline u32 gr_gpc0_swdx_rm_spill_buffer_size_r(void)
2700{
2701 return 0x005001dcU;
2702}
2703static inline u32 gr_gpc0_swdx_rm_spill_buffer_size_256b_f(u32 v)
2704{
2705 return (v & 0xffffU) << 0U;
2706}
2707static inline u32 gr_gpc0_swdx_rm_spill_buffer_size_256b_default_v(void)
2708{
2709 return 0x00000de0U;
2710}
2711static inline u32 gr_gpc0_swdx_rm_spill_buffer_size_256b_byte_granularity_v(void)
2712{
2713 return 0x00000100U;
2714}
2715static inline u32 gr_gpc0_swdx_rm_spill_buffer_addr_r(void)
2716{
2717 return 0x005001d8U;
2718}
2719static inline u32 gr_gpc0_swdx_rm_spill_buffer_addr_39_8_f(u32 v)
2720{
2721 return (v & 0xffffffffU) << 0U;
2722}
2723static inline u32 gr_gpc0_swdx_rm_spill_buffer_addr_39_8_align_bits_v(void)
2724{
2725 return 0x00000008U;
2726}
2727static inline u32 gr_gpcs_swdx_beta_cb_ctrl_r(void)
2728{
2729 return 0x004181e4U;
2730}
2731static inline u32 gr_gpcs_swdx_beta_cb_ctrl_cbes_reserve_f(u32 v)
2732{
2733 return (v & 0xfffU) << 0U;
2734}
2735static inline u32 gr_gpcs_swdx_beta_cb_ctrl_cbes_reserve_gfxp_v(void)
2736{
2737 return 0x00000100U;
2738}
2739static inline u32 gr_gpcs_ppcs_cbm_beta_cb_ctrl_r(void)
2740{
2741 return 0x0041befcU;
2742}
2743static inline u32 gr_gpcs_ppcs_cbm_beta_cb_ctrl_cbes_reserve_f(u32 v)
2744{
2745 return (v & 0xfffU) << 0U;
2746}
2747static inline u32 gr_gpcs_swdx_tc_beta_cb_size_r(u32 i)
2748{
2749 return 0x00418ea0U + i*4U;
2750}
2751static inline u32 gr_gpcs_swdx_tc_beta_cb_size_v_f(u32 v)
2752{
2753 return (v & 0x3fffffU) << 0U;
2754}
2755static inline u32 gr_gpcs_swdx_tc_beta_cb_size_v_m(void)
2756{
2757 return 0x3fffffU << 0U;
2758}
2759static inline u32 gr_gpcs_swdx_dss_zbc_color_r_r(u32 i)
2760{
2761 return 0x00418010U + i*4U;
2762}
2763static inline u32 gr_gpcs_swdx_dss_zbc_color_r_val_f(u32 v)
2764{
2765 return (v & 0xffffffffU) << 0U;
2766}
2767static inline u32 gr_gpcs_swdx_dss_zbc_color_g_r(u32 i)
2768{
2769 return 0x0041804cU + i*4U;
2770}
2771static inline u32 gr_gpcs_swdx_dss_zbc_color_g_val_f(u32 v)
2772{
2773 return (v & 0xffffffffU) << 0U;
2774}
2775static inline u32 gr_gpcs_swdx_dss_zbc_color_b_r(u32 i)
2776{
2777 return 0x00418088U + i*4U;
2778}
2779static inline u32 gr_gpcs_swdx_dss_zbc_color_b_val_f(u32 v)
2780{
2781 return (v & 0xffffffffU) << 0U;
2782}
2783static inline u32 gr_gpcs_swdx_dss_zbc_color_a_r(u32 i)
2784{
2785 return 0x004180c4U + i*4U;
2786}
2787static inline u32 gr_gpcs_swdx_dss_zbc_color_a_val_f(u32 v)
2788{
2789 return (v & 0xffffffffU) << 0U;
2790}
2791static inline u32 gr_gpcs_swdx_dss_zbc_c_01_to_04_format_r(void)
2792{
2793 return 0x00500100U;
2794}
2795static inline u32 gr_gpcs_swdx_dss_zbc_z_r(u32 i)
2796{
2797 return 0x00418110U + i*4U;
2798}
2799static inline u32 gr_gpcs_swdx_dss_zbc_z_val_f(u32 v)
2800{
2801 return (v & 0xffffffffU) << 0U;
2802}
2803static inline u32 gr_gpcs_swdx_dss_zbc_z_01_to_04_format_r(void)
2804{
2805 return 0x0050014cU;
2806}
2807static inline u32 gr_gpcs_setup_attrib_cb_base_r(void)
2808{
2809 return 0x00418810U;
2810}
2811static inline u32 gr_gpcs_setup_attrib_cb_base_addr_39_12_f(u32 v)
2812{
2813 return (v & 0xfffffffU) << 0U;
2814}
2815static inline u32 gr_gpcs_setup_attrib_cb_base_addr_39_12_align_bits_v(void)
2816{
2817 return 0x0000000cU;
2818}
2819static inline u32 gr_gpcs_setup_attrib_cb_base_valid_true_f(void)
2820{
2821 return 0x80000000U;
2822}
2823static inline u32 gr_crstr_gpc_map0_r(void)
2824{
2825 return 0x00418b08U;
2826}
2827static inline u32 gr_crstr_gpc_map0_tile0_f(u32 v)
2828{
2829 return (v & 0x7U) << 0U;
2830}
2831static inline u32 gr_crstr_gpc_map0_tile1_f(u32 v)
2832{
2833 return (v & 0x7U) << 5U;
2834}
2835static inline u32 gr_crstr_gpc_map0_tile2_f(u32 v)
2836{
2837 return (v & 0x7U) << 10U;
2838}
2839static inline u32 gr_crstr_gpc_map0_tile3_f(u32 v)
2840{
2841 return (v & 0x7U) << 15U;
2842}
2843static inline u32 gr_crstr_gpc_map0_tile4_f(u32 v)
2844{
2845 return (v & 0x7U) << 20U;
2846}
2847static inline u32 gr_crstr_gpc_map0_tile5_f(u32 v)
2848{
2849 return (v & 0x7U) << 25U;
2850}
2851static inline u32 gr_crstr_gpc_map1_r(void)
2852{
2853 return 0x00418b0cU;
2854}
2855static inline u32 gr_crstr_gpc_map1_tile6_f(u32 v)
2856{
2857 return (v & 0x7U) << 0U;
2858}
2859static inline u32 gr_crstr_gpc_map1_tile7_f(u32 v)
2860{
2861 return (v & 0x7U) << 5U;
2862}
2863static inline u32 gr_crstr_gpc_map1_tile8_f(u32 v)
2864{
2865 return (v & 0x7U) << 10U;
2866}
2867static inline u32 gr_crstr_gpc_map1_tile9_f(u32 v)
2868{
2869 return (v & 0x7U) << 15U;
2870}
2871static inline u32 gr_crstr_gpc_map1_tile10_f(u32 v)
2872{
2873 return (v & 0x7U) << 20U;
2874}
2875static inline u32 gr_crstr_gpc_map1_tile11_f(u32 v)
2876{
2877 return (v & 0x7U) << 25U;
2878}
2879static inline u32 gr_crstr_gpc_map2_r(void)
2880{
2881 return 0x00418b10U;
2882}
2883static inline u32 gr_crstr_gpc_map2_tile12_f(u32 v)
2884{
2885 return (v & 0x7U) << 0U;
2886}
2887static inline u32 gr_crstr_gpc_map2_tile13_f(u32 v)
2888{
2889 return (v & 0x7U) << 5U;
2890}
2891static inline u32 gr_crstr_gpc_map2_tile14_f(u32 v)
2892{
2893 return (v & 0x7U) << 10U;
2894}
2895static inline u32 gr_crstr_gpc_map2_tile15_f(u32 v)
2896{
2897 return (v & 0x7U) << 15U;
2898}
2899static inline u32 gr_crstr_gpc_map2_tile16_f(u32 v)
2900{
2901 return (v & 0x7U) << 20U;
2902}
2903static inline u32 gr_crstr_gpc_map2_tile17_f(u32 v)
2904{
2905 return (v & 0x7U) << 25U;
2906}
2907static inline u32 gr_crstr_gpc_map3_r(void)
2908{
2909 return 0x00418b14U;
2910}
2911static inline u32 gr_crstr_gpc_map3_tile18_f(u32 v)
2912{
2913 return (v & 0x7U) << 0U;
2914}
2915static inline u32 gr_crstr_gpc_map3_tile19_f(u32 v)
2916{
2917 return (v & 0x7U) << 5U;
2918}
2919static inline u32 gr_crstr_gpc_map3_tile20_f(u32 v)
2920{
2921 return (v & 0x7U) << 10U;
2922}
2923static inline u32 gr_crstr_gpc_map3_tile21_f(u32 v)
2924{
2925 return (v & 0x7U) << 15U;
2926}
2927static inline u32 gr_crstr_gpc_map3_tile22_f(u32 v)
2928{
2929 return (v & 0x7U) << 20U;
2930}
2931static inline u32 gr_crstr_gpc_map3_tile23_f(u32 v)
2932{
2933 return (v & 0x7U) << 25U;
2934}
2935static inline u32 gr_crstr_gpc_map4_r(void)
2936{
2937 return 0x00418b18U;
2938}
2939static inline u32 gr_crstr_gpc_map4_tile24_f(u32 v)
2940{
2941 return (v & 0x7U) << 0U;
2942}
2943static inline u32 gr_crstr_gpc_map4_tile25_f(u32 v)
2944{
2945 return (v & 0x7U) << 5U;
2946}
2947static inline u32 gr_crstr_gpc_map4_tile26_f(u32 v)
2948{
2949 return (v & 0x7U) << 10U;
2950}
2951static inline u32 gr_crstr_gpc_map4_tile27_f(u32 v)
2952{
2953 return (v & 0x7U) << 15U;
2954}
2955static inline u32 gr_crstr_gpc_map4_tile28_f(u32 v)
2956{
2957 return (v & 0x7U) << 20U;
2958}
2959static inline u32 gr_crstr_gpc_map4_tile29_f(u32 v)
2960{
2961 return (v & 0x7U) << 25U;
2962}
2963static inline u32 gr_crstr_gpc_map5_r(void)
2964{
2965 return 0x00418b1cU;
2966}
2967static inline u32 gr_crstr_gpc_map5_tile30_f(u32 v)
2968{
2969 return (v & 0x7U) << 0U;
2970}
2971static inline u32 gr_crstr_gpc_map5_tile31_f(u32 v)
2972{
2973 return (v & 0x7U) << 5U;
2974}
2975static inline u32 gr_crstr_gpc_map5_tile32_f(u32 v)
2976{
2977 return (v & 0x7U) << 10U;
2978}
2979static inline u32 gr_crstr_gpc_map5_tile33_f(u32 v)
2980{
2981 return (v & 0x7U) << 15U;
2982}
2983static inline u32 gr_crstr_gpc_map5_tile34_f(u32 v)
2984{
2985 return (v & 0x7U) << 20U;
2986}
2987static inline u32 gr_crstr_gpc_map5_tile35_f(u32 v)
2988{
2989 return (v & 0x7U) << 25U;
2990}
2991static inline u32 gr_crstr_map_table_cfg_r(void)
2992{
2993 return 0x00418bb8U;
2994}
2995static inline u32 gr_crstr_map_table_cfg_row_offset_f(u32 v)
2996{
2997 return (v & 0xffU) << 0U;
2998}
2999static inline u32 gr_crstr_map_table_cfg_num_entries_f(u32 v)
3000{
3001 return (v & 0xffU) << 8U;
3002}
3003static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map0_r(void)
3004{
3005 return 0x00418980U;
3006}
3007static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map0_tile_0_f(u32 v)
3008{
3009 return (v & 0x7U) << 0U;
3010}
3011static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map0_tile_1_f(u32 v)
3012{
3013 return (v & 0x7U) << 4U;
3014}
3015static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map0_tile_2_f(u32 v)
3016{
3017 return (v & 0x7U) << 8U;
3018}
3019static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map0_tile_3_f(u32 v)
3020{
3021 return (v & 0x7U) << 12U;
3022}
3023static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map0_tile_4_f(u32 v)
3024{
3025 return (v & 0x7U) << 16U;
3026}
3027static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map0_tile_5_f(u32 v)
3028{
3029 return (v & 0x7U) << 20U;
3030}
3031static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map0_tile_6_f(u32 v)
3032{
3033 return (v & 0x7U) << 24U;
3034}
3035static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map0_tile_7_f(u32 v)
3036{
3037 return (v & 0x7U) << 28U;
3038}
3039static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map1_r(void)
3040{
3041 return 0x00418984U;
3042}
3043static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map1_tile_8_f(u32 v)
3044{
3045 return (v & 0x7U) << 0U;
3046}
3047static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map1_tile_9_f(u32 v)
3048{
3049 return (v & 0x7U) << 4U;
3050}
3051static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map1_tile_10_f(u32 v)
3052{
3053 return (v & 0x7U) << 8U;
3054}
3055static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map1_tile_11_f(u32 v)
3056{
3057 return (v & 0x7U) << 12U;
3058}
3059static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map1_tile_12_f(u32 v)
3060{
3061 return (v & 0x7U) << 16U;
3062}
3063static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map1_tile_13_f(u32 v)
3064{
3065 return (v & 0x7U) << 20U;
3066}
3067static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map1_tile_14_f(u32 v)
3068{
3069 return (v & 0x7U) << 24U;
3070}
3071static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map1_tile_15_f(u32 v)
3072{
3073 return (v & 0x7U) << 28U;
3074}
3075static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map2_r(void)
3076{
3077 return 0x00418988U;
3078}
3079static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map2_tile_16_f(u32 v)
3080{
3081 return (v & 0x7U) << 0U;
3082}
3083static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map2_tile_17_f(u32 v)
3084{
3085 return (v & 0x7U) << 4U;
3086}
3087static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map2_tile_18_f(u32 v)
3088{
3089 return (v & 0x7U) << 8U;
3090}
3091static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map2_tile_19_f(u32 v)
3092{
3093 return (v & 0x7U) << 12U;
3094}
3095static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map2_tile_20_f(u32 v)
3096{
3097 return (v & 0x7U) << 16U;
3098}
3099static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map2_tile_21_f(u32 v)
3100{
3101 return (v & 0x7U) << 20U;
3102}
3103static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map2_tile_22_f(u32 v)
3104{
3105 return (v & 0x7U) << 24U;
3106}
3107static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map2_tile_23_s(void)
3108{
3109 return 3U;
3110}
3111static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map2_tile_23_f(u32 v)
3112{
3113 return (v & 0x7U) << 28U;
3114}
3115static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map2_tile_23_m(void)
3116{
3117 return 0x7U << 28U;
3118}
3119static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map2_tile_23_v(u32 r)
3120{
3121 return (r >> 28U) & 0x7U;
3122}
3123static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map3_r(void)
3124{
3125 return 0x0041898cU;
3126}
3127static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map3_tile_24_f(u32 v)
3128{
3129 return (v & 0x7U) << 0U;
3130}
3131static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map3_tile_25_f(u32 v)
3132{
3133 return (v & 0x7U) << 4U;
3134}
3135static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map3_tile_26_f(u32 v)
3136{
3137 return (v & 0x7U) << 8U;
3138}
3139static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map3_tile_27_f(u32 v)
3140{
3141 return (v & 0x7U) << 12U;
3142}
3143static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map3_tile_28_f(u32 v)
3144{
3145 return (v & 0x7U) << 16U;
3146}
3147static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map3_tile_29_f(u32 v)
3148{
3149 return (v & 0x7U) << 20U;
3150}
3151static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map3_tile_30_f(u32 v)
3152{
3153 return (v & 0x7U) << 24U;
3154}
3155static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map3_tile_31_f(u32 v)
3156{
3157 return (v & 0x7U) << 28U;
3158}
3159static inline u32 gr_gpcs_gpm_pd_cfg_r(void)
3160{
3161 return 0x00418c6cU;
3162}
3163static inline u32 gr_gpcs_gpm_pd_cfg_timeslice_mode_disable_f(void)
3164{
3165 return 0x0U;
3166}
3167static inline u32 gr_gpcs_gpm_pd_cfg_timeslice_mode_enable_f(void)
3168{
3169 return 0x1U;
3170}
3171static inline u32 gr_gpcs_gcc_pagepool_base_r(void)
3172{
3173 return 0x00419004U;
3174}
3175static inline u32 gr_gpcs_gcc_pagepool_base_addr_39_8_f(u32 v)
3176{
3177 return (v & 0xffffffffU) << 0U;
3178}
3179static inline u32 gr_gpcs_gcc_pagepool_r(void)
3180{
3181 return 0x00419008U;
3182}
3183static inline u32 gr_gpcs_gcc_pagepool_total_pages_f(u32 v)
3184{
3185 return (v & 0x3ffU) << 0U;
3186}
3187static inline u32 gr_gpcs_tpcs_pe_vaf_r(void)
3188{
3189 return 0x0041980cU;
3190}
3191static inline u32 gr_gpcs_tpcs_pe_vaf_fast_mode_switch_true_f(void)
3192{
3193 return 0x10U;
3194}
3195static inline u32 gr_gpcs_tpcs_pe_pin_cb_global_base_addr_r(void)
3196{
3197 return 0x00419848U;
3198}
3199static inline u32 gr_gpcs_tpcs_pe_pin_cb_global_base_addr_v_f(u32 v)
3200{
3201 return (v & 0xfffffffU) << 0U;
3202}
3203static inline u32 gr_gpcs_tpcs_pe_pin_cb_global_base_addr_valid_f(u32 v)
3204{
3205 return (v & 0x1U) << 28U;
3206}
3207static inline u32 gr_gpcs_tpcs_pe_pin_cb_global_base_addr_valid_true_f(void)
3208{
3209 return 0x10000000U;
3210}
3211static inline u32 gr_gpcs_tpcs_mpc_vtg_debug_r(void)
3212{
3213 return 0x00419c00U;
3214}
3215static inline u32 gr_gpcs_tpcs_mpc_vtg_debug_timeslice_mode_disabled_f(void)
3216{
3217 return 0x0U;
3218}
3219static inline u32 gr_gpcs_tpcs_mpc_vtg_debug_timeslice_mode_enabled_f(void)
3220{
3221 return 0x8U;
3222}
3223static inline u32 gr_gpcs_tpcs_mpc_vtg_cb_global_base_addr_r(void)
3224{
3225 return 0x00419c2cU;
3226}
3227static inline u32 gr_gpcs_tpcs_mpc_vtg_cb_global_base_addr_v_f(u32 v)
3228{
3229 return (v & 0xfffffffU) << 0U;
3230}
3231static inline u32 gr_gpcs_tpcs_mpc_vtg_cb_global_base_addr_valid_f(u32 v)
3232{
3233 return (v & 0x1U) << 28U;
3234}
3235static inline u32 gr_gpcs_tpcs_mpc_vtg_cb_global_base_addr_valid_true_f(void)
3236{
3237 return 0x10000000U;
3238}
3239static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_r(void)
3240{
3241 return 0x00419e44U;
3242}
3243static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_stack_error_report_f(void)
3244{
3245 return 0x2U;
3246}
3247static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_api_stack_error_report_f(void)
3248{
3249 return 0x4U;
3250}
3251static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_ret_empty_stack_error_report_f(void)
3252{
3253 return 0x8U;
3254}
3255static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_pc_wrap_report_f(void)
3256{
3257 return 0x10U;
3258}
3259static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_misaligned_pc_report_f(void)
3260{
3261 return 0x20U;
3262}
3263static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_pc_overflow_report_f(void)
3264{
3265 return 0x40U;
3266}
3267static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_misaligned_immc_addr_report_f(void)
3268{
3269 return 0x80U;
3270}
3271static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_misaligned_reg_report_f(void)
3272{
3273 return 0x100U;
3274}
3275static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_illegal_instr_encoding_report_f(void)
3276{
3277 return 0x200U;
3278}
3279static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_illegal_sph_instr_combo_report_f(void)
3280{
3281 return 0x400U;
3282}
3283static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_illegal_instr_param_report_f(void)
3284{
3285 return 0x800U;
3286}
3287static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_invalid_const_addr_report_f(void)
3288{
3289 return 0x1000U;
3290}
3291static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_oor_reg_report_f(void)
3292{
3293 return 0x2000U;
3294}
3295static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_oor_addr_report_f(void)
3296{
3297 return 0x4000U;
3298}
3299static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_misaligned_addr_report_f(void)
3300{
3301 return 0x8000U;
3302}
3303static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_invalid_addr_space_report_f(void)
3304{
3305 return 0x10000U;
3306}
3307static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_illegal_instr_param2_report_f(void)
3308{
3309 return 0x20000U;
3310}
3311static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_invalid_const_addr_ldc_report_f(void)
3312{
3313 return 0x40000U;
3314}
3315static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_mmu_fault_report_f(void)
3316{
3317 return 0x800000U;
3318}
3319static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_stack_overflow_report_f(void)
3320{
3321 return 0x400000U;
3322}
3323static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_geometry_sm_error_report_f(void)
3324{
3325 return 0x80000U;
3326}
3327static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_divergent_report_f(void)
3328{
3329 return 0x100000U;
3330}
3331static inline u32 gr_gpc0_tpc0_sm_hww_warp_esr_report_mask_r(void)
3332{
3333 return 0x00504644U;
3334}
3335static inline u32 gr_gpcs_tpcs_sm_hww_global_esr_report_mask_r(void)
3336{
3337 return 0x00419e4cU;
3338}
3339static inline u32 gr_gpcs_tpcs_sm_hww_global_esr_report_mask_sm_to_sm_fault_report_f(void)
3340{
3341 return 0x1U;
3342}
3343static inline u32 gr_gpcs_tpcs_sm_hww_global_esr_report_mask_l1_error_report_f(void)
3344{
3345 return 0x2U;
3346}
3347static inline u32 gr_gpcs_tpcs_sm_hww_global_esr_report_mask_multiple_warp_errors_report_f(void)
3348{
3349 return 0x4U;
3350}
3351static inline u32 gr_gpcs_tpcs_sm_hww_global_esr_report_mask_physical_stack_overflow_error_report_f(void)
3352{
3353 return 0x8U;
3354}
3355static inline u32 gr_gpcs_tpcs_sm_hww_global_esr_report_mask_bpt_int_report_f(void)
3356{
3357 return 0x10U;
3358}
3359static inline u32 gr_gpcs_tpcs_sm_hww_global_esr_report_mask_ecc_sec_error_report_f(void)
3360{
3361 return 0x20000000U;
3362}
3363static inline u32 gr_gpcs_tpcs_sm_hww_global_esr_report_mask_ecc_ded_error_report_f(void)
3364{
3365 return 0x40000000U;
3366}
3367static inline u32 gr_gpcs_tpcs_sm_hww_global_esr_report_mask_bpt_pause_report_f(void)
3368{
3369 return 0x20U;
3370}
3371static inline u32 gr_gpcs_tpcs_sm_hww_global_esr_report_mask_single_step_complete_report_f(void)
3372{
3373 return 0x40U;
3374}
3375static inline u32 gr_gpc0_tpc0_sm_hww_global_esr_report_mask_r(void)
3376{
3377 return 0x0050464cU;
3378}
3379static inline u32 gr_gpcs_tpcs_tpccs_tpc_exception_en_r(void)
3380{
3381 return 0x00419d0cU;
3382}
3383static inline u32 gr_gpcs_tpcs_tpccs_tpc_exception_en_sm_enabled_f(void)
3384{
3385 return 0x2U;
3386}
3387static inline u32 gr_gpcs_tpcs_tpccs_tpc_exception_en_tex_enabled_f(void)
3388{
3389 return 0x1U;
3390}
3391static inline u32 gr_gpc0_tpc0_tpccs_tpc_exception_en_r(void)
3392{
3393 return 0x0050450cU;
3394}
3395static inline u32 gr_gpc0_tpc0_tpccs_tpc_exception_en_sm_v(u32 r)
3396{
3397 return (r >> 1U) & 0x1U;
3398}
3399static inline u32 gr_gpc0_tpc0_tpccs_tpc_exception_en_sm_enabled_f(void)
3400{
3401 return 0x2U;
3402}
3403static inline u32 gr_gpcs_gpccs_gpc_exception_en_r(void)
3404{
3405 return 0x0041ac94U;
3406}
3407static inline u32 gr_gpcs_gpccs_gpc_exception_en_tpc_f(u32 v)
3408{
3409 return (v & 0xffU) << 16U;
3410}
3411static inline u32 gr_gpc0_gpccs_gpc_exception_r(void)
3412{
3413 return 0x00502c90U;
3414}
3415static inline u32 gr_gpc0_gpccs_gpc_exception_gcc_v(u32 r)
3416{
3417 return (r >> 2U) & 0x1U;
3418}
3419static inline u32 gr_gpc0_gpccs_gpc_exception_tpc_v(u32 r)
3420{
3421 return (r >> 16U) & 0xffU;
3422}
3423static inline u32 gr_gpc0_gpccs_gpc_exception_tpc_0_pending_v(void)
3424{
3425 return 0x00000001U;
3426}
3427static inline u32 gr_gpc0_tpc0_tpccs_tpc_exception_r(void)
3428{
3429 return 0x00504508U;
3430}
3431static inline u32 gr_gpc0_tpc0_tpccs_tpc_exception_tex_v(u32 r)
3432{
3433 return (r >> 0U) & 0x1U;
3434}
3435static inline u32 gr_gpc0_tpc0_tpccs_tpc_exception_tex_pending_v(void)
3436{
3437 return 0x00000001U;
3438}
3439static inline u32 gr_gpc0_tpc0_tpccs_tpc_exception_sm_v(u32 r)
3440{
3441 return (r >> 1U) & 0x1U;
3442}
3443static inline u32 gr_gpc0_tpc0_tpccs_tpc_exception_sm_pending_v(void)
3444{
3445 return 0x00000001U;
3446}
3447static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_r(void)
3448{
3449 return 0x00504610U;
3450}
3451static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_debugger_mode_m(void)
3452{
3453 return 0x1U << 0U;
3454}
3455static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_debugger_mode_v(u32 r)
3456{
3457 return (r >> 0U) & 0x1U;
3458}
3459static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_debugger_mode_on_v(void)
3460{
3461 return 0x00000001U;
3462}
3463static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_debugger_mode_on_f(void)
3464{
3465 return 0x1U;
3466}
3467static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_debugger_mode_off_v(void)
3468{
3469 return 0x00000000U;
3470}
3471static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_debugger_mode_off_f(void)
3472{
3473 return 0x0U;
3474}
3475static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_stop_trigger_enable_f(void)
3476{
3477 return 0x80000000U;
3478}
3479static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_stop_trigger_disable_f(void)
3480{
3481 return 0x0U;
3482}
3483static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_run_trigger_task_f(void)
3484{
3485 return 0x40000000U;
3486}
3487static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_stop_on_any_warp_m(void)
3488{
3489 return 0x1U << 1U;
3490}
3491static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_stop_on_any_warp_v(u32 r)
3492{
3493 return (r >> 1U) & 0x1U;
3494}
3495static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_stop_on_any_warp_disable_f(void)
3496{
3497 return 0x0U;
3498}
3499static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_stop_on_any_sm_m(void)
3500{
3501 return 0x1U << 2U;
3502}
3503static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_stop_on_any_sm_v(u32 r)
3504{
3505 return (r >> 2U) & 0x1U;
3506}
3507static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_stop_on_any_sm_disable_f(void)
3508{
3509 return 0x0U;
3510}
3511static inline u32 gr_gpc0_tpc0_sm_warp_valid_mask_r(void)
3512{
3513 return 0x00504614U;
3514}
3515static inline u32 gr_gpc0_tpc0_sm_warp_valid_mask_1_r(void)
3516{
3517 return 0x00504618U;
3518}
3519static inline u32 gr_gpc0_tpc0_sm_dbgr_bpt_pause_mask_r(void)
3520{
3521 return 0x00504624U;
3522}
3523static inline u32 gr_gpc0_tpc0_sm_dbgr_bpt_pause_mask_1_r(void)
3524{
3525 return 0x00504628U;
3526}
3527static inline u32 gr_gpc0_tpc0_sm_dbgr_bpt_trap_mask_r(void)
3528{
3529 return 0x00504634U;
3530}
3531static inline u32 gr_gpc0_tpc0_sm_dbgr_bpt_trap_mask_1_r(void)
3532{
3533 return 0x00504638U;
3534}
3535static inline u32 gr_gpcs_tpcs_sm_dbgr_bpt_pause_mask_r(void)
3536{
3537 return 0x00419e24U;
3538}
3539static inline u32 gr_gpcs_tpcs_sm_dbgr_bpt_pause_mask_stop_on_any_warp_disable_v(void)
3540{
3541 return 0x00000000U;
3542}
3543static inline u32 gr_gpcs_tpcs_sm_dbgr_bpt_pause_mask_stop_on_any_sm_disable_v(void)
3544{
3545 return 0x00000000U;
3546}
3547static inline u32 gr_gpc0_tpc0_sm_dbgr_status0_r(void)
3548{
3549 return 0x0050460cU;
3550}
3551static inline u32 gr_gpc0_tpc0_sm_dbgr_status0_sm_in_trap_mode_v(u32 r)
3552{
3553 return (r >> 0U) & 0x1U;
3554}
3555static inline u32 gr_gpc0_tpc0_sm_dbgr_status0_locked_down_v(u32 r)
3556{
3557 return (r >> 4U) & 0x1U;
3558}
3559static inline u32 gr_gpc0_tpc0_sm_dbgr_status0_locked_down_true_v(void)
3560{
3561 return 0x00000001U;
3562}
3563static inline u32 gr_gpcs_tpcs_sm_hww_global_esr_r(void)
3564{
3565 return 0x00419e50U;
3566}
3567static inline u32 gr_gpcs_tpcs_sm_hww_global_esr_bpt_int_pending_f(void)
3568{
3569 return 0x10U;
3570}
3571static inline u32 gr_gpcs_tpcs_sm_hww_global_esr_bpt_pause_pending_f(void)
3572{
3573 return 0x20U;
3574}
3575static inline u32 gr_gpcs_tpcs_sm_hww_global_esr_single_step_complete_pending_f(void)
3576{
3577 return 0x40U;
3578}
3579static inline u32 gr_gpc0_tpc0_sm_hww_global_esr_r(void)
3580{
3581 return 0x00504650U;
3582}
3583static inline u32 gr_gpc0_tpc0_sm_hww_global_esr_bpt_int_pending_f(void)
3584{
3585 return 0x10U;
3586}
3587static inline u32 gr_gpc0_tpc0_sm_hww_global_esr_ecc_sec_error_pending_f(void)
3588{
3589 return 0x20000000U;
3590}
3591static inline u32 gr_gpc0_tpc0_sm_hww_global_esr_ecc_ded_error_pending_f(void)
3592{
3593 return 0x40000000U;
3594}
3595static inline u32 gr_gpc0_tpc0_sm_hww_global_esr_bpt_pause_pending_f(void)
3596{
3597 return 0x20U;
3598}
3599static inline u32 gr_gpc0_tpc0_sm_hww_global_esr_single_step_complete_pending_f(void)
3600{
3601 return 0x40U;
3602}
3603static inline u32 gr_gpc0_tpc0_tex_m_hww_esr_r(void)
3604{
3605 return 0x00504224U;
3606}
3607static inline u32 gr_gpc0_tpc0_tex_m_hww_esr_intr_pending_f(void)
3608{
3609 return 0x1U;
3610}
3611static inline u32 gr_gpc0_tpc0_sm_hww_warp_esr_r(void)
3612{
3613 return 0x00504648U;
3614}
3615static inline u32 gr_gpc0_tpc0_sm_hww_warp_esr_error_v(u32 r)
3616{
3617 return (r >> 0U) & 0xffffU;
3618}
3619static inline u32 gr_gpc0_tpc0_sm_hww_warp_esr_error_none_v(void)
3620{
3621 return 0x00000000U;
3622}
3623static inline u32 gr_gpc0_tpc0_sm_hww_warp_esr_error_none_f(void)
3624{
3625 return 0x0U;
3626}
3627static inline u32 gr_gpc0_tpc0_sm_halfctl_ctrl_r(void)
3628{
3629 return 0x00504770U;
3630}
3631static inline u32 gr_gpcs_tpcs_sm_halfctl_ctrl_r(void)
3632{
3633 return 0x00419f70U;
3634}
3635static inline u32 gr_gpcs_tpcs_sm_halfctl_ctrl_sctl_read_quad_ctl_m(void)
3636{
3637 return 0x1U << 4U;
3638}
3639static inline u32 gr_gpcs_tpcs_sm_halfctl_ctrl_sctl_read_quad_ctl_f(u32 v)
3640{
3641 return (v & 0x1U) << 4U;
3642}
3643static inline u32 gr_gpc0_tpc0_sm_debug_sfe_control_r(void)
3644{
3645 return 0x0050477cU;
3646}
3647static inline u32 gr_gpcs_tpcs_sm_debug_sfe_control_r(void)
3648{
3649 return 0x00419f7cU;
3650}
3651static inline u32 gr_gpcs_tpcs_sm_debug_sfe_control_read_half_ctl_m(void)
3652{
3653 return 0x1U << 0U;
3654}
3655static inline u32 gr_gpcs_tpcs_sm_debug_sfe_control_read_half_ctl_f(u32 v)
3656{
3657 return (v & 0x1U) << 0U;
3658}
3659static inline u32 gr_gpcs_tpcs_pes_vsc_vpc_r(void)
3660{
3661 return 0x0041be08U;
3662}
3663static inline u32 gr_gpcs_tpcs_pes_vsc_vpc_fast_mode_switch_true_f(void)
3664{
3665 return 0x4U;
3666}
3667static inline u32 gr_ppcs_wwdx_map_gpc_map0_r(void)
3668{
3669 return 0x0041bf00U;
3670}
3671static inline u32 gr_ppcs_wwdx_map_gpc_map1_r(void)
3672{
3673 return 0x0041bf04U;
3674}
3675static inline u32 gr_ppcs_wwdx_map_gpc_map2_r(void)
3676{
3677 return 0x0041bf08U;
3678}
3679static inline u32 gr_ppcs_wwdx_map_gpc_map3_r(void)
3680{
3681 return 0x0041bf0cU;
3682}
3683static inline u32 gr_ppcs_wwdx_map_gpc_map4_r(void)
3684{
3685 return 0x0041bf10U;
3686}
3687static inline u32 gr_ppcs_wwdx_map_gpc_map5_r(void)
3688{
3689 return 0x0041bf14U;
3690}
3691static inline u32 gr_ppcs_wwdx_map_table_cfg_r(void)
3692{
3693 return 0x0041bfd0U;
3694}
3695static inline u32 gr_ppcs_wwdx_map_table_cfg_row_offset_f(u32 v)
3696{
3697 return (v & 0xffU) << 0U;
3698}
3699static inline u32 gr_ppcs_wwdx_map_table_cfg_num_entries_f(u32 v)
3700{
3701 return (v & 0xffU) << 8U;
3702}
3703static inline u32 gr_ppcs_wwdx_map_table_cfg_normalized_num_entries_f(u32 v)
3704{
3705 return (v & 0x1fU) << 16U;
3706}
3707static inline u32 gr_ppcs_wwdx_map_table_cfg_normalized_shift_value_f(u32 v)
3708{
3709 return (v & 0x7U) << 21U;
3710}
3711static inline u32 gr_ppcs_wwdx_map_table_cfg_coeff5_mod_value_f(u32 v)
3712{
3713 return (v & 0x1fU) << 24U;
3714}
3715static inline u32 gr_gpcs_ppcs_wwdx_sm_num_rcp_r(void)
3716{
3717 return 0x0041bfd4U;
3718}
3719static inline u32 gr_gpcs_ppcs_wwdx_sm_num_rcp_conservative_f(u32 v)
3720{
3721 return (v & 0xffffffU) << 0U;
3722}
3723static inline u32 gr_ppcs_wwdx_map_table_cfg2_r(void)
3724{
3725 return 0x0041bfe4U;
3726}
3727static inline u32 gr_ppcs_wwdx_map_table_cfg2_coeff6_mod_value_f(u32 v)
3728{
3729 return (v & 0x1fU) << 0U;
3730}
3731static inline u32 gr_ppcs_wwdx_map_table_cfg2_coeff7_mod_value_f(u32 v)
3732{
3733 return (v & 0x1fU) << 5U;
3734}
3735static inline u32 gr_ppcs_wwdx_map_table_cfg2_coeff8_mod_value_f(u32 v)
3736{
3737 return (v & 0x1fU) << 10U;
3738}
3739static inline u32 gr_ppcs_wwdx_map_table_cfg2_coeff9_mod_value_f(u32 v)
3740{
3741 return (v & 0x1fU) << 15U;
3742}
3743static inline u32 gr_ppcs_wwdx_map_table_cfg2_coeff10_mod_value_f(u32 v)
3744{
3745 return (v & 0x1fU) << 20U;
3746}
3747static inline u32 gr_ppcs_wwdx_map_table_cfg2_coeff11_mod_value_f(u32 v)
3748{
3749 return (v & 0x1fU) << 25U;
3750}
3751static inline u32 gr_bes_zrop_settings_r(void)
3752{
3753 return 0x00408850U;
3754}
3755static inline u32 gr_bes_zrop_settings_num_active_ltcs_f(u32 v)
3756{
3757 return (v & 0xfU) << 0U;
3758}
3759static inline u32 gr_be0_crop_debug3_r(void)
3760{
3761 return 0x00410108U;
3762}
3763static inline u32 gr_bes_crop_debug3_r(void)
3764{
3765 return 0x00408908U;
3766}
3767static inline u32 gr_bes_crop_debug3_comp_vdc_4to2_disable_m(void)
3768{
3769 return 0x1U << 31U;
3770}
3771static inline u32 gr_bes_crop_debug3_blendopt_read_suppress_m(void)
3772{
3773 return 0x1U << 1U;
3774}
3775static inline u32 gr_bes_crop_debug3_blendopt_read_suppress_disabled_f(void)
3776{
3777 return 0x0U;
3778}
3779static inline u32 gr_bes_crop_debug3_blendopt_read_suppress_enabled_f(void)
3780{
3781 return 0x2U;
3782}
3783static inline u32 gr_bes_crop_debug3_blendopt_fill_override_m(void)
3784{
3785 return 0x1U << 2U;
3786}
3787static inline u32 gr_bes_crop_debug3_blendopt_fill_override_disabled_f(void)
3788{
3789 return 0x0U;
3790}
3791static inline u32 gr_bes_crop_debug3_blendopt_fill_override_enabled_f(void)
3792{
3793 return 0x4U;
3794}
3795static inline u32 gr_bes_crop_settings_r(void)
3796{
3797 return 0x00408958U;
3798}
3799static inline u32 gr_bes_crop_settings_num_active_ltcs_f(u32 v)
3800{
3801 return (v & 0xfU) << 0U;
3802}
3803static inline u32 gr_zcull_bytes_per_aliquot_per_gpu_v(void)
3804{
3805 return 0x00000020U;
3806}
3807static inline u32 gr_zcull_save_restore_header_bytes_per_gpc_v(void)
3808{
3809 return 0x00000020U;
3810}
3811static inline u32 gr_zcull_save_restore_subregion_header_bytes_per_gpc_v(void)
3812{
3813 return 0x000000c0U;
3814}
3815static inline u32 gr_zcull_subregion_qty_v(void)
3816{
3817 return 0x00000010U;
3818}
3819static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter_control_sel0_r(void)
3820{
3821 return 0x00504604U;
3822}
3823static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter_control_sel1_r(void)
3824{
3825 return 0x00504608U;
3826}
3827static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter_control0_r(void)
3828{
3829 return 0x0050465cU;
3830}
3831static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter_control1_r(void)
3832{
3833 return 0x00504660U;
3834}
3835static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter_control2_r(void)
3836{
3837 return 0x00504664U;
3838}
3839static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter_control3_r(void)
3840{
3841 return 0x00504668U;
3842}
3843static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter_control4_r(void)
3844{
3845 return 0x0050466cU;
3846}
3847static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter_control5_r(void)
3848{
3849 return 0x00504658U;
3850}
3851static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter0_control_r(void)
3852{
3853 return 0x00504730U;
3854}
3855static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter1_control_r(void)
3856{
3857 return 0x00504734U;
3858}
3859static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter2_control_r(void)
3860{
3861 return 0x00504738U;
3862}
3863static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter3_control_r(void)
3864{
3865 return 0x0050473cU;
3866}
3867static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter4_control_r(void)
3868{
3869 return 0x00504740U;
3870}
3871static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter5_control_r(void)
3872{
3873 return 0x00504744U;
3874}
3875static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter6_control_r(void)
3876{
3877 return 0x00504748U;
3878}
3879static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter7_control_r(void)
3880{
3881 return 0x0050474cU;
3882}
3883static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter_status_s1_r(void)
3884{
3885 return 0x00504678U;
3886}
3887static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter_status1_r(void)
3888{
3889 return 0x00504694U;
3890}
3891static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter0_s0_r(void)
3892{
3893 return 0x005046f0U;
3894}
3895static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter0_s1_r(void)
3896{
3897 return 0x00504700U;
3898}
3899static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter1_s0_r(void)
3900{
3901 return 0x005046f4U;
3902}
3903static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter1_s1_r(void)
3904{
3905 return 0x00504704U;
3906}
3907static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter2_s0_r(void)
3908{
3909 return 0x005046f8U;
3910}
3911static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter2_s1_r(void)
3912{
3913 return 0x00504708U;
3914}
3915static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter3_s0_r(void)
3916{
3917 return 0x005046fcU;
3918}
3919static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter3_s1_r(void)
3920{
3921 return 0x0050470cU;
3922}
3923static inline u32 gr_fe_pwr_mode_r(void)
3924{
3925 return 0x00404170U;
3926}
3927static inline u32 gr_fe_pwr_mode_mode_auto_f(void)
3928{
3929 return 0x0U;
3930}
3931static inline u32 gr_fe_pwr_mode_mode_force_on_f(void)
3932{
3933 return 0x2U;
3934}
3935static inline u32 gr_fe_pwr_mode_req_v(u32 r)
3936{
3937 return (r >> 4U) & 0x1U;
3938}
3939static inline u32 gr_fe_pwr_mode_req_send_f(void)
3940{
3941 return 0x10U;
3942}
3943static inline u32 gr_fe_pwr_mode_req_done_v(void)
3944{
3945 return 0x00000000U;
3946}
3947static inline u32 gr_gpcs_pri_mmu_ctrl_r(void)
3948{
3949 return 0x00418880U;
3950}
3951static inline u32 gr_gpcs_pri_mmu_ctrl_vm_pg_size_m(void)
3952{
3953 return 0x1U << 0U;
3954}
3955static inline u32 gr_gpcs_pri_mmu_ctrl_use_pdb_big_page_size_m(void)
3956{
3957 return 0x1U << 11U;
3958}
3959static inline u32 gr_gpcs_pri_mmu_ctrl_vol_fault_m(void)
3960{
3961 return 0x1U << 1U;
3962}
3963static inline u32 gr_gpcs_pri_mmu_ctrl_comp_fault_m(void)
3964{
3965 return 0x1U << 2U;
3966}
3967static inline u32 gr_gpcs_pri_mmu_ctrl_miss_gran_m(void)
3968{
3969 return 0x3U << 3U;
3970}
3971static inline u32 gr_gpcs_pri_mmu_ctrl_cache_mode_m(void)
3972{
3973 return 0x3U << 5U;
3974}
3975static inline u32 gr_gpcs_pri_mmu_ctrl_mmu_aperture_m(void)
3976{
3977 return 0x3U << 28U;
3978}
3979static inline u32 gr_gpcs_pri_mmu_ctrl_mmu_vol_m(void)
3980{
3981 return 0x1U << 30U;
3982}
3983static inline u32 gr_gpcs_pri_mmu_ctrl_mmu_disable_m(void)
3984{
3985 return 0x1U << 31U;
3986}
3987static inline u32 gr_gpcs_pri_mmu_pm_unit_mask_r(void)
3988{
3989 return 0x00418890U;
3990}
3991static inline u32 gr_gpcs_pri_mmu_pm_req_mask_r(void)
3992{
3993 return 0x00418894U;
3994}
3995static inline u32 gr_gpcs_pri_mmu_debug_ctrl_r(void)
3996{
3997 return 0x004188b0U;
3998}
3999static inline u32 gr_gpcs_pri_mmu_debug_ctrl_debug_v(u32 r)
4000{
4001 return (r >> 16U) & 0x1U;
4002}
4003static inline u32 gr_gpcs_pri_mmu_debug_ctrl_debug_enabled_v(void)
4004{
4005 return 0x00000001U;
4006}
4007static inline u32 gr_gpcs_pri_mmu_debug_wr_r(void)
4008{
4009 return 0x004188b4U;
4010}
4011static inline u32 gr_gpcs_pri_mmu_debug_rd_r(void)
4012{
4013 return 0x004188b8U;
4014}
4015static inline u32 gr_gpcs_mmu_num_active_ltcs_r(void)
4016{
4017 return 0x004188acU;
4018}
4019static inline u32 gr_gpcs_tpcs_sm_dbgr_control0_r(void)
4020{
4021 return 0x00419e10U;
4022}
4023static inline u32 gr_gpcs_tpcs_sm_dbgr_control0_debugger_mode_f(u32 v)
4024{
4025 return (v & 0x1U) << 0U;
4026}
4027static inline u32 gr_gpcs_tpcs_sm_dbgr_control0_debugger_mode_on_v(void)
4028{
4029 return 0x00000001U;
4030}
4031static inline u32 gr_gpcs_tpcs_sm_dbgr_control0_stop_trigger_m(void)
4032{
4033 return 0x1U << 31U;
4034}
4035static inline u32 gr_gpcs_tpcs_sm_dbgr_control0_stop_trigger_v(u32 r)
4036{
4037 return (r >> 31U) & 0x1U;
4038}
4039static inline u32 gr_gpcs_tpcs_sm_dbgr_control0_stop_trigger_enable_f(void)
4040{
4041 return 0x80000000U;
4042}
4043static inline u32 gr_gpcs_tpcs_sm_dbgr_control0_stop_trigger_disable_f(void)
4044{
4045 return 0x0U;
4046}
4047static inline u32 gr_gpcs_tpcs_sm_dbgr_control0_run_trigger_m(void)
4048{
4049 return 0x1U << 30U;
4050}
4051static inline u32 gr_gpcs_tpcs_sm_dbgr_control0_run_trigger_v(u32 r)
4052{
4053 return (r >> 30U) & 0x1U;
4054}
4055static inline u32 gr_gpcs_tpcs_sm_dbgr_control0_run_trigger_task_f(void)
4056{
4057 return 0x40000000U;
4058}
4059static inline u32 gr_fe_gfxp_wfi_timeout_r(void)
4060{
4061 return 0x004041c0U;
4062}
4063static inline u32 gr_fe_gfxp_wfi_timeout_count_f(u32 v)
4064{
4065 return (v & 0xffffffffU) << 0U;
4066}
4067static inline u32 gr_fe_gfxp_wfi_timeout_count_disabled_f(void)
4068{
4069 return 0x0U;
4070}
4071static inline u32 gr_gpcs_tpcs_sm_texio_control_r(void)
4072{
4073 return 0x00419c84U;
4074}
4075static inline u32 gr_gpcs_tpcs_sm_texio_control_oor_addr_check_mode_f(u32 v)
4076{
4077 return (v & 0x7U) << 8U;
4078}
4079static inline u32 gr_gpcs_tpcs_sm_texio_control_oor_addr_check_mode_m(void)
4080{
4081 return 0x7U << 8U;
4082}
4083static inline u32 gr_gpcs_tpcs_sm_texio_control_oor_addr_check_mode_arm_63_48_match_f(void)
4084{
4085 return 0x100U;
4086}
4087static inline u32 gr_gpcs_tpcs_sm_disp_ctrl_r(void)
4088{
4089 return 0x00419f78U;
4090}
4091static inline u32 gr_gpcs_tpcs_sm_disp_ctrl_re_suppress_m(void)
4092{
4093 return 0x3U << 11U;
4094}
4095static inline u32 gr_gpcs_tpcs_sm_disp_ctrl_re_suppress_disable_f(void)
4096{
4097 return 0x1000U;
4098}
4099static inline u32 gr_gpcs_tc_debug0_r(void)
4100{
4101 return 0x00418708U;
4102}
4103static inline u32 gr_gpcs_tc_debug0_limit_coalesce_buffer_size_f(u32 v)
4104{
4105 return (v & 0x1ffU) << 0U;
4106}
4107static inline u32 gr_gpcs_tc_debug0_limit_coalesce_buffer_size_m(void)
4108{
4109 return 0x1ffU << 0U;
4110}
4111#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_ltc_gp106.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_ltc_gp106.h
new file mode 100644
index 00000000..e4e87aa8
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_ltc_gp106.h
@@ -0,0 +1,559 @@
1/*
2 * Copyright (c) 2016-2017, 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_ltc_gp106_h_
57#define _hw_ltc_gp106_h_
58
59static inline u32 ltc_ltcs_lts0_cbc_ctrl1_r(void)
60{
61 return 0x0014046cU;
62}
63static inline u32 ltc_ltc0_lts0_dstg_cfg0_r(void)
64{
65 return 0x00140518U;
66}
67static inline u32 ltc_ltcs_ltss_dstg_cfg0_r(void)
68{
69 return 0x0017e318U;
70}
71static inline u32 ltc_ltcs_ltss_dstg_cfg0_vdc_4to2_disable_m(void)
72{
73 return 0x1U << 15U;
74}
75static inline u32 ltc_ltc0_lts0_tstg_cfg1_r(void)
76{
77 return 0x00140494U;
78}
79static inline u32 ltc_ltc0_lts0_tstg_cfg1_active_ways_v(u32 r)
80{
81 return (r >> 0U) & 0xffffU;
82}
83static inline u32 ltc_ltc0_lts0_tstg_cfg1_active_sets_v(u32 r)
84{
85 return (r >> 16U) & 0x3U;
86}
87static inline u32 ltc_ltc0_lts0_tstg_cfg1_active_sets_all_v(void)
88{
89 return 0x00000000U;
90}
91static inline u32 ltc_ltc0_lts0_tstg_cfg1_active_sets_half_v(void)
92{
93 return 0x00000001U;
94}
95static inline u32 ltc_ltc0_lts0_tstg_cfg1_active_sets_quarter_v(void)
96{
97 return 0x00000002U;
98}
99static inline u32 ltc_ltcs_ltss_cbc_ctrl1_r(void)
100{
101 return 0x0017e26cU;
102}
103static inline u32 ltc_ltcs_ltss_cbc_ctrl1_clean_active_f(void)
104{
105 return 0x1U;
106}
107static inline u32 ltc_ltcs_ltss_cbc_ctrl1_invalidate_active_f(void)
108{
109 return 0x2U;
110}
111static inline u32 ltc_ltcs_ltss_cbc_ctrl1_clear_v(u32 r)
112{
113 return (r >> 2U) & 0x1U;
114}
115static inline u32 ltc_ltcs_ltss_cbc_ctrl1_clear_active_v(void)
116{
117 return 0x00000001U;
118}
119static inline u32 ltc_ltcs_ltss_cbc_ctrl1_clear_active_f(void)
120{
121 return 0x4U;
122}
123static inline u32 ltc_ltc0_lts0_cbc_ctrl1_r(void)
124{
125 return 0x0014046cU;
126}
127static inline u32 ltc_ltcs_ltss_cbc_ctrl2_r(void)
128{
129 return 0x0017e270U;
130}
131static inline u32 ltc_ltcs_ltss_cbc_ctrl2_clear_lower_bound_f(u32 v)
132{
133 return (v & 0x3ffffU) << 0U;
134}
135static inline u32 ltc_ltcs_ltss_cbc_ctrl3_r(void)
136{
137 return 0x0017e274U;
138}
139static inline u32 ltc_ltcs_ltss_cbc_ctrl3_clear_upper_bound_f(u32 v)
140{
141 return (v & 0x3ffffU) << 0U;
142}
143static inline u32 ltc_ltcs_ltss_cbc_ctrl3_clear_upper_bound_init_v(void)
144{
145 return 0x0003ffffU;
146}
147static inline u32 ltc_ltcs_ltss_cbc_base_r(void)
148{
149 return 0x0017e278U;
150}
151static inline u32 ltc_ltcs_ltss_cbc_base_alignment_shift_v(void)
152{
153 return 0x0000000bU;
154}
155static inline u32 ltc_ltcs_ltss_cbc_base_address_v(u32 r)
156{
157 return (r >> 0U) & 0x3ffffffU;
158}
159static inline u32 ltc_ltcs_ltss_cbc_num_active_ltcs_r(void)
160{
161 return 0x0017e27cU;
162}
163static inline u32 ltc_ltcs_misc_ltc_num_active_ltcs_r(void)
164{
165 return 0x0017e000U;
166}
167static inline u32 ltc_ltcs_ltss_cbc_param_r(void)
168{
169 return 0x0017e280U;
170}
171static inline u32 ltc_ltcs_ltss_cbc_param_comptags_per_cache_line_v(u32 r)
172{
173 return (r >> 0U) & 0xffffU;
174}
175static inline u32 ltc_ltcs_ltss_cbc_param_cache_line_size_v(u32 r)
176{
177 return (r >> 24U) & 0xfU;
178}
179static inline u32 ltc_ltcs_ltss_cbc_param_slices_per_ltc_v(u32 r)
180{
181 return (r >> 28U) & 0xfU;
182}
183static inline u32 ltc_ltcs_ltss_cbc_param2_r(void)
184{
185 return 0x0017e3f4U;
186}
187static inline u32 ltc_ltcs_ltss_cbc_param2_gobs_per_comptagline_per_slice_v(u32 r)
188{
189 return (r >> 0U) & 0xffffU;
190}
191static inline u32 ltc_ltcs_ltss_tstg_set_mgmt_r(void)
192{
193 return 0x0017e2acU;
194}
195static inline u32 ltc_ltcs_ltss_tstg_set_mgmt_max_ways_evict_last_f(u32 v)
196{
197 return (v & 0x1fU) << 16U;
198}
199static inline u32 ltc_ltcs_ltss_dstg_zbc_index_r(void)
200{
201 return 0x0017e338U;
202}
203static inline u32 ltc_ltcs_ltss_dstg_zbc_index_address_f(u32 v)
204{
205 return (v & 0xfU) << 0U;
206}
207static inline u32 ltc_ltcs_ltss_dstg_zbc_color_clear_value_r(u32 i)
208{
209 return 0x0017e33cU + i*4U;
210}
211static inline u32 ltc_ltcs_ltss_dstg_zbc_color_clear_value__size_1_v(void)
212{
213 return 0x00000004U;
214}
215static inline u32 ltc_ltcs_ltss_dstg_zbc_depth_clear_value_r(void)
216{
217 return 0x0017e34cU;
218}
219static inline u32 ltc_ltcs_ltss_dstg_zbc_depth_clear_value_field_s(void)
220{
221 return 32U;
222}
223static inline u32 ltc_ltcs_ltss_dstg_zbc_depth_clear_value_field_f(u32 v)
224{
225 return (v & 0xffffffffU) << 0U;
226}
227static inline u32 ltc_ltcs_ltss_dstg_zbc_depth_clear_value_field_m(void)
228{
229 return 0xffffffffU << 0U;
230}
231static inline u32 ltc_ltcs_ltss_dstg_zbc_depth_clear_value_field_v(u32 r)
232{
233 return (r >> 0U) & 0xffffffffU;
234}
235static inline u32 ltc_ltcs_ltss_tstg_set_mgmt_2_r(void)
236{
237 return 0x0017e2b0U;
238}
239static inline u32 ltc_ltcs_ltss_tstg_set_mgmt_2_l2_bypass_mode_enabled_f(void)
240{
241 return 0x10000000U;
242}
243static inline u32 ltc_ltcs_ltss_g_elpg_r(void)
244{
245 return 0x0017e214U;
246}
247static inline u32 ltc_ltcs_ltss_g_elpg_flush_v(u32 r)
248{
249 return (r >> 0U) & 0x1U;
250}
251static inline u32 ltc_ltcs_ltss_g_elpg_flush_pending_v(void)
252{
253 return 0x00000001U;
254}
255static inline u32 ltc_ltcs_ltss_g_elpg_flush_pending_f(void)
256{
257 return 0x1U;
258}
259static inline u32 ltc_ltc0_ltss_g_elpg_r(void)
260{
261 return 0x00140214U;
262}
263static inline u32 ltc_ltc0_ltss_g_elpg_flush_v(u32 r)
264{
265 return (r >> 0U) & 0x1U;
266}
267static inline u32 ltc_ltc0_ltss_g_elpg_flush_pending_v(void)
268{
269 return 0x00000001U;
270}
271static inline u32 ltc_ltc0_ltss_g_elpg_flush_pending_f(void)
272{
273 return 0x1U;
274}
275static inline u32 ltc_ltc1_ltss_g_elpg_r(void)
276{
277 return 0x00142214U;
278}
279static inline u32 ltc_ltc1_ltss_g_elpg_flush_v(u32 r)
280{
281 return (r >> 0U) & 0x1U;
282}
283static inline u32 ltc_ltc1_ltss_g_elpg_flush_pending_v(void)
284{
285 return 0x00000001U;
286}
287static inline u32 ltc_ltc1_ltss_g_elpg_flush_pending_f(void)
288{
289 return 0x1U;
290}
291static inline u32 ltc_ltcs_ltss_intr_r(void)
292{
293 return 0x0017e20cU;
294}
295static inline u32 ltc_ltcs_ltss_intr_ecc_sec_error_pending_f(void)
296{
297 return 0x100U;
298}
299static inline u32 ltc_ltcs_ltss_intr_ecc_ded_error_pending_f(void)
300{
301 return 0x200U;
302}
303static inline u32 ltc_ltcs_ltss_intr_en_evicted_cb_m(void)
304{
305 return 0x1U << 20U;
306}
307static inline u32 ltc_ltcs_ltss_intr_en_illegal_compstat_access_m(void)
308{
309 return 0x1U << 30U;
310}
311static inline u32 ltc_ltcs_ltss_intr_en_ecc_sec_error_enabled_f(void)
312{
313 return 0x1000000U;
314}
315static inline u32 ltc_ltcs_ltss_intr_en_ecc_ded_error_enabled_f(void)
316{
317 return 0x2000000U;
318}
319static inline u32 ltc_ltc0_lts0_intr_r(void)
320{
321 return 0x0014040cU;
322}
323static inline u32 ltc_ltc0_lts0_dstg_ecc_report_r(void)
324{
325 return 0x0014051cU;
326}
327static inline u32 ltc_ltc0_lts0_dstg_ecc_report_sec_count_m(void)
328{
329 return 0xffU << 0U;
330}
331static inline u32 ltc_ltc0_lts0_dstg_ecc_report_sec_count_v(u32 r)
332{
333 return (r >> 0U) & 0xffU;
334}
335static inline u32 ltc_ltc0_lts0_dstg_ecc_report_ded_count_m(void)
336{
337 return 0xffU << 16U;
338}
339static inline u32 ltc_ltc0_lts0_dstg_ecc_report_ded_count_v(u32 r)
340{
341 return (r >> 16U) & 0xffU;
342}
343static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_r(void)
344{
345 return 0x0017e2a0U;
346}
347static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_invalidate_v(u32 r)
348{
349 return (r >> 0U) & 0x1U;
350}
351static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_invalidate_pending_v(void)
352{
353 return 0x00000001U;
354}
355static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_invalidate_pending_f(void)
356{
357 return 0x1U;
358}
359static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_max_cycles_between_invalidates_v(u32 r)
360{
361 return (r >> 8U) & 0xfU;
362}
363static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_max_cycles_between_invalidates_3_v(void)
364{
365 return 0x00000003U;
366}
367static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_max_cycles_between_invalidates_3_f(void)
368{
369 return 0x300U;
370}
371static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_invalidate_evict_last_class_v(u32 r)
372{
373 return (r >> 28U) & 0x1U;
374}
375static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_invalidate_evict_last_class_true_v(void)
376{
377 return 0x00000001U;
378}
379static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_invalidate_evict_last_class_true_f(void)
380{
381 return 0x10000000U;
382}
383static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_invalidate_evict_normal_class_v(u32 r)
384{
385 return (r >> 29U) & 0x1U;
386}
387static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_invalidate_evict_normal_class_true_v(void)
388{
389 return 0x00000001U;
390}
391static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_invalidate_evict_normal_class_true_f(void)
392{
393 return 0x20000000U;
394}
395static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_invalidate_evict_first_class_v(u32 r)
396{
397 return (r >> 30U) & 0x1U;
398}
399static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_invalidate_evict_first_class_true_v(void)
400{
401 return 0x00000001U;
402}
403static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_invalidate_evict_first_class_true_f(void)
404{
405 return 0x40000000U;
406}
407static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_r(void)
408{
409 return 0x0017e2a4U;
410}
411static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_v(u32 r)
412{
413 return (r >> 0U) & 0x1U;
414}
415static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_pending_v(void)
416{
417 return 0x00000001U;
418}
419static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_pending_f(void)
420{
421 return 0x1U;
422}
423static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_max_cycles_between_cleans_v(u32 r)
424{
425 return (r >> 8U) & 0xfU;
426}
427static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_max_cycles_between_cleans_3_v(void)
428{
429 return 0x00000003U;
430}
431static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_max_cycles_between_cleans_3_f(void)
432{
433 return 0x300U;
434}
435static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_wait_for_fb_to_pull_v(u32 r)
436{
437 return (r >> 16U) & 0x1U;
438}
439static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_wait_for_fb_to_pull_true_v(void)
440{
441 return 0x00000001U;
442}
443static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_wait_for_fb_to_pull_true_f(void)
444{
445 return 0x10000U;
446}
447static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_evict_last_class_v(u32 r)
448{
449 return (r >> 28U) & 0x1U;
450}
451static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_evict_last_class_true_v(void)
452{
453 return 0x00000001U;
454}
455static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_evict_last_class_true_f(void)
456{
457 return 0x10000000U;
458}
459static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_evict_normal_class_v(u32 r)
460{
461 return (r >> 29U) & 0x1U;
462}
463static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_evict_normal_class_true_v(void)
464{
465 return 0x00000001U;
466}
467static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_evict_normal_class_true_f(void)
468{
469 return 0x20000000U;
470}
471static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_evict_first_class_v(u32 r)
472{
473 return (r >> 30U) & 0x1U;
474}
475static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_evict_first_class_true_v(void)
476{
477 return 0x00000001U;
478}
479static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_evict_first_class_true_f(void)
480{
481 return 0x40000000U;
482}
483static inline u32 ltc_ltc0_ltss_tstg_cmgmt0_r(void)
484{
485 return 0x001402a0U;
486}
487static inline u32 ltc_ltc0_ltss_tstg_cmgmt0_invalidate_v(u32 r)
488{
489 return (r >> 0U) & 0x1U;
490}
491static inline u32 ltc_ltc0_ltss_tstg_cmgmt0_invalidate_pending_v(void)
492{
493 return 0x00000001U;
494}
495static inline u32 ltc_ltc0_ltss_tstg_cmgmt0_invalidate_pending_f(void)
496{
497 return 0x1U;
498}
499static inline u32 ltc_ltc0_ltss_tstg_cmgmt1_r(void)
500{
501 return 0x001402a4U;
502}
503static inline u32 ltc_ltc0_ltss_tstg_cmgmt1_clean_v(u32 r)
504{
505 return (r >> 0U) & 0x1U;
506}
507static inline u32 ltc_ltc0_ltss_tstg_cmgmt1_clean_pending_v(void)
508{
509 return 0x00000001U;
510}
511static inline u32 ltc_ltc0_ltss_tstg_cmgmt1_clean_pending_f(void)
512{
513 return 0x1U;
514}
515static inline u32 ltc_ltc1_ltss_tstg_cmgmt0_r(void)
516{
517 return 0x001422a0U;
518}
519static inline u32 ltc_ltc1_ltss_tstg_cmgmt0_invalidate_v(u32 r)
520{
521 return (r >> 0U) & 0x1U;
522}
523static inline u32 ltc_ltc1_ltss_tstg_cmgmt0_invalidate_pending_v(void)
524{
525 return 0x00000001U;
526}
527static inline u32 ltc_ltc1_ltss_tstg_cmgmt0_invalidate_pending_f(void)
528{
529 return 0x1U;
530}
531static inline u32 ltc_ltc1_ltss_tstg_cmgmt1_r(void)
532{
533 return 0x001422a4U;
534}
535static inline u32 ltc_ltc1_ltss_tstg_cmgmt1_clean_v(u32 r)
536{
537 return (r >> 0U) & 0x1U;
538}
539static inline u32 ltc_ltc1_ltss_tstg_cmgmt1_clean_pending_v(void)
540{
541 return 0x00000001U;
542}
543static inline u32 ltc_ltc1_ltss_tstg_cmgmt1_clean_pending_f(void)
544{
545 return 0x1U;
546}
547static inline u32 ltc_ltc0_lts0_tstg_info_1_r(void)
548{
549 return 0x0014058cU;
550}
551static inline u32 ltc_ltc0_lts0_tstg_info_1_slice_size_in_kb_v(u32 r)
552{
553 return (r >> 0U) & 0xffffU;
554}
555static inline u32 ltc_ltc0_lts0_tstg_info_1_slices_per_l2_v(u32 r)
556{
557 return (r >> 16U) & 0x1fU;
558}
559#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_mc_gp106.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_mc_gp106.h
new file mode 100644
index 00000000..349e2d7f
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_mc_gp106.h
@@ -0,0 +1,251 @@
1/*
2 * Copyright (c) 2016-2017, 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_mc_gp106_h_
57#define _hw_mc_gp106_h_
58
59static inline u32 mc_boot_0_r(void)
60{
61 return 0x00000000U;
62}
63static inline u32 mc_boot_0_architecture_v(u32 r)
64{
65 return (r >> 24U) & 0x1fU;
66}
67static inline u32 mc_boot_0_implementation_v(u32 r)
68{
69 return (r >> 20U) & 0xfU;
70}
71static inline u32 mc_boot_0_major_revision_v(u32 r)
72{
73 return (r >> 4U) & 0xfU;
74}
75static inline u32 mc_boot_0_minor_revision_v(u32 r)
76{
77 return (r >> 0U) & 0xfU;
78}
79static inline u32 mc_intr_r(u32 i)
80{
81 return 0x00000100U + i*4U;
82}
83static inline u32 mc_intr_pfifo_pending_f(void)
84{
85 return 0x100U;
86}
87static inline u32 mc_intr_replayable_fault_pending_f(void)
88{
89 return 0x200U;
90}
91static inline u32 mc_intr_pgraph_pending_f(void)
92{
93 return 0x1000U;
94}
95static inline u32 mc_intr_pmu_pending_f(void)
96{
97 return 0x1000000U;
98}
99static inline u32 mc_intr_ltc_pending_f(void)
100{
101 return 0x2000000U;
102}
103static inline u32 mc_intr_priv_ring_pending_f(void)
104{
105 return 0x40000000U;
106}
107static inline u32 mc_intr_pbus_pending_f(void)
108{
109 return 0x10000000U;
110}
111static inline u32 mc_intr_en_r(u32 i)
112{
113 return 0x00000140U + i*4U;
114}
115static inline u32 mc_intr_en_set_r(u32 i)
116{
117 return 0x00000160U + i*4U;
118}
119static inline u32 mc_intr_en_clear_r(u32 i)
120{
121 return 0x00000180U + i*4U;
122}
123static inline u32 mc_enable_r(void)
124{
125 return 0x00000200U;
126}
127static inline u32 mc_enable_xbar_enabled_f(void)
128{
129 return 0x4U;
130}
131static inline u32 mc_enable_l2_enabled_f(void)
132{
133 return 0x8U;
134}
135static inline u32 mc_enable_pmedia_s(void)
136{
137 return 1U;
138}
139static inline u32 mc_enable_pmedia_f(u32 v)
140{
141 return (v & 0x1U) << 4U;
142}
143static inline u32 mc_enable_pmedia_m(void)
144{
145 return 0x1U << 4U;
146}
147static inline u32 mc_enable_pmedia_v(u32 r)
148{
149 return (r >> 4U) & 0x1U;
150}
151static inline u32 mc_enable_priv_ring_enabled_f(void)
152{
153 return 0x20U;
154}
155static inline u32 mc_enable_ce0_m(void)
156{
157 return 0x1U << 6U;
158}
159static inline u32 mc_enable_pfifo_enabled_f(void)
160{
161 return 0x100U;
162}
163static inline u32 mc_enable_pgraph_enabled_f(void)
164{
165 return 0x1000U;
166}
167static inline u32 mc_enable_pwr_v(u32 r)
168{
169 return (r >> 13U) & 0x1U;
170}
171static inline u32 mc_enable_pwr_disabled_v(void)
172{
173 return 0x00000000U;
174}
175static inline u32 mc_enable_pwr_enabled_f(void)
176{
177 return 0x2000U;
178}
179static inline u32 mc_enable_pfb_enabled_f(void)
180{
181 return 0x100000U;
182}
183static inline u32 mc_enable_ce2_m(void)
184{
185 return 0x1U << 21U;
186}
187static inline u32 mc_enable_ce2_enabled_f(void)
188{
189 return 0x200000U;
190}
191static inline u32 mc_enable_blg_enabled_f(void)
192{
193 return 0x8000000U;
194}
195static inline u32 mc_enable_perfmon_enabled_f(void)
196{
197 return 0x10000000U;
198}
199static inline u32 mc_enable_hub_enabled_f(void)
200{
201 return 0x20000000U;
202}
203static inline u32 mc_intr_ltc_r(void)
204{
205 return 0x000001c0U;
206}
207static inline u32 mc_enable_pb_r(void)
208{
209 return 0x00000204U;
210}
211static inline u32 mc_enable_pb_0_s(void)
212{
213 return 1U;
214}
215static inline u32 mc_enable_pb_0_f(u32 v)
216{
217 return (v & 0x1U) << 0U;
218}
219static inline u32 mc_enable_pb_0_m(void)
220{
221 return 0x1U << 0U;
222}
223static inline u32 mc_enable_pb_0_v(u32 r)
224{
225 return (r >> 0U) & 0x1U;
226}
227static inline u32 mc_enable_pb_0_enabled_v(void)
228{
229 return 0x00000001U;
230}
231static inline u32 mc_enable_pb_sel_f(u32 v, u32 i)
232{
233 return (v & 0x1U) << (0U + i*1U);
234}
235static inline u32 mc_elpg_enable_r(void)
236{
237 return 0x0000020cU;
238}
239static inline u32 mc_elpg_enable_xbar_enabled_f(void)
240{
241 return 0x4U;
242}
243static inline u32 mc_elpg_enable_pfb_enabled_f(void)
244{
245 return 0x100000U;
246}
247static inline u32 mc_elpg_enable_hub_enabled_f(void)
248{
249 return 0x20000000U;
250}
251#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_pbdma_gp106.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_pbdma_gp106.h
new file mode 100644
index 00000000..dad6317d
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_pbdma_gp106.h
@@ -0,0 +1,527 @@
1/*
2 * Copyright (c) 2016-2017, 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_pbdma_gp106_h_
57#define _hw_pbdma_gp106_h_
58
59static inline u32 pbdma_gp_entry1_r(void)
60{
61 return 0x10000004U;
62}
63static inline u32 pbdma_gp_entry1_get_hi_v(u32 r)
64{
65 return (r >> 0U) & 0xffU;
66}
67static inline u32 pbdma_gp_entry1_length_f(u32 v)
68{
69 return (v & 0x1fffffU) << 10U;
70}
71static inline u32 pbdma_gp_entry1_length_v(u32 r)
72{
73 return (r >> 10U) & 0x1fffffU;
74}
75static inline u32 pbdma_gp_base_r(u32 i)
76{
77 return 0x00040048U + i*8192U;
78}
79static inline u32 pbdma_gp_base__size_1_v(void)
80{
81 return 0x00000004U;
82}
83static inline u32 pbdma_gp_base_offset_f(u32 v)
84{
85 return (v & 0x1fffffffU) << 3U;
86}
87static inline u32 pbdma_gp_base_rsvd_s(void)
88{
89 return 3U;
90}
91static inline u32 pbdma_gp_base_hi_r(u32 i)
92{
93 return 0x0004004cU + i*8192U;
94}
95static inline u32 pbdma_gp_base_hi_offset_f(u32 v)
96{
97 return (v & 0xffU) << 0U;
98}
99static inline u32 pbdma_gp_base_hi_limit2_f(u32 v)
100{
101 return (v & 0x1fU) << 16U;
102}
103static inline u32 pbdma_gp_fetch_r(u32 i)
104{
105 return 0x00040050U + i*8192U;
106}
107static inline u32 pbdma_gp_get_r(u32 i)
108{
109 return 0x00040014U + i*8192U;
110}
111static inline u32 pbdma_gp_put_r(u32 i)
112{
113 return 0x00040000U + i*8192U;
114}
115static inline u32 pbdma_pb_fetch_r(u32 i)
116{
117 return 0x00040054U + i*8192U;
118}
119static inline u32 pbdma_pb_fetch_hi_r(u32 i)
120{
121 return 0x00040058U + i*8192U;
122}
123static inline u32 pbdma_get_r(u32 i)
124{
125 return 0x00040018U + i*8192U;
126}
127static inline u32 pbdma_get_hi_r(u32 i)
128{
129 return 0x0004001cU + i*8192U;
130}
131static inline u32 pbdma_put_r(u32 i)
132{
133 return 0x0004005cU + i*8192U;
134}
135static inline u32 pbdma_put_hi_r(u32 i)
136{
137 return 0x00040060U + i*8192U;
138}
139static inline u32 pbdma_formats_r(u32 i)
140{
141 return 0x0004009cU + i*8192U;
142}
143static inline u32 pbdma_formats_gp_fermi0_f(void)
144{
145 return 0x0U;
146}
147static inline u32 pbdma_formats_pb_fermi1_f(void)
148{
149 return 0x100U;
150}
151static inline u32 pbdma_formats_mp_fermi0_f(void)
152{
153 return 0x0U;
154}
155static inline u32 pbdma_pb_header_r(u32 i)
156{
157 return 0x00040084U + i*8192U;
158}
159static inline u32 pbdma_pb_header_priv_user_f(void)
160{
161 return 0x0U;
162}
163static inline u32 pbdma_pb_header_method_zero_f(void)
164{
165 return 0x0U;
166}
167static inline u32 pbdma_pb_header_subchannel_zero_f(void)
168{
169 return 0x0U;
170}
171static inline u32 pbdma_pb_header_level_main_f(void)
172{
173 return 0x0U;
174}
175static inline u32 pbdma_pb_header_first_true_f(void)
176{
177 return 0x400000U;
178}
179static inline u32 pbdma_pb_header_type_inc_f(void)
180{
181 return 0x20000000U;
182}
183static inline u32 pbdma_pb_header_type_non_inc_f(void)
184{
185 return 0x60000000U;
186}
187static inline u32 pbdma_hdr_shadow_r(u32 i)
188{
189 return 0x00040118U + i*8192U;
190}
191static inline u32 pbdma_gp_shadow_0_r(u32 i)
192{
193 return 0x00040110U + i*8192U;
194}
195static inline u32 pbdma_gp_shadow_1_r(u32 i)
196{
197 return 0x00040114U + i*8192U;
198}
199static inline u32 pbdma_subdevice_r(u32 i)
200{
201 return 0x00040094U + i*8192U;
202}
203static inline u32 pbdma_subdevice_id_f(u32 v)
204{
205 return (v & 0xfffU) << 0U;
206}
207static inline u32 pbdma_subdevice_status_active_f(void)
208{
209 return 0x10000000U;
210}
211static inline u32 pbdma_subdevice_channel_dma_enable_f(void)
212{
213 return 0x20000000U;
214}
215static inline u32 pbdma_method0_r(u32 i)
216{
217 return 0x000400c0U + i*8192U;
218}
219static inline u32 pbdma_method0_fifo_size_v(void)
220{
221 return 0x00000004U;
222}
223static inline u32 pbdma_method0_addr_f(u32 v)
224{
225 return (v & 0xfffU) << 2U;
226}
227static inline u32 pbdma_method0_addr_v(u32 r)
228{
229 return (r >> 2U) & 0xfffU;
230}
231static inline u32 pbdma_method0_subch_v(u32 r)
232{
233 return (r >> 16U) & 0x7U;
234}
235static inline u32 pbdma_method0_first_true_f(void)
236{
237 return 0x400000U;
238}
239static inline u32 pbdma_method0_valid_true_f(void)
240{
241 return 0x80000000U;
242}
243static inline u32 pbdma_method1_r(u32 i)
244{
245 return 0x000400c8U + i*8192U;
246}
247static inline u32 pbdma_method2_r(u32 i)
248{
249 return 0x000400d0U + i*8192U;
250}
251static inline u32 pbdma_method3_r(u32 i)
252{
253 return 0x000400d8U + i*8192U;
254}
255static inline u32 pbdma_data0_r(u32 i)
256{
257 return 0x000400c4U + i*8192U;
258}
259static inline u32 pbdma_target_r(u32 i)
260{
261 return 0x000400acU + i*8192U;
262}
263static inline u32 pbdma_target_engine_sw_f(void)
264{
265 return 0x1fU;
266}
267static inline u32 pbdma_acquire_r(u32 i)
268{
269 return 0x00040030U + i*8192U;
270}
271static inline u32 pbdma_acquire_retry_man_2_f(void)
272{
273 return 0x2U;
274}
275static inline u32 pbdma_acquire_retry_exp_2_f(void)
276{
277 return 0x100U;
278}
279static inline u32 pbdma_acquire_timeout_exp_max_f(void)
280{
281 return 0x7800U;
282}
283static inline u32 pbdma_acquire_timeout_man_max_f(void)
284{
285 return 0x7fff8000U;
286}
287static inline u32 pbdma_acquire_timeout_en_disable_f(void)
288{
289 return 0x0U;
290}
291static inline u32 pbdma_status_r(u32 i)
292{
293 return 0x00040100U + i*8192U;
294}
295static inline u32 pbdma_channel_r(u32 i)
296{
297 return 0x00040120U + i*8192U;
298}
299static inline u32 pbdma_signature_r(u32 i)
300{
301 return 0x00040010U + i*8192U;
302}
303static inline u32 pbdma_signature_hw_valid_f(void)
304{
305 return 0xfaceU;
306}
307static inline u32 pbdma_signature_sw_zero_f(void)
308{
309 return 0x0U;
310}
311static inline u32 pbdma_userd_r(u32 i)
312{
313 return 0x00040008U + i*8192U;
314}
315static inline u32 pbdma_userd_target_vid_mem_f(void)
316{
317 return 0x0U;
318}
319static inline u32 pbdma_userd_target_sys_mem_coh_f(void)
320{
321 return 0x2U;
322}
323static inline u32 pbdma_userd_target_sys_mem_ncoh_f(void)
324{
325 return 0x3U;
326}
327static inline u32 pbdma_userd_addr_f(u32 v)
328{
329 return (v & 0x7fffffU) << 9U;
330}
331static inline u32 pbdma_userd_hi_r(u32 i)
332{
333 return 0x0004000cU + i*8192U;
334}
335static inline u32 pbdma_userd_hi_addr_f(u32 v)
336{
337 return (v & 0xffU) << 0U;
338}
339static inline u32 pbdma_config_r(u32 i)
340{
341 return 0x000400f4U + i*8192U;
342}
343static inline u32 pbdma_config_auth_level_privileged_f(void)
344{
345 return 0x100U;
346}
347static inline u32 pbdma_hce_ctrl_r(u32 i)
348{
349 return 0x000400e4U + i*8192U;
350}
351static inline u32 pbdma_hce_ctrl_hce_priv_mode_yes_f(void)
352{
353 return 0x20U;
354}
355static inline u32 pbdma_intr_0_r(u32 i)
356{
357 return 0x00040108U + i*8192U;
358}
359static inline u32 pbdma_intr_0_memreq_v(u32 r)
360{
361 return (r >> 0U) & 0x1U;
362}
363static inline u32 pbdma_intr_0_memreq_pending_f(void)
364{
365 return 0x1U;
366}
367static inline u32 pbdma_intr_0_memack_timeout_pending_f(void)
368{
369 return 0x2U;
370}
371static inline u32 pbdma_intr_0_memack_extra_pending_f(void)
372{
373 return 0x4U;
374}
375static inline u32 pbdma_intr_0_memdat_timeout_pending_f(void)
376{
377 return 0x8U;
378}
379static inline u32 pbdma_intr_0_memdat_extra_pending_f(void)
380{
381 return 0x10U;
382}
383static inline u32 pbdma_intr_0_memflush_pending_f(void)
384{
385 return 0x20U;
386}
387static inline u32 pbdma_intr_0_memop_pending_f(void)
388{
389 return 0x40U;
390}
391static inline u32 pbdma_intr_0_lbconnect_pending_f(void)
392{
393 return 0x80U;
394}
395static inline u32 pbdma_intr_0_lbreq_pending_f(void)
396{
397 return 0x100U;
398}
399static inline u32 pbdma_intr_0_lback_timeout_pending_f(void)
400{
401 return 0x200U;
402}
403static inline u32 pbdma_intr_0_lback_extra_pending_f(void)
404{
405 return 0x400U;
406}
407static inline u32 pbdma_intr_0_lbdat_timeout_pending_f(void)
408{
409 return 0x800U;
410}
411static inline u32 pbdma_intr_0_lbdat_extra_pending_f(void)
412{
413 return 0x1000U;
414}
415static inline u32 pbdma_intr_0_gpfifo_pending_f(void)
416{
417 return 0x2000U;
418}
419static inline u32 pbdma_intr_0_gpptr_pending_f(void)
420{
421 return 0x4000U;
422}
423static inline u32 pbdma_intr_0_gpentry_pending_f(void)
424{
425 return 0x8000U;
426}
427static inline u32 pbdma_intr_0_gpcrc_pending_f(void)
428{
429 return 0x10000U;
430}
431static inline u32 pbdma_intr_0_pbptr_pending_f(void)
432{
433 return 0x20000U;
434}
435static inline u32 pbdma_intr_0_pbentry_pending_f(void)
436{
437 return 0x40000U;
438}
439static inline u32 pbdma_intr_0_pbcrc_pending_f(void)
440{
441 return 0x80000U;
442}
443static inline u32 pbdma_intr_0_xbarconnect_pending_f(void)
444{
445 return 0x100000U;
446}
447static inline u32 pbdma_intr_0_method_pending_f(void)
448{
449 return 0x200000U;
450}
451static inline u32 pbdma_intr_0_methodcrc_pending_f(void)
452{
453 return 0x400000U;
454}
455static inline u32 pbdma_intr_0_device_pending_f(void)
456{
457 return 0x800000U;
458}
459static inline u32 pbdma_intr_0_semaphore_pending_f(void)
460{
461 return 0x2000000U;
462}
463static inline u32 pbdma_intr_0_acquire_pending_f(void)
464{
465 return 0x4000000U;
466}
467static inline u32 pbdma_intr_0_pri_pending_f(void)
468{
469 return 0x8000000U;
470}
471static inline u32 pbdma_intr_0_no_ctxsw_seg_pending_f(void)
472{
473 return 0x20000000U;
474}
475static inline u32 pbdma_intr_0_pbseg_pending_f(void)
476{
477 return 0x40000000U;
478}
479static inline u32 pbdma_intr_0_signature_pending_f(void)
480{
481 return 0x80000000U;
482}
483static inline u32 pbdma_intr_1_r(u32 i)
484{
485 return 0x00040148U + i*8192U;
486}
487static inline u32 pbdma_intr_en_0_r(u32 i)
488{
489 return 0x0004010cU + i*8192U;
490}
491static inline u32 pbdma_intr_en_0_lbreq_enabled_f(void)
492{
493 return 0x100U;
494}
495static inline u32 pbdma_intr_en_1_r(u32 i)
496{
497 return 0x0004014cU + i*8192U;
498}
499static inline u32 pbdma_intr_stall_r(u32 i)
500{
501 return 0x0004013cU + i*8192U;
502}
503static inline u32 pbdma_intr_stall_lbreq_enabled_f(void)
504{
505 return 0x100U;
506}
507static inline u32 pbdma_udma_nop_r(void)
508{
509 return 0x00000008U;
510}
511static inline u32 pbdma_runlist_timeslice_r(u32 i)
512{
513 return 0x000400f8U + i*8192U;
514}
515static inline u32 pbdma_runlist_timeslice_timeout_128_f(void)
516{
517 return 0x80U;
518}
519static inline u32 pbdma_runlist_timeslice_timescale_3_f(void)
520{
521 return 0x3000U;
522}
523static inline u32 pbdma_runlist_timeslice_enable_true_f(void)
524{
525 return 0x10000000U;
526}
527#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_perf_gp106.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_perf_gp106.h
new file mode 100644
index 00000000..b0182789
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_perf_gp106.h
@@ -0,0 +1,211 @@
1/*
2 * Copyright (c) 2016-2017, 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_perf_gp106_h_
57#define _hw_perf_gp106_h_
58
59static inline u32 perf_pmasys_control_r(void)
60{
61 return 0x001b4000U;
62}
63static inline u32 perf_pmasys_control_membuf_status_v(u32 r)
64{
65 return (r >> 4U) & 0x1U;
66}
67static inline u32 perf_pmasys_control_membuf_status_overflowed_v(void)
68{
69 return 0x00000001U;
70}
71static inline u32 perf_pmasys_control_membuf_status_overflowed_f(void)
72{
73 return 0x10U;
74}
75static inline u32 perf_pmasys_control_membuf_clear_status_f(u32 v)
76{
77 return (v & 0x1U) << 5U;
78}
79static inline u32 perf_pmasys_control_membuf_clear_status_v(u32 r)
80{
81 return (r >> 5U) & 0x1U;
82}
83static inline u32 perf_pmasys_control_membuf_clear_status_doit_v(void)
84{
85 return 0x00000001U;
86}
87static inline u32 perf_pmasys_control_membuf_clear_status_doit_f(void)
88{
89 return 0x20U;
90}
91static inline u32 perf_pmasys_mem_block_r(void)
92{
93 return 0x001b4070U;
94}
95static inline u32 perf_pmasys_mem_block_base_f(u32 v)
96{
97 return (v & 0xfffffffU) << 0U;
98}
99static inline u32 perf_pmasys_mem_block_target_f(u32 v)
100{
101 return (v & 0x3U) << 28U;
102}
103static inline u32 perf_pmasys_mem_block_target_v(u32 r)
104{
105 return (r >> 28U) & 0x3U;
106}
107static inline u32 perf_pmasys_mem_block_target_lfb_v(void)
108{
109 return 0x00000000U;
110}
111static inline u32 perf_pmasys_mem_block_target_lfb_f(void)
112{
113 return 0x0U;
114}
115static inline u32 perf_pmasys_mem_block_target_sys_coh_v(void)
116{
117 return 0x00000002U;
118}
119static inline u32 perf_pmasys_mem_block_target_sys_coh_f(void)
120{
121 return 0x20000000U;
122}
123static inline u32 perf_pmasys_mem_block_target_sys_ncoh_v(void)
124{
125 return 0x00000003U;
126}
127static inline u32 perf_pmasys_mem_block_target_sys_ncoh_f(void)
128{
129 return 0x30000000U;
130}
131static inline u32 perf_pmasys_mem_block_valid_f(u32 v)
132{
133 return (v & 0x1U) << 31U;
134}
135static inline u32 perf_pmasys_mem_block_valid_v(u32 r)
136{
137 return (r >> 31U) & 0x1U;
138}
139static inline u32 perf_pmasys_mem_block_valid_true_v(void)
140{
141 return 0x00000001U;
142}
143static inline u32 perf_pmasys_mem_block_valid_true_f(void)
144{
145 return 0x80000000U;
146}
147static inline u32 perf_pmasys_mem_block_valid_false_v(void)
148{
149 return 0x00000000U;
150}
151static inline u32 perf_pmasys_mem_block_valid_false_f(void)
152{
153 return 0x0U;
154}
155static inline u32 perf_pmasys_outbase_r(void)
156{
157 return 0x001b4074U;
158}
159static inline u32 perf_pmasys_outbase_ptr_f(u32 v)
160{
161 return (v & 0x7ffffffU) << 5U;
162}
163static inline u32 perf_pmasys_outbaseupper_r(void)
164{
165 return 0x001b4078U;
166}
167static inline u32 perf_pmasys_outbaseupper_ptr_f(u32 v)
168{
169 return (v & 0xffU) << 0U;
170}
171static inline u32 perf_pmasys_outsize_r(void)
172{
173 return 0x001b407cU;
174}
175static inline u32 perf_pmasys_outsize_numbytes_f(u32 v)
176{
177 return (v & 0x7ffffffU) << 5U;
178}
179static inline u32 perf_pmasys_mem_bytes_r(void)
180{
181 return 0x001b4084U;
182}
183static inline u32 perf_pmasys_mem_bytes_numbytes_f(u32 v)
184{
185 return (v & 0xfffffffU) << 4U;
186}
187static inline u32 perf_pmasys_mem_bump_r(void)
188{
189 return 0x001b4088U;
190}
191static inline u32 perf_pmasys_mem_bump_numbytes_f(u32 v)
192{
193 return (v & 0xfffffffU) << 4U;
194}
195static inline u32 perf_pmasys_enginestatus_r(void)
196{
197 return 0x001b40a4U;
198}
199static inline u32 perf_pmasys_enginestatus_rbufempty_f(u32 v)
200{
201 return (v & 0x1U) << 4U;
202}
203static inline u32 perf_pmasys_enginestatus_rbufempty_empty_v(void)
204{
205 return 0x00000001U;
206}
207static inline u32 perf_pmasys_enginestatus_rbufempty_empty_f(void)
208{
209 return 0x10U;
210}
211#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_pram_gp106.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_pram_gp106.h
new file mode 100644
index 00000000..7e33e716
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_pram_gp106.h
@@ -0,0 +1,63 @@
1/*
2 * Copyright (c) 2017, 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_pram_gp106_h_
57#define _hw_pram_gp106_h_
58
59static inline u32 pram_data032_r(u32 i)
60{
61 return 0x00700000U + i*4U;
62}
63#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_pri_ringmaster_gp106.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_pri_ringmaster_gp106.h
new file mode 100644
index 00000000..efdedc3b
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_pri_ringmaster_gp106.h
@@ -0,0 +1,151 @@
1/*
2 * Copyright (c) 2016-2017, 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_pri_ringmaster_gp106_h_
57#define _hw_pri_ringmaster_gp106_h_
58
59static inline u32 pri_ringmaster_command_r(void)
60{
61 return 0x0012004cU;
62}
63static inline u32 pri_ringmaster_command_cmd_m(void)
64{
65 return 0x3fU << 0U;
66}
67static inline u32 pri_ringmaster_command_cmd_v(u32 r)
68{
69 return (r >> 0U) & 0x3fU;
70}
71static inline u32 pri_ringmaster_command_cmd_no_cmd_v(void)
72{
73 return 0x00000000U;
74}
75static inline u32 pri_ringmaster_command_cmd_start_ring_f(void)
76{
77 return 0x1U;
78}
79static inline u32 pri_ringmaster_command_cmd_ack_interrupt_f(void)
80{
81 return 0x2U;
82}
83static inline u32 pri_ringmaster_command_cmd_enumerate_stations_f(void)
84{
85 return 0x3U;
86}
87static inline u32 pri_ringmaster_command_cmd_enumerate_stations_bc_grp_all_f(void)
88{
89 return 0x0U;
90}
91static inline u32 pri_ringmaster_command_data_r(void)
92{
93 return 0x00120048U;
94}
95static inline u32 pri_ringmaster_start_results_r(void)
96{
97 return 0x00120050U;
98}
99static inline u32 pri_ringmaster_start_results_connectivity_v(u32 r)
100{
101 return (r >> 0U) & 0x1U;
102}
103static inline u32 pri_ringmaster_start_results_connectivity_pass_v(void)
104{
105 return 0x00000001U;
106}
107static inline u32 pri_ringmaster_intr_status0_r(void)
108{
109 return 0x00120058U;
110}
111static inline u32 pri_ringmaster_intr_status1_r(void)
112{
113 return 0x0012005cU;
114}
115static inline u32 pri_ringmaster_global_ctl_r(void)
116{
117 return 0x00120060U;
118}
119static inline u32 pri_ringmaster_global_ctl_ring_reset_asserted_f(void)
120{
121 return 0x1U;
122}
123static inline u32 pri_ringmaster_global_ctl_ring_reset_deasserted_f(void)
124{
125 return 0x0U;
126}
127static inline u32 pri_ringmaster_enum_fbp_r(void)
128{
129 return 0x00120074U;
130}
131static inline u32 pri_ringmaster_enum_fbp_count_v(u32 r)
132{
133 return (r >> 0U) & 0x1fU;
134}
135static inline u32 pri_ringmaster_enum_gpc_r(void)
136{
137 return 0x00120078U;
138}
139static inline u32 pri_ringmaster_enum_gpc_count_v(u32 r)
140{
141 return (r >> 0U) & 0x1fU;
142}
143static inline u32 pri_ringmaster_enum_ltc_r(void)
144{
145 return 0x0012006cU;
146}
147static inline u32 pri_ringmaster_enum_ltc_count_v(u32 r)
148{
149 return (r >> 0U) & 0x1fU;
150}
151#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_pri_ringstation_gpc_gp106.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_pri_ringstation_gpc_gp106.h
new file mode 100644
index 00000000..711938d4
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_pri_ringstation_gpc_gp106.h
@@ -0,0 +1,79 @@
1/*
2 * Copyright (c) 2017, 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_pri_ringstation_gpc_gp106_h_
57#define _hw_pri_ringstation_gpc_gp106_h_
58
59static inline u32 pri_ringstation_gpc_master_config_r(u32 i)
60{
61 return 0x00128300U + i*4U;
62}
63static inline u32 pri_ringstation_gpc_gpc0_priv_error_adr_r(void)
64{
65 return 0x00128120U;
66}
67static inline u32 pri_ringstation_gpc_gpc0_priv_error_wrdat_r(void)
68{
69 return 0x00128124U;
70}
71static inline u32 pri_ringstation_gpc_gpc0_priv_error_info_r(void)
72{
73 return 0x00128128U;
74}
75static inline u32 pri_ringstation_gpc_gpc0_priv_error_code_r(void)
76{
77 return 0x0012812cU;
78}
79#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_pri_ringstation_sys_gp106.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_pri_ringstation_sys_gp106.h
new file mode 100644
index 00000000..a3a1447d
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_pri_ringstation_sys_gp106.h
@@ -0,0 +1,91 @@
1/*
2 * Copyright (c) 2016-2017, 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_pri_ringstation_sys_gp106_h_
57#define _hw_pri_ringstation_sys_gp106_h_
58
59static inline u32 pri_ringstation_sys_master_config_r(u32 i)
60{
61 return 0x00122300U + i*4U;
62}
63static inline u32 pri_ringstation_sys_decode_config_r(void)
64{
65 return 0x00122204U;
66}
67static inline u32 pri_ringstation_sys_decode_config_ring_m(void)
68{
69 return 0x7U << 0U;
70}
71static inline u32 pri_ringstation_sys_decode_config_ring_drop_on_ring_not_started_f(void)
72{
73 return 0x1U;
74}
75static inline u32 pri_ringstation_sys_priv_error_adr_r(void)
76{
77 return 0x00122120U;
78}
79static inline u32 pri_ringstation_sys_priv_error_wrdat_r(void)
80{
81 return 0x00122124U;
82}
83static inline u32 pri_ringstation_sys_priv_error_info_r(void)
84{
85 return 0x00122128U;
86}
87static inline u32 pri_ringstation_sys_priv_error_code_r(void)
88{
89 return 0x0012212cU;
90}
91#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_proj_gp106.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_proj_gp106.h
new file mode 100644
index 00000000..be2111cc
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_proj_gp106.h
@@ -0,0 +1,175 @@
1/*
2 * Copyright (c) 2016-2017, 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_proj_gp106_h_
57#define _hw_proj_gp106_h_
58
59static inline u32 proj_gpc_base_v(void)
60{
61 return 0x00500000U;
62}
63static inline u32 proj_gpc_shared_base_v(void)
64{
65 return 0x00418000U;
66}
67static inline u32 proj_gpc_stride_v(void)
68{
69 return 0x00008000U;
70}
71static inline u32 proj_ltc_stride_v(void)
72{
73 return 0x00002000U;
74}
75static inline u32 proj_lts_stride_v(void)
76{
77 return 0x00000200U;
78}
79static inline u32 proj_fbpa_base_v(void)
80{
81 return 0x00900000U;
82}
83static inline u32 proj_fbpa_shared_base_v(void)
84{
85 return 0x009a0000U;
86}
87static inline u32 proj_fbpa_stride_v(void)
88{
89 return 0x00004000U;
90}
91static inline u32 proj_ppc_in_gpc_base_v(void)
92{
93 return 0x00003000U;
94}
95static inline u32 proj_ppc_in_gpc_shared_base_v(void)
96{
97 return 0x00003e00U;
98}
99static inline u32 proj_ppc_in_gpc_stride_v(void)
100{
101 return 0x00000200U;
102}
103static inline u32 proj_rop_base_v(void)
104{
105 return 0x00410000U;
106}
107static inline u32 proj_rop_shared_base_v(void)
108{
109 return 0x00408800U;
110}
111static inline u32 proj_rop_stride_v(void)
112{
113 return 0x00000400U;
114}
115static inline u32 proj_tpc_in_gpc_base_v(void)
116{
117 return 0x00004000U;
118}
119static inline u32 proj_tpc_in_gpc_stride_v(void)
120{
121 return 0x00000800U;
122}
123static inline u32 proj_tpc_in_gpc_shared_base_v(void)
124{
125 return 0x00001800U;
126}
127static inline u32 proj_host_num_engines_v(void)
128{
129 return 0x00000009U;
130}
131static inline u32 proj_host_num_pbdma_v(void)
132{
133 return 0x00000004U;
134}
135static inline u32 proj_scal_litter_num_tpc_per_gpc_v(void)
136{
137 return 0x00000005U;
138}
139static inline u32 proj_scal_litter_num_sm_per_tpc_v(void)
140{
141 return 0x00000001U;
142}
143static inline u32 proj_scal_litter_num_fbps_v(void)
144{
145 return 0x00000006U;
146}
147static inline u32 proj_scal_litter_num_fbpas_v(void)
148{
149 return 0x00000006U;
150}
151static inline u32 proj_scal_litter_num_gpcs_v(void)
152{
153 return 0x00000006U;
154}
155static inline u32 proj_scal_litter_num_pes_per_gpc_v(void)
156{
157 return 0x00000003U;
158}
159static inline u32 proj_scal_litter_num_tpcs_per_pes_v(void)
160{
161 return 0x00000002U;
162}
163static inline u32 proj_scal_litter_num_zcull_banks_v(void)
164{
165 return 0x00000004U;
166}
167static inline u32 proj_scal_max_gpcs_v(void)
168{
169 return 0x00000020U;
170}
171static inline u32 proj_scal_max_tpc_per_gpc_v(void)
172{
173 return 0x00000008U;
174}
175#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_psec_gp106.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_psec_gp106.h
new file mode 100644
index 00000000..b91c09ba
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_psec_gp106.h
@@ -0,0 +1,615 @@
1/*
2 * Copyright (c) 2016-2017, 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_psec_gp106_h_
57#define _hw_psec_gp106_h_
58
59static inline u32 psec_falcon_irqsset_r(void)
60{
61 return 0x00087000U;
62}
63static inline u32 psec_falcon_irqsset_swgen0_set_f(void)
64{
65 return 0x40U;
66}
67static inline u32 psec_falcon_irqsclr_r(void)
68{
69 return 0x00087004U;
70}
71static inline u32 psec_falcon_irqstat_r(void)
72{
73 return 0x00087008U;
74}
75static inline u32 psec_falcon_irqstat_halt_true_f(void)
76{
77 return 0x10U;
78}
79static inline u32 psec_falcon_irqstat_exterr_true_f(void)
80{
81 return 0x20U;
82}
83static inline u32 psec_falcon_irqstat_swgen0_true_f(void)
84{
85 return 0x40U;
86}
87static inline u32 psec_falcon_irqmode_r(void)
88{
89 return 0x0008700cU;
90}
91static inline u32 psec_falcon_irqmset_r(void)
92{
93 return 0x00087010U;
94}
95static inline u32 psec_falcon_irqmset_gptmr_f(u32 v)
96{
97 return (v & 0x1U) << 0U;
98}
99static inline u32 psec_falcon_irqmset_wdtmr_f(u32 v)
100{
101 return (v & 0x1U) << 1U;
102}
103static inline u32 psec_falcon_irqmset_mthd_f(u32 v)
104{
105 return (v & 0x1U) << 2U;
106}
107static inline u32 psec_falcon_irqmset_ctxsw_f(u32 v)
108{
109 return (v & 0x1U) << 3U;
110}
111static inline u32 psec_falcon_irqmset_halt_f(u32 v)
112{
113 return (v & 0x1U) << 4U;
114}
115static inline u32 psec_falcon_irqmset_exterr_f(u32 v)
116{
117 return (v & 0x1U) << 5U;
118}
119static inline u32 psec_falcon_irqmset_swgen0_f(u32 v)
120{
121 return (v & 0x1U) << 6U;
122}
123static inline u32 psec_falcon_irqmset_swgen1_f(u32 v)
124{
125 return (v & 0x1U) << 7U;
126}
127static inline u32 psec_falcon_irqmclr_r(void)
128{
129 return 0x00087014U;
130}
131static inline u32 psec_falcon_irqmclr_gptmr_f(u32 v)
132{
133 return (v & 0x1U) << 0U;
134}
135static inline u32 psec_falcon_irqmclr_wdtmr_f(u32 v)
136{
137 return (v & 0x1U) << 1U;
138}
139static inline u32 psec_falcon_irqmclr_mthd_f(u32 v)
140{
141 return (v & 0x1U) << 2U;
142}
143static inline u32 psec_falcon_irqmclr_ctxsw_f(u32 v)
144{
145 return (v & 0x1U) << 3U;
146}
147static inline u32 psec_falcon_irqmclr_halt_f(u32 v)
148{
149 return (v & 0x1U) << 4U;
150}
151static inline u32 psec_falcon_irqmclr_exterr_f(u32 v)
152{
153 return (v & 0x1U) << 5U;
154}
155static inline u32 psec_falcon_irqmclr_swgen0_f(u32 v)
156{
157 return (v & 0x1U) << 6U;
158}
159static inline u32 psec_falcon_irqmclr_swgen1_f(u32 v)
160{
161 return (v & 0x1U) << 7U;
162}
163static inline u32 psec_falcon_irqmclr_ext_f(u32 v)
164{
165 return (v & 0xffU) << 8U;
166}
167static inline u32 psec_falcon_irqmask_r(void)
168{
169 return 0x00087018U;
170}
171static inline u32 psec_falcon_irqdest_r(void)
172{
173 return 0x0008701cU;
174}
175static inline u32 psec_falcon_irqdest_host_gptmr_f(u32 v)
176{
177 return (v & 0x1U) << 0U;
178}
179static inline u32 psec_falcon_irqdest_host_wdtmr_f(u32 v)
180{
181 return (v & 0x1U) << 1U;
182}
183static inline u32 psec_falcon_irqdest_host_mthd_f(u32 v)
184{
185 return (v & 0x1U) << 2U;
186}
187static inline u32 psec_falcon_irqdest_host_ctxsw_f(u32 v)
188{
189 return (v & 0x1U) << 3U;
190}
191static inline u32 psec_falcon_irqdest_host_halt_f(u32 v)
192{
193 return (v & 0x1U) << 4U;
194}
195static inline u32 psec_falcon_irqdest_host_exterr_f(u32 v)
196{
197 return (v & 0x1U) << 5U;
198}
199static inline u32 psec_falcon_irqdest_host_swgen0_f(u32 v)
200{
201 return (v & 0x1U) << 6U;
202}
203static inline u32 psec_falcon_irqdest_host_swgen1_f(u32 v)
204{
205 return (v & 0x1U) << 7U;
206}
207static inline u32 psec_falcon_irqdest_host_ext_f(u32 v)
208{
209 return (v & 0xffU) << 8U;
210}
211static inline u32 psec_falcon_irqdest_target_gptmr_f(u32 v)
212{
213 return (v & 0x1U) << 16U;
214}
215static inline u32 psec_falcon_irqdest_target_wdtmr_f(u32 v)
216{
217 return (v & 0x1U) << 17U;
218}
219static inline u32 psec_falcon_irqdest_target_mthd_f(u32 v)
220{
221 return (v & 0x1U) << 18U;
222}
223static inline u32 psec_falcon_irqdest_target_ctxsw_f(u32 v)
224{
225 return (v & 0x1U) << 19U;
226}
227static inline u32 psec_falcon_irqdest_target_halt_f(u32 v)
228{
229 return (v & 0x1U) << 20U;
230}
231static inline u32 psec_falcon_irqdest_target_exterr_f(u32 v)
232{
233 return (v & 0x1U) << 21U;
234}
235static inline u32 psec_falcon_irqdest_target_swgen0_f(u32 v)
236{
237 return (v & 0x1U) << 22U;
238}
239static inline u32 psec_falcon_irqdest_target_swgen1_f(u32 v)
240{
241 return (v & 0x1U) << 23U;
242}
243static inline u32 psec_falcon_irqdest_target_ext_f(u32 v)
244{
245 return (v & 0xffU) << 24U;
246}
247static inline u32 psec_falcon_curctx_r(void)
248{
249 return 0x00087050U;
250}
251static inline u32 psec_falcon_nxtctx_r(void)
252{
253 return 0x00087054U;
254}
255static inline u32 psec_falcon_mailbox0_r(void)
256{
257 return 0x00087040U;
258}
259static inline u32 psec_falcon_mailbox1_r(void)
260{
261 return 0x00087044U;
262}
263static inline u32 psec_falcon_itfen_r(void)
264{
265 return 0x00087048U;
266}
267static inline u32 psec_falcon_itfen_ctxen_enable_f(void)
268{
269 return 0x1U;
270}
271static inline u32 psec_falcon_idlestate_r(void)
272{
273 return 0x0008704cU;
274}
275static inline u32 psec_falcon_idlestate_falcon_busy_v(u32 r)
276{
277 return (r >> 0U) & 0x1U;
278}
279static inline u32 psec_falcon_idlestate_ext_busy_v(u32 r)
280{
281 return (r >> 1U) & 0x7fffU;
282}
283static inline u32 psec_falcon_os_r(void)
284{
285 return 0x00087080U;
286}
287static inline u32 psec_falcon_engctl_r(void)
288{
289 return 0x000870a4U;
290}
291static inline u32 psec_falcon_cpuctl_r(void)
292{
293 return 0x00087100U;
294}
295static inline u32 psec_falcon_cpuctl_startcpu_f(u32 v)
296{
297 return (v & 0x1U) << 1U;
298}
299static inline u32 psec_falcon_cpuctl_halt_intr_f(u32 v)
300{
301 return (v & 0x1U) << 4U;
302}
303static inline u32 psec_falcon_cpuctl_halt_intr_m(void)
304{
305 return 0x1U << 4U;
306}
307static inline u32 psec_falcon_cpuctl_halt_intr_v(u32 r)
308{
309 return (r >> 4U) & 0x1U;
310}
311static inline u32 psec_falcon_cpuctl_cpuctl_alias_en_f(u32 v)
312{
313 return (v & 0x1U) << 6U;
314}
315static inline u32 psec_falcon_cpuctl_cpuctl_alias_en_m(void)
316{
317 return 0x1U << 6U;
318}
319static inline u32 psec_falcon_cpuctl_cpuctl_alias_en_v(u32 r)
320{
321 return (r >> 6U) & 0x1U;
322}
323static inline u32 psec_falcon_cpuctl_alias_r(void)
324{
325 return 0x00087130U;
326}
327static inline u32 psec_falcon_cpuctl_alias_startcpu_f(u32 v)
328{
329 return (v & 0x1U) << 1U;
330}
331static inline u32 psec_falcon_imemc_r(u32 i)
332{
333 return 0x00087180U + i*16U;
334}
335static inline u32 psec_falcon_imemc_offs_f(u32 v)
336{
337 return (v & 0x3fU) << 2U;
338}
339static inline u32 psec_falcon_imemc_blk_f(u32 v)
340{
341 return (v & 0xffU) << 8U;
342}
343static inline u32 psec_falcon_imemc_aincw_f(u32 v)
344{
345 return (v & 0x1U) << 24U;
346}
347static inline u32 psec_falcon_imemd_r(u32 i)
348{
349 return 0x00087184U + i*16U;
350}
351static inline u32 psec_falcon_imemt_r(u32 i)
352{
353 return 0x00087188U + i*16U;
354}
355static inline u32 psec_falcon_sctl_r(void)
356{
357 return 0x00087240U;
358}
359static inline u32 psec_falcon_mmu_phys_sec_r(void)
360{
361 return 0x00100ce4U;
362}
363static inline u32 psec_falcon_bootvec_r(void)
364{
365 return 0x00087104U;
366}
367static inline u32 psec_falcon_bootvec_vec_f(u32 v)
368{
369 return (v & 0xffffffffU) << 0U;
370}
371static inline u32 psec_falcon_dmactl_r(void)
372{
373 return 0x0008710cU;
374}
375static inline u32 psec_falcon_dmactl_dmem_scrubbing_m(void)
376{
377 return 0x1U << 1U;
378}
379static inline u32 psec_falcon_dmactl_imem_scrubbing_m(void)
380{
381 return 0x1U << 2U;
382}
383static inline u32 psec_falcon_dmactl_require_ctx_f(u32 v)
384{
385 return (v & 0x1U) << 0U;
386}
387static inline u32 psec_falcon_hwcfg_r(void)
388{
389 return 0x00087108U;
390}
391static inline u32 psec_falcon_hwcfg_imem_size_v(u32 r)
392{
393 return (r >> 0U) & 0x1ffU;
394}
395static inline u32 psec_falcon_hwcfg_dmem_size_v(u32 r)
396{
397 return (r >> 9U) & 0x1ffU;
398}
399static inline u32 psec_falcon_dmatrfbase_r(void)
400{
401 return 0x00087110U;
402}
403static inline u32 psec_falcon_dmatrfbase1_r(void)
404{
405 return 0x00087128U;
406}
407static inline u32 psec_falcon_dmatrfmoffs_r(void)
408{
409 return 0x00087114U;
410}
411static inline u32 psec_falcon_dmatrfcmd_r(void)
412{
413 return 0x00087118U;
414}
415static inline u32 psec_falcon_dmatrfcmd_imem_f(u32 v)
416{
417 return (v & 0x1U) << 4U;
418}
419static inline u32 psec_falcon_dmatrfcmd_write_f(u32 v)
420{
421 return (v & 0x1U) << 5U;
422}
423static inline u32 psec_falcon_dmatrfcmd_size_f(u32 v)
424{
425 return (v & 0x7U) << 8U;
426}
427static inline u32 psec_falcon_dmatrfcmd_ctxdma_f(u32 v)
428{
429 return (v & 0x7U) << 12U;
430}
431static inline u32 psec_falcon_dmatrffboffs_r(void)
432{
433 return 0x0008711cU;
434}
435static inline u32 psec_falcon_exterraddr_r(void)
436{
437 return 0x00087168U;
438}
439static inline u32 psec_falcon_exterrstat_r(void)
440{
441 return 0x0008716cU;
442}
443static inline u32 psec_falcon_exterrstat_valid_m(void)
444{
445 return 0x1U << 31U;
446}
447static inline u32 psec_falcon_exterrstat_valid_v(u32 r)
448{
449 return (r >> 31U) & 0x1U;
450}
451static inline u32 psec_falcon_exterrstat_valid_true_v(void)
452{
453 return 0x00000001U;
454}
455static inline u32 psec_sec2_falcon_icd_cmd_r(void)
456{
457 return 0x00087200U;
458}
459static inline u32 psec_sec2_falcon_icd_cmd_opc_s(void)
460{
461 return 4U;
462}
463static inline u32 psec_sec2_falcon_icd_cmd_opc_f(u32 v)
464{
465 return (v & 0xfU) << 0U;
466}
467static inline u32 psec_sec2_falcon_icd_cmd_opc_m(void)
468{
469 return 0xfU << 0U;
470}
471static inline u32 psec_sec2_falcon_icd_cmd_opc_v(u32 r)
472{
473 return (r >> 0U) & 0xfU;
474}
475static inline u32 psec_sec2_falcon_icd_cmd_opc_rreg_f(void)
476{
477 return 0x8U;
478}
479static inline u32 psec_sec2_falcon_icd_cmd_opc_rstat_f(void)
480{
481 return 0xeU;
482}
483static inline u32 psec_sec2_falcon_icd_cmd_idx_f(u32 v)
484{
485 return (v & 0x1fU) << 8U;
486}
487static inline u32 psec_sec2_falcon_icd_rdata_r(void)
488{
489 return 0x0008720cU;
490}
491static inline u32 psec_falcon_dmemc_r(u32 i)
492{
493 return 0x000871c0U + i*8U;
494}
495static inline u32 psec_falcon_dmemc_offs_f(u32 v)
496{
497 return (v & 0x3fU) << 2U;
498}
499static inline u32 psec_falcon_dmemc_offs_m(void)
500{
501 return 0x3fU << 2U;
502}
503static inline u32 psec_falcon_dmemc_blk_f(u32 v)
504{
505 return (v & 0xffU) << 8U;
506}
507static inline u32 psec_falcon_dmemc_blk_m(void)
508{
509 return 0xffU << 8U;
510}
511static inline u32 psec_falcon_dmemc_aincw_f(u32 v)
512{
513 return (v & 0x1U) << 24U;
514}
515static inline u32 psec_falcon_dmemc_aincr_f(u32 v)
516{
517 return (v & 0x1U) << 25U;
518}
519static inline u32 psec_falcon_dmemd_r(u32 i)
520{
521 return 0x000871c4U + i*8U;
522}
523static inline u32 psec_falcon_debug1_r(void)
524{
525 return 0x00087090U;
526}
527static inline u32 psec_falcon_debug1_ctxsw_mode_s(void)
528{
529 return 1U;
530}
531static inline u32 psec_falcon_debug1_ctxsw_mode_f(u32 v)
532{
533 return (v & 0x1U) << 16U;
534}
535static inline u32 psec_falcon_debug1_ctxsw_mode_m(void)
536{
537 return 0x1U << 16U;
538}
539static inline u32 psec_falcon_debug1_ctxsw_mode_v(u32 r)
540{
541 return (r >> 16U) & 0x1U;
542}
543static inline u32 psec_falcon_debug1_ctxsw_mode_init_f(void)
544{
545 return 0x0U;
546}
547static inline u32 psec_fbif_transcfg_r(u32 i)
548{
549 return 0x00087600U + i*4U;
550}
551static inline u32 psec_fbif_transcfg_target_local_fb_f(void)
552{
553 return 0x0U;
554}
555static inline u32 psec_fbif_transcfg_target_coherent_sysmem_f(void)
556{
557 return 0x1U;
558}
559static inline u32 psec_fbif_transcfg_target_noncoherent_sysmem_f(void)
560{
561 return 0x2U;
562}
563static inline u32 psec_fbif_transcfg_mem_type_s(void)
564{
565 return 1U;
566}
567static inline u32 psec_fbif_transcfg_mem_type_f(u32 v)
568{
569 return (v & 0x1U) << 2U;
570}
571static inline u32 psec_fbif_transcfg_mem_type_m(void)
572{
573 return 0x1U << 2U;
574}
575static inline u32 psec_fbif_transcfg_mem_type_v(u32 r)
576{
577 return (r >> 2U) & 0x1U;
578}
579static inline u32 psec_fbif_transcfg_mem_type_virtual_f(void)
580{
581 return 0x0U;
582}
583static inline u32 psec_fbif_transcfg_mem_type_physical_f(void)
584{
585 return 0x4U;
586}
587static inline u32 psec_falcon_engine_r(void)
588{
589 return 0x000873c0U;
590}
591static inline u32 psec_falcon_engine_reset_true_f(void)
592{
593 return 0x1U;
594}
595static inline u32 psec_falcon_engine_reset_false_f(void)
596{
597 return 0x0U;
598}
599static inline u32 psec_fbif_ctl_r(void)
600{
601 return 0x00087624U;
602}
603static inline u32 psec_fbif_ctl_allow_phys_no_ctx_init_f(void)
604{
605 return 0x0U;
606}
607static inline u32 psec_fbif_ctl_allow_phys_no_ctx_disallow_f(void)
608{
609 return 0x0U;
610}
611static inline u32 psec_fbif_ctl_allow_phys_no_ctx_allow_f(void)
612{
613 return 0x80U;
614}
615#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_pwr_gp106.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_pwr_gp106.h
new file mode 100644
index 00000000..a9fbbd10
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_pwr_gp106.h
@@ -0,0 +1,847 @@
1/*
2 * Copyright (c) 2016-2017, 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_pwr_gp106_h_
57#define _hw_pwr_gp106_h_
58
59static inline u32 pwr_falcon_irqsset_r(void)
60{
61 return 0x0010a000U;
62}
63static inline u32 pwr_falcon_irqsset_swgen0_set_f(void)
64{
65 return 0x40U;
66}
67static inline u32 pwr_falcon_irqsclr_r(void)
68{
69 return 0x0010a004U;
70}
71static inline u32 pwr_falcon_irqstat_r(void)
72{
73 return 0x0010a008U;
74}
75static inline u32 pwr_falcon_irqstat_halt_true_f(void)
76{
77 return 0x10U;
78}
79static inline u32 pwr_falcon_irqstat_exterr_true_f(void)
80{
81 return 0x20U;
82}
83static inline u32 pwr_falcon_irqstat_swgen0_true_f(void)
84{
85 return 0x40U;
86}
87static inline u32 pwr_falcon_irqmode_r(void)
88{
89 return 0x0010a00cU;
90}
91static inline u32 pwr_falcon_irqmset_r(void)
92{
93 return 0x0010a010U;
94}
95static inline u32 pwr_falcon_irqmset_gptmr_f(u32 v)
96{
97 return (v & 0x1U) << 0U;
98}
99static inline u32 pwr_falcon_irqmset_wdtmr_f(u32 v)
100{
101 return (v & 0x1U) << 1U;
102}
103static inline u32 pwr_falcon_irqmset_mthd_f(u32 v)
104{
105 return (v & 0x1U) << 2U;
106}
107static inline u32 pwr_falcon_irqmset_ctxsw_f(u32 v)
108{
109 return (v & 0x1U) << 3U;
110}
111static inline u32 pwr_falcon_irqmset_halt_f(u32 v)
112{
113 return (v & 0x1U) << 4U;
114}
115static inline u32 pwr_falcon_irqmset_exterr_f(u32 v)
116{
117 return (v & 0x1U) << 5U;
118}
119static inline u32 pwr_falcon_irqmset_swgen0_f(u32 v)
120{
121 return (v & 0x1U) << 6U;
122}
123static inline u32 pwr_falcon_irqmset_swgen1_f(u32 v)
124{
125 return (v & 0x1U) << 7U;
126}
127static inline u32 pwr_falcon_irqmclr_r(void)
128{
129 return 0x0010a014U;
130}
131static inline u32 pwr_falcon_irqmclr_gptmr_f(u32 v)
132{
133 return (v & 0x1U) << 0U;
134}
135static inline u32 pwr_falcon_irqmclr_wdtmr_f(u32 v)
136{
137 return (v & 0x1U) << 1U;
138}
139static inline u32 pwr_falcon_irqmclr_mthd_f(u32 v)
140{
141 return (v & 0x1U) << 2U;
142}
143static inline u32 pwr_falcon_irqmclr_ctxsw_f(u32 v)
144{
145 return (v & 0x1U) << 3U;
146}
147static inline u32 pwr_falcon_irqmclr_halt_f(u32 v)
148{
149 return (v & 0x1U) << 4U;
150}
151static inline u32 pwr_falcon_irqmclr_exterr_f(u32 v)
152{
153 return (v & 0x1U) << 5U;
154}
155static inline u32 pwr_falcon_irqmclr_swgen0_f(u32 v)
156{
157 return (v & 0x1U) << 6U;
158}
159static inline u32 pwr_falcon_irqmclr_swgen1_f(u32 v)
160{
161 return (v & 0x1U) << 7U;
162}
163static inline u32 pwr_falcon_irqmclr_ext_f(u32 v)
164{
165 return (v & 0xffU) << 8U;
166}
167static inline u32 pwr_falcon_irqmask_r(void)
168{
169 return 0x0010a018U;
170}
171static inline u32 pwr_falcon_irqdest_r(void)
172{
173 return 0x0010a01cU;
174}
175static inline u32 pwr_falcon_irqdest_host_gptmr_f(u32 v)
176{
177 return (v & 0x1U) << 0U;
178}
179static inline u32 pwr_falcon_irqdest_host_wdtmr_f(u32 v)
180{
181 return (v & 0x1U) << 1U;
182}
183static inline u32 pwr_falcon_irqdest_host_mthd_f(u32 v)
184{
185 return (v & 0x1U) << 2U;
186}
187static inline u32 pwr_falcon_irqdest_host_ctxsw_f(u32 v)
188{
189 return (v & 0x1U) << 3U;
190}
191static inline u32 pwr_falcon_irqdest_host_halt_f(u32 v)
192{
193 return (v & 0x1U) << 4U;
194}
195static inline u32 pwr_falcon_irqdest_host_exterr_f(u32 v)
196{
197 return (v & 0x1U) << 5U;
198}
199static inline u32 pwr_falcon_irqdest_host_swgen0_f(u32 v)
200{
201 return (v & 0x1U) << 6U;
202}
203static inline u32 pwr_falcon_irqdest_host_swgen1_f(u32 v)
204{
205 return (v & 0x1U) << 7U;
206}
207static inline u32 pwr_falcon_irqdest_host_ext_f(u32 v)
208{
209 return (v & 0xffU) << 8U;
210}
211static inline u32 pwr_falcon_irqdest_target_gptmr_f(u32 v)
212{
213 return (v & 0x1U) << 16U;
214}
215static inline u32 pwr_falcon_irqdest_target_wdtmr_f(u32 v)
216{
217 return (v & 0x1U) << 17U;
218}
219static inline u32 pwr_falcon_irqdest_target_mthd_f(u32 v)
220{
221 return (v & 0x1U) << 18U;
222}
223static inline u32 pwr_falcon_irqdest_target_ctxsw_f(u32 v)
224{
225 return (v & 0x1U) << 19U;
226}
227static inline u32 pwr_falcon_irqdest_target_halt_f(u32 v)
228{
229 return (v & 0x1U) << 20U;
230}
231static inline u32 pwr_falcon_irqdest_target_exterr_f(u32 v)
232{
233 return (v & 0x1U) << 21U;
234}
235static inline u32 pwr_falcon_irqdest_target_swgen0_f(u32 v)
236{
237 return (v & 0x1U) << 22U;
238}
239static inline u32 pwr_falcon_irqdest_target_swgen1_f(u32 v)
240{
241 return (v & 0x1U) << 23U;
242}
243static inline u32 pwr_falcon_irqdest_target_ext_f(u32 v)
244{
245 return (v & 0xffU) << 24U;
246}
247static inline u32 pwr_falcon_curctx_r(void)
248{
249 return 0x0010a050U;
250}
251static inline u32 pwr_falcon_nxtctx_r(void)
252{
253 return 0x0010a054U;
254}
255static inline u32 pwr_falcon_mailbox0_r(void)
256{
257 return 0x0010a040U;
258}
259static inline u32 pwr_falcon_mailbox1_r(void)
260{
261 return 0x0010a044U;
262}
263static inline u32 pwr_falcon_itfen_r(void)
264{
265 return 0x0010a048U;
266}
267static inline u32 pwr_falcon_itfen_ctxen_enable_f(void)
268{
269 return 0x1U;
270}
271static inline u32 pwr_falcon_idlestate_r(void)
272{
273 return 0x0010a04cU;
274}
275static inline u32 pwr_falcon_idlestate_falcon_busy_v(u32 r)
276{
277 return (r >> 0U) & 0x1U;
278}
279static inline u32 pwr_falcon_idlestate_ext_busy_v(u32 r)
280{
281 return (r >> 1U) & 0x7fffU;
282}
283static inline u32 pwr_falcon_os_r(void)
284{
285 return 0x0010a080U;
286}
287static inline u32 pwr_falcon_engctl_r(void)
288{
289 return 0x0010a0a4U;
290}
291static inline u32 pwr_falcon_cpuctl_r(void)
292{
293 return 0x0010a100U;
294}
295static inline u32 pwr_falcon_cpuctl_startcpu_f(u32 v)
296{
297 return (v & 0x1U) << 1U;
298}
299static inline u32 pwr_falcon_cpuctl_halt_intr_f(u32 v)
300{
301 return (v & 0x1U) << 4U;
302}
303static inline u32 pwr_falcon_cpuctl_halt_intr_m(void)
304{
305 return 0x1U << 4U;
306}
307static inline u32 pwr_falcon_cpuctl_halt_intr_v(u32 r)
308{
309 return (r >> 4U) & 0x1U;
310}
311static inline u32 pwr_falcon_cpuctl_cpuctl_alias_en_f(u32 v)
312{
313 return (v & 0x1U) << 6U;
314}
315static inline u32 pwr_falcon_cpuctl_cpuctl_alias_en_m(void)
316{
317 return 0x1U << 6U;
318}
319static inline u32 pwr_falcon_cpuctl_cpuctl_alias_en_v(u32 r)
320{
321 return (r >> 6U) & 0x1U;
322}
323static inline u32 pwr_falcon_cpuctl_alias_r(void)
324{
325 return 0x0010a130U;
326}
327static inline u32 pwr_falcon_cpuctl_alias_startcpu_f(u32 v)
328{
329 return (v & 0x1U) << 1U;
330}
331static inline u32 pwr_pmu_scpctl_stat_r(void)
332{
333 return 0x0010ac08U;
334}
335static inline u32 pwr_pmu_scpctl_stat_debug_mode_f(u32 v)
336{
337 return (v & 0x1U) << 20U;
338}
339static inline u32 pwr_pmu_scpctl_stat_debug_mode_m(void)
340{
341 return 0x1U << 20U;
342}
343static inline u32 pwr_pmu_scpctl_stat_debug_mode_v(u32 r)
344{
345 return (r >> 20U) & 0x1U;
346}
347static inline u32 pwr_falcon_imemc_r(u32 i)
348{
349 return 0x0010a180U + i*16U;
350}
351static inline u32 pwr_falcon_imemc_offs_f(u32 v)
352{
353 return (v & 0x3fU) << 2U;
354}
355static inline u32 pwr_falcon_imemc_blk_f(u32 v)
356{
357 return (v & 0xffU) << 8U;
358}
359static inline u32 pwr_falcon_imemc_aincw_f(u32 v)
360{
361 return (v & 0x1U) << 24U;
362}
363static inline u32 pwr_falcon_imemd_r(u32 i)
364{
365 return 0x0010a184U + i*16U;
366}
367static inline u32 pwr_falcon_imemt_r(u32 i)
368{
369 return 0x0010a188U + i*16U;
370}
371static inline u32 pwr_falcon_sctl_r(void)
372{
373 return 0x0010a240U;
374}
375static inline u32 pwr_falcon_mmu_phys_sec_r(void)
376{
377 return 0x00100ce4U;
378}
379static inline u32 pwr_falcon_bootvec_r(void)
380{
381 return 0x0010a104U;
382}
383static inline u32 pwr_falcon_bootvec_vec_f(u32 v)
384{
385 return (v & 0xffffffffU) << 0U;
386}
387static inline u32 pwr_falcon_dmactl_r(void)
388{
389 return 0x0010a10cU;
390}
391static inline u32 pwr_falcon_dmactl_dmem_scrubbing_m(void)
392{
393 return 0x1U << 1U;
394}
395static inline u32 pwr_falcon_dmactl_imem_scrubbing_m(void)
396{
397 return 0x1U << 2U;
398}
399static inline u32 pwr_falcon_dmactl_require_ctx_f(u32 v)
400{
401 return (v & 0x1U) << 0U;
402}
403static inline u32 pwr_falcon_hwcfg_r(void)
404{
405 return 0x0010a108U;
406}
407static inline u32 pwr_falcon_hwcfg_imem_size_v(u32 r)
408{
409 return (r >> 0U) & 0x1ffU;
410}
411static inline u32 pwr_falcon_hwcfg_dmem_size_v(u32 r)
412{
413 return (r >> 9U) & 0x1ffU;
414}
415static inline u32 pwr_falcon_dmatrfbase_r(void)
416{
417 return 0x0010a110U;
418}
419static inline u32 pwr_falcon_dmatrfbase1_r(void)
420{
421 return 0x0010a128U;
422}
423static inline u32 pwr_falcon_dmatrfmoffs_r(void)
424{
425 return 0x0010a114U;
426}
427static inline u32 pwr_falcon_dmatrfcmd_r(void)
428{
429 return 0x0010a118U;
430}
431static inline u32 pwr_falcon_dmatrfcmd_imem_f(u32 v)
432{
433 return (v & 0x1U) << 4U;
434}
435static inline u32 pwr_falcon_dmatrfcmd_write_f(u32 v)
436{
437 return (v & 0x1U) << 5U;
438}
439static inline u32 pwr_falcon_dmatrfcmd_size_f(u32 v)
440{
441 return (v & 0x7U) << 8U;
442}
443static inline u32 pwr_falcon_dmatrfcmd_ctxdma_f(u32 v)
444{
445 return (v & 0x7U) << 12U;
446}
447static inline u32 pwr_falcon_dmatrffboffs_r(void)
448{
449 return 0x0010a11cU;
450}
451static inline u32 pwr_falcon_exterraddr_r(void)
452{
453 return 0x0010a168U;
454}
455static inline u32 pwr_falcon_exterrstat_r(void)
456{
457 return 0x0010a16cU;
458}
459static inline u32 pwr_falcon_exterrstat_valid_m(void)
460{
461 return 0x1U << 31U;
462}
463static inline u32 pwr_falcon_exterrstat_valid_v(u32 r)
464{
465 return (r >> 31U) & 0x1U;
466}
467static inline u32 pwr_falcon_exterrstat_valid_true_v(void)
468{
469 return 0x00000001U;
470}
471static inline u32 pwr_pmu_falcon_icd_cmd_r(void)
472{
473 return 0x0010a200U;
474}
475static inline u32 pwr_pmu_falcon_icd_cmd_opc_s(void)
476{
477 return 4U;
478}
479static inline u32 pwr_pmu_falcon_icd_cmd_opc_f(u32 v)
480{
481 return (v & 0xfU) << 0U;
482}
483static inline u32 pwr_pmu_falcon_icd_cmd_opc_m(void)
484{
485 return 0xfU << 0U;
486}
487static inline u32 pwr_pmu_falcon_icd_cmd_opc_v(u32 r)
488{
489 return (r >> 0U) & 0xfU;
490}
491static inline u32 pwr_pmu_falcon_icd_cmd_opc_rreg_f(void)
492{
493 return 0x8U;
494}
495static inline u32 pwr_pmu_falcon_icd_cmd_opc_rstat_f(void)
496{
497 return 0xeU;
498}
499static inline u32 pwr_pmu_falcon_icd_cmd_idx_f(u32 v)
500{
501 return (v & 0x1fU) << 8U;
502}
503static inline u32 pwr_pmu_falcon_icd_rdata_r(void)
504{
505 return 0x0010a20cU;
506}
507static inline u32 pwr_falcon_dmemc_r(u32 i)
508{
509 return 0x0010a1c0U + i*8U;
510}
511static inline u32 pwr_falcon_dmemc_offs_f(u32 v)
512{
513 return (v & 0x3fU) << 2U;
514}
515static inline u32 pwr_falcon_dmemc_offs_m(void)
516{
517 return 0x3fU << 2U;
518}
519static inline u32 pwr_falcon_dmemc_blk_f(u32 v)
520{
521 return (v & 0xffU) << 8U;
522}
523static inline u32 pwr_falcon_dmemc_blk_m(void)
524{
525 return 0xffU << 8U;
526}
527static inline u32 pwr_falcon_dmemc_aincw_f(u32 v)
528{
529 return (v & 0x1U) << 24U;
530}
531static inline u32 pwr_falcon_dmemc_aincr_f(u32 v)
532{
533 return (v & 0x1U) << 25U;
534}
535static inline u32 pwr_falcon_dmemd_r(u32 i)
536{
537 return 0x0010a1c4U + i*8U;
538}
539static inline u32 pwr_pmu_new_instblk_r(void)
540{
541 return 0x0010a480U;
542}
543static inline u32 pwr_pmu_new_instblk_ptr_f(u32 v)
544{
545 return (v & 0xfffffffU) << 0U;
546}
547static inline u32 pwr_pmu_new_instblk_target_fb_f(void)
548{
549 return 0x0U;
550}
551static inline u32 pwr_pmu_new_instblk_target_sys_coh_f(void)
552{
553 return 0x20000000U;
554}
555static inline u32 pwr_pmu_new_instblk_target_sys_ncoh_f(void)
556{
557 return 0x30000000U;
558}
559static inline u32 pwr_pmu_new_instblk_valid_f(u32 v)
560{
561 return (v & 0x1U) << 30U;
562}
563static inline u32 pwr_pmu_mutex_id_r(void)
564{
565 return 0x0010a488U;
566}
567static inline u32 pwr_pmu_mutex_id_value_v(u32 r)
568{
569 return (r >> 0U) & 0xffU;
570}
571static inline u32 pwr_pmu_mutex_id_value_init_v(void)
572{
573 return 0x00000000U;
574}
575static inline u32 pwr_pmu_mutex_id_value_not_avail_v(void)
576{
577 return 0x000000ffU;
578}
579static inline u32 pwr_pmu_mutex_id_release_r(void)
580{
581 return 0x0010a48cU;
582}
583static inline u32 pwr_pmu_mutex_id_release_value_f(u32 v)
584{
585 return (v & 0xffU) << 0U;
586}
587static inline u32 pwr_pmu_mutex_id_release_value_m(void)
588{
589 return 0xffU << 0U;
590}
591static inline u32 pwr_pmu_mutex_id_release_value_init_v(void)
592{
593 return 0x00000000U;
594}
595static inline u32 pwr_pmu_mutex_id_release_value_init_f(void)
596{
597 return 0x0U;
598}
599static inline u32 pwr_pmu_mutex_r(u32 i)
600{
601 return 0x0010a580U + i*4U;
602}
603static inline u32 pwr_pmu_mutex__size_1_v(void)
604{
605 return 0x00000010U;
606}
607static inline u32 pwr_pmu_mutex_value_f(u32 v)
608{
609 return (v & 0xffU) << 0U;
610}
611static inline u32 pwr_pmu_mutex_value_v(u32 r)
612{
613 return (r >> 0U) & 0xffU;
614}
615static inline u32 pwr_pmu_mutex_value_initial_lock_f(void)
616{
617 return 0x0U;
618}
619static inline u32 pwr_pmu_queue_head_r(u32 i)
620{
621 return 0x0010a4a0U + i*4U;
622}
623static inline u32 pwr_pmu_queue_head__size_1_v(void)
624{
625 return 0x00000004U;
626}
627static inline u32 pwr_pmu_queue_head_address_f(u32 v)
628{
629 return (v & 0xffffffffU) << 0U;
630}
631static inline u32 pwr_pmu_queue_head_address_v(u32 r)
632{
633 return (r >> 0U) & 0xffffffffU;
634}
635static inline u32 pwr_pmu_queue_tail_r(u32 i)
636{
637 return 0x0010a4b0U + i*4U;
638}
639static inline u32 pwr_pmu_queue_tail__size_1_v(void)
640{
641 return 0x00000004U;
642}
643static inline u32 pwr_pmu_queue_tail_address_f(u32 v)
644{
645 return (v & 0xffffffffU) << 0U;
646}
647static inline u32 pwr_pmu_queue_tail_address_v(u32 r)
648{
649 return (r >> 0U) & 0xffffffffU;
650}
651static inline u32 pwr_pmu_msgq_head_r(void)
652{
653 return 0x0010a4c8U;
654}
655static inline u32 pwr_pmu_msgq_head_val_f(u32 v)
656{
657 return (v & 0xffffffffU) << 0U;
658}
659static inline u32 pwr_pmu_msgq_head_val_v(u32 r)
660{
661 return (r >> 0U) & 0xffffffffU;
662}
663static inline u32 pwr_pmu_msgq_tail_r(void)
664{
665 return 0x0010a4ccU;
666}
667static inline u32 pwr_pmu_msgq_tail_val_f(u32 v)
668{
669 return (v & 0xffffffffU) << 0U;
670}
671static inline u32 pwr_pmu_msgq_tail_val_v(u32 r)
672{
673 return (r >> 0U) & 0xffffffffU;
674}
675static inline u32 pwr_pmu_idle_mask_r(u32 i)
676{
677 return 0x0010a504U + i*16U;
678}
679static inline u32 pwr_pmu_idle_mask_gr_enabled_f(void)
680{
681 return 0x1U;
682}
683static inline u32 pwr_pmu_idle_mask_ce_2_enabled_f(void)
684{
685 return 0x200000U;
686}
687static inline u32 pwr_pmu_idle_count_r(u32 i)
688{
689 return 0x0010a508U + i*16U;
690}
691static inline u32 pwr_pmu_idle_count_value_f(u32 v)
692{
693 return (v & 0x7fffffffU) << 0U;
694}
695static inline u32 pwr_pmu_idle_count_value_v(u32 r)
696{
697 return (r >> 0U) & 0x7fffffffU;
698}
699static inline u32 pwr_pmu_idle_count_reset_f(u32 v)
700{
701 return (v & 0x1U) << 31U;
702}
703static inline u32 pwr_pmu_idle_ctrl_r(u32 i)
704{
705 return 0x0010a50cU + i*16U;
706}
707static inline u32 pwr_pmu_idle_ctrl_value_m(void)
708{
709 return 0x3U << 0U;
710}
711static inline u32 pwr_pmu_idle_ctrl_value_busy_f(void)
712{
713 return 0x2U;
714}
715static inline u32 pwr_pmu_idle_ctrl_value_always_f(void)
716{
717 return 0x3U;
718}
719static inline u32 pwr_pmu_idle_ctrl_filter_m(void)
720{
721 return 0x1U << 2U;
722}
723static inline u32 pwr_pmu_idle_ctrl_filter_disabled_f(void)
724{
725 return 0x0U;
726}
727static inline u32 pwr_pmu_idle_mask_supp_r(u32 i)
728{
729 return 0x0010a9f0U + i*8U;
730}
731static inline u32 pwr_pmu_idle_mask_1_supp_r(u32 i)
732{
733 return 0x0010a9f4U + i*8U;
734}
735static inline u32 pwr_pmu_idle_ctrl_supp_r(u32 i)
736{
737 return 0x0010aa30U + i*8U;
738}
739static inline u32 pwr_pmu_debug_r(u32 i)
740{
741 return 0x0010a5c0U + i*4U;
742}
743static inline u32 pwr_pmu_debug__size_1_v(void)
744{
745 return 0x00000004U;
746}
747static inline u32 pwr_pmu_mailbox_r(u32 i)
748{
749 return 0x0010a450U + i*4U;
750}
751static inline u32 pwr_pmu_mailbox__size_1_v(void)
752{
753 return 0x0000000cU;
754}
755static inline u32 pwr_pmu_bar0_addr_r(void)
756{
757 return 0x0010a7a0U;
758}
759static inline u32 pwr_pmu_bar0_data_r(void)
760{
761 return 0x0010a7a4U;
762}
763static inline u32 pwr_pmu_bar0_ctl_r(void)
764{
765 return 0x0010a7acU;
766}
767static inline u32 pwr_pmu_bar0_timeout_r(void)
768{
769 return 0x0010a7a8U;
770}
771static inline u32 pwr_pmu_bar0_fecs_error_r(void)
772{
773 return 0x0010a988U;
774}
775static inline u32 pwr_pmu_bar0_error_status_r(void)
776{
777 return 0x0010a7b0U;
778}
779static inline u32 pwr_pmu_pg_idlefilth_r(u32 i)
780{
781 return 0x0010a6c0U + i*4U;
782}
783static inline u32 pwr_pmu_pg_ppuidlefilth_r(u32 i)
784{
785 return 0x0010a6e8U + i*4U;
786}
787static inline u32 pwr_pmu_pg_idle_cnt_r(u32 i)
788{
789 return 0x0010a710U + i*4U;
790}
791static inline u32 pwr_pmu_pg_intren_r(u32 i)
792{
793 return 0x0010a760U + i*4U;
794}
795static inline u32 pwr_fbif_transcfg_r(u32 i)
796{
797 return 0x0010ae00U + i*4U;
798}
799static inline u32 pwr_fbif_transcfg_target_local_fb_f(void)
800{
801 return 0x0U;
802}
803static inline u32 pwr_fbif_transcfg_target_coherent_sysmem_f(void)
804{
805 return 0x1U;
806}
807static inline u32 pwr_fbif_transcfg_target_noncoherent_sysmem_f(void)
808{
809 return 0x2U;
810}
811static inline u32 pwr_fbif_transcfg_mem_type_s(void)
812{
813 return 1U;
814}
815static inline u32 pwr_fbif_transcfg_mem_type_f(u32 v)
816{
817 return (v & 0x1U) << 2U;
818}
819static inline u32 pwr_fbif_transcfg_mem_type_m(void)
820{
821 return 0x1U << 2U;
822}
823static inline u32 pwr_fbif_transcfg_mem_type_v(u32 r)
824{
825 return (r >> 2U) & 0x1U;
826}
827static inline u32 pwr_fbif_transcfg_mem_type_virtual_f(void)
828{
829 return 0x0U;
830}
831static inline u32 pwr_fbif_transcfg_mem_type_physical_f(void)
832{
833 return 0x4U;
834}
835static inline u32 pwr_falcon_engine_r(void)
836{
837 return 0x0010a3c0U;
838}
839static inline u32 pwr_falcon_engine_reset_true_f(void)
840{
841 return 0x1U;
842}
843static inline u32 pwr_falcon_engine_reset_false_f(void)
844{
845 return 0x0U;
846}
847#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_ram_gp106.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_ram_gp106.h
new file mode 100644
index 00000000..3ae3f3bb
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_ram_gp106.h
@@ -0,0 +1,487 @@
1/*
2 * Copyright (c) 2016-2017, 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_ram_gp106_h_
57#define _hw_ram_gp106_h_
58
59static inline u32 ram_in_ramfc_s(void)
60{
61 return 4096U;
62}
63static inline u32 ram_in_ramfc_w(void)
64{
65 return 0U;
66}
67static inline u32 ram_in_page_dir_base_target_f(u32 v)
68{
69 return (v & 0x3U) << 0U;
70}
71static inline u32 ram_in_page_dir_base_target_w(void)
72{
73 return 128U;
74}
75static inline u32 ram_in_page_dir_base_target_vid_mem_f(void)
76{
77 return 0x0U;
78}
79static inline u32 ram_in_page_dir_base_target_sys_mem_coh_f(void)
80{
81 return 0x2U;
82}
83static inline u32 ram_in_page_dir_base_target_sys_mem_ncoh_f(void)
84{
85 return 0x3U;
86}
87static inline u32 ram_in_page_dir_base_vol_w(void)
88{
89 return 128U;
90}
91static inline u32 ram_in_page_dir_base_vol_true_f(void)
92{
93 return 0x4U;
94}
95static inline u32 ram_in_page_dir_base_fault_replay_tex_f(u32 v)
96{
97 return (v & 0x1U) << 4U;
98}
99static inline u32 ram_in_page_dir_base_fault_replay_tex_m(void)
100{
101 return 0x1U << 4U;
102}
103static inline u32 ram_in_page_dir_base_fault_replay_tex_w(void)
104{
105 return 128U;
106}
107static inline u32 ram_in_page_dir_base_fault_replay_tex_true_f(void)
108{
109 return 0x10U;
110}
111static inline u32 ram_in_page_dir_base_fault_replay_gcc_f(u32 v)
112{
113 return (v & 0x1U) << 5U;
114}
115static inline u32 ram_in_page_dir_base_fault_replay_gcc_m(void)
116{
117 return 0x1U << 5U;
118}
119static inline u32 ram_in_page_dir_base_fault_replay_gcc_w(void)
120{
121 return 128U;
122}
123static inline u32 ram_in_page_dir_base_fault_replay_gcc_true_f(void)
124{
125 return 0x20U;
126}
127static inline u32 ram_in_big_page_size_f(u32 v)
128{
129 return (v & 0x1U) << 11U;
130}
131static inline u32 ram_in_big_page_size_m(void)
132{
133 return 0x1U << 11U;
134}
135static inline u32 ram_in_big_page_size_w(void)
136{
137 return 128U;
138}
139static inline u32 ram_in_big_page_size_128kb_f(void)
140{
141 return 0x0U;
142}
143static inline u32 ram_in_big_page_size_64kb_f(void)
144{
145 return 0x800U;
146}
147static inline u32 ram_in_page_dir_base_lo_f(u32 v)
148{
149 return (v & 0xfffffU) << 12U;
150}
151static inline u32 ram_in_page_dir_base_lo_w(void)
152{
153 return 128U;
154}
155static inline u32 ram_in_page_dir_base_hi_f(u32 v)
156{
157 return (v & 0xffffffffU) << 0U;
158}
159static inline u32 ram_in_page_dir_base_hi_w(void)
160{
161 return 129U;
162}
163static inline u32 ram_in_adr_limit_lo_f(u32 v)
164{
165 return (v & 0xfffffU) << 12U;
166}
167static inline u32 ram_in_adr_limit_lo_w(void)
168{
169 return 130U;
170}
171static inline u32 ram_in_adr_limit_hi_f(u32 v)
172{
173 return (v & 0xffffffffU) << 0U;
174}
175static inline u32 ram_in_adr_limit_hi_w(void)
176{
177 return 131U;
178}
179static inline u32 ram_in_engine_cs_w(void)
180{
181 return 132U;
182}
183static inline u32 ram_in_engine_cs_wfi_v(void)
184{
185 return 0x00000000U;
186}
187static inline u32 ram_in_engine_cs_wfi_f(void)
188{
189 return 0x0U;
190}
191static inline u32 ram_in_engine_cs_fg_v(void)
192{
193 return 0x00000001U;
194}
195static inline u32 ram_in_engine_cs_fg_f(void)
196{
197 return 0x8U;
198}
199static inline u32 ram_in_gr_cs_w(void)
200{
201 return 132U;
202}
203static inline u32 ram_in_gr_cs_wfi_f(void)
204{
205 return 0x0U;
206}
207static inline u32 ram_in_gr_wfi_target_w(void)
208{
209 return 132U;
210}
211static inline u32 ram_in_gr_wfi_mode_w(void)
212{
213 return 132U;
214}
215static inline u32 ram_in_gr_wfi_mode_physical_v(void)
216{
217 return 0x00000000U;
218}
219static inline u32 ram_in_gr_wfi_mode_physical_f(void)
220{
221 return 0x0U;
222}
223static inline u32 ram_in_gr_wfi_mode_virtual_v(void)
224{
225 return 0x00000001U;
226}
227static inline u32 ram_in_gr_wfi_mode_virtual_f(void)
228{
229 return 0x4U;
230}
231static inline u32 ram_in_gr_wfi_ptr_lo_f(u32 v)
232{
233 return (v & 0xfffffU) << 12U;
234}
235static inline u32 ram_in_gr_wfi_ptr_lo_w(void)
236{
237 return 132U;
238}
239static inline u32 ram_in_gr_wfi_ptr_hi_f(u32 v)
240{
241 return (v & 0xffU) << 0U;
242}
243static inline u32 ram_in_gr_wfi_ptr_hi_w(void)
244{
245 return 133U;
246}
247static inline u32 ram_in_base_shift_v(void)
248{
249 return 0x0000000cU;
250}
251static inline u32 ram_in_alloc_size_v(void)
252{
253 return 0x00001000U;
254}
255static inline u32 ram_fc_size_val_v(void)
256{
257 return 0x00000200U;
258}
259static inline u32 ram_fc_gp_put_w(void)
260{
261 return 0U;
262}
263static inline u32 ram_fc_userd_w(void)
264{
265 return 2U;
266}
267static inline u32 ram_fc_userd_hi_w(void)
268{
269 return 3U;
270}
271static inline u32 ram_fc_signature_w(void)
272{
273 return 4U;
274}
275static inline u32 ram_fc_gp_get_w(void)
276{
277 return 5U;
278}
279static inline u32 ram_fc_pb_get_w(void)
280{
281 return 6U;
282}
283static inline u32 ram_fc_pb_get_hi_w(void)
284{
285 return 7U;
286}
287static inline u32 ram_fc_pb_top_level_get_w(void)
288{
289 return 8U;
290}
291static inline u32 ram_fc_pb_top_level_get_hi_w(void)
292{
293 return 9U;
294}
295static inline u32 ram_fc_acquire_w(void)
296{
297 return 12U;
298}
299static inline u32 ram_fc_semaphorea_w(void)
300{
301 return 14U;
302}
303static inline u32 ram_fc_semaphoreb_w(void)
304{
305 return 15U;
306}
307static inline u32 ram_fc_semaphorec_w(void)
308{
309 return 16U;
310}
311static inline u32 ram_fc_semaphored_w(void)
312{
313 return 17U;
314}
315static inline u32 ram_fc_gp_base_w(void)
316{
317 return 18U;
318}
319static inline u32 ram_fc_gp_base_hi_w(void)
320{
321 return 19U;
322}
323static inline u32 ram_fc_gp_fetch_w(void)
324{
325 return 20U;
326}
327static inline u32 ram_fc_pb_fetch_w(void)
328{
329 return 21U;
330}
331static inline u32 ram_fc_pb_fetch_hi_w(void)
332{
333 return 22U;
334}
335static inline u32 ram_fc_pb_put_w(void)
336{
337 return 23U;
338}
339static inline u32 ram_fc_pb_put_hi_w(void)
340{
341 return 24U;
342}
343static inline u32 ram_fc_pb_header_w(void)
344{
345 return 33U;
346}
347static inline u32 ram_fc_pb_count_w(void)
348{
349 return 34U;
350}
351static inline u32 ram_fc_subdevice_w(void)
352{
353 return 37U;
354}
355static inline u32 ram_fc_formats_w(void)
356{
357 return 39U;
358}
359static inline u32 ram_fc_target_w(void)
360{
361 return 43U;
362}
363static inline u32 ram_fc_hce_ctrl_w(void)
364{
365 return 57U;
366}
367static inline u32 ram_fc_chid_w(void)
368{
369 return 58U;
370}
371static inline u32 ram_fc_chid_id_f(u32 v)
372{
373 return (v & 0xfffU) << 0U;
374}
375static inline u32 ram_fc_chid_id_w(void)
376{
377 return 0U;
378}
379static inline u32 ram_fc_config_w(void)
380{
381 return 61U;
382}
383static inline u32 ram_fc_runlist_timeslice_w(void)
384{
385 return 62U;
386}
387static inline u32 ram_userd_base_shift_v(void)
388{
389 return 0x00000009U;
390}
391static inline u32 ram_userd_chan_size_v(void)
392{
393 return 0x00000200U;
394}
395static inline u32 ram_userd_put_w(void)
396{
397 return 16U;
398}
399static inline u32 ram_userd_get_w(void)
400{
401 return 17U;
402}
403static inline u32 ram_userd_ref_w(void)
404{
405 return 18U;
406}
407static inline u32 ram_userd_put_hi_w(void)
408{
409 return 19U;
410}
411static inline u32 ram_userd_ref_threshold_w(void)
412{
413 return 20U;
414}
415static inline u32 ram_userd_top_level_get_w(void)
416{
417 return 22U;
418}
419static inline u32 ram_userd_top_level_get_hi_w(void)
420{
421 return 23U;
422}
423static inline u32 ram_userd_get_hi_w(void)
424{
425 return 24U;
426}
427static inline u32 ram_userd_gp_get_w(void)
428{
429 return 34U;
430}
431static inline u32 ram_userd_gp_put_w(void)
432{
433 return 35U;
434}
435static inline u32 ram_userd_gp_top_level_get_w(void)
436{
437 return 22U;
438}
439static inline u32 ram_userd_gp_top_level_get_hi_w(void)
440{
441 return 23U;
442}
443static inline u32 ram_rl_entry_size_v(void)
444{
445 return 0x00000008U;
446}
447static inline u32 ram_rl_entry_chid_f(u32 v)
448{
449 return (v & 0xfffU) << 0U;
450}
451static inline u32 ram_rl_entry_id_f(u32 v)
452{
453 return (v & 0xfffU) << 0U;
454}
455static inline u32 ram_rl_entry_type_f(u32 v)
456{
457 return (v & 0x1U) << 13U;
458}
459static inline u32 ram_rl_entry_type_chid_f(void)
460{
461 return 0x0U;
462}
463static inline u32 ram_rl_entry_type_tsg_f(void)
464{
465 return 0x2000U;
466}
467static inline u32 ram_rl_entry_timeslice_scale_f(u32 v)
468{
469 return (v & 0xfU) << 14U;
470}
471static inline u32 ram_rl_entry_timeslice_scale_3_f(void)
472{
473 return 0xc000U;
474}
475static inline u32 ram_rl_entry_timeslice_timeout_f(u32 v)
476{
477 return (v & 0xffU) << 18U;
478}
479static inline u32 ram_rl_entry_timeslice_timeout_128_f(void)
480{
481 return 0x2000000U;
482}
483static inline u32 ram_rl_entry_tsg_length_f(u32 v)
484{
485 return (v & 0x3fU) << 26U;
486}
487#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_therm_gp106.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_therm_gp106.h
new file mode 100644
index 00000000..ee580326
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_therm_gp106.h
@@ -0,0 +1,183 @@
1/*
2 * Copyright (c) 2016-2017, 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_therm_gp106_h_
57#define _hw_therm_gp106_h_
58
59static inline u32 therm_temp_sensor_tsense_r(void)
60{
61 return 0x00020460U;
62}
63static inline u32 therm_temp_sensor_tsense_fixed_point_f(u32 v)
64{
65 return (v & 0x3fffU) << 3U;
66}
67static inline u32 therm_temp_sensor_tsense_fixed_point_m(void)
68{
69 return 0x3fffU << 3U;
70}
71static inline u32 therm_temp_sensor_tsense_fixed_point_v(u32 r)
72{
73 return (r >> 3U) & 0x3fffU;
74}
75static inline u32 therm_temp_sensor_tsense_fixed_point_min_v(void)
76{
77 return 0x00003b00U;
78}
79static inline u32 therm_temp_sensor_tsense_fixed_point_max_v(void)
80{
81 return 0x000010e0U;
82}
83static inline u32 therm_temp_sensor_tsense_state_f(u32 v)
84{
85 return (v & 0x3U) << 29U;
86}
87static inline u32 therm_temp_sensor_tsense_state_m(void)
88{
89 return 0x3U << 29U;
90}
91static inline u32 therm_temp_sensor_tsense_state_v(u32 r)
92{
93 return (r >> 29U) & 0x3U;
94}
95static inline u32 therm_temp_sensor_tsense_state_valid_v(void)
96{
97 return 0x00000001U;
98}
99static inline u32 therm_temp_sensor_tsense_state_shadow_v(void)
100{
101 return 0x00000002U;
102}
103static inline u32 therm_gate_ctrl_r(u32 i)
104{
105 return 0x00020200U + i*4U;
106}
107static inline u32 therm_gate_ctrl_eng_clk_m(void)
108{
109 return 0x3U << 0U;
110}
111static inline u32 therm_gate_ctrl_eng_clk_run_f(void)
112{
113 return 0x0U;
114}
115static inline u32 therm_gate_ctrl_eng_clk_auto_f(void)
116{
117 return 0x1U;
118}
119static inline u32 therm_gate_ctrl_eng_clk_stop_f(void)
120{
121 return 0x2U;
122}
123static inline u32 therm_gate_ctrl_blk_clk_m(void)
124{
125 return 0x3U << 2U;
126}
127static inline u32 therm_gate_ctrl_blk_clk_run_f(void)
128{
129 return 0x0U;
130}
131static inline u32 therm_gate_ctrl_blk_clk_auto_f(void)
132{
133 return 0x4U;
134}
135static inline u32 therm_gate_ctrl_eng_idle_filt_exp_f(u32 v)
136{
137 return (v & 0x1fU) << 8U;
138}
139static inline u32 therm_gate_ctrl_eng_idle_filt_exp_m(void)
140{
141 return 0x1fU << 8U;
142}
143static inline u32 therm_gate_ctrl_eng_idle_filt_mant_f(u32 v)
144{
145 return (v & 0x7U) << 13U;
146}
147static inline u32 therm_gate_ctrl_eng_idle_filt_mant_m(void)
148{
149 return 0x7U << 13U;
150}
151static inline u32 therm_gate_ctrl_eng_delay_before_f(u32 v)
152{
153 return (v & 0xfU) << 16U;
154}
155static inline u32 therm_gate_ctrl_eng_delay_before_m(void)
156{
157 return 0xfU << 16U;
158}
159static inline u32 therm_gate_ctrl_eng_delay_after_f(u32 v)
160{
161 return (v & 0xfU) << 20U;
162}
163static inline u32 therm_gate_ctrl_eng_delay_after_m(void)
164{
165 return 0xfU << 20U;
166}
167static inline u32 therm_fecs_idle_filter_r(void)
168{
169 return 0x00020288U;
170}
171static inline u32 therm_fecs_idle_filter_value_m(void)
172{
173 return 0xffffffffU << 0U;
174}
175static inline u32 therm_hubmmu_idle_filter_r(void)
176{
177 return 0x0002028cU;
178}
179static inline u32 therm_hubmmu_idle_filter_value_m(void)
180{
181 return 0xffffffffU << 0U;
182}
183#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_timer_gp106.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_timer_gp106.h
new file mode 100644
index 00000000..7fd722f9
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_timer_gp106.h
@@ -0,0 +1,115 @@
1/*
2 * Copyright (c) 2016-2017, 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_timer_gp106_h_
57#define _hw_timer_gp106_h_
58
59static inline u32 timer_pri_timeout_r(void)
60{
61 return 0x00009080U;
62}
63static inline u32 timer_pri_timeout_period_f(u32 v)
64{
65 return (v & 0xffffffU) << 0U;
66}
67static inline u32 timer_pri_timeout_period_m(void)
68{
69 return 0xffffffU << 0U;
70}
71static inline u32 timer_pri_timeout_period_v(u32 r)
72{
73 return (r >> 0U) & 0xffffffU;
74}
75static inline u32 timer_pri_timeout_en_f(u32 v)
76{
77 return (v & 0x1U) << 31U;
78}
79static inline u32 timer_pri_timeout_en_m(void)
80{
81 return 0x1U << 31U;
82}
83static inline u32 timer_pri_timeout_en_v(u32 r)
84{
85 return (r >> 31U) & 0x1U;
86}
87static inline u32 timer_pri_timeout_en_en_enabled_f(void)
88{
89 return 0x80000000U;
90}
91static inline u32 timer_pri_timeout_en_en_disabled_f(void)
92{
93 return 0x0U;
94}
95static inline u32 timer_pri_timeout_save_0_r(void)
96{
97 return 0x00009084U;
98}
99static inline u32 timer_pri_timeout_save_1_r(void)
100{
101 return 0x00009088U;
102}
103static inline u32 timer_pri_timeout_fecs_errcode_r(void)
104{
105 return 0x0000908cU;
106}
107static inline u32 timer_time_0_r(void)
108{
109 return 0x00009400U;
110}
111static inline u32 timer_time_1_r(void)
112{
113 return 0x00009410U;
114}
115#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_top_gp106.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_top_gp106.h
new file mode 100644
index 00000000..749f66ed
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_top_gp106.h
@@ -0,0 +1,255 @@
1/*
2 * Copyright (c) 2016-2017, 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_top_gp106_h_
57#define _hw_top_gp106_h_
58
59static inline u32 top_num_gpcs_r(void)
60{
61 return 0x00022430U;
62}
63static inline u32 top_num_gpcs_value_v(u32 r)
64{
65 return (r >> 0U) & 0x1fU;
66}
67static inline u32 top_tpc_per_gpc_r(void)
68{
69 return 0x00022434U;
70}
71static inline u32 top_tpc_per_gpc_value_v(u32 r)
72{
73 return (r >> 0U) & 0x1fU;
74}
75static inline u32 top_num_fbps_r(void)
76{
77 return 0x00022438U;
78}
79static inline u32 top_num_fbps_value_v(u32 r)
80{
81 return (r >> 0U) & 0x1fU;
82}
83static inline u32 top_num_fbpas_r(void)
84{
85 return 0x0002243cU;
86}
87static inline u32 top_num_fbpas_value_v(u32 r)
88{
89 return (r >> 0U) & 0x1fU;
90}
91static inline u32 top_ltc_per_fbp_r(void)
92{
93 return 0x00022450U;
94}
95static inline u32 top_ltc_per_fbp_value_v(u32 r)
96{
97 return (r >> 0U) & 0x1fU;
98}
99static inline u32 top_slices_per_ltc_r(void)
100{
101 return 0x0002245cU;
102}
103static inline u32 top_slices_per_ltc_value_v(u32 r)
104{
105 return (r >> 0U) & 0x1fU;
106}
107static inline u32 top_num_ltcs_r(void)
108{
109 return 0x00022454U;
110}
111static inline u32 top_device_info_r(u32 i)
112{
113 return 0x00022700U + i*4U;
114}
115static inline u32 top_device_info__size_1_v(void)
116{
117 return 0x00000040U;
118}
119static inline u32 top_device_info_chain_v(u32 r)
120{
121 return (r >> 31U) & 0x1U;
122}
123static inline u32 top_device_info_chain_enable_v(void)
124{
125 return 0x00000001U;
126}
127static inline u32 top_device_info_engine_enum_v(u32 r)
128{
129 return (r >> 26U) & 0xfU;
130}
131static inline u32 top_device_info_runlist_enum_v(u32 r)
132{
133 return (r >> 21U) & 0xfU;
134}
135static inline u32 top_device_info_intr_enum_v(u32 r)
136{
137 return (r >> 15U) & 0x1fU;
138}
139static inline u32 top_device_info_reset_enum_v(u32 r)
140{
141 return (r >> 9U) & 0x1fU;
142}
143static inline u32 top_device_info_type_enum_v(u32 r)
144{
145 return (r >> 2U) & 0x1fffffffU;
146}
147static inline u32 top_device_info_type_enum_graphics_v(void)
148{
149 return 0x00000000U;
150}
151static inline u32 top_device_info_type_enum_graphics_f(void)
152{
153 return 0x0U;
154}
155static inline u32 top_device_info_type_enum_copy0_v(void)
156{
157 return 0x00000001U;
158}
159static inline u32 top_device_info_type_enum_copy0_f(void)
160{
161 return 0x4U;
162}
163static inline u32 top_device_info_type_enum_copy2_v(void)
164{
165 return 0x00000003U;
166}
167static inline u32 top_device_info_type_enum_copy2_f(void)
168{
169 return 0xcU;
170}
171static inline u32 top_device_info_type_enum_lce_v(void)
172{
173 return 0x00000013U;
174}
175static inline u32 top_device_info_type_enum_lce_f(void)
176{
177 return 0x4cU;
178}
179static inline u32 top_device_info_engine_v(u32 r)
180{
181 return (r >> 5U) & 0x1U;
182}
183static inline u32 top_device_info_runlist_v(u32 r)
184{
185 return (r >> 4U) & 0x1U;
186}
187static inline u32 top_device_info_intr_v(u32 r)
188{
189 return (r >> 3U) & 0x1U;
190}
191static inline u32 top_device_info_reset_v(u32 r)
192{
193 return (r >> 2U) & 0x1U;
194}
195static inline u32 top_device_info_entry_v(u32 r)
196{
197 return (r >> 0U) & 0x3U;
198}
199static inline u32 top_device_info_entry_not_valid_v(void)
200{
201 return 0x00000000U;
202}
203static inline u32 top_device_info_entry_enum_v(void)
204{
205 return 0x00000002U;
206}
207static inline u32 top_device_info_entry_engine_type_v(void)
208{
209 return 0x00000003U;
210}
211static inline u32 top_device_info_entry_data_v(void)
212{
213 return 0x00000001U;
214}
215static inline u32 top_device_info_data_type_v(u32 r)
216{
217 return (r >> 30U) & 0x1U;
218}
219static inline u32 top_device_info_data_type_enum2_v(void)
220{
221 return 0x00000000U;
222}
223static inline u32 top_device_info_data_inst_id_v(u32 r)
224{
225 return (r >> 26U) & 0xfU;
226}
227static inline u32 top_device_info_data_pri_base_v(u32 r)
228{
229 return (r >> 12U) & 0xfffU;
230}
231static inline u32 top_device_info_data_pri_base_align_v(void)
232{
233 return 0x0000000cU;
234}
235static inline u32 top_device_info_data_fault_id_enum_v(u32 r)
236{
237 return (r >> 3U) & 0x1fU;
238}
239static inline u32 top_device_info_data_fault_id_v(u32 r)
240{
241 return (r >> 2U) & 0x1U;
242}
243static inline u32 top_device_info_data_fault_id_valid_v(void)
244{
245 return 0x00000001U;
246}
247static inline u32 top_scratch1_r(void)
248{
249 return 0x0002240cU;
250}
251static inline u32 top_scratch1_devinit_completed_v(u32 r)
252{
253 return (r >> 1U) & 0x1U;
254}
255#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_trim_gp106.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_trim_gp106.h
new file mode 100644
index 00000000..cebb6d40
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_trim_gp106.h
@@ -0,0 +1,195 @@
1/*
2 * Copyright (c) 2016-2017, 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_trim_gp106_h_
57#define _hw_trim_gp106_h_
58
59static inline u32 trim_gpc_bcast_clk_cntr_ncgpcclk_cfg_r(void)
60{
61 return 0x00132924U;
62}
63static inline u32 trim_gpc_bcast_clk_cntr_ncgpcclk_cfg_noofipclks_s(void)
64{
65 return 16U;
66}
67static inline u32 trim_gpc_bcast_clk_cntr_ncgpcclk_cfg_noofipclks_f(u32 v)
68{
69 return (v & 0xffffU) << 0U;
70}
71static inline u32 trim_gpc_bcast_clk_cntr_ncgpcclk_cfg_noofipclks_m(void)
72{
73 return 0xffffU << 0U;
74}
75static inline u32 trim_gpc_bcast_clk_cntr_ncgpcclk_cfg_noofipclks_v(u32 r)
76{
77 return (r >> 0U) & 0xffffU;
78}
79static inline u32 trim_gpc_bcast_clk_cntr_ncgpcclk_cfg_write_en_s(void)
80{
81 return 1U;
82}
83static inline u32 trim_gpc_bcast_clk_cntr_ncgpcclk_cfg_write_en_f(u32 v)
84{
85 return (v & 0x1U) << 16U;
86}
87static inline u32 trim_gpc_bcast_clk_cntr_ncgpcclk_cfg_write_en_m(void)
88{
89 return 0x1U << 16U;
90}
91static inline u32 trim_gpc_bcast_clk_cntr_ncgpcclk_cfg_write_en_v(u32 r)
92{
93 return (r >> 16U) & 0x1U;
94}
95static inline u32 trim_gpc_bcast_clk_cntr_ncgpcclk_cfg_write_en_deasserted_f(void)
96{
97 return 0x0U;
98}
99static inline u32 trim_gpc_bcast_clk_cntr_ncgpcclk_cfg_write_en_asserted_f(void)
100{
101 return 0x10000U;
102}
103static inline u32 trim_gpc_bcast_clk_cntr_ncgpcclk_cfg_enable_s(void)
104{
105 return 1U;
106}
107static inline u32 trim_gpc_bcast_clk_cntr_ncgpcclk_cfg_enable_f(u32 v)
108{
109 return (v & 0x1U) << 20U;
110}
111static inline u32 trim_gpc_bcast_clk_cntr_ncgpcclk_cfg_enable_m(void)
112{
113 return 0x1U << 20U;
114}
115static inline u32 trim_gpc_bcast_clk_cntr_ncgpcclk_cfg_enable_v(u32 r)
116{
117 return (r >> 20U) & 0x1U;
118}
119static inline u32 trim_gpc_bcast_clk_cntr_ncgpcclk_cfg_enable_deasserted_f(void)
120{
121 return 0x0U;
122}
123static inline u32 trim_gpc_bcast_clk_cntr_ncgpcclk_cfg_enable_asserted_f(void)
124{
125 return 0x100000U;
126}
127static inline u32 trim_gpc_bcast_clk_cntr_ncgpcclk_cfg_reset_s(void)
128{
129 return 1U;
130}
131static inline u32 trim_gpc_bcast_clk_cntr_ncgpcclk_cfg_reset_f(u32 v)
132{
133 return (v & 0x1U) << 24U;
134}
135static inline u32 trim_gpc_bcast_clk_cntr_ncgpcclk_cfg_reset_m(void)
136{
137 return 0x1U << 24U;
138}
139static inline u32 trim_gpc_bcast_clk_cntr_ncgpcclk_cfg_reset_v(u32 r)
140{
141 return (r >> 24U) & 0x1U;
142}
143static inline u32 trim_gpc_bcast_clk_cntr_ncgpcclk_cfg_reset_deasserted_f(void)
144{
145 return 0x0U;
146}
147static inline u32 trim_gpc_bcast_clk_cntr_ncgpcclk_cfg_reset_asserted_f(void)
148{
149 return 0x1000000U;
150}
151static inline u32 trim_gpc_bcast_clk_cntr_ncgpcclk_cfg_source_gpc2clk_f(void)
152{
153 return 0x70000000U;
154}
155static inline u32 trim_gpc_bcast_clk_cntr_ncgpcclk_cnt_r(void)
156{
157 return 0x00132928U;
158}
159static inline u32 trim_fbpa_bcast_clk_cntr_ncltcclk_cfg_r(void)
160{
161 return 0x00132128U;
162}
163static inline u32 trim_fbpa_bcast_clk_cntr_ncltcclk_cfg_source_dramdiv4_rec_clk1_f(void)
164{
165 return 0x30000000U;
166}
167static inline u32 trim_fbpa_bcast_clk_cntr_ncltcclk_cnt_r(void)
168{
169 return 0x0013212cU;
170}
171static inline u32 trim_sys_clk_cntr_ncltcpll_cfg_r(void)
172{
173 return 0x001373c0U;
174}
175static inline u32 trim_sys_clk_cntr_ncltcpll_cfg_source_xbar2clk_f(void)
176{
177 return 0x20000000U;
178}
179static inline u32 trim_sys_clk_cntr_ncltcpll_cnt_r(void)
180{
181 return 0x001373c4U;
182}
183static inline u32 trim_sys_clk_cntr_ncsyspll_cfg_r(void)
184{
185 return 0x001373b0U;
186}
187static inline u32 trim_sys_clk_cntr_ncsyspll_cfg_source_sys2clk_f(void)
188{
189 return 0x0U;
190}
191static inline u32 trim_sys_clk_cntr_ncsyspll_cnt_r(void)
192{
193 return 0x001373b4U;
194}
195#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_xp_gp106.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_xp_gp106.h
new file mode 100644
index 00000000..f6c843c5
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_xp_gp106.h
@@ -0,0 +1,143 @@
1/*
2 * Copyright (c) 2016-2017, 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_xp_gp106_h_
57#define _hw_xp_gp106_h_
58
59static inline u32 xp_dl_mgr_r(u32 i)
60{
61 return 0x0008b8c0U + i*4U;
62}
63static inline u32 xp_dl_mgr_safe_timing_f(u32 v)
64{
65 return (v & 0x1U) << 2U;
66}
67static inline u32 xp_pl_link_config_r(u32 i)
68{
69 return 0x0008c040U + i*4U;
70}
71static inline u32 xp_pl_link_config_ltssm_status_f(u32 v)
72{
73 return (v & 0x1U) << 4U;
74}
75static inline u32 xp_pl_link_config_ltssm_status_idle_v(void)
76{
77 return 0x00000000U;
78}
79static inline u32 xp_pl_link_config_ltssm_directive_f(u32 v)
80{
81 return (v & 0xfU) << 0U;
82}
83static inline u32 xp_pl_link_config_ltssm_directive_m(void)
84{
85 return 0xfU << 0U;
86}
87static inline u32 xp_pl_link_config_ltssm_directive_normal_operations_v(void)
88{
89 return 0x00000000U;
90}
91static inline u32 xp_pl_link_config_ltssm_directive_change_speed_v(void)
92{
93 return 0x00000001U;
94}
95static inline u32 xp_pl_link_config_max_link_rate_f(u32 v)
96{
97 return (v & 0x3U) << 18U;
98}
99static inline u32 xp_pl_link_config_max_link_rate_m(void)
100{
101 return 0x3U << 18U;
102}
103static inline u32 xp_pl_link_config_max_link_rate_2500_mtps_v(void)
104{
105 return 0x00000002U;
106}
107static inline u32 xp_pl_link_config_max_link_rate_5000_mtps_v(void)
108{
109 return 0x00000001U;
110}
111static inline u32 xp_pl_link_config_max_link_rate_8000_mtps_v(void)
112{
113 return 0x00000000U;
114}
115static inline u32 xp_pl_link_config_target_tx_width_f(u32 v)
116{
117 return (v & 0x7U) << 20U;
118}
119static inline u32 xp_pl_link_config_target_tx_width_m(void)
120{
121 return 0x7U << 20U;
122}
123static inline u32 xp_pl_link_config_target_tx_width_x1_v(void)
124{
125 return 0x00000007U;
126}
127static inline u32 xp_pl_link_config_target_tx_width_x2_v(void)
128{
129 return 0x00000006U;
130}
131static inline u32 xp_pl_link_config_target_tx_width_x4_v(void)
132{
133 return 0x00000005U;
134}
135static inline u32 xp_pl_link_config_target_tx_width_x8_v(void)
136{
137 return 0x00000004U;
138}
139static inline u32 xp_pl_link_config_target_tx_width_x16_v(void)
140{
141 return 0x00000000U;
142}
143#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_xve_gp106.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_xve_gp106.h
new file mode 100644
index 00000000..e61d13f3
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_xve_gp106.h
@@ -0,0 +1,207 @@
1/*
2 * Copyright (c) 2016-2017, 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_xve_gp106_h_
57#define _hw_xve_gp106_h_
58
59static inline u32 xve_rom_ctrl_r(void)
60{
61 return 0x00000050U;
62}
63static inline u32 xve_rom_ctrl_rom_shadow_f(u32 v)
64{
65 return (v & 0x1U) << 0U;
66}
67static inline u32 xve_rom_ctrl_rom_shadow_disabled_f(void)
68{
69 return 0x0U;
70}
71static inline u32 xve_rom_ctrl_rom_shadow_enabled_f(void)
72{
73 return 0x1U;
74}
75static inline u32 xve_link_control_status_r(void)
76{
77 return 0x00000088U;
78}
79static inline u32 xve_link_control_status_link_speed_m(void)
80{
81 return 0xfU << 16U;
82}
83static inline u32 xve_link_control_status_link_speed_v(u32 r)
84{
85 return (r >> 16U) & 0xfU;
86}
87static inline u32 xve_link_control_status_link_speed_link_speed_2p5_v(void)
88{
89 return 0x00000001U;
90}
91static inline u32 xve_link_control_status_link_speed_link_speed_5p0_v(void)
92{
93 return 0x00000002U;
94}
95static inline u32 xve_link_control_status_link_speed_link_speed_8p0_v(void)
96{
97 return 0x00000003U;
98}
99static inline u32 xve_link_control_status_link_width_m(void)
100{
101 return 0x3fU << 20U;
102}
103static inline u32 xve_link_control_status_link_width_v(u32 r)
104{
105 return (r >> 20U) & 0x3fU;
106}
107static inline u32 xve_link_control_status_link_width_x1_v(void)
108{
109 return 0x00000001U;
110}
111static inline u32 xve_link_control_status_link_width_x2_v(void)
112{
113 return 0x00000002U;
114}
115static inline u32 xve_link_control_status_link_width_x4_v(void)
116{
117 return 0x00000004U;
118}
119static inline u32 xve_link_control_status_link_width_x8_v(void)
120{
121 return 0x00000008U;
122}
123static inline u32 xve_link_control_status_link_width_x16_v(void)
124{
125 return 0x00000010U;
126}
127static inline u32 xve_priv_xv_r(void)
128{
129 return 0x00000150U;
130}
131static inline u32 xve_priv_xv_cya_l0s_enable_f(u32 v)
132{
133 return (v & 0x1U) << 7U;
134}
135static inline u32 xve_priv_xv_cya_l0s_enable_m(void)
136{
137 return 0x1U << 7U;
138}
139static inline u32 xve_priv_xv_cya_l0s_enable_v(u32 r)
140{
141 return (r >> 7U) & 0x1U;
142}
143static inline u32 xve_priv_xv_cya_l1_enable_f(u32 v)
144{
145 return (v & 0x1U) << 8U;
146}
147static inline u32 xve_priv_xv_cya_l1_enable_m(void)
148{
149 return 0x1U << 8U;
150}
151static inline u32 xve_priv_xv_cya_l1_enable_v(u32 r)
152{
153 return (r >> 8U) & 0x1U;
154}
155static inline u32 xve_cya_2_r(void)
156{
157 return 0x00000704U;
158}
159static inline u32 xve_reset_r(void)
160{
161 return 0x00000718U;
162}
163static inline u32 xve_reset_reset_m(void)
164{
165 return 0x1U << 0U;
166}
167static inline u32 xve_reset_gpu_on_sw_reset_m(void)
168{
169 return 0x1U << 1U;
170}
171static inline u32 xve_reset_counter_en_m(void)
172{
173 return 0x1U << 2U;
174}
175static inline u32 xve_reset_counter_val_f(u32 v)
176{
177 return (v & 0x7ffU) << 4U;
178}
179static inline u32 xve_reset_counter_val_m(void)
180{
181 return 0x7ffU << 4U;
182}
183static inline u32 xve_reset_counter_val_v(u32 r)
184{
185 return (r >> 4U) & 0x7ffU;
186}
187static inline u32 xve_reset_clock_on_sw_reset_m(void)
188{
189 return 0x1U << 15U;
190}
191static inline u32 xve_reset_clock_counter_en_m(void)
192{
193 return 0x1U << 16U;
194}
195static inline u32 xve_reset_clock_counter_val_f(u32 v)
196{
197 return (v & 0x7ffU) << 17U;
198}
199static inline u32 xve_reset_clock_counter_val_m(void)
200{
201 return 0x7ffU << 17U;
202}
203static inline u32 xve_reset_clock_counter_val_v(u32 r)
204{
205 return (r >> 17U) & 0x7ffU;
206}
207#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_bus_gp10b.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_bus_gp10b.h
new file mode 100644
index 00000000..b06ea66d
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_bus_gp10b.h
@@ -0,0 +1,223 @@
1/*
2 * Copyright (c) 2014-2017, 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_bus_gp10b_h_
57#define _hw_bus_gp10b_h_
58
59static inline u32 bus_bar0_window_r(void)
60{
61 return 0x00001700U;
62}
63static inline u32 bus_bar0_window_base_f(u32 v)
64{
65 return (v & 0xffffffU) << 0U;
66}
67static inline u32 bus_bar0_window_target_vid_mem_f(void)
68{
69 return 0x0U;
70}
71static inline u32 bus_bar0_window_target_sys_mem_coherent_f(void)
72{
73 return 0x2000000U;
74}
75static inline u32 bus_bar0_window_target_sys_mem_noncoherent_f(void)
76{
77 return 0x3000000U;
78}
79static inline u32 bus_bar0_window_target_bar0_window_base_shift_v(void)
80{
81 return 0x00000010U;
82}
83static inline u32 bus_bar1_block_r(void)
84{
85 return 0x00001704U;
86}
87static inline u32 bus_bar1_block_ptr_f(u32 v)
88{
89 return (v & 0xfffffffU) << 0U;
90}
91static inline u32 bus_bar1_block_target_vid_mem_f(void)
92{
93 return 0x0U;
94}
95static inline u32 bus_bar1_block_target_sys_mem_coh_f(void)
96{
97 return 0x20000000U;
98}
99static inline u32 bus_bar1_block_target_sys_mem_ncoh_f(void)
100{
101 return 0x30000000U;
102}
103static inline u32 bus_bar1_block_mode_virtual_f(void)
104{
105 return 0x80000000U;
106}
107static inline u32 bus_bar2_block_r(void)
108{
109 return 0x00001714U;
110}
111static inline u32 bus_bar2_block_ptr_f(u32 v)
112{
113 return (v & 0xfffffffU) << 0U;
114}
115static inline u32 bus_bar2_block_target_vid_mem_f(void)
116{
117 return 0x0U;
118}
119static inline u32 bus_bar2_block_target_sys_mem_coh_f(void)
120{
121 return 0x20000000U;
122}
123static inline u32 bus_bar2_block_target_sys_mem_ncoh_f(void)
124{
125 return 0x30000000U;
126}
127static inline u32 bus_bar2_block_mode_virtual_f(void)
128{
129 return 0x80000000U;
130}
131static inline u32 bus_bar1_block_ptr_shift_v(void)
132{
133 return 0x0000000cU;
134}
135static inline u32 bus_bar2_block_ptr_shift_v(void)
136{
137 return 0x0000000cU;
138}
139static inline u32 bus_bind_status_r(void)
140{
141 return 0x00001710U;
142}
143static inline u32 bus_bind_status_bar1_pending_v(u32 r)
144{
145 return (r >> 0U) & 0x1U;
146}
147static inline u32 bus_bind_status_bar1_pending_empty_f(void)
148{
149 return 0x0U;
150}
151static inline u32 bus_bind_status_bar1_pending_busy_f(void)
152{
153 return 0x1U;
154}
155static inline u32 bus_bind_status_bar1_outstanding_v(u32 r)
156{
157 return (r >> 1U) & 0x1U;
158}
159static inline u32 bus_bind_status_bar1_outstanding_false_f(void)
160{
161 return 0x0U;
162}
163static inline u32 bus_bind_status_bar1_outstanding_true_f(void)
164{
165 return 0x2U;
166}
167static inline u32 bus_bind_status_bar2_pending_v(u32 r)
168{
169 return (r >> 2U) & 0x1U;
170}
171static inline u32 bus_bind_status_bar2_pending_empty_f(void)
172{
173 return 0x0U;
174}
175static inline u32 bus_bind_status_bar2_pending_busy_f(void)
176{
177 return 0x4U;
178}
179static inline u32 bus_bind_status_bar2_outstanding_v(u32 r)
180{
181 return (r >> 3U) & 0x1U;
182}
183static inline u32 bus_bind_status_bar2_outstanding_false_f(void)
184{
185 return 0x0U;
186}
187static inline u32 bus_bind_status_bar2_outstanding_true_f(void)
188{
189 return 0x8U;
190}
191static inline u32 bus_intr_0_r(void)
192{
193 return 0x00001100U;
194}
195static inline u32 bus_intr_0_pri_squash_m(void)
196{
197 return 0x1U << 1U;
198}
199static inline u32 bus_intr_0_pri_fecserr_m(void)
200{
201 return 0x1U << 2U;
202}
203static inline u32 bus_intr_0_pri_timeout_m(void)
204{
205 return 0x1U << 3U;
206}
207static inline u32 bus_intr_en_0_r(void)
208{
209 return 0x00001140U;
210}
211static inline u32 bus_intr_en_0_pri_squash_m(void)
212{
213 return 0x1U << 1U;
214}
215static inline u32 bus_intr_en_0_pri_fecserr_m(void)
216{
217 return 0x1U << 2U;
218}
219static inline u32 bus_intr_en_0_pri_timeout_m(void)
220{
221 return 0x1U << 3U;
222}
223#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_ccsr_gp10b.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_ccsr_gp10b.h
new file mode 100644
index 00000000..00879c11
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_ccsr_gp10b.h
@@ -0,0 +1,163 @@
1/*
2 * Copyright (c) 2014-2017, 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_ccsr_gp10b_h_
57#define _hw_ccsr_gp10b_h_
58
59static inline u32 ccsr_channel_inst_r(u32 i)
60{
61 return 0x00800000U + i*8U;
62}
63static inline u32 ccsr_channel_inst__size_1_v(void)
64{
65 return 0x00000200U;
66}
67static inline u32 ccsr_channel_inst_ptr_f(u32 v)
68{
69 return (v & 0xfffffffU) << 0U;
70}
71static inline u32 ccsr_channel_inst_target_vid_mem_f(void)
72{
73 return 0x0U;
74}
75static inline u32 ccsr_channel_inst_target_sys_mem_coh_f(void)
76{
77 return 0x20000000U;
78}
79static inline u32 ccsr_channel_inst_target_sys_mem_ncoh_f(void)
80{
81 return 0x30000000U;
82}
83static inline u32 ccsr_channel_inst_bind_false_f(void)
84{
85 return 0x0U;
86}
87static inline u32 ccsr_channel_inst_bind_true_f(void)
88{
89 return 0x80000000U;
90}
91static inline u32 ccsr_channel_r(u32 i)
92{
93 return 0x00800004U + i*8U;
94}
95static inline u32 ccsr_channel__size_1_v(void)
96{
97 return 0x00000200U;
98}
99static inline u32 ccsr_channel_enable_v(u32 r)
100{
101 return (r >> 0U) & 0x1U;
102}
103static inline u32 ccsr_channel_enable_set_f(u32 v)
104{
105 return (v & 0x1U) << 10U;
106}
107static inline u32 ccsr_channel_enable_set_true_f(void)
108{
109 return 0x400U;
110}
111static inline u32 ccsr_channel_enable_clr_true_f(void)
112{
113 return 0x800U;
114}
115static inline u32 ccsr_channel_status_v(u32 r)
116{
117 return (r >> 24U) & 0xfU;
118}
119static inline u32 ccsr_channel_status_pending_ctx_reload_v(void)
120{
121 return 0x00000002U;
122}
123static inline u32 ccsr_channel_status_pending_acq_ctx_reload_v(void)
124{
125 return 0x00000004U;
126}
127static inline u32 ccsr_channel_status_on_pbdma_ctx_reload_v(void)
128{
129 return 0x0000000aU;
130}
131static inline u32 ccsr_channel_status_on_pbdma_and_eng_ctx_reload_v(void)
132{
133 return 0x0000000bU;
134}
135static inline u32 ccsr_channel_status_on_eng_ctx_reload_v(void)
136{
137 return 0x0000000cU;
138}
139static inline u32 ccsr_channel_status_on_eng_pending_ctx_reload_v(void)
140{
141 return 0x0000000dU;
142}
143static inline u32 ccsr_channel_status_on_eng_pending_acq_ctx_reload_v(void)
144{
145 return 0x0000000eU;
146}
147static inline u32 ccsr_channel_next_v(u32 r)
148{
149 return (r >> 1U) & 0x1U;
150}
151static inline u32 ccsr_channel_next_true_v(void)
152{
153 return 0x00000001U;
154}
155static inline u32 ccsr_channel_force_ctx_reload_true_f(void)
156{
157 return 0x100U;
158}
159static inline u32 ccsr_channel_busy_v(u32 r)
160{
161 return (r >> 28U) & 0x1U;
162}
163#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_ce_gp10b.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_ce_gp10b.h
new file mode 100644
index 00000000..c2937710
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_ce_gp10b.h
@@ -0,0 +1,87 @@
1/*
2 * Copyright (c) 2016-2017, 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_ce_gp10b_h_
57#define _hw_ce_gp10b_h_
58
59static inline u32 ce_intr_status_r(u32 i)
60{
61 return 0x00104410U + i*128U;
62}
63static inline u32 ce_intr_status_blockpipe_pending_f(void)
64{
65 return 0x1U;
66}
67static inline u32 ce_intr_status_blockpipe_reset_f(void)
68{
69 return 0x1U;
70}
71static inline u32 ce_intr_status_nonblockpipe_pending_f(void)
72{
73 return 0x2U;
74}
75static inline u32 ce_intr_status_nonblockpipe_reset_f(void)
76{
77 return 0x2U;
78}
79static inline u32 ce_intr_status_launcherr_pending_f(void)
80{
81 return 0x4U;
82}
83static inline u32 ce_intr_status_launcherr_reset_f(void)
84{
85 return 0x4U;
86}
87#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_ctxsw_prog_gp10b.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_ctxsw_prog_gp10b.h
new file mode 100644
index 00000000..b214bdb3
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_ctxsw_prog_gp10b.h
@@ -0,0 +1,487 @@
1/*
2 * Copyright (c) 2014-2017, 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_ctxsw_prog_gp10b_h_
57#define _hw_ctxsw_prog_gp10b_h_
58
59static inline u32 ctxsw_prog_fecs_header_v(void)
60{
61 return 0x00000100U;
62}
63static inline u32 ctxsw_prog_main_image_num_gpcs_o(void)
64{
65 return 0x00000008U;
66}
67static inline u32 ctxsw_prog_main_image_patch_count_o(void)
68{
69 return 0x00000010U;
70}
71static inline u32 ctxsw_prog_main_image_context_id_o(void)
72{
73 return 0x000000f0U;
74}
75static inline u32 ctxsw_prog_main_image_patch_adr_lo_o(void)
76{
77 return 0x00000014U;
78}
79static inline u32 ctxsw_prog_main_image_patch_adr_hi_o(void)
80{
81 return 0x00000018U;
82}
83static inline u32 ctxsw_prog_main_image_zcull_o(void)
84{
85 return 0x0000001cU;
86}
87static inline u32 ctxsw_prog_main_image_zcull_mode_no_ctxsw_v(void)
88{
89 return 0x00000001U;
90}
91static inline u32 ctxsw_prog_main_image_zcull_mode_separate_buffer_v(void)
92{
93 return 0x00000002U;
94}
95static inline u32 ctxsw_prog_main_image_zcull_ptr_o(void)
96{
97 return 0x00000020U;
98}
99static inline u32 ctxsw_prog_main_image_pm_o(void)
100{
101 return 0x00000028U;
102}
103static inline u32 ctxsw_prog_main_image_pm_mode_m(void)
104{
105 return 0x7U << 0U;
106}
107static inline u32 ctxsw_prog_main_image_pm_mode_no_ctxsw_f(void)
108{
109 return 0x0U;
110}
111static inline u32 ctxsw_prog_main_image_pm_smpc_mode_m(void)
112{
113 return 0x7U << 3U;
114}
115static inline u32 ctxsw_prog_main_image_pm_smpc_mode_ctxsw_f(void)
116{
117 return 0x8U;
118}
119static inline u32 ctxsw_prog_main_image_pm_smpc_mode_no_ctxsw_f(void)
120{
121 return 0x0U;
122}
123static inline u32 ctxsw_prog_main_image_pm_ptr_o(void)
124{
125 return 0x0000002cU;
126}
127static inline u32 ctxsw_prog_main_image_num_save_ops_o(void)
128{
129 return 0x000000f4U;
130}
131static inline u32 ctxsw_prog_main_image_num_wfi_save_ops_o(void)
132{
133 return 0x000000d0U;
134}
135static inline u32 ctxsw_prog_main_image_num_cta_save_ops_o(void)
136{
137 return 0x000000d4U;
138}
139static inline u32 ctxsw_prog_main_image_num_gfxp_save_ops_o(void)
140{
141 return 0x000000d8U;
142}
143static inline u32 ctxsw_prog_main_image_num_cilp_save_ops_o(void)
144{
145 return 0x000000dcU;
146}
147static inline u32 ctxsw_prog_main_image_num_restore_ops_o(void)
148{
149 return 0x000000f8U;
150}
151static inline u32 ctxsw_prog_main_image_magic_value_o(void)
152{
153 return 0x000000fcU;
154}
155static inline u32 ctxsw_prog_main_image_magic_value_v_value_v(void)
156{
157 return 0x600dc0deU;
158}
159static inline u32 ctxsw_prog_local_priv_register_ctl_o(void)
160{
161 return 0x0000000cU;
162}
163static inline u32 ctxsw_prog_local_priv_register_ctl_offset_v(u32 r)
164{
165 return (r >> 0U) & 0xffffU;
166}
167static inline u32 ctxsw_prog_local_image_ppc_info_o(void)
168{
169 return 0x000000f4U;
170}
171static inline u32 ctxsw_prog_local_image_ppc_info_num_ppcs_v(u32 r)
172{
173 return (r >> 0U) & 0xffffU;
174}
175static inline u32 ctxsw_prog_local_image_ppc_info_ppc_mask_v(u32 r)
176{
177 return (r >> 16U) & 0xffffU;
178}
179static inline u32 ctxsw_prog_local_image_num_tpcs_o(void)
180{
181 return 0x000000f8U;
182}
183static inline u32 ctxsw_prog_local_magic_value_o(void)
184{
185 return 0x000000fcU;
186}
187static inline u32 ctxsw_prog_local_magic_value_v_value_v(void)
188{
189 return 0xad0becabU;
190}
191static inline u32 ctxsw_prog_main_extended_buffer_ctl_o(void)
192{
193 return 0x000000ecU;
194}
195static inline u32 ctxsw_prog_main_extended_buffer_ctl_offset_v(u32 r)
196{
197 return (r >> 0U) & 0xffffU;
198}
199static inline u32 ctxsw_prog_main_extended_buffer_ctl_size_v(u32 r)
200{
201 return (r >> 16U) & 0xffU;
202}
203static inline u32 ctxsw_prog_extended_buffer_segments_size_in_bytes_v(void)
204{
205 return 0x00000100U;
206}
207static inline u32 ctxsw_prog_extended_marker_size_in_bytes_v(void)
208{
209 return 0x00000004U;
210}
211static inline u32 ctxsw_prog_extended_sm_dsm_perf_counter_register_stride_v(void)
212{
213 return 0x00000000U;
214}
215static inline u32 ctxsw_prog_extended_sm_dsm_perf_counter_control_register_stride_v(void)
216{
217 return 0x00000002U;
218}
219static inline u32 ctxsw_prog_main_image_priv_access_map_config_o(void)
220{
221 return 0x000000a0U;
222}
223static inline u32 ctxsw_prog_main_image_priv_access_map_config_mode_s(void)
224{
225 return 2U;
226}
227static inline u32 ctxsw_prog_main_image_priv_access_map_config_mode_f(u32 v)
228{
229 return (v & 0x3U) << 0U;
230}
231static inline u32 ctxsw_prog_main_image_priv_access_map_config_mode_m(void)
232{
233 return 0x3U << 0U;
234}
235static inline u32 ctxsw_prog_main_image_priv_access_map_config_mode_v(u32 r)
236{
237 return (r >> 0U) & 0x3U;
238}
239static inline u32 ctxsw_prog_main_image_priv_access_map_config_mode_allow_all_f(void)
240{
241 return 0x0U;
242}
243static inline u32 ctxsw_prog_main_image_priv_access_map_config_mode_use_map_f(void)
244{
245 return 0x2U;
246}
247static inline u32 ctxsw_prog_main_image_priv_access_map_addr_lo_o(void)
248{
249 return 0x000000a4U;
250}
251static inline u32 ctxsw_prog_main_image_priv_access_map_addr_hi_o(void)
252{
253 return 0x000000a8U;
254}
255static inline u32 ctxsw_prog_main_image_misc_options_o(void)
256{
257 return 0x0000003cU;
258}
259static inline u32 ctxsw_prog_main_image_misc_options_verif_features_m(void)
260{
261 return 0x1U << 3U;
262}
263static inline u32 ctxsw_prog_main_image_misc_options_verif_features_disabled_f(void)
264{
265 return 0x0U;
266}
267static inline u32 ctxsw_prog_main_image_pmu_options_o(void)
268{
269 return 0x00000070U;
270}
271static inline u32 ctxsw_prog_main_image_pmu_options_boost_clock_frequencies_f(u32 v)
272{
273 return (v & 0x1U) << 0U;
274}
275static inline u32 ctxsw_prog_main_image_graphics_preemption_options_o(void)
276{
277 return 0x00000080U;
278}
279static inline u32 ctxsw_prog_main_image_graphics_preemption_options_control_f(u32 v)
280{
281 return (v & 0x3U) << 0U;
282}
283static inline u32 ctxsw_prog_main_image_graphics_preemption_options_control_gfxp_f(void)
284{
285 return 0x1U;
286}
287static inline u32 ctxsw_prog_main_image_full_preemption_ptr_o(void)
288{
289 return 0x00000068U;
290}
291static inline u32 ctxsw_prog_main_image_compute_preemption_options_o(void)
292{
293 return 0x00000084U;
294}
295static inline u32 ctxsw_prog_main_image_compute_preemption_options_control_f(u32 v)
296{
297 return (v & 0x3U) << 0U;
298}
299static inline u32 ctxsw_prog_main_image_compute_preemption_options_control_cta_f(void)
300{
301 return 0x1U;
302}
303static inline u32 ctxsw_prog_main_image_compute_preemption_options_control_cilp_f(void)
304{
305 return 0x2U;
306}
307static inline u32 ctxsw_prog_main_image_context_timestamp_buffer_control_o(void)
308{
309 return 0x000000acU;
310}
311static inline u32 ctxsw_prog_main_image_context_timestamp_buffer_control_num_records_f(u32 v)
312{
313 return (v & 0xffffU) << 0U;
314}
315static inline u32 ctxsw_prog_main_image_context_timestamp_buffer_ptr_hi_o(void)
316{
317 return 0x000000b0U;
318}
319static inline u32 ctxsw_prog_main_image_context_timestamp_buffer_ptr_hi_v_m(void)
320{
321 return 0xfffffffU << 0U;
322}
323static inline u32 ctxsw_prog_main_image_context_timestamp_buffer_ptr_hi_target_m(void)
324{
325 return 0x3U << 28U;
326}
327static inline u32 ctxsw_prog_main_image_context_timestamp_buffer_ptr_hi_target_vid_mem_f(void)
328{
329 return 0x0U;
330}
331static inline u32 ctxsw_prog_main_image_context_timestamp_buffer_ptr_hi_target_sys_mem_coherent_f(void)
332{
333 return 0x20000000U;
334}
335static inline u32 ctxsw_prog_main_image_context_timestamp_buffer_ptr_hi_target_sys_mem_noncoherent_f(void)
336{
337 return 0x30000000U;
338}
339static inline u32 ctxsw_prog_main_image_context_timestamp_buffer_ptr_o(void)
340{
341 return 0x000000b4U;
342}
343static inline u32 ctxsw_prog_main_image_context_timestamp_buffer_ptr_v_f(u32 v)
344{
345 return (v & 0xffffffffU) << 0U;
346}
347static inline u32 ctxsw_prog_record_timestamp_record_size_in_bytes_v(void)
348{
349 return 0x00000080U;
350}
351static inline u32 ctxsw_prog_record_timestamp_record_size_in_words_v(void)
352{
353 return 0x00000020U;
354}
355static inline u32 ctxsw_prog_record_timestamp_magic_value_lo_o(void)
356{
357 return 0x00000000U;
358}
359static inline u32 ctxsw_prog_record_timestamp_magic_value_lo_v_value_v(void)
360{
361 return 0x00000000U;
362}
363static inline u32 ctxsw_prog_record_timestamp_magic_value_hi_o(void)
364{
365 return 0x00000004U;
366}
367static inline u32 ctxsw_prog_record_timestamp_magic_value_hi_v_value_v(void)
368{
369 return 0x600dbeefU;
370}
371static inline u32 ctxsw_prog_record_timestamp_context_id_o(void)
372{
373 return 0x00000008U;
374}
375static inline u32 ctxsw_prog_record_timestamp_context_ptr_o(void)
376{
377 return 0x0000000cU;
378}
379static inline u32 ctxsw_prog_record_timestamp_timestamp_lo_o(void)
380{
381 return 0x00000018U;
382}
383static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_o(void)
384{
385 return 0x0000001cU;
386}
387static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_v_f(u32 v)
388{
389 return (v & 0xffffffU) << 0U;
390}
391static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_v_v(u32 r)
392{
393 return (r >> 0U) & 0xffffffU;
394}
395static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_f(u32 v)
396{
397 return (v & 0xffU) << 24U;
398}
399static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_m(void)
400{
401 return 0xffU << 24U;
402}
403static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_v(u32 r)
404{
405 return (r >> 24U) & 0xffU;
406}
407static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_ctxsw_req_by_host_v(void)
408{
409 return 0x00000001U;
410}
411static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_ctxsw_req_by_host_f(void)
412{
413 return 0x1000000U;
414}
415static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_fe_ack_v(void)
416{
417 return 0x00000002U;
418}
419static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_fe_ack_f(void)
420{
421 return 0x2000000U;
422}
423static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_fe_ack_wfi_v(void)
424{
425 return 0x0000000aU;
426}
427static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_fe_ack_wfi_f(void)
428{
429 return 0xa000000U;
430}
431static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_fe_ack_gfxp_v(void)
432{
433 return 0x0000000bU;
434}
435static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_fe_ack_gfxp_f(void)
436{
437 return 0xb000000U;
438}
439static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_fe_ack_ctap_v(void)
440{
441 return 0x0000000cU;
442}
443static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_fe_ack_ctap_f(void)
444{
445 return 0xc000000U;
446}
447static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_fe_ack_cilp_v(void)
448{
449 return 0x0000000dU;
450}
451static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_fe_ack_cilp_f(void)
452{
453 return 0xd000000U;
454}
455static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_save_end_v(void)
456{
457 return 0x00000003U;
458}
459static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_save_end_f(void)
460{
461 return 0x3000000U;
462}
463static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_restore_start_v(void)
464{
465 return 0x00000004U;
466}
467static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_restore_start_f(void)
468{
469 return 0x4000000U;
470}
471static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_context_start_v(void)
472{
473 return 0x00000005U;
474}
475static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_context_start_f(void)
476{
477 return 0x5000000U;
478}
479static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_invalid_timestamp_v(void)
480{
481 return 0x000000ffU;
482}
483static inline u32 ctxsw_prog_record_timestamp_timestamp_hi_tag_invalid_timestamp_f(void)
484{
485 return 0xff000000U;
486}
487#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_falcon_gp10b.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_falcon_gp10b.h
new file mode 100644
index 00000000..918f262b
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_falcon_gp10b.h
@@ -0,0 +1,599 @@
1/*
2 * Copyright (c) 2017, 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_falcon_gp10b_h_
57#define _hw_falcon_gp10b_h_
58
59static inline u32 falcon_falcon_irqsset_r(void)
60{
61 return 0x00000000U;
62}
63static inline u32 falcon_falcon_irqsset_swgen0_set_f(void)
64{
65 return 0x40U;
66}
67static inline u32 falcon_falcon_irqsclr_r(void)
68{
69 return 0x00000004U;
70}
71static inline u32 falcon_falcon_irqstat_r(void)
72{
73 return 0x00000008U;
74}
75static inline u32 falcon_falcon_irqstat_halt_true_f(void)
76{
77 return 0x10U;
78}
79static inline u32 falcon_falcon_irqstat_exterr_true_f(void)
80{
81 return 0x20U;
82}
83static inline u32 falcon_falcon_irqstat_swgen0_true_f(void)
84{
85 return 0x40U;
86}
87static inline u32 falcon_falcon_irqmode_r(void)
88{
89 return 0x0000000cU;
90}
91static inline u32 falcon_falcon_irqmset_r(void)
92{
93 return 0x00000010U;
94}
95static inline u32 falcon_falcon_irqmset_gptmr_f(u32 v)
96{
97 return (v & 0x1U) << 0U;
98}
99static inline u32 falcon_falcon_irqmset_wdtmr_f(u32 v)
100{
101 return (v & 0x1U) << 1U;
102}
103static inline u32 falcon_falcon_irqmset_mthd_f(u32 v)
104{
105 return (v & 0x1U) << 2U;
106}
107static inline u32 falcon_falcon_irqmset_ctxsw_f(u32 v)
108{
109 return (v & 0x1U) << 3U;
110}
111static inline u32 falcon_falcon_irqmset_halt_f(u32 v)
112{
113 return (v & 0x1U) << 4U;
114}
115static inline u32 falcon_falcon_irqmset_exterr_f(u32 v)
116{
117 return (v & 0x1U) << 5U;
118}
119static inline u32 falcon_falcon_irqmset_swgen0_f(u32 v)
120{
121 return (v & 0x1U) << 6U;
122}
123static inline u32 falcon_falcon_irqmset_swgen1_f(u32 v)
124{
125 return (v & 0x1U) << 7U;
126}
127static inline u32 falcon_falcon_irqmclr_r(void)
128{
129 return 0x00000014U;
130}
131static inline u32 falcon_falcon_irqmclr_gptmr_f(u32 v)
132{
133 return (v & 0x1U) << 0U;
134}
135static inline u32 falcon_falcon_irqmclr_wdtmr_f(u32 v)
136{
137 return (v & 0x1U) << 1U;
138}
139static inline u32 falcon_falcon_irqmclr_mthd_f(u32 v)
140{
141 return (v & 0x1U) << 2U;
142}
143static inline u32 falcon_falcon_irqmclr_ctxsw_f(u32 v)
144{
145 return (v & 0x1U) << 3U;
146}
147static inline u32 falcon_falcon_irqmclr_halt_f(u32 v)
148{
149 return (v & 0x1U) << 4U;
150}
151static inline u32 falcon_falcon_irqmclr_exterr_f(u32 v)
152{
153 return (v & 0x1U) << 5U;
154}
155static inline u32 falcon_falcon_irqmclr_swgen0_f(u32 v)
156{
157 return (v & 0x1U) << 6U;
158}
159static inline u32 falcon_falcon_irqmclr_swgen1_f(u32 v)
160{
161 return (v & 0x1U) << 7U;
162}
163static inline u32 falcon_falcon_irqmclr_ext_f(u32 v)
164{
165 return (v & 0xffU) << 8U;
166}
167static inline u32 falcon_falcon_irqmask_r(void)
168{
169 return 0x00000018U;
170}
171static inline u32 falcon_falcon_irqdest_r(void)
172{
173 return 0x0000001cU;
174}
175static inline u32 falcon_falcon_irqdest_host_gptmr_f(u32 v)
176{
177 return (v & 0x1U) << 0U;
178}
179static inline u32 falcon_falcon_irqdest_host_wdtmr_f(u32 v)
180{
181 return (v & 0x1U) << 1U;
182}
183static inline u32 falcon_falcon_irqdest_host_mthd_f(u32 v)
184{
185 return (v & 0x1U) << 2U;
186}
187static inline u32 falcon_falcon_irqdest_host_ctxsw_f(u32 v)
188{
189 return (v & 0x1U) << 3U;
190}
191static inline u32 falcon_falcon_irqdest_host_halt_f(u32 v)
192{
193 return (v & 0x1U) << 4U;
194}
195static inline u32 falcon_falcon_irqdest_host_exterr_f(u32 v)
196{
197 return (v & 0x1U) << 5U;
198}
199static inline u32 falcon_falcon_irqdest_host_swgen0_f(u32 v)
200{
201 return (v & 0x1U) << 6U;
202}
203static inline u32 falcon_falcon_irqdest_host_swgen1_f(u32 v)
204{
205 return (v & 0x1U) << 7U;
206}
207static inline u32 falcon_falcon_irqdest_host_ext_f(u32 v)
208{
209 return (v & 0xffU) << 8U;
210}
211static inline u32 falcon_falcon_irqdest_target_gptmr_f(u32 v)
212{
213 return (v & 0x1U) << 16U;
214}
215static inline u32 falcon_falcon_irqdest_target_wdtmr_f(u32 v)
216{
217 return (v & 0x1U) << 17U;
218}
219static inline u32 falcon_falcon_irqdest_target_mthd_f(u32 v)
220{
221 return (v & 0x1U) << 18U;
222}
223static inline u32 falcon_falcon_irqdest_target_ctxsw_f(u32 v)
224{
225 return (v & 0x1U) << 19U;
226}
227static inline u32 falcon_falcon_irqdest_target_halt_f(u32 v)
228{
229 return (v & 0x1U) << 20U;
230}
231static inline u32 falcon_falcon_irqdest_target_exterr_f(u32 v)
232{
233 return (v & 0x1U) << 21U;
234}
235static inline u32 falcon_falcon_irqdest_target_swgen0_f(u32 v)
236{
237 return (v & 0x1U) << 22U;
238}
239static inline u32 falcon_falcon_irqdest_target_swgen1_f(u32 v)
240{
241 return (v & 0x1U) << 23U;
242}
243static inline u32 falcon_falcon_irqdest_target_ext_f(u32 v)
244{
245 return (v & 0xffU) << 24U;
246}
247static inline u32 falcon_falcon_curctx_r(void)
248{
249 return 0x00000050U;
250}
251static inline u32 falcon_falcon_nxtctx_r(void)
252{
253 return 0x00000054U;
254}
255static inline u32 falcon_falcon_mailbox0_r(void)
256{
257 return 0x00000040U;
258}
259static inline u32 falcon_falcon_mailbox1_r(void)
260{
261 return 0x00000044U;
262}
263static inline u32 falcon_falcon_itfen_r(void)
264{
265 return 0x00000048U;
266}
267static inline u32 falcon_falcon_itfen_ctxen_enable_f(void)
268{
269 return 0x1U;
270}
271static inline u32 falcon_falcon_idlestate_r(void)
272{
273 return 0x0000004cU;
274}
275static inline u32 falcon_falcon_idlestate_falcon_busy_v(u32 r)
276{
277 return (r >> 0U) & 0x1U;
278}
279static inline u32 falcon_falcon_idlestate_ext_busy_v(u32 r)
280{
281 return (r >> 1U) & 0x7fffU;
282}
283static inline u32 falcon_falcon_os_r(void)
284{
285 return 0x00000080U;
286}
287static inline u32 falcon_falcon_engctl_r(void)
288{
289 return 0x000000a4U;
290}
291static inline u32 falcon_falcon_cpuctl_r(void)
292{
293 return 0x00000100U;
294}
295static inline u32 falcon_falcon_cpuctl_startcpu_f(u32 v)
296{
297 return (v & 0x1U) << 1U;
298}
299static inline u32 falcon_falcon_cpuctl_sreset_f(u32 v)
300{
301 return (v & 0x1U) << 2U;
302}
303static inline u32 falcon_falcon_cpuctl_hreset_f(u32 v)
304{
305 return (v & 0x1U) << 3U;
306}
307static inline u32 falcon_falcon_cpuctl_halt_intr_f(u32 v)
308{
309 return (v & 0x1U) << 4U;
310}
311static inline u32 falcon_falcon_cpuctl_halt_intr_m(void)
312{
313 return 0x1U << 4U;
314}
315static inline u32 falcon_falcon_cpuctl_halt_intr_v(u32 r)
316{
317 return (r >> 4U) & 0x1U;
318}
319static inline u32 falcon_falcon_cpuctl_stopped_m(void)
320{
321 return 0x1U << 5U;
322}
323static inline u32 falcon_falcon_cpuctl_cpuctl_alias_en_f(u32 v)
324{
325 return (v & 0x1U) << 6U;
326}
327static inline u32 falcon_falcon_cpuctl_cpuctl_alias_en_m(void)
328{
329 return 0x1U << 6U;
330}
331static inline u32 falcon_falcon_cpuctl_cpuctl_alias_en_v(u32 r)
332{
333 return (r >> 6U) & 0x1U;
334}
335static inline u32 falcon_falcon_cpuctl_alias_r(void)
336{
337 return 0x00000130U;
338}
339static inline u32 falcon_falcon_cpuctl_alias_startcpu_f(u32 v)
340{
341 return (v & 0x1U) << 1U;
342}
343static inline u32 falcon_falcon_imemc_r(u32 i)
344{
345 return 0x00000180U + i*16U;
346}
347static inline u32 falcon_falcon_imemc_offs_f(u32 v)
348{
349 return (v & 0x3fU) << 2U;
350}
351static inline u32 falcon_falcon_imemc_blk_f(u32 v)
352{
353 return (v & 0xffU) << 8U;
354}
355static inline u32 falcon_falcon_imemc_aincw_f(u32 v)
356{
357 return (v & 0x1U) << 24U;
358}
359static inline u32 falcon_falcon_imemd_r(u32 i)
360{
361 return 0x00000184U + i*16U;
362}
363static inline u32 falcon_falcon_imemt_r(u32 i)
364{
365 return 0x00000188U + i*16U;
366}
367static inline u32 falcon_falcon_sctl_r(void)
368{
369 return 0x00000240U;
370}
371static inline u32 falcon_falcon_mmu_phys_sec_r(void)
372{
373 return 0x00100ce4U;
374}
375static inline u32 falcon_falcon_bootvec_r(void)
376{
377 return 0x00000104U;
378}
379static inline u32 falcon_falcon_bootvec_vec_f(u32 v)
380{
381 return (v & 0xffffffffU) << 0U;
382}
383static inline u32 falcon_falcon_dmactl_r(void)
384{
385 return 0x0000010cU;
386}
387static inline u32 falcon_falcon_dmactl_dmem_scrubbing_m(void)
388{
389 return 0x1U << 1U;
390}
391static inline u32 falcon_falcon_dmactl_imem_scrubbing_m(void)
392{
393 return 0x1U << 2U;
394}
395static inline u32 falcon_falcon_dmactl_require_ctx_f(u32 v)
396{
397 return (v & 0x1U) << 0U;
398}
399static inline u32 falcon_falcon_hwcfg_r(void)
400{
401 return 0x00000108U;
402}
403static inline u32 falcon_falcon_hwcfg_imem_size_v(u32 r)
404{
405 return (r >> 0U) & 0x1ffU;
406}
407static inline u32 falcon_falcon_hwcfg_dmem_size_v(u32 r)
408{
409 return (r >> 9U) & 0x1ffU;
410}
411static inline u32 falcon_falcon_dmatrfbase_r(void)
412{
413 return 0x00000110U;
414}
415static inline u32 falcon_falcon_dmatrfbase1_r(void)
416{
417 return 0x00000128U;
418}
419static inline u32 falcon_falcon_dmatrfmoffs_r(void)
420{
421 return 0x00000114U;
422}
423static inline u32 falcon_falcon_imctl_debug_r(void)
424{
425 return 0x0000015cU;
426}
427static inline u32 falcon_falcon_imctl_debug_addr_blk_f(u32 v)
428{
429 return (v & 0xffffffU) << 0U;
430}
431static inline u32 falcon_falcon_imctl_debug_cmd_f(u32 v)
432{
433 return (v & 0x7U) << 24U;
434}
435static inline u32 falcon_falcon_imstat_r(void)
436{
437 return 0x00000144U;
438}
439static inline u32 falcon_falcon_traceidx_r(void)
440{
441 return 0x00000148U;
442}
443static inline u32 falcon_falcon_traceidx_maxidx_v(u32 r)
444{
445 return (r >> 16U) & 0xffU;
446}
447static inline u32 falcon_falcon_traceidx_idx_f(u32 v)
448{
449 return (v & 0xffU) << 0U;
450}
451static inline u32 falcon_falcon_tracepc_r(void)
452{
453 return 0x0000014cU;
454}
455static inline u32 falcon_falcon_tracepc_pc_v(u32 r)
456{
457 return (r >> 0U) & 0xffffffU;
458}
459static inline u32 falcon_falcon_dmatrfcmd_r(void)
460{
461 return 0x00000118U;
462}
463static inline u32 falcon_falcon_dmatrfcmd_imem_f(u32 v)
464{
465 return (v & 0x1U) << 4U;
466}
467static inline u32 falcon_falcon_dmatrfcmd_write_f(u32 v)
468{
469 return (v & 0x1U) << 5U;
470}
471static inline u32 falcon_falcon_dmatrfcmd_size_f(u32 v)
472{
473 return (v & 0x7U) << 8U;
474}
475static inline u32 falcon_falcon_dmatrfcmd_ctxdma_f(u32 v)
476{
477 return (v & 0x7U) << 12U;
478}
479static inline u32 falcon_falcon_dmatrffboffs_r(void)
480{
481 return 0x0000011cU;
482}
483static inline u32 falcon_falcon_exterraddr_r(void)
484{
485 return 0x00000168U;
486}
487static inline u32 falcon_falcon_exterrstat_r(void)
488{
489 return 0x0000016cU;
490}
491static inline u32 falcon_falcon_exterrstat_valid_m(void)
492{
493 return 0x1U << 31U;
494}
495static inline u32 falcon_falcon_exterrstat_valid_v(u32 r)
496{
497 return (r >> 31U) & 0x1U;
498}
499static inline u32 falcon_falcon_exterrstat_valid_true_v(void)
500{
501 return 0x00000001U;
502}
503static inline u32 falcon_falcon_icd_cmd_r(void)
504{
505 return 0x00000200U;
506}
507static inline u32 falcon_falcon_icd_cmd_opc_s(void)
508{
509 return 4U;
510}
511static inline u32 falcon_falcon_icd_cmd_opc_f(u32 v)
512{
513 return (v & 0xfU) << 0U;
514}
515static inline u32 falcon_falcon_icd_cmd_opc_m(void)
516{
517 return 0xfU << 0U;
518}
519static inline u32 falcon_falcon_icd_cmd_opc_v(u32 r)
520{
521 return (r >> 0U) & 0xfU;
522}
523static inline u32 falcon_falcon_icd_cmd_opc_rreg_f(void)
524{
525 return 0x8U;
526}
527static inline u32 falcon_falcon_icd_cmd_opc_rstat_f(void)
528{
529 return 0xeU;
530}
531static inline u32 falcon_falcon_icd_cmd_idx_f(u32 v)
532{
533 return (v & 0x1fU) << 8U;
534}
535static inline u32 falcon_falcon_icd_rdata_r(void)
536{
537 return 0x0000020cU;
538}
539static inline u32 falcon_falcon_dmemc_r(u32 i)
540{
541 return 0x000001c0U + i*8U;
542}
543static inline u32 falcon_falcon_dmemc_offs_f(u32 v)
544{
545 return (v & 0x3fU) << 2U;
546}
547static inline u32 falcon_falcon_dmemc_offs_m(void)
548{
549 return 0x3fU << 2U;
550}
551static inline u32 falcon_falcon_dmemc_blk_f(u32 v)
552{
553 return (v & 0xffU) << 8U;
554}
555static inline u32 falcon_falcon_dmemc_blk_m(void)
556{
557 return 0xffU << 8U;
558}
559static inline u32 falcon_falcon_dmemc_aincw_f(u32 v)
560{
561 return (v & 0x1U) << 24U;
562}
563static inline u32 falcon_falcon_dmemc_aincr_f(u32 v)
564{
565 return (v & 0x1U) << 25U;
566}
567static inline u32 falcon_falcon_dmemd_r(u32 i)
568{
569 return 0x000001c4U + i*8U;
570}
571static inline u32 falcon_falcon_debug1_r(void)
572{
573 return 0x00000090U;
574}
575static inline u32 falcon_falcon_debug1_ctxsw_mode_s(void)
576{
577 return 1U;
578}
579static inline u32 falcon_falcon_debug1_ctxsw_mode_f(u32 v)
580{
581 return (v & 0x1U) << 16U;
582}
583static inline u32 falcon_falcon_debug1_ctxsw_mode_m(void)
584{
585 return 0x1U << 16U;
586}
587static inline u32 falcon_falcon_debug1_ctxsw_mode_v(u32 r)
588{
589 return (r >> 16U) & 0x1U;
590}
591static inline u32 falcon_falcon_debug1_ctxsw_mode_init_f(void)
592{
593 return 0x0U;
594}
595static inline u32 falcon_falcon_debuginfo_r(void)
596{
597 return 0x00000094U;
598}
599#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_fb_gp10b.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_fb_gp10b.h
new file mode 100644
index 00000000..81a6f79c
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_fb_gp10b.h
@@ -0,0 +1,487 @@
1/*
2 * Copyright (c) 2014-2017, 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_fb_gp10b_h_
57#define _hw_fb_gp10b_h_
58
59static inline u32 fb_fbhub_num_active_ltcs_r(void)
60{
61 return 0x00100800U;
62}
63static inline u32 fb_mmu_ctrl_r(void)
64{
65 return 0x00100c80U;
66}
67static inline u32 fb_mmu_ctrl_vm_pg_size_f(u32 v)
68{
69 return (v & 0x1U) << 0U;
70}
71static inline u32 fb_mmu_ctrl_vm_pg_size_128kb_f(void)
72{
73 return 0x0U;
74}
75static inline u32 fb_mmu_ctrl_vm_pg_size_64kb_f(void)
76{
77 return 0x1U;
78}
79static inline u32 fb_mmu_ctrl_pri_fifo_empty_v(u32 r)
80{
81 return (r >> 15U) & 0x1U;
82}
83static inline u32 fb_mmu_ctrl_pri_fifo_empty_false_f(void)
84{
85 return 0x0U;
86}
87static inline u32 fb_mmu_ctrl_pri_fifo_space_v(u32 r)
88{
89 return (r >> 16U) & 0xffU;
90}
91static inline u32 fb_mmu_ctrl_use_pdb_big_page_size_v(u32 r)
92{
93 return (r >> 11U) & 0x1U;
94}
95static inline u32 fb_mmu_ctrl_use_pdb_big_page_size_true_f(void)
96{
97 return 0x800U;
98}
99static inline u32 fb_mmu_ctrl_use_pdb_big_page_size_false_f(void)
100{
101 return 0x0U;
102}
103static inline u32 fb_priv_mmu_phy_secure_r(void)
104{
105 return 0x00100ce4U;
106}
107static inline u32 fb_mmu_invalidate_pdb_r(void)
108{
109 return 0x00100cb8U;
110}
111static inline u32 fb_mmu_invalidate_pdb_aperture_vid_mem_f(void)
112{
113 return 0x0U;
114}
115static inline u32 fb_mmu_invalidate_pdb_aperture_sys_mem_f(void)
116{
117 return 0x2U;
118}
119static inline u32 fb_mmu_invalidate_pdb_addr_f(u32 v)
120{
121 return (v & 0xfffffffU) << 4U;
122}
123static inline u32 fb_mmu_invalidate_r(void)
124{
125 return 0x00100cbcU;
126}
127static inline u32 fb_mmu_invalidate_all_va_true_f(void)
128{
129 return 0x1U;
130}
131static inline u32 fb_mmu_invalidate_all_pdb_true_f(void)
132{
133 return 0x2U;
134}
135static inline u32 fb_mmu_invalidate_hubtlb_only_s(void)
136{
137 return 1U;
138}
139static inline u32 fb_mmu_invalidate_hubtlb_only_f(u32 v)
140{
141 return (v & 0x1U) << 2U;
142}
143static inline u32 fb_mmu_invalidate_hubtlb_only_m(void)
144{
145 return 0x1U << 2U;
146}
147static inline u32 fb_mmu_invalidate_hubtlb_only_v(u32 r)
148{
149 return (r >> 2U) & 0x1U;
150}
151static inline u32 fb_mmu_invalidate_hubtlb_only_true_f(void)
152{
153 return 0x4U;
154}
155static inline u32 fb_mmu_invalidate_replay_s(void)
156{
157 return 3U;
158}
159static inline u32 fb_mmu_invalidate_replay_f(u32 v)
160{
161 return (v & 0x7U) << 3U;
162}
163static inline u32 fb_mmu_invalidate_replay_m(void)
164{
165 return 0x7U << 3U;
166}
167static inline u32 fb_mmu_invalidate_replay_v(u32 r)
168{
169 return (r >> 3U) & 0x7U;
170}
171static inline u32 fb_mmu_invalidate_replay_none_f(void)
172{
173 return 0x0U;
174}
175static inline u32 fb_mmu_invalidate_replay_start_f(void)
176{
177 return 0x8U;
178}
179static inline u32 fb_mmu_invalidate_replay_start_ack_all_f(void)
180{
181 return 0x10U;
182}
183static inline u32 fb_mmu_invalidate_replay_cancel_targeted_f(void)
184{
185 return 0x18U;
186}
187static inline u32 fb_mmu_invalidate_replay_cancel_global_f(void)
188{
189 return 0x20U;
190}
191static inline u32 fb_mmu_invalidate_replay_cancel_f(void)
192{
193 return 0x20U;
194}
195static inline u32 fb_mmu_invalidate_sys_membar_s(void)
196{
197 return 1U;
198}
199static inline u32 fb_mmu_invalidate_sys_membar_f(u32 v)
200{
201 return (v & 0x1U) << 6U;
202}
203static inline u32 fb_mmu_invalidate_sys_membar_m(void)
204{
205 return 0x1U << 6U;
206}
207static inline u32 fb_mmu_invalidate_sys_membar_v(u32 r)
208{
209 return (r >> 6U) & 0x1U;
210}
211static inline u32 fb_mmu_invalidate_sys_membar_true_f(void)
212{
213 return 0x40U;
214}
215static inline u32 fb_mmu_invalidate_ack_s(void)
216{
217 return 2U;
218}
219static inline u32 fb_mmu_invalidate_ack_f(u32 v)
220{
221 return (v & 0x3U) << 7U;
222}
223static inline u32 fb_mmu_invalidate_ack_m(void)
224{
225 return 0x3U << 7U;
226}
227static inline u32 fb_mmu_invalidate_ack_v(u32 r)
228{
229 return (r >> 7U) & 0x3U;
230}
231static inline u32 fb_mmu_invalidate_ack_ack_none_required_f(void)
232{
233 return 0x0U;
234}
235static inline u32 fb_mmu_invalidate_ack_ack_intranode_f(void)
236{
237 return 0x100U;
238}
239static inline u32 fb_mmu_invalidate_ack_ack_globally_f(void)
240{
241 return 0x80U;
242}
243static inline u32 fb_mmu_invalidate_cancel_client_id_s(void)
244{
245 return 6U;
246}
247static inline u32 fb_mmu_invalidate_cancel_client_id_f(u32 v)
248{
249 return (v & 0x3fU) << 9U;
250}
251static inline u32 fb_mmu_invalidate_cancel_client_id_m(void)
252{
253 return 0x3fU << 9U;
254}
255static inline u32 fb_mmu_invalidate_cancel_client_id_v(u32 r)
256{
257 return (r >> 9U) & 0x3fU;
258}
259static inline u32 fb_mmu_invalidate_cancel_gpc_id_s(void)
260{
261 return 5U;
262}
263static inline u32 fb_mmu_invalidate_cancel_gpc_id_f(u32 v)
264{
265 return (v & 0x1fU) << 15U;
266}
267static inline u32 fb_mmu_invalidate_cancel_gpc_id_m(void)
268{
269 return 0x1fU << 15U;
270}
271static inline u32 fb_mmu_invalidate_cancel_gpc_id_v(u32 r)
272{
273 return (r >> 15U) & 0x1fU;
274}
275static inline u32 fb_mmu_invalidate_cancel_client_type_s(void)
276{
277 return 1U;
278}
279static inline u32 fb_mmu_invalidate_cancel_client_type_f(u32 v)
280{
281 return (v & 0x1U) << 20U;
282}
283static inline u32 fb_mmu_invalidate_cancel_client_type_m(void)
284{
285 return 0x1U << 20U;
286}
287static inline u32 fb_mmu_invalidate_cancel_client_type_v(u32 r)
288{
289 return (r >> 20U) & 0x1U;
290}
291static inline u32 fb_mmu_invalidate_cancel_client_type_gpc_f(void)
292{
293 return 0x0U;
294}
295static inline u32 fb_mmu_invalidate_cancel_client_type_hub_f(void)
296{
297 return 0x100000U;
298}
299static inline u32 fb_mmu_invalidate_cancel_cache_level_s(void)
300{
301 return 3U;
302}
303static inline u32 fb_mmu_invalidate_cancel_cache_level_f(u32 v)
304{
305 return (v & 0x7U) << 24U;
306}
307static inline u32 fb_mmu_invalidate_cancel_cache_level_m(void)
308{
309 return 0x7U << 24U;
310}
311static inline u32 fb_mmu_invalidate_cancel_cache_level_v(u32 r)
312{
313 return (r >> 24U) & 0x7U;
314}
315static inline u32 fb_mmu_invalidate_cancel_cache_level_all_f(void)
316{
317 return 0x0U;
318}
319static inline u32 fb_mmu_invalidate_cancel_cache_level_pte_only_f(void)
320{
321 return 0x1000000U;
322}
323static inline u32 fb_mmu_invalidate_cancel_cache_level_up_to_pde0_f(void)
324{
325 return 0x2000000U;
326}
327static inline u32 fb_mmu_invalidate_cancel_cache_level_up_to_pde1_f(void)
328{
329 return 0x3000000U;
330}
331static inline u32 fb_mmu_invalidate_cancel_cache_level_up_to_pde2_f(void)
332{
333 return 0x4000000U;
334}
335static inline u32 fb_mmu_invalidate_cancel_cache_level_up_to_pde3_f(void)
336{
337 return 0x5000000U;
338}
339static inline u32 fb_mmu_invalidate_cancel_cache_level_up_to_pde4_f(void)
340{
341 return 0x6000000U;
342}
343static inline u32 fb_mmu_invalidate_cancel_cache_level_up_to_pde5_f(void)
344{
345 return 0x7000000U;
346}
347static inline u32 fb_mmu_invalidate_trigger_s(void)
348{
349 return 1U;
350}
351static inline u32 fb_mmu_invalidate_trigger_f(u32 v)
352{
353 return (v & 0x1U) << 31U;
354}
355static inline u32 fb_mmu_invalidate_trigger_m(void)
356{
357 return 0x1U << 31U;
358}
359static inline u32 fb_mmu_invalidate_trigger_v(u32 r)
360{
361 return (r >> 31U) & 0x1U;
362}
363static inline u32 fb_mmu_invalidate_trigger_true_f(void)
364{
365 return 0x80000000U;
366}
367static inline u32 fb_mmu_debug_wr_r(void)
368{
369 return 0x00100cc8U;
370}
371static inline u32 fb_mmu_debug_wr_aperture_s(void)
372{
373 return 2U;
374}
375static inline u32 fb_mmu_debug_wr_aperture_f(u32 v)
376{
377 return (v & 0x3U) << 0U;
378}
379static inline u32 fb_mmu_debug_wr_aperture_m(void)
380{
381 return 0x3U << 0U;
382}
383static inline u32 fb_mmu_debug_wr_aperture_v(u32 r)
384{
385 return (r >> 0U) & 0x3U;
386}
387static inline u32 fb_mmu_debug_wr_aperture_vid_mem_f(void)
388{
389 return 0x0U;
390}
391static inline u32 fb_mmu_debug_wr_aperture_sys_mem_coh_f(void)
392{
393 return 0x2U;
394}
395static inline u32 fb_mmu_debug_wr_aperture_sys_mem_ncoh_f(void)
396{
397 return 0x3U;
398}
399static inline u32 fb_mmu_debug_wr_vol_false_f(void)
400{
401 return 0x0U;
402}
403static inline u32 fb_mmu_debug_wr_vol_true_v(void)
404{
405 return 0x00000001U;
406}
407static inline u32 fb_mmu_debug_wr_vol_true_f(void)
408{
409 return 0x4U;
410}
411static inline u32 fb_mmu_debug_wr_addr_f(u32 v)
412{
413 return (v & 0xfffffffU) << 4U;
414}
415static inline u32 fb_mmu_debug_wr_addr_alignment_v(void)
416{
417 return 0x0000000cU;
418}
419static inline u32 fb_mmu_debug_rd_r(void)
420{
421 return 0x00100cccU;
422}
423static inline u32 fb_mmu_debug_rd_aperture_vid_mem_f(void)
424{
425 return 0x0U;
426}
427static inline u32 fb_mmu_debug_rd_aperture_sys_mem_coh_f(void)
428{
429 return 0x2U;
430}
431static inline u32 fb_mmu_debug_rd_aperture_sys_mem_ncoh_f(void)
432{
433 return 0x3U;
434}
435static inline u32 fb_mmu_debug_rd_vol_false_f(void)
436{
437 return 0x0U;
438}
439static inline u32 fb_mmu_debug_rd_addr_f(u32 v)
440{
441 return (v & 0xfffffffU) << 4U;
442}
443static inline u32 fb_mmu_debug_rd_addr_alignment_v(void)
444{
445 return 0x0000000cU;
446}
447static inline u32 fb_mmu_debug_ctrl_r(void)
448{
449 return 0x00100cc4U;
450}
451static inline u32 fb_mmu_debug_ctrl_debug_v(u32 r)
452{
453 return (r >> 16U) & 0x1U;
454}
455static inline u32 fb_mmu_debug_ctrl_debug_m(void)
456{
457 return 0x1U << 16U;
458}
459static inline u32 fb_mmu_debug_ctrl_debug_enabled_v(void)
460{
461 return 0x00000001U;
462}
463static inline u32 fb_mmu_debug_ctrl_debug_disabled_v(void)
464{
465 return 0x00000000U;
466}
467static inline u32 fb_mmu_vpr_info_r(void)
468{
469 return 0x00100cd0U;
470}
471static inline u32 fb_mmu_vpr_info_fetch_v(u32 r)
472{
473 return (r >> 2U) & 0x1U;
474}
475static inline u32 fb_mmu_vpr_info_fetch_false_v(void)
476{
477 return 0x00000000U;
478}
479static inline u32 fb_mmu_vpr_info_fetch_true_v(void)
480{
481 return 0x00000001U;
482}
483static inline u32 fb_niso_flush_sysmem_addr_r(void)
484{
485 return 0x00100c10U;
486}
487#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_fifo_gp10b.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_fifo_gp10b.h
new file mode 100644
index 00000000..71701626
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_fifo_gp10b.h
@@ -0,0 +1,699 @@
1/*
2 * Copyright (c) 2014-2017, 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_fifo_gp10b_h_
57#define _hw_fifo_gp10b_h_
58
59static inline u32 fifo_bar1_base_r(void)
60{
61 return 0x00002254U;
62}
63static inline u32 fifo_bar1_base_ptr_f(u32 v)
64{
65 return (v & 0xfffffffU) << 0U;
66}
67static inline u32 fifo_bar1_base_ptr_align_shift_v(void)
68{
69 return 0x0000000cU;
70}
71static inline u32 fifo_bar1_base_valid_false_f(void)
72{
73 return 0x0U;
74}
75static inline u32 fifo_bar1_base_valid_true_f(void)
76{
77 return 0x10000000U;
78}
79static inline u32 fifo_runlist_base_r(void)
80{
81 return 0x00002270U;
82}
83static inline u32 fifo_runlist_base_ptr_f(u32 v)
84{
85 return (v & 0xfffffffU) << 0U;
86}
87static inline u32 fifo_runlist_base_target_vid_mem_f(void)
88{
89 return 0x0U;
90}
91static inline u32 fifo_runlist_base_target_sys_mem_coh_f(void)
92{
93 return 0x20000000U;
94}
95static inline u32 fifo_runlist_base_target_sys_mem_ncoh_f(void)
96{
97 return 0x30000000U;
98}
99static inline u32 fifo_runlist_r(void)
100{
101 return 0x00002274U;
102}
103static inline u32 fifo_runlist_engine_f(u32 v)
104{
105 return (v & 0xfU) << 20U;
106}
107static inline u32 fifo_eng_runlist_base_r(u32 i)
108{
109 return 0x00002280U + i*8U;
110}
111static inline u32 fifo_eng_runlist_base__size_1_v(void)
112{
113 return 0x00000001U;
114}
115static inline u32 fifo_eng_runlist_r(u32 i)
116{
117 return 0x00002284U + i*8U;
118}
119static inline u32 fifo_eng_runlist__size_1_v(void)
120{
121 return 0x00000001U;
122}
123static inline u32 fifo_eng_runlist_length_f(u32 v)
124{
125 return (v & 0xffffU) << 0U;
126}
127static inline u32 fifo_eng_runlist_length_max_v(void)
128{
129 return 0x0000ffffU;
130}
131static inline u32 fifo_eng_runlist_pending_true_f(void)
132{
133 return 0x100000U;
134}
135static inline u32 fifo_pb_timeslice_r(u32 i)
136{
137 return 0x00002350U + i*4U;
138}
139static inline u32 fifo_pb_timeslice_timeout_16_f(void)
140{
141 return 0x10U;
142}
143static inline u32 fifo_pb_timeslice_timescale_0_f(void)
144{
145 return 0x0U;
146}
147static inline u32 fifo_pb_timeslice_enable_true_f(void)
148{
149 return 0x10000000U;
150}
151static inline u32 fifo_pbdma_map_r(u32 i)
152{
153 return 0x00002390U + i*4U;
154}
155static inline u32 fifo_intr_0_r(void)
156{
157 return 0x00002100U;
158}
159static inline u32 fifo_intr_0_bind_error_pending_f(void)
160{
161 return 0x1U;
162}
163static inline u32 fifo_intr_0_bind_error_reset_f(void)
164{
165 return 0x1U;
166}
167static inline u32 fifo_intr_0_sched_error_pending_f(void)
168{
169 return 0x100U;
170}
171static inline u32 fifo_intr_0_sched_error_reset_f(void)
172{
173 return 0x100U;
174}
175static inline u32 fifo_intr_0_chsw_error_pending_f(void)
176{
177 return 0x10000U;
178}
179static inline u32 fifo_intr_0_chsw_error_reset_f(void)
180{
181 return 0x10000U;
182}
183static inline u32 fifo_intr_0_fb_flush_timeout_pending_f(void)
184{
185 return 0x800000U;
186}
187static inline u32 fifo_intr_0_fb_flush_timeout_reset_f(void)
188{
189 return 0x800000U;
190}
191static inline u32 fifo_intr_0_lb_error_pending_f(void)
192{
193 return 0x1000000U;
194}
195static inline u32 fifo_intr_0_lb_error_reset_f(void)
196{
197 return 0x1000000U;
198}
199static inline u32 fifo_intr_0_replayable_fault_error_pending_f(void)
200{
201 return 0x2000000U;
202}
203static inline u32 fifo_intr_0_dropped_mmu_fault_pending_f(void)
204{
205 return 0x8000000U;
206}
207static inline u32 fifo_intr_0_dropped_mmu_fault_reset_f(void)
208{
209 return 0x8000000U;
210}
211static inline u32 fifo_intr_0_mmu_fault_pending_f(void)
212{
213 return 0x10000000U;
214}
215static inline u32 fifo_intr_0_pbdma_intr_pending_f(void)
216{
217 return 0x20000000U;
218}
219static inline u32 fifo_intr_0_runlist_event_pending_f(void)
220{
221 return 0x40000000U;
222}
223static inline u32 fifo_intr_0_channel_intr_pending_f(void)
224{
225 return 0x80000000U;
226}
227static inline u32 fifo_intr_en_0_r(void)
228{
229 return 0x00002140U;
230}
231static inline u32 fifo_intr_en_0_sched_error_f(u32 v)
232{
233 return (v & 0x1U) << 8U;
234}
235static inline u32 fifo_intr_en_0_sched_error_m(void)
236{
237 return 0x1U << 8U;
238}
239static inline u32 fifo_intr_en_0_mmu_fault_f(u32 v)
240{
241 return (v & 0x1U) << 28U;
242}
243static inline u32 fifo_intr_en_0_mmu_fault_m(void)
244{
245 return 0x1U << 28U;
246}
247static inline u32 fifo_intr_en_1_r(void)
248{
249 return 0x00002528U;
250}
251static inline u32 fifo_intr_bind_error_r(void)
252{
253 return 0x0000252cU;
254}
255static inline u32 fifo_intr_sched_error_r(void)
256{
257 return 0x0000254cU;
258}
259static inline u32 fifo_intr_sched_error_code_f(u32 v)
260{
261 return (v & 0xffU) << 0U;
262}
263static inline u32 fifo_intr_sched_error_code_ctxsw_timeout_v(void)
264{
265 return 0x0000000aU;
266}
267static inline u32 fifo_intr_chsw_error_r(void)
268{
269 return 0x0000256cU;
270}
271static inline u32 fifo_intr_mmu_fault_id_r(void)
272{
273 return 0x0000259cU;
274}
275static inline u32 fifo_intr_mmu_fault_eng_id_graphics_v(void)
276{
277 return 0x00000000U;
278}
279static inline u32 fifo_intr_mmu_fault_eng_id_graphics_f(void)
280{
281 return 0x0U;
282}
283static inline u32 fifo_intr_mmu_fault_inst_r(u32 i)
284{
285 return 0x00002800U + i*16U;
286}
287static inline u32 fifo_intr_mmu_fault_inst_ptr_v(u32 r)
288{
289 return (r >> 0U) & 0xfffffffU;
290}
291static inline u32 fifo_intr_mmu_fault_inst_ptr_align_shift_v(void)
292{
293 return 0x0000000cU;
294}
295static inline u32 fifo_intr_mmu_fault_lo_r(u32 i)
296{
297 return 0x00002804U + i*16U;
298}
299static inline u32 fifo_intr_mmu_fault_hi_r(u32 i)
300{
301 return 0x00002808U + i*16U;
302}
303static inline u32 fifo_intr_mmu_fault_info_r(u32 i)
304{
305 return 0x0000280cU + i*16U;
306}
307static inline u32 fifo_intr_mmu_fault_info_type_v(u32 r)
308{
309 return (r >> 0U) & 0x1fU;
310}
311static inline u32 fifo_intr_mmu_fault_info_access_type_v(u32 r)
312{
313 return (r >> 16U) & 0x7U;
314}
315static inline u32 fifo_intr_mmu_fault_info_client_type_v(u32 r)
316{
317 return (r >> 20U) & 0x1U;
318}
319static inline u32 fifo_intr_mmu_fault_info_client_type_gpc_v(void)
320{
321 return 0x00000000U;
322}
323static inline u32 fifo_intr_mmu_fault_info_client_type_hub_v(void)
324{
325 return 0x00000001U;
326}
327static inline u32 fifo_intr_mmu_fault_info_client_v(u32 r)
328{
329 return (r >> 8U) & 0x7fU;
330}
331static inline u32 fifo_intr_pbdma_id_r(void)
332{
333 return 0x000025a0U;
334}
335static inline u32 fifo_intr_pbdma_id_status_f(u32 v, u32 i)
336{
337 return (v & 0x1U) << (0U + i*1U);
338}
339static inline u32 fifo_intr_pbdma_id_status_v(u32 r, u32 i)
340{
341 return (r >> (0U + i*1U)) & 0x1U;
342}
343static inline u32 fifo_intr_pbdma_id_status__size_1_v(void)
344{
345 return 0x00000001U;
346}
347static inline u32 fifo_intr_runlist_r(void)
348{
349 return 0x00002a00U;
350}
351static inline u32 fifo_fb_timeout_r(void)
352{
353 return 0x00002a04U;
354}
355static inline u32 fifo_fb_timeout_period_m(void)
356{
357 return 0x3fffffffU << 0U;
358}
359static inline u32 fifo_fb_timeout_period_max_f(void)
360{
361 return 0x3fffffffU;
362}
363static inline u32 fifo_error_sched_disable_r(void)
364{
365 return 0x0000262cU;
366}
367static inline u32 fifo_sched_disable_r(void)
368{
369 return 0x00002630U;
370}
371static inline u32 fifo_sched_disable_runlist_f(u32 v, u32 i)
372{
373 return (v & 0x1U) << (0U + i*1U);
374}
375static inline u32 fifo_sched_disable_runlist_m(u32 i)
376{
377 return 0x1U << (0U + i*1U);
378}
379static inline u32 fifo_sched_disable_true_v(void)
380{
381 return 0x00000001U;
382}
383static inline u32 fifo_preempt_r(void)
384{
385 return 0x00002634U;
386}
387static inline u32 fifo_preempt_pending_true_f(void)
388{
389 return 0x100000U;
390}
391static inline u32 fifo_preempt_type_channel_f(void)
392{
393 return 0x0U;
394}
395static inline u32 fifo_preempt_type_tsg_f(void)
396{
397 return 0x1000000U;
398}
399static inline u32 fifo_preempt_chid_f(u32 v)
400{
401 return (v & 0xfffU) << 0U;
402}
403static inline u32 fifo_preempt_id_f(u32 v)
404{
405 return (v & 0xfffU) << 0U;
406}
407static inline u32 fifo_trigger_mmu_fault_r(u32 i)
408{
409 return 0x00002a30U + i*4U;
410}
411static inline u32 fifo_trigger_mmu_fault_id_f(u32 v)
412{
413 return (v & 0x1fU) << 0U;
414}
415static inline u32 fifo_trigger_mmu_fault_enable_f(u32 v)
416{
417 return (v & 0x1U) << 8U;
418}
419static inline u32 fifo_engine_status_r(u32 i)
420{
421 return 0x00002640U + i*8U;
422}
423static inline u32 fifo_engine_status__size_1_v(void)
424{
425 return 0x00000002U;
426}
427static inline u32 fifo_engine_status_id_v(u32 r)
428{
429 return (r >> 0U) & 0xfffU;
430}
431static inline u32 fifo_engine_status_id_type_v(u32 r)
432{
433 return (r >> 12U) & 0x1U;
434}
435static inline u32 fifo_engine_status_id_type_chid_v(void)
436{
437 return 0x00000000U;
438}
439static inline u32 fifo_engine_status_id_type_tsgid_v(void)
440{
441 return 0x00000001U;
442}
443static inline u32 fifo_engine_status_ctx_status_v(u32 r)
444{
445 return (r >> 13U) & 0x7U;
446}
447static inline u32 fifo_engine_status_ctx_status_invalid_v(void)
448{
449 return 0x00000000U;
450}
451static inline u32 fifo_engine_status_ctx_status_valid_v(void)
452{
453 return 0x00000001U;
454}
455static inline u32 fifo_engine_status_ctx_status_ctxsw_load_v(void)
456{
457 return 0x00000005U;
458}
459static inline u32 fifo_engine_status_ctx_status_ctxsw_save_v(void)
460{
461 return 0x00000006U;
462}
463static inline u32 fifo_engine_status_ctx_status_ctxsw_switch_v(void)
464{
465 return 0x00000007U;
466}
467static inline u32 fifo_engine_status_next_id_v(u32 r)
468{
469 return (r >> 16U) & 0xfffU;
470}
471static inline u32 fifo_engine_status_next_id_type_v(u32 r)
472{
473 return (r >> 28U) & 0x1U;
474}
475static inline u32 fifo_engine_status_next_id_type_chid_v(void)
476{
477 return 0x00000000U;
478}
479static inline u32 fifo_engine_status_faulted_v(u32 r)
480{
481 return (r >> 30U) & 0x1U;
482}
483static inline u32 fifo_engine_status_faulted_true_v(void)
484{
485 return 0x00000001U;
486}
487static inline u32 fifo_engine_status_engine_v(u32 r)
488{
489 return (r >> 31U) & 0x1U;
490}
491static inline u32 fifo_engine_status_engine_idle_v(void)
492{
493 return 0x00000000U;
494}
495static inline u32 fifo_engine_status_engine_busy_v(void)
496{
497 return 0x00000001U;
498}
499static inline u32 fifo_engine_status_ctxsw_v(u32 r)
500{
501 return (r >> 15U) & 0x1U;
502}
503static inline u32 fifo_engine_status_ctxsw_in_progress_v(void)
504{
505 return 0x00000001U;
506}
507static inline u32 fifo_engine_status_ctxsw_in_progress_f(void)
508{
509 return 0x8000U;
510}
511static inline u32 fifo_pbdma_status_r(u32 i)
512{
513 return 0x00003080U + i*4U;
514}
515static inline u32 fifo_pbdma_status__size_1_v(void)
516{
517 return 0x00000001U;
518}
519static inline u32 fifo_pbdma_status_id_v(u32 r)
520{
521 return (r >> 0U) & 0xfffU;
522}
523static inline u32 fifo_pbdma_status_id_type_v(u32 r)
524{
525 return (r >> 12U) & 0x1U;
526}
527static inline u32 fifo_pbdma_status_id_type_chid_v(void)
528{
529 return 0x00000000U;
530}
531static inline u32 fifo_pbdma_status_id_type_tsgid_v(void)
532{
533 return 0x00000001U;
534}
535static inline u32 fifo_pbdma_status_chan_status_v(u32 r)
536{
537 return (r >> 13U) & 0x7U;
538}
539static inline u32 fifo_pbdma_status_chan_status_valid_v(void)
540{
541 return 0x00000001U;
542}
543static inline u32 fifo_pbdma_status_chan_status_chsw_load_v(void)
544{
545 return 0x00000005U;
546}
547static inline u32 fifo_pbdma_status_chan_status_chsw_save_v(void)
548{
549 return 0x00000006U;
550}
551static inline u32 fifo_pbdma_status_chan_status_chsw_switch_v(void)
552{
553 return 0x00000007U;
554}
555static inline u32 fifo_pbdma_status_next_id_v(u32 r)
556{
557 return (r >> 16U) & 0xfffU;
558}
559static inline u32 fifo_pbdma_status_next_id_type_v(u32 r)
560{
561 return (r >> 28U) & 0x1U;
562}
563static inline u32 fifo_pbdma_status_next_id_type_chid_v(void)
564{
565 return 0x00000000U;
566}
567static inline u32 fifo_pbdma_status_chsw_v(u32 r)
568{
569 return (r >> 15U) & 0x1U;
570}
571static inline u32 fifo_pbdma_status_chsw_in_progress_v(void)
572{
573 return 0x00000001U;
574}
575static inline u32 fifo_replay_fault_buffer_lo_r(void)
576{
577 return 0x00002a70U;
578}
579static inline u32 fifo_replay_fault_buffer_lo_enable_v(u32 r)
580{
581 return (r >> 0U) & 0x1U;
582}
583static inline u32 fifo_replay_fault_buffer_lo_enable_true_v(void)
584{
585 return 0x00000001U;
586}
587static inline u32 fifo_replay_fault_buffer_lo_enable_false_v(void)
588{
589 return 0x00000000U;
590}
591static inline u32 fifo_replay_fault_buffer_lo_base_f(u32 v)
592{
593 return (v & 0xfffffU) << 12U;
594}
595static inline u32 fifo_replay_fault_buffer_lo_base_reset_v(void)
596{
597 return 0x00000000U;
598}
599static inline u32 fifo_replay_fault_buffer_hi_r(void)
600{
601 return 0x00002a74U;
602}
603static inline u32 fifo_replay_fault_buffer_hi_base_f(u32 v)
604{
605 return (v & 0xffU) << 0U;
606}
607static inline u32 fifo_replay_fault_buffer_hi_base_reset_v(void)
608{
609 return 0x00000000U;
610}
611static inline u32 fifo_replay_fault_buffer_size_r(void)
612{
613 return 0x00002a78U;
614}
615static inline u32 fifo_replay_fault_buffer_size_hw_f(u32 v)
616{
617 return (v & 0x1ffU) << 0U;
618}
619static inline u32 fifo_replay_fault_buffer_size_hw_entries_v(void)
620{
621 return 0x000000c0U;
622}
623static inline u32 fifo_replay_fault_buffer_get_r(void)
624{
625 return 0x00002a7cU;
626}
627static inline u32 fifo_replay_fault_buffer_get_offset_hw_f(u32 v)
628{
629 return (v & 0x1ffU) << 0U;
630}
631static inline u32 fifo_replay_fault_buffer_get_offset_hw_init_v(void)
632{
633 return 0x00000000U;
634}
635static inline u32 fifo_replay_fault_buffer_put_r(void)
636{
637 return 0x00002a80U;
638}
639static inline u32 fifo_replay_fault_buffer_put_offset_hw_f(u32 v)
640{
641 return (v & 0x1ffU) << 0U;
642}
643static inline u32 fifo_replay_fault_buffer_put_offset_hw_init_v(void)
644{
645 return 0x00000000U;
646}
647static inline u32 fifo_replay_fault_buffer_info_r(void)
648{
649 return 0x00002a84U;
650}
651static inline u32 fifo_replay_fault_buffer_info_overflow_f(u32 v)
652{
653 return (v & 0x1U) << 0U;
654}
655static inline u32 fifo_replay_fault_buffer_info_overflow_false_v(void)
656{
657 return 0x00000000U;
658}
659static inline u32 fifo_replay_fault_buffer_info_overflow_true_v(void)
660{
661 return 0x00000001U;
662}
663static inline u32 fifo_replay_fault_buffer_info_overflow_clear_v(void)
664{
665 return 0x00000001U;
666}
667static inline u32 fifo_replay_fault_buffer_info_write_nack_f(u32 v)
668{
669 return (v & 0x1U) << 24U;
670}
671static inline u32 fifo_replay_fault_buffer_info_write_nack_false_v(void)
672{
673 return 0x00000000U;
674}
675static inline u32 fifo_replay_fault_buffer_info_write_nack_true_v(void)
676{
677 return 0x00000001U;
678}
679static inline u32 fifo_replay_fault_buffer_info_write_nack_clear_v(void)
680{
681 return 0x00000001U;
682}
683static inline u32 fifo_replay_fault_buffer_info_fault_while_buffer_disabled_f(u32 v)
684{
685 return (v & 0x1U) << 28U;
686}
687static inline u32 fifo_replay_fault_buffer_info_fault_while_buffer_disabled_false_v(void)
688{
689 return 0x00000000U;
690}
691static inline u32 fifo_replay_fault_buffer_info_fault_while_buffer_disabled_true_v(void)
692{
693 return 0x00000001U;
694}
695static inline u32 fifo_replay_fault_buffer_info_fault_while_buffer_disabled_clear_v(void)
696{
697 return 0x00000001U;
698}
699#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_flush_gp10b.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_flush_gp10b.h
new file mode 100644
index 00000000..ae6eabf1
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_flush_gp10b.h
@@ -0,0 +1,187 @@
1/*
2 * Copyright (c) 2014-2017, 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_flush_gp10b_h_
57#define _hw_flush_gp10b_h_
58
59static inline u32 flush_l2_system_invalidate_r(void)
60{
61 return 0x00070004U;
62}
63static inline u32 flush_l2_system_invalidate_pending_v(u32 r)
64{
65 return (r >> 0U) & 0x1U;
66}
67static inline u32 flush_l2_system_invalidate_pending_busy_v(void)
68{
69 return 0x00000001U;
70}
71static inline u32 flush_l2_system_invalidate_pending_busy_f(void)
72{
73 return 0x1U;
74}
75static inline u32 flush_l2_system_invalidate_outstanding_v(u32 r)
76{
77 return (r >> 1U) & 0x1U;
78}
79static inline u32 flush_l2_system_invalidate_outstanding_true_v(void)
80{
81 return 0x00000001U;
82}
83static inline u32 flush_l2_flush_dirty_r(void)
84{
85 return 0x00070010U;
86}
87static inline u32 flush_l2_flush_dirty_pending_v(u32 r)
88{
89 return (r >> 0U) & 0x1U;
90}
91static inline u32 flush_l2_flush_dirty_pending_empty_v(void)
92{
93 return 0x00000000U;
94}
95static inline u32 flush_l2_flush_dirty_pending_empty_f(void)
96{
97 return 0x0U;
98}
99static inline u32 flush_l2_flush_dirty_pending_busy_v(void)
100{
101 return 0x00000001U;
102}
103static inline u32 flush_l2_flush_dirty_pending_busy_f(void)
104{
105 return 0x1U;
106}
107static inline u32 flush_l2_flush_dirty_outstanding_v(u32 r)
108{
109 return (r >> 1U) & 0x1U;
110}
111static inline u32 flush_l2_flush_dirty_outstanding_false_v(void)
112{
113 return 0x00000000U;
114}
115static inline u32 flush_l2_flush_dirty_outstanding_false_f(void)
116{
117 return 0x0U;
118}
119static inline u32 flush_l2_flush_dirty_outstanding_true_v(void)
120{
121 return 0x00000001U;
122}
123static inline u32 flush_l2_clean_comptags_r(void)
124{
125 return 0x0007000cU;
126}
127static inline u32 flush_l2_clean_comptags_pending_v(u32 r)
128{
129 return (r >> 0U) & 0x1U;
130}
131static inline u32 flush_l2_clean_comptags_pending_empty_v(void)
132{
133 return 0x00000000U;
134}
135static inline u32 flush_l2_clean_comptags_pending_empty_f(void)
136{
137 return 0x0U;
138}
139static inline u32 flush_l2_clean_comptags_pending_busy_v(void)
140{
141 return 0x00000001U;
142}
143static inline u32 flush_l2_clean_comptags_pending_busy_f(void)
144{
145 return 0x1U;
146}
147static inline u32 flush_l2_clean_comptags_outstanding_v(u32 r)
148{
149 return (r >> 1U) & 0x1U;
150}
151static inline u32 flush_l2_clean_comptags_outstanding_false_v(void)
152{
153 return 0x00000000U;
154}
155static inline u32 flush_l2_clean_comptags_outstanding_false_f(void)
156{
157 return 0x0U;
158}
159static inline u32 flush_l2_clean_comptags_outstanding_true_v(void)
160{
161 return 0x00000001U;
162}
163static inline u32 flush_fb_flush_r(void)
164{
165 return 0x00070000U;
166}
167static inline u32 flush_fb_flush_pending_v(u32 r)
168{
169 return (r >> 0U) & 0x1U;
170}
171static inline u32 flush_fb_flush_pending_busy_v(void)
172{
173 return 0x00000001U;
174}
175static inline u32 flush_fb_flush_pending_busy_f(void)
176{
177 return 0x1U;
178}
179static inline u32 flush_fb_flush_outstanding_v(u32 r)
180{
181 return (r >> 1U) & 0x1U;
182}
183static inline u32 flush_fb_flush_outstanding_true_v(void)
184{
185 return 0x00000001U;
186}
187#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_fuse_gp10b.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_fuse_gp10b.h
new file mode 100644
index 00000000..29107fb8
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_fuse_gp10b.h
@@ -0,0 +1,151 @@
1/*
2 * Copyright (c) 2014-2017, 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_fuse_gp10b_h_
57#define _hw_fuse_gp10b_h_
58
59static inline u32 fuse_status_opt_tpc_gpc_r(u32 i)
60{
61 return 0x00021c38U + i*4U;
62}
63static inline u32 fuse_ctrl_opt_tpc_gpc_r(u32 i)
64{
65 return 0x00021838U + i*4U;
66}
67static inline u32 fuse_ctrl_opt_ram_svop_pdp_r(void)
68{
69 return 0x00021944U;
70}
71static inline u32 fuse_ctrl_opt_ram_svop_pdp_data_f(u32 v)
72{
73 return (v & 0xffU) << 0U;
74}
75static inline u32 fuse_ctrl_opt_ram_svop_pdp_data_m(void)
76{
77 return 0xffU << 0U;
78}
79static inline u32 fuse_ctrl_opt_ram_svop_pdp_data_v(u32 r)
80{
81 return (r >> 0U) & 0xffU;
82}
83static inline u32 fuse_ctrl_opt_ram_svop_pdp_override_r(void)
84{
85 return 0x00021948U;
86}
87static inline u32 fuse_ctrl_opt_ram_svop_pdp_override_data_f(u32 v)
88{
89 return (v & 0x1U) << 0U;
90}
91static inline u32 fuse_ctrl_opt_ram_svop_pdp_override_data_m(void)
92{
93 return 0x1U << 0U;
94}
95static inline u32 fuse_ctrl_opt_ram_svop_pdp_override_data_v(u32 r)
96{
97 return (r >> 0U) & 0x1U;
98}
99static inline u32 fuse_ctrl_opt_ram_svop_pdp_override_data_yes_f(void)
100{
101 return 0x1U;
102}
103static inline u32 fuse_ctrl_opt_ram_svop_pdp_override_data_no_f(void)
104{
105 return 0x0U;
106}
107static inline u32 fuse_status_opt_fbio_r(void)
108{
109 return 0x00021c14U;
110}
111static inline u32 fuse_status_opt_fbio_data_f(u32 v)
112{
113 return (v & 0xffffU) << 0U;
114}
115static inline u32 fuse_status_opt_fbio_data_m(void)
116{
117 return 0xffffU << 0U;
118}
119static inline u32 fuse_status_opt_fbio_data_v(u32 r)
120{
121 return (r >> 0U) & 0xffffU;
122}
123static inline u32 fuse_status_opt_rop_l2_fbp_r(u32 i)
124{
125 return 0x00021d70U + i*4U;
126}
127static inline u32 fuse_status_opt_fbp_r(void)
128{
129 return 0x00021d38U;
130}
131static inline u32 fuse_status_opt_fbp_idx_v(u32 r, u32 i)
132{
133 return (r >> (0U + i*1U)) & 0x1U;
134}
135static inline u32 fuse_opt_ecc_en_r(void)
136{
137 return 0x00021228U;
138}
139static inline u32 fuse_opt_feature_fuses_override_disable_r(void)
140{
141 return 0x000213f0U;
142}
143static inline u32 fuse_opt_sec_debug_en_r(void)
144{
145 return 0x00021218U;
146}
147static inline u32 fuse_opt_priv_sec_en_r(void)
148{
149 return 0x00021434U;
150}
151#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_gmmu_gp10b.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_gmmu_gp10b.h
new file mode 100644
index 00000000..4702f575
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_gmmu_gp10b.h
@@ -0,0 +1,1283 @@
1/*
2 * Copyright (c) 2014-2017, 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_gmmu_gp10b_h_
57#define _hw_gmmu_gp10b_h_
58
59static inline u32 gmmu_new_pde_is_pte_w(void)
60{
61 return 0U;
62}
63static inline u32 gmmu_new_pde_is_pte_false_f(void)
64{
65 return 0x0U;
66}
67static inline u32 gmmu_new_pde_aperture_w(void)
68{
69 return 0U;
70}
71static inline u32 gmmu_new_pde_aperture_invalid_f(void)
72{
73 return 0x0U;
74}
75static inline u32 gmmu_new_pde_aperture_video_memory_f(void)
76{
77 return 0x2U;
78}
79static inline u32 gmmu_new_pde_aperture_sys_mem_coh_f(void)
80{
81 return 0x4U;
82}
83static inline u32 gmmu_new_pde_aperture_sys_mem_ncoh_f(void)
84{
85 return 0x6U;
86}
87static inline u32 gmmu_new_pde_address_sys_f(u32 v)
88{
89 return (v & 0xfffffffU) << 8U;
90}
91static inline u32 gmmu_new_pde_address_sys_w(void)
92{
93 return 0U;
94}
95static inline u32 gmmu_new_pde_vol_w(void)
96{
97 return 0U;
98}
99static inline u32 gmmu_new_pde_vol_true_f(void)
100{
101 return 0x8U;
102}
103static inline u32 gmmu_new_pde_vol_false_f(void)
104{
105 return 0x0U;
106}
107static inline u32 gmmu_new_pde_address_shift_v(void)
108{
109 return 0x0000000cU;
110}
111static inline u32 gmmu_new_pde__size_v(void)
112{
113 return 0x00000008U;
114}
115static inline u32 gmmu_new_dual_pde_is_pte_w(void)
116{
117 return 0U;
118}
119static inline u32 gmmu_new_dual_pde_is_pte_false_f(void)
120{
121 return 0x0U;
122}
123static inline u32 gmmu_new_dual_pde_aperture_big_w(void)
124{
125 return 0U;
126}
127static inline u32 gmmu_new_dual_pde_aperture_big_invalid_f(void)
128{
129 return 0x0U;
130}
131static inline u32 gmmu_new_dual_pde_aperture_big_video_memory_f(void)
132{
133 return 0x2U;
134}
135static inline u32 gmmu_new_dual_pde_aperture_big_sys_mem_coh_f(void)
136{
137 return 0x4U;
138}
139static inline u32 gmmu_new_dual_pde_aperture_big_sys_mem_ncoh_f(void)
140{
141 return 0x6U;
142}
143static inline u32 gmmu_new_dual_pde_address_big_sys_f(u32 v)
144{
145 return (v & 0xfffffffU) << 4U;
146}
147static inline u32 gmmu_new_dual_pde_address_big_sys_w(void)
148{
149 return 0U;
150}
151static inline u32 gmmu_new_dual_pde_aperture_small_w(void)
152{
153 return 2U;
154}
155static inline u32 gmmu_new_dual_pde_aperture_small_invalid_f(void)
156{
157 return 0x0U;
158}
159static inline u32 gmmu_new_dual_pde_aperture_small_video_memory_f(void)
160{
161 return 0x2U;
162}
163static inline u32 gmmu_new_dual_pde_aperture_small_sys_mem_coh_f(void)
164{
165 return 0x4U;
166}
167static inline u32 gmmu_new_dual_pde_aperture_small_sys_mem_ncoh_f(void)
168{
169 return 0x6U;
170}
171static inline u32 gmmu_new_dual_pde_vol_small_w(void)
172{
173 return 2U;
174}
175static inline u32 gmmu_new_dual_pde_vol_small_true_f(void)
176{
177 return 0x8U;
178}
179static inline u32 gmmu_new_dual_pde_vol_small_false_f(void)
180{
181 return 0x0U;
182}
183static inline u32 gmmu_new_dual_pde_vol_big_w(void)
184{
185 return 0U;
186}
187static inline u32 gmmu_new_dual_pde_vol_big_true_f(void)
188{
189 return 0x8U;
190}
191static inline u32 gmmu_new_dual_pde_vol_big_false_f(void)
192{
193 return 0x0U;
194}
195static inline u32 gmmu_new_dual_pde_address_small_sys_f(u32 v)
196{
197 return (v & 0xfffffffU) << 8U;
198}
199static inline u32 gmmu_new_dual_pde_address_small_sys_w(void)
200{
201 return 2U;
202}
203static inline u32 gmmu_new_dual_pde_address_shift_v(void)
204{
205 return 0x0000000cU;
206}
207static inline u32 gmmu_new_dual_pde_address_big_shift_v(void)
208{
209 return 0x00000008U;
210}
211static inline u32 gmmu_new_dual_pde__size_v(void)
212{
213 return 0x00000010U;
214}
215static inline u32 gmmu_new_pte__size_v(void)
216{
217 return 0x00000008U;
218}
219static inline u32 gmmu_new_pte_valid_w(void)
220{
221 return 0U;
222}
223static inline u32 gmmu_new_pte_valid_true_f(void)
224{
225 return 0x1U;
226}
227static inline u32 gmmu_new_pte_valid_false_f(void)
228{
229 return 0x0U;
230}
231static inline u32 gmmu_new_pte_privilege_w(void)
232{
233 return 0U;
234}
235static inline u32 gmmu_new_pte_privilege_true_f(void)
236{
237 return 0x20U;
238}
239static inline u32 gmmu_new_pte_privilege_false_f(void)
240{
241 return 0x0U;
242}
243static inline u32 gmmu_new_pte_address_sys_f(u32 v)
244{
245 return (v & 0xfffffffU) << 8U;
246}
247static inline u32 gmmu_new_pte_address_sys_w(void)
248{
249 return 0U;
250}
251static inline u32 gmmu_new_pte_address_vid_f(u32 v)
252{
253 return (v & 0xffffffU) << 8U;
254}
255static inline u32 gmmu_new_pte_address_vid_w(void)
256{
257 return 0U;
258}
259static inline u32 gmmu_new_pte_vol_w(void)
260{
261 return 0U;
262}
263static inline u32 gmmu_new_pte_vol_true_f(void)
264{
265 return 0x8U;
266}
267static inline u32 gmmu_new_pte_vol_false_f(void)
268{
269 return 0x0U;
270}
271static inline u32 gmmu_new_pte_aperture_w(void)
272{
273 return 0U;
274}
275static inline u32 gmmu_new_pte_aperture_video_memory_f(void)
276{
277 return 0x0U;
278}
279static inline u32 gmmu_new_pte_aperture_sys_mem_coh_f(void)
280{
281 return 0x4U;
282}
283static inline u32 gmmu_new_pte_aperture_sys_mem_ncoh_f(void)
284{
285 return 0x6U;
286}
287static inline u32 gmmu_new_pte_read_only_w(void)
288{
289 return 0U;
290}
291static inline u32 gmmu_new_pte_read_only_true_f(void)
292{
293 return 0x40U;
294}
295static inline u32 gmmu_new_pte_comptagline_f(u32 v)
296{
297 return (v & 0x3ffffU) << 4U;
298}
299static inline u32 gmmu_new_pte_comptagline_w(void)
300{
301 return 1U;
302}
303static inline u32 gmmu_new_pte_kind_f(u32 v)
304{
305 return (v & 0xffU) << 24U;
306}
307static inline u32 gmmu_new_pte_kind_w(void)
308{
309 return 1U;
310}
311static inline u32 gmmu_new_pte_address_shift_v(void)
312{
313 return 0x0000000cU;
314}
315static inline u32 gmmu_pte_kind_f(u32 v)
316{
317 return (v & 0xffU) << 4U;
318}
319static inline u32 gmmu_pte_kind_w(void)
320{
321 return 1U;
322}
323static inline u32 gmmu_pte_kind_invalid_v(void)
324{
325 return 0x000000ffU;
326}
327static inline u32 gmmu_pte_kind_pitch_v(void)
328{
329 return 0x00000000U;
330}
331static inline u32 gmmu_pte_kind_z16_v(void)
332{
333 return 0x00000001U;
334}
335static inline u32 gmmu_pte_kind_z16_2c_v(void)
336{
337 return 0x00000002U;
338}
339static inline u32 gmmu_pte_kind_z16_ms2_2c_v(void)
340{
341 return 0x00000003U;
342}
343static inline u32 gmmu_pte_kind_z16_ms4_2c_v(void)
344{
345 return 0x00000004U;
346}
347static inline u32 gmmu_pte_kind_z16_ms8_2c_v(void)
348{
349 return 0x00000005U;
350}
351static inline u32 gmmu_pte_kind_z16_ms16_2c_v(void)
352{
353 return 0x00000006U;
354}
355static inline u32 gmmu_pte_kind_z16_2z_v(void)
356{
357 return 0x00000007U;
358}
359static inline u32 gmmu_pte_kind_z16_ms2_2z_v(void)
360{
361 return 0x00000008U;
362}
363static inline u32 gmmu_pte_kind_z16_ms4_2z_v(void)
364{
365 return 0x00000009U;
366}
367static inline u32 gmmu_pte_kind_z16_ms8_2z_v(void)
368{
369 return 0x0000000aU;
370}
371static inline u32 gmmu_pte_kind_z16_ms16_2z_v(void)
372{
373 return 0x0000000bU;
374}
375static inline u32 gmmu_pte_kind_z16_2cz_v(void)
376{
377 return 0x00000036U;
378}
379static inline u32 gmmu_pte_kind_z16_ms2_2cz_v(void)
380{
381 return 0x00000037U;
382}
383static inline u32 gmmu_pte_kind_z16_ms4_2cz_v(void)
384{
385 return 0x00000038U;
386}
387static inline u32 gmmu_pte_kind_z16_ms8_2cz_v(void)
388{
389 return 0x00000039U;
390}
391static inline u32 gmmu_pte_kind_z16_ms16_2cz_v(void)
392{
393 return 0x0000005fU;
394}
395static inline u32 gmmu_pte_kind_z16_4cz_v(void)
396{
397 return 0x0000000cU;
398}
399static inline u32 gmmu_pte_kind_z16_ms2_4cz_v(void)
400{
401 return 0x0000000dU;
402}
403static inline u32 gmmu_pte_kind_z16_ms4_4cz_v(void)
404{
405 return 0x0000000eU;
406}
407static inline u32 gmmu_pte_kind_z16_ms8_4cz_v(void)
408{
409 return 0x0000000fU;
410}
411static inline u32 gmmu_pte_kind_z16_ms16_4cz_v(void)
412{
413 return 0x00000010U;
414}
415static inline u32 gmmu_pte_kind_s8z24_v(void)
416{
417 return 0x00000011U;
418}
419static inline u32 gmmu_pte_kind_s8z24_1z_v(void)
420{
421 return 0x00000012U;
422}
423static inline u32 gmmu_pte_kind_s8z24_ms2_1z_v(void)
424{
425 return 0x00000013U;
426}
427static inline u32 gmmu_pte_kind_s8z24_ms4_1z_v(void)
428{
429 return 0x00000014U;
430}
431static inline u32 gmmu_pte_kind_s8z24_ms8_1z_v(void)
432{
433 return 0x00000015U;
434}
435static inline u32 gmmu_pte_kind_s8z24_ms16_1z_v(void)
436{
437 return 0x00000016U;
438}
439static inline u32 gmmu_pte_kind_s8z24_2cz_v(void)
440{
441 return 0x00000017U;
442}
443static inline u32 gmmu_pte_kind_s8z24_ms2_2cz_v(void)
444{
445 return 0x00000018U;
446}
447static inline u32 gmmu_pte_kind_s8z24_ms4_2cz_v(void)
448{
449 return 0x00000019U;
450}
451static inline u32 gmmu_pte_kind_s8z24_ms8_2cz_v(void)
452{
453 return 0x0000001aU;
454}
455static inline u32 gmmu_pte_kind_s8z24_ms16_2cz_v(void)
456{
457 return 0x0000001bU;
458}
459static inline u32 gmmu_pte_kind_s8z24_2cs_v(void)
460{
461 return 0x0000001cU;
462}
463static inline u32 gmmu_pte_kind_s8z24_ms2_2cs_v(void)
464{
465 return 0x0000001dU;
466}
467static inline u32 gmmu_pte_kind_s8z24_ms4_2cs_v(void)
468{
469 return 0x0000001eU;
470}
471static inline u32 gmmu_pte_kind_s8z24_ms8_2cs_v(void)
472{
473 return 0x0000001fU;
474}
475static inline u32 gmmu_pte_kind_s8z24_ms16_2cs_v(void)
476{
477 return 0x00000020U;
478}
479static inline u32 gmmu_pte_kind_s8z24_4cszv_v(void)
480{
481 return 0x00000021U;
482}
483static inline u32 gmmu_pte_kind_s8z24_ms2_4cszv_v(void)
484{
485 return 0x00000022U;
486}
487static inline u32 gmmu_pte_kind_s8z24_ms4_4cszv_v(void)
488{
489 return 0x00000023U;
490}
491static inline u32 gmmu_pte_kind_s8z24_ms8_4cszv_v(void)
492{
493 return 0x00000024U;
494}
495static inline u32 gmmu_pte_kind_s8z24_ms16_4cszv_v(void)
496{
497 return 0x00000025U;
498}
499static inline u32 gmmu_pte_kind_v8z24_ms4_vc12_v(void)
500{
501 return 0x00000026U;
502}
503static inline u32 gmmu_pte_kind_v8z24_ms4_vc4_v(void)
504{
505 return 0x00000027U;
506}
507static inline u32 gmmu_pte_kind_v8z24_ms8_vc8_v(void)
508{
509 return 0x00000028U;
510}
511static inline u32 gmmu_pte_kind_v8z24_ms8_vc24_v(void)
512{
513 return 0x00000029U;
514}
515static inline u32 gmmu_pte_kind_v8z24_ms4_vc12_1zv_v(void)
516{
517 return 0x0000002eU;
518}
519static inline u32 gmmu_pte_kind_v8z24_ms4_vc4_1zv_v(void)
520{
521 return 0x0000002fU;
522}
523static inline u32 gmmu_pte_kind_v8z24_ms8_vc8_1zv_v(void)
524{
525 return 0x00000030U;
526}
527static inline u32 gmmu_pte_kind_v8z24_ms8_vc24_1zv_v(void)
528{
529 return 0x00000031U;
530}
531static inline u32 gmmu_pte_kind_v8z24_ms4_vc12_2cs_v(void)
532{
533 return 0x00000032U;
534}
535static inline u32 gmmu_pte_kind_v8z24_ms4_vc4_2cs_v(void)
536{
537 return 0x00000033U;
538}
539static inline u32 gmmu_pte_kind_v8z24_ms8_vc8_2cs_v(void)
540{
541 return 0x00000034U;
542}
543static inline u32 gmmu_pte_kind_v8z24_ms8_vc24_2cs_v(void)
544{
545 return 0x00000035U;
546}
547static inline u32 gmmu_pte_kind_v8z24_ms4_vc12_2czv_v(void)
548{
549 return 0x0000003aU;
550}
551static inline u32 gmmu_pte_kind_v8z24_ms4_vc4_2czv_v(void)
552{
553 return 0x0000003bU;
554}
555static inline u32 gmmu_pte_kind_v8z24_ms8_vc8_2czv_v(void)
556{
557 return 0x0000003cU;
558}
559static inline u32 gmmu_pte_kind_v8z24_ms8_vc24_2czv_v(void)
560{
561 return 0x0000003dU;
562}
563static inline u32 gmmu_pte_kind_v8z24_ms4_vc12_2zv_v(void)
564{
565 return 0x0000003eU;
566}
567static inline u32 gmmu_pte_kind_v8z24_ms4_vc4_2zv_v(void)
568{
569 return 0x0000003fU;
570}
571static inline u32 gmmu_pte_kind_v8z24_ms8_vc8_2zv_v(void)
572{
573 return 0x00000040U;
574}
575static inline u32 gmmu_pte_kind_v8z24_ms8_vc24_2zv_v(void)
576{
577 return 0x00000041U;
578}
579static inline u32 gmmu_pte_kind_v8z24_ms4_vc12_4cszv_v(void)
580{
581 return 0x00000042U;
582}
583static inline u32 gmmu_pte_kind_v8z24_ms4_vc4_4cszv_v(void)
584{
585 return 0x00000043U;
586}
587static inline u32 gmmu_pte_kind_v8z24_ms8_vc8_4cszv_v(void)
588{
589 return 0x00000044U;
590}
591static inline u32 gmmu_pte_kind_v8z24_ms8_vc24_4cszv_v(void)
592{
593 return 0x00000045U;
594}
595static inline u32 gmmu_pte_kind_z24s8_v(void)
596{
597 return 0x00000046U;
598}
599static inline u32 gmmu_pte_kind_z24s8_1z_v(void)
600{
601 return 0x00000047U;
602}
603static inline u32 gmmu_pte_kind_z24s8_ms2_1z_v(void)
604{
605 return 0x00000048U;
606}
607static inline u32 gmmu_pte_kind_z24s8_ms4_1z_v(void)
608{
609 return 0x00000049U;
610}
611static inline u32 gmmu_pte_kind_z24s8_ms8_1z_v(void)
612{
613 return 0x0000004aU;
614}
615static inline u32 gmmu_pte_kind_z24s8_ms16_1z_v(void)
616{
617 return 0x0000004bU;
618}
619static inline u32 gmmu_pte_kind_z24s8_2cs_v(void)
620{
621 return 0x0000004cU;
622}
623static inline u32 gmmu_pte_kind_z24s8_ms2_2cs_v(void)
624{
625 return 0x0000004dU;
626}
627static inline u32 gmmu_pte_kind_z24s8_ms4_2cs_v(void)
628{
629 return 0x0000004eU;
630}
631static inline u32 gmmu_pte_kind_z24s8_ms8_2cs_v(void)
632{
633 return 0x0000004fU;
634}
635static inline u32 gmmu_pte_kind_z24s8_ms16_2cs_v(void)
636{
637 return 0x00000050U;
638}
639static inline u32 gmmu_pte_kind_z24s8_2cz_v(void)
640{
641 return 0x00000051U;
642}
643static inline u32 gmmu_pte_kind_z24s8_ms2_2cz_v(void)
644{
645 return 0x00000052U;
646}
647static inline u32 gmmu_pte_kind_z24s8_ms4_2cz_v(void)
648{
649 return 0x00000053U;
650}
651static inline u32 gmmu_pte_kind_z24s8_ms8_2cz_v(void)
652{
653 return 0x00000054U;
654}
655static inline u32 gmmu_pte_kind_z24s8_ms16_2cz_v(void)
656{
657 return 0x00000055U;
658}
659static inline u32 gmmu_pte_kind_z24s8_4cszv_v(void)
660{
661 return 0x00000056U;
662}
663static inline u32 gmmu_pte_kind_z24s8_ms2_4cszv_v(void)
664{
665 return 0x00000057U;
666}
667static inline u32 gmmu_pte_kind_z24s8_ms4_4cszv_v(void)
668{
669 return 0x00000058U;
670}
671static inline u32 gmmu_pte_kind_z24s8_ms8_4cszv_v(void)
672{
673 return 0x00000059U;
674}
675static inline u32 gmmu_pte_kind_z24s8_ms16_4cszv_v(void)
676{
677 return 0x0000005aU;
678}
679static inline u32 gmmu_pte_kind_z24v8_ms4_vc12_v(void)
680{
681 return 0x0000005bU;
682}
683static inline u32 gmmu_pte_kind_z24v8_ms4_vc4_v(void)
684{
685 return 0x0000005cU;
686}
687static inline u32 gmmu_pte_kind_z24v8_ms8_vc8_v(void)
688{
689 return 0x0000005dU;
690}
691static inline u32 gmmu_pte_kind_z24v8_ms8_vc24_v(void)
692{
693 return 0x0000005eU;
694}
695static inline u32 gmmu_pte_kind_z24v8_ms4_vc12_1zv_v(void)
696{
697 return 0x00000063U;
698}
699static inline u32 gmmu_pte_kind_z24v8_ms4_vc4_1zv_v(void)
700{
701 return 0x00000064U;
702}
703static inline u32 gmmu_pte_kind_z24v8_ms8_vc8_1zv_v(void)
704{
705 return 0x00000065U;
706}
707static inline u32 gmmu_pte_kind_z24v8_ms8_vc24_1zv_v(void)
708{
709 return 0x00000066U;
710}
711static inline u32 gmmu_pte_kind_z24v8_ms4_vc12_2cs_v(void)
712{
713 return 0x00000067U;
714}
715static inline u32 gmmu_pte_kind_z24v8_ms4_vc4_2cs_v(void)
716{
717 return 0x00000068U;
718}
719static inline u32 gmmu_pte_kind_z24v8_ms8_vc8_2cs_v(void)
720{
721 return 0x00000069U;
722}
723static inline u32 gmmu_pte_kind_z24v8_ms8_vc24_2cs_v(void)
724{
725 return 0x0000006aU;
726}
727static inline u32 gmmu_pte_kind_z24v8_ms4_vc12_2czv_v(void)
728{
729 return 0x0000006fU;
730}
731static inline u32 gmmu_pte_kind_z24v8_ms4_vc4_2czv_v(void)
732{
733 return 0x00000070U;
734}
735static inline u32 gmmu_pte_kind_z24v8_ms8_vc8_2czv_v(void)
736{
737 return 0x00000071U;
738}
739static inline u32 gmmu_pte_kind_z24v8_ms8_vc24_2czv_v(void)
740{
741 return 0x00000072U;
742}
743static inline u32 gmmu_pte_kind_z24v8_ms4_vc12_2zv_v(void)
744{
745 return 0x00000073U;
746}
747static inline u32 gmmu_pte_kind_z24v8_ms4_vc4_2zv_v(void)
748{
749 return 0x00000074U;
750}
751static inline u32 gmmu_pte_kind_z24v8_ms8_vc8_2zv_v(void)
752{
753 return 0x00000075U;
754}
755static inline u32 gmmu_pte_kind_z24v8_ms8_vc24_2zv_v(void)
756{
757 return 0x00000076U;
758}
759static inline u32 gmmu_pte_kind_z24v8_ms4_vc12_4cszv_v(void)
760{
761 return 0x00000077U;
762}
763static inline u32 gmmu_pte_kind_z24v8_ms4_vc4_4cszv_v(void)
764{
765 return 0x00000078U;
766}
767static inline u32 gmmu_pte_kind_z24v8_ms8_vc8_4cszv_v(void)
768{
769 return 0x00000079U;
770}
771static inline u32 gmmu_pte_kind_z24v8_ms8_vc24_4cszv_v(void)
772{
773 return 0x0000007aU;
774}
775static inline u32 gmmu_pte_kind_zf32_v(void)
776{
777 return 0x0000007bU;
778}
779static inline u32 gmmu_pte_kind_zf32_1z_v(void)
780{
781 return 0x0000007cU;
782}
783static inline u32 gmmu_pte_kind_zf32_ms2_1z_v(void)
784{
785 return 0x0000007dU;
786}
787static inline u32 gmmu_pte_kind_zf32_ms4_1z_v(void)
788{
789 return 0x0000007eU;
790}
791static inline u32 gmmu_pte_kind_zf32_ms8_1z_v(void)
792{
793 return 0x0000007fU;
794}
795static inline u32 gmmu_pte_kind_zf32_ms16_1z_v(void)
796{
797 return 0x00000080U;
798}
799static inline u32 gmmu_pte_kind_zf32_2cs_v(void)
800{
801 return 0x00000081U;
802}
803static inline u32 gmmu_pte_kind_zf32_ms2_2cs_v(void)
804{
805 return 0x00000082U;
806}
807static inline u32 gmmu_pte_kind_zf32_ms4_2cs_v(void)
808{
809 return 0x00000083U;
810}
811static inline u32 gmmu_pte_kind_zf32_ms8_2cs_v(void)
812{
813 return 0x00000084U;
814}
815static inline u32 gmmu_pte_kind_zf32_ms16_2cs_v(void)
816{
817 return 0x00000085U;
818}
819static inline u32 gmmu_pte_kind_zf32_2cz_v(void)
820{
821 return 0x00000086U;
822}
823static inline u32 gmmu_pte_kind_zf32_ms2_2cz_v(void)
824{
825 return 0x00000087U;
826}
827static inline u32 gmmu_pte_kind_zf32_ms4_2cz_v(void)
828{
829 return 0x00000088U;
830}
831static inline u32 gmmu_pte_kind_zf32_ms8_2cz_v(void)
832{
833 return 0x00000089U;
834}
835static inline u32 gmmu_pte_kind_zf32_ms16_2cz_v(void)
836{
837 return 0x0000008aU;
838}
839static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms4_vc12_v(void)
840{
841 return 0x0000008bU;
842}
843static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms4_vc4_v(void)
844{
845 return 0x0000008cU;
846}
847static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms8_vc8_v(void)
848{
849 return 0x0000008dU;
850}
851static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms8_vc24_v(void)
852{
853 return 0x0000008eU;
854}
855static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms4_vc12_1cs_v(void)
856{
857 return 0x0000008fU;
858}
859static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms4_vc4_1cs_v(void)
860{
861 return 0x00000090U;
862}
863static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms8_vc8_1cs_v(void)
864{
865 return 0x00000091U;
866}
867static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms8_vc24_1cs_v(void)
868{
869 return 0x00000092U;
870}
871static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms4_vc12_1zv_v(void)
872{
873 return 0x00000097U;
874}
875static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms4_vc4_1zv_v(void)
876{
877 return 0x00000098U;
878}
879static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms8_vc8_1zv_v(void)
880{
881 return 0x00000099U;
882}
883static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms8_vc24_1zv_v(void)
884{
885 return 0x0000009aU;
886}
887static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms4_vc12_1czv_v(void)
888{
889 return 0x0000009bU;
890}
891static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms4_vc4_1czv_v(void)
892{
893 return 0x0000009cU;
894}
895static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms8_vc8_1czv_v(void)
896{
897 return 0x0000009dU;
898}
899static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms8_vc24_1czv_v(void)
900{
901 return 0x0000009eU;
902}
903static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms4_vc12_2cs_v(void)
904{
905 return 0x0000009fU;
906}
907static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms4_vc4_2cs_v(void)
908{
909 return 0x000000a0U;
910}
911static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms8_vc8_2cs_v(void)
912{
913 return 0x000000a1U;
914}
915static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms8_vc24_2cs_v(void)
916{
917 return 0x000000a2U;
918}
919static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms4_vc12_2cszv_v(void)
920{
921 return 0x000000a3U;
922}
923static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms4_vc4_2cszv_v(void)
924{
925 return 0x000000a4U;
926}
927static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms8_vc8_2cszv_v(void)
928{
929 return 0x000000a5U;
930}
931static inline u32 gmmu_pte_kind_x8z24_x16v8s8_ms8_vc24_2cszv_v(void)
932{
933 return 0x000000a6U;
934}
935static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms4_vc12_v(void)
936{
937 return 0x000000a7U;
938}
939static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms4_vc4_v(void)
940{
941 return 0x000000a8U;
942}
943static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms8_vc8_v(void)
944{
945 return 0x000000a9U;
946}
947static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms8_vc24_v(void)
948{
949 return 0x000000aaU;
950}
951static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms4_vc12_1cs_v(void)
952{
953 return 0x000000abU;
954}
955static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms4_vc4_1cs_v(void)
956{
957 return 0x000000acU;
958}
959static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms8_vc8_1cs_v(void)
960{
961 return 0x000000adU;
962}
963static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms8_vc24_1cs_v(void)
964{
965 return 0x000000aeU;
966}
967static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms4_vc12_1zv_v(void)
968{
969 return 0x000000b3U;
970}
971static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms4_vc4_1zv_v(void)
972{
973 return 0x000000b4U;
974}
975static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms8_vc8_1zv_v(void)
976{
977 return 0x000000b5U;
978}
979static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms8_vc24_1zv_v(void)
980{
981 return 0x000000b6U;
982}
983static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms4_vc12_1czv_v(void)
984{
985 return 0x000000b7U;
986}
987static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms4_vc4_1czv_v(void)
988{
989 return 0x000000b8U;
990}
991static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms8_vc8_1czv_v(void)
992{
993 return 0x000000b9U;
994}
995static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms8_vc24_1czv_v(void)
996{
997 return 0x000000baU;
998}
999static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms4_vc12_2cs_v(void)
1000{
1001 return 0x000000bbU;
1002}
1003static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms4_vc4_2cs_v(void)
1004{
1005 return 0x000000bcU;
1006}
1007static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms8_vc8_2cs_v(void)
1008{
1009 return 0x000000bdU;
1010}
1011static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms8_vc24_2cs_v(void)
1012{
1013 return 0x000000beU;
1014}
1015static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms4_vc12_2cszv_v(void)
1016{
1017 return 0x000000bfU;
1018}
1019static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms4_vc4_2cszv_v(void)
1020{
1021 return 0x000000c0U;
1022}
1023static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms8_vc8_2cszv_v(void)
1024{
1025 return 0x000000c1U;
1026}
1027static inline u32 gmmu_pte_kind_zf32_x16v8s8_ms8_vc24_2cszv_v(void)
1028{
1029 return 0x000000c2U;
1030}
1031static inline u32 gmmu_pte_kind_zf32_x24s8_v(void)
1032{
1033 return 0x000000c3U;
1034}
1035static inline u32 gmmu_pte_kind_zf32_x24s8_1cs_v(void)
1036{
1037 return 0x000000c4U;
1038}
1039static inline u32 gmmu_pte_kind_zf32_x24s8_ms2_1cs_v(void)
1040{
1041 return 0x000000c5U;
1042}
1043static inline u32 gmmu_pte_kind_zf32_x24s8_ms4_1cs_v(void)
1044{
1045 return 0x000000c6U;
1046}
1047static inline u32 gmmu_pte_kind_zf32_x24s8_ms8_1cs_v(void)
1048{
1049 return 0x000000c7U;
1050}
1051static inline u32 gmmu_pte_kind_zf32_x24s8_ms16_1cs_v(void)
1052{
1053 return 0x000000c8U;
1054}
1055static inline u32 gmmu_pte_kind_zf32_x24s8_2cszv_v(void)
1056{
1057 return 0x000000ceU;
1058}
1059static inline u32 gmmu_pte_kind_zf32_x24s8_ms2_2cszv_v(void)
1060{
1061 return 0x000000cfU;
1062}
1063static inline u32 gmmu_pte_kind_zf32_x24s8_ms4_2cszv_v(void)
1064{
1065 return 0x000000d0U;
1066}
1067static inline u32 gmmu_pte_kind_zf32_x24s8_ms8_2cszv_v(void)
1068{
1069 return 0x000000d1U;
1070}
1071static inline u32 gmmu_pte_kind_zf32_x24s8_ms16_2cszv_v(void)
1072{
1073 return 0x000000d2U;
1074}
1075static inline u32 gmmu_pte_kind_zf32_x24s8_2cs_v(void)
1076{
1077 return 0x000000d3U;
1078}
1079static inline u32 gmmu_pte_kind_zf32_x24s8_ms2_2cs_v(void)
1080{
1081 return 0x000000d4U;
1082}
1083static inline u32 gmmu_pte_kind_zf32_x24s8_ms4_2cs_v(void)
1084{
1085 return 0x000000d5U;
1086}
1087static inline u32 gmmu_pte_kind_zf32_x24s8_ms8_2cs_v(void)
1088{
1089 return 0x000000d6U;
1090}
1091static inline u32 gmmu_pte_kind_zf32_x24s8_ms16_2cs_v(void)
1092{
1093 return 0x000000d7U;
1094}
1095static inline u32 gmmu_pte_kind_generic_16bx2_v(void)
1096{
1097 return 0x000000feU;
1098}
1099static inline u32 gmmu_pte_kind_c32_2c_v(void)
1100{
1101 return 0x000000d8U;
1102}
1103static inline u32 gmmu_pte_kind_c32_2cbr_v(void)
1104{
1105 return 0x000000d9U;
1106}
1107static inline u32 gmmu_pte_kind_c32_2cba_v(void)
1108{
1109 return 0x000000daU;
1110}
1111static inline u32 gmmu_pte_kind_c32_2cra_v(void)
1112{
1113 return 0x000000dbU;
1114}
1115static inline u32 gmmu_pte_kind_c32_2bra_v(void)
1116{
1117 return 0x000000dcU;
1118}
1119static inline u32 gmmu_pte_kind_c32_ms2_2c_v(void)
1120{
1121 return 0x000000ddU;
1122}
1123static inline u32 gmmu_pte_kind_c32_ms2_2cbr_v(void)
1124{
1125 return 0x000000deU;
1126}
1127static inline u32 gmmu_pte_kind_c32_ms2_2cra_v(void)
1128{
1129 return 0x000000ccU;
1130}
1131static inline u32 gmmu_pte_kind_c32_ms4_2c_v(void)
1132{
1133 return 0x000000dfU;
1134}
1135static inline u32 gmmu_pte_kind_c32_ms4_2cbr_v(void)
1136{
1137 return 0x000000e0U;
1138}
1139static inline u32 gmmu_pte_kind_c32_ms4_2cba_v(void)
1140{
1141 return 0x000000e1U;
1142}
1143static inline u32 gmmu_pte_kind_c32_ms4_2cra_v(void)
1144{
1145 return 0x000000e2U;
1146}
1147static inline u32 gmmu_pte_kind_c32_ms4_2bra_v(void)
1148{
1149 return 0x000000e3U;
1150}
1151static inline u32 gmmu_pte_kind_c32_ms4_4cbra_v(void)
1152{
1153 return 0x0000002cU;
1154}
1155static inline u32 gmmu_pte_kind_c32_ms8_ms16_2c_v(void)
1156{
1157 return 0x000000e4U;
1158}
1159static inline u32 gmmu_pte_kind_c32_ms8_ms16_2cra_v(void)
1160{
1161 return 0x000000e5U;
1162}
1163static inline u32 gmmu_pte_kind_c64_2c_v(void)
1164{
1165 return 0x000000e6U;
1166}
1167static inline u32 gmmu_pte_kind_c64_2cbr_v(void)
1168{
1169 return 0x000000e7U;
1170}
1171static inline u32 gmmu_pte_kind_c64_2cba_v(void)
1172{
1173 return 0x000000e8U;
1174}
1175static inline u32 gmmu_pte_kind_c64_2cra_v(void)
1176{
1177 return 0x000000e9U;
1178}
1179static inline u32 gmmu_pte_kind_c64_2bra_v(void)
1180{
1181 return 0x000000eaU;
1182}
1183static inline u32 gmmu_pte_kind_c64_ms2_2c_v(void)
1184{
1185 return 0x000000ebU;
1186}
1187static inline u32 gmmu_pte_kind_c64_ms2_2cbr_v(void)
1188{
1189 return 0x000000ecU;
1190}
1191static inline u32 gmmu_pte_kind_c64_ms2_2cra_v(void)
1192{
1193 return 0x000000cdU;
1194}
1195static inline u32 gmmu_pte_kind_c64_ms4_2c_v(void)
1196{
1197 return 0x000000edU;
1198}
1199static inline u32 gmmu_pte_kind_c64_ms4_2cbr_v(void)
1200{
1201 return 0x000000eeU;
1202}
1203static inline u32 gmmu_pte_kind_c64_ms4_2cba_v(void)
1204{
1205 return 0x000000efU;
1206}
1207static inline u32 gmmu_pte_kind_c64_ms4_2cra_v(void)
1208{
1209 return 0x000000f0U;
1210}
1211static inline u32 gmmu_pte_kind_c64_ms4_2bra_v(void)
1212{
1213 return 0x000000f1U;
1214}
1215static inline u32 gmmu_pte_kind_c64_ms4_4cbra_v(void)
1216{
1217 return 0x0000002dU;
1218}
1219static inline u32 gmmu_pte_kind_c64_ms8_ms16_2c_v(void)
1220{
1221 return 0x000000f2U;
1222}
1223static inline u32 gmmu_pte_kind_c64_ms8_ms16_2cra_v(void)
1224{
1225 return 0x000000f3U;
1226}
1227static inline u32 gmmu_pte_kind_c128_2c_v(void)
1228{
1229 return 0x000000f4U;
1230}
1231static inline u32 gmmu_pte_kind_c128_2cr_v(void)
1232{
1233 return 0x000000f5U;
1234}
1235static inline u32 gmmu_pte_kind_c128_ms2_2c_v(void)
1236{
1237 return 0x000000f6U;
1238}
1239static inline u32 gmmu_pte_kind_c128_ms2_2cr_v(void)
1240{
1241 return 0x000000f7U;
1242}
1243static inline u32 gmmu_pte_kind_c128_ms4_2c_v(void)
1244{
1245 return 0x000000f8U;
1246}
1247static inline u32 gmmu_pte_kind_c128_ms4_2cr_v(void)
1248{
1249 return 0x000000f9U;
1250}
1251static inline u32 gmmu_pte_kind_c128_ms8_ms16_2c_v(void)
1252{
1253 return 0x000000faU;
1254}
1255static inline u32 gmmu_pte_kind_c128_ms8_ms16_2cr_v(void)
1256{
1257 return 0x000000fbU;
1258}
1259static inline u32 gmmu_pte_kind_x8c24_v(void)
1260{
1261 return 0x000000fcU;
1262}
1263static inline u32 gmmu_pte_kind_pitch_no_swizzle_v(void)
1264{
1265 return 0x000000fdU;
1266}
1267static inline u32 gmmu_pte_kind_smsked_message_v(void)
1268{
1269 return 0x000000caU;
1270}
1271static inline u32 gmmu_pte_kind_smhost_message_v(void)
1272{
1273 return 0x000000cbU;
1274}
1275static inline u32 gmmu_pte_kind_s8_v(void)
1276{
1277 return 0x0000002aU;
1278}
1279static inline u32 gmmu_pte_kind_s8_2s_v(void)
1280{
1281 return 0x0000002bU;
1282}
1283#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_gr_gp10b.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_gr_gp10b.h
new file mode 100644
index 00000000..51809112
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_gr_gp10b.h
@@ -0,0 +1,4363 @@
1/*
2 * Copyright (c) 2014-2017, 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_gr_gp10b_h_
57#define _hw_gr_gp10b_h_
58
59static inline u32 gr_intr_r(void)
60{
61 return 0x00400100U;
62}
63static inline u32 gr_intr_notify_pending_f(void)
64{
65 return 0x1U;
66}
67static inline u32 gr_intr_notify_reset_f(void)
68{
69 return 0x1U;
70}
71static inline u32 gr_intr_semaphore_pending_f(void)
72{
73 return 0x2U;
74}
75static inline u32 gr_intr_semaphore_reset_f(void)
76{
77 return 0x2U;
78}
79static inline u32 gr_intr_illegal_method_pending_f(void)
80{
81 return 0x10U;
82}
83static inline u32 gr_intr_illegal_method_reset_f(void)
84{
85 return 0x10U;
86}
87static inline u32 gr_intr_illegal_notify_pending_f(void)
88{
89 return 0x40U;
90}
91static inline u32 gr_intr_illegal_notify_reset_f(void)
92{
93 return 0x40U;
94}
95static inline u32 gr_intr_firmware_method_f(u32 v)
96{
97 return (v & 0x1U) << 8U;
98}
99static inline u32 gr_intr_firmware_method_pending_f(void)
100{
101 return 0x100U;
102}
103static inline u32 gr_intr_firmware_method_reset_f(void)
104{
105 return 0x100U;
106}
107static inline u32 gr_intr_illegal_class_pending_f(void)
108{
109 return 0x20U;
110}
111static inline u32 gr_intr_illegal_class_reset_f(void)
112{
113 return 0x20U;
114}
115static inline u32 gr_intr_fecs_error_pending_f(void)
116{
117 return 0x80000U;
118}
119static inline u32 gr_intr_fecs_error_reset_f(void)
120{
121 return 0x80000U;
122}
123static inline u32 gr_intr_class_error_pending_f(void)
124{
125 return 0x100000U;
126}
127static inline u32 gr_intr_class_error_reset_f(void)
128{
129 return 0x100000U;
130}
131static inline u32 gr_intr_exception_pending_f(void)
132{
133 return 0x200000U;
134}
135static inline u32 gr_intr_exception_reset_f(void)
136{
137 return 0x200000U;
138}
139static inline u32 gr_fecs_intr_r(void)
140{
141 return 0x00400144U;
142}
143static inline u32 gr_class_error_r(void)
144{
145 return 0x00400110U;
146}
147static inline u32 gr_class_error_code_v(u32 r)
148{
149 return (r >> 0U) & 0xffffU;
150}
151static inline u32 gr_intr_nonstall_r(void)
152{
153 return 0x00400120U;
154}
155static inline u32 gr_intr_nonstall_trap_pending_f(void)
156{
157 return 0x2U;
158}
159static inline u32 gr_intr_en_r(void)
160{
161 return 0x0040013cU;
162}
163static inline u32 gr_exception_r(void)
164{
165 return 0x00400108U;
166}
167static inline u32 gr_exception_fe_m(void)
168{
169 return 0x1U << 0U;
170}
171static inline u32 gr_exception_gpc_m(void)
172{
173 return 0x1U << 24U;
174}
175static inline u32 gr_exception_memfmt_m(void)
176{
177 return 0x1U << 1U;
178}
179static inline u32 gr_exception_ds_m(void)
180{
181 return 0x1U << 4U;
182}
183static inline u32 gr_exception_sked_m(void)
184{
185 return 0x1U << 8U;
186}
187static inline u32 gr_exception1_r(void)
188{
189 return 0x00400118U;
190}
191static inline u32 gr_exception1_gpc_0_pending_f(void)
192{
193 return 0x1U;
194}
195static inline u32 gr_exception2_r(void)
196{
197 return 0x0040011cU;
198}
199static inline u32 gr_exception_en_r(void)
200{
201 return 0x00400138U;
202}
203static inline u32 gr_exception_en_fe_m(void)
204{
205 return 0x1U << 0U;
206}
207static inline u32 gr_exception1_en_r(void)
208{
209 return 0x00400130U;
210}
211static inline u32 gr_exception2_en_r(void)
212{
213 return 0x00400134U;
214}
215static inline u32 gr_gpfifo_ctl_r(void)
216{
217 return 0x00400500U;
218}
219static inline u32 gr_gpfifo_ctl_access_f(u32 v)
220{
221 return (v & 0x1U) << 0U;
222}
223static inline u32 gr_gpfifo_ctl_access_disabled_f(void)
224{
225 return 0x0U;
226}
227static inline u32 gr_gpfifo_ctl_access_enabled_f(void)
228{
229 return 0x1U;
230}
231static inline u32 gr_gpfifo_ctl_semaphore_access_f(u32 v)
232{
233 return (v & 0x1U) << 16U;
234}
235static inline u32 gr_gpfifo_ctl_semaphore_access_enabled_v(void)
236{
237 return 0x00000001U;
238}
239static inline u32 gr_gpfifo_ctl_semaphore_access_enabled_f(void)
240{
241 return 0x10000U;
242}
243static inline u32 gr_gpfifo_status_r(void)
244{
245 return 0x00400504U;
246}
247static inline u32 gr_trapped_addr_r(void)
248{
249 return 0x00400704U;
250}
251static inline u32 gr_trapped_addr_mthd_v(u32 r)
252{
253 return (r >> 2U) & 0xfffU;
254}
255static inline u32 gr_trapped_addr_subch_v(u32 r)
256{
257 return (r >> 16U) & 0x7U;
258}
259static inline u32 gr_trapped_addr_mme_generated_v(u32 r)
260{
261 return (r >> 20U) & 0x1U;
262}
263static inline u32 gr_trapped_addr_datahigh_v(u32 r)
264{
265 return (r >> 24U) & 0x1U;
266}
267static inline u32 gr_trapped_addr_priv_v(u32 r)
268{
269 return (r >> 28U) & 0x1U;
270}
271static inline u32 gr_trapped_addr_status_v(u32 r)
272{
273 return (r >> 31U) & 0x1U;
274}
275static inline u32 gr_trapped_data_lo_r(void)
276{
277 return 0x00400708U;
278}
279static inline u32 gr_trapped_data_hi_r(void)
280{
281 return 0x0040070cU;
282}
283static inline u32 gr_trapped_data_mme_r(void)
284{
285 return 0x00400710U;
286}
287static inline u32 gr_trapped_data_mme_pc_v(u32 r)
288{
289 return (r >> 0U) & 0xfffU;
290}
291static inline u32 gr_status_r(void)
292{
293 return 0x00400700U;
294}
295static inline u32 gr_status_fe_method_upper_v(u32 r)
296{
297 return (r >> 1U) & 0x1U;
298}
299static inline u32 gr_status_fe_method_lower_v(u32 r)
300{
301 return (r >> 2U) & 0x1U;
302}
303static inline u32 gr_status_fe_method_lower_idle_v(void)
304{
305 return 0x00000000U;
306}
307static inline u32 gr_status_fe_gi_v(u32 r)
308{
309 return (r >> 21U) & 0x1U;
310}
311static inline u32 gr_status_mask_r(void)
312{
313 return 0x00400610U;
314}
315static inline u32 gr_status_1_r(void)
316{
317 return 0x00400604U;
318}
319static inline u32 gr_status_2_r(void)
320{
321 return 0x00400608U;
322}
323static inline u32 gr_engine_status_r(void)
324{
325 return 0x0040060cU;
326}
327static inline u32 gr_engine_status_value_busy_f(void)
328{
329 return 0x1U;
330}
331static inline u32 gr_pri_be0_becs_be_exception_r(void)
332{
333 return 0x00410204U;
334}
335static inline u32 gr_pri_be0_becs_be_exception_en_r(void)
336{
337 return 0x00410208U;
338}
339static inline u32 gr_pri_gpc0_gpccs_gpc_exception_r(void)
340{
341 return 0x00502c90U;
342}
343static inline u32 gr_pri_gpc0_gpccs_gpc_exception_en_r(void)
344{
345 return 0x00502c94U;
346}
347static inline u32 gr_pri_gpc0_tpc0_tpccs_tpc_exception_r(void)
348{
349 return 0x00504508U;
350}
351static inline u32 gr_pri_gpc0_tpc0_tpccs_tpc_exception_en_r(void)
352{
353 return 0x0050450cU;
354}
355static inline u32 gr_activity_0_r(void)
356{
357 return 0x00400380U;
358}
359static inline u32 gr_activity_1_r(void)
360{
361 return 0x00400384U;
362}
363static inline u32 gr_activity_2_r(void)
364{
365 return 0x00400388U;
366}
367static inline u32 gr_activity_4_r(void)
368{
369 return 0x00400390U;
370}
371static inline u32 gr_activity_4_gpc0_s(void)
372{
373 return 3U;
374}
375static inline u32 gr_activity_4_gpc0_f(u32 v)
376{
377 return (v & 0x7U) << 0U;
378}
379static inline u32 gr_activity_4_gpc0_m(void)
380{
381 return 0x7U << 0U;
382}
383static inline u32 gr_activity_4_gpc0_v(u32 r)
384{
385 return (r >> 0U) & 0x7U;
386}
387static inline u32 gr_activity_4_gpc0_empty_v(void)
388{
389 return 0x00000000U;
390}
391static inline u32 gr_activity_4_gpc0_preempted_v(void)
392{
393 return 0x00000004U;
394}
395static inline u32 gr_pri_gpc0_gcc_dbg_r(void)
396{
397 return 0x00501000U;
398}
399static inline u32 gr_pri_gpcs_gcc_dbg_r(void)
400{
401 return 0x00419000U;
402}
403static inline u32 gr_pri_gpcs_gcc_dbg_invalidate_m(void)
404{
405 return 0x1U << 1U;
406}
407static inline u32 gr_pri_gpc0_tpc0_sm_cache_control_r(void)
408{
409 return 0x005046a4U;
410}
411static inline u32 gr_pri_gpcs_tpcs_sm_cache_control_r(void)
412{
413 return 0x00419ea4U;
414}
415static inline u32 gr_pri_gpcs_tpcs_sm_cache_control_invalidate_cache_m(void)
416{
417 return 0x1U << 0U;
418}
419static inline u32 gr_pri_sked_activity_r(void)
420{
421 return 0x00407054U;
422}
423static inline u32 gr_pri_gpc0_gpccs_gpc_activity0_r(void)
424{
425 return 0x00502c80U;
426}
427static inline u32 gr_pri_gpc0_gpccs_gpc_activity1_r(void)
428{
429 return 0x00502c84U;
430}
431static inline u32 gr_pri_gpc0_gpccs_gpc_activity2_r(void)
432{
433 return 0x00502c88U;
434}
435static inline u32 gr_pri_gpc0_gpccs_gpc_activity3_r(void)
436{
437 return 0x00502c8cU;
438}
439static inline u32 gr_pri_gpc0_tpc0_tpccs_tpc_activity_0_r(void)
440{
441 return 0x00504500U;
442}
443static inline u32 gr_pri_gpc0_tpc1_tpccs_tpc_activity_0_r(void)
444{
445 return 0x00504d00U;
446}
447static inline u32 gr_pri_gpc0_tpcs_tpccs_tpc_activity_0_r(void)
448{
449 return 0x00501d00U;
450}
451static inline u32 gr_pri_gpcs_gpccs_gpc_activity_0_r(void)
452{
453 return 0x0041ac80U;
454}
455static inline u32 gr_pri_gpcs_gpccs_gpc_activity_1_r(void)
456{
457 return 0x0041ac84U;
458}
459static inline u32 gr_pri_gpcs_gpccs_gpc_activity_2_r(void)
460{
461 return 0x0041ac88U;
462}
463static inline u32 gr_pri_gpcs_gpccs_gpc_activity_3_r(void)
464{
465 return 0x0041ac8cU;
466}
467static inline u32 gr_pri_gpcs_tpc0_tpccs_tpc_activity_0_r(void)
468{
469 return 0x0041c500U;
470}
471static inline u32 gr_pri_gpcs_tpc1_tpccs_tpc_activity_0_r(void)
472{
473 return 0x0041cd00U;
474}
475static inline u32 gr_pri_gpcs_tpcs_tpccs_tpc_activity_0_r(void)
476{
477 return 0x00419d00U;
478}
479static inline u32 gr_pri_be0_becs_be_activity0_r(void)
480{
481 return 0x00410200U;
482}
483static inline u32 gr_pri_be1_becs_be_activity0_r(void)
484{
485 return 0x00410600U;
486}
487static inline u32 gr_pri_bes_becs_be_activity0_r(void)
488{
489 return 0x00408a00U;
490}
491static inline u32 gr_pri_ds_mpipe_status_r(void)
492{
493 return 0x00405858U;
494}
495static inline u32 gr_pri_fe_go_idle_info_r(void)
496{
497 return 0x00404194U;
498}
499static inline u32 gr_pri_gpc0_tpc0_tex_m_tex_subunits_status_r(void)
500{
501 return 0x00504238U;
502}
503static inline u32 gr_pri_gpc0_tpc0_sm_lrf_ecc_status_r(void)
504{
505 return 0x005046b8U;
506}
507static inline u32 gr_pri_gpc0_tpc0_sm_lrf_ecc_status_single_err_detected_qrfdp0_b(void)
508{
509 return 4U;
510}
511static inline u32 gr_pri_gpc0_tpc0_sm_lrf_ecc_status_single_err_detected_qrfdp0_pending_f(void)
512{
513 return 0x10U;
514}
515static inline u32 gr_pri_gpc0_tpc0_sm_lrf_ecc_status_single_err_detected_qrfdp1_pending_f(void)
516{
517 return 0x20U;
518}
519static inline u32 gr_pri_gpc0_tpc0_sm_lrf_ecc_status_single_err_detected_qrfdp2_pending_f(void)
520{
521 return 0x40U;
522}
523static inline u32 gr_pri_gpc0_tpc0_sm_lrf_ecc_status_single_err_detected_qrfdp3_pending_f(void)
524{
525 return 0x80U;
526}
527static inline u32 gr_pri_gpc0_tpc0_sm_lrf_ecc_status_double_err_detected_qrfdp0_b(void)
528{
529 return 8U;
530}
531static inline u32 gr_pri_gpc0_tpc0_sm_lrf_ecc_status_double_err_detected_qrfdp0_pending_f(void)
532{
533 return 0x100U;
534}
535static inline u32 gr_pri_gpc0_tpc0_sm_lrf_ecc_status_double_err_detected_qrfdp1_pending_f(void)
536{
537 return 0x200U;
538}
539static inline u32 gr_pri_gpc0_tpc0_sm_lrf_ecc_status_double_err_detected_qrfdp2_pending_f(void)
540{
541 return 0x400U;
542}
543static inline u32 gr_pri_gpc0_tpc0_sm_lrf_ecc_status_double_err_detected_qrfdp3_pending_f(void)
544{
545 return 0x800U;
546}
547static inline u32 gr_pri_gpc0_tpc0_sm_shm_ecc_status_r(void)
548{
549 return 0x005044a0U;
550}
551static inline u32 gr_pri_gpc0_tpc0_sm_shm_ecc_status_single_err_corrected_shm0_pending_f(void)
552{
553 return 0x1U;
554}
555static inline u32 gr_pri_gpc0_tpc0_sm_shm_ecc_status_single_err_corrected_shm1_pending_f(void)
556{
557 return 0x2U;
558}
559static inline u32 gr_pri_gpc0_tpc0_sm_shm_ecc_status_single_err_detected_shm0_pending_f(void)
560{
561 return 0x10U;
562}
563static inline u32 gr_pri_gpc0_tpc0_sm_shm_ecc_status_single_err_detected_shm1_pending_f(void)
564{
565 return 0x20U;
566}
567static inline u32 gr_pri_gpc0_tpc0_sm_shm_ecc_status_double_err_detected_shm0_pending_f(void)
568{
569 return 0x100U;
570}
571static inline u32 gr_pri_gpc0_tpc0_sm_shm_ecc_status_double_err_detected_shm1_pending_f(void)
572{
573 return 0x200U;
574}
575static inline u32 gr_pri_gpc0_tpc0_sm_lrf_ecc_single_err_count_r(void)
576{
577 return 0x005046bcU;
578}
579static inline u32 gr_pri_gpc0_tpc0_sm_lrf_ecc_double_err_count_r(void)
580{
581 return 0x005046c0U;
582}
583static inline u32 gr_pri_gpc0_tpc0_sm_shm_ecc_err_count_r(void)
584{
585 return 0x005044a4U;
586}
587static inline u32 gr_pri_gpc0_tpc0_sm_shm_ecc_err_count_single_corrected_m(void)
588{
589 return 0xffU << 0U;
590}
591static inline u32 gr_pri_gpc0_tpc0_sm_shm_ecc_err_count_single_corrected_v(u32 r)
592{
593 return (r >> 0U) & 0xffU;
594}
595static inline u32 gr_pri_gpc0_tpc0_sm_shm_ecc_err_count_single_detected_m(void)
596{
597 return 0xffU << 8U;
598}
599static inline u32 gr_pri_gpc0_tpc0_sm_shm_ecc_err_count_single_detected_v(u32 r)
600{
601 return (r >> 8U) & 0xffU;
602}
603static inline u32 gr_pri_gpc0_tpc0_sm_shm_ecc_err_count_double_detected_m(void)
604{
605 return 0xffU << 16U;
606}
607static inline u32 gr_pri_gpc0_tpc0_sm_shm_ecc_err_count_double_detected_v(u32 r)
608{
609 return (r >> 16U) & 0xffU;
610}
611static inline u32 gr_pri_gpc0_tpc0_tex_m_routing_r(void)
612{
613 return 0x005042c4U;
614}
615static inline u32 gr_pri_gpc0_tpc0_tex_m_routing_sel_default_f(void)
616{
617 return 0x0U;
618}
619static inline u32 gr_pri_gpc0_tpc0_tex_m_routing_sel_pipe0_f(void)
620{
621 return 0x1U;
622}
623static inline u32 gr_pri_gpc0_tpc0_tex_m_routing_sel_pipe1_f(void)
624{
625 return 0x2U;
626}
627static inline u32 gr_pri_gpc0_tpc0_tex_m_ecc_cnt_total_r(void)
628{
629 return 0x00504218U;
630}
631static inline u32 gr_pri_gpc0_tpc0_tex_m_ecc_cnt_total_sec_m(void)
632{
633 return 0xffffU << 0U;
634}
635static inline u32 gr_pri_gpc0_tpc0_tex_m_ecc_cnt_total_sec_v(u32 r)
636{
637 return (r >> 0U) & 0xffffU;
638}
639static inline u32 gr_pri_gpc0_tpc0_tex_m_ecc_cnt_total_ded_m(void)
640{
641 return 0xffffU << 16U;
642}
643static inline u32 gr_pri_gpc0_tpc0_tex_m_ecc_cnt_total_ded_v(u32 r)
644{
645 return (r >> 16U) & 0xffffU;
646}
647static inline u32 gr_pri_gpc0_tpc0_tex_m_ecc_cnt_unique_r(void)
648{
649 return 0x005042ecU;
650}
651static inline u32 gr_pri_gpc0_tpc0_tex_m_ecc_cnt_unique_sec_m(void)
652{
653 return 0xffffU << 0U;
654}
655static inline u32 gr_pri_gpc0_tpc0_tex_m_ecc_cnt_unique_sec_v(u32 r)
656{
657 return (r >> 0U) & 0xffffU;
658}
659static inline u32 gr_pri_gpc0_tpc0_tex_m_ecc_cnt_unique_ded_m(void)
660{
661 return 0xffffU << 16U;
662}
663static inline u32 gr_pri_gpc0_tpc0_tex_m_ecc_cnt_unique_ded_v(u32 r)
664{
665 return (r >> 16U) & 0xffffU;
666}
667static inline u32 gr_pri_be0_crop_status1_r(void)
668{
669 return 0x00410134U;
670}
671static inline u32 gr_pri_bes_crop_status1_r(void)
672{
673 return 0x00408934U;
674}
675static inline u32 gr_pri_be0_zrop_status_r(void)
676{
677 return 0x00410048U;
678}
679static inline u32 gr_pri_be0_zrop_status2_r(void)
680{
681 return 0x0041004cU;
682}
683static inline u32 gr_pri_bes_zrop_status_r(void)
684{
685 return 0x00408848U;
686}
687static inline u32 gr_pri_bes_zrop_status2_r(void)
688{
689 return 0x0040884cU;
690}
691static inline u32 gr_pipe_bundle_address_r(void)
692{
693 return 0x00400200U;
694}
695static inline u32 gr_pipe_bundle_address_value_v(u32 r)
696{
697 return (r >> 0U) & 0xffffU;
698}
699static inline u32 gr_pipe_bundle_data_r(void)
700{
701 return 0x00400204U;
702}
703static inline u32 gr_pipe_bundle_config_r(void)
704{
705 return 0x00400208U;
706}
707static inline u32 gr_pipe_bundle_config_override_pipe_mode_disabled_f(void)
708{
709 return 0x0U;
710}
711static inline u32 gr_pipe_bundle_config_override_pipe_mode_enabled_f(void)
712{
713 return 0x80000000U;
714}
715static inline u32 gr_fe_hww_esr_r(void)
716{
717 return 0x00404000U;
718}
719static inline u32 gr_fe_hww_esr_reset_active_f(void)
720{
721 return 0x40000000U;
722}
723static inline u32 gr_fe_hww_esr_en_enable_f(void)
724{
725 return 0x80000000U;
726}
727static inline u32 gr_fe_go_idle_timeout_r(void)
728{
729 return 0x00404154U;
730}
731static inline u32 gr_fe_go_idle_timeout_count_f(u32 v)
732{
733 return (v & 0xffffffffU) << 0U;
734}
735static inline u32 gr_fe_go_idle_timeout_count_disabled_f(void)
736{
737 return 0x0U;
738}
739static inline u32 gr_fe_go_idle_timeout_count_prod_f(void)
740{
741 return 0x7fffffffU;
742}
743static inline u32 gr_fe_object_table_r(u32 i)
744{
745 return 0x00404200U + i*4U;
746}
747static inline u32 gr_fe_object_table_nvclass_v(u32 r)
748{
749 return (r >> 0U) & 0xffffU;
750}
751static inline u32 gr_fe_tpc_fs_r(void)
752{
753 return 0x004041c4U;
754}
755static inline u32 gr_pri_mme_shadow_raw_index_r(void)
756{
757 return 0x00404488U;
758}
759static inline u32 gr_pri_mme_shadow_raw_index_write_trigger_f(void)
760{
761 return 0x80000000U;
762}
763static inline u32 gr_pri_mme_shadow_raw_data_r(void)
764{
765 return 0x0040448cU;
766}
767static inline u32 gr_mme_hww_esr_r(void)
768{
769 return 0x00404490U;
770}
771static inline u32 gr_mme_hww_esr_reset_active_f(void)
772{
773 return 0x40000000U;
774}
775static inline u32 gr_mme_hww_esr_en_enable_f(void)
776{
777 return 0x80000000U;
778}
779static inline u32 gr_memfmt_hww_esr_r(void)
780{
781 return 0x00404600U;
782}
783static inline u32 gr_memfmt_hww_esr_reset_active_f(void)
784{
785 return 0x40000000U;
786}
787static inline u32 gr_memfmt_hww_esr_en_enable_f(void)
788{
789 return 0x80000000U;
790}
791static inline u32 gr_fecs_cpuctl_r(void)
792{
793 return 0x00409100U;
794}
795static inline u32 gr_fecs_cpuctl_startcpu_f(u32 v)
796{
797 return (v & 0x1U) << 1U;
798}
799static inline u32 gr_fecs_cpuctl_alias_r(void)
800{
801 return 0x00409130U;
802}
803static inline u32 gr_fecs_cpuctl_alias_startcpu_f(u32 v)
804{
805 return (v & 0x1U) << 1U;
806}
807static inline u32 gr_fecs_dmactl_r(void)
808{
809 return 0x0040910cU;
810}
811static inline u32 gr_fecs_dmactl_require_ctx_f(u32 v)
812{
813 return (v & 0x1U) << 0U;
814}
815static inline u32 gr_fecs_dmactl_dmem_scrubbing_m(void)
816{
817 return 0x1U << 1U;
818}
819static inline u32 gr_fecs_dmactl_imem_scrubbing_m(void)
820{
821 return 0x1U << 2U;
822}
823static inline u32 gr_fecs_os_r(void)
824{
825 return 0x00409080U;
826}
827static inline u32 gr_fecs_idlestate_r(void)
828{
829 return 0x0040904cU;
830}
831static inline u32 gr_fecs_mailbox0_r(void)
832{
833 return 0x00409040U;
834}
835static inline u32 gr_fecs_mailbox1_r(void)
836{
837 return 0x00409044U;
838}
839static inline u32 gr_fecs_irqstat_r(void)
840{
841 return 0x00409008U;
842}
843static inline u32 gr_fecs_irqmode_r(void)
844{
845 return 0x0040900cU;
846}
847static inline u32 gr_fecs_irqmask_r(void)
848{
849 return 0x00409018U;
850}
851static inline u32 gr_fecs_irqdest_r(void)
852{
853 return 0x0040901cU;
854}
855static inline u32 gr_fecs_curctx_r(void)
856{
857 return 0x00409050U;
858}
859static inline u32 gr_fecs_nxtctx_r(void)
860{
861 return 0x00409054U;
862}
863static inline u32 gr_fecs_engctl_r(void)
864{
865 return 0x004090a4U;
866}
867static inline u32 gr_fecs_debug1_r(void)
868{
869 return 0x00409090U;
870}
871static inline u32 gr_fecs_debuginfo_r(void)
872{
873 return 0x00409094U;
874}
875static inline u32 gr_fecs_icd_cmd_r(void)
876{
877 return 0x00409200U;
878}
879static inline u32 gr_fecs_icd_cmd_opc_s(void)
880{
881 return 4U;
882}
883static inline u32 gr_fecs_icd_cmd_opc_f(u32 v)
884{
885 return (v & 0xfU) << 0U;
886}
887static inline u32 gr_fecs_icd_cmd_opc_m(void)
888{
889 return 0xfU << 0U;
890}
891static inline u32 gr_fecs_icd_cmd_opc_v(u32 r)
892{
893 return (r >> 0U) & 0xfU;
894}
895static inline u32 gr_fecs_icd_cmd_opc_rreg_f(void)
896{
897 return 0x8U;
898}
899static inline u32 gr_fecs_icd_cmd_opc_rstat_f(void)
900{
901 return 0xeU;
902}
903static inline u32 gr_fecs_icd_cmd_idx_f(u32 v)
904{
905 return (v & 0x1fU) << 8U;
906}
907static inline u32 gr_fecs_icd_rdata_r(void)
908{
909 return 0x0040920cU;
910}
911static inline u32 gr_fecs_imemc_r(u32 i)
912{
913 return 0x00409180U + i*16U;
914}
915static inline u32 gr_fecs_imemc_offs_f(u32 v)
916{
917 return (v & 0x3fU) << 2U;
918}
919static inline u32 gr_fecs_imemc_blk_f(u32 v)
920{
921 return (v & 0xffU) << 8U;
922}
923static inline u32 gr_fecs_imemc_aincw_f(u32 v)
924{
925 return (v & 0x1U) << 24U;
926}
927static inline u32 gr_fecs_imemd_r(u32 i)
928{
929 return 0x00409184U + i*16U;
930}
931static inline u32 gr_fecs_imemt_r(u32 i)
932{
933 return 0x00409188U + i*16U;
934}
935static inline u32 gr_fecs_imemt_tag_f(u32 v)
936{
937 return (v & 0xffffU) << 0U;
938}
939static inline u32 gr_fecs_dmemc_r(u32 i)
940{
941 return 0x004091c0U + i*8U;
942}
943static inline u32 gr_fecs_dmemc_offs_s(void)
944{
945 return 6U;
946}
947static inline u32 gr_fecs_dmemc_offs_f(u32 v)
948{
949 return (v & 0x3fU) << 2U;
950}
951static inline u32 gr_fecs_dmemc_offs_m(void)
952{
953 return 0x3fU << 2U;
954}
955static inline u32 gr_fecs_dmemc_offs_v(u32 r)
956{
957 return (r >> 2U) & 0x3fU;
958}
959static inline u32 gr_fecs_dmemc_blk_f(u32 v)
960{
961 return (v & 0xffU) << 8U;
962}
963static inline u32 gr_fecs_dmemc_aincw_f(u32 v)
964{
965 return (v & 0x1U) << 24U;
966}
967static inline u32 gr_fecs_dmemd_r(u32 i)
968{
969 return 0x004091c4U + i*8U;
970}
971static inline u32 gr_fecs_dmatrfbase_r(void)
972{
973 return 0x00409110U;
974}
975static inline u32 gr_fecs_dmatrfmoffs_r(void)
976{
977 return 0x00409114U;
978}
979static inline u32 gr_fecs_dmatrffboffs_r(void)
980{
981 return 0x0040911cU;
982}
983static inline u32 gr_fecs_dmatrfcmd_r(void)
984{
985 return 0x00409118U;
986}
987static inline u32 gr_fecs_dmatrfcmd_imem_f(u32 v)
988{
989 return (v & 0x1U) << 4U;
990}
991static inline u32 gr_fecs_dmatrfcmd_write_f(u32 v)
992{
993 return (v & 0x1U) << 5U;
994}
995static inline u32 gr_fecs_dmatrfcmd_size_f(u32 v)
996{
997 return (v & 0x7U) << 8U;
998}
999static inline u32 gr_fecs_dmatrfcmd_ctxdma_f(u32 v)
1000{
1001 return (v & 0x7U) << 12U;
1002}
1003static inline u32 gr_fecs_bootvec_r(void)
1004{
1005 return 0x00409104U;
1006}
1007static inline u32 gr_fecs_bootvec_vec_f(u32 v)
1008{
1009 return (v & 0xffffffffU) << 0U;
1010}
1011static inline u32 gr_fecs_falcon_hwcfg_r(void)
1012{
1013 return 0x00409108U;
1014}
1015static inline u32 gr_gpcs_gpccs_falcon_hwcfg_r(void)
1016{
1017 return 0x0041a108U;
1018}
1019static inline u32 gr_fecs_falcon_rm_r(void)
1020{
1021 return 0x00409084U;
1022}
1023static inline u32 gr_fecs_current_ctx_r(void)
1024{
1025 return 0x00409b00U;
1026}
1027static inline u32 gr_fecs_current_ctx_ptr_f(u32 v)
1028{
1029 return (v & 0xfffffffU) << 0U;
1030}
1031static inline u32 gr_fecs_current_ctx_ptr_v(u32 r)
1032{
1033 return (r >> 0U) & 0xfffffffU;
1034}
1035static inline u32 gr_fecs_current_ctx_target_s(void)
1036{
1037 return 2U;
1038}
1039static inline u32 gr_fecs_current_ctx_target_f(u32 v)
1040{
1041 return (v & 0x3U) << 28U;
1042}
1043static inline u32 gr_fecs_current_ctx_target_m(void)
1044{
1045 return 0x3U << 28U;
1046}
1047static inline u32 gr_fecs_current_ctx_target_v(u32 r)
1048{
1049 return (r >> 28U) & 0x3U;
1050}
1051static inline u32 gr_fecs_current_ctx_target_vid_mem_f(void)
1052{
1053 return 0x0U;
1054}
1055static inline u32 gr_fecs_current_ctx_target_sys_mem_coh_f(void)
1056{
1057 return 0x20000000U;
1058}
1059static inline u32 gr_fecs_current_ctx_target_sys_mem_ncoh_f(void)
1060{
1061 return 0x30000000U;
1062}
1063static inline u32 gr_fecs_current_ctx_valid_s(void)
1064{
1065 return 1U;
1066}
1067static inline u32 gr_fecs_current_ctx_valid_f(u32 v)
1068{
1069 return (v & 0x1U) << 31U;
1070}
1071static inline u32 gr_fecs_current_ctx_valid_m(void)
1072{
1073 return 0x1U << 31U;
1074}
1075static inline u32 gr_fecs_current_ctx_valid_v(u32 r)
1076{
1077 return (r >> 31U) & 0x1U;
1078}
1079static inline u32 gr_fecs_current_ctx_valid_false_f(void)
1080{
1081 return 0x0U;
1082}
1083static inline u32 gr_fecs_method_data_r(void)
1084{
1085 return 0x00409500U;
1086}
1087static inline u32 gr_fecs_method_push_r(void)
1088{
1089 return 0x00409504U;
1090}
1091static inline u32 gr_fecs_method_push_adr_f(u32 v)
1092{
1093 return (v & 0xfffU) << 0U;
1094}
1095static inline u32 gr_fecs_method_push_adr_bind_pointer_v(void)
1096{
1097 return 0x00000003U;
1098}
1099static inline u32 gr_fecs_method_push_adr_bind_pointer_f(void)
1100{
1101 return 0x3U;
1102}
1103static inline u32 gr_fecs_method_push_adr_discover_image_size_v(void)
1104{
1105 return 0x00000010U;
1106}
1107static inline u32 gr_fecs_method_push_adr_wfi_golden_save_v(void)
1108{
1109 return 0x00000009U;
1110}
1111static inline u32 gr_fecs_method_push_adr_restore_golden_v(void)
1112{
1113 return 0x00000015U;
1114}
1115static inline u32 gr_fecs_method_push_adr_discover_zcull_image_size_v(void)
1116{
1117 return 0x00000016U;
1118}
1119static inline u32 gr_fecs_method_push_adr_discover_pm_image_size_v(void)
1120{
1121 return 0x00000025U;
1122}
1123static inline u32 gr_fecs_method_push_adr_discover_reglist_image_size_v(void)
1124{
1125 return 0x00000030U;
1126}
1127static inline u32 gr_fecs_method_push_adr_set_reglist_bind_instance_v(void)
1128{
1129 return 0x00000031U;
1130}
1131static inline u32 gr_fecs_method_push_adr_set_reglist_virtual_address_v(void)
1132{
1133 return 0x00000032U;
1134}
1135static inline u32 gr_fecs_method_push_adr_stop_ctxsw_v(void)
1136{
1137 return 0x00000038U;
1138}
1139static inline u32 gr_fecs_method_push_adr_start_ctxsw_v(void)
1140{
1141 return 0x00000039U;
1142}
1143static inline u32 gr_fecs_method_push_adr_set_watchdog_timeout_f(void)
1144{
1145 return 0x21U;
1146}
1147static inline u32 gr_fecs_method_push_adr_write_timestamp_record_v(void)
1148{
1149 return 0x0000003dU;
1150}
1151static inline u32 gr_fecs_method_push_adr_discover_preemption_image_size_v(void)
1152{
1153 return 0x0000001aU;
1154}
1155static inline u32 gr_fecs_method_push_adr_halt_pipeline_v(void)
1156{
1157 return 0x00000004U;
1158}
1159static inline u32 gr_fecs_method_push_adr_configure_interrupt_completion_option_v(void)
1160{
1161 return 0x0000003aU;
1162}
1163static inline u32 gr_fecs_host_int_status_r(void)
1164{
1165 return 0x00409c18U;
1166}
1167static inline u32 gr_fecs_host_int_status_fault_during_ctxsw_f(u32 v)
1168{
1169 return (v & 0x1U) << 16U;
1170}
1171static inline u32 gr_fecs_host_int_status_umimp_firmware_method_f(u32 v)
1172{
1173 return (v & 0x1U) << 17U;
1174}
1175static inline u32 gr_fecs_host_int_status_umimp_illegal_method_f(u32 v)
1176{
1177 return (v & 0x1U) << 18U;
1178}
1179static inline u32 gr_fecs_host_int_status_ctxsw_intr_f(u32 v)
1180{
1181 return (v & 0xffffU) << 0U;
1182}
1183static inline u32 gr_fecs_host_int_clear_r(void)
1184{
1185 return 0x00409c20U;
1186}
1187static inline u32 gr_fecs_host_int_clear_ctxsw_intr1_f(u32 v)
1188{
1189 return (v & 0x1U) << 1U;
1190}
1191static inline u32 gr_fecs_host_int_clear_ctxsw_intr1_clear_f(void)
1192{
1193 return 0x2U;
1194}
1195static inline u32 gr_fecs_host_int_enable_r(void)
1196{
1197 return 0x00409c24U;
1198}
1199static inline u32 gr_fecs_host_int_enable_ctxsw_intr1_enable_f(void)
1200{
1201 return 0x2U;
1202}
1203static inline u32 gr_fecs_host_int_enable_fault_during_ctxsw_enable_f(void)
1204{
1205 return 0x10000U;
1206}
1207static inline u32 gr_fecs_host_int_enable_umimp_firmware_method_enable_f(void)
1208{
1209 return 0x20000U;
1210}
1211static inline u32 gr_fecs_host_int_enable_umimp_illegal_method_enable_f(void)
1212{
1213 return 0x40000U;
1214}
1215static inline u32 gr_fecs_host_int_enable_watchdog_enable_f(void)
1216{
1217 return 0x80000U;
1218}
1219static inline u32 gr_fecs_ctxsw_reset_ctl_r(void)
1220{
1221 return 0x00409614U;
1222}
1223static inline u32 gr_fecs_ctxsw_reset_ctl_sys_halt_disabled_f(void)
1224{
1225 return 0x0U;
1226}
1227static inline u32 gr_fecs_ctxsw_reset_ctl_gpc_halt_disabled_f(void)
1228{
1229 return 0x0U;
1230}
1231static inline u32 gr_fecs_ctxsw_reset_ctl_be_halt_disabled_f(void)
1232{
1233 return 0x0U;
1234}
1235static inline u32 gr_fecs_ctxsw_reset_ctl_sys_engine_reset_disabled_f(void)
1236{
1237 return 0x10U;
1238}
1239static inline u32 gr_fecs_ctxsw_reset_ctl_gpc_engine_reset_disabled_f(void)
1240{
1241 return 0x20U;
1242}
1243static inline u32 gr_fecs_ctxsw_reset_ctl_be_engine_reset_disabled_f(void)
1244{
1245 return 0x40U;
1246}
1247static inline u32 gr_fecs_ctxsw_reset_ctl_sys_context_reset_enabled_f(void)
1248{
1249 return 0x0U;
1250}
1251static inline u32 gr_fecs_ctxsw_reset_ctl_sys_context_reset_disabled_f(void)
1252{
1253 return 0x100U;
1254}
1255static inline u32 gr_fecs_ctxsw_reset_ctl_gpc_context_reset_enabled_f(void)
1256{
1257 return 0x0U;
1258}
1259static inline u32 gr_fecs_ctxsw_reset_ctl_gpc_context_reset_disabled_f(void)
1260{
1261 return 0x200U;
1262}
1263static inline u32 gr_fecs_ctxsw_reset_ctl_be_context_reset_s(void)
1264{
1265 return 1U;
1266}
1267static inline u32 gr_fecs_ctxsw_reset_ctl_be_context_reset_f(u32 v)
1268{
1269 return (v & 0x1U) << 10U;
1270}
1271static inline u32 gr_fecs_ctxsw_reset_ctl_be_context_reset_m(void)
1272{
1273 return 0x1U << 10U;
1274}
1275static inline u32 gr_fecs_ctxsw_reset_ctl_be_context_reset_v(u32 r)
1276{
1277 return (r >> 10U) & 0x1U;
1278}
1279static inline u32 gr_fecs_ctxsw_reset_ctl_be_context_reset_enabled_f(void)
1280{
1281 return 0x0U;
1282}
1283static inline u32 gr_fecs_ctxsw_reset_ctl_be_context_reset_disabled_f(void)
1284{
1285 return 0x400U;
1286}
1287static inline u32 gr_fecs_ctx_state_store_major_rev_id_r(void)
1288{
1289 return 0x0040960cU;
1290}
1291static inline u32 gr_fecs_ctxsw_mailbox_r(u32 i)
1292{
1293 return 0x00409800U + i*4U;
1294}
1295static inline u32 gr_fecs_ctxsw_mailbox__size_1_v(void)
1296{
1297 return 0x00000010U;
1298}
1299static inline u32 gr_fecs_ctxsw_mailbox_value_f(u32 v)
1300{
1301 return (v & 0xffffffffU) << 0U;
1302}
1303static inline u32 gr_fecs_ctxsw_mailbox_value_pass_v(void)
1304{
1305 return 0x00000001U;
1306}
1307static inline u32 gr_fecs_ctxsw_mailbox_value_fail_v(void)
1308{
1309 return 0x00000002U;
1310}
1311static inline u32 gr_fecs_ctxsw_mailbox_set_r(u32 i)
1312{
1313 return 0x004098c0U + i*4U;
1314}
1315static inline u32 gr_fecs_ctxsw_mailbox_set_value_f(u32 v)
1316{
1317 return (v & 0xffffffffU) << 0U;
1318}
1319static inline u32 gr_fecs_ctxsw_mailbox_clear_r(u32 i)
1320{
1321 return 0x00409840U + i*4U;
1322}
1323static inline u32 gr_fecs_ctxsw_mailbox_clear_value_f(u32 v)
1324{
1325 return (v & 0xffffffffU) << 0U;
1326}
1327static inline u32 gr_fecs_fs_r(void)
1328{
1329 return 0x00409604U;
1330}
1331static inline u32 gr_fecs_fs_num_available_gpcs_s(void)
1332{
1333 return 5U;
1334}
1335static inline u32 gr_fecs_fs_num_available_gpcs_f(u32 v)
1336{
1337 return (v & 0x1fU) << 0U;
1338}
1339static inline u32 gr_fecs_fs_num_available_gpcs_m(void)
1340{
1341 return 0x1fU << 0U;
1342}
1343static inline u32 gr_fecs_fs_num_available_gpcs_v(u32 r)
1344{
1345 return (r >> 0U) & 0x1fU;
1346}
1347static inline u32 gr_fecs_fs_num_available_fbps_s(void)
1348{
1349 return 5U;
1350}
1351static inline u32 gr_fecs_fs_num_available_fbps_f(u32 v)
1352{
1353 return (v & 0x1fU) << 16U;
1354}
1355static inline u32 gr_fecs_fs_num_available_fbps_m(void)
1356{
1357 return 0x1fU << 16U;
1358}
1359static inline u32 gr_fecs_fs_num_available_fbps_v(u32 r)
1360{
1361 return (r >> 16U) & 0x1fU;
1362}
1363static inline u32 gr_fecs_cfg_r(void)
1364{
1365 return 0x00409620U;
1366}
1367static inline u32 gr_fecs_cfg_imem_sz_v(u32 r)
1368{
1369 return (r >> 0U) & 0xffU;
1370}
1371static inline u32 gr_fecs_rc_lanes_r(void)
1372{
1373 return 0x00409880U;
1374}
1375static inline u32 gr_fecs_rc_lanes_num_chains_s(void)
1376{
1377 return 6U;
1378}
1379static inline u32 gr_fecs_rc_lanes_num_chains_f(u32 v)
1380{
1381 return (v & 0x3fU) << 0U;
1382}
1383static inline u32 gr_fecs_rc_lanes_num_chains_m(void)
1384{
1385 return 0x3fU << 0U;
1386}
1387static inline u32 gr_fecs_rc_lanes_num_chains_v(u32 r)
1388{
1389 return (r >> 0U) & 0x3fU;
1390}
1391static inline u32 gr_fecs_ctxsw_status_1_r(void)
1392{
1393 return 0x00409400U;
1394}
1395static inline u32 gr_fecs_ctxsw_status_1_arb_busy_s(void)
1396{
1397 return 1U;
1398}
1399static inline u32 gr_fecs_ctxsw_status_1_arb_busy_f(u32 v)
1400{
1401 return (v & 0x1U) << 12U;
1402}
1403static inline u32 gr_fecs_ctxsw_status_1_arb_busy_m(void)
1404{
1405 return 0x1U << 12U;
1406}
1407static inline u32 gr_fecs_ctxsw_status_1_arb_busy_v(u32 r)
1408{
1409 return (r >> 12U) & 0x1U;
1410}
1411static inline u32 gr_fecs_arb_ctx_adr_r(void)
1412{
1413 return 0x00409a24U;
1414}
1415static inline u32 gr_fecs_new_ctx_r(void)
1416{
1417 return 0x00409b04U;
1418}
1419static inline u32 gr_fecs_new_ctx_ptr_s(void)
1420{
1421 return 28U;
1422}
1423static inline u32 gr_fecs_new_ctx_ptr_f(u32 v)
1424{
1425 return (v & 0xfffffffU) << 0U;
1426}
1427static inline u32 gr_fecs_new_ctx_ptr_m(void)
1428{
1429 return 0xfffffffU << 0U;
1430}
1431static inline u32 gr_fecs_new_ctx_ptr_v(u32 r)
1432{
1433 return (r >> 0U) & 0xfffffffU;
1434}
1435static inline u32 gr_fecs_new_ctx_target_s(void)
1436{
1437 return 2U;
1438}
1439static inline u32 gr_fecs_new_ctx_target_f(u32 v)
1440{
1441 return (v & 0x3U) << 28U;
1442}
1443static inline u32 gr_fecs_new_ctx_target_m(void)
1444{
1445 return 0x3U << 28U;
1446}
1447static inline u32 gr_fecs_new_ctx_target_v(u32 r)
1448{
1449 return (r >> 28U) & 0x3U;
1450}
1451static inline u32 gr_fecs_new_ctx_target_vid_mem_f(void)
1452{
1453 return 0x0U;
1454}
1455static inline u32 gr_fecs_new_ctx_target_sys_mem_ncoh_f(void)
1456{
1457 return 0x30000000U;
1458}
1459static inline u32 gr_fecs_new_ctx_valid_s(void)
1460{
1461 return 1U;
1462}
1463static inline u32 gr_fecs_new_ctx_valid_f(u32 v)
1464{
1465 return (v & 0x1U) << 31U;
1466}
1467static inline u32 gr_fecs_new_ctx_valid_m(void)
1468{
1469 return 0x1U << 31U;
1470}
1471static inline u32 gr_fecs_new_ctx_valid_v(u32 r)
1472{
1473 return (r >> 31U) & 0x1U;
1474}
1475static inline u32 gr_fecs_arb_ctx_ptr_r(void)
1476{
1477 return 0x00409a0cU;
1478}
1479static inline u32 gr_fecs_arb_ctx_ptr_ptr_s(void)
1480{
1481 return 28U;
1482}
1483static inline u32 gr_fecs_arb_ctx_ptr_ptr_f(u32 v)
1484{
1485 return (v & 0xfffffffU) << 0U;
1486}
1487static inline u32 gr_fecs_arb_ctx_ptr_ptr_m(void)
1488{
1489 return 0xfffffffU << 0U;
1490}
1491static inline u32 gr_fecs_arb_ctx_ptr_ptr_v(u32 r)
1492{
1493 return (r >> 0U) & 0xfffffffU;
1494}
1495static inline u32 gr_fecs_arb_ctx_ptr_target_s(void)
1496{
1497 return 2U;
1498}
1499static inline u32 gr_fecs_arb_ctx_ptr_target_f(u32 v)
1500{
1501 return (v & 0x3U) << 28U;
1502}
1503static inline u32 gr_fecs_arb_ctx_ptr_target_m(void)
1504{
1505 return 0x3U << 28U;
1506}
1507static inline u32 gr_fecs_arb_ctx_ptr_target_v(u32 r)
1508{
1509 return (r >> 28U) & 0x3U;
1510}
1511static inline u32 gr_fecs_arb_ctx_ptr_target_vid_mem_f(void)
1512{
1513 return 0x0U;
1514}
1515static inline u32 gr_fecs_arb_ctx_ptr_target_sys_mem_ncoh_f(void)
1516{
1517 return 0x30000000U;
1518}
1519static inline u32 gr_fecs_arb_ctx_cmd_r(void)
1520{
1521 return 0x00409a10U;
1522}
1523static inline u32 gr_fecs_arb_ctx_cmd_cmd_s(void)
1524{
1525 return 5U;
1526}
1527static inline u32 gr_fecs_arb_ctx_cmd_cmd_f(u32 v)
1528{
1529 return (v & 0x1fU) << 0U;
1530}
1531static inline u32 gr_fecs_arb_ctx_cmd_cmd_m(void)
1532{
1533 return 0x1fU << 0U;
1534}
1535static inline u32 gr_fecs_arb_ctx_cmd_cmd_v(u32 r)
1536{
1537 return (r >> 0U) & 0x1fU;
1538}
1539static inline u32 gr_fecs_ctxsw_status_fe_0_r(void)
1540{
1541 return 0x00409c00U;
1542}
1543static inline u32 gr_gpc0_gpccs_ctxsw_status_gpc_0_r(void)
1544{
1545 return 0x00502c04U;
1546}
1547static inline u32 gr_gpc0_gpccs_ctxsw_status_1_r(void)
1548{
1549 return 0x00502400U;
1550}
1551static inline u32 gr_fecs_ctxsw_idlestate_r(void)
1552{
1553 return 0x00409420U;
1554}
1555static inline u32 gr_fecs_feature_override_ecc_r(void)
1556{
1557 return 0x00409658U;
1558}
1559static inline u32 gr_fecs_feature_override_ecc_sm_lrf_override_v(u32 r)
1560{
1561 return (r >> 3U) & 0x1U;
1562}
1563static inline u32 gr_fecs_feature_override_ecc_sm_shm_override_v(u32 r)
1564{
1565 return (r >> 7U) & 0x1U;
1566}
1567static inline u32 gr_fecs_feature_override_ecc_tex_override_v(u32 r)
1568{
1569 return (r >> 11U) & 0x1U;
1570}
1571static inline u32 gr_fecs_feature_override_ecc_ltc_override_v(u32 r)
1572{
1573 return (r >> 15U) & 0x1U;
1574}
1575static inline u32 gr_fecs_feature_override_ecc_sm_lrf_v(u32 r)
1576{
1577 return (r >> 0U) & 0x1U;
1578}
1579static inline u32 gr_fecs_feature_override_ecc_sm_shm_v(u32 r)
1580{
1581 return (r >> 4U) & 0x1U;
1582}
1583static inline u32 gr_fecs_feature_override_ecc_tex_v(u32 r)
1584{
1585 return (r >> 8U) & 0x1U;
1586}
1587static inline u32 gr_fecs_feature_override_ecc_ltc_v(u32 r)
1588{
1589 return (r >> 12U) & 0x1U;
1590}
1591static inline u32 gr_gpc0_gpccs_ctxsw_idlestate_r(void)
1592{
1593 return 0x00502420U;
1594}
1595static inline u32 gr_rstr2d_gpc_map0_r(void)
1596{
1597 return 0x0040780cU;
1598}
1599static inline u32 gr_rstr2d_gpc_map1_r(void)
1600{
1601 return 0x00407810U;
1602}
1603static inline u32 gr_rstr2d_gpc_map2_r(void)
1604{
1605 return 0x00407814U;
1606}
1607static inline u32 gr_rstr2d_gpc_map3_r(void)
1608{
1609 return 0x00407818U;
1610}
1611static inline u32 gr_rstr2d_gpc_map4_r(void)
1612{
1613 return 0x0040781cU;
1614}
1615static inline u32 gr_rstr2d_gpc_map5_r(void)
1616{
1617 return 0x00407820U;
1618}
1619static inline u32 gr_rstr2d_map_table_cfg_r(void)
1620{
1621 return 0x004078bcU;
1622}
1623static inline u32 gr_rstr2d_map_table_cfg_row_offset_f(u32 v)
1624{
1625 return (v & 0xffU) << 0U;
1626}
1627static inline u32 gr_rstr2d_map_table_cfg_num_entries_f(u32 v)
1628{
1629 return (v & 0xffU) << 8U;
1630}
1631static inline u32 gr_pd_hww_esr_r(void)
1632{
1633 return 0x00406018U;
1634}
1635static inline u32 gr_pd_hww_esr_reset_active_f(void)
1636{
1637 return 0x40000000U;
1638}
1639static inline u32 gr_pd_hww_esr_en_enable_f(void)
1640{
1641 return 0x80000000U;
1642}
1643static inline u32 gr_pd_num_tpc_per_gpc_r(u32 i)
1644{
1645 return 0x00406028U + i*4U;
1646}
1647static inline u32 gr_pd_num_tpc_per_gpc__size_1_v(void)
1648{
1649 return 0x00000004U;
1650}
1651static inline u32 gr_pd_num_tpc_per_gpc_count0_f(u32 v)
1652{
1653 return (v & 0xfU) << 0U;
1654}
1655static inline u32 gr_pd_num_tpc_per_gpc_count1_f(u32 v)
1656{
1657 return (v & 0xfU) << 4U;
1658}
1659static inline u32 gr_pd_num_tpc_per_gpc_count2_f(u32 v)
1660{
1661 return (v & 0xfU) << 8U;
1662}
1663static inline u32 gr_pd_num_tpc_per_gpc_count3_f(u32 v)
1664{
1665 return (v & 0xfU) << 12U;
1666}
1667static inline u32 gr_pd_num_tpc_per_gpc_count4_f(u32 v)
1668{
1669 return (v & 0xfU) << 16U;
1670}
1671static inline u32 gr_pd_num_tpc_per_gpc_count5_f(u32 v)
1672{
1673 return (v & 0xfU) << 20U;
1674}
1675static inline u32 gr_pd_num_tpc_per_gpc_count6_f(u32 v)
1676{
1677 return (v & 0xfU) << 24U;
1678}
1679static inline u32 gr_pd_num_tpc_per_gpc_count7_f(u32 v)
1680{
1681 return (v & 0xfU) << 28U;
1682}
1683static inline u32 gr_pd_ab_dist_cfg0_r(void)
1684{
1685 return 0x004064c0U;
1686}
1687static inline u32 gr_pd_ab_dist_cfg0_timeslice_enable_en_f(void)
1688{
1689 return 0x80000000U;
1690}
1691static inline u32 gr_pd_ab_dist_cfg0_timeslice_enable_dis_f(void)
1692{
1693 return 0x0U;
1694}
1695static inline u32 gr_pd_ab_dist_cfg1_r(void)
1696{
1697 return 0x004064c4U;
1698}
1699static inline u32 gr_pd_ab_dist_cfg1_max_batches_f(u32 v)
1700{
1701 return (v & 0xffffU) << 0U;
1702}
1703static inline u32 gr_pd_ab_dist_cfg1_max_batches_init_f(void)
1704{
1705 return 0xffffU;
1706}
1707static inline u32 gr_pd_ab_dist_cfg1_max_output_f(u32 v)
1708{
1709 return (v & 0xffffU) << 16U;
1710}
1711static inline u32 gr_pd_ab_dist_cfg1_max_output_granularity_v(void)
1712{
1713 return 0x00000080U;
1714}
1715static inline u32 gr_pd_ab_dist_cfg2_r(void)
1716{
1717 return 0x004064c8U;
1718}
1719static inline u32 gr_pd_ab_dist_cfg2_token_limit_f(u32 v)
1720{
1721 return (v & 0x1fffU) << 0U;
1722}
1723static inline u32 gr_pd_ab_dist_cfg2_token_limit_init_v(void)
1724{
1725 return 0x000001c0U;
1726}
1727static inline u32 gr_pd_ab_dist_cfg2_state_limit_f(u32 v)
1728{
1729 return (v & 0x1fffU) << 16U;
1730}
1731static inline u32 gr_pd_ab_dist_cfg2_state_limit_scc_bundle_granularity_v(void)
1732{
1733 return 0x00000020U;
1734}
1735static inline u32 gr_pd_ab_dist_cfg2_state_limit_min_gpm_fifo_depths_v(void)
1736{
1737 return 0x00000182U;
1738}
1739static inline u32 gr_pd_dist_skip_table_r(u32 i)
1740{
1741 return 0x004064d0U + i*4U;
1742}
1743static inline u32 gr_pd_dist_skip_table__size_1_v(void)
1744{
1745 return 0x00000008U;
1746}
1747static inline u32 gr_pd_dist_skip_table_gpc_4n0_mask_f(u32 v)
1748{
1749 return (v & 0xffU) << 0U;
1750}
1751static inline u32 gr_pd_dist_skip_table_gpc_4n1_mask_f(u32 v)
1752{
1753 return (v & 0xffU) << 8U;
1754}
1755static inline u32 gr_pd_dist_skip_table_gpc_4n2_mask_f(u32 v)
1756{
1757 return (v & 0xffU) << 16U;
1758}
1759static inline u32 gr_pd_dist_skip_table_gpc_4n3_mask_f(u32 v)
1760{
1761 return (v & 0xffU) << 24U;
1762}
1763static inline u32 gr_ds_debug_r(void)
1764{
1765 return 0x00405800U;
1766}
1767static inline u32 gr_ds_debug_timeslice_mode_disable_f(void)
1768{
1769 return 0x0U;
1770}
1771static inline u32 gr_ds_debug_timeslice_mode_enable_f(void)
1772{
1773 return 0x8000000U;
1774}
1775static inline u32 gr_ds_zbc_color_r_r(void)
1776{
1777 return 0x00405804U;
1778}
1779static inline u32 gr_ds_zbc_color_r_val_f(u32 v)
1780{
1781 return (v & 0xffffffffU) << 0U;
1782}
1783static inline u32 gr_ds_zbc_color_g_r(void)
1784{
1785 return 0x00405808U;
1786}
1787static inline u32 gr_ds_zbc_color_g_val_f(u32 v)
1788{
1789 return (v & 0xffffffffU) << 0U;
1790}
1791static inline u32 gr_ds_zbc_color_b_r(void)
1792{
1793 return 0x0040580cU;
1794}
1795static inline u32 gr_ds_zbc_color_b_val_f(u32 v)
1796{
1797 return (v & 0xffffffffU) << 0U;
1798}
1799static inline u32 gr_ds_zbc_color_a_r(void)
1800{
1801 return 0x00405810U;
1802}
1803static inline u32 gr_ds_zbc_color_a_val_f(u32 v)
1804{
1805 return (v & 0xffffffffU) << 0U;
1806}
1807static inline u32 gr_ds_zbc_color_fmt_r(void)
1808{
1809 return 0x00405814U;
1810}
1811static inline u32 gr_ds_zbc_color_fmt_val_f(u32 v)
1812{
1813 return (v & 0x7fU) << 0U;
1814}
1815static inline u32 gr_ds_zbc_color_fmt_val_invalid_f(void)
1816{
1817 return 0x0U;
1818}
1819static inline u32 gr_ds_zbc_color_fmt_val_zero_v(void)
1820{
1821 return 0x00000001U;
1822}
1823static inline u32 gr_ds_zbc_color_fmt_val_unorm_one_v(void)
1824{
1825 return 0x00000002U;
1826}
1827static inline u32 gr_ds_zbc_color_fmt_val_rf32_gf32_bf32_af32_v(void)
1828{
1829 return 0x00000004U;
1830}
1831static inline u32 gr_ds_zbc_color_fmt_val_a8_b8_g8_r8_v(void)
1832{
1833 return 0x00000028U;
1834}
1835static inline u32 gr_ds_zbc_z_r(void)
1836{
1837 return 0x00405818U;
1838}
1839static inline u32 gr_ds_zbc_z_val_s(void)
1840{
1841 return 32U;
1842}
1843static inline u32 gr_ds_zbc_z_val_f(u32 v)
1844{
1845 return (v & 0xffffffffU) << 0U;
1846}
1847static inline u32 gr_ds_zbc_z_val_m(void)
1848{
1849 return 0xffffffffU << 0U;
1850}
1851static inline u32 gr_ds_zbc_z_val_v(u32 r)
1852{
1853 return (r >> 0U) & 0xffffffffU;
1854}
1855static inline u32 gr_ds_zbc_z_val__init_v(void)
1856{
1857 return 0x00000000U;
1858}
1859static inline u32 gr_ds_zbc_z_val__init_f(void)
1860{
1861 return 0x0U;
1862}
1863static inline u32 gr_ds_zbc_z_fmt_r(void)
1864{
1865 return 0x0040581cU;
1866}
1867static inline u32 gr_ds_zbc_z_fmt_val_f(u32 v)
1868{
1869 return (v & 0x1U) << 0U;
1870}
1871static inline u32 gr_ds_zbc_z_fmt_val_invalid_f(void)
1872{
1873 return 0x0U;
1874}
1875static inline u32 gr_ds_zbc_z_fmt_val_fp32_v(void)
1876{
1877 return 0x00000001U;
1878}
1879static inline u32 gr_ds_zbc_tbl_index_r(void)
1880{
1881 return 0x00405820U;
1882}
1883static inline u32 gr_ds_zbc_tbl_index_val_f(u32 v)
1884{
1885 return (v & 0xfU) << 0U;
1886}
1887static inline u32 gr_ds_zbc_tbl_ld_r(void)
1888{
1889 return 0x00405824U;
1890}
1891static inline u32 gr_ds_zbc_tbl_ld_select_c_f(void)
1892{
1893 return 0x0U;
1894}
1895static inline u32 gr_ds_zbc_tbl_ld_select_z_f(void)
1896{
1897 return 0x1U;
1898}
1899static inline u32 gr_ds_zbc_tbl_ld_action_write_f(void)
1900{
1901 return 0x0U;
1902}
1903static inline u32 gr_ds_zbc_tbl_ld_trigger_active_f(void)
1904{
1905 return 0x4U;
1906}
1907static inline u32 gr_ds_tga_constraintlogic_beta_r(void)
1908{
1909 return 0x00405830U;
1910}
1911static inline u32 gr_ds_tga_constraintlogic_beta_cbsize_f(u32 v)
1912{
1913 return (v & 0x3fffffU) << 0U;
1914}
1915static inline u32 gr_ds_tga_constraintlogic_alpha_r(void)
1916{
1917 return 0x0040585cU;
1918}
1919static inline u32 gr_ds_tga_constraintlogic_alpha_cbsize_f(u32 v)
1920{
1921 return (v & 0xffffU) << 0U;
1922}
1923static inline u32 gr_ds_hww_esr_r(void)
1924{
1925 return 0x00405840U;
1926}
1927static inline u32 gr_ds_hww_esr_reset_s(void)
1928{
1929 return 1U;
1930}
1931static inline u32 gr_ds_hww_esr_reset_f(u32 v)
1932{
1933 return (v & 0x1U) << 30U;
1934}
1935static inline u32 gr_ds_hww_esr_reset_m(void)
1936{
1937 return 0x1U << 30U;
1938}
1939static inline u32 gr_ds_hww_esr_reset_v(u32 r)
1940{
1941 return (r >> 30U) & 0x1U;
1942}
1943static inline u32 gr_ds_hww_esr_reset_task_v(void)
1944{
1945 return 0x00000001U;
1946}
1947static inline u32 gr_ds_hww_esr_reset_task_f(void)
1948{
1949 return 0x40000000U;
1950}
1951static inline u32 gr_ds_hww_esr_en_enabled_f(void)
1952{
1953 return 0x80000000U;
1954}
1955static inline u32 gr_ds_hww_esr_2_r(void)
1956{
1957 return 0x00405848U;
1958}
1959static inline u32 gr_ds_hww_esr_2_reset_s(void)
1960{
1961 return 1U;
1962}
1963static inline u32 gr_ds_hww_esr_2_reset_f(u32 v)
1964{
1965 return (v & 0x1U) << 30U;
1966}
1967static inline u32 gr_ds_hww_esr_2_reset_m(void)
1968{
1969 return 0x1U << 30U;
1970}
1971static inline u32 gr_ds_hww_esr_2_reset_v(u32 r)
1972{
1973 return (r >> 30U) & 0x1U;
1974}
1975static inline u32 gr_ds_hww_esr_2_reset_task_v(void)
1976{
1977 return 0x00000001U;
1978}
1979static inline u32 gr_ds_hww_esr_2_reset_task_f(void)
1980{
1981 return 0x40000000U;
1982}
1983static inline u32 gr_ds_hww_esr_2_en_enabled_f(void)
1984{
1985 return 0x80000000U;
1986}
1987static inline u32 gr_ds_hww_report_mask_r(void)
1988{
1989 return 0x00405844U;
1990}
1991static inline u32 gr_ds_hww_report_mask_sph0_err_report_f(void)
1992{
1993 return 0x1U;
1994}
1995static inline u32 gr_ds_hww_report_mask_sph1_err_report_f(void)
1996{
1997 return 0x2U;
1998}
1999static inline u32 gr_ds_hww_report_mask_sph2_err_report_f(void)
2000{
2001 return 0x4U;
2002}
2003static inline u32 gr_ds_hww_report_mask_sph3_err_report_f(void)
2004{
2005 return 0x8U;
2006}
2007static inline u32 gr_ds_hww_report_mask_sph4_err_report_f(void)
2008{
2009 return 0x10U;
2010}
2011static inline u32 gr_ds_hww_report_mask_sph5_err_report_f(void)
2012{
2013 return 0x20U;
2014}
2015static inline u32 gr_ds_hww_report_mask_sph6_err_report_f(void)
2016{
2017 return 0x40U;
2018}
2019static inline u32 gr_ds_hww_report_mask_sph7_err_report_f(void)
2020{
2021 return 0x80U;
2022}
2023static inline u32 gr_ds_hww_report_mask_sph8_err_report_f(void)
2024{
2025 return 0x100U;
2026}
2027static inline u32 gr_ds_hww_report_mask_sph9_err_report_f(void)
2028{
2029 return 0x200U;
2030}
2031static inline u32 gr_ds_hww_report_mask_sph10_err_report_f(void)
2032{
2033 return 0x400U;
2034}
2035static inline u32 gr_ds_hww_report_mask_sph11_err_report_f(void)
2036{
2037 return 0x800U;
2038}
2039static inline u32 gr_ds_hww_report_mask_sph12_err_report_f(void)
2040{
2041 return 0x1000U;
2042}
2043static inline u32 gr_ds_hww_report_mask_sph13_err_report_f(void)
2044{
2045 return 0x2000U;
2046}
2047static inline u32 gr_ds_hww_report_mask_sph14_err_report_f(void)
2048{
2049 return 0x4000U;
2050}
2051static inline u32 gr_ds_hww_report_mask_sph15_err_report_f(void)
2052{
2053 return 0x8000U;
2054}
2055static inline u32 gr_ds_hww_report_mask_sph16_err_report_f(void)
2056{
2057 return 0x10000U;
2058}
2059static inline u32 gr_ds_hww_report_mask_sph17_err_report_f(void)
2060{
2061 return 0x20000U;
2062}
2063static inline u32 gr_ds_hww_report_mask_sph18_err_report_f(void)
2064{
2065 return 0x40000U;
2066}
2067static inline u32 gr_ds_hww_report_mask_sph19_err_report_f(void)
2068{
2069 return 0x80000U;
2070}
2071static inline u32 gr_ds_hww_report_mask_sph20_err_report_f(void)
2072{
2073 return 0x100000U;
2074}
2075static inline u32 gr_ds_hww_report_mask_sph21_err_report_f(void)
2076{
2077 return 0x200000U;
2078}
2079static inline u32 gr_ds_hww_report_mask_sph22_err_report_f(void)
2080{
2081 return 0x400000U;
2082}
2083static inline u32 gr_ds_hww_report_mask_sph23_err_report_f(void)
2084{
2085 return 0x800000U;
2086}
2087static inline u32 gr_ds_hww_report_mask_2_r(void)
2088{
2089 return 0x0040584cU;
2090}
2091static inline u32 gr_ds_hww_report_mask_2_sph24_err_report_f(void)
2092{
2093 return 0x1U;
2094}
2095static inline u32 gr_ds_num_tpc_per_gpc_r(u32 i)
2096{
2097 return 0x00405870U + i*4U;
2098}
2099static inline u32 gr_scc_bundle_cb_base_r(void)
2100{
2101 return 0x00408004U;
2102}
2103static inline u32 gr_scc_bundle_cb_base_addr_39_8_f(u32 v)
2104{
2105 return (v & 0xffffffffU) << 0U;
2106}
2107static inline u32 gr_scc_bundle_cb_base_addr_39_8_align_bits_v(void)
2108{
2109 return 0x00000008U;
2110}
2111static inline u32 gr_scc_bundle_cb_size_r(void)
2112{
2113 return 0x00408008U;
2114}
2115static inline u32 gr_scc_bundle_cb_size_div_256b_f(u32 v)
2116{
2117 return (v & 0x7ffU) << 0U;
2118}
2119static inline u32 gr_scc_bundle_cb_size_div_256b__prod_v(void)
2120{
2121 return 0x00000018U;
2122}
2123static inline u32 gr_scc_bundle_cb_size_div_256b_byte_granularity_v(void)
2124{
2125 return 0x00000100U;
2126}
2127static inline u32 gr_scc_bundle_cb_size_valid_false_v(void)
2128{
2129 return 0x00000000U;
2130}
2131static inline u32 gr_scc_bundle_cb_size_valid_false_f(void)
2132{
2133 return 0x0U;
2134}
2135static inline u32 gr_scc_bundle_cb_size_valid_true_f(void)
2136{
2137 return 0x80000000U;
2138}
2139static inline u32 gr_scc_pagepool_base_r(void)
2140{
2141 return 0x0040800cU;
2142}
2143static inline u32 gr_scc_pagepool_base_addr_39_8_f(u32 v)
2144{
2145 return (v & 0xffffffffU) << 0U;
2146}
2147static inline u32 gr_scc_pagepool_base_addr_39_8_align_bits_v(void)
2148{
2149 return 0x00000008U;
2150}
2151static inline u32 gr_scc_pagepool_r(void)
2152{
2153 return 0x00408010U;
2154}
2155static inline u32 gr_scc_pagepool_total_pages_f(u32 v)
2156{
2157 return (v & 0x3ffU) << 0U;
2158}
2159static inline u32 gr_scc_pagepool_total_pages_hwmax_v(void)
2160{
2161 return 0x00000000U;
2162}
2163static inline u32 gr_scc_pagepool_total_pages_hwmax_value_v(void)
2164{
2165 return 0x00000200U;
2166}
2167static inline u32 gr_scc_pagepool_total_pages_byte_granularity_v(void)
2168{
2169 return 0x00000100U;
2170}
2171static inline u32 gr_scc_pagepool_max_valid_pages_s(void)
2172{
2173 return 10U;
2174}
2175static inline u32 gr_scc_pagepool_max_valid_pages_f(u32 v)
2176{
2177 return (v & 0x3ffU) << 10U;
2178}
2179static inline u32 gr_scc_pagepool_max_valid_pages_m(void)
2180{
2181 return 0x3ffU << 10U;
2182}
2183static inline u32 gr_scc_pagepool_max_valid_pages_v(u32 r)
2184{
2185 return (r >> 10U) & 0x3ffU;
2186}
2187static inline u32 gr_scc_pagepool_valid_true_f(void)
2188{
2189 return 0x80000000U;
2190}
2191static inline u32 gr_scc_init_r(void)
2192{
2193 return 0x0040802cU;
2194}
2195static inline u32 gr_scc_init_ram_trigger_f(void)
2196{
2197 return 0x1U;
2198}
2199static inline u32 gr_scc_hww_esr_r(void)
2200{
2201 return 0x00408030U;
2202}
2203static inline u32 gr_scc_hww_esr_reset_active_f(void)
2204{
2205 return 0x40000000U;
2206}
2207static inline u32 gr_scc_hww_esr_en_enable_f(void)
2208{
2209 return 0x80000000U;
2210}
2211static inline u32 gr_sked_hww_esr_r(void)
2212{
2213 return 0x00407020U;
2214}
2215static inline u32 gr_sked_hww_esr_reset_active_f(void)
2216{
2217 return 0x40000000U;
2218}
2219static inline u32 gr_cwd_fs_r(void)
2220{
2221 return 0x00405b00U;
2222}
2223static inline u32 gr_cwd_fs_num_gpcs_f(u32 v)
2224{
2225 return (v & 0xffU) << 0U;
2226}
2227static inline u32 gr_cwd_fs_num_tpcs_f(u32 v)
2228{
2229 return (v & 0xffU) << 8U;
2230}
2231static inline u32 gr_cwd_gpc_tpc_id_r(u32 i)
2232{
2233 return 0x00405b60U + i*4U;
2234}
2235static inline u32 gr_cwd_gpc_tpc_id_tpc0_s(void)
2236{
2237 return 4U;
2238}
2239static inline u32 gr_cwd_gpc_tpc_id_tpc0_f(u32 v)
2240{
2241 return (v & 0xfU) << 0U;
2242}
2243static inline u32 gr_cwd_gpc_tpc_id_gpc0_s(void)
2244{
2245 return 4U;
2246}
2247static inline u32 gr_cwd_gpc_tpc_id_gpc0_f(u32 v)
2248{
2249 return (v & 0xfU) << 4U;
2250}
2251static inline u32 gr_cwd_gpc_tpc_id_tpc1_f(u32 v)
2252{
2253 return (v & 0xfU) << 8U;
2254}
2255static inline u32 gr_cwd_sm_id_r(u32 i)
2256{
2257 return 0x00405ba0U + i*4U;
2258}
2259static inline u32 gr_cwd_sm_id__size_1_v(void)
2260{
2261 return 0x00000010U;
2262}
2263static inline u32 gr_cwd_sm_id_tpc0_f(u32 v)
2264{
2265 return (v & 0xffU) << 0U;
2266}
2267static inline u32 gr_cwd_sm_id_tpc1_f(u32 v)
2268{
2269 return (v & 0xffU) << 8U;
2270}
2271static inline u32 gr_gpc0_fs_gpc_r(void)
2272{
2273 return 0x00502608U;
2274}
2275static inline u32 gr_gpc0_fs_gpc_num_available_tpcs_v(u32 r)
2276{
2277 return (r >> 0U) & 0x1fU;
2278}
2279static inline u32 gr_gpc0_fs_gpc_num_available_zculls_v(u32 r)
2280{
2281 return (r >> 16U) & 0x1fU;
2282}
2283static inline u32 gr_gpc0_cfg_r(void)
2284{
2285 return 0x00502620U;
2286}
2287static inline u32 gr_gpc0_cfg_imem_sz_v(u32 r)
2288{
2289 return (r >> 0U) & 0xffU;
2290}
2291static inline u32 gr_gpccs_rc_lanes_r(void)
2292{
2293 return 0x00502880U;
2294}
2295static inline u32 gr_gpccs_rc_lanes_num_chains_s(void)
2296{
2297 return 6U;
2298}
2299static inline u32 gr_gpccs_rc_lanes_num_chains_f(u32 v)
2300{
2301 return (v & 0x3fU) << 0U;
2302}
2303static inline u32 gr_gpccs_rc_lanes_num_chains_m(void)
2304{
2305 return 0x3fU << 0U;
2306}
2307static inline u32 gr_gpccs_rc_lanes_num_chains_v(u32 r)
2308{
2309 return (r >> 0U) & 0x3fU;
2310}
2311static inline u32 gr_gpccs_rc_lane_size_r(void)
2312{
2313 return 0x00502910U;
2314}
2315static inline u32 gr_gpccs_rc_lane_size_v_s(void)
2316{
2317 return 24U;
2318}
2319static inline u32 gr_gpccs_rc_lane_size_v_f(u32 v)
2320{
2321 return (v & 0xffffffU) << 0U;
2322}
2323static inline u32 gr_gpccs_rc_lane_size_v_m(void)
2324{
2325 return 0xffffffU << 0U;
2326}
2327static inline u32 gr_gpccs_rc_lane_size_v_v(u32 r)
2328{
2329 return (r >> 0U) & 0xffffffU;
2330}
2331static inline u32 gr_gpccs_rc_lane_size_v_0_v(void)
2332{
2333 return 0x00000000U;
2334}
2335static inline u32 gr_gpccs_rc_lane_size_v_0_f(void)
2336{
2337 return 0x0U;
2338}
2339static inline u32 gr_gpc0_zcull_fs_r(void)
2340{
2341 return 0x00500910U;
2342}
2343static inline u32 gr_gpc0_zcull_fs_num_sms_f(u32 v)
2344{
2345 return (v & 0x1ffU) << 0U;
2346}
2347static inline u32 gr_gpc0_zcull_fs_num_active_banks_f(u32 v)
2348{
2349 return (v & 0xfU) << 16U;
2350}
2351static inline u32 gr_gpc0_zcull_ram_addr_r(void)
2352{
2353 return 0x00500914U;
2354}
2355static inline u32 gr_gpc0_zcull_ram_addr_tiles_per_hypertile_row_per_gpc_f(u32 v)
2356{
2357 return (v & 0xfU) << 0U;
2358}
2359static inline u32 gr_gpc0_zcull_ram_addr_row_offset_f(u32 v)
2360{
2361 return (v & 0xfU) << 8U;
2362}
2363static inline u32 gr_gpc0_zcull_sm_num_rcp_r(void)
2364{
2365 return 0x00500918U;
2366}
2367static inline u32 gr_gpc0_zcull_sm_num_rcp_conservative_f(u32 v)
2368{
2369 return (v & 0xffffffU) << 0U;
2370}
2371static inline u32 gr_gpc0_zcull_sm_num_rcp_conservative__max_v(void)
2372{
2373 return 0x00800000U;
2374}
2375static inline u32 gr_gpc0_zcull_total_ram_size_r(void)
2376{
2377 return 0x00500920U;
2378}
2379static inline u32 gr_gpc0_zcull_total_ram_size_num_aliquots_f(u32 v)
2380{
2381 return (v & 0xffffU) << 0U;
2382}
2383static inline u32 gr_gpc0_zcull_zcsize_r(u32 i)
2384{
2385 return 0x00500a04U + i*32U;
2386}
2387static inline u32 gr_gpc0_zcull_zcsize_height_subregion__multiple_v(void)
2388{
2389 return 0x00000040U;
2390}
2391static inline u32 gr_gpc0_zcull_zcsize_width_subregion__multiple_v(void)
2392{
2393 return 0x00000010U;
2394}
2395static inline u32 gr_gpc0_gpm_pd_sm_id_r(u32 i)
2396{
2397 return 0x00500c10U + i*4U;
2398}
2399static inline u32 gr_gpc0_gpm_pd_sm_id_id_f(u32 v)
2400{
2401 return (v & 0xffU) << 0U;
2402}
2403static inline u32 gr_gpc0_gpm_pd_pes_tpc_id_mask_r(u32 i)
2404{
2405 return 0x00500c30U + i*4U;
2406}
2407static inline u32 gr_gpc0_gpm_pd_pes_tpc_id_mask_mask_v(u32 r)
2408{
2409 return (r >> 0U) & 0xffU;
2410}
2411static inline u32 gr_gpc0_tpc0_pe_cfg_smid_r(void)
2412{
2413 return 0x00504088U;
2414}
2415static inline u32 gr_gpc0_tpc0_pe_cfg_smid_value_f(u32 v)
2416{
2417 return (v & 0xffffU) << 0U;
2418}
2419static inline u32 gr_gpc0_tpc0_sm_cfg_r(void)
2420{
2421 return 0x00504698U;
2422}
2423static inline u32 gr_gpc0_tpc0_sm_cfg_sm_id_f(u32 v)
2424{
2425 return (v & 0xffffU) << 0U;
2426}
2427static inline u32 gr_gpc0_tpc0_sm_cfg_sm_id_v(u32 r)
2428{
2429 return (r >> 0U) & 0xffffU;
2430}
2431static inline u32 gr_gpc0_tpc0_sm_arch_r(void)
2432{
2433 return 0x0050469cU;
2434}
2435static inline u32 gr_gpc0_tpc0_sm_arch_warp_count_v(u32 r)
2436{
2437 return (r >> 0U) & 0xffU;
2438}
2439static inline u32 gr_gpc0_tpc0_sm_arch_spa_version_v(u32 r)
2440{
2441 return (r >> 8U) & 0xfffU;
2442}
2443static inline u32 gr_gpc0_tpc0_sm_arch_sm_version_v(u32 r)
2444{
2445 return (r >> 20U) & 0xfffU;
2446}
2447static inline u32 gr_gpc0_ppc0_pes_vsc_strem_r(void)
2448{
2449 return 0x00503018U;
2450}
2451static inline u32 gr_gpc0_ppc0_pes_vsc_strem_master_pe_m(void)
2452{
2453 return 0x1U << 0U;
2454}
2455static inline u32 gr_gpc0_ppc0_pes_vsc_strem_master_pe_true_f(void)
2456{
2457 return 0x1U;
2458}
2459static inline u32 gr_gpc0_ppc0_cbm_beta_cb_size_r(void)
2460{
2461 return 0x005030c0U;
2462}
2463static inline u32 gr_gpc0_ppc0_cbm_beta_cb_size_v_f(u32 v)
2464{
2465 return (v & 0x3fffffU) << 0U;
2466}
2467static inline u32 gr_gpc0_ppc0_cbm_beta_cb_size_v_m(void)
2468{
2469 return 0x3fffffU << 0U;
2470}
2471static inline u32 gr_gpc0_ppc0_cbm_beta_cb_size_v_default_v(void)
2472{
2473 return 0x00030000U;
2474}
2475static inline u32 gr_gpc0_ppc0_cbm_beta_cb_size_v_gfxp_v(void)
2476{
2477 return 0x00030a00U;
2478}
2479static inline u32 gr_gpc0_ppc0_cbm_beta_cb_size_v_granularity_v(void)
2480{
2481 return 0x00000020U;
2482}
2483static inline u32 gr_gpc0_ppc0_cbm_beta_cb_offset_r(void)
2484{
2485 return 0x005030f4U;
2486}
2487static inline u32 gr_gpc0_ppc0_cbm_alpha_cb_size_r(void)
2488{
2489 return 0x005030e4U;
2490}
2491static inline u32 gr_gpc0_ppc0_cbm_alpha_cb_size_v_f(u32 v)
2492{
2493 return (v & 0xffffU) << 0U;
2494}
2495static inline u32 gr_gpc0_ppc0_cbm_alpha_cb_size_v_m(void)
2496{
2497 return 0xffffU << 0U;
2498}
2499static inline u32 gr_gpc0_ppc0_cbm_alpha_cb_size_v_default_v(void)
2500{
2501 return 0x00000800U;
2502}
2503static inline u32 gr_gpc0_ppc0_cbm_alpha_cb_size_v_granularity_v(void)
2504{
2505 return 0x00000020U;
2506}
2507static inline u32 gr_gpc0_ppc0_cbm_alpha_cb_offset_r(void)
2508{
2509 return 0x005030f8U;
2510}
2511static inline u32 gr_gpc0_ppc0_cbm_beta_steady_state_cb_size_r(void)
2512{
2513 return 0x005030f0U;
2514}
2515static inline u32 gr_gpc0_ppc0_cbm_beta_steady_state_cb_size_v_f(u32 v)
2516{
2517 return (v & 0x3fffffU) << 0U;
2518}
2519static inline u32 gr_gpc0_ppc0_cbm_beta_steady_state_cb_size_v_default_v(void)
2520{
2521 return 0x00030000U;
2522}
2523static inline u32 gr_gpcs_tpcs_tex_rm_cb_0_r(void)
2524{
2525 return 0x00419b00U;
2526}
2527static inline u32 gr_gpcs_tpcs_tex_rm_cb_0_base_addr_43_12_f(u32 v)
2528{
2529 return (v & 0xffffffffU) << 0U;
2530}
2531static inline u32 gr_gpcs_tpcs_tex_rm_cb_1_r(void)
2532{
2533 return 0x00419b04U;
2534}
2535static inline u32 gr_gpcs_tpcs_tex_rm_cb_1_size_div_128b_s(void)
2536{
2537 return 21U;
2538}
2539static inline u32 gr_gpcs_tpcs_tex_rm_cb_1_size_div_128b_f(u32 v)
2540{
2541 return (v & 0x1fffffU) << 0U;
2542}
2543static inline u32 gr_gpcs_tpcs_tex_rm_cb_1_size_div_128b_m(void)
2544{
2545 return 0x1fffffU << 0U;
2546}
2547static inline u32 gr_gpcs_tpcs_tex_rm_cb_1_size_div_128b_v(u32 r)
2548{
2549 return (r >> 0U) & 0x1fffffU;
2550}
2551static inline u32 gr_gpcs_tpcs_tex_rm_cb_1_size_div_128b_granularity_f(void)
2552{
2553 return 0x80U;
2554}
2555static inline u32 gr_gpcs_tpcs_tex_rm_cb_1_valid_s(void)
2556{
2557 return 1U;
2558}
2559static inline u32 gr_gpcs_tpcs_tex_rm_cb_1_valid_f(u32 v)
2560{
2561 return (v & 0x1U) << 31U;
2562}
2563static inline u32 gr_gpcs_tpcs_tex_rm_cb_1_valid_m(void)
2564{
2565 return 0x1U << 31U;
2566}
2567static inline u32 gr_gpcs_tpcs_tex_rm_cb_1_valid_v(u32 r)
2568{
2569 return (r >> 31U) & 0x1U;
2570}
2571static inline u32 gr_gpcs_tpcs_tex_rm_cb_1_valid_true_f(void)
2572{
2573 return 0x80000000U;
2574}
2575static inline u32 gr_gpcs_tpcs_tex_m_dbg2_r(void)
2576{
2577 return 0x00419a3cU;
2578}
2579static inline u32 gr_gpcs_tpcs_tex_m_dbg2_lg_rd_coalesce_en_f(u32 v)
2580{
2581 return (v & 0x1U) << 2U;
2582}
2583static inline u32 gr_gpcs_tpcs_tex_m_dbg2_lg_rd_coalesce_en_m(void)
2584{
2585 return 0x1U << 2U;
2586}
2587static inline u32 gr_gpcs_tpcs_tex_m_dbg2_su_rd_coalesce_en_f(u32 v)
2588{
2589 return (v & 0x1U) << 4U;
2590}
2591static inline u32 gr_gpcs_tpcs_tex_m_dbg2_su_rd_coalesce_en_m(void)
2592{
2593 return 0x1U << 4U;
2594}
2595static inline u32 gr_gpccs_falcon_addr_r(void)
2596{
2597 return 0x0041a0acU;
2598}
2599static inline u32 gr_gpccs_falcon_addr_lsb_s(void)
2600{
2601 return 6U;
2602}
2603static inline u32 gr_gpccs_falcon_addr_lsb_f(u32 v)
2604{
2605 return (v & 0x3fU) << 0U;
2606}
2607static inline u32 gr_gpccs_falcon_addr_lsb_m(void)
2608{
2609 return 0x3fU << 0U;
2610}
2611static inline u32 gr_gpccs_falcon_addr_lsb_v(u32 r)
2612{
2613 return (r >> 0U) & 0x3fU;
2614}
2615static inline u32 gr_gpccs_falcon_addr_lsb_init_v(void)
2616{
2617 return 0x00000000U;
2618}
2619static inline u32 gr_gpccs_falcon_addr_lsb_init_f(void)
2620{
2621 return 0x0U;
2622}
2623static inline u32 gr_gpccs_falcon_addr_msb_s(void)
2624{
2625 return 6U;
2626}
2627static inline u32 gr_gpccs_falcon_addr_msb_f(u32 v)
2628{
2629 return (v & 0x3fU) << 6U;
2630}
2631static inline u32 gr_gpccs_falcon_addr_msb_m(void)
2632{
2633 return 0x3fU << 6U;
2634}
2635static inline u32 gr_gpccs_falcon_addr_msb_v(u32 r)
2636{
2637 return (r >> 6U) & 0x3fU;
2638}
2639static inline u32 gr_gpccs_falcon_addr_msb_init_v(void)
2640{
2641 return 0x00000000U;
2642}
2643static inline u32 gr_gpccs_falcon_addr_msb_init_f(void)
2644{
2645 return 0x0U;
2646}
2647static inline u32 gr_gpccs_falcon_addr_ext_s(void)
2648{
2649 return 12U;
2650}
2651static inline u32 gr_gpccs_falcon_addr_ext_f(u32 v)
2652{
2653 return (v & 0xfffU) << 0U;
2654}
2655static inline u32 gr_gpccs_falcon_addr_ext_m(void)
2656{
2657 return 0xfffU << 0U;
2658}
2659static inline u32 gr_gpccs_falcon_addr_ext_v(u32 r)
2660{
2661 return (r >> 0U) & 0xfffU;
2662}
2663static inline u32 gr_gpccs_cpuctl_r(void)
2664{
2665 return 0x0041a100U;
2666}
2667static inline u32 gr_gpccs_cpuctl_startcpu_f(u32 v)
2668{
2669 return (v & 0x1U) << 1U;
2670}
2671static inline u32 gr_gpccs_dmactl_r(void)
2672{
2673 return 0x0041a10cU;
2674}
2675static inline u32 gr_gpccs_dmactl_require_ctx_f(u32 v)
2676{
2677 return (v & 0x1U) << 0U;
2678}
2679static inline u32 gr_gpccs_dmactl_dmem_scrubbing_m(void)
2680{
2681 return 0x1U << 1U;
2682}
2683static inline u32 gr_gpccs_dmactl_imem_scrubbing_m(void)
2684{
2685 return 0x1U << 2U;
2686}
2687static inline u32 gr_gpccs_imemc_r(u32 i)
2688{
2689 return 0x0041a180U + i*16U;
2690}
2691static inline u32 gr_gpccs_imemc_offs_f(u32 v)
2692{
2693 return (v & 0x3fU) << 2U;
2694}
2695static inline u32 gr_gpccs_imemc_blk_f(u32 v)
2696{
2697 return (v & 0xffU) << 8U;
2698}
2699static inline u32 gr_gpccs_imemc_aincw_f(u32 v)
2700{
2701 return (v & 0x1U) << 24U;
2702}
2703static inline u32 gr_gpccs_imemd_r(u32 i)
2704{
2705 return 0x0041a184U + i*16U;
2706}
2707static inline u32 gr_gpccs_imemt_r(u32 i)
2708{
2709 return 0x0041a188U + i*16U;
2710}
2711static inline u32 gr_gpccs_imemt__size_1_v(void)
2712{
2713 return 0x00000004U;
2714}
2715static inline u32 gr_gpccs_imemt_tag_f(u32 v)
2716{
2717 return (v & 0xffffU) << 0U;
2718}
2719static inline u32 gr_gpccs_dmemc_r(u32 i)
2720{
2721 return 0x0041a1c0U + i*8U;
2722}
2723static inline u32 gr_gpccs_dmemc_offs_f(u32 v)
2724{
2725 return (v & 0x3fU) << 2U;
2726}
2727static inline u32 gr_gpccs_dmemc_blk_f(u32 v)
2728{
2729 return (v & 0xffU) << 8U;
2730}
2731static inline u32 gr_gpccs_dmemc_aincw_f(u32 v)
2732{
2733 return (v & 0x1U) << 24U;
2734}
2735static inline u32 gr_gpccs_dmemd_r(u32 i)
2736{
2737 return 0x0041a1c4U + i*8U;
2738}
2739static inline u32 gr_gpccs_ctxsw_mailbox_r(u32 i)
2740{
2741 return 0x0041a800U + i*4U;
2742}
2743static inline u32 gr_gpccs_ctxsw_mailbox_value_f(u32 v)
2744{
2745 return (v & 0xffffffffU) << 0U;
2746}
2747static inline u32 gr_gpcs_swdx_bundle_cb_base_r(void)
2748{
2749 return 0x00418e24U;
2750}
2751static inline u32 gr_gpcs_swdx_bundle_cb_base_addr_39_8_s(void)
2752{
2753 return 32U;
2754}
2755static inline u32 gr_gpcs_swdx_bundle_cb_base_addr_39_8_f(u32 v)
2756{
2757 return (v & 0xffffffffU) << 0U;
2758}
2759static inline u32 gr_gpcs_swdx_bundle_cb_base_addr_39_8_m(void)
2760{
2761 return 0xffffffffU << 0U;
2762}
2763static inline u32 gr_gpcs_swdx_bundle_cb_base_addr_39_8_v(u32 r)
2764{
2765 return (r >> 0U) & 0xffffffffU;
2766}
2767static inline u32 gr_gpcs_swdx_bundle_cb_base_addr_39_8_init_v(void)
2768{
2769 return 0x00000000U;
2770}
2771static inline u32 gr_gpcs_swdx_bundle_cb_base_addr_39_8_init_f(void)
2772{
2773 return 0x0U;
2774}
2775static inline u32 gr_gpcs_swdx_bundle_cb_size_r(void)
2776{
2777 return 0x00418e28U;
2778}
2779static inline u32 gr_gpcs_swdx_bundle_cb_size_div_256b_s(void)
2780{
2781 return 11U;
2782}
2783static inline u32 gr_gpcs_swdx_bundle_cb_size_div_256b_f(u32 v)
2784{
2785 return (v & 0x7ffU) << 0U;
2786}
2787static inline u32 gr_gpcs_swdx_bundle_cb_size_div_256b_m(void)
2788{
2789 return 0x7ffU << 0U;
2790}
2791static inline u32 gr_gpcs_swdx_bundle_cb_size_div_256b_v(u32 r)
2792{
2793 return (r >> 0U) & 0x7ffU;
2794}
2795static inline u32 gr_gpcs_swdx_bundle_cb_size_div_256b_init_v(void)
2796{
2797 return 0x00000018U;
2798}
2799static inline u32 gr_gpcs_swdx_bundle_cb_size_div_256b_init_f(void)
2800{
2801 return 0x18U;
2802}
2803static inline u32 gr_gpcs_swdx_bundle_cb_size_valid_s(void)
2804{
2805 return 1U;
2806}
2807static inline u32 gr_gpcs_swdx_bundle_cb_size_valid_f(u32 v)
2808{
2809 return (v & 0x1U) << 31U;
2810}
2811static inline u32 gr_gpcs_swdx_bundle_cb_size_valid_m(void)
2812{
2813 return 0x1U << 31U;
2814}
2815static inline u32 gr_gpcs_swdx_bundle_cb_size_valid_v(u32 r)
2816{
2817 return (r >> 31U) & 0x1U;
2818}
2819static inline u32 gr_gpcs_swdx_bundle_cb_size_valid_false_v(void)
2820{
2821 return 0x00000000U;
2822}
2823static inline u32 gr_gpcs_swdx_bundle_cb_size_valid_false_f(void)
2824{
2825 return 0x0U;
2826}
2827static inline u32 gr_gpcs_swdx_bundle_cb_size_valid_true_v(void)
2828{
2829 return 0x00000001U;
2830}
2831static inline u32 gr_gpcs_swdx_bundle_cb_size_valid_true_f(void)
2832{
2833 return 0x80000000U;
2834}
2835static inline u32 gr_gpc0_swdx_rm_spill_buffer_size_r(void)
2836{
2837 return 0x00500ee4U;
2838}
2839static inline u32 gr_gpc0_swdx_rm_spill_buffer_size_256b_f(u32 v)
2840{
2841 return (v & 0xffffU) << 0U;
2842}
2843static inline u32 gr_gpc0_swdx_rm_spill_buffer_size_256b_default_v(void)
2844{
2845 return 0x00000250U;
2846}
2847static inline u32 gr_gpc0_swdx_rm_spill_buffer_size_256b_byte_granularity_v(void)
2848{
2849 return 0x00000100U;
2850}
2851static inline u32 gr_gpc0_swdx_rm_spill_buffer_addr_r(void)
2852{
2853 return 0x00500ee0U;
2854}
2855static inline u32 gr_gpc0_swdx_rm_spill_buffer_addr_39_8_f(u32 v)
2856{
2857 return (v & 0xffffffffU) << 0U;
2858}
2859static inline u32 gr_gpc0_swdx_rm_spill_buffer_addr_39_8_align_bits_v(void)
2860{
2861 return 0x00000008U;
2862}
2863static inline u32 gr_gpcs_swdx_beta_cb_ctrl_r(void)
2864{
2865 return 0x00418eecU;
2866}
2867static inline u32 gr_gpcs_swdx_beta_cb_ctrl_cbes_reserve_f(u32 v)
2868{
2869 return (v & 0xfffU) << 0U;
2870}
2871static inline u32 gr_gpcs_swdx_beta_cb_ctrl_cbes_reserve_gfxp_v(void)
2872{
2873 return 0x00000100U;
2874}
2875static inline u32 gr_gpcs_ppcs_cbm_beta_cb_ctrl_r(void)
2876{
2877 return 0x0041befcU;
2878}
2879static inline u32 gr_gpcs_ppcs_cbm_beta_cb_ctrl_cbes_reserve_f(u32 v)
2880{
2881 return (v & 0xfffU) << 0U;
2882}
2883static inline u32 gr_gpcs_swdx_tc_beta_cb_size_r(u32 i)
2884{
2885 return 0x00418ea0U + i*4U;
2886}
2887static inline u32 gr_gpcs_swdx_tc_beta_cb_size_v_f(u32 v)
2888{
2889 return (v & 0x3fffffU) << 0U;
2890}
2891static inline u32 gr_gpcs_swdx_tc_beta_cb_size_v_m(void)
2892{
2893 return 0x3fffffU << 0U;
2894}
2895static inline u32 gr_gpcs_swdx_dss_zbc_color_r_r(u32 i)
2896{
2897 return 0x00418010U + i*4U;
2898}
2899static inline u32 gr_gpcs_swdx_dss_zbc_color_r_val_f(u32 v)
2900{
2901 return (v & 0xffffffffU) << 0U;
2902}
2903static inline u32 gr_gpcs_swdx_dss_zbc_color_g_r(u32 i)
2904{
2905 return 0x0041804cU + i*4U;
2906}
2907static inline u32 gr_gpcs_swdx_dss_zbc_color_g_val_f(u32 v)
2908{
2909 return (v & 0xffffffffU) << 0U;
2910}
2911static inline u32 gr_gpcs_swdx_dss_zbc_color_b_r(u32 i)
2912{
2913 return 0x00418088U + i*4U;
2914}
2915static inline u32 gr_gpcs_swdx_dss_zbc_color_b_val_f(u32 v)
2916{
2917 return (v & 0xffffffffU) << 0U;
2918}
2919static inline u32 gr_gpcs_swdx_dss_zbc_color_a_r(u32 i)
2920{
2921 return 0x004180c4U + i*4U;
2922}
2923static inline u32 gr_gpcs_swdx_dss_zbc_color_a_val_f(u32 v)
2924{
2925 return (v & 0xffffffffU) << 0U;
2926}
2927static inline u32 gr_gpcs_swdx_dss_zbc_c_01_to_04_format_r(void)
2928{
2929 return 0x00500100U;
2930}
2931static inline u32 gr_gpcs_swdx_dss_zbc_z_r(u32 i)
2932{
2933 return 0x00418110U + i*4U;
2934}
2935static inline u32 gr_gpcs_swdx_dss_zbc_z_val_f(u32 v)
2936{
2937 return (v & 0xffffffffU) << 0U;
2938}
2939static inline u32 gr_gpcs_swdx_dss_zbc_z_01_to_04_format_r(void)
2940{
2941 return 0x0050014cU;
2942}
2943static inline u32 gr_gpcs_setup_attrib_cb_base_r(void)
2944{
2945 return 0x00418810U;
2946}
2947static inline u32 gr_gpcs_setup_attrib_cb_base_addr_39_12_f(u32 v)
2948{
2949 return (v & 0xfffffffU) << 0U;
2950}
2951static inline u32 gr_gpcs_setup_attrib_cb_base_addr_39_12_align_bits_v(void)
2952{
2953 return 0x0000000cU;
2954}
2955static inline u32 gr_gpcs_setup_attrib_cb_base_valid_true_f(void)
2956{
2957 return 0x80000000U;
2958}
2959static inline u32 gr_crstr_gpc_map0_r(void)
2960{
2961 return 0x00418b08U;
2962}
2963static inline u32 gr_crstr_gpc_map0_tile0_f(u32 v)
2964{
2965 return (v & 0x7U) << 0U;
2966}
2967static inline u32 gr_crstr_gpc_map0_tile1_f(u32 v)
2968{
2969 return (v & 0x7U) << 5U;
2970}
2971static inline u32 gr_crstr_gpc_map0_tile2_f(u32 v)
2972{
2973 return (v & 0x7U) << 10U;
2974}
2975static inline u32 gr_crstr_gpc_map0_tile3_f(u32 v)
2976{
2977 return (v & 0x7U) << 15U;
2978}
2979static inline u32 gr_crstr_gpc_map0_tile4_f(u32 v)
2980{
2981 return (v & 0x7U) << 20U;
2982}
2983static inline u32 gr_crstr_gpc_map0_tile5_f(u32 v)
2984{
2985 return (v & 0x7U) << 25U;
2986}
2987static inline u32 gr_crstr_gpc_map1_r(void)
2988{
2989 return 0x00418b0cU;
2990}
2991static inline u32 gr_crstr_gpc_map1_tile6_f(u32 v)
2992{
2993 return (v & 0x7U) << 0U;
2994}
2995static inline u32 gr_crstr_gpc_map1_tile7_f(u32 v)
2996{
2997 return (v & 0x7U) << 5U;
2998}
2999static inline u32 gr_crstr_gpc_map1_tile8_f(u32 v)
3000{
3001 return (v & 0x7U) << 10U;
3002}
3003static inline u32 gr_crstr_gpc_map1_tile9_f(u32 v)
3004{
3005 return (v & 0x7U) << 15U;
3006}
3007static inline u32 gr_crstr_gpc_map1_tile10_f(u32 v)
3008{
3009 return (v & 0x7U) << 20U;
3010}
3011static inline u32 gr_crstr_gpc_map1_tile11_f(u32 v)
3012{
3013 return (v & 0x7U) << 25U;
3014}
3015static inline u32 gr_crstr_gpc_map2_r(void)
3016{
3017 return 0x00418b10U;
3018}
3019static inline u32 gr_crstr_gpc_map2_tile12_f(u32 v)
3020{
3021 return (v & 0x7U) << 0U;
3022}
3023static inline u32 gr_crstr_gpc_map2_tile13_f(u32 v)
3024{
3025 return (v & 0x7U) << 5U;
3026}
3027static inline u32 gr_crstr_gpc_map2_tile14_f(u32 v)
3028{
3029 return (v & 0x7U) << 10U;
3030}
3031static inline u32 gr_crstr_gpc_map2_tile15_f(u32 v)
3032{
3033 return (v & 0x7U) << 15U;
3034}
3035static inline u32 gr_crstr_gpc_map2_tile16_f(u32 v)
3036{
3037 return (v & 0x7U) << 20U;
3038}
3039static inline u32 gr_crstr_gpc_map2_tile17_f(u32 v)
3040{
3041 return (v & 0x7U) << 25U;
3042}
3043static inline u32 gr_crstr_gpc_map3_r(void)
3044{
3045 return 0x00418b14U;
3046}
3047static inline u32 gr_crstr_gpc_map3_tile18_f(u32 v)
3048{
3049 return (v & 0x7U) << 0U;
3050}
3051static inline u32 gr_crstr_gpc_map3_tile19_f(u32 v)
3052{
3053 return (v & 0x7U) << 5U;
3054}
3055static inline u32 gr_crstr_gpc_map3_tile20_f(u32 v)
3056{
3057 return (v & 0x7U) << 10U;
3058}
3059static inline u32 gr_crstr_gpc_map3_tile21_f(u32 v)
3060{
3061 return (v & 0x7U) << 15U;
3062}
3063static inline u32 gr_crstr_gpc_map3_tile22_f(u32 v)
3064{
3065 return (v & 0x7U) << 20U;
3066}
3067static inline u32 gr_crstr_gpc_map3_tile23_f(u32 v)
3068{
3069 return (v & 0x7U) << 25U;
3070}
3071static inline u32 gr_crstr_gpc_map4_r(void)
3072{
3073 return 0x00418b18U;
3074}
3075static inline u32 gr_crstr_gpc_map4_tile24_f(u32 v)
3076{
3077 return (v & 0x7U) << 0U;
3078}
3079static inline u32 gr_crstr_gpc_map4_tile25_f(u32 v)
3080{
3081 return (v & 0x7U) << 5U;
3082}
3083static inline u32 gr_crstr_gpc_map4_tile26_f(u32 v)
3084{
3085 return (v & 0x7U) << 10U;
3086}
3087static inline u32 gr_crstr_gpc_map4_tile27_f(u32 v)
3088{
3089 return (v & 0x7U) << 15U;
3090}
3091static inline u32 gr_crstr_gpc_map4_tile28_f(u32 v)
3092{
3093 return (v & 0x7U) << 20U;
3094}
3095static inline u32 gr_crstr_gpc_map4_tile29_f(u32 v)
3096{
3097 return (v & 0x7U) << 25U;
3098}
3099static inline u32 gr_crstr_gpc_map5_r(void)
3100{
3101 return 0x00418b1cU;
3102}
3103static inline u32 gr_crstr_gpc_map5_tile30_f(u32 v)
3104{
3105 return (v & 0x7U) << 0U;
3106}
3107static inline u32 gr_crstr_gpc_map5_tile31_f(u32 v)
3108{
3109 return (v & 0x7U) << 5U;
3110}
3111static inline u32 gr_crstr_gpc_map5_tile32_f(u32 v)
3112{
3113 return (v & 0x7U) << 10U;
3114}
3115static inline u32 gr_crstr_gpc_map5_tile33_f(u32 v)
3116{
3117 return (v & 0x7U) << 15U;
3118}
3119static inline u32 gr_crstr_gpc_map5_tile34_f(u32 v)
3120{
3121 return (v & 0x7U) << 20U;
3122}
3123static inline u32 gr_crstr_gpc_map5_tile35_f(u32 v)
3124{
3125 return (v & 0x7U) << 25U;
3126}
3127static inline u32 gr_crstr_map_table_cfg_r(void)
3128{
3129 return 0x00418bb8U;
3130}
3131static inline u32 gr_crstr_map_table_cfg_row_offset_f(u32 v)
3132{
3133 return (v & 0xffU) << 0U;
3134}
3135static inline u32 gr_crstr_map_table_cfg_num_entries_f(u32 v)
3136{
3137 return (v & 0xffU) << 8U;
3138}
3139static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map0_r(void)
3140{
3141 return 0x00418980U;
3142}
3143static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map0_tile_0_f(u32 v)
3144{
3145 return (v & 0x7U) << 0U;
3146}
3147static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map0_tile_1_f(u32 v)
3148{
3149 return (v & 0x7U) << 4U;
3150}
3151static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map0_tile_2_f(u32 v)
3152{
3153 return (v & 0x7U) << 8U;
3154}
3155static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map0_tile_3_f(u32 v)
3156{
3157 return (v & 0x7U) << 12U;
3158}
3159static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map0_tile_4_f(u32 v)
3160{
3161 return (v & 0x7U) << 16U;
3162}
3163static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map0_tile_5_f(u32 v)
3164{
3165 return (v & 0x7U) << 20U;
3166}
3167static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map0_tile_6_f(u32 v)
3168{
3169 return (v & 0x7U) << 24U;
3170}
3171static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map0_tile_7_f(u32 v)
3172{
3173 return (v & 0x7U) << 28U;
3174}
3175static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map1_r(void)
3176{
3177 return 0x00418984U;
3178}
3179static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map1_tile_8_f(u32 v)
3180{
3181 return (v & 0x7U) << 0U;
3182}
3183static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map1_tile_9_f(u32 v)
3184{
3185 return (v & 0x7U) << 4U;
3186}
3187static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map1_tile_10_f(u32 v)
3188{
3189 return (v & 0x7U) << 8U;
3190}
3191static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map1_tile_11_f(u32 v)
3192{
3193 return (v & 0x7U) << 12U;
3194}
3195static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map1_tile_12_f(u32 v)
3196{
3197 return (v & 0x7U) << 16U;
3198}
3199static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map1_tile_13_f(u32 v)
3200{
3201 return (v & 0x7U) << 20U;
3202}
3203static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map1_tile_14_f(u32 v)
3204{
3205 return (v & 0x7U) << 24U;
3206}
3207static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map1_tile_15_f(u32 v)
3208{
3209 return (v & 0x7U) << 28U;
3210}
3211static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map2_r(void)
3212{
3213 return 0x00418988U;
3214}
3215static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map2_tile_16_f(u32 v)
3216{
3217 return (v & 0x7U) << 0U;
3218}
3219static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map2_tile_17_f(u32 v)
3220{
3221 return (v & 0x7U) << 4U;
3222}
3223static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map2_tile_18_f(u32 v)
3224{
3225 return (v & 0x7U) << 8U;
3226}
3227static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map2_tile_19_f(u32 v)
3228{
3229 return (v & 0x7U) << 12U;
3230}
3231static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map2_tile_20_f(u32 v)
3232{
3233 return (v & 0x7U) << 16U;
3234}
3235static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map2_tile_21_f(u32 v)
3236{
3237 return (v & 0x7U) << 20U;
3238}
3239static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map2_tile_22_f(u32 v)
3240{
3241 return (v & 0x7U) << 24U;
3242}
3243static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map2_tile_23_s(void)
3244{
3245 return 3U;
3246}
3247static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map2_tile_23_f(u32 v)
3248{
3249 return (v & 0x7U) << 28U;
3250}
3251static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map2_tile_23_m(void)
3252{
3253 return 0x7U << 28U;
3254}
3255static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map2_tile_23_v(u32 r)
3256{
3257 return (r >> 28U) & 0x7U;
3258}
3259static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map3_r(void)
3260{
3261 return 0x0041898cU;
3262}
3263static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map3_tile_24_f(u32 v)
3264{
3265 return (v & 0x7U) << 0U;
3266}
3267static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map3_tile_25_f(u32 v)
3268{
3269 return (v & 0x7U) << 4U;
3270}
3271static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map3_tile_26_f(u32 v)
3272{
3273 return (v & 0x7U) << 8U;
3274}
3275static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map3_tile_27_f(u32 v)
3276{
3277 return (v & 0x7U) << 12U;
3278}
3279static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map3_tile_28_f(u32 v)
3280{
3281 return (v & 0x7U) << 16U;
3282}
3283static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map3_tile_29_f(u32 v)
3284{
3285 return (v & 0x7U) << 20U;
3286}
3287static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map3_tile_30_f(u32 v)
3288{
3289 return (v & 0x7U) << 24U;
3290}
3291static inline u32 gr_gpcs_zcull_sm_in_gpc_number_map3_tile_31_f(u32 v)
3292{
3293 return (v & 0x7U) << 28U;
3294}
3295static inline u32 gr_gpcs_gpm_pd_cfg_r(void)
3296{
3297 return 0x00418c6cU;
3298}
3299static inline u32 gr_gpcs_gpm_pd_cfg_timeslice_mode_disable_f(void)
3300{
3301 return 0x0U;
3302}
3303static inline u32 gr_gpcs_gpm_pd_cfg_timeslice_mode_enable_f(void)
3304{
3305 return 0x1U;
3306}
3307static inline u32 gr_gpcs_gcc_pagepool_base_r(void)
3308{
3309 return 0x00419004U;
3310}
3311static inline u32 gr_gpcs_gcc_pagepool_base_addr_39_8_f(u32 v)
3312{
3313 return (v & 0xffffffffU) << 0U;
3314}
3315static inline u32 gr_gpcs_gcc_pagepool_r(void)
3316{
3317 return 0x00419008U;
3318}
3319static inline u32 gr_gpcs_gcc_pagepool_total_pages_f(u32 v)
3320{
3321 return (v & 0x3ffU) << 0U;
3322}
3323static inline u32 gr_gpcs_tpcs_pe_vaf_r(void)
3324{
3325 return 0x0041980cU;
3326}
3327static inline u32 gr_gpcs_tpcs_pe_vaf_fast_mode_switch_true_f(void)
3328{
3329 return 0x10U;
3330}
3331static inline u32 gr_gpcs_tpcs_pe_pin_cb_global_base_addr_r(void)
3332{
3333 return 0x00419848U;
3334}
3335static inline u32 gr_gpcs_tpcs_pe_pin_cb_global_base_addr_v_f(u32 v)
3336{
3337 return (v & 0xfffffffU) << 0U;
3338}
3339static inline u32 gr_gpcs_tpcs_pe_pin_cb_global_base_addr_valid_f(u32 v)
3340{
3341 return (v & 0x1U) << 28U;
3342}
3343static inline u32 gr_gpcs_tpcs_pe_pin_cb_global_base_addr_valid_true_f(void)
3344{
3345 return 0x10000000U;
3346}
3347static inline u32 gr_gpcs_tpcs_mpc_vtg_debug_r(void)
3348{
3349 return 0x00419c00U;
3350}
3351static inline u32 gr_gpcs_tpcs_mpc_vtg_debug_timeslice_mode_disabled_f(void)
3352{
3353 return 0x0U;
3354}
3355static inline u32 gr_gpcs_tpcs_mpc_vtg_debug_timeslice_mode_enabled_f(void)
3356{
3357 return 0x8U;
3358}
3359static inline u32 gr_gpcs_tpcs_mpc_vtg_cb_global_base_addr_r(void)
3360{
3361 return 0x00419c2cU;
3362}
3363static inline u32 gr_gpcs_tpcs_mpc_vtg_cb_global_base_addr_v_f(u32 v)
3364{
3365 return (v & 0xfffffffU) << 0U;
3366}
3367static inline u32 gr_gpcs_tpcs_mpc_vtg_cb_global_base_addr_valid_f(u32 v)
3368{
3369 return (v & 0x1U) << 28U;
3370}
3371static inline u32 gr_gpcs_tpcs_mpc_vtg_cb_global_base_addr_valid_true_f(void)
3372{
3373 return 0x10000000U;
3374}
3375static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_r(void)
3376{
3377 return 0x00419e44U;
3378}
3379static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_stack_error_report_f(void)
3380{
3381 return 0x2U;
3382}
3383static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_api_stack_error_report_f(void)
3384{
3385 return 0x4U;
3386}
3387static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_ret_empty_stack_error_report_f(void)
3388{
3389 return 0x8U;
3390}
3391static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_pc_wrap_report_f(void)
3392{
3393 return 0x10U;
3394}
3395static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_misaligned_pc_report_f(void)
3396{
3397 return 0x20U;
3398}
3399static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_pc_overflow_report_f(void)
3400{
3401 return 0x40U;
3402}
3403static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_misaligned_immc_addr_report_f(void)
3404{
3405 return 0x80U;
3406}
3407static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_misaligned_reg_report_f(void)
3408{
3409 return 0x100U;
3410}
3411static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_illegal_instr_encoding_report_f(void)
3412{
3413 return 0x200U;
3414}
3415static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_illegal_sph_instr_combo_report_f(void)
3416{
3417 return 0x400U;
3418}
3419static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_illegal_instr_param_report_f(void)
3420{
3421 return 0x800U;
3422}
3423static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_invalid_const_addr_report_f(void)
3424{
3425 return 0x1000U;
3426}
3427static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_oor_reg_report_f(void)
3428{
3429 return 0x2000U;
3430}
3431static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_oor_addr_report_f(void)
3432{
3433 return 0x4000U;
3434}
3435static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_misaligned_addr_report_f(void)
3436{
3437 return 0x8000U;
3438}
3439static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_invalid_addr_space_report_f(void)
3440{
3441 return 0x10000U;
3442}
3443static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_illegal_instr_param2_report_f(void)
3444{
3445 return 0x20000U;
3446}
3447static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_invalid_const_addr_ldc_report_f(void)
3448{
3449 return 0x40000U;
3450}
3451static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_mmu_fault_report_f(void)
3452{
3453 return 0x800000U;
3454}
3455static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_stack_overflow_report_f(void)
3456{
3457 return 0x400000U;
3458}
3459static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_geometry_sm_error_report_f(void)
3460{
3461 return 0x80000U;
3462}
3463static inline u32 gr_gpcs_tpcs_sm_hww_warp_esr_report_mask_divergent_report_f(void)
3464{
3465 return 0x100000U;
3466}
3467static inline u32 gr_gpc0_tpc0_sm_hww_warp_esr_report_mask_r(void)
3468{
3469 return 0x00504644U;
3470}
3471static inline u32 gr_gpcs_tpcs_sm_hww_global_esr_report_mask_r(void)
3472{
3473 return 0x00419e4cU;
3474}
3475static inline u32 gr_gpcs_tpcs_sm_hww_global_esr_report_mask_sm_to_sm_fault_report_f(void)
3476{
3477 return 0x1U;
3478}
3479static inline u32 gr_gpcs_tpcs_sm_hww_global_esr_report_mask_l1_error_report_f(void)
3480{
3481 return 0x2U;
3482}
3483static inline u32 gr_gpcs_tpcs_sm_hww_global_esr_report_mask_multiple_warp_errors_report_f(void)
3484{
3485 return 0x4U;
3486}
3487static inline u32 gr_gpcs_tpcs_sm_hww_global_esr_report_mask_physical_stack_overflow_error_report_f(void)
3488{
3489 return 0x8U;
3490}
3491static inline u32 gr_gpcs_tpcs_sm_hww_global_esr_report_mask_bpt_int_report_f(void)
3492{
3493 return 0x10U;
3494}
3495static inline u32 gr_gpcs_tpcs_sm_hww_global_esr_report_mask_ecc_sec_error_report_f(void)
3496{
3497 return 0x20000000U;
3498}
3499static inline u32 gr_gpcs_tpcs_sm_hww_global_esr_report_mask_ecc_ded_error_report_f(void)
3500{
3501 return 0x40000000U;
3502}
3503static inline u32 gr_gpcs_tpcs_sm_hww_global_esr_report_mask_bpt_pause_report_f(void)
3504{
3505 return 0x20U;
3506}
3507static inline u32 gr_gpcs_tpcs_sm_hww_global_esr_report_mask_single_step_complete_report_f(void)
3508{
3509 return 0x40U;
3510}
3511static inline u32 gr_gpc0_tpc0_sm_hww_global_esr_report_mask_r(void)
3512{
3513 return 0x0050464cU;
3514}
3515static inline u32 gr_gpcs_tpcs_tpccs_tpc_exception_en_r(void)
3516{
3517 return 0x00419d0cU;
3518}
3519static inline u32 gr_gpcs_tpcs_tpccs_tpc_exception_en_sm_enabled_f(void)
3520{
3521 return 0x2U;
3522}
3523static inline u32 gr_gpcs_tpcs_tpccs_tpc_exception_en_tex_enabled_f(void)
3524{
3525 return 0x1U;
3526}
3527static inline u32 gr_gpc0_tpc0_tpccs_tpc_exception_en_r(void)
3528{
3529 return 0x0050450cU;
3530}
3531static inline u32 gr_gpc0_tpc0_tpccs_tpc_exception_en_sm_v(u32 r)
3532{
3533 return (r >> 1U) & 0x1U;
3534}
3535static inline u32 gr_gpc0_tpc0_tpccs_tpc_exception_en_sm_enabled_f(void)
3536{
3537 return 0x2U;
3538}
3539static inline u32 gr_gpcs_gpccs_gpc_exception_en_r(void)
3540{
3541 return 0x0041ac94U;
3542}
3543static inline u32 gr_gpcs_gpccs_gpc_exception_en_tpc_f(u32 v)
3544{
3545 return (v & 0xffU) << 16U;
3546}
3547static inline u32 gr_gpc0_gpccs_gpc_exception_r(void)
3548{
3549 return 0x00502c90U;
3550}
3551static inline u32 gr_gpc0_gpccs_gpc_exception_gcc_v(u32 r)
3552{
3553 return (r >> 2U) & 0x1U;
3554}
3555static inline u32 gr_gpc0_gpccs_gpc_exception_tpc_v(u32 r)
3556{
3557 return (r >> 16U) & 0xffU;
3558}
3559static inline u32 gr_gpc0_gpccs_gpc_exception_tpc_0_pending_v(void)
3560{
3561 return 0x00000001U;
3562}
3563static inline u32 gr_gpc0_tpc0_tpccs_tpc_exception_r(void)
3564{
3565 return 0x00504508U;
3566}
3567static inline u32 gr_gpc0_tpc0_tpccs_tpc_exception_tex_v(u32 r)
3568{
3569 return (r >> 0U) & 0x1U;
3570}
3571static inline u32 gr_gpc0_tpc0_tpccs_tpc_exception_tex_pending_v(void)
3572{
3573 return 0x00000001U;
3574}
3575static inline u32 gr_gpc0_tpc0_tpccs_tpc_exception_sm_v(u32 r)
3576{
3577 return (r >> 1U) & 0x1U;
3578}
3579static inline u32 gr_gpc0_tpc0_tpccs_tpc_exception_sm_pending_v(void)
3580{
3581 return 0x00000001U;
3582}
3583static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_r(void)
3584{
3585 return 0x00504610U;
3586}
3587static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_debugger_mode_m(void)
3588{
3589 return 0x1U << 0U;
3590}
3591static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_debugger_mode_v(u32 r)
3592{
3593 return (r >> 0U) & 0x1U;
3594}
3595static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_debugger_mode_on_v(void)
3596{
3597 return 0x00000001U;
3598}
3599static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_debugger_mode_off_v(void)
3600{
3601 return 0x00000000U;
3602}
3603static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_stop_trigger_enable_f(void)
3604{
3605 return 0x80000000U;
3606}
3607static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_stop_trigger_disable_f(void)
3608{
3609 return 0x0U;
3610}
3611static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_single_step_mode_enable_f(void)
3612{
3613 return 0x8U;
3614}
3615static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_single_step_mode_disable_f(void)
3616{
3617 return 0x0U;
3618}
3619static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_run_trigger_task_f(void)
3620{
3621 return 0x40000000U;
3622}
3623static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_stop_on_any_warp_m(void)
3624{
3625 return 0x1U << 1U;
3626}
3627static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_stop_on_any_warp_v(u32 r)
3628{
3629 return (r >> 1U) & 0x1U;
3630}
3631static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_stop_on_any_warp_disable_f(void)
3632{
3633 return 0x0U;
3634}
3635static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_stop_on_any_sm_m(void)
3636{
3637 return 0x1U << 2U;
3638}
3639static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_stop_on_any_sm_v(u32 r)
3640{
3641 return (r >> 2U) & 0x1U;
3642}
3643static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_stop_on_any_sm_disable_f(void)
3644{
3645 return 0x0U;
3646}
3647static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_stop_on_any_sm_stop_on_any_warp_disable_v(void)
3648{
3649 return 0x00000000U;
3650}
3651static inline u32 gr_gpc0_tpc0_sm_dbgr_control0_stop_on_any_sm_stop_on_any_sm_disable_v(void)
3652{
3653 return 0x00000000U;
3654}
3655static inline u32 gr_gpc0_tpc0_sm_warp_valid_mask_r(void)
3656{
3657 return 0x00504614U;
3658}
3659static inline u32 gr_gpc0_tpc0_sm_warp_valid_mask_1_r(void)
3660{
3661 return 0x00504618U;
3662}
3663static inline u32 gr_gpc0_tpc0_sm_dbgr_bpt_pause_mask_r(void)
3664{
3665 return 0x00504624U;
3666}
3667static inline u32 gr_gpc0_tpc0_sm_dbgr_bpt_pause_mask_1_r(void)
3668{
3669 return 0x00504628U;
3670}
3671static inline u32 gr_gpc0_tpc0_sm_dbgr_bpt_trap_mask_r(void)
3672{
3673 return 0x00504634U;
3674}
3675static inline u32 gr_gpc0_tpc0_sm_dbgr_bpt_trap_mask_1_r(void)
3676{
3677 return 0x00504638U;
3678}
3679static inline u32 gr_gpcs_tpcs_sm_dbgr_bpt_pause_mask_r(void)
3680{
3681 return 0x00419e24U;
3682}
3683static inline u32 gr_gpc0_tpc0_sm_dbgr_status0_r(void)
3684{
3685 return 0x0050460cU;
3686}
3687static inline u32 gr_gpc0_tpc0_sm_dbgr_status0_sm_in_trap_mode_v(u32 r)
3688{
3689 return (r >> 0U) & 0x1U;
3690}
3691static inline u32 gr_gpc0_tpc0_sm_dbgr_status0_locked_down_v(u32 r)
3692{
3693 return (r >> 4U) & 0x1U;
3694}
3695static inline u32 gr_gpc0_tpc0_sm_dbgr_status0_locked_down_true_v(void)
3696{
3697 return 0x00000001U;
3698}
3699static inline u32 gr_gpcs_tpcs_sm_hww_global_esr_r(void)
3700{
3701 return 0x00419e50U;
3702}
3703static inline u32 gr_gpcs_tpcs_sm_hww_global_esr_bpt_int_pending_f(void)
3704{
3705 return 0x10U;
3706}
3707static inline u32 gr_gpcs_tpcs_sm_hww_global_esr_bpt_pause_pending_f(void)
3708{
3709 return 0x20U;
3710}
3711static inline u32 gr_gpcs_tpcs_sm_hww_global_esr_single_step_complete_pending_f(void)
3712{
3713 return 0x40U;
3714}
3715static inline u32 gr_gpcs_tpcs_sm_hww_global_esr_sm_to_sm_fault_pending_f(void)
3716{
3717 return 0x1U;
3718}
3719static inline u32 gr_gpcs_tpcs_sm_hww_global_esr_l1_error_pending_f(void)
3720{
3721 return 0x2U;
3722}
3723static inline u32 gr_gpcs_tpcs_sm_hww_global_esr_multiple_warp_errors_pending_f(void)
3724{
3725 return 0x4U;
3726}
3727static inline u32 gr_gpcs_tpcs_sm_hww_global_esr_physical_stack_overflow_error_pending_f(void)
3728{
3729 return 0x8U;
3730}
3731static inline u32 gr_gpcs_tpcs_sm_hww_global_esr_timeout_error_pending_f(void)
3732{
3733 return 0x80000000U;
3734}
3735static inline u32 gr_gpc0_tpc0_sm_hww_global_esr_r(void)
3736{
3737 return 0x00504650U;
3738}
3739static inline u32 gr_gpc0_tpc0_sm_hww_global_esr_bpt_int_pending_f(void)
3740{
3741 return 0x10U;
3742}
3743static inline u32 gr_gpc0_tpc0_sm_hww_global_esr_ecc_sec_error_pending_f(void)
3744{
3745 return 0x20000000U;
3746}
3747static inline u32 gr_gpc0_tpc0_sm_hww_global_esr_ecc_ded_error_pending_f(void)
3748{
3749 return 0x40000000U;
3750}
3751static inline u32 gr_gpc0_tpc0_sm_hww_global_esr_bpt_pause_pending_f(void)
3752{
3753 return 0x20U;
3754}
3755static inline u32 gr_gpc0_tpc0_sm_hww_global_esr_single_step_complete_pending_f(void)
3756{
3757 return 0x40U;
3758}
3759static inline u32 gr_gpc0_tpc0_sm_hww_global_esr_sm_to_sm_fault_pending_f(void)
3760{
3761 return 0x1U;
3762}
3763static inline u32 gr_gpc0_tpc0_sm_hww_global_esr_l1_error_pending_f(void)
3764{
3765 return 0x2U;
3766}
3767static inline u32 gr_gpc0_tpc0_sm_hww_global_esr_multiple_warp_errors_pending_f(void)
3768{
3769 return 0x4U;
3770}
3771static inline u32 gr_gpc0_tpc0_sm_hww_global_esr_physical_stack_overflow_error_pending_f(void)
3772{
3773 return 0x8U;
3774}
3775static inline u32 gr_gpc0_tpc0_sm_hww_global_esr_timeout_error_pending_f(void)
3776{
3777 return 0x80000000U;
3778}
3779static inline u32 gr_gpc0_tpc0_tex_m_hww_esr_r(void)
3780{
3781 return 0x00504224U;
3782}
3783static inline u32 gr_gpc0_tpc0_tex_m_hww_esr_intr_pending_f(void)
3784{
3785 return 0x1U;
3786}
3787static inline u32 gr_gpc0_tpc0_tex_m_hww_esr_ecc_sec_pending_f(void)
3788{
3789 return 0x80U;
3790}
3791static inline u32 gr_gpc0_tpc0_tex_m_hww_esr_ecc_ded_pending_f(void)
3792{
3793 return 0x100U;
3794}
3795static inline u32 gr_gpc0_tpc0_tex_m_hww_esr_reset_active_f(void)
3796{
3797 return 0x40000000U;
3798}
3799static inline u32 gr_gpc0_tpc0_sm_hww_warp_esr_r(void)
3800{
3801 return 0x00504648U;
3802}
3803static inline u32 gr_gpc0_tpc0_sm_hww_warp_esr_error_v(u32 r)
3804{
3805 return (r >> 0U) & 0xffffU;
3806}
3807static inline u32 gr_gpc0_tpc0_sm_hww_warp_esr_error_none_v(void)
3808{
3809 return 0x00000000U;
3810}
3811static inline u32 gr_gpc0_tpc0_sm_hww_warp_esr_error_none_f(void)
3812{
3813 return 0x0U;
3814}
3815static inline u32 gr_gpc0_tpc0_sm_hww_warp_esr_addr_valid_m(void)
3816{
3817 return 0x1U << 24U;
3818}
3819static inline u32 gr_gpc0_tpc0_sm_hww_warp_esr_addr_error_type_m(void)
3820{
3821 return 0x7U << 25U;
3822}
3823static inline u32 gr_gpc0_tpc0_sm_hww_warp_esr_addr_error_type_none_f(void)
3824{
3825 return 0x0U;
3826}
3827static inline u32 gr_gpc0_tpc0_sm_hww_warp_esr_pc_r(void)
3828{
3829 return 0x00504654U;
3830}
3831static inline u32 gr_gpc0_tpc0_sm_halfctl_ctrl_r(void)
3832{
3833 return 0x00504770U;
3834}
3835static inline u32 gr_gpcs_tpcs_sm_halfctl_ctrl_r(void)
3836{
3837 return 0x00419f70U;
3838}
3839static inline u32 gr_gpcs_tpcs_sm_halfctl_ctrl_sctl_read_quad_ctl_m(void)
3840{
3841 return 0x1U << 4U;
3842}
3843static inline u32 gr_gpcs_tpcs_sm_halfctl_ctrl_sctl_read_quad_ctl_f(u32 v)
3844{
3845 return (v & 0x1U) << 4U;
3846}
3847static inline u32 gr_gpc0_tpc0_sm_debug_sfe_control_r(void)
3848{
3849 return 0x0050477cU;
3850}
3851static inline u32 gr_gpcs_tpcs_sm_debug_sfe_control_r(void)
3852{
3853 return 0x00419f7cU;
3854}
3855static inline u32 gr_gpcs_tpcs_sm_debug_sfe_control_read_half_ctl_m(void)
3856{
3857 return 0x1U << 0U;
3858}
3859static inline u32 gr_gpcs_tpcs_sm_debug_sfe_control_read_half_ctl_f(u32 v)
3860{
3861 return (v & 0x1U) << 0U;
3862}
3863static inline u32 gr_gpcs_tpcs_pes_vsc_vpc_r(void)
3864{
3865 return 0x0041be08U;
3866}
3867static inline u32 gr_gpcs_tpcs_pes_vsc_vpc_fast_mode_switch_true_f(void)
3868{
3869 return 0x4U;
3870}
3871static inline u32 gr_ppcs_wwdx_map_gpc_map0_r(void)
3872{
3873 return 0x0041bf00U;
3874}
3875static inline u32 gr_ppcs_wwdx_map_gpc_map1_r(void)
3876{
3877 return 0x0041bf04U;
3878}
3879static inline u32 gr_ppcs_wwdx_map_gpc_map2_r(void)
3880{
3881 return 0x0041bf08U;
3882}
3883static inline u32 gr_ppcs_wwdx_map_gpc_map3_r(void)
3884{
3885 return 0x0041bf0cU;
3886}
3887static inline u32 gr_ppcs_wwdx_map_gpc_map4_r(void)
3888{
3889 return 0x0041bf10U;
3890}
3891static inline u32 gr_ppcs_wwdx_map_gpc_map5_r(void)
3892{
3893 return 0x0041bf14U;
3894}
3895static inline u32 gr_ppcs_wwdx_map_table_cfg_r(void)
3896{
3897 return 0x0041bfd0U;
3898}
3899static inline u32 gr_ppcs_wwdx_map_table_cfg_row_offset_f(u32 v)
3900{
3901 return (v & 0xffU) << 0U;
3902}
3903static inline u32 gr_ppcs_wwdx_map_table_cfg_num_entries_f(u32 v)
3904{
3905 return (v & 0xffU) << 8U;
3906}
3907static inline u32 gr_ppcs_wwdx_map_table_cfg_normalized_num_entries_f(u32 v)
3908{
3909 return (v & 0x1fU) << 16U;
3910}
3911static inline u32 gr_ppcs_wwdx_map_table_cfg_normalized_shift_value_f(u32 v)
3912{
3913 return (v & 0x7U) << 21U;
3914}
3915static inline u32 gr_ppcs_wwdx_map_table_cfg_coeff5_mod_value_f(u32 v)
3916{
3917 return (v & 0x1fU) << 24U;
3918}
3919static inline u32 gr_gpcs_ppcs_wwdx_sm_num_rcp_r(void)
3920{
3921 return 0x0041bfd4U;
3922}
3923static inline u32 gr_gpcs_ppcs_wwdx_sm_num_rcp_conservative_f(u32 v)
3924{
3925 return (v & 0xffffffU) << 0U;
3926}
3927static inline u32 gr_ppcs_wwdx_map_table_cfg2_r(void)
3928{
3929 return 0x0041bfe4U;
3930}
3931static inline u32 gr_ppcs_wwdx_map_table_cfg2_coeff6_mod_value_f(u32 v)
3932{
3933 return (v & 0x1fU) << 0U;
3934}
3935static inline u32 gr_ppcs_wwdx_map_table_cfg2_coeff7_mod_value_f(u32 v)
3936{
3937 return (v & 0x1fU) << 5U;
3938}
3939static inline u32 gr_ppcs_wwdx_map_table_cfg2_coeff8_mod_value_f(u32 v)
3940{
3941 return (v & 0x1fU) << 10U;
3942}
3943static inline u32 gr_ppcs_wwdx_map_table_cfg2_coeff9_mod_value_f(u32 v)
3944{
3945 return (v & 0x1fU) << 15U;
3946}
3947static inline u32 gr_ppcs_wwdx_map_table_cfg2_coeff10_mod_value_f(u32 v)
3948{
3949 return (v & 0x1fU) << 20U;
3950}
3951static inline u32 gr_ppcs_wwdx_map_table_cfg2_coeff11_mod_value_f(u32 v)
3952{
3953 return (v & 0x1fU) << 25U;
3954}
3955static inline u32 gr_bes_zrop_settings_r(void)
3956{
3957 return 0x00408850U;
3958}
3959static inline u32 gr_bes_zrop_settings_num_active_ltcs_f(u32 v)
3960{
3961 return (v & 0xfU) << 0U;
3962}
3963static inline u32 gr_be0_crop_debug3_r(void)
3964{
3965 return 0x00410108U;
3966}
3967static inline u32 gr_bes_crop_debug3_r(void)
3968{
3969 return 0x00408908U;
3970}
3971static inline u32 gr_bes_crop_debug3_comp_vdc_4to2_disable_m(void)
3972{
3973 return 0x1U << 31U;
3974}
3975static inline u32 gr_bes_crop_debug3_blendopt_read_suppress_m(void)
3976{
3977 return 0x1U << 1U;
3978}
3979static inline u32 gr_bes_crop_debug3_blendopt_read_suppress_disabled_f(void)
3980{
3981 return 0x0U;
3982}
3983static inline u32 gr_bes_crop_debug3_blendopt_read_suppress_enabled_f(void)
3984{
3985 return 0x2U;
3986}
3987static inline u32 gr_bes_crop_debug3_blendopt_fill_override_m(void)
3988{
3989 return 0x1U << 2U;
3990}
3991static inline u32 gr_bes_crop_debug3_blendopt_fill_override_disabled_f(void)
3992{
3993 return 0x0U;
3994}
3995static inline u32 gr_bes_crop_debug3_blendopt_fill_override_enabled_f(void)
3996{
3997 return 0x4U;
3998}
3999static inline u32 gr_bes_crop_settings_r(void)
4000{
4001 return 0x00408958U;
4002}
4003static inline u32 gr_bes_crop_settings_num_active_ltcs_f(u32 v)
4004{
4005 return (v & 0xfU) << 0U;
4006}
4007static inline u32 gr_zcull_bytes_per_aliquot_per_gpu_v(void)
4008{
4009 return 0x00000020U;
4010}
4011static inline u32 gr_zcull_save_restore_header_bytes_per_gpc_v(void)
4012{
4013 return 0x00000020U;
4014}
4015static inline u32 gr_zcull_save_restore_subregion_header_bytes_per_gpc_v(void)
4016{
4017 return 0x000000c0U;
4018}
4019static inline u32 gr_zcull_subregion_qty_v(void)
4020{
4021 return 0x00000010U;
4022}
4023static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter_control_sel0_r(void)
4024{
4025 return 0x00504604U;
4026}
4027static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter_control_sel1_r(void)
4028{
4029 return 0x00504608U;
4030}
4031static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter_control0_r(void)
4032{
4033 return 0x0050465cU;
4034}
4035static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter_control1_r(void)
4036{
4037 return 0x00504660U;
4038}
4039static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter_control2_r(void)
4040{
4041 return 0x00504664U;
4042}
4043static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter_control3_r(void)
4044{
4045 return 0x00504668U;
4046}
4047static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter_control4_r(void)
4048{
4049 return 0x0050466cU;
4050}
4051static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter_control5_r(void)
4052{
4053 return 0x00504658U;
4054}
4055static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter0_control_r(void)
4056{
4057 return 0x00504730U;
4058}
4059static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter1_control_r(void)
4060{
4061 return 0x00504734U;
4062}
4063static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter2_control_r(void)
4064{
4065 return 0x00504738U;
4066}
4067static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter3_control_r(void)
4068{
4069 return 0x0050473cU;
4070}
4071static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter4_control_r(void)
4072{
4073 return 0x00504740U;
4074}
4075static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter5_control_r(void)
4076{
4077 return 0x00504744U;
4078}
4079static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter6_control_r(void)
4080{
4081 return 0x00504748U;
4082}
4083static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter7_control_r(void)
4084{
4085 return 0x0050474cU;
4086}
4087static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter_status_s1_r(void)
4088{
4089 return 0x00504678U;
4090}
4091static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter_status1_r(void)
4092{
4093 return 0x00504694U;
4094}
4095static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter0_s0_r(void)
4096{
4097 return 0x005046f0U;
4098}
4099static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter0_s1_r(void)
4100{
4101 return 0x00504700U;
4102}
4103static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter1_s0_r(void)
4104{
4105 return 0x005046f4U;
4106}
4107static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter1_s1_r(void)
4108{
4109 return 0x00504704U;
4110}
4111static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter2_s0_r(void)
4112{
4113 return 0x005046f8U;
4114}
4115static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter2_s1_r(void)
4116{
4117 return 0x00504708U;
4118}
4119static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter3_s0_r(void)
4120{
4121 return 0x005046fcU;
4122}
4123static inline u32 gr_pri_gpc0_tpc0_sm_dsm_perf_counter3_s1_r(void)
4124{
4125 return 0x0050470cU;
4126}
4127static inline u32 gr_fe_pwr_mode_r(void)
4128{
4129 return 0x00404170U;
4130}
4131static inline u32 gr_fe_pwr_mode_mode_auto_f(void)
4132{
4133 return 0x0U;
4134}
4135static inline u32 gr_fe_pwr_mode_mode_force_on_f(void)
4136{
4137 return 0x2U;
4138}
4139static inline u32 gr_fe_pwr_mode_req_v(u32 r)
4140{
4141 return (r >> 4U) & 0x1U;
4142}
4143static inline u32 gr_fe_pwr_mode_req_send_f(void)
4144{
4145 return 0x10U;
4146}
4147static inline u32 gr_fe_pwr_mode_req_done_v(void)
4148{
4149 return 0x00000000U;
4150}
4151static inline u32 gr_gpcs_pri_mmu_ctrl_r(void)
4152{
4153 return 0x00418880U;
4154}
4155static inline u32 gr_gpcs_pri_mmu_ctrl_vm_pg_size_m(void)
4156{
4157 return 0x1U << 0U;
4158}
4159static inline u32 gr_gpcs_pri_mmu_ctrl_use_pdb_big_page_size_m(void)
4160{
4161 return 0x1U << 11U;
4162}
4163static inline u32 gr_gpcs_pri_mmu_ctrl_vol_fault_m(void)
4164{
4165 return 0x1U << 1U;
4166}
4167static inline u32 gr_gpcs_pri_mmu_ctrl_comp_fault_m(void)
4168{
4169 return 0x1U << 2U;
4170}
4171static inline u32 gr_gpcs_pri_mmu_ctrl_miss_gran_m(void)
4172{
4173 return 0x3U << 3U;
4174}
4175static inline u32 gr_gpcs_pri_mmu_ctrl_cache_mode_m(void)
4176{
4177 return 0x3U << 5U;
4178}
4179static inline u32 gr_gpcs_pri_mmu_ctrl_mmu_aperture_m(void)
4180{
4181 return 0x3U << 28U;
4182}
4183static inline u32 gr_gpcs_pri_mmu_ctrl_mmu_vol_m(void)
4184{
4185 return 0x1U << 30U;
4186}
4187static inline u32 gr_gpcs_pri_mmu_ctrl_mmu_disable_m(void)
4188{
4189 return 0x1U << 31U;
4190}
4191static inline u32 gr_gpcs_pri_mmu_pm_unit_mask_r(void)
4192{
4193 return 0x00418890U;
4194}
4195static inline u32 gr_gpcs_pri_mmu_pm_req_mask_r(void)
4196{
4197 return 0x00418894U;
4198}
4199static inline u32 gr_gpcs_pri_mmu_debug_ctrl_r(void)
4200{
4201 return 0x004188b0U;
4202}
4203static inline u32 gr_gpcs_pri_mmu_debug_ctrl_debug_v(u32 r)
4204{
4205 return (r >> 16U) & 0x1U;
4206}
4207static inline u32 gr_gpcs_pri_mmu_debug_ctrl_debug_enabled_v(void)
4208{
4209 return 0x00000001U;
4210}
4211static inline u32 gr_gpcs_pri_mmu_debug_wr_r(void)
4212{
4213 return 0x004188b4U;
4214}
4215static inline u32 gr_gpcs_pri_mmu_debug_rd_r(void)
4216{
4217 return 0x004188b8U;
4218}
4219static inline u32 gr_gpcs_mmu_num_active_ltcs_r(void)
4220{
4221 return 0x004188acU;
4222}
4223static inline u32 gr_gpcs_tpcs_sm_dbgr_control0_r(void)
4224{
4225 return 0x00419e10U;
4226}
4227static inline u32 gr_gpcs_tpcs_sm_dbgr_control0_debugger_mode_f(u32 v)
4228{
4229 return (v & 0x1U) << 0U;
4230}
4231static inline u32 gr_gpcs_tpcs_sm_dbgr_control0_debugger_mode_on_v(void)
4232{
4233 return 0x00000001U;
4234}
4235static inline u32 gr_gpcs_tpcs_sm_dbgr_control0_stop_trigger_m(void)
4236{
4237 return 0x1U << 31U;
4238}
4239static inline u32 gr_gpcs_tpcs_sm_dbgr_control0_stop_trigger_v(u32 r)
4240{
4241 return (r >> 31U) & 0x1U;
4242}
4243static inline u32 gr_gpcs_tpcs_sm_dbgr_control0_stop_trigger_enable_f(void)
4244{
4245 return 0x80000000U;
4246}
4247static inline u32 gr_gpcs_tpcs_sm_dbgr_control0_stop_trigger_disable_f(void)
4248{
4249 return 0x0U;
4250}
4251static inline u32 gr_gpcs_tpcs_sm_dbgr_control0_single_step_mode_m(void)
4252{
4253 return 0x1U << 3U;
4254}
4255static inline u32 gr_gpcs_tpcs_sm_dbgr_control0_single_step_mode_enable_f(void)
4256{
4257 return 0x8U;
4258}
4259static inline u32 gr_gpcs_tpcs_sm_dbgr_control0_single_step_mode_disable_f(void)
4260{
4261 return 0x0U;
4262}
4263static inline u32 gr_gpcs_tpcs_sm_dbgr_control0_run_trigger_m(void)
4264{
4265 return 0x1U << 30U;
4266}
4267static inline u32 gr_gpcs_tpcs_sm_dbgr_control0_run_trigger_v(u32 r)
4268{
4269 return (r >> 30U) & 0x1U;
4270}
4271static inline u32 gr_gpcs_tpcs_sm_dbgr_control0_run_trigger_task_f(void)
4272{
4273 return 0x40000000U;
4274}
4275static inline u32 gr_fe_gfxp_wfi_timeout_r(void)
4276{
4277 return 0x004041c0U;
4278}
4279static inline u32 gr_fe_gfxp_wfi_timeout_count_f(u32 v)
4280{
4281 return (v & 0xffffffffU) << 0U;
4282}
4283static inline u32 gr_fe_gfxp_wfi_timeout_count_disabled_f(void)
4284{
4285 return 0x0U;
4286}
4287static inline u32 gr_debug_2_r(void)
4288{
4289 return 0x00400088U;
4290}
4291static inline u32 gr_debug_2_gfxp_wfi_always_injects_wfi_m(void)
4292{
4293 return 0x1U << 23U;
4294}
4295static inline u32 gr_debug_2_gfxp_wfi_always_injects_wfi_v(u32 r)
4296{
4297 return (r >> 23U) & 0x1U;
4298}
4299static inline u32 gr_debug_2_gfxp_wfi_always_injects_wfi_enabled_f(void)
4300{
4301 return 0x800000U;
4302}
4303static inline u32 gr_debug_2_gfxp_wfi_always_injects_wfi_disabled_f(void)
4304{
4305 return 0x0U;
4306}
4307static inline u32 gr_gpcs_tpcs_sm_texio_control_r(void)
4308{
4309 return 0x00419c84U;
4310}
4311static inline u32 gr_gpcs_tpcs_sm_texio_control_oor_addr_check_mode_f(u32 v)
4312{
4313 return (v & 0x7U) << 8U;
4314}
4315static inline u32 gr_gpcs_tpcs_sm_texio_control_oor_addr_check_mode_m(void)
4316{
4317 return 0x7U << 8U;
4318}
4319static inline u32 gr_gpcs_tpcs_sm_texio_control_oor_addr_check_mode_arm_63_48_match_f(void)
4320{
4321 return 0x100U;
4322}
4323static inline u32 gr_gpcs_tpcs_sm_disp_ctrl_r(void)
4324{
4325 return 0x00419f78U;
4326}
4327static inline u32 gr_gpcs_tpcs_sm_disp_ctrl_re_suppress_m(void)
4328{
4329 return 0x3U << 11U;
4330}
4331static inline u32 gr_gpcs_tpcs_sm_disp_ctrl_re_suppress_disable_f(void)
4332{
4333 return 0x1000U;
4334}
4335static inline u32 gr_gpcs_tc_debug0_r(void)
4336{
4337 return 0x00418708U;
4338}
4339static inline u32 gr_gpcs_tc_debug0_limit_coalesce_buffer_size_f(u32 v)
4340{
4341 return (v & 0xffU) << 0U;
4342}
4343static inline u32 gr_gpcs_tc_debug0_limit_coalesce_buffer_size_m(void)
4344{
4345 return 0xffU << 0U;
4346}
4347static inline u32 gr_gpc0_prop_debug1_r(void)
4348{
4349 return 0x00500400U;
4350}
4351static inline u32 gr_gpc0_prop_debug1_czf_bypass_f(u32 v)
4352{
4353 return (v & 0x3U) << 14U;
4354}
4355static inline u32 gr_gpc0_prop_debug1_czf_bypass_m(void)
4356{
4357 return 0x3U << 14U;
4358}
4359static inline u32 gr_gpc0_prop_debug1_czf_bypass_init_v(void)
4360{
4361 return 0x00000001U;
4362}
4363#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_ltc_gp10b.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_ltc_gp10b.h
new file mode 100644
index 00000000..721a48ae
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_ltc_gp10b.h
@@ -0,0 +1,587 @@
1/*
2 * Copyright (c) 2014-2017, 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_ltc_gp10b_h_
57#define _hw_ltc_gp10b_h_
58
59static inline u32 ltc_pltcg_base_v(void)
60{
61 return 0x00140000U;
62}
63static inline u32 ltc_pltcg_extent_v(void)
64{
65 return 0x0017ffffU;
66}
67static inline u32 ltc_ltc0_ltss_v(void)
68{
69 return 0x00140200U;
70}
71static inline u32 ltc_ltc0_lts0_v(void)
72{
73 return 0x00140400U;
74}
75static inline u32 ltc_ltcs_ltss_v(void)
76{
77 return 0x0017e200U;
78}
79static inline u32 ltc_ltcs_lts0_cbc_ctrl1_r(void)
80{
81 return 0x0014046cU;
82}
83static inline u32 ltc_ltc0_lts0_dstg_cfg0_r(void)
84{
85 return 0x00140518U;
86}
87static inline u32 ltc_ltcs_ltss_dstg_cfg0_r(void)
88{
89 return 0x0017e318U;
90}
91static inline u32 ltc_ltcs_ltss_dstg_cfg0_vdc_4to2_disable_m(void)
92{
93 return 0x1U << 15U;
94}
95static inline u32 ltc_ltc0_lts0_tstg_cfg1_r(void)
96{
97 return 0x00140494U;
98}
99static inline u32 ltc_ltc0_lts0_tstg_cfg1_active_ways_v(u32 r)
100{
101 return (r >> 0U) & 0xffffU;
102}
103static inline u32 ltc_ltc0_lts0_tstg_cfg1_active_sets_v(u32 r)
104{
105 return (r >> 16U) & 0x3U;
106}
107static inline u32 ltc_ltc0_lts0_tstg_cfg1_active_sets_all_v(void)
108{
109 return 0x00000000U;
110}
111static inline u32 ltc_ltc0_lts0_tstg_cfg1_active_sets_half_v(void)
112{
113 return 0x00000001U;
114}
115static inline u32 ltc_ltc0_lts0_tstg_cfg1_active_sets_quarter_v(void)
116{
117 return 0x00000002U;
118}
119static inline u32 ltc_ltcs_ltss_cbc_ctrl1_r(void)
120{
121 return 0x0017e26cU;
122}
123static inline u32 ltc_ltcs_ltss_cbc_ctrl1_clean_active_f(void)
124{
125 return 0x1U;
126}
127static inline u32 ltc_ltcs_ltss_cbc_ctrl1_invalidate_active_f(void)
128{
129 return 0x2U;
130}
131static inline u32 ltc_ltcs_ltss_cbc_ctrl1_clear_v(u32 r)
132{
133 return (r >> 2U) & 0x1U;
134}
135static inline u32 ltc_ltcs_ltss_cbc_ctrl1_clear_active_v(void)
136{
137 return 0x00000001U;
138}
139static inline u32 ltc_ltcs_ltss_cbc_ctrl1_clear_active_f(void)
140{
141 return 0x4U;
142}
143static inline u32 ltc_ltc0_lts0_cbc_ctrl1_r(void)
144{
145 return 0x0014046cU;
146}
147static inline u32 ltc_ltcs_ltss_cbc_ctrl2_r(void)
148{
149 return 0x0017e270U;
150}
151static inline u32 ltc_ltcs_ltss_cbc_ctrl2_clear_lower_bound_f(u32 v)
152{
153 return (v & 0x3ffffU) << 0U;
154}
155static inline u32 ltc_ltcs_ltss_cbc_ctrl3_r(void)
156{
157 return 0x0017e274U;
158}
159static inline u32 ltc_ltcs_ltss_cbc_ctrl3_clear_upper_bound_f(u32 v)
160{
161 return (v & 0x3ffffU) << 0U;
162}
163static inline u32 ltc_ltcs_ltss_cbc_ctrl3_clear_upper_bound_init_v(void)
164{
165 return 0x0003ffffU;
166}
167static inline u32 ltc_ltcs_ltss_cbc_base_r(void)
168{
169 return 0x0017e278U;
170}
171static inline u32 ltc_ltcs_ltss_cbc_base_alignment_shift_v(void)
172{
173 return 0x0000000bU;
174}
175static inline u32 ltc_ltcs_ltss_cbc_base_address_v(u32 r)
176{
177 return (r >> 0U) & 0x3ffffffU;
178}
179static inline u32 ltc_ltcs_ltss_cbc_num_active_ltcs_r(void)
180{
181 return 0x0017e27cU;
182}
183static inline u32 ltc_ltcs_misc_ltc_num_active_ltcs_r(void)
184{
185 return 0x0017e000U;
186}
187static inline u32 ltc_ltcs_ltss_cbc_param_r(void)
188{
189 return 0x0017e280U;
190}
191static inline u32 ltc_ltcs_ltss_cbc_param_comptags_per_cache_line_v(u32 r)
192{
193 return (r >> 0U) & 0xffffU;
194}
195static inline u32 ltc_ltcs_ltss_cbc_param_cache_line_size_v(u32 r)
196{
197 return (r >> 24U) & 0xfU;
198}
199static inline u32 ltc_ltcs_ltss_cbc_param_slices_per_ltc_v(u32 r)
200{
201 return (r >> 28U) & 0xfU;
202}
203static inline u32 ltc_ltcs_ltss_cbc_param2_r(void)
204{
205 return 0x0017e3f4U;
206}
207static inline u32 ltc_ltcs_ltss_cbc_param2_gobs_per_comptagline_per_slice_v(u32 r)
208{
209 return (r >> 0U) & 0xffffU;
210}
211static inline u32 ltc_ltcs_ltss_tstg_set_mgmt_r(void)
212{
213 return 0x0017e2acU;
214}
215static inline u32 ltc_ltcs_ltss_tstg_set_mgmt_max_ways_evict_last_f(u32 v)
216{
217 return (v & 0x1fU) << 16U;
218}
219static inline u32 ltc_ltcs_ltss_dstg_zbc_index_r(void)
220{
221 return 0x0017e338U;
222}
223static inline u32 ltc_ltcs_ltss_dstg_zbc_index_address_f(u32 v)
224{
225 return (v & 0xfU) << 0U;
226}
227static inline u32 ltc_ltcs_ltss_dstg_zbc_color_clear_value_r(u32 i)
228{
229 return 0x0017e33cU + i*4U;
230}
231static inline u32 ltc_ltcs_ltss_dstg_zbc_color_clear_value__size_1_v(void)
232{
233 return 0x00000004U;
234}
235static inline u32 ltc_ltcs_ltss_dstg_zbc_depth_clear_value_r(void)
236{
237 return 0x0017e34cU;
238}
239static inline u32 ltc_ltcs_ltss_dstg_zbc_depth_clear_value_field_s(void)
240{
241 return 32U;
242}
243static inline u32 ltc_ltcs_ltss_dstg_zbc_depth_clear_value_field_f(u32 v)
244{
245 return (v & 0xffffffffU) << 0U;
246}
247static inline u32 ltc_ltcs_ltss_dstg_zbc_depth_clear_value_field_m(void)
248{
249 return 0xffffffffU << 0U;
250}
251static inline u32 ltc_ltcs_ltss_dstg_zbc_depth_clear_value_field_v(u32 r)
252{
253 return (r >> 0U) & 0xffffffffU;
254}
255static inline u32 ltc_ltcs_ltss_tstg_set_mgmt_2_r(void)
256{
257 return 0x0017e2b0U;
258}
259static inline u32 ltc_ltcs_ltss_tstg_set_mgmt_2_l2_bypass_mode_enabled_f(void)
260{
261 return 0x10000000U;
262}
263static inline u32 ltc_ltcs_ltss_g_elpg_r(void)
264{
265 return 0x0017e214U;
266}
267static inline u32 ltc_ltcs_ltss_g_elpg_flush_v(u32 r)
268{
269 return (r >> 0U) & 0x1U;
270}
271static inline u32 ltc_ltcs_ltss_g_elpg_flush_pending_v(void)
272{
273 return 0x00000001U;
274}
275static inline u32 ltc_ltcs_ltss_g_elpg_flush_pending_f(void)
276{
277 return 0x1U;
278}
279static inline u32 ltc_ltc0_ltss_g_elpg_r(void)
280{
281 return 0x00140214U;
282}
283static inline u32 ltc_ltc0_ltss_g_elpg_flush_v(u32 r)
284{
285 return (r >> 0U) & 0x1U;
286}
287static inline u32 ltc_ltc0_ltss_g_elpg_flush_pending_v(void)
288{
289 return 0x00000001U;
290}
291static inline u32 ltc_ltc0_ltss_g_elpg_flush_pending_f(void)
292{
293 return 0x1U;
294}
295static inline u32 ltc_ltc1_ltss_g_elpg_r(void)
296{
297 return 0x00142214U;
298}
299static inline u32 ltc_ltc1_ltss_g_elpg_flush_v(u32 r)
300{
301 return (r >> 0U) & 0x1U;
302}
303static inline u32 ltc_ltc1_ltss_g_elpg_flush_pending_v(void)
304{
305 return 0x00000001U;
306}
307static inline u32 ltc_ltc1_ltss_g_elpg_flush_pending_f(void)
308{
309 return 0x1U;
310}
311static inline u32 ltc_ltcs_ltss_intr_r(void)
312{
313 return 0x0017e20cU;
314}
315static inline u32 ltc_ltcs_ltss_intr_ecc_sec_error_pending_f(void)
316{
317 return 0x100U;
318}
319static inline u32 ltc_ltcs_ltss_intr_ecc_ded_error_pending_f(void)
320{
321 return 0x200U;
322}
323static inline u32 ltc_ltcs_ltss_intr_en_evicted_cb_m(void)
324{
325 return 0x1U << 20U;
326}
327static inline u32 ltc_ltcs_ltss_intr_en_illegal_compstat_access_m(void)
328{
329 return 0x1U << 30U;
330}
331static inline u32 ltc_ltcs_ltss_intr_en_ecc_sec_error_enabled_f(void)
332{
333 return 0x1000000U;
334}
335static inline u32 ltc_ltcs_ltss_intr_en_ecc_ded_error_enabled_f(void)
336{
337 return 0x2000000U;
338}
339static inline u32 ltc_ltc0_lts0_intr_r(void)
340{
341 return 0x0014040cU;
342}
343static inline u32 ltc_ltc0_lts0_dstg_ecc_report_r(void)
344{
345 return 0x0014051cU;
346}
347static inline u32 ltc_ltc0_lts0_dstg_ecc_report_sec_count_m(void)
348{
349 return 0xffU << 0U;
350}
351static inline u32 ltc_ltc0_lts0_dstg_ecc_report_sec_count_v(u32 r)
352{
353 return (r >> 0U) & 0xffU;
354}
355static inline u32 ltc_ltc0_lts0_dstg_ecc_report_ded_count_m(void)
356{
357 return 0xffU << 16U;
358}
359static inline u32 ltc_ltc0_lts0_dstg_ecc_report_ded_count_v(u32 r)
360{
361 return (r >> 16U) & 0xffU;
362}
363static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_r(void)
364{
365 return 0x0017e2a0U;
366}
367static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_invalidate_v(u32 r)
368{
369 return (r >> 0U) & 0x1U;
370}
371static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_invalidate_pending_v(void)
372{
373 return 0x00000001U;
374}
375static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_invalidate_pending_f(void)
376{
377 return 0x1U;
378}
379static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_max_cycles_between_invalidates_v(u32 r)
380{
381 return (r >> 8U) & 0xfU;
382}
383static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_max_cycles_between_invalidates_3_v(void)
384{
385 return 0x00000003U;
386}
387static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_max_cycles_between_invalidates_3_f(void)
388{
389 return 0x300U;
390}
391static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_invalidate_evict_last_class_v(u32 r)
392{
393 return (r >> 28U) & 0x1U;
394}
395static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_invalidate_evict_last_class_true_v(void)
396{
397 return 0x00000001U;
398}
399static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_invalidate_evict_last_class_true_f(void)
400{
401 return 0x10000000U;
402}
403static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_invalidate_evict_normal_class_v(u32 r)
404{
405 return (r >> 29U) & 0x1U;
406}
407static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_invalidate_evict_normal_class_true_v(void)
408{
409 return 0x00000001U;
410}
411static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_invalidate_evict_normal_class_true_f(void)
412{
413 return 0x20000000U;
414}
415static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_invalidate_evict_first_class_v(u32 r)
416{
417 return (r >> 30U) & 0x1U;
418}
419static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_invalidate_evict_first_class_true_v(void)
420{
421 return 0x00000001U;
422}
423static inline u32 ltc_ltcs_ltss_tstg_cmgmt0_invalidate_evict_first_class_true_f(void)
424{
425 return 0x40000000U;
426}
427static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_r(void)
428{
429 return 0x0017e2a4U;
430}
431static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_v(u32 r)
432{
433 return (r >> 0U) & 0x1U;
434}
435static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_pending_v(void)
436{
437 return 0x00000001U;
438}
439static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_pending_f(void)
440{
441 return 0x1U;
442}
443static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_max_cycles_between_cleans_v(u32 r)
444{
445 return (r >> 8U) & 0xfU;
446}
447static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_max_cycles_between_cleans_3_v(void)
448{
449 return 0x00000003U;
450}
451static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_max_cycles_between_cleans_3_f(void)
452{
453 return 0x300U;
454}
455static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_wait_for_fb_to_pull_v(u32 r)
456{
457 return (r >> 16U) & 0x1U;
458}
459static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_wait_for_fb_to_pull_true_v(void)
460{
461 return 0x00000001U;
462}
463static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_wait_for_fb_to_pull_true_f(void)
464{
465 return 0x10000U;
466}
467static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_evict_last_class_v(u32 r)
468{
469 return (r >> 28U) & 0x1U;
470}
471static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_evict_last_class_true_v(void)
472{
473 return 0x00000001U;
474}
475static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_evict_last_class_true_f(void)
476{
477 return 0x10000000U;
478}
479static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_evict_normal_class_v(u32 r)
480{
481 return (r >> 29U) & 0x1U;
482}
483static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_evict_normal_class_true_v(void)
484{
485 return 0x00000001U;
486}
487static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_evict_normal_class_true_f(void)
488{
489 return 0x20000000U;
490}
491static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_evict_first_class_v(u32 r)
492{
493 return (r >> 30U) & 0x1U;
494}
495static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_evict_first_class_true_v(void)
496{
497 return 0x00000001U;
498}
499static inline u32 ltc_ltcs_ltss_tstg_cmgmt1_clean_evict_first_class_true_f(void)
500{
501 return 0x40000000U;
502}
503static inline u32 ltc_ltc0_ltss_tstg_cmgmt0_r(void)
504{
505 return 0x001402a0U;
506}
507static inline u32 ltc_ltc0_ltss_tstg_cmgmt0_invalidate_v(u32 r)
508{
509 return (r >> 0U) & 0x1U;
510}
511static inline u32 ltc_ltc0_ltss_tstg_cmgmt0_invalidate_pending_v(void)
512{
513 return 0x00000001U;
514}
515static inline u32 ltc_ltc0_ltss_tstg_cmgmt0_invalidate_pending_f(void)
516{
517 return 0x1U;
518}
519static inline u32 ltc_ltc0_ltss_tstg_cmgmt1_r(void)
520{
521 return 0x001402a4U;
522}
523static inline u32 ltc_ltc0_ltss_tstg_cmgmt1_clean_v(u32 r)
524{
525 return (r >> 0U) & 0x1U;
526}
527static inline u32 ltc_ltc0_ltss_tstg_cmgmt1_clean_pending_v(void)
528{
529 return 0x00000001U;
530}
531static inline u32 ltc_ltc0_ltss_tstg_cmgmt1_clean_pending_f(void)
532{
533 return 0x1U;
534}
535static inline u32 ltc_ltc1_ltss_tstg_cmgmt0_r(void)
536{
537 return 0x001422a0U;
538}
539static inline u32 ltc_ltc1_ltss_tstg_cmgmt0_invalidate_v(u32 r)
540{
541 return (r >> 0U) & 0x1U;
542}
543static inline u32 ltc_ltc1_ltss_tstg_cmgmt0_invalidate_pending_v(void)
544{
545 return 0x00000001U;
546}
547static inline u32 ltc_ltc1_ltss_tstg_cmgmt0_invalidate_pending_f(void)
548{
549 return 0x1U;
550}
551static inline u32 ltc_ltc1_ltss_tstg_cmgmt1_r(void)
552{
553 return 0x001422a4U;
554}
555static inline u32 ltc_ltc1_ltss_tstg_cmgmt1_clean_v(u32 r)
556{
557 return (r >> 0U) & 0x1U;
558}
559static inline u32 ltc_ltc1_ltss_tstg_cmgmt1_clean_pending_v(void)
560{
561 return 0x00000001U;
562}
563static inline u32 ltc_ltc1_ltss_tstg_cmgmt1_clean_pending_f(void)
564{
565 return 0x1U;
566}
567static inline u32 ltc_ltc0_lts0_tstg_info_1_r(void)
568{
569 return 0x0014058cU;
570}
571static inline u32 ltc_ltc0_lts0_tstg_info_1_slice_size_in_kb_v(u32 r)
572{
573 return (r >> 0U) & 0xffffU;
574}
575static inline u32 ltc_ltc0_lts0_tstg_info_1_slices_per_l2_v(u32 r)
576{
577 return (r >> 16U) & 0x1fU;
578}
579static inline u32 ltc_ltca_g_axi_pctrl_r(void)
580{
581 return 0x00160000U;
582}
583static inline u32 ltc_ltca_g_axi_pctrl_user_sid_f(u32 v)
584{
585 return (v & 0xffU) << 2U;
586}
587#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_mc_gp10b.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_mc_gp10b.h
new file mode 100644
index 00000000..dbf0ce35
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_mc_gp10b.h
@@ -0,0 +1,251 @@
1/*
2 * Copyright (c) 2014-2017, 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_mc_gp10b_h_
57#define _hw_mc_gp10b_h_
58
59static inline u32 mc_boot_0_r(void)
60{
61 return 0x00000000U;
62}
63static inline u32 mc_boot_0_architecture_v(u32 r)
64{
65 return (r >> 24U) & 0x1fU;
66}
67static inline u32 mc_boot_0_implementation_v(u32 r)
68{
69 return (r >> 20U) & 0xfU;
70}
71static inline u32 mc_boot_0_major_revision_v(u32 r)
72{
73 return (r >> 4U) & 0xfU;
74}
75static inline u32 mc_boot_0_minor_revision_v(u32 r)
76{
77 return (r >> 0U) & 0xfU;
78}
79static inline u32 mc_intr_r(u32 i)
80{
81 return 0x00000100U + i*4U;
82}
83static inline u32 mc_intr_pfifo_pending_f(void)
84{
85 return 0x100U;
86}
87static inline u32 mc_intr_replayable_fault_pending_f(void)
88{
89 return 0x200U;
90}
91static inline u32 mc_intr_pgraph_pending_f(void)
92{
93 return 0x1000U;
94}
95static inline u32 mc_intr_pmu_pending_f(void)
96{
97 return 0x1000000U;
98}
99static inline u32 mc_intr_ltc_pending_f(void)
100{
101 return 0x2000000U;
102}
103static inline u32 mc_intr_priv_ring_pending_f(void)
104{
105 return 0x40000000U;
106}
107static inline u32 mc_intr_pbus_pending_f(void)
108{
109 return 0x10000000U;
110}
111static inline u32 mc_intr_en_r(u32 i)
112{
113 return 0x00000140U + i*4U;
114}
115static inline u32 mc_intr_en_set_r(u32 i)
116{
117 return 0x00000160U + i*4U;
118}
119static inline u32 mc_intr_en_clear_r(u32 i)
120{
121 return 0x00000180U + i*4U;
122}
123static inline u32 mc_enable_r(void)
124{
125 return 0x00000200U;
126}
127static inline u32 mc_enable_xbar_enabled_f(void)
128{
129 return 0x4U;
130}
131static inline u32 mc_enable_l2_enabled_f(void)
132{
133 return 0x8U;
134}
135static inline u32 mc_enable_pmedia_s(void)
136{
137 return 1U;
138}
139static inline u32 mc_enable_pmedia_f(u32 v)
140{
141 return (v & 0x1U) << 4U;
142}
143static inline u32 mc_enable_pmedia_m(void)
144{
145 return 0x1U << 4U;
146}
147static inline u32 mc_enable_pmedia_v(u32 r)
148{
149 return (r >> 4U) & 0x1U;
150}
151static inline u32 mc_enable_priv_ring_enabled_f(void)
152{
153 return 0x20U;
154}
155static inline u32 mc_enable_ce0_m(void)
156{
157 return 0x1U << 6U;
158}
159static inline u32 mc_enable_pfifo_enabled_f(void)
160{
161 return 0x100U;
162}
163static inline u32 mc_enable_pgraph_enabled_f(void)
164{
165 return 0x1000U;
166}
167static inline u32 mc_enable_pwr_v(u32 r)
168{
169 return (r >> 13U) & 0x1U;
170}
171static inline u32 mc_enable_pwr_disabled_v(void)
172{
173 return 0x00000000U;
174}
175static inline u32 mc_enable_pwr_enabled_f(void)
176{
177 return 0x2000U;
178}
179static inline u32 mc_enable_pfb_enabled_f(void)
180{
181 return 0x100000U;
182}
183static inline u32 mc_enable_ce2_m(void)
184{
185 return 0x1U << 21U;
186}
187static inline u32 mc_enable_ce2_enabled_f(void)
188{
189 return 0x200000U;
190}
191static inline u32 mc_enable_blg_enabled_f(void)
192{
193 return 0x8000000U;
194}
195static inline u32 mc_enable_perfmon_enabled_f(void)
196{
197 return 0x10000000U;
198}
199static inline u32 mc_enable_hub_enabled_f(void)
200{
201 return 0x20000000U;
202}
203static inline u32 mc_intr_ltc_r(void)
204{
205 return 0x000001c0U;
206}
207static inline u32 mc_enable_pb_r(void)
208{
209 return 0x00000204U;
210}
211static inline u32 mc_enable_pb_0_s(void)
212{
213 return 1U;
214}
215static inline u32 mc_enable_pb_0_f(u32 v)
216{
217 return (v & 0x1U) << 0U;
218}
219static inline u32 mc_enable_pb_0_m(void)
220{
221 return 0x1U << 0U;
222}
223static inline u32 mc_enable_pb_0_v(u32 r)
224{
225 return (r >> 0U) & 0x1U;
226}
227static inline u32 mc_enable_pb_0_enabled_v(void)
228{
229 return 0x00000001U;
230}
231static inline u32 mc_enable_pb_sel_f(u32 v, u32 i)
232{
233 return (v & 0x1U) << (0U + i*1U);
234}
235static inline u32 mc_elpg_enable_r(void)
236{
237 return 0x0000020cU;
238}
239static inline u32 mc_elpg_enable_xbar_enabled_f(void)
240{
241 return 0x4U;
242}
243static inline u32 mc_elpg_enable_pfb_enabled_f(void)
244{
245 return 0x100000U;
246}
247static inline u32 mc_elpg_enable_hub_enabled_f(void)
248{
249 return 0x20000000U;
250}
251#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_pbdma_gp10b.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_pbdma_gp10b.h
new file mode 100644
index 00000000..4f45f824
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_pbdma_gp10b.h
@@ -0,0 +1,607 @@
1/*
2 * Copyright (c) 2014-2017, 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_pbdma_gp10b_h_
57#define _hw_pbdma_gp10b_h_
58
59static inline u32 pbdma_gp_entry1_r(void)
60{
61 return 0x10000004U;
62}
63static inline u32 pbdma_gp_entry1_get_hi_v(u32 r)
64{
65 return (r >> 0U) & 0xffU;
66}
67static inline u32 pbdma_gp_entry1_length_f(u32 v)
68{
69 return (v & 0x1fffffU) << 10U;
70}
71static inline u32 pbdma_gp_entry1_length_v(u32 r)
72{
73 return (r >> 10U) & 0x1fffffU;
74}
75static inline u32 pbdma_gp_base_r(u32 i)
76{
77 return 0x00040048U + i*8192U;
78}
79static inline u32 pbdma_gp_base__size_1_v(void)
80{
81 return 0x00000001U;
82}
83static inline u32 pbdma_gp_base_offset_f(u32 v)
84{
85 return (v & 0x1fffffffU) << 3U;
86}
87static inline u32 pbdma_gp_base_rsvd_s(void)
88{
89 return 3U;
90}
91static inline u32 pbdma_gp_base_hi_r(u32 i)
92{
93 return 0x0004004cU + i*8192U;
94}
95static inline u32 pbdma_gp_base_hi_offset_f(u32 v)
96{
97 return (v & 0xffU) << 0U;
98}
99static inline u32 pbdma_gp_base_hi_limit2_f(u32 v)
100{
101 return (v & 0x1fU) << 16U;
102}
103static inline u32 pbdma_gp_fetch_r(u32 i)
104{
105 return 0x00040050U + i*8192U;
106}
107static inline u32 pbdma_gp_get_r(u32 i)
108{
109 return 0x00040014U + i*8192U;
110}
111static inline u32 pbdma_gp_put_r(u32 i)
112{
113 return 0x00040000U + i*8192U;
114}
115static inline u32 pbdma_pb_fetch_r(u32 i)
116{
117 return 0x00040054U + i*8192U;
118}
119static inline u32 pbdma_pb_fetch_hi_r(u32 i)
120{
121 return 0x00040058U + i*8192U;
122}
123static inline u32 pbdma_get_r(u32 i)
124{
125 return 0x00040018U + i*8192U;
126}
127static inline u32 pbdma_get_hi_r(u32 i)
128{
129 return 0x0004001cU + i*8192U;
130}
131static inline u32 pbdma_put_r(u32 i)
132{
133 return 0x0004005cU + i*8192U;
134}
135static inline u32 pbdma_put_hi_r(u32 i)
136{
137 return 0x00040060U + i*8192U;
138}
139static inline u32 pbdma_formats_r(u32 i)
140{
141 return 0x0004009cU + i*8192U;
142}
143static inline u32 pbdma_formats_gp_fermi0_f(void)
144{
145 return 0x0U;
146}
147static inline u32 pbdma_formats_pb_fermi1_f(void)
148{
149 return 0x100U;
150}
151static inline u32 pbdma_formats_mp_fermi0_f(void)
152{
153 return 0x0U;
154}
155static inline u32 pbdma_pb_header_r(u32 i)
156{
157 return 0x00040084U + i*8192U;
158}
159static inline u32 pbdma_pb_header_priv_user_f(void)
160{
161 return 0x0U;
162}
163static inline u32 pbdma_pb_header_method_zero_f(void)
164{
165 return 0x0U;
166}
167static inline u32 pbdma_pb_header_subchannel_zero_f(void)
168{
169 return 0x0U;
170}
171static inline u32 pbdma_pb_header_level_main_f(void)
172{
173 return 0x0U;
174}
175static inline u32 pbdma_pb_header_first_true_f(void)
176{
177 return 0x400000U;
178}
179static inline u32 pbdma_pb_header_type_inc_f(void)
180{
181 return 0x20000000U;
182}
183static inline u32 pbdma_pb_header_type_non_inc_f(void)
184{
185 return 0x60000000U;
186}
187static inline u32 pbdma_hdr_shadow_r(u32 i)
188{
189 return 0x00040118U + i*8192U;
190}
191static inline u32 pbdma_gp_shadow_0_r(u32 i)
192{
193 return 0x00040110U + i*8192U;
194}
195static inline u32 pbdma_gp_shadow_1_r(u32 i)
196{
197 return 0x00040114U + i*8192U;
198}
199static inline u32 pbdma_subdevice_r(u32 i)
200{
201 return 0x00040094U + i*8192U;
202}
203static inline u32 pbdma_subdevice_id_f(u32 v)
204{
205 return (v & 0xfffU) << 0U;
206}
207static inline u32 pbdma_subdevice_status_active_f(void)
208{
209 return 0x10000000U;
210}
211static inline u32 pbdma_subdevice_channel_dma_enable_f(void)
212{
213 return 0x20000000U;
214}
215static inline u32 pbdma_method0_r(u32 i)
216{
217 return 0x000400c0U + i*8192U;
218}
219static inline u32 pbdma_method0_fifo_size_v(void)
220{
221 return 0x00000004U;
222}
223static inline u32 pbdma_method0_addr_f(u32 v)
224{
225 return (v & 0xfffU) << 2U;
226}
227static inline u32 pbdma_method0_addr_v(u32 r)
228{
229 return (r >> 2U) & 0xfffU;
230}
231static inline u32 pbdma_method0_subch_v(u32 r)
232{
233 return (r >> 16U) & 0x7U;
234}
235static inline u32 pbdma_method0_first_true_f(void)
236{
237 return 0x400000U;
238}
239static inline u32 pbdma_method0_valid_true_f(void)
240{
241 return 0x80000000U;
242}
243static inline u32 pbdma_method1_r(u32 i)
244{
245 return 0x000400c8U + i*8192U;
246}
247static inline u32 pbdma_method2_r(u32 i)
248{
249 return 0x000400d0U + i*8192U;
250}
251static inline u32 pbdma_method3_r(u32 i)
252{
253 return 0x000400d8U + i*8192U;
254}
255static inline u32 pbdma_data0_r(u32 i)
256{
257 return 0x000400c4U + i*8192U;
258}
259static inline u32 pbdma_target_r(u32 i)
260{
261 return 0x000400acU + i*8192U;
262}
263static inline u32 pbdma_target_engine_sw_f(void)
264{
265 return 0x1fU;
266}
267static inline u32 pbdma_acquire_r(u32 i)
268{
269 return 0x00040030U + i*8192U;
270}
271static inline u32 pbdma_acquire_retry_man_2_f(void)
272{
273 return 0x2U;
274}
275static inline u32 pbdma_acquire_retry_exp_2_f(void)
276{
277 return 0x100U;
278}
279static inline u32 pbdma_acquire_timeout_exp_f(u32 v)
280{
281 return (v & 0xfU) << 11U;
282}
283static inline u32 pbdma_acquire_timeout_exp_max_v(void)
284{
285 return 0x0000000fU;
286}
287static inline u32 pbdma_acquire_timeout_exp_max_f(void)
288{
289 return 0x7800U;
290}
291static inline u32 pbdma_acquire_timeout_man_f(u32 v)
292{
293 return (v & 0xffffU) << 15U;
294}
295static inline u32 pbdma_acquire_timeout_man_max_v(void)
296{
297 return 0x0000ffffU;
298}
299static inline u32 pbdma_acquire_timeout_man_max_f(void)
300{
301 return 0x7fff8000U;
302}
303static inline u32 pbdma_acquire_timeout_en_enable_f(void)
304{
305 return 0x80000000U;
306}
307static inline u32 pbdma_acquire_timeout_en_disable_f(void)
308{
309 return 0x0U;
310}
311static inline u32 pbdma_status_r(u32 i)
312{
313 return 0x00040100U + i*8192U;
314}
315static inline u32 pbdma_channel_r(u32 i)
316{
317 return 0x00040120U + i*8192U;
318}
319static inline u32 pbdma_signature_r(u32 i)
320{
321 return 0x00040010U + i*8192U;
322}
323static inline u32 pbdma_signature_hw_valid_f(void)
324{
325 return 0xfaceU;
326}
327static inline u32 pbdma_signature_sw_zero_f(void)
328{
329 return 0x0U;
330}
331static inline u32 pbdma_userd_r(u32 i)
332{
333 return 0x00040008U + i*8192U;
334}
335static inline u32 pbdma_userd_target_vid_mem_f(void)
336{
337 return 0x0U;
338}
339static inline u32 pbdma_userd_target_sys_mem_coh_f(void)
340{
341 return 0x2U;
342}
343static inline u32 pbdma_userd_target_sys_mem_ncoh_f(void)
344{
345 return 0x3U;
346}
347static inline u32 pbdma_userd_addr_f(u32 v)
348{
349 return (v & 0x7fffffU) << 9U;
350}
351static inline u32 pbdma_userd_hi_r(u32 i)
352{
353 return 0x0004000cU + i*8192U;
354}
355static inline u32 pbdma_userd_hi_addr_f(u32 v)
356{
357 return (v & 0xffU) << 0U;
358}
359static inline u32 pbdma_config_r(u32 i)
360{
361 return 0x000400f4U + i*8192U;
362}
363static inline u32 pbdma_config_auth_level_privileged_f(void)
364{
365 return 0x100U;
366}
367static inline u32 pbdma_hce_ctrl_r(u32 i)
368{
369 return 0x000400e4U + i*8192U;
370}
371static inline u32 pbdma_hce_ctrl_hce_priv_mode_yes_f(void)
372{
373 return 0x20U;
374}
375static inline u32 pbdma_intr_0_r(u32 i)
376{
377 return 0x00040108U + i*8192U;
378}
379static inline u32 pbdma_intr_0_memreq_v(u32 r)
380{
381 return (r >> 0U) & 0x1U;
382}
383static inline u32 pbdma_intr_0_memreq_pending_f(void)
384{
385 return 0x1U;
386}
387static inline u32 pbdma_intr_0_memack_timeout_pending_f(void)
388{
389 return 0x2U;
390}
391static inline u32 pbdma_intr_0_memack_extra_pending_f(void)
392{
393 return 0x4U;
394}
395static inline u32 pbdma_intr_0_memdat_timeout_pending_f(void)
396{
397 return 0x8U;
398}
399static inline u32 pbdma_intr_0_memdat_extra_pending_f(void)
400{
401 return 0x10U;
402}
403static inline u32 pbdma_intr_0_memflush_pending_f(void)
404{
405 return 0x20U;
406}
407static inline u32 pbdma_intr_0_memop_pending_f(void)
408{
409 return 0x40U;
410}
411static inline u32 pbdma_intr_0_lbconnect_pending_f(void)
412{
413 return 0x80U;
414}
415static inline u32 pbdma_intr_0_lbreq_pending_f(void)
416{
417 return 0x100U;
418}
419static inline u32 pbdma_intr_0_lback_timeout_pending_f(void)
420{
421 return 0x200U;
422}
423static inline u32 pbdma_intr_0_lback_extra_pending_f(void)
424{
425 return 0x400U;
426}
427static inline u32 pbdma_intr_0_lbdat_timeout_pending_f(void)
428{
429 return 0x800U;
430}
431static inline u32 pbdma_intr_0_lbdat_extra_pending_f(void)
432{
433 return 0x1000U;
434}
435static inline u32 pbdma_intr_0_gpfifo_pending_f(void)
436{
437 return 0x2000U;
438}
439static inline u32 pbdma_intr_0_gpptr_pending_f(void)
440{
441 return 0x4000U;
442}
443static inline u32 pbdma_intr_0_gpentry_pending_f(void)
444{
445 return 0x8000U;
446}
447static inline u32 pbdma_intr_0_gpcrc_pending_f(void)
448{
449 return 0x10000U;
450}
451static inline u32 pbdma_intr_0_pbptr_pending_f(void)
452{
453 return 0x20000U;
454}
455static inline u32 pbdma_intr_0_pbentry_pending_f(void)
456{
457 return 0x40000U;
458}
459static inline u32 pbdma_intr_0_pbcrc_pending_f(void)
460{
461 return 0x80000U;
462}
463static inline u32 pbdma_intr_0_xbarconnect_pending_f(void)
464{
465 return 0x100000U;
466}
467static inline u32 pbdma_intr_0_method_pending_f(void)
468{
469 return 0x200000U;
470}
471static inline u32 pbdma_intr_0_methodcrc_pending_f(void)
472{
473 return 0x400000U;
474}
475static inline u32 pbdma_intr_0_device_pending_f(void)
476{
477 return 0x800000U;
478}
479static inline u32 pbdma_intr_0_semaphore_pending_f(void)
480{
481 return 0x2000000U;
482}
483static inline u32 pbdma_intr_0_acquire_pending_f(void)
484{
485 return 0x4000000U;
486}
487static inline u32 pbdma_intr_0_pri_pending_f(void)
488{
489 return 0x8000000U;
490}
491static inline u32 pbdma_intr_0_no_ctxsw_seg_pending_f(void)
492{
493 return 0x20000000U;
494}
495static inline u32 pbdma_intr_0_pbseg_pending_f(void)
496{
497 return 0x40000000U;
498}
499static inline u32 pbdma_intr_0_signature_pending_f(void)
500{
501 return 0x80000000U;
502}
503static inline u32 pbdma_intr_0_syncpoint_illegal_pending_f(void)
504{
505 return 0x10000000U;
506}
507static inline u32 pbdma_intr_1_r(u32 i)
508{
509 return 0x00040148U + i*8192U;
510}
511static inline u32 pbdma_intr_en_0_r(u32 i)
512{
513 return 0x0004010cU + i*8192U;
514}
515static inline u32 pbdma_intr_en_0_lbreq_enabled_f(void)
516{
517 return 0x100U;
518}
519static inline u32 pbdma_intr_en_1_r(u32 i)
520{
521 return 0x0004014cU + i*8192U;
522}
523static inline u32 pbdma_intr_stall_r(u32 i)
524{
525 return 0x0004013cU + i*8192U;
526}
527static inline u32 pbdma_intr_stall_lbreq_enabled_f(void)
528{
529 return 0x100U;
530}
531static inline u32 pbdma_udma_nop_r(void)
532{
533 return 0x00000008U;
534}
535static inline u32 pbdma_allowed_syncpoints_r(u32 i)
536{
537 return 0x000400e8U + i*8192U;
538}
539static inline u32 pbdma_allowed_syncpoints_0_valid_f(u32 v)
540{
541 return (v & 0x1U) << 31U;
542}
543static inline u32 pbdma_allowed_syncpoints_0_index_f(u32 v)
544{
545 return (v & 0x7fffU) << 16U;
546}
547static inline u32 pbdma_allowed_syncpoints_0_index_v(u32 r)
548{
549 return (r >> 16U) & 0x7fffU;
550}
551static inline u32 pbdma_allowed_syncpoints_1_valid_f(u32 v)
552{
553 return (v & 0x1U) << 15U;
554}
555static inline u32 pbdma_allowed_syncpoints_1_index_f(u32 v)
556{
557 return (v & 0x7fffU) << 0U;
558}
559static inline u32 pbdma_syncpointa_r(u32 i)
560{
561 return 0x000400a4U + i*8192U;
562}
563static inline u32 pbdma_syncpointa_payload_v(u32 r)
564{
565 return (r >> 0U) & 0xffffffffU;
566}
567static inline u32 pbdma_syncpointb_r(u32 i)
568{
569 return 0x000400a8U + i*8192U;
570}
571static inline u32 pbdma_syncpointb_op_v(u32 r)
572{
573 return (r >> 0U) & 0x1U;
574}
575static inline u32 pbdma_syncpointb_op_wait_v(void)
576{
577 return 0x00000000U;
578}
579static inline u32 pbdma_syncpointb_wait_switch_v(u32 r)
580{
581 return (r >> 4U) & 0x1U;
582}
583static inline u32 pbdma_syncpointb_wait_switch_en_v(void)
584{
585 return 0x00000001U;
586}
587static inline u32 pbdma_syncpointb_syncpt_index_v(u32 r)
588{
589 return (r >> 8U) & 0xfffU;
590}
591static inline u32 pbdma_runlist_timeslice_r(u32 i)
592{
593 return 0x000400f8U + i*8192U;
594}
595static inline u32 pbdma_runlist_timeslice_timeout_128_f(void)
596{
597 return 0x80U;
598}
599static inline u32 pbdma_runlist_timeslice_timescale_3_f(void)
600{
601 return 0x3000U;
602}
603static inline u32 pbdma_runlist_timeslice_enable_true_f(void)
604{
605 return 0x10000000U;
606}
607#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_perf_gp10b.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_perf_gp10b.h
new file mode 100644
index 00000000..aa0fafe7
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_perf_gp10b.h
@@ -0,0 +1,211 @@
1/*
2 * Copyright (c) 2015-2017, 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_perf_gp10b_h_
57#define _hw_perf_gp10b_h_
58
59static inline u32 perf_pmasys_control_r(void)
60{
61 return 0x001b4000U;
62}
63static inline u32 perf_pmasys_control_membuf_status_v(u32 r)
64{
65 return (r >> 4U) & 0x1U;
66}
67static inline u32 perf_pmasys_control_membuf_status_overflowed_v(void)
68{
69 return 0x00000001U;
70}
71static inline u32 perf_pmasys_control_membuf_status_overflowed_f(void)
72{
73 return 0x10U;
74}
75static inline u32 perf_pmasys_control_membuf_clear_status_f(u32 v)
76{
77 return (v & 0x1U) << 5U;
78}
79static inline u32 perf_pmasys_control_membuf_clear_status_v(u32 r)
80{
81 return (r >> 5U) & 0x1U;
82}
83static inline u32 perf_pmasys_control_membuf_clear_status_doit_v(void)
84{
85 return 0x00000001U;
86}
87static inline u32 perf_pmasys_control_membuf_clear_status_doit_f(void)
88{
89 return 0x20U;
90}
91static inline u32 perf_pmasys_mem_block_r(void)
92{
93 return 0x001b4070U;
94}
95static inline u32 perf_pmasys_mem_block_base_f(u32 v)
96{
97 return (v & 0xfffffffU) << 0U;
98}
99static inline u32 perf_pmasys_mem_block_target_f(u32 v)
100{
101 return (v & 0x3U) << 28U;
102}
103static inline u32 perf_pmasys_mem_block_target_v(u32 r)
104{
105 return (r >> 28U) & 0x3U;
106}
107static inline u32 perf_pmasys_mem_block_target_lfb_v(void)
108{
109 return 0x00000000U;
110}
111static inline u32 perf_pmasys_mem_block_target_lfb_f(void)
112{
113 return 0x0U;
114}
115static inline u32 perf_pmasys_mem_block_target_sys_coh_v(void)
116{
117 return 0x00000002U;
118}
119static inline u32 perf_pmasys_mem_block_target_sys_coh_f(void)
120{
121 return 0x20000000U;
122}
123static inline u32 perf_pmasys_mem_block_target_sys_ncoh_v(void)
124{
125 return 0x00000003U;
126}
127static inline u32 perf_pmasys_mem_block_target_sys_ncoh_f(void)
128{
129 return 0x30000000U;
130}
131static inline u32 perf_pmasys_mem_block_valid_f(u32 v)
132{
133 return (v & 0x1U) << 31U;
134}
135static inline u32 perf_pmasys_mem_block_valid_v(u32 r)
136{
137 return (r >> 31U) & 0x1U;
138}
139static inline u32 perf_pmasys_mem_block_valid_true_v(void)
140{
141 return 0x00000001U;
142}
143static inline u32 perf_pmasys_mem_block_valid_true_f(void)
144{
145 return 0x80000000U;
146}
147static inline u32 perf_pmasys_mem_block_valid_false_v(void)
148{
149 return 0x00000000U;
150}
151static inline u32 perf_pmasys_mem_block_valid_false_f(void)
152{
153 return 0x0U;
154}
155static inline u32 perf_pmasys_outbase_r(void)
156{
157 return 0x001b4074U;
158}
159static inline u32 perf_pmasys_outbase_ptr_f(u32 v)
160{
161 return (v & 0x7ffffffU) << 5U;
162}
163static inline u32 perf_pmasys_outbaseupper_r(void)
164{
165 return 0x001b4078U;
166}
167static inline u32 perf_pmasys_outbaseupper_ptr_f(u32 v)
168{
169 return (v & 0xffU) << 0U;
170}
171static inline u32 perf_pmasys_outsize_r(void)
172{
173 return 0x001b407cU;
174}
175static inline u32 perf_pmasys_outsize_numbytes_f(u32 v)
176{
177 return (v & 0x7ffffffU) << 5U;
178}
179static inline u32 perf_pmasys_mem_bytes_r(void)
180{
181 return 0x001b4084U;
182}
183static inline u32 perf_pmasys_mem_bytes_numbytes_f(u32 v)
184{
185 return (v & 0xfffffffU) << 4U;
186}
187static inline u32 perf_pmasys_mem_bump_r(void)
188{
189 return 0x001b4088U;
190}
191static inline u32 perf_pmasys_mem_bump_numbytes_f(u32 v)
192{
193 return (v & 0xfffffffU) << 4U;
194}
195static inline u32 perf_pmasys_enginestatus_r(void)
196{
197 return 0x001b40a4U;
198}
199static inline u32 perf_pmasys_enginestatus_rbufempty_f(u32 v)
200{
201 return (v & 0x1U) << 4U;
202}
203static inline u32 perf_pmasys_enginestatus_rbufempty_empty_v(void)
204{
205 return 0x00000001U;
206}
207static inline u32 perf_pmasys_enginestatus_rbufempty_empty_f(void)
208{
209 return 0x10U;
210}
211#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_pram_gp10b.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_pram_gp10b.h
new file mode 100644
index 00000000..aef0e693
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_pram_gp10b.h
@@ -0,0 +1,63 @@
1/*
2 * Copyright (c) 2016-2017, 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_pram_gp10b_h_
57#define _hw_pram_gp10b_h_
58
59static inline u32 pram_data032_r(u32 i)
60{
61 return 0x00700000U + i*4U;
62}
63#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_pri_ringmaster_gp10b.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_pri_ringmaster_gp10b.h
new file mode 100644
index 00000000..03a3854e
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_pri_ringmaster_gp10b.h
@@ -0,0 +1,167 @@
1/*
2 * Copyright (c) 2014-2017, 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_pri_ringmaster_gp10b_h_
57#define _hw_pri_ringmaster_gp10b_h_
58
59static inline u32 pri_ringmaster_command_r(void)
60{
61 return 0x0012004cU;
62}
63static inline u32 pri_ringmaster_command_cmd_m(void)
64{
65 return 0x3fU << 0U;
66}
67static inline u32 pri_ringmaster_command_cmd_v(u32 r)
68{
69 return (r >> 0U) & 0x3fU;
70}
71static inline u32 pri_ringmaster_command_cmd_no_cmd_v(void)
72{
73 return 0x00000000U;
74}
75static inline u32 pri_ringmaster_command_cmd_start_ring_f(void)
76{
77 return 0x1U;
78}
79static inline u32 pri_ringmaster_command_cmd_ack_interrupt_f(void)
80{
81 return 0x2U;
82}
83static inline u32 pri_ringmaster_command_cmd_enumerate_stations_f(void)
84{
85 return 0x3U;
86}
87static inline u32 pri_ringmaster_command_cmd_enumerate_stations_bc_grp_all_f(void)
88{
89 return 0x0U;
90}
91static inline u32 pri_ringmaster_command_data_r(void)
92{
93 return 0x00120048U;
94}
95static inline u32 pri_ringmaster_start_results_r(void)
96{
97 return 0x00120050U;
98}
99static inline u32 pri_ringmaster_start_results_connectivity_v(u32 r)
100{
101 return (r >> 0U) & 0x1U;
102}
103static inline u32 pri_ringmaster_start_results_connectivity_pass_v(void)
104{
105 return 0x00000001U;
106}
107static inline u32 pri_ringmaster_intr_status0_r(void)
108{
109 return 0x00120058U;
110}
111static inline u32 pri_ringmaster_intr_status0_ring_start_conn_fault_v(u32 r)
112{
113 return (r >> 0U) & 0x1U;
114}
115static inline u32 pri_ringmaster_intr_status0_disconnect_fault_v(u32 r)
116{
117 return (r >> 1U) & 0x1U;
118}
119static inline u32 pri_ringmaster_intr_status0_overflow_fault_v(u32 r)
120{
121 return (r >> 2U) & 0x1U;
122}
123static inline u32 pri_ringmaster_intr_status0_gbl_write_error_sys_v(u32 r)
124{
125 return (r >> 8U) & 0x1U;
126}
127static inline u32 pri_ringmaster_intr_status1_r(void)
128{
129 return 0x0012005cU;
130}
131static inline u32 pri_ringmaster_global_ctl_r(void)
132{
133 return 0x00120060U;
134}
135static inline u32 pri_ringmaster_global_ctl_ring_reset_asserted_f(void)
136{
137 return 0x1U;
138}
139static inline u32 pri_ringmaster_global_ctl_ring_reset_deasserted_f(void)
140{
141 return 0x0U;
142}
143static inline u32 pri_ringmaster_enum_fbp_r(void)
144{
145 return 0x00120074U;
146}
147static inline u32 pri_ringmaster_enum_fbp_count_v(u32 r)
148{
149 return (r >> 0U) & 0x1fU;
150}
151static inline u32 pri_ringmaster_enum_gpc_r(void)
152{
153 return 0x00120078U;
154}
155static inline u32 pri_ringmaster_enum_gpc_count_v(u32 r)
156{
157 return (r >> 0U) & 0x1fU;
158}
159static inline u32 pri_ringmaster_enum_ltc_r(void)
160{
161 return 0x0012006cU;
162}
163static inline u32 pri_ringmaster_enum_ltc_count_v(u32 r)
164{
165 return (r >> 0U) & 0x1fU;
166}
167#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_pri_ringstation_gpc_gp10b.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_pri_ringstation_gpc_gp10b.h
new file mode 100644
index 00000000..1bd5a0f7
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_pri_ringstation_gpc_gp10b.h
@@ -0,0 +1,79 @@
1/*
2 * Copyright (c) 2017, 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_pri_ringstation_gpc_gp10b_h_
57#define _hw_pri_ringstation_gpc_gp10b_h_
58
59static inline u32 pri_ringstation_gpc_master_config_r(u32 i)
60{
61 return 0x00128300U + i*4U;
62}
63static inline u32 pri_ringstation_gpc_gpc0_priv_error_adr_r(void)
64{
65 return 0x00128120U;
66}
67static inline u32 pri_ringstation_gpc_gpc0_priv_error_wrdat_r(void)
68{
69 return 0x00128124U;
70}
71static inline u32 pri_ringstation_gpc_gpc0_priv_error_info_r(void)
72{
73 return 0x00128128U;
74}
75static inline u32 pri_ringstation_gpc_gpc0_priv_error_code_r(void)
76{
77 return 0x0012812cU;
78}
79#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_pri_ringstation_sys_gp10b.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_pri_ringstation_sys_gp10b.h
new file mode 100644
index 00000000..c4d9ef1b
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_pri_ringstation_sys_gp10b.h
@@ -0,0 +1,91 @@
1/*
2 * Copyright (c) 2014-2017, 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_pri_ringstation_sys_gp10b_h_
57#define _hw_pri_ringstation_sys_gp10b_h_
58
59static inline u32 pri_ringstation_sys_master_config_r(u32 i)
60{
61 return 0x00122300U + i*4U;
62}
63static inline u32 pri_ringstation_sys_decode_config_r(void)
64{
65 return 0x00122204U;
66}
67static inline u32 pri_ringstation_sys_decode_config_ring_m(void)
68{
69 return 0x7U << 0U;
70}
71static inline u32 pri_ringstation_sys_decode_config_ring_drop_on_ring_not_started_f(void)
72{
73 return 0x1U;
74}
75static inline u32 pri_ringstation_sys_priv_error_adr_r(void)
76{
77 return 0x00122120U;
78}
79static inline u32 pri_ringstation_sys_priv_error_wrdat_r(void)
80{
81 return 0x00122124U;
82}
83static inline u32 pri_ringstation_sys_priv_error_info_r(void)
84{
85 return 0x00122128U;
86}
87static inline u32 pri_ringstation_sys_priv_error_code_r(void)
88{
89 return 0x0012212cU;
90}
91#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_proj_gp10b.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_proj_gp10b.h
new file mode 100644
index 00000000..f5d60beb
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_proj_gp10b.h
@@ -0,0 +1,175 @@
1/*
2 * Copyright (c) 2016-2017, 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_proj_gp10b_h_
57#define _hw_proj_gp10b_h_
58
59static inline u32 proj_gpc_base_v(void)
60{
61 return 0x00500000U;
62}
63static inline u32 proj_gpc_shared_base_v(void)
64{
65 return 0x00418000U;
66}
67static inline u32 proj_gpc_stride_v(void)
68{
69 return 0x00008000U;
70}
71static inline u32 proj_ltc_stride_v(void)
72{
73 return 0x00002000U;
74}
75static inline u32 proj_lts_stride_v(void)
76{
77 return 0x00000200U;
78}
79static inline u32 proj_fbpa_base_v(void)
80{
81 return 0x00900000U;
82}
83static inline u32 proj_fbpa_shared_base_v(void)
84{
85 return 0x009a0000U;
86}
87static inline u32 proj_fbpa_stride_v(void)
88{
89 return 0x00004000U;
90}
91static inline u32 proj_ppc_in_gpc_base_v(void)
92{
93 return 0x00003000U;
94}
95static inline u32 proj_ppc_in_gpc_shared_base_v(void)
96{
97 return 0x00003e00U;
98}
99static inline u32 proj_ppc_in_gpc_stride_v(void)
100{
101 return 0x00000200U;
102}
103static inline u32 proj_rop_base_v(void)
104{
105 return 0x00410000U;
106}
107static inline u32 proj_rop_shared_base_v(void)
108{
109 return 0x00408800U;
110}
111static inline u32 proj_rop_stride_v(void)
112{
113 return 0x00000400U;
114}
115static inline u32 proj_tpc_in_gpc_base_v(void)
116{
117 return 0x00004000U;
118}
119static inline u32 proj_tpc_in_gpc_stride_v(void)
120{
121 return 0x00000800U;
122}
123static inline u32 proj_tpc_in_gpc_shared_base_v(void)
124{
125 return 0x00001800U;
126}
127static inline u32 proj_host_num_engines_v(void)
128{
129 return 0x00000002U;
130}
131static inline u32 proj_host_num_pbdma_v(void)
132{
133 return 0x00000001U;
134}
135static inline u32 proj_scal_litter_num_tpc_per_gpc_v(void)
136{
137 return 0x00000002U;
138}
139static inline u32 proj_scal_litter_num_sm_per_tpc_v(void)
140{
141 return 0x00000001U;
142}
143static inline u32 proj_scal_litter_num_fbps_v(void)
144{
145 return 0x00000001U;
146}
147static inline u32 proj_scal_litter_num_fbpas_v(void)
148{
149 return 0x00000001U;
150}
151static inline u32 proj_scal_litter_num_gpcs_v(void)
152{
153 return 0x00000001U;
154}
155static inline u32 proj_scal_litter_num_pes_per_gpc_v(void)
156{
157 return 0x00000001U;
158}
159static inline u32 proj_scal_litter_num_tpcs_per_pes_v(void)
160{
161 return 0x00000002U;
162}
163static inline u32 proj_scal_litter_num_zcull_banks_v(void)
164{
165 return 0x00000004U;
166}
167static inline u32 proj_scal_max_gpcs_v(void)
168{
169 return 0x00000020U;
170}
171static inline u32 proj_scal_max_tpc_per_gpc_v(void)
172{
173 return 0x00000008U;
174}
175#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_pwr_gp10b.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_pwr_gp10b.h
new file mode 100644
index 00000000..73a5c45c
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_pwr_gp10b.h
@@ -0,0 +1,831 @@
1/*
2 * Copyright (c) 2014-2017, 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_pwr_gp10b_h_
57#define _hw_pwr_gp10b_h_
58
59static inline u32 pwr_falcon_irqsset_r(void)
60{
61 return 0x0010a000U;
62}
63static inline u32 pwr_falcon_irqsset_swgen0_set_f(void)
64{
65 return 0x40U;
66}
67static inline u32 pwr_falcon_irqsclr_r(void)
68{
69 return 0x0010a004U;
70}
71static inline u32 pwr_falcon_irqstat_r(void)
72{
73 return 0x0010a008U;
74}
75static inline u32 pwr_falcon_irqstat_halt_true_f(void)
76{
77 return 0x10U;
78}
79static inline u32 pwr_falcon_irqstat_exterr_true_f(void)
80{
81 return 0x20U;
82}
83static inline u32 pwr_falcon_irqstat_swgen0_true_f(void)
84{
85 return 0x40U;
86}
87static inline u32 pwr_falcon_irqmode_r(void)
88{
89 return 0x0010a00cU;
90}
91static inline u32 pwr_falcon_irqmset_r(void)
92{
93 return 0x0010a010U;
94}
95static inline u32 pwr_falcon_irqmset_gptmr_f(u32 v)
96{
97 return (v & 0x1U) << 0U;
98}
99static inline u32 pwr_falcon_irqmset_wdtmr_f(u32 v)
100{
101 return (v & 0x1U) << 1U;
102}
103static inline u32 pwr_falcon_irqmset_mthd_f(u32 v)
104{
105 return (v & 0x1U) << 2U;
106}
107static inline u32 pwr_falcon_irqmset_ctxsw_f(u32 v)
108{
109 return (v & 0x1U) << 3U;
110}
111static inline u32 pwr_falcon_irqmset_halt_f(u32 v)
112{
113 return (v & 0x1U) << 4U;
114}
115static inline u32 pwr_falcon_irqmset_exterr_f(u32 v)
116{
117 return (v & 0x1U) << 5U;
118}
119static inline u32 pwr_falcon_irqmset_swgen0_f(u32 v)
120{
121 return (v & 0x1U) << 6U;
122}
123static inline u32 pwr_falcon_irqmset_swgen1_f(u32 v)
124{
125 return (v & 0x1U) << 7U;
126}
127static inline u32 pwr_falcon_irqmclr_r(void)
128{
129 return 0x0010a014U;
130}
131static inline u32 pwr_falcon_irqmclr_gptmr_f(u32 v)
132{
133 return (v & 0x1U) << 0U;
134}
135static inline u32 pwr_falcon_irqmclr_wdtmr_f(u32 v)
136{
137 return (v & 0x1U) << 1U;
138}
139static inline u32 pwr_falcon_irqmclr_mthd_f(u32 v)
140{
141 return (v & 0x1U) << 2U;
142}
143static inline u32 pwr_falcon_irqmclr_ctxsw_f(u32 v)
144{
145 return (v & 0x1U) << 3U;
146}
147static inline u32 pwr_falcon_irqmclr_halt_f(u32 v)
148{
149 return (v & 0x1U) << 4U;
150}
151static inline u32 pwr_falcon_irqmclr_exterr_f(u32 v)
152{
153 return (v & 0x1U) << 5U;
154}
155static inline u32 pwr_falcon_irqmclr_swgen0_f(u32 v)
156{
157 return (v & 0x1U) << 6U;
158}
159static inline u32 pwr_falcon_irqmclr_swgen1_f(u32 v)
160{
161 return (v & 0x1U) << 7U;
162}
163static inline u32 pwr_falcon_irqmclr_ext_f(u32 v)
164{
165 return (v & 0xffU) << 8U;
166}
167static inline u32 pwr_falcon_irqmask_r(void)
168{
169 return 0x0010a018U;
170}
171static inline u32 pwr_falcon_irqdest_r(void)
172{
173 return 0x0010a01cU;
174}
175static inline u32 pwr_falcon_irqdest_host_gptmr_f(u32 v)
176{
177 return (v & 0x1U) << 0U;
178}
179static inline u32 pwr_falcon_irqdest_host_wdtmr_f(u32 v)
180{
181 return (v & 0x1U) << 1U;
182}
183static inline u32 pwr_falcon_irqdest_host_mthd_f(u32 v)
184{
185 return (v & 0x1U) << 2U;
186}
187static inline u32 pwr_falcon_irqdest_host_ctxsw_f(u32 v)
188{
189 return (v & 0x1U) << 3U;
190}
191static inline u32 pwr_falcon_irqdest_host_halt_f(u32 v)
192{
193 return (v & 0x1U) << 4U;
194}
195static inline u32 pwr_falcon_irqdest_host_exterr_f(u32 v)
196{
197 return (v & 0x1U) << 5U;
198}
199static inline u32 pwr_falcon_irqdest_host_swgen0_f(u32 v)
200{
201 return (v & 0x1U) << 6U;
202}
203static inline u32 pwr_falcon_irqdest_host_swgen1_f(u32 v)
204{
205 return (v & 0x1U) << 7U;
206}
207static inline u32 pwr_falcon_irqdest_host_ext_f(u32 v)
208{
209 return (v & 0xffU) << 8U;
210}
211static inline u32 pwr_falcon_irqdest_target_gptmr_f(u32 v)
212{
213 return (v & 0x1U) << 16U;
214}
215static inline u32 pwr_falcon_irqdest_target_wdtmr_f(u32 v)
216{
217 return (v & 0x1U) << 17U;
218}
219static inline u32 pwr_falcon_irqdest_target_mthd_f(u32 v)
220{
221 return (v & 0x1U) << 18U;
222}
223static inline u32 pwr_falcon_irqdest_target_ctxsw_f(u32 v)
224{
225 return (v & 0x1U) << 19U;
226}
227static inline u32 pwr_falcon_irqdest_target_halt_f(u32 v)
228{
229 return (v & 0x1U) << 20U;
230}
231static inline u32 pwr_falcon_irqdest_target_exterr_f(u32 v)
232{
233 return (v & 0x1U) << 21U;
234}
235static inline u32 pwr_falcon_irqdest_target_swgen0_f(u32 v)
236{
237 return (v & 0x1U) << 22U;
238}
239static inline u32 pwr_falcon_irqdest_target_swgen1_f(u32 v)
240{
241 return (v & 0x1U) << 23U;
242}
243static inline u32 pwr_falcon_irqdest_target_ext_f(u32 v)
244{
245 return (v & 0xffU) << 24U;
246}
247static inline u32 pwr_falcon_curctx_r(void)
248{
249 return 0x0010a050U;
250}
251static inline u32 pwr_falcon_nxtctx_r(void)
252{
253 return 0x0010a054U;
254}
255static inline u32 pwr_falcon_mailbox0_r(void)
256{
257 return 0x0010a040U;
258}
259static inline u32 pwr_falcon_mailbox1_r(void)
260{
261 return 0x0010a044U;
262}
263static inline u32 pwr_falcon_itfen_r(void)
264{
265 return 0x0010a048U;
266}
267static inline u32 pwr_falcon_itfen_ctxen_enable_f(void)
268{
269 return 0x1U;
270}
271static inline u32 pwr_falcon_idlestate_r(void)
272{
273 return 0x0010a04cU;
274}
275static inline u32 pwr_falcon_idlestate_falcon_busy_v(u32 r)
276{
277 return (r >> 0U) & 0x1U;
278}
279static inline u32 pwr_falcon_idlestate_ext_busy_v(u32 r)
280{
281 return (r >> 1U) & 0x7fffU;
282}
283static inline u32 pwr_falcon_os_r(void)
284{
285 return 0x0010a080U;
286}
287static inline u32 pwr_falcon_engctl_r(void)
288{
289 return 0x0010a0a4U;
290}
291static inline u32 pwr_falcon_cpuctl_r(void)
292{
293 return 0x0010a100U;
294}
295static inline u32 pwr_falcon_cpuctl_startcpu_f(u32 v)
296{
297 return (v & 0x1U) << 1U;
298}
299static inline u32 pwr_falcon_cpuctl_halt_intr_f(u32 v)
300{
301 return (v & 0x1U) << 4U;
302}
303static inline u32 pwr_falcon_cpuctl_halt_intr_m(void)
304{
305 return 0x1U << 4U;
306}
307static inline u32 pwr_falcon_cpuctl_halt_intr_v(u32 r)
308{
309 return (r >> 4U) & 0x1U;
310}
311static inline u32 pwr_falcon_cpuctl_cpuctl_alias_en_f(u32 v)
312{
313 return (v & 0x1U) << 6U;
314}
315static inline u32 pwr_falcon_cpuctl_cpuctl_alias_en_m(void)
316{
317 return 0x1U << 6U;
318}
319static inline u32 pwr_falcon_cpuctl_cpuctl_alias_en_v(u32 r)
320{
321 return (r >> 6U) & 0x1U;
322}
323static inline u32 pwr_falcon_cpuctl_alias_r(void)
324{
325 return 0x0010a130U;
326}
327static inline u32 pwr_falcon_cpuctl_alias_startcpu_f(u32 v)
328{
329 return (v & 0x1U) << 1U;
330}
331static inline u32 pwr_pmu_scpctl_stat_r(void)
332{
333 return 0x0010ac08U;
334}
335static inline u32 pwr_pmu_scpctl_stat_debug_mode_f(u32 v)
336{
337 return (v & 0x1U) << 20U;
338}
339static inline u32 pwr_pmu_scpctl_stat_debug_mode_m(void)
340{
341 return 0x1U << 20U;
342}
343static inline u32 pwr_pmu_scpctl_stat_debug_mode_v(u32 r)
344{
345 return (r >> 20U) & 0x1U;
346}
347static inline u32 pwr_falcon_imemc_r(u32 i)
348{
349 return 0x0010a180U + i*16U;
350}
351static inline u32 pwr_falcon_imemc_offs_f(u32 v)
352{
353 return (v & 0x3fU) << 2U;
354}
355static inline u32 pwr_falcon_imemc_blk_f(u32 v)
356{
357 return (v & 0xffU) << 8U;
358}
359static inline u32 pwr_falcon_imemc_aincw_f(u32 v)
360{
361 return (v & 0x1U) << 24U;
362}
363static inline u32 pwr_falcon_imemd_r(u32 i)
364{
365 return 0x0010a184U + i*16U;
366}
367static inline u32 pwr_falcon_imemt_r(u32 i)
368{
369 return 0x0010a188U + i*16U;
370}
371static inline u32 pwr_falcon_sctl_r(void)
372{
373 return 0x0010a240U;
374}
375static inline u32 pwr_falcon_mmu_phys_sec_r(void)
376{
377 return 0x00100ce4U;
378}
379static inline u32 pwr_falcon_bootvec_r(void)
380{
381 return 0x0010a104U;
382}
383static inline u32 pwr_falcon_bootvec_vec_f(u32 v)
384{
385 return (v & 0xffffffffU) << 0U;
386}
387static inline u32 pwr_falcon_dmactl_r(void)
388{
389 return 0x0010a10cU;
390}
391static inline u32 pwr_falcon_dmactl_dmem_scrubbing_m(void)
392{
393 return 0x1U << 1U;
394}
395static inline u32 pwr_falcon_dmactl_imem_scrubbing_m(void)
396{
397 return 0x1U << 2U;
398}
399static inline u32 pwr_falcon_hwcfg_r(void)
400{
401 return 0x0010a108U;
402}
403static inline u32 pwr_falcon_hwcfg_imem_size_v(u32 r)
404{
405 return (r >> 0U) & 0x1ffU;
406}
407static inline u32 pwr_falcon_hwcfg_dmem_size_v(u32 r)
408{
409 return (r >> 9U) & 0x1ffU;
410}
411static inline u32 pwr_falcon_dmatrfbase_r(void)
412{
413 return 0x0010a110U;
414}
415static inline u32 pwr_falcon_dmatrfbase1_r(void)
416{
417 return 0x0010a128U;
418}
419static inline u32 pwr_falcon_dmatrfmoffs_r(void)
420{
421 return 0x0010a114U;
422}
423static inline u32 pwr_falcon_dmatrfcmd_r(void)
424{
425 return 0x0010a118U;
426}
427static inline u32 pwr_falcon_dmatrfcmd_imem_f(u32 v)
428{
429 return (v & 0x1U) << 4U;
430}
431static inline u32 pwr_falcon_dmatrfcmd_write_f(u32 v)
432{
433 return (v & 0x1U) << 5U;
434}
435static inline u32 pwr_falcon_dmatrfcmd_size_f(u32 v)
436{
437 return (v & 0x7U) << 8U;
438}
439static inline u32 pwr_falcon_dmatrfcmd_ctxdma_f(u32 v)
440{
441 return (v & 0x7U) << 12U;
442}
443static inline u32 pwr_falcon_dmatrffboffs_r(void)
444{
445 return 0x0010a11cU;
446}
447static inline u32 pwr_falcon_exterraddr_r(void)
448{
449 return 0x0010a168U;
450}
451static inline u32 pwr_falcon_exterrstat_r(void)
452{
453 return 0x0010a16cU;
454}
455static inline u32 pwr_falcon_exterrstat_valid_m(void)
456{
457 return 0x1U << 31U;
458}
459static inline u32 pwr_falcon_exterrstat_valid_v(u32 r)
460{
461 return (r >> 31U) & 0x1U;
462}
463static inline u32 pwr_falcon_exterrstat_valid_true_v(void)
464{
465 return 0x00000001U;
466}
467static inline u32 pwr_pmu_falcon_icd_cmd_r(void)
468{
469 return 0x0010a200U;
470}
471static inline u32 pwr_pmu_falcon_icd_cmd_opc_s(void)
472{
473 return 4U;
474}
475static inline u32 pwr_pmu_falcon_icd_cmd_opc_f(u32 v)
476{
477 return (v & 0xfU) << 0U;
478}
479static inline u32 pwr_pmu_falcon_icd_cmd_opc_m(void)
480{
481 return 0xfU << 0U;
482}
483static inline u32 pwr_pmu_falcon_icd_cmd_opc_v(u32 r)
484{
485 return (r >> 0U) & 0xfU;
486}
487static inline u32 pwr_pmu_falcon_icd_cmd_opc_rreg_f(void)
488{
489 return 0x8U;
490}
491static inline u32 pwr_pmu_falcon_icd_cmd_opc_rstat_f(void)
492{
493 return 0xeU;
494}
495static inline u32 pwr_pmu_falcon_icd_cmd_idx_f(u32 v)
496{
497 return (v & 0x1fU) << 8U;
498}
499static inline u32 pwr_pmu_falcon_icd_rdata_r(void)
500{
501 return 0x0010a20cU;
502}
503static inline u32 pwr_falcon_dmemc_r(u32 i)
504{
505 return 0x0010a1c0U + i*8U;
506}
507static inline u32 pwr_falcon_dmemc_offs_f(u32 v)
508{
509 return (v & 0x3fU) << 2U;
510}
511static inline u32 pwr_falcon_dmemc_offs_m(void)
512{
513 return 0x3fU << 2U;
514}
515static inline u32 pwr_falcon_dmemc_blk_f(u32 v)
516{
517 return (v & 0xffU) << 8U;
518}
519static inline u32 pwr_falcon_dmemc_blk_m(void)
520{
521 return 0xffU << 8U;
522}
523static inline u32 pwr_falcon_dmemc_aincw_f(u32 v)
524{
525 return (v & 0x1U) << 24U;
526}
527static inline u32 pwr_falcon_dmemc_aincr_f(u32 v)
528{
529 return (v & 0x1U) << 25U;
530}
531static inline u32 pwr_falcon_dmemd_r(u32 i)
532{
533 return 0x0010a1c4U + i*8U;
534}
535static inline u32 pwr_pmu_new_instblk_r(void)
536{
537 return 0x0010a480U;
538}
539static inline u32 pwr_pmu_new_instblk_ptr_f(u32 v)
540{
541 return (v & 0xfffffffU) << 0U;
542}
543static inline u32 pwr_pmu_new_instblk_target_fb_f(void)
544{
545 return 0x0U;
546}
547static inline u32 pwr_pmu_new_instblk_target_sys_coh_f(void)
548{
549 return 0x20000000U;
550}
551static inline u32 pwr_pmu_new_instblk_target_sys_ncoh_f(void)
552{
553 return 0x30000000U;
554}
555static inline u32 pwr_pmu_new_instblk_valid_f(u32 v)
556{
557 return (v & 0x1U) << 30U;
558}
559static inline u32 pwr_pmu_mutex_id_r(void)
560{
561 return 0x0010a488U;
562}
563static inline u32 pwr_pmu_mutex_id_value_v(u32 r)
564{
565 return (r >> 0U) & 0xffU;
566}
567static inline u32 pwr_pmu_mutex_id_value_init_v(void)
568{
569 return 0x00000000U;
570}
571static inline u32 pwr_pmu_mutex_id_value_not_avail_v(void)
572{
573 return 0x000000ffU;
574}
575static inline u32 pwr_pmu_mutex_id_release_r(void)
576{
577 return 0x0010a48cU;
578}
579static inline u32 pwr_pmu_mutex_id_release_value_f(u32 v)
580{
581 return (v & 0xffU) << 0U;
582}
583static inline u32 pwr_pmu_mutex_id_release_value_m(void)
584{
585 return 0xffU << 0U;
586}
587static inline u32 pwr_pmu_mutex_id_release_value_init_v(void)
588{
589 return 0x00000000U;
590}
591static inline u32 pwr_pmu_mutex_id_release_value_init_f(void)
592{
593 return 0x0U;
594}
595static inline u32 pwr_pmu_mutex_r(u32 i)
596{
597 return 0x0010a580U + i*4U;
598}
599static inline u32 pwr_pmu_mutex__size_1_v(void)
600{
601 return 0x00000010U;
602}
603static inline u32 pwr_pmu_mutex_value_f(u32 v)
604{
605 return (v & 0xffU) << 0U;
606}
607static inline u32 pwr_pmu_mutex_value_v(u32 r)
608{
609 return (r >> 0U) & 0xffU;
610}
611static inline u32 pwr_pmu_mutex_value_initial_lock_f(void)
612{
613 return 0x0U;
614}
615static inline u32 pwr_pmu_queue_head_r(u32 i)
616{
617 return 0x0010a4a0U + i*4U;
618}
619static inline u32 pwr_pmu_queue_head__size_1_v(void)
620{
621 return 0x00000004U;
622}
623static inline u32 pwr_pmu_queue_head_address_f(u32 v)
624{
625 return (v & 0xffffffffU) << 0U;
626}
627static inline u32 pwr_pmu_queue_head_address_v(u32 r)
628{
629 return (r >> 0U) & 0xffffffffU;
630}
631static inline u32 pwr_pmu_queue_tail_r(u32 i)
632{
633 return 0x0010a4b0U + i*4U;
634}
635static inline u32 pwr_pmu_queue_tail__size_1_v(void)
636{
637 return 0x00000004U;
638}
639static inline u32 pwr_pmu_queue_tail_address_f(u32 v)
640{
641 return (v & 0xffffffffU) << 0U;
642}
643static inline u32 pwr_pmu_queue_tail_address_v(u32 r)
644{
645 return (r >> 0U) & 0xffffffffU;
646}
647static inline u32 pwr_pmu_msgq_head_r(void)
648{
649 return 0x0010a4c8U;
650}
651static inline u32 pwr_pmu_msgq_head_val_f(u32 v)
652{
653 return (v & 0xffffffffU) << 0U;
654}
655static inline u32 pwr_pmu_msgq_head_val_v(u32 r)
656{
657 return (r >> 0U) & 0xffffffffU;
658}
659static inline u32 pwr_pmu_msgq_tail_r(void)
660{
661 return 0x0010a4ccU;
662}
663static inline u32 pwr_pmu_msgq_tail_val_f(u32 v)
664{
665 return (v & 0xffffffffU) << 0U;
666}
667static inline u32 pwr_pmu_msgq_tail_val_v(u32 r)
668{
669 return (r >> 0U) & 0xffffffffU;
670}
671static inline u32 pwr_pmu_idle_mask_r(u32 i)
672{
673 return 0x0010a504U + i*16U;
674}
675static inline u32 pwr_pmu_idle_mask_gr_enabled_f(void)
676{
677 return 0x1U;
678}
679static inline u32 pwr_pmu_idle_mask_ce_2_enabled_f(void)
680{
681 return 0x200000U;
682}
683static inline u32 pwr_pmu_idle_count_r(u32 i)
684{
685 return 0x0010a508U + i*16U;
686}
687static inline u32 pwr_pmu_idle_count_value_f(u32 v)
688{
689 return (v & 0x7fffffffU) << 0U;
690}
691static inline u32 pwr_pmu_idle_count_value_v(u32 r)
692{
693 return (r >> 0U) & 0x7fffffffU;
694}
695static inline u32 pwr_pmu_idle_count_reset_f(u32 v)
696{
697 return (v & 0x1U) << 31U;
698}
699static inline u32 pwr_pmu_idle_ctrl_r(u32 i)
700{
701 return 0x0010a50cU + i*16U;
702}
703static inline u32 pwr_pmu_idle_ctrl_value_m(void)
704{
705 return 0x3U << 0U;
706}
707static inline u32 pwr_pmu_idle_ctrl_value_busy_f(void)
708{
709 return 0x2U;
710}
711static inline u32 pwr_pmu_idle_ctrl_value_always_f(void)
712{
713 return 0x3U;
714}
715static inline u32 pwr_pmu_idle_ctrl_filter_m(void)
716{
717 return 0x1U << 2U;
718}
719static inline u32 pwr_pmu_idle_ctrl_filter_disabled_f(void)
720{
721 return 0x0U;
722}
723static inline u32 pwr_pmu_idle_mask_supp_r(u32 i)
724{
725 return 0x0010a9f0U + i*8U;
726}
727static inline u32 pwr_pmu_idle_mask_1_supp_r(u32 i)
728{
729 return 0x0010a9f4U + i*8U;
730}
731static inline u32 pwr_pmu_idle_ctrl_supp_r(u32 i)
732{
733 return 0x0010aa30U + i*8U;
734}
735static inline u32 pwr_pmu_debug_r(u32 i)
736{
737 return 0x0010a5c0U + i*4U;
738}
739static inline u32 pwr_pmu_debug__size_1_v(void)
740{
741 return 0x00000004U;
742}
743static inline u32 pwr_pmu_mailbox_r(u32 i)
744{
745 return 0x0010a450U + i*4U;
746}
747static inline u32 pwr_pmu_mailbox__size_1_v(void)
748{
749 return 0x0000000cU;
750}
751static inline u32 pwr_pmu_bar0_addr_r(void)
752{
753 return 0x0010a7a0U;
754}
755static inline u32 pwr_pmu_bar0_data_r(void)
756{
757 return 0x0010a7a4U;
758}
759static inline u32 pwr_pmu_bar0_ctl_r(void)
760{
761 return 0x0010a7acU;
762}
763static inline u32 pwr_pmu_bar0_timeout_r(void)
764{
765 return 0x0010a7a8U;
766}
767static inline u32 pwr_pmu_bar0_fecs_error_r(void)
768{
769 return 0x0010a988U;
770}
771static inline u32 pwr_pmu_bar0_error_status_r(void)
772{
773 return 0x0010a7b0U;
774}
775static inline u32 pwr_pmu_pg_idlefilth_r(u32 i)
776{
777 return 0x0010a6c0U + i*4U;
778}
779static inline u32 pwr_pmu_pg_ppuidlefilth_r(u32 i)
780{
781 return 0x0010a6e8U + i*4U;
782}
783static inline u32 pwr_pmu_pg_idle_cnt_r(u32 i)
784{
785 return 0x0010a710U + i*4U;
786}
787static inline u32 pwr_pmu_pg_intren_r(u32 i)
788{
789 return 0x0010a760U + i*4U;
790}
791static inline u32 pwr_fbif_transcfg_r(u32 i)
792{
793 return 0x0010ae00U + i*4U;
794}
795static inline u32 pwr_fbif_transcfg_target_local_fb_f(void)
796{
797 return 0x0U;
798}
799static inline u32 pwr_fbif_transcfg_target_coherent_sysmem_f(void)
800{
801 return 0x1U;
802}
803static inline u32 pwr_fbif_transcfg_target_noncoherent_sysmem_f(void)
804{
805 return 0x2U;
806}
807static inline u32 pwr_fbif_transcfg_mem_type_s(void)
808{
809 return 1U;
810}
811static inline u32 pwr_fbif_transcfg_mem_type_f(u32 v)
812{
813 return (v & 0x1U) << 2U;
814}
815static inline u32 pwr_fbif_transcfg_mem_type_m(void)
816{
817 return 0x1U << 2U;
818}
819static inline u32 pwr_fbif_transcfg_mem_type_v(u32 r)
820{
821 return (r >> 2U) & 0x1U;
822}
823static inline u32 pwr_fbif_transcfg_mem_type_virtual_f(void)
824{
825 return 0x0U;
826}
827static inline u32 pwr_fbif_transcfg_mem_type_physical_f(void)
828{
829 return 0x4U;
830}
831#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_ram_gp10b.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_ram_gp10b.h
new file mode 100644
index 00000000..a94fc0a2
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_ram_gp10b.h
@@ -0,0 +1,499 @@
1/*
2 * Copyright (c) 2014-2017, 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_ram_gp10b_h_
57#define _hw_ram_gp10b_h_
58
59static inline u32 ram_in_ramfc_s(void)
60{
61 return 4096U;
62}
63static inline u32 ram_in_ramfc_w(void)
64{
65 return 0U;
66}
67static inline u32 ram_in_page_dir_base_target_f(u32 v)
68{
69 return (v & 0x3U) << 0U;
70}
71static inline u32 ram_in_page_dir_base_target_w(void)
72{
73 return 128U;
74}
75static inline u32 ram_in_page_dir_base_target_vid_mem_f(void)
76{
77 return 0x0U;
78}
79static inline u32 ram_in_page_dir_base_target_sys_mem_coh_f(void)
80{
81 return 0x2U;
82}
83static inline u32 ram_in_page_dir_base_target_sys_mem_ncoh_f(void)
84{
85 return 0x3U;
86}
87static inline u32 ram_in_page_dir_base_vol_w(void)
88{
89 return 128U;
90}
91static inline u32 ram_in_page_dir_base_vol_true_f(void)
92{
93 return 0x4U;
94}
95static inline u32 ram_in_page_dir_base_fault_replay_tex_f(u32 v)
96{
97 return (v & 0x1U) << 4U;
98}
99static inline u32 ram_in_page_dir_base_fault_replay_tex_m(void)
100{
101 return 0x1U << 4U;
102}
103static inline u32 ram_in_page_dir_base_fault_replay_tex_w(void)
104{
105 return 128U;
106}
107static inline u32 ram_in_page_dir_base_fault_replay_tex_true_f(void)
108{
109 return 0x10U;
110}
111static inline u32 ram_in_page_dir_base_fault_replay_gcc_f(u32 v)
112{
113 return (v & 0x1U) << 5U;
114}
115static inline u32 ram_in_page_dir_base_fault_replay_gcc_m(void)
116{
117 return 0x1U << 5U;
118}
119static inline u32 ram_in_page_dir_base_fault_replay_gcc_w(void)
120{
121 return 128U;
122}
123static inline u32 ram_in_page_dir_base_fault_replay_gcc_true_f(void)
124{
125 return 0x20U;
126}
127static inline u32 ram_in_big_page_size_f(u32 v)
128{
129 return (v & 0x1U) << 11U;
130}
131static inline u32 ram_in_big_page_size_m(void)
132{
133 return 0x1U << 11U;
134}
135static inline u32 ram_in_big_page_size_w(void)
136{
137 return 128U;
138}
139static inline u32 ram_in_big_page_size_128kb_f(void)
140{
141 return 0x0U;
142}
143static inline u32 ram_in_big_page_size_64kb_f(void)
144{
145 return 0x800U;
146}
147static inline u32 ram_in_page_dir_base_lo_f(u32 v)
148{
149 return (v & 0xfffffU) << 12U;
150}
151static inline u32 ram_in_page_dir_base_lo_w(void)
152{
153 return 128U;
154}
155static inline u32 ram_in_page_dir_base_hi_f(u32 v)
156{
157 return (v & 0xffU) << 0U;
158}
159static inline u32 ram_in_page_dir_base_hi_w(void)
160{
161 return 129U;
162}
163static inline u32 ram_in_adr_limit_lo_f(u32 v)
164{
165 return (v & 0xfffffU) << 12U;
166}
167static inline u32 ram_in_adr_limit_lo_w(void)
168{
169 return 130U;
170}
171static inline u32 ram_in_adr_limit_hi_f(u32 v)
172{
173 return (v & 0xffffffffU) << 0U;
174}
175static inline u32 ram_in_adr_limit_hi_w(void)
176{
177 return 131U;
178}
179static inline u32 ram_in_engine_cs_w(void)
180{
181 return 132U;
182}
183static inline u32 ram_in_engine_cs_wfi_v(void)
184{
185 return 0x00000000U;
186}
187static inline u32 ram_in_engine_cs_wfi_f(void)
188{
189 return 0x0U;
190}
191static inline u32 ram_in_engine_cs_fg_v(void)
192{
193 return 0x00000001U;
194}
195static inline u32 ram_in_engine_cs_fg_f(void)
196{
197 return 0x8U;
198}
199static inline u32 ram_in_gr_cs_w(void)
200{
201 return 132U;
202}
203static inline u32 ram_in_gr_cs_wfi_f(void)
204{
205 return 0x0U;
206}
207static inline u32 ram_in_gr_wfi_target_w(void)
208{
209 return 132U;
210}
211static inline u32 ram_in_gr_wfi_mode_w(void)
212{
213 return 132U;
214}
215static inline u32 ram_in_gr_wfi_mode_physical_v(void)
216{
217 return 0x00000000U;
218}
219static inline u32 ram_in_gr_wfi_mode_physical_f(void)
220{
221 return 0x0U;
222}
223static inline u32 ram_in_gr_wfi_mode_virtual_v(void)
224{
225 return 0x00000001U;
226}
227static inline u32 ram_in_gr_wfi_mode_virtual_f(void)
228{
229 return 0x4U;
230}
231static inline u32 ram_in_gr_wfi_ptr_lo_f(u32 v)
232{
233 return (v & 0xfffffU) << 12U;
234}
235static inline u32 ram_in_gr_wfi_ptr_lo_w(void)
236{
237 return 132U;
238}
239static inline u32 ram_in_gr_wfi_ptr_hi_f(u32 v)
240{
241 return (v & 0xffU) << 0U;
242}
243static inline u32 ram_in_gr_wfi_ptr_hi_w(void)
244{
245 return 133U;
246}
247static inline u32 ram_in_base_shift_v(void)
248{
249 return 0x0000000cU;
250}
251static inline u32 ram_in_alloc_size_v(void)
252{
253 return 0x00001000U;
254}
255static inline u32 ram_fc_size_val_v(void)
256{
257 return 0x00000200U;
258}
259static inline u32 ram_fc_gp_put_w(void)
260{
261 return 0U;
262}
263static inline u32 ram_fc_userd_w(void)
264{
265 return 2U;
266}
267static inline u32 ram_fc_userd_hi_w(void)
268{
269 return 3U;
270}
271static inline u32 ram_fc_signature_w(void)
272{
273 return 4U;
274}
275static inline u32 ram_fc_gp_get_w(void)
276{
277 return 5U;
278}
279static inline u32 ram_fc_pb_get_w(void)
280{
281 return 6U;
282}
283static inline u32 ram_fc_pb_get_hi_w(void)
284{
285 return 7U;
286}
287static inline u32 ram_fc_pb_top_level_get_w(void)
288{
289 return 8U;
290}
291static inline u32 ram_fc_pb_top_level_get_hi_w(void)
292{
293 return 9U;
294}
295static inline u32 ram_fc_acquire_w(void)
296{
297 return 12U;
298}
299static inline u32 ram_fc_semaphorea_w(void)
300{
301 return 14U;
302}
303static inline u32 ram_fc_semaphoreb_w(void)
304{
305 return 15U;
306}
307static inline u32 ram_fc_semaphorec_w(void)
308{
309 return 16U;
310}
311static inline u32 ram_fc_semaphored_w(void)
312{
313 return 17U;
314}
315static inline u32 ram_fc_gp_base_w(void)
316{
317 return 18U;
318}
319static inline u32 ram_fc_gp_base_hi_w(void)
320{
321 return 19U;
322}
323static inline u32 ram_fc_gp_fetch_w(void)
324{
325 return 20U;
326}
327static inline u32 ram_fc_pb_fetch_w(void)
328{
329 return 21U;
330}
331static inline u32 ram_fc_pb_fetch_hi_w(void)
332{
333 return 22U;
334}
335static inline u32 ram_fc_pb_put_w(void)
336{
337 return 23U;
338}
339static inline u32 ram_fc_pb_put_hi_w(void)
340{
341 return 24U;
342}
343static inline u32 ram_fc_pb_header_w(void)
344{
345 return 33U;
346}
347static inline u32 ram_fc_pb_count_w(void)
348{
349 return 34U;
350}
351static inline u32 ram_fc_subdevice_w(void)
352{
353 return 37U;
354}
355static inline u32 ram_fc_formats_w(void)
356{
357 return 39U;
358}
359static inline u32 ram_fc_allowed_syncpoints_w(void)
360{
361 return 58U;
362}
363static inline u32 ram_fc_syncpointa_w(void)
364{
365 return 41U;
366}
367static inline u32 ram_fc_syncpointb_w(void)
368{
369 return 42U;
370}
371static inline u32 ram_fc_target_w(void)
372{
373 return 43U;
374}
375static inline u32 ram_fc_hce_ctrl_w(void)
376{
377 return 57U;
378}
379static inline u32 ram_fc_chid_w(void)
380{
381 return 58U;
382}
383static inline u32 ram_fc_chid_id_f(u32 v)
384{
385 return (v & 0xfffU) << 0U;
386}
387static inline u32 ram_fc_chid_id_w(void)
388{
389 return 0U;
390}
391static inline u32 ram_fc_config_w(void)
392{
393 return 61U;
394}
395static inline u32 ram_fc_runlist_timeslice_w(void)
396{
397 return 62U;
398}
399static inline u32 ram_userd_base_shift_v(void)
400{
401 return 0x00000009U;
402}
403static inline u32 ram_userd_chan_size_v(void)
404{
405 return 0x00000200U;
406}
407static inline u32 ram_userd_put_w(void)
408{
409 return 16U;
410}
411static inline u32 ram_userd_get_w(void)
412{
413 return 17U;
414}
415static inline u32 ram_userd_ref_w(void)
416{
417 return 18U;
418}
419static inline u32 ram_userd_put_hi_w(void)
420{
421 return 19U;
422}
423static inline u32 ram_userd_ref_threshold_w(void)
424{
425 return 20U;
426}
427static inline u32 ram_userd_top_level_get_w(void)
428{
429 return 22U;
430}
431static inline u32 ram_userd_top_level_get_hi_w(void)
432{
433 return 23U;
434}
435static inline u32 ram_userd_get_hi_w(void)
436{
437 return 24U;
438}
439static inline u32 ram_userd_gp_get_w(void)
440{
441 return 34U;
442}
443static inline u32 ram_userd_gp_put_w(void)
444{
445 return 35U;
446}
447static inline u32 ram_userd_gp_top_level_get_w(void)
448{
449 return 22U;
450}
451static inline u32 ram_userd_gp_top_level_get_hi_w(void)
452{
453 return 23U;
454}
455static inline u32 ram_rl_entry_size_v(void)
456{
457 return 0x00000008U;
458}
459static inline u32 ram_rl_entry_chid_f(u32 v)
460{
461 return (v & 0xfffU) << 0U;
462}
463static inline u32 ram_rl_entry_id_f(u32 v)
464{
465 return (v & 0xfffU) << 0U;
466}
467static inline u32 ram_rl_entry_type_f(u32 v)
468{
469 return (v & 0x1U) << 13U;
470}
471static inline u32 ram_rl_entry_type_chid_f(void)
472{
473 return 0x0U;
474}
475static inline u32 ram_rl_entry_type_tsg_f(void)
476{
477 return 0x2000U;
478}
479static inline u32 ram_rl_entry_timeslice_scale_f(u32 v)
480{
481 return (v & 0xfU) << 14U;
482}
483static inline u32 ram_rl_entry_timeslice_scale_3_f(void)
484{
485 return 0xc000U;
486}
487static inline u32 ram_rl_entry_timeslice_timeout_f(u32 v)
488{
489 return (v & 0xffU) << 18U;
490}
491static inline u32 ram_rl_entry_timeslice_timeout_128_f(void)
492{
493 return 0x2000000U;
494}
495static inline u32 ram_rl_entry_tsg_length_f(u32 v)
496{
497 return (v & 0x3fU) << 26U;
498}
499#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_therm_gp10b.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_therm_gp10b.h
new file mode 100644
index 00000000..49fb7180
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_therm_gp10b.h
@@ -0,0 +1,415 @@
1/*
2 * Copyright (c) 2014-2017, 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_therm_gp10b_h_
57#define _hw_therm_gp10b_h_
58
59static inline u32 therm_use_a_r(void)
60{
61 return 0x00020798U;
62}
63static inline u32 therm_use_a_ext_therm_0_enable_f(void)
64{
65 return 0x1U;
66}
67static inline u32 therm_use_a_ext_therm_1_enable_f(void)
68{
69 return 0x2U;
70}
71static inline u32 therm_use_a_ext_therm_2_enable_f(void)
72{
73 return 0x4U;
74}
75static inline u32 therm_evt_ext_therm_0_r(void)
76{
77 return 0x00020700U;
78}
79static inline u32 therm_evt_ext_therm_0_slow_factor_f(u32 v)
80{
81 return (v & 0x3fU) << 24U;
82}
83static inline u32 therm_evt_ext_therm_0_slow_factor_init_v(void)
84{
85 return 0x00000001U;
86}
87static inline u32 therm_evt_ext_therm_0_mode_f(u32 v)
88{
89 return (v & 0x3U) << 30U;
90}
91static inline u32 therm_evt_ext_therm_0_mode_normal_v(void)
92{
93 return 0x00000000U;
94}
95static inline u32 therm_evt_ext_therm_0_mode_inverted_v(void)
96{
97 return 0x00000001U;
98}
99static inline u32 therm_evt_ext_therm_0_mode_forced_v(void)
100{
101 return 0x00000002U;
102}
103static inline u32 therm_evt_ext_therm_0_mode_cleared_v(void)
104{
105 return 0x00000003U;
106}
107static inline u32 therm_evt_ext_therm_1_r(void)
108{
109 return 0x00020704U;
110}
111static inline u32 therm_evt_ext_therm_1_slow_factor_f(u32 v)
112{
113 return (v & 0x3fU) << 24U;
114}
115static inline u32 therm_evt_ext_therm_1_slow_factor_init_v(void)
116{
117 return 0x00000002U;
118}
119static inline u32 therm_evt_ext_therm_1_mode_f(u32 v)
120{
121 return (v & 0x3U) << 30U;
122}
123static inline u32 therm_evt_ext_therm_1_mode_normal_v(void)
124{
125 return 0x00000000U;
126}
127static inline u32 therm_evt_ext_therm_1_mode_inverted_v(void)
128{
129 return 0x00000001U;
130}
131static inline u32 therm_evt_ext_therm_1_mode_forced_v(void)
132{
133 return 0x00000002U;
134}
135static inline u32 therm_evt_ext_therm_1_mode_cleared_v(void)
136{
137 return 0x00000003U;
138}
139static inline u32 therm_evt_ext_therm_2_r(void)
140{
141 return 0x00020708U;
142}
143static inline u32 therm_evt_ext_therm_2_slow_factor_f(u32 v)
144{
145 return (v & 0x3fU) << 24U;
146}
147static inline u32 therm_evt_ext_therm_2_slow_factor_init_v(void)
148{
149 return 0x00000003U;
150}
151static inline u32 therm_evt_ext_therm_2_mode_f(u32 v)
152{
153 return (v & 0x3U) << 30U;
154}
155static inline u32 therm_evt_ext_therm_2_mode_normal_v(void)
156{
157 return 0x00000000U;
158}
159static inline u32 therm_evt_ext_therm_2_mode_inverted_v(void)
160{
161 return 0x00000001U;
162}
163static inline u32 therm_evt_ext_therm_2_mode_forced_v(void)
164{
165 return 0x00000002U;
166}
167static inline u32 therm_evt_ext_therm_2_mode_cleared_v(void)
168{
169 return 0x00000003U;
170}
171static inline u32 therm_weight_1_r(void)
172{
173 return 0x00020024U;
174}
175static inline u32 therm_config1_r(void)
176{
177 return 0x00020050U;
178}
179static inline u32 therm_config2_r(void)
180{
181 return 0x00020130U;
182}
183static inline u32 therm_config2_slowdown_factor_extended_f(u32 v)
184{
185 return (v & 0x1U) << 24U;
186}
187static inline u32 therm_config2_grad_enable_f(u32 v)
188{
189 return (v & 0x1U) << 31U;
190}
191static inline u32 therm_gate_ctrl_r(u32 i)
192{
193 return 0x00020200U + i*4U;
194}
195static inline u32 therm_gate_ctrl_eng_clk_m(void)
196{
197 return 0x3U << 0U;
198}
199static inline u32 therm_gate_ctrl_eng_clk_run_f(void)
200{
201 return 0x0U;
202}
203static inline u32 therm_gate_ctrl_eng_clk_auto_f(void)
204{
205 return 0x1U;
206}
207static inline u32 therm_gate_ctrl_eng_clk_stop_f(void)
208{
209 return 0x2U;
210}
211static inline u32 therm_gate_ctrl_blk_clk_m(void)
212{
213 return 0x3U << 2U;
214}
215static inline u32 therm_gate_ctrl_blk_clk_run_f(void)
216{
217 return 0x0U;
218}
219static inline u32 therm_gate_ctrl_blk_clk_auto_f(void)
220{
221 return 0x4U;
222}
223static inline u32 therm_gate_ctrl_eng_pwr_m(void)
224{
225 return 0x3U << 4U;
226}
227static inline u32 therm_gate_ctrl_eng_pwr_auto_f(void)
228{
229 return 0x10U;
230}
231static inline u32 therm_gate_ctrl_eng_pwr_off_v(void)
232{
233 return 0x00000002U;
234}
235static inline u32 therm_gate_ctrl_eng_pwr_off_f(void)
236{
237 return 0x20U;
238}
239static inline u32 therm_gate_ctrl_eng_idle_filt_exp_f(u32 v)
240{
241 return (v & 0x1fU) << 8U;
242}
243static inline u32 therm_gate_ctrl_eng_idle_filt_exp_m(void)
244{
245 return 0x1fU << 8U;
246}
247static inline u32 therm_gate_ctrl_eng_idle_filt_mant_f(u32 v)
248{
249 return (v & 0x7U) << 13U;
250}
251static inline u32 therm_gate_ctrl_eng_idle_filt_mant_m(void)
252{
253 return 0x7U << 13U;
254}
255static inline u32 therm_gate_ctrl_eng_delay_before_f(u32 v)
256{
257 return (v & 0xfU) << 16U;
258}
259static inline u32 therm_gate_ctrl_eng_delay_before_m(void)
260{
261 return 0xfU << 16U;
262}
263static inline u32 therm_gate_ctrl_eng_delay_after_f(u32 v)
264{
265 return (v & 0xfU) << 20U;
266}
267static inline u32 therm_gate_ctrl_eng_delay_after_m(void)
268{
269 return 0xfU << 20U;
270}
271static inline u32 therm_fecs_idle_filter_r(void)
272{
273 return 0x00020288U;
274}
275static inline u32 therm_fecs_idle_filter_value_m(void)
276{
277 return 0xffffffffU << 0U;
278}
279static inline u32 therm_hubmmu_idle_filter_r(void)
280{
281 return 0x0002028cU;
282}
283static inline u32 therm_hubmmu_idle_filter_value_m(void)
284{
285 return 0xffffffffU << 0U;
286}
287static inline u32 therm_clk_slowdown_r(u32 i)
288{
289 return 0x00020160U + i*4U;
290}
291static inline u32 therm_clk_slowdown_idle_factor_f(u32 v)
292{
293 return (v & 0x3fU) << 16U;
294}
295static inline u32 therm_clk_slowdown_idle_factor_m(void)
296{
297 return 0x3fU << 16U;
298}
299static inline u32 therm_clk_slowdown_idle_factor_v(u32 r)
300{
301 return (r >> 16U) & 0x3fU;
302}
303static inline u32 therm_clk_slowdown_idle_factor_disabled_f(void)
304{
305 return 0x0U;
306}
307static inline u32 therm_grad_stepping_table_r(u32 i)
308{
309 return 0x000202c8U + i*4U;
310}
311static inline u32 therm_grad_stepping_table_slowdown_factor0_f(u32 v)
312{
313 return (v & 0x3fU) << 0U;
314}
315static inline u32 therm_grad_stepping_table_slowdown_factor0_m(void)
316{
317 return 0x3fU << 0U;
318}
319static inline u32 therm_grad_stepping_table_slowdown_factor0_fpdiv_by1p5_f(void)
320{
321 return 0x1U;
322}
323static inline u32 therm_grad_stepping_table_slowdown_factor0_fpdiv_by2_f(void)
324{
325 return 0x2U;
326}
327static inline u32 therm_grad_stepping_table_slowdown_factor0_fpdiv_by4_f(void)
328{
329 return 0x6U;
330}
331static inline u32 therm_grad_stepping_table_slowdown_factor0_fpdiv_by8_f(void)
332{
333 return 0xeU;
334}
335static inline u32 therm_grad_stepping_table_slowdown_factor1_f(u32 v)
336{
337 return (v & 0x3fU) << 6U;
338}
339static inline u32 therm_grad_stepping_table_slowdown_factor1_m(void)
340{
341 return 0x3fU << 6U;
342}
343static inline u32 therm_grad_stepping_table_slowdown_factor2_f(u32 v)
344{
345 return (v & 0x3fU) << 12U;
346}
347static inline u32 therm_grad_stepping_table_slowdown_factor2_m(void)
348{
349 return 0x3fU << 12U;
350}
351static inline u32 therm_grad_stepping_table_slowdown_factor3_f(u32 v)
352{
353 return (v & 0x3fU) << 18U;
354}
355static inline u32 therm_grad_stepping_table_slowdown_factor3_m(void)
356{
357 return 0x3fU << 18U;
358}
359static inline u32 therm_grad_stepping_table_slowdown_factor4_f(u32 v)
360{
361 return (v & 0x3fU) << 24U;
362}
363static inline u32 therm_grad_stepping_table_slowdown_factor4_m(void)
364{
365 return 0x3fU << 24U;
366}
367static inline u32 therm_grad_stepping0_r(void)
368{
369 return 0x000202c0U;
370}
371static inline u32 therm_grad_stepping0_feature_s(void)
372{
373 return 1U;
374}
375static inline u32 therm_grad_stepping0_feature_f(u32 v)
376{
377 return (v & 0x1U) << 0U;
378}
379static inline u32 therm_grad_stepping0_feature_m(void)
380{
381 return 0x1U << 0U;
382}
383static inline u32 therm_grad_stepping0_feature_v(u32 r)
384{
385 return (r >> 0U) & 0x1U;
386}
387static inline u32 therm_grad_stepping0_feature_enable_f(void)
388{
389 return 0x1U;
390}
391static inline u32 therm_grad_stepping1_r(void)
392{
393 return 0x000202c4U;
394}
395static inline u32 therm_grad_stepping1_pdiv_duration_f(u32 v)
396{
397 return (v & 0x1ffffU) << 0U;
398}
399static inline u32 therm_clk_timing_r(u32 i)
400{
401 return 0x000203c0U + i*4U;
402}
403static inline u32 therm_clk_timing_grad_slowdown_f(u32 v)
404{
405 return (v & 0x1U) << 16U;
406}
407static inline u32 therm_clk_timing_grad_slowdown_m(void)
408{
409 return 0x1U << 16U;
410}
411static inline u32 therm_clk_timing_grad_slowdown_enabled_f(void)
412{
413 return 0x10000U;
414}
415#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_timer_gp10b.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_timer_gp10b.h
new file mode 100644
index 00000000..db752648
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_timer_gp10b.h
@@ -0,0 +1,115 @@
1/*
2 * Copyright (c) 2014-2017, 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_timer_gp10b_h_
57#define _hw_timer_gp10b_h_
58
59static inline u32 timer_pri_timeout_r(void)
60{
61 return 0x00009080U;
62}
63static inline u32 timer_pri_timeout_period_f(u32 v)
64{
65 return (v & 0xffffffU) << 0U;
66}
67static inline u32 timer_pri_timeout_period_m(void)
68{
69 return 0xffffffU << 0U;
70}
71static inline u32 timer_pri_timeout_period_v(u32 r)
72{
73 return (r >> 0U) & 0xffffffU;
74}
75static inline u32 timer_pri_timeout_en_f(u32 v)
76{
77 return (v & 0x1U) << 31U;
78}
79static inline u32 timer_pri_timeout_en_m(void)
80{
81 return 0x1U << 31U;
82}
83static inline u32 timer_pri_timeout_en_v(u32 r)
84{
85 return (r >> 31U) & 0x1U;
86}
87static inline u32 timer_pri_timeout_en_en_enabled_f(void)
88{
89 return 0x80000000U;
90}
91static inline u32 timer_pri_timeout_en_en_disabled_f(void)
92{
93 return 0x0U;
94}
95static inline u32 timer_pri_timeout_save_0_r(void)
96{
97 return 0x00009084U;
98}
99static inline u32 timer_pri_timeout_save_1_r(void)
100{
101 return 0x00009088U;
102}
103static inline u32 timer_pri_timeout_fecs_errcode_r(void)
104{
105 return 0x0000908cU;
106}
107static inline u32 timer_time_0_r(void)
108{
109 return 0x00009400U;
110}
111static inline u32 timer_time_1_r(void)
112{
113 return 0x00009410U;
114}
115#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_top_gp10b.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_top_gp10b.h
new file mode 100644
index 00000000..8d336077
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_top_gp10b.h
@@ -0,0 +1,231 @@
1/*
2 * Copyright (c) 2014-2017, 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_top_gp10b_h_
57#define _hw_top_gp10b_h_
58
59static inline u32 top_num_gpcs_r(void)
60{
61 return 0x00022430U;
62}
63static inline u32 top_num_gpcs_value_v(u32 r)
64{
65 return (r >> 0U) & 0x1fU;
66}
67static inline u32 top_tpc_per_gpc_r(void)
68{
69 return 0x00022434U;
70}
71static inline u32 top_tpc_per_gpc_value_v(u32 r)
72{
73 return (r >> 0U) & 0x1fU;
74}
75static inline u32 top_num_fbps_r(void)
76{
77 return 0x00022438U;
78}
79static inline u32 top_num_fbps_value_v(u32 r)
80{
81 return (r >> 0U) & 0x1fU;
82}
83static inline u32 top_ltc_per_fbp_r(void)
84{
85 return 0x00022450U;
86}
87static inline u32 top_ltc_per_fbp_value_v(u32 r)
88{
89 return (r >> 0U) & 0x1fU;
90}
91static inline u32 top_slices_per_ltc_r(void)
92{
93 return 0x0002245cU;
94}
95static inline u32 top_slices_per_ltc_value_v(u32 r)
96{
97 return (r >> 0U) & 0x1fU;
98}
99static inline u32 top_num_ltcs_r(void)
100{
101 return 0x00022454U;
102}
103static inline u32 top_device_info_r(u32 i)
104{
105 return 0x00022700U + i*4U;
106}
107static inline u32 top_device_info__size_1_v(void)
108{
109 return 0x00000040U;
110}
111static inline u32 top_device_info_chain_v(u32 r)
112{
113 return (r >> 31U) & 0x1U;
114}
115static inline u32 top_device_info_chain_enable_v(void)
116{
117 return 0x00000001U;
118}
119static inline u32 top_device_info_engine_enum_v(u32 r)
120{
121 return (r >> 26U) & 0xfU;
122}
123static inline u32 top_device_info_runlist_enum_v(u32 r)
124{
125 return (r >> 21U) & 0xfU;
126}
127static inline u32 top_device_info_intr_enum_v(u32 r)
128{
129 return (r >> 15U) & 0x1fU;
130}
131static inline u32 top_device_info_reset_enum_v(u32 r)
132{
133 return (r >> 9U) & 0x1fU;
134}
135static inline u32 top_device_info_type_enum_v(u32 r)
136{
137 return (r >> 2U) & 0x1fffffffU;
138}
139static inline u32 top_device_info_type_enum_graphics_v(void)
140{
141 return 0x00000000U;
142}
143static inline u32 top_device_info_type_enum_graphics_f(void)
144{
145 return 0x0U;
146}
147static inline u32 top_device_info_type_enum_copy2_v(void)
148{
149 return 0x00000003U;
150}
151static inline u32 top_device_info_type_enum_copy2_f(void)
152{
153 return 0xcU;
154}
155static inline u32 top_device_info_type_enum_lce_v(void)
156{
157 return 0x00000013U;
158}
159static inline u32 top_device_info_type_enum_lce_f(void)
160{
161 return 0x4cU;
162}
163static inline u32 top_device_info_engine_v(u32 r)
164{
165 return (r >> 5U) & 0x1U;
166}
167static inline u32 top_device_info_runlist_v(u32 r)
168{
169 return (r >> 4U) & 0x1U;
170}
171static inline u32 top_device_info_intr_v(u32 r)
172{
173 return (r >> 3U) & 0x1U;
174}
175static inline u32 top_device_info_reset_v(u32 r)
176{
177 return (r >> 2U) & 0x1U;
178}
179static inline u32 top_device_info_entry_v(u32 r)
180{
181 return (r >> 0U) & 0x3U;
182}
183static inline u32 top_device_info_entry_not_valid_v(void)
184{
185 return 0x00000000U;
186}
187static inline u32 top_device_info_entry_enum_v(void)
188{
189 return 0x00000002U;
190}
191static inline u32 top_device_info_entry_engine_type_v(void)
192{
193 return 0x00000002U;
194}
195static inline u32 top_device_info_entry_data_v(void)
196{
197 return 0x00000001U;
198}
199static inline u32 top_device_info_data_type_v(u32 r)
200{
201 return (r >> 30U) & 0x1U;
202}
203static inline u32 top_device_info_data_type_enum2_v(void)
204{
205 return 0x00000000U;
206}
207static inline u32 top_device_info_data_inst_id_v(u32 r)
208{
209 return (r >> 26U) & 0xfU;
210}
211static inline u32 top_device_info_data_pri_base_v(u32 r)
212{
213 return (r >> 12U) & 0xfffU;
214}
215static inline u32 top_device_info_data_pri_base_align_v(void)
216{
217 return 0x0000000cU;
218}
219static inline u32 top_device_info_data_fault_id_enum_v(u32 r)
220{
221 return (r >> 3U) & 0x1fU;
222}
223static inline u32 top_device_info_data_fault_id_v(u32 r)
224{
225 return (r >> 2U) & 0x1U;
226}
227static inline u32 top_device_info_data_fault_id_valid_v(void)
228{
229 return 0x00000001U;
230}
231#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/io.h b/drivers/gpu/nvgpu/include/nvgpu/io.h
new file mode 100644
index 00000000..94ae8f95
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/io.h
@@ -0,0 +1,49 @@
1/*
2 * Copyright (c) 2017, 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#ifndef __NVGPU_IO_H__
23#define __NVGPU_IO_H__
24
25#include <nvgpu/types.h>
26#ifdef CONFIG_TEGRA_19x_GPU
27#include <nvgpu/io_t19x.h>
28#endif
29
30/* Legacy defines - should be removed once everybody uses nvgpu_* */
31#define gk20a_writel nvgpu_writel
32#define gk20a_readl nvgpu_readl
33#define gk20a_writel_check nvgpu_writel_check
34#define gk20a_bar1_writel nvgpu_bar1_writel
35#define gk20a_bar1_readl nvgpu_bar1_readl
36#define gk20a_io_exists nvgpu_io_exists
37#define gk20a_io_valid_reg nvgpu_io_valid_reg
38
39struct gk20a;
40
41void nvgpu_writel(struct gk20a *g, u32 r, u32 v);
42u32 nvgpu_readl(struct gk20a *g, u32 r);
43void nvgpu_writel_check(struct gk20a *g, u32 r, u32 v);
44void nvgpu_bar1_writel(struct gk20a *g, u32 b, u32 v);
45u32 nvgpu_bar1_readl(struct gk20a *g, u32 b);
46bool nvgpu_io_exists(struct gk20a *g);
47bool nvgpu_io_valid_reg(struct gk20a *g, u32 r);
48
49#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/kmem.h b/drivers/gpu/nvgpu/include/nvgpu/kmem.h
new file mode 100644
index 00000000..fef837cf
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/kmem.h
@@ -0,0 +1,288 @@
1/*
2 * Copyright (c) 2017, 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#ifndef __NVGPU_KMEM_H__
24#define __NVGPU_KMEM_H__
25
26#include <nvgpu/types.h>
27
28/*
29 * Incase this isn't defined already.
30 */
31#ifndef _THIS_IP_
32#define _THIS_IP_ ({ __label__ __here; __here: (unsigned long)&&__here; })
33#endif
34
35struct gk20a;
36
37/*
38 * When there's other implementations make sure they are included instead of
39 * Linux when not compiling on Linux!
40 */
41#ifdef __KERNEL__
42#include <nvgpu/linux/kmem.h>
43#else
44#include <nvgpu_rmos/include/kmem.h>
45#endif
46
47/**
48 * DOC: Kmem cache support
49 *
50 * In Linux there is support for the notion of a kmem_cache. It gives better
51 * memory usage characteristics for lots of allocations of the same size. Think
52 * structs that get allocated over and over. Normal kmalloc() type routines
53 * typically round to the next power-of-2 since that's easy.
54 *
55 * But if we know the size ahead of time the packing for the allocations can be
56 * much better. This is the benefit of a slab allocator. This type hides the
57 * underlying kmem_cache (or absense thereof).
58 */
59struct nvgpu_kmem_cache;
60
61#ifdef CONFIG_NVGPU_TRACK_MEM_USAGE
62/*
63 * Uncomment this if you want to enable stack traces in the memory profiling.
64 * Since this is a fairly high overhead operation and is only necessary for
65 * debugging actual bugs it's left here for developers to enable.
66 */
67/* #define __NVGPU_SAVE_KALLOC_STACK_TRACES */
68
69/*
70 * Defined per-OS.
71 */
72struct nvgpu_mem_alloc_tracker;
73#endif
74
75
76/**
77 * nvgpu_kmem_cache_create - create an nvgpu kernel memory cache.
78 *
79 * @g The GPU driver struct using this cache.
80 * @size Size of the object allocated by the cache.
81 *
82 * This cache can be used to allocate objects of size @size. Common usage would
83 * be for a struct that gets allocated a lot. In that case @size should be
84 * sizeof(struct my_struct).
85 *
86 * A given implementation of this need not do anything special. The allocation
87 * routines can simply be passed on to nvgpu_kzalloc() if desired so packing
88 * and alignment of the structs cannot be assumed.
89 */
90struct nvgpu_kmem_cache *nvgpu_kmem_cache_create(struct gk20a *g, size_t size);
91
92/**
93 * nvgpu_kmem_cache_destroy - destroy a cache created by
94 * nvgpu_kmem_cache_create().
95 *
96 * @cache The cache to destroy.
97 */
98void nvgpu_kmem_cache_destroy(struct nvgpu_kmem_cache *cache);
99
100/**
101 * nvgpu_kmem_cache_alloc - Allocate an object from the cache
102 *
103 * @cache The cache to alloc from.
104 */
105void *nvgpu_kmem_cache_alloc(struct nvgpu_kmem_cache *cache);
106
107/**
108 * nvgpu_kmem_cache_free - Free an object back to a cache
109 *
110 * @cache The cache to return the object to.
111 * @ptr Pointer to the object to free.
112 */
113void nvgpu_kmem_cache_free(struct nvgpu_kmem_cache *cache, void *ptr);
114
115/**
116 * nvgpu_kmalloc - Allocate from the kernel's allocator.
117 *
118 * @g: Current GPU.
119 * @size: Size of the allocation.
120 *
121 * Allocate a chunk of system memory from the kernel. Allocations larger than 1
122 * page may fail even when there may appear to be enough memory.
123 *
124 * This function may sleep so cannot be used in IRQs.
125 */
126#define nvgpu_kmalloc(g, size) __nvgpu_kmalloc(g, size, _THIS_IP_)
127
128/**
129 * nvgpu_kzalloc - Allocate from the kernel's allocator.
130 *
131 * @g: Current GPU.
132 * @size: Size of the allocation.
133 *
134 * Identical to nvgpu_kalloc() except the memory will be zeroed before being
135 * returned.
136 */
137#define nvgpu_kzalloc(g, size) __nvgpu_kzalloc(g, size, _THIS_IP_)
138
139/**
140 * nvgpu_kcalloc - Allocate from the kernel's allocator.
141 *
142 * @g: Current GPU.
143 * @n: Number of objects.
144 * @size: Size of each object.
145 *
146 * Identical to nvgpu_kalloc() except the size of the memory chunk returned is
147 * @n * @size.
148 */
149#define nvgpu_kcalloc(g, n, size) __nvgpu_kcalloc(g, n, size, _THIS_IP_)
150
151/**
152 * nvgpu_vmalloc - Allocate memory and return a map to it.
153 *
154 * @g: Current GPU.
155 * @size: Size of the allocation.
156 *
157 * Allocate some memory and return a pointer to a virtual memory mapping of
158 * that memory in the kernel's virtual address space. The underlying physical
159 * memory is not guaranteed to be contiguous (and indeed likely isn't). This
160 * allows for much larger allocations to be done without worrying about as much
161 * about physical memory fragmentation.
162 *
163 * This function may sleep.
164 */
165#define nvgpu_vmalloc(g, size) __nvgpu_vmalloc(g, size, _THIS_IP_)
166
167/**
168 * nvgpu_vzalloc - Allocate memory and return a map to it.
169 *
170 * @g: Current GPU.
171 * @size: Size of the allocation.
172 *
173 * Identical to nvgpu_vmalloc() except this will return zero'ed memory.
174 */
175#define nvgpu_vzalloc(g, size) __nvgpu_vzalloc(g, size, _THIS_IP_)
176
177/**
178 * nvgpu_kfree - Frees an alloc from nvgpu_kmalloc, nvgpu_kzalloc,
179 * nvgpu_kcalloc.
180 *
181 * @g: Current GPU.
182 * @addr: Address of object to free.
183 */
184#define nvgpu_kfree(g, addr) __nvgpu_kfree(g, addr)
185
186/**
187 * nvgpu_vfree - Frees an alloc from nvgpu_vmalloc, nvgpu_vzalloc.
188 *
189 * @g: Current GPU.
190 * @addr: Address of object to free.
191 */
192#define nvgpu_vfree(g, addr) __nvgpu_vfree(g, addr)
193
194#define kmem_dbg(g, fmt, args...) \
195 nvgpu_log(g, gpu_dbg_kmem, fmt, ##args)
196
197/**
198 * nvgpu_kmem_init - Initialize the kmem tracking stuff.
199 *
200 *@g: The driver to init.
201 *
202 * Returns non-zero on failure.
203 */
204int nvgpu_kmem_init(struct gk20a *g);
205
206/**
207 * nvgpu_kmem_fini - Finalize the kmem tracking code
208 *
209 * @g - The GPU.
210 * @flags - Flags that control operation of this finalization.
211 *
212 * Cleanup resources used by nvgpu_kmem. Available flags for cleanup are:
213 *
214 * %NVGPU_KMEM_FINI_DO_NOTHING
215 * %NVGPU_KMEM_FINI_FORCE_CLEANUP
216 * %NVGPU_KMEM_FINI_DUMP_ALLOCS
217 * %NVGPU_KMEM_FINI_WARN
218 * %NVGPU_KMEM_FINI_BUG
219 *
220 * %NVGPU_KMEM_FINI_DO_NOTHING will be overridden by anything else specified.
221 * Put another way don't just add %NVGPU_KMEM_FINI_DO_NOTHING and expect that
222 * to suppress other flags from doing anything.
223 */
224void nvgpu_kmem_fini(struct gk20a *g, int flags);
225
226/*
227 * These will simply be ignored if CONFIG_NVGPU_TRACK_MEM_USAGE is not defined.
228 */
229#define NVGPU_KMEM_FINI_DO_NOTHING 0
230#define NVGPU_KMEM_FINI_FORCE_CLEANUP (1 << 0)
231#define NVGPU_KMEM_FINI_DUMP_ALLOCS (1 << 1)
232#define NVGPU_KMEM_FINI_WARN (1 << 2)
233#define NVGPU_KMEM_FINI_BUG (1 << 3)
234
235/*
236 * Implemented by the OS interface.
237 */
238void *__nvgpu_big_alloc(struct gk20a *g, size_t size, bool clear);
239
240/**
241 * nvgpu_big_malloc - Pick virtual or physical alloc based on @size
242 *
243 * @g - The GPU.
244 * @size - Size of the allocation.
245 *
246 * On some platforms (i.e Linux) it is possible to allocate memory directly
247 * mapped into the kernel's address space (kmalloc) or allocate discontiguous
248 * pages which are then mapped into a special kernel address range. Each type
249 * of allocation has pros and cons. kmalloc() for instance lets you allocate
250 * small buffers more space efficiently but vmalloc() allows you to successfully
251 * allocate much larger buffers without worrying about fragmentation as much
252 * (but will allocate in multiples of page size).
253 *
254 * This function aims to provide the right allocation for when buffers are of
255 * variable size. In some cases the code doesn't know ahead of time if the
256 * buffer is going to be big or small so this does the check for you and
257 * provides the right type of memory allocation.
258 *
259 * Returns a pointer to a virtual address range that the kernel can access or
260 * %NULL on failure.
261 */
262static inline void *nvgpu_big_malloc(struct gk20a *g, size_t size)
263{
264 return __nvgpu_big_alloc(g, size, false);
265}
266
267/**
268 * nvgpu_big_malloc - Pick virtual or physical alloc based on @size
269 *
270 * @g - The GPU.
271 * @size - Size of the allocation.
272 *
273 * Zeroed memory version of nvgpu_big_malloc().
274 */
275static inline void *nvgpu_big_zalloc(struct gk20a *g, size_t size)
276{
277 return __nvgpu_big_alloc(g, size, true);
278}
279
280/**
281 * nvgpu_big_free - Free and alloc from nvgpu_big_zalloc() or
282 * nvgpu_big_malloc().
283 * @g - The GPU.
284 * @p - A pointer allocated by nvgpu_big_zalloc() or nvgpu_big_malloc().
285 */
286void nvgpu_big_free(struct gk20a *g, void *p);
287
288#endif /* __NVGPU_KMEM_H__ */
diff --git a/drivers/gpu/nvgpu/include/nvgpu/kref.h b/drivers/gpu/nvgpu/include/nvgpu/kref.h
new file mode 100644
index 00000000..72b21ec4
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/kref.h
@@ -0,0 +1,86 @@
1/*
2 * Copyright (c) 2017, 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/*
24 * The following structure is used for reference counting of objects in nvgpu.
25 */
26#ifndef __NVGPU_KREF_H__
27#define __NVGPU_KREF_H__
28
29#include <nvgpu/atomic.h>
30
31struct nvgpu_ref {
32 nvgpu_atomic_t refcount;
33};
34
35/*
36 * Initialize object.
37 * @ref: the nvgpu_ref object to initialize
38 */
39static inline void nvgpu_ref_init(struct nvgpu_ref *ref)
40{
41 nvgpu_atomic_set(&ref->refcount, 1);
42}
43
44/*
45 * Increment reference count for the object
46 * @ref: the nvgpu_ref object
47 */
48static inline void nvgpu_ref_get(struct nvgpu_ref *ref)
49{
50 nvgpu_atomic_inc(&ref->refcount);
51}
52
53/*
54 * Decrement reference count for the object and call release() if it becomes
55 * zero.
56 * @ref: the nvgpu_ref object
57 * @release: pointer to the function that would be invoked to clean up the
58 * object when the reference count becomes zero, i.e. the last
59 * reference corresponding to this object is removed.
60 * Return 1 if object was removed, otherwise return 0. The user should not
61 * make any assumptions about the status of the object in the memory when
62 * the function returns 0 and should only use it to know that there are no
63 * further references to this object.
64 */
65static inline int nvgpu_ref_put(struct nvgpu_ref *ref,
66 void (*release)(struct nvgpu_ref *r))
67{
68 if (nvgpu_atomic_sub_and_test(1, &ref->refcount)) {
69 if (release != NULL)
70 release(ref);
71 return 1;
72 }
73 return 0;
74}
75
76/*
77 * Increment reference count for the object unless it is zero.
78 * @ref: the nvgpu_ref object
79 * Return non-zero if the increment succeeds, Otherwise return 0.
80 */
81static inline int __must_check nvgpu_ref_get_unless_zero(struct nvgpu_ref *ref)
82{
83 return nvgpu_atomic_add_unless(&ref->refcount, 1, 0);
84}
85
86#endif /* __NVGPU_KREF_H__ */
diff --git a/drivers/gpu/nvgpu/include/nvgpu/linux/atomic.h b/drivers/gpu/nvgpu/include/nvgpu/linux/atomic.h
new file mode 100644
index 00000000..0734672e
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/linux/atomic.h
@@ -0,0 +1,149 @@
1/*
2 * Copyright (c) 2017, 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#ifndef __NVGPU_ATOMIC_LINUX_H__
17#define __NVGPU_ATOMIC_LINUX_H__
18
19#ifdef __KERNEL__
20#include <linux/atomic.h>
21#endif
22
23typedef struct nvgpu_atomic {
24 atomic_t atomic_var;
25} nvgpu_atomic_t;
26
27typedef struct nvgpu_atomic64 {
28 atomic64_t atomic_var;
29} nvgpu_atomic64_t;
30
31#define __nvgpu_atomic_init(i) { ATOMIC_INIT(i) }
32#define __nvgpu_atomic64_init(i) { ATOMIC64_INIT(i) }
33
34static inline void __nvgpu_atomic_set(nvgpu_atomic_t *v, int i)
35{
36 atomic_set(&v->atomic_var, i);
37}
38
39static inline int __nvgpu_atomic_read(nvgpu_atomic_t *v)
40{
41 return atomic_read(&v->atomic_var);
42}
43
44static inline void __nvgpu_atomic_inc(nvgpu_atomic_t *v)
45{
46 atomic_inc(&v->atomic_var);
47}
48
49static inline int __nvgpu_atomic_inc_return(nvgpu_atomic_t *v)
50{
51 return atomic_inc_return(&v->atomic_var);
52}
53
54static inline void __nvgpu_atomic_dec(nvgpu_atomic_t *v)
55{
56 atomic_dec(&v->atomic_var);
57}
58
59static inline int __nvgpu_atomic_dec_return(nvgpu_atomic_t *v)
60{
61 return atomic_dec_return(&v->atomic_var);
62}
63
64static inline int __nvgpu_atomic_cmpxchg(nvgpu_atomic_t *v, int old, int new)
65{
66 return atomic_cmpxchg(&v->atomic_var, old, new);
67}
68
69static inline int __nvgpu_atomic_xchg(nvgpu_atomic_t *v, int new)
70{
71 return atomic_xchg(&v->atomic_var, new);
72}
73
74static inline bool __nvgpu_atomic_inc_and_test(nvgpu_atomic_t *v)
75{
76 return atomic_inc_and_test(&v->atomic_var);
77}
78
79static inline bool __nvgpu_atomic_dec_and_test(nvgpu_atomic_t *v)
80{
81 return atomic_dec_and_test(&v->atomic_var);
82}
83
84static inline bool __nvgpu_atomic_sub_and_test(int i, nvgpu_atomic_t *v)
85{
86 return atomic_sub_and_test(i, &v->atomic_var);
87}
88
89static inline int __nvgpu_atomic_add_return(int i, nvgpu_atomic_t *v)
90{
91 return atomic_add_return(i, &v->atomic_var);
92}
93
94static inline int __nvgpu_atomic_add_unless(nvgpu_atomic_t *v, int a, int u)
95{
96 return atomic_add_unless(&v->atomic_var, a, u);
97}
98
99static inline void __nvgpu_atomic64_set(nvgpu_atomic64_t *v, long i)
100{
101 atomic64_set(&v->atomic_var, i);
102}
103
104static inline long __nvgpu_atomic64_read(nvgpu_atomic64_t *v)
105{
106 return atomic64_read(&v->atomic_var);
107}
108
109static inline void __nvgpu_atomic64_add(long x, nvgpu_atomic64_t *v)
110{
111 atomic64_add(x, &v->atomic_var);
112}
113
114static inline void __nvgpu_atomic64_inc(nvgpu_atomic64_t *v)
115{
116 atomic64_inc(&v->atomic_var);
117}
118
119static inline long __nvgpu_atomic64_inc_return(nvgpu_atomic64_t *v)
120{
121 return atomic64_inc_return(&v->atomic_var);
122}
123
124static inline void __nvgpu_atomic64_dec(nvgpu_atomic64_t *v)
125{
126 atomic64_dec(&v->atomic_var);
127}
128
129static inline void __nvgpu_atomic64_dec_return(nvgpu_atomic64_t *v)
130{
131 atomic64_dec_return(&v->atomic_var);
132}
133
134static inline long __nvgpu_atomic64_cmpxchg(nvgpu_atomic64_t *v,
135 long old, long new)
136{
137 return atomic64_cmpxchg(&v->atomic_var, old, new);
138}
139
140static inline void __nvgpu_atomic64_sub(long x, nvgpu_atomic64_t *v)
141{
142 atomic64_sub(x, &v->atomic_var);
143}
144
145static inline long __nvgpu_atomic64_sub_return(long x, nvgpu_atomic64_t *v)
146{
147 return atomic64_sub_return(x, &v->atomic_var);
148}
149#endif /*__NVGPU_ATOMIC_LINUX_H__ */
diff --git a/drivers/gpu/nvgpu/include/nvgpu/linux/barrier.h b/drivers/gpu/nvgpu/include/nvgpu/linux/barrier.h
new file mode 100644
index 00000000..b20f9462
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/linux/barrier.h
@@ -0,0 +1,35 @@
1/*
2 * Copyright (c) 2017, 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#ifndef __NVGPU_BARRIER_LINUX_H__
18#define __NVGPU_BARRIER_LINUX_H__
19
20#include <asm/barrier.h>
21
22#define __nvgpu_mb() mb()
23#define __nvgpu_rmb() rmb()
24#define __nvgpu_wmb() wmb()
25
26#define __nvgpu_smp_mb() smp_mb()
27#define __nvgpu_smp_rmb() smp_rmb()
28#define __nvgpu_smp_wmb() smp_wmb()
29
30#define __nvgpu_read_barrier_depends() read_barrier_depends()
31#define __nvgpu_smp_read_barrier_depends() smp_read_barrier_depends()
32
33#define __NV_ACCESS_ONCE(x) ACCESS_ONCE(x)
34
35#endif /* __NVGPU_BARRIER_LINUX_H__ */
diff --git a/drivers/gpu/nvgpu/include/nvgpu/linux/cond.h b/drivers/gpu/nvgpu/include/nvgpu/linux/cond.h
new file mode 100644
index 00000000..01ca5291
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/linux/cond.h
@@ -0,0 +1,80 @@
1/*
2 * Copyright (c) 2017, 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#ifndef __NVGPU_COND_LINUX_H__
18#define __NVGPU_COND_LINUX_H__
19
20#include <linux/wait.h>
21
22struct nvgpu_cond {
23 bool initialized;
24 wait_queue_head_t wq;
25};
26
27/**
28 * NVGPU_COND_WAIT - Wait for a condition to be true
29 *
30 * @c - The condition variable to sleep on
31 * @condition - The condition that needs to be true
32 * @timeout_ms - Timeout in milliseconds, or 0 for infinite wait
33 *
34 * Wait for a condition to become true. Returns -ETIMEOUT if
35 * the wait timed out with condition false.
36 */
37#define NVGPU_COND_WAIT(c, condition, timeout_ms) \
38({\
39 int ret = 0; \
40 long _timeout_ms = timeout_ms;\
41 if (_timeout_ms > 0) { \
42 long _ret = wait_event_timeout((c)->wq, condition, \
43 msecs_to_jiffies(_timeout_ms)); \
44 if (_ret == 0) \
45 ret = -ETIMEDOUT; \
46 } else { \
47 wait_event((c)->wq, condition); \
48 } \
49 ret;\
50})
51
52/**
53 * NVGPU_COND_WAIT_INTERRUPTIBLE - Wait for a condition to be true
54 *
55 * @c - The condition variable to sleep on
56 * @condition - The condition that needs to be true
57 * @timeout_ms - Timeout in milliseconds, or 0 for infinite wait
58 *
59 * Wait for a condition to become true. Returns -ETIMEOUT if
60 * the wait timed out with condition false or -ERESTARTSYS on
61 * signal.
62 */
63#define NVGPU_COND_WAIT_INTERRUPTIBLE(c, condition, timeout_ms) \
64({ \
65 int ret = 0; \
66 long _timeout_ms = timeout_ms;\
67 if (_timeout_ms > 0) { \
68 long _ret = wait_event_interruptible_timeout((c)->wq, condition, \
69 msecs_to_jiffies(_timeout_ms)); \
70 if (_ret == 0) \
71 ret = -ETIMEDOUT; \
72 else if (_ret == -ERESTARTSYS) \
73 ret = -ERESTARTSYS; \
74 } else { \
75 wait_event_interruptible((c)->wq, condition); \
76 } \
77 ret; \
78})
79
80#endif /* __NVGPU_LOCK_LINUX_H__ */
diff --git a/drivers/gpu/nvgpu/include/nvgpu/linux/dma.h b/drivers/gpu/nvgpu/include/nvgpu/linux/dma.h
new file mode 100644
index 00000000..342b278e
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/linux/dma.h
@@ -0,0 +1,38 @@
1/*
2 * Copyright (c) 2017, 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#ifndef __NVGPU_LINUX_DMA_H__
18#define __NVGPU_LINUX_DMA_H__
19
20/**
21 * Functions used internally for building the backing SGTs for nvgpu_mems.
22 */
23
24
25int nvgpu_get_sgtable_attrs(struct gk20a *g, struct sg_table **sgt,
26 void *cpuva, u64 iova,
27 size_t size, unsigned long flags);
28
29int nvgpu_get_sgtable(struct gk20a *g, struct sg_table **sgt,
30 void *cpuva, u64 iova, size_t size);
31
32int nvgpu_get_sgtable_from_pages(struct gk20a *g, struct sg_table **sgt,
33 struct page **pages, u64 iova,
34 size_t size);
35
36void nvgpu_free_sgtable(struct gk20a *g, struct sg_table **sgt);
37
38#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/linux/kmem.h b/drivers/gpu/nvgpu/include/nvgpu/linux/kmem.h
new file mode 100644
index 00000000..611854f2
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/linux/kmem.h
@@ -0,0 +1,50 @@
1/*
2 * Copyright (c) 2017, 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#ifndef __NVGPU_KMEM_LINUX_H__
18#define __NVGPU_KMEM_LINUX_H__
19
20struct gk20a;
21struct device;
22
23#ifdef CONFIG_NVGPU_TRACK_MEM_USAGE
24void *__nvgpu_track_vmalloc(struct gk20a *g, unsigned long size,
25 unsigned long ip);
26void *__nvgpu_track_vzalloc(struct gk20a *g, unsigned long size,
27 unsigned long ip);
28void *__nvgpu_track_kmalloc(struct gk20a *g, size_t size, unsigned long ip);
29void *__nvgpu_track_kzalloc(struct gk20a *g, size_t size, unsigned long ip);
30void *__nvgpu_track_kcalloc(struct gk20a *g, size_t n, size_t size,
31 unsigned long ip);
32void __nvgpu_track_vfree(struct gk20a *g, void *addr);
33void __nvgpu_track_kfree(struct gk20a *g, void *addr);
34#endif
35
36/**
37 * DOC: Linux pass through kmem implementation.
38 *
39 * These are the Linux implementations of the various kmem functions defined by
40 * nvgpu. This should not be included directly - instead include <nvgpu/kmem.h>.
41 */
42void *__nvgpu_kmalloc(struct gk20a *g, size_t size, unsigned long ip);
43void *__nvgpu_kzalloc(struct gk20a *g, size_t size, unsigned long ip);
44void *__nvgpu_kcalloc(struct gk20a *g, size_t n, size_t size, unsigned long ip);
45void *__nvgpu_vmalloc(struct gk20a *g, unsigned long size, unsigned long ip);
46void *__nvgpu_vzalloc(struct gk20a *g, unsigned long size, unsigned long ip);
47void __nvgpu_kfree(struct gk20a *g, void *addr);
48void __nvgpu_vfree(struct gk20a *g, void *addr);
49
50#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/linux/lock.h b/drivers/gpu/nvgpu/include/nvgpu/linux/lock.h
new file mode 100644
index 00000000..fbf26e9d
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/linux/lock.h
@@ -0,0 +1,81 @@
1/*
2 * Copyright (c) 2017, 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#ifndef NVGPU_LOCK_LINUX_H
18#define NVGPU_LOCK_LINUX_H
19
20#include <linux/mutex.h>
21#include <linux/spinlock.h>
22
23struct nvgpu_mutex {
24 struct mutex mutex;
25};
26struct nvgpu_spinlock {
27 spinlock_t spinlock;
28};
29struct nvgpu_raw_spinlock {
30 raw_spinlock_t spinlock;
31};
32
33static inline int nvgpu_mutex_init(struct nvgpu_mutex *mutex)
34{
35 mutex_init(&mutex->mutex);
36 return 0;
37};
38static inline void nvgpu_mutex_acquire(struct nvgpu_mutex *mutex)
39{
40 mutex_lock(&mutex->mutex);
41};
42static inline void nvgpu_mutex_release(struct nvgpu_mutex *mutex)
43{
44 mutex_unlock(&mutex->mutex);
45};
46static inline int nvgpu_mutex_tryacquire(struct nvgpu_mutex *mutex)
47{
48 return mutex_trylock(&mutex->mutex);
49};
50static inline void nvgpu_mutex_destroy(struct nvgpu_mutex *mutex)
51{
52 mutex_destroy(&mutex->mutex);
53};
54
55static inline void nvgpu_spinlock_init(struct nvgpu_spinlock *spinlock)
56{
57 spin_lock_init(&spinlock->spinlock);
58};
59static inline void nvgpu_spinlock_acquire(struct nvgpu_spinlock *spinlock)
60{
61 spin_lock(&spinlock->spinlock);
62};
63static inline void nvgpu_spinlock_release(struct nvgpu_spinlock *spinlock)
64{
65 spin_unlock(&spinlock->spinlock);
66};
67
68static inline void nvgpu_raw_spinlock_init(struct nvgpu_raw_spinlock *spinlock)
69{
70 raw_spin_lock_init(&spinlock->spinlock);
71};
72static inline void nvgpu_raw_spinlock_acquire(struct nvgpu_raw_spinlock *spinlock)
73{
74 raw_spin_lock(&spinlock->spinlock);
75};
76static inline void nvgpu_raw_spinlock_release(struct nvgpu_raw_spinlock *spinlock)
77{
78 raw_spin_unlock(&spinlock->spinlock);
79};
80
81#endif /* NVGPU_LOCK_LINUX_H */
diff --git a/drivers/gpu/nvgpu/include/nvgpu/linux/nvgpu_mem.h b/drivers/gpu/nvgpu/include/nvgpu/linux/nvgpu_mem.h
new file mode 100644
index 00000000..e5f5031a
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/linux/nvgpu_mem.h
@@ -0,0 +1,89 @@
1/*
2 * Copyright (c) 2017, 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#ifndef __NVGPU_LINUX_NVGPU_MEM_H__
18#define __NVGPU_LINUX_NVGPU_MEM_H__
19
20struct page;
21struct sg_table;
22struct scatterlist;
23struct nvgpu_sgt;
24
25struct gk20a;
26struct nvgpu_mem;
27struct nvgpu_gmmu_attrs;
28
29struct nvgpu_mem_priv {
30 struct page **pages;
31 struct sg_table *sgt;
32 unsigned long flags;
33};
34
35u64 nvgpu_mem_get_addr_sgl(struct gk20a *g, struct scatterlist *sgl);
36struct nvgpu_sgt *nvgpu_mem_linux_sgt_create(struct gk20a *g,
37 struct sg_table *sgt);
38void nvgpu_mem_linux_sgt_free(struct gk20a *g, struct nvgpu_sgt *sgt);
39struct nvgpu_sgt *nvgpu_linux_sgt_create(struct gk20a *g,
40 struct sg_table *sgt);
41/**
42 * __nvgpu_mem_create_from_pages - Create an nvgpu_mem from physical pages.
43 *
44 * @g - The GPU.
45 * @dest - nvgpu_mem to initialize.
46 * @pages - A list of page pointers.
47 * @nr_pages - The number of pages in @pages.
48 *
49 * Create a new nvgpu_mem struct from a pre-existing list of physical pages. The
50 * pages need not be contiguous (the underlying scatter gather list will help
51 * with that). However, note, this API will explicitly make it so that the GMMU
52 * mapping code bypasses SMMU access for the passed pages. This allows one to
53 * make mem_descs that describe MMIO regions or other non-DRAM things.
54 *
55 * This only works for SYSMEM (or other things like SYSMEM - basically just not
56 * VIDMEM). Also, this API is only available for Linux as it heavily depends on
57 * the notion of struct %page.
58 *
59 * The resulting nvgpu_mem should be released with the nvgpu_dma_free() or the
60 * nvgpu_dma_unmap_free() function depending on whether or not the resulting
61 * nvgpu_mem has been mapped. The underlying pages themselves must be cleaned up
62 * by the caller of this API.
63 *
64 * Returns 0 on success, or a relevant error otherwise.
65 */
66int __nvgpu_mem_create_from_pages(struct gk20a *g, struct nvgpu_mem *dest,
67 struct page **pages, int nr_pages);
68
69/**
70 * __nvgpu_mem_create_from_phys - Create an nvgpu_mem from physical mem.
71 *
72 * @g - The GPU.
73 * @dest - nvgpu_mem to initialize.
74 * @src_phys - start address of physical mem
75 * @nr_pages - The number of pages in phys.
76 *
77 * Create a new nvgpu_mem struct from a physical memory aperure. The physical
78 * memory aperture needs to be contiguous for requested @nr_pages. This API
79 * only works for SYSMEM.
80 *
81 * The resulting nvgpu_mem should be released with the nvgpu_dma_free() or the
82 * nvgpu_dma_unmap_free() function depending on whether or not the resulting
83 * nvgpu_mem has been mapped.
84 *
85 * Returns 0 on success, or a relevant error otherwise.
86 */
87int __nvgpu_mem_create_from_phys(struct gk20a *g, struct nvgpu_mem *dest,
88 u64 src_phys, int nr_pages);
89#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/linux/rwsem.h b/drivers/gpu/nvgpu/include/nvgpu/linux/rwsem.h
new file mode 100644
index 00000000..7d073d39
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/linux/rwsem.h
@@ -0,0 +1,26 @@
1/*
2 * Copyright (c) 2017, 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#ifndef __NVGPU_RWSEM_LINUX_H__
18#define __NVGPU_RWSEM_LINUX_H__
19
20#include <linux/rwsem.h>
21
22struct nvgpu_rwsem {
23 struct rw_semaphore rwsem;
24};
25
26#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/linux/thread.h b/drivers/gpu/nvgpu/include/nvgpu/linux/thread.h
new file mode 100644
index 00000000..1355319c
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/linux/thread.h
@@ -0,0 +1,29 @@
1/*
2 * Copyright (c) 2017, 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#ifndef __NVGPU_THREAD_LINUX_H__
18#define __NVGPU_THREAD_LINUX_H__
19
20struct task_struct;
21
22struct nvgpu_thread {
23 struct task_struct *task;
24 bool running;
25 int (*fn)(void *);
26 void *data;
27};
28
29#endif /* __NVGPU_THREAD_LINUX_H__ */
diff --git a/drivers/gpu/nvgpu/include/nvgpu/linux/vidmem.h b/drivers/gpu/nvgpu/include/nvgpu/linux/vidmem.h
new file mode 100644
index 00000000..ec02faec
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/linux/vidmem.h
@@ -0,0 +1,77 @@
1/*
2 * Copyright (c) 2017, 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#ifndef __NVGPU_LINUX_VIDMEM_H__
18#define __NVGPU_LINUX_VIDMEM_H__
19
20#include <nvgpu/types.h>
21
22struct dma_buf;
23
24struct gk20a;
25
26#ifdef CONFIG_GK20A_VIDMEM
27
28struct gk20a *nvgpu_vidmem_buf_owner(struct dma_buf *dmabuf);
29int nvgpu_vidmem_export_linux(struct gk20a *g, size_t bytes);
30
31void nvgpu_vidmem_set_page_alloc(struct scatterlist *sgl, u64 addr);
32struct nvgpu_page_alloc *nvgpu_vidmem_get_page_alloc(struct scatterlist *sgl);
33
34int nvgpu_vidmem_buf_access_memory(struct gk20a *g, struct dma_buf *dmabuf,
35 void *buffer, u64 offset, u64 size, u32 cmd);
36
37#else /* !CONFIG_GK20A_VIDMEM */
38
39static inline struct gk20a *nvgpu_vidmem_buf_owner(struct dma_buf *dmabuf)
40{
41 return NULL;
42}
43
44static inline int nvgpu_vidmem_export_linux(struct gk20a *g, size_t bytes)
45{
46 return -ENOSYS;
47}
48
49static inline void nvgpu_vidmem_set_page_alloc(struct scatterlist *sgl,
50 u64 addr)
51{
52}
53
54static inline struct nvgpu_page_alloc *nvgpu_vidmem_get_page_alloc(
55 struct scatterlist *sgl)
56{
57 return NULL;
58}
59
60static inline int nvgpu_vidmem_buf_access_memory(struct gk20a *g,
61 struct dma_buf *dmabuf,
62 void *buffer, u64 offset,
63 u64 size, u32 cmd)
64{
65 return -ENOSYS;
66}
67
68#endif
69
70
71struct nvgpu_vidmem_linux {
72 struct dma_buf *dmabuf;
73 void *dmabuf_priv;
74 void (*dmabuf_priv_delete)(void *);
75};
76
77#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/linux/vm.h b/drivers/gpu/nvgpu/include/nvgpu/linux/vm.h
new file mode 100644
index 00000000..d9f082af
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/linux/vm.h
@@ -0,0 +1,88 @@
1/*
2 * Copyright (c) 2017, 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#ifndef __COMMON_LINUX_VM_PRIV_H__
18#define __COMMON_LINUX_VM_PRIV_H__
19
20#include <nvgpu/types.h>
21
22#include <asm/cacheflush.h>
23
24/*
25 * Couple of places explicitly flush caches still. Any DMA buffer we allocate
26 * from within the GPU is writecombine and as a result does not need this but
27 * there seem to be exceptions.
28 */
29#ifdef CONFIG_ARM64
30#define outer_flush_range(a, b)
31#define __cpuc_flush_dcache_area __flush_dcache_area
32#endif
33
34struct sg_table;
35struct dma_buf;
36struct device;
37
38struct vm_gk20a;
39struct vm_gk20a_mapping_batch;
40struct nvgpu_vm_area;
41
42struct nvgpu_os_buffer {
43 struct dma_buf *dmabuf;
44 struct device *dev;
45};
46
47struct nvgpu_mapped_buf_priv {
48 struct dma_buf *dmabuf;
49 struct sg_table *sgt;
50};
51
52/* NVGPU_AS_MAP_BUFFER_FLAGS_DIRECT_KIND_CTRL must be set */
53int nvgpu_vm_map_linux(struct vm_gk20a *vm,
54 struct dma_buf *dmabuf,
55 u64 offset_align,
56 u32 flags,
57 s16 compr_kind,
58 s16 incompr_kind,
59 int rw_flag,
60 u64 buffer_offset,
61 u64 mapping_size,
62 struct vm_gk20a_mapping_batch *mapping_batch,
63 u64 *gpu_va);
64
65/*
66 * Notes:
67 * - Batch may be NULL if map op is not part of a batch.
68 * - NVGPU_AS_MAP_BUFFER_FLAGS_DIRECT_KIND_CTRL must be set
69 */
70int nvgpu_vm_map_buffer(struct vm_gk20a *vm,
71 int dmabuf_fd,
72 u64 *offset_align,
73 u32 flags, /* NVGPU_AS_MAP_BUFFER_FLAGS_ */
74 s16 compr_kind,
75 s16 incompr_kind,
76 u64 buffer_offset,
77 u64 mapping_size,
78 struct vm_gk20a_mapping_batch *batch);
79
80/* find buffer corresponding to va */
81int nvgpu_vm_find_buf(struct vm_gk20a *vm, u64 gpu_va,
82 struct dma_buf **dmabuf,
83 u64 *offset);
84
85enum nvgpu_aperture gk20a_dmabuf_aperture(struct gk20a *g,
86 struct dma_buf *dmabuf);
87
88#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/list.h b/drivers/gpu/nvgpu/include/nvgpu/list.h
new file mode 100644
index 00000000..a7e13cab
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/list.h
@@ -0,0 +1,103 @@
1/*
2 * Copyright (c) 2017, 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#ifndef NVGPU_LIST_H
24#define NVGPU_LIST_H
25
26struct nvgpu_list_node {
27 struct nvgpu_list_node *prev;
28 struct nvgpu_list_node *next;
29};
30
31static inline void nvgpu_init_list_node(struct nvgpu_list_node *node)
32{
33 node->prev = node;
34 node->next = node;
35}
36
37static inline void nvgpu_list_add(struct nvgpu_list_node *new_node, struct nvgpu_list_node *head)
38{
39 new_node->next = head->next;
40 new_node->next->prev = new_node;
41 new_node->prev = head;
42 head->next = new_node;
43}
44
45static inline void nvgpu_list_add_tail(struct nvgpu_list_node *new_node, struct nvgpu_list_node *head)
46{
47 new_node->prev = head->prev;
48 new_node->prev->next = new_node;
49 new_node->next = head;
50 head->prev = new_node;
51}
52
53static inline void nvgpu_list_del(struct nvgpu_list_node *node)
54{
55 node->prev->next = node->next;
56 node->next->prev = node->prev;
57 nvgpu_init_list_node(node);
58}
59
60static inline int nvgpu_list_empty(struct nvgpu_list_node *head)
61{
62 return head->next == head;
63}
64
65static inline void nvgpu_list_move(struct nvgpu_list_node *node, struct nvgpu_list_node *head)
66{
67 nvgpu_list_del(node);
68 nvgpu_list_add(node, head);
69}
70
71static inline void nvgpu_list_replace_init(struct nvgpu_list_node *old_node, struct nvgpu_list_node *new_node)
72{
73 new_node->next = old_node->next;
74 new_node->next->prev = new_node;
75 new_node->prev = old_node->prev;
76 new_node->prev->next = new_node;
77 nvgpu_init_list_node(old_node);
78}
79
80#define nvgpu_list_entry(ptr, type, member) \
81 type ## _from_ ## member(ptr)
82
83#define nvgpu_list_next_entry(pos, type, member) \
84 nvgpu_list_entry((pos)->member.next, type, member)
85
86#define nvgpu_list_first_entry(ptr, type, member) \
87 nvgpu_list_entry((ptr)->next, type, member)
88
89#define nvgpu_list_last_entry(ptr, type, member) \
90 nvgpu_list_entry((ptr)->prev, type, member)
91
92#define nvgpu_list_for_each_entry(pos, head, type, member) \
93 for (pos = nvgpu_list_first_entry(head, type, member); \
94 &pos->member != (head); \
95 pos = nvgpu_list_next_entry(pos, type, member))
96
97#define nvgpu_list_for_each_entry_safe(pos, n, head, type, member) \
98 for (pos = nvgpu_list_first_entry(head, type, member), \
99 n = nvgpu_list_next_entry(pos, type, member); \
100 &pos->member != (head); \
101 pos = n, n = nvgpu_list_next_entry(n, type, member))
102
103#endif /* NVGPU_LIST_H */
diff --git a/drivers/gpu/nvgpu/include/nvgpu/lock.h b/drivers/gpu/nvgpu/include/nvgpu/lock.h
new file mode 100644
index 00000000..bccded57
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/lock.h
@@ -0,0 +1,73 @@
1/*
2 * Copyright (c) 2017, 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#ifndef NVGPU_LOCK_H
24#define NVGPU_LOCK_H
25
26#ifdef __KERNEL__
27#include <nvgpu/linux/lock.h>
28#else
29#include <nvgpu_rmos/include/lock.h>
30#endif
31
32/*
33 * struct nvgpu_mutex
34 *
35 * Should be implemented per-OS in a separate library
36 * But implementation should adhere to mutex implementation
37 * as specified in Linux Documentation
38 */
39struct nvgpu_mutex;
40
41/*
42 * struct nvgpu_spinlock
43 *
44 * Should be implemented per-OS in a separate library
45 * But implementation should adhere to spinlock implementation
46 * as specified in Linux Documentation
47 */
48struct nvgpu_spinlock;
49
50/*
51 * struct nvgpu_raw_spinlock
52 *
53 * Should be implemented per-OS in a separate library
54 * But implementation should adhere to raw_spinlock implementation
55 * as specified in Linux Documentation
56 */
57struct nvgpu_raw_spinlock;
58
59int nvgpu_mutex_init(struct nvgpu_mutex *mutex);
60void nvgpu_mutex_acquire(struct nvgpu_mutex *mutex);
61void nvgpu_mutex_release(struct nvgpu_mutex *mutex);
62int nvgpu_mutex_tryacquire(struct nvgpu_mutex *mutex);
63void nvgpu_mutex_destroy(struct nvgpu_mutex *mutex);
64
65void nvgpu_spinlock_init(struct nvgpu_spinlock *spinlock);
66void nvgpu_spinlock_acquire(struct nvgpu_spinlock *spinlock);
67void nvgpu_spinlock_release(struct nvgpu_spinlock *spinlock);
68
69void nvgpu_raw_spinlock_init(struct nvgpu_raw_spinlock *spinlock);
70void nvgpu_raw_spinlock_acquire(struct nvgpu_raw_spinlock *spinlock);
71void nvgpu_raw_spinlock_release(struct nvgpu_raw_spinlock *spinlock);
72
73#endif /* NVGPU_LOCK_H */
diff --git a/drivers/gpu/nvgpu/include/nvgpu/log.h b/drivers/gpu/nvgpu/include/nvgpu/log.h
new file mode 100644
index 00000000..65f86198
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/log.h
@@ -0,0 +1,183 @@
1/*
2 * Copyright (c) 2017, 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#ifndef __NVGPU_DEBUGGING_H__
24#define __NVGPU_DEBUGGING_H__
25
26#include <nvgpu/types.h>
27#include <nvgpu/bitops.h>
28
29struct gk20a;
30
31enum nvgpu_log_type {
32 NVGPU_ERROR,
33 NVGPU_WARNING,
34 NVGPU_DEBUG,
35 NVGPU_INFO,
36};
37
38/*
39 * Each OS must implement these functions. They handle the OS specific nuances
40 * of printing data to a UART, log, whatever.
41 */
42__attribute__((format (printf, 5, 6)))
43void __nvgpu_log_msg(struct gk20a *g, const char *func_name, int line,
44 enum nvgpu_log_type type, const char *fmt, ...);
45
46__attribute__((format (printf, 5, 6)))
47void __nvgpu_log_dbg(struct gk20a *g, u32 log_mask,
48 const char *func_name, int line,
49 const char *fmt, ...);
50
51/*
52 * Use this define to set a default mask.
53 */
54#define NVGPU_DEFAULT_DBG_MASK (0)
55
56enum nvgpu_log_categories {
57 gpu_dbg_info = BIT(0), /* Lightly verbose info. */
58 gpu_dbg_fn = BIT(1), /* Function name tracing. */
59 gpu_dbg_reg = BIT(2), /* Register accesses; very verbose. */
60 gpu_dbg_pte = BIT(3), /* GMMU PTEs. */
61 gpu_dbg_intr = BIT(4), /* Interrupts. */
62 gpu_dbg_pmu = BIT(5), /* gk20a pmu. */
63 gpu_dbg_clk = BIT(6), /* gk20a clk. */
64 gpu_dbg_map = BIT(7), /* Memory mappings. */
65 gpu_dbg_map_v = BIT(8), /* Verbose mem mappings. */
66 gpu_dbg_gpu_dbg = BIT(9), /* GPU debugger/profiler. */
67 gpu_dbg_cde = BIT(10), /* cde info messages. */
68 gpu_dbg_cde_ctx = BIT(11), /* cde context usage messages. */
69 gpu_dbg_ctxsw = BIT(12), /* ctxsw tracing. */
70 gpu_dbg_sched = BIT(13), /* Sched control tracing. */
71 gpu_dbg_sema = BIT(14), /* Semaphore debugging. */
72 gpu_dbg_sema_v = BIT(15), /* Verbose semaphore debugging. */
73 gpu_dbg_pmu_pstate = BIT(16), /* p state controlled by pmu. */
74 gpu_dbg_xv = BIT(17), /* XVE debugging. */
75 gpu_dbg_shutdown = BIT(18), /* GPU shutdown tracing. */
76 gpu_dbg_kmem = BIT(19), /* Kmem tracking debugging. */
77 gpu_dbg_pd_cache = BIT(20), /* PD cache traces. */
78 gpu_dbg_alloc = BIT(21), /* Allocator debugging. */
79 gpu_dbg_dma = BIT(22), /* DMA allocation prints. */
80 gpu_dbg_sgl = BIT(23), /* SGL related traces. */
81 gpu_dbg_vidmem = BIT(24), /* VIDMEM tracing. */
82 gpu_dbg_mem = BIT(31), /* memory accesses; very verbose. */
83};
84
85/**
86 * nvgpu_log_mask_enabled - Check if logging is enabled
87 *
88 * @g - The GPU.
89 * @log_mask - The mask the check against.
90 *
91 * Check if, given the passed mask, logging would actually happen. This is
92 * useful for avoiding calling the logging function many times when we know that
93 * said prints would not happen. For example for-loops of log statements in
94 * critical paths.
95 */
96int nvgpu_log_mask_enabled(struct gk20a *g, u32 log_mask);
97
98/**
99 * nvgpu_log - Print a debug message
100 *
101 * @g - The GPU.
102 * @log_mask - A mask defining when the print should happen. See enum
103 * %nvgpu_log_categories.
104 * @fmt - A format string (printf style).
105 * @arg... - Arguments for the format string.
106 *
107 * Print a message if the log_mask matches the enabled debugging.
108 */
109#define nvgpu_log(g, log_mask, fmt, arg...) \
110 __nvgpu_log_dbg(g, log_mask, __func__, __LINE__, fmt, ##arg)
111
112/**
113 * nvgpu_err - Print an error
114 *
115 * @g - The GPU.
116 * @fmt - A format string (printf style).
117 * @arg... - Arguments for the format string.
118 *
119 * Uncondtionally print an error message.
120 */
121#define nvgpu_err(g, fmt, arg...) \
122 __nvgpu_log_msg(g, __func__, __LINE__, NVGPU_ERROR, fmt, ##arg)
123
124/**
125 * nvgpu_err - Print a warning
126 *
127 * @g - The GPU.
128 * @fmt - A format string (printf style).
129 * @arg... - Arguments for the format string.
130 *
131 * Uncondtionally print a warming message.
132 */
133#define nvgpu_warn(g, fmt, arg...) \
134 __nvgpu_log_msg(g, __func__, __LINE__, NVGPU_WARNING, fmt, ##arg)
135
136/**
137 * nvgpu_info - Print an info message
138 *
139 * @g - The GPU.
140 * @fmt - A format string (printf style).
141 * @arg... - Arguments for the format string.
142 *
143 * Unconditionally print an information message.
144 */
145#define nvgpu_info(g, fmt, arg...) \
146 __nvgpu_log_msg(g, __func__, __LINE__, NVGPU_INFO, fmt, ##arg)
147
148/*
149 * Some convenience macros.
150 */
151#define nvgpu_log_fn(g, fmt, arg...) nvgpu_log(g, gpu_dbg_fn, fmt, ##arg)
152#define nvgpu_log_info(g, fmt, arg...) nvgpu_log(g, gpu_dbg_info, fmt, ##arg)
153
154/******************************************************************************
155 * The old legacy debugging API minus some parts that are unnecessary. *
156 * Please, please, please do not use this!!! This is still around to aid *
157 * transitioning to the new API. *
158 * *
159 * This changes up the print formats to be closer to the new APIs formats. *
160 * Also it removes the dev_warn() and dev_err() usage. Those arguments are *
161 * ignored now. *
162 ******************************************************************************/
163
164/*
165 * This exist for backwards compatibility with the old debug/logging API. If you
166 * want ftrace support use the new API!
167 */
168extern u32 nvgpu_dbg_mask;
169
170#define gk20a_dbg(log_mask, fmt, arg...) \
171 do { \
172 if (((log_mask) & nvgpu_dbg_mask) != 0) \
173 __nvgpu_log_msg(NULL, __func__, __LINE__, \
174 NVGPU_DEBUG, fmt "\n", ##arg); \
175 } while (0)
176
177/*
178 * Some convenience macros.
179 */
180#define gk20a_dbg_fn(fmt, arg...) gk20a_dbg(gpu_dbg_fn, fmt, ##arg)
181#define gk20a_dbg_info(fmt, arg...) gk20a_dbg(gpu_dbg_info, fmt, ##arg)
182
183#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/log2.h b/drivers/gpu/nvgpu/include/nvgpu/log2.h
new file mode 100644
index 00000000..827162f8
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/log2.h
@@ -0,0 +1,29 @@
1/*
2 * Copyright (c) 2017, 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#ifndef __NVGPU_LOG2_H__
23#define __NVGPU_LOG2_H__
24
25#ifdef __KERNEL__
26#include <linux/log2.h>
27#endif
28
29#endif /* __NVGPU_LOG2_H__ */
diff --git a/drivers/gpu/nvgpu/include/nvgpu/ltc.h b/drivers/gpu/nvgpu/include/nvgpu/ltc.h
new file mode 100644
index 00000000..60aa5424
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/ltc.h
@@ -0,0 +1,34 @@
1/*
2 * Copyright (c) 2017, 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#ifndef __NVGPU_LTC_H__
24#define __NVGPU_LTC_H__
25
26#include <nvgpu/types.h>
27
28struct gk20a;
29
30int nvgpu_init_ltc_support(struct gk20a *g);
31void nvgpu_ltc_sync_enabled(struct gk20a *g);
32int nvgpu_ltc_alloc_cbc(struct gk20a *g, size_t compbit_backing_size);
33
34#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/mm.h b/drivers/gpu/nvgpu/include/nvgpu/mm.h
new file mode 100644
index 00000000..9882b31e
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/mm.h
@@ -0,0 +1,222 @@
1/*
2 * Permission is hereby granted, free of charge, to any person obtaining a
3 * copy of this software and associated documentation files (the "Software"),
4 * to deal in the Software without restriction, including without limitation
5 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
6 * and/or sell copies of the Software, and to permit persons to whom the
7 * Software is furnished to do so, subject to the following conditions:
8 *
9 * The above copyright notice and this permission notice shall be included in
10 * all copies or substantial portions of the Software.
11 *
12 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
15 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
17 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
18 * DEALINGS IN THE SOFTWARE.
19 */
20
21#ifndef __NVGPU_MM_H__
22#define __NVGPU_MM_H__
23
24#include <nvgpu/types.h>
25#include <nvgpu/cond.h>
26#include <nvgpu/thread.h>
27#include <nvgpu/lock.h>
28#include <nvgpu/atomic.h>
29#include <nvgpu/nvgpu_mem.h>
30#include <nvgpu/allocator.h>
31#include <nvgpu/list.h>
32
33struct gk20a;
34struct vm_gk20a;
35struct nvgpu_mem;
36struct nvgpu_pd_cache;
37
38#define FAULT_TYPE_NUM 2 /* replay and nonreplay faults */
39
40struct mmu_fault_info {
41 u64 inst_ptr;
42 u32 inst_aperture;
43 u64 fault_addr;
44 u32 fault_addr_aperture;
45 u32 timestamp_lo;
46 u32 timestamp_hi;
47 u32 mmu_engine_id;
48 u32 gpc_id;
49 u32 client_type;
50 u32 client_id;
51 u32 fault_type;
52 u32 access_type;
53 u32 protected_mode;
54 u32 replayable_fault;
55 u32 replay_fault_en;
56 u32 valid;
57 u32 faulted_pbdma;
58 u32 faulted_engine;
59 u32 faulted_subid;
60 u32 chid;
61 struct channel_gk20a *refch;
62 const char *client_type_desc;
63 const char *fault_type_desc;
64 const char *client_id_desc;
65};
66
67enum nvgpu_flush_op {
68 NVGPU_FLUSH_DEFAULT,
69 NVGPU_FLUSH_FB,
70 NVGPU_FLUSH_L2_INV,
71 NVGPU_FLUSH_L2_FLUSH,
72 NVGPU_FLUSH_CBC_CLEAN,
73};
74
75struct mm_gk20a {
76 struct gk20a *g;
77
78 /* GPU VA default sizes address spaces for channels */
79 struct {
80 u64 user_size; /* userspace-visible GPU VA region */
81 u64 kernel_size; /* kernel-only GPU VA region */
82 } channel;
83
84 struct {
85 u32 aperture_size;
86 struct vm_gk20a *vm;
87 struct nvgpu_mem inst_block;
88 } bar1;
89
90 struct {
91 u32 aperture_size;
92 struct vm_gk20a *vm;
93 struct nvgpu_mem inst_block;
94 } bar2;
95
96 struct {
97 u32 aperture_size;
98 struct vm_gk20a *vm;
99 struct nvgpu_mem inst_block;
100 } pmu;
101
102 struct {
103 /* using pmu vm currently */
104 struct nvgpu_mem inst_block;
105 } hwpm;
106
107 struct {
108 struct vm_gk20a *vm;
109 struct nvgpu_mem inst_block;
110 } perfbuf;
111
112 struct {
113 struct vm_gk20a *vm;
114 } cde;
115
116 struct {
117 struct vm_gk20a *vm;
118 } ce;
119
120 struct nvgpu_pd_cache *pd_cache;
121
122 struct nvgpu_mutex l2_op_lock;
123 struct nvgpu_mutex tlb_lock;
124 struct nvgpu_mutex priv_lock;
125
126 struct nvgpu_mem bar2_desc;
127
128#ifdef CONFIG_TEGRA_19x_GPU
129 struct nvgpu_mem hw_fault_buf[FAULT_TYPE_NUM];
130 unsigned int hw_fault_buf_status[FAULT_TYPE_NUM];
131 struct mmu_fault_info *fault_info[FAULT_TYPE_NUM];
132 struct nvgpu_mutex hub_isr_mutex;
133 u32 hub_intr_types;
134#endif
135 /*
136 * Separate function to cleanup the CE since it requires a channel to
137 * be closed which must happen before fifo cleanup.
138 */
139 void (*remove_ce_support)(struct mm_gk20a *mm);
140 void (*remove_support)(struct mm_gk20a *mm);
141 bool sw_ready;
142 int physical_bits;
143 bool use_full_comp_tag_line;
144 bool ltc_enabled_current;
145 bool ltc_enabled_target;
146 bool bypass_smmu;
147 bool disable_bigpage;
148 bool has_physical_mode;
149
150 struct nvgpu_mem sysmem_flush;
151
152 u32 pramin_window;
153 struct nvgpu_spinlock pramin_window_lock;
154 bool force_pramin; /* via debugfs */
155
156 struct {
157 size_t size;
158 u64 base;
159 size_t bootstrap_size;
160 u64 bootstrap_base;
161
162 struct nvgpu_allocator allocator;
163 struct nvgpu_allocator bootstrap_allocator;
164
165 u32 ce_ctx_id;
166 volatile bool cleared;
167 struct nvgpu_mutex first_clear_mutex;
168
169 struct nvgpu_list_node clear_list_head;
170 struct nvgpu_mutex clear_list_mutex;
171
172 struct nvgpu_cond clearing_thread_cond;
173 struct nvgpu_thread clearing_thread;
174 struct nvgpu_mutex clearing_thread_lock;
175 nvgpu_atomic_t pause_count;
176
177 nvgpu_atomic64_t bytes_pending;
178 } vidmem;
179};
180
181#define gk20a_from_mm(mm) ((mm)->g)
182#define gk20a_from_vm(vm) ((vm)->mm->g)
183
184static inline int bar1_aperture_size_mb_gk20a(void)
185{
186 return 16; /* 16MB is more than enough atm. */
187}
188
189/* The maximum GPU VA range supported */
190#define NV_GMMU_VA_RANGE 38
191
192/* The default userspace-visible GPU VA size */
193#define NV_MM_DEFAULT_USER_SIZE (1ULL << 37)
194
195/* The default kernel-reserved GPU VA size */
196#define NV_MM_DEFAULT_KERNEL_SIZE (1ULL << 32)
197
198/*
199 * When not using unified address spaces, the bottom 56GB of the space are used
200 * for small pages, and the remaining high memory is used for large pages.
201 */
202static inline u64 __nv_gmmu_va_small_page_limit(void)
203{
204 return ((u64)SZ_1G * 56);
205}
206
207enum gmmu_pgsz_gk20a __get_pte_size_fixed_map(struct vm_gk20a *vm,
208 u64 base, u64 size);
209enum gmmu_pgsz_gk20a __get_pte_size(struct vm_gk20a *vm, u64 base, u64 size);
210
211void nvgpu_init_mm_ce_context(struct gk20a *g);
212int nvgpu_init_mm_support(struct gk20a *g);
213int nvgpu_init_mm_setup_hw(struct gk20a *g);
214
215u64 nvgpu_inst_block_addr(struct gk20a *g, struct nvgpu_mem *mem);
216void nvgpu_free_inst_block(struct gk20a *g, struct nvgpu_mem *inst_block);
217
218int nvgpu_mm_suspend(struct gk20a *g);
219u32 nvgpu_mm_get_default_big_page_size(struct gk20a *g);
220u32 nvgpu_mm_get_available_big_page_sizes(struct gk20a *g);
221
222#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/nvgpu_common.h b/drivers/gpu/nvgpu/include/nvgpu/nvgpu_common.h
new file mode 100644
index 00000000..50e8c8f1
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/nvgpu_common.h
@@ -0,0 +1,34 @@
1/*
2 * Copyright (c) 2016-2017, 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#ifndef NVGPU_COMMON_H
24#define NVGPU_COMMON_H
25
26struct gk20a;
27struct class;
28
29int nvgpu_probe(struct gk20a *g,
30 const char *debugfs_symlink,
31 const char *interface_name,
32 struct class *class);
33
34#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/nvgpu_mem.h b/drivers/gpu/nvgpu/include/nvgpu/nvgpu_mem.h
new file mode 100644
index 00000000..2b8b7015
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/nvgpu_mem.h
@@ -0,0 +1,331 @@
1/*
2 * Copyright (c) 2017, 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#ifndef __NVGPU_NVGPU_MEM_H__
24#define __NVGPU_NVGPU_MEM_H__
25
26#include <nvgpu/types.h>
27#include <nvgpu/list.h>
28
29#ifdef __KERNEL__
30#include <nvgpu/linux/nvgpu_mem.h>
31#else
32#include <nvgpu_rmos/include/nvgpu_mem.h>
33#endif
34
35struct page;
36struct sg_table;
37struct nvgpu_sgt;
38
39struct gk20a;
40struct nvgpu_allocator;
41struct nvgpu_gmmu_attrs;
42struct nvgpu_page_alloc;
43
44#define NVGPU_MEM_DMA_ERROR (~0ULL)
45
46/*
47 * Real location of a buffer - nvgpu_aperture_mask() will deduce what will be
48 * told to the gpu about the aperture, but this flag designates where the
49 * memory actually was allocated from.
50 */
51enum nvgpu_aperture {
52 APERTURE_INVALID = 0, /* unallocated or N/A */
53 APERTURE_SYSMEM,
54 APERTURE_VIDMEM
55};
56
57struct nvgpu_sgt_ops {
58 void *(*sgl_next)(void *sgl);
59 u64 (*sgl_phys)(void *sgl);
60 u64 (*sgl_dma)(void *sgl);
61 u64 (*sgl_length)(void *sgl);
62 u64 (*sgl_gpu_addr)(struct gk20a *g, void *sgl,
63 struct nvgpu_gmmu_attrs *attrs);
64 /*
65 * If left NULL then iommuable is assumed to be false.
66 */
67 bool (*sgt_iommuable)(struct gk20a *g, struct nvgpu_sgt *sgt);
68
69 /*
70 * Note: this operates on the whole SGT not a specific SGL entry.
71 */
72 void (*sgt_free)(struct gk20a *g, struct nvgpu_sgt *sgt);
73};
74
75/*
76 * Scatter gather table: this is a list of scatter list entries and the ops for
77 * interacting with those entries.
78 */
79struct nvgpu_sgt {
80 /*
81 * Ops for interacting with the underlying scatter gather list entries.
82 */
83 const struct nvgpu_sgt_ops *ops;
84
85 /*
86 * The first node in the scatter gather list.
87 */
88 void *sgl;
89};
90
91/*
92 * This struct holds the necessary information for describing a struct
93 * nvgpu_mem's scatter gather list.
94 *
95 * Not all nvgpu_sgt's use this particular implementation. Nor is a given OS
96 * required to use this at all.
97 */
98struct nvgpu_mem_sgl {
99 /*
100 * Internally this is implemented as a singly linked list.
101 */
102 struct nvgpu_mem_sgl *next;
103
104 /*
105 * There is both a phys address and a DMA address since some systems,
106 * for example ones with an IOMMU, may see these as different addresses.
107 */
108 u64 phys;
109 u64 dma;
110 u64 length;
111};
112
113/*
114 * Iterate over the SGL entries in an SGT.
115 */
116#define nvgpu_sgt_for_each_sgl(__sgl__, __sgt__) \
117 for ((__sgl__) = (__sgt__)->sgl; \
118 (__sgl__) != NULL; \
119 (__sgl__) = nvgpu_sgt_get_next(__sgt__, __sgl__))
120
121struct nvgpu_mem {
122 /*
123 * Populated for all nvgpu_mem structs - vidmem or system.
124 */
125 enum nvgpu_aperture aperture;
126 size_t size;
127 size_t aligned_size;
128 u64 gpu_va;
129 bool skip_wmb;
130
131 /*
132 * Set when a nvgpu_mem struct is not a "real" nvgpu_mem struct. Instead
133 * the struct is just a copy of another nvgpu_mem struct.
134 */
135#define NVGPU_MEM_FLAG_SHADOW_COPY (1 << 0)
136
137 /*
138 * Specify that the GVA mapping is a fixed mapping - that is the caller
139 * chose the GPU VA, not the GMMU mapping function. Only relevant for
140 * VIDMEM.
141 */
142#define NVGPU_MEM_FLAG_FIXED (1 << 1)
143
144 /*
145 * Set for user generated VIDMEM allocations. This triggers a special
146 * cleanup path that clears the vidmem on free. Given that the VIDMEM is
147 * zeroed on boot this means that all user vidmem allocations are
148 * therefor zeroed (to prevent leaking information in VIDMEM buffers).
149 */
150#define NVGPU_MEM_FLAG_USER_MEM (1 << 2)
151
152 /*
153 * Internal flag that specifies this struct has not been made with DMA
154 * memory and as a result should not try to use the DMA routines for
155 * freeing the backing memory.
156 *
157 * However, this will not stop the DMA API from freeing other parts of
158 * nvgpu_mem in a system specific way.
159 */
160#define __NVGPU_MEM_FLAG_NO_DMA (1 << 3)
161 unsigned long mem_flags;
162
163 /*
164 * Only populated for a sysmem allocation.
165 */
166 void *cpu_va;
167
168 /*
169 * Fields only populated for vidmem allocations.
170 */
171 struct nvgpu_page_alloc *vidmem_alloc;
172 struct nvgpu_allocator *allocator;
173 struct nvgpu_list_node clear_list_entry;
174
175 /*
176 * This is defined by the system specific header. It can be empty if
177 * there's no system specific stuff for a given system.
178 */
179 struct nvgpu_mem_priv priv;
180};
181
182static inline struct nvgpu_mem *
183nvgpu_mem_from_clear_list_entry(struct nvgpu_list_node *node)
184{
185 return (struct nvgpu_mem *)
186 ((uintptr_t)node - offsetof(struct nvgpu_mem,
187 clear_list_entry));
188};
189
190static inline const char *nvgpu_aperture_str(enum nvgpu_aperture aperture)
191{
192 switch (aperture) {
193 case APERTURE_INVALID: return "INVAL";
194 case APERTURE_SYSMEM: return "SYSMEM";
195 case APERTURE_VIDMEM: return "VIDMEM";
196 };
197 return "UNKNOWN";
198}
199
200/*
201 * Returns true if the passed nvgpu_mem has been allocated (i.e it's valid for
202 * subsequent use).
203 */
204static inline bool nvgpu_mem_is_valid(struct nvgpu_mem *mem)
205{
206 /*
207 * Internally the DMA APIs must set/unset the aperture flag when
208 * allocating/freeing the buffer. So check that to see if the *mem
209 * has been allocated or not.
210 *
211 * This relies on mem_descs being zeroed before being initialized since
212 * APERTURE_INVALID is equal to 0.
213 */
214 return mem->aperture != APERTURE_INVALID;
215
216}
217
218/*
219 * Create a nvgpu_sgt of the default implementation
220 */
221struct nvgpu_sgt *nvgpu_sgt_create(struct gk20a *g);
222
223/**
224 * nvgpu_mem_sgt_create_from_mem - Create a scatter list from an nvgpu_mem.
225 *
226 * @g - The GPU.
227 * @mem - The source memory allocation to use.
228 *
229 * Create a scatter gather table from the passed @mem struct. This list lets the
230 * calling code iterate across each chunk of a DMA allocation for when that DMA
231 * allocation is not completely contiguous.
232 */
233struct nvgpu_sgt *nvgpu_sgt_create_from_mem(struct gk20a *g,
234 struct nvgpu_mem *mem);
235
236void *nvgpu_sgt_get_next(struct nvgpu_sgt *sgt, void *sgl);
237u64 nvgpu_sgt_get_phys(struct nvgpu_sgt *sgt, void *sgl);
238u64 nvgpu_sgt_get_dma(struct nvgpu_sgt *sgt, void *sgl);
239u64 nvgpu_sgt_get_length(struct nvgpu_sgt *sgt, void *sgl);
240u64 nvgpu_sgt_get_gpu_addr(struct gk20a *g, struct nvgpu_sgt *sgt, void *sgl,
241 struct nvgpu_gmmu_attrs *attrs);
242void nvgpu_sgt_free(struct gk20a *g, struct nvgpu_sgt *sgt);
243
244bool nvgpu_sgt_iommuable(struct gk20a *g, struct nvgpu_sgt *sgt);
245u64 nvgpu_sgt_alignment(struct gk20a *g, struct nvgpu_sgt *sgt);
246
247/**
248 * nvgpu_mem_create_from_mem - Create a new nvgpu_mem struct from an old one.
249 *
250 * @g - The GPU.
251 * @dest - Destination nvgpu_mem to hold resulting memory description.
252 * @src - Source memory. Must be valid.
253 * @start_page - Starting page to use.
254 * @nr_pages - Number of pages to place in the new nvgpu_mem.
255 *
256 * Create a new nvgpu_mem struct describing a subsection of the @src nvgpu_mem.
257 * This will create an nvpgu_mem object starting at @start_page and is @nr_pages
258 * long. This currently only works on SYSMEM nvgpu_mems. If this is called on a
259 * VIDMEM nvgpu_mem then this will return an error.
260 *
261 * There is a _major_ caveat to this API: if the source buffer is freed before
262 * the copy is freed then the copy will become invalid. This is a result from
263 * how typical DMA APIs work: we can't call free on the buffer multiple times.
264 * Nor can we call free on parts of a buffer. Thus the only way to ensure that
265 * the entire buffer is actually freed is to call free once on the source
266 * buffer. Since these nvgpu_mem structs are not ref-counted in anyway it is up
267 * to the caller of this API to _ensure_ that the resulting nvgpu_mem buffer
268 * from this API is freed before the source buffer. Otherwise there can and will
269 * be memory corruption.
270 *
271 * The resulting nvgpu_mem should be released with the nvgpu_dma_free() or the
272 * nvgpu_dma_unmap_free() function depending on whether or not the resulting
273 * nvgpu_mem has been mapped.
274 *
275 * This will return 0 on success. An error is returned if the resulting
276 * nvgpu_mem would not make sense or if a new scatter gather table cannot be
277 * created.
278 */
279int nvgpu_mem_create_from_mem(struct gk20a *g,
280 struct nvgpu_mem *dest, struct nvgpu_mem *src,
281 int start_page, int nr_pages);
282
283/*
284 * Really free a vidmem buffer. There's a fair amount of work involved in
285 * freeing vidmem buffers in the DMA API. This handles none of that - it only
286 * frees the underlying vidmem specific structures used in vidmem buffers.
287 *
288 * This is implemented in the OS specific code. If it's not necessary it can
289 * be a noop. But the symbol must at least be present.
290 */
291void __nvgpu_mem_free_vidmem_alloc(struct gk20a *g, struct nvgpu_mem *vidmem);
292
293/*
294 * Buffer accessors - wrap between begin() and end() if there is no permanent
295 * kernel mapping for this buffer.
296 */
297
298int nvgpu_mem_begin(struct gk20a *g, struct nvgpu_mem *mem);
299/* nop for null mem, like with free() or vunmap() */
300void nvgpu_mem_end(struct gk20a *g, struct nvgpu_mem *mem);
301
302/* word-indexed offset */
303u32 nvgpu_mem_rd32(struct gk20a *g, struct nvgpu_mem *mem, u32 w);
304/* byte offset (32b-aligned) */
305u32 nvgpu_mem_rd(struct gk20a *g, struct nvgpu_mem *mem, u32 offset);
306/* memcpy to cpu, offset and size in bytes (32b-aligned) */
307void nvgpu_mem_rd_n(struct gk20a *g, struct nvgpu_mem *mem, u32 offset,
308 void *dest, u32 size);
309
310/* word-indexed offset */
311void nvgpu_mem_wr32(struct gk20a *g, struct nvgpu_mem *mem, u32 w, u32 data);
312/* byte offset (32b-aligned) */
313void nvgpu_mem_wr(struct gk20a *g, struct nvgpu_mem *mem, u32 offset, u32 data);
314/* memcpy from cpu, offset and size in bytes (32b-aligned) */
315void nvgpu_mem_wr_n(struct gk20a *g, struct nvgpu_mem *mem, u32 offset,
316 void *src, u32 size);
317/* size and offset in bytes (32b-aligned), filled with the constant byte c */
318void nvgpu_memset(struct gk20a *g, struct nvgpu_mem *mem, u32 offset,
319 u32 c, u32 size);
320
321u64 nvgpu_mem_get_addr(struct gk20a *g, struct nvgpu_mem *mem);
322u64 nvgpu_mem_get_phys_addr(struct gk20a *g, struct nvgpu_mem *mem);
323
324u32 __nvgpu_aperture_mask(struct gk20a *g, enum nvgpu_aperture aperture,
325 u32 sysmem_mask, u32 vidmem_mask);
326u32 nvgpu_aperture_mask(struct gk20a *g, struct nvgpu_mem *mem,
327 u32 sysmem_mask, u32 vidmem_mask);
328
329u64 nvgpu_mem_iommu_translate(struct gk20a *g, u64 phys);
330
331#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/nvhost.h b/drivers/gpu/nvgpu/include/nvgpu/nvhost.h
new file mode 100644
index 00000000..536b248a
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/nvhost.h
@@ -0,0 +1,81 @@
1/*
2 * Copyright (c) 2017, 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#ifndef __NVGPU_NVHOST_H__
24#define __NVGPU_NVHOST_H__
25
26#ifdef CONFIG_TEGRA_GK20A_NVHOST
27
28struct nvgpu_nvhost_dev;
29struct gk20a;
30struct sync_pt;
31struct sync_fence;
32struct timespec;
33
34int nvgpu_get_nvhost_dev(struct gk20a *g);
35void nvgpu_free_nvhost_dev(struct gk20a *g);
36
37int nvgpu_nvhost_module_busy_ext(struct nvgpu_nvhost_dev *nvhost_dev);
38void nvgpu_nvhost_module_idle_ext(struct nvgpu_nvhost_dev *nvhost_dev);
39
40void nvgpu_nvhost_debug_dump_device(struct nvgpu_nvhost_dev *nvhost_dev);
41
42int nvgpu_nvhost_syncpt_is_expired_ext(struct nvgpu_nvhost_dev *nvhost_dev,
43 u32 id, u32 thresh);
44int nvgpu_nvhost_syncpt_wait_timeout_ext(struct nvgpu_nvhost_dev *nvhost_dev,
45 u32 id, u32 thresh, u32 timeout, u32 *value, struct timespec *ts);
46
47u32 nvgpu_nvhost_syncpt_incr_max_ext(struct nvgpu_nvhost_dev *nvhost_dev,
48 u32 id, u32 incrs);
49void nvgpu_nvhost_syncpt_set_min_eq_max_ext(struct nvgpu_nvhost_dev *nvhost_dev,
50 u32 id);
51int nvgpu_nvhost_syncpt_read_ext_check(struct nvgpu_nvhost_dev *nvhost_dev,
52 u32 id, u32 *val);
53
54int nvgpu_nvhost_intr_register_notifier(struct nvgpu_nvhost_dev *nvhost_dev,
55 u32 id, u32 thresh, void (*callback)(void *, int), void *private_data);
56
57const char *nvgpu_nvhost_syncpt_get_name(struct nvgpu_nvhost_dev *nvhost_dev,
58 int id);
59bool nvgpu_nvhost_syncpt_is_valid_pt_ext(struct nvgpu_nvhost_dev *nvhost_dev,
60 u32 id);
61void nvgpu_nvhost_syncpt_put_ref_ext(struct nvgpu_nvhost_dev *nvhost_dev,
62 u32 id);
63u32 nvgpu_nvhost_get_syncpt_host_managed(struct nvgpu_nvhost_dev *nvhost_dev,
64 u32 param,
65 const char *syncpt_name);
66
67int nvgpu_nvhost_create_symlink(struct gk20a *g);
68void nvgpu_nvhost_remove_symlink(struct gk20a *g);
69
70#ifdef CONFIG_SYNC
71u32 nvgpu_nvhost_sync_pt_id(struct sync_pt *pt);
72u32 nvgpu_nvhost_sync_pt_thresh(struct sync_pt *pt);
73int nvgpu_nvhost_sync_num_pts(struct sync_fence *fence);
74
75struct sync_fence *nvgpu_nvhost_sync_fdget(int fd);
76struct sync_fence *nvgpu_nvhost_sync_create_fence(
77 struct nvgpu_nvhost_dev *nvhost_dev,
78 u32 id, u32 thresh, u32 num_pts, const char *name);
79#endif /* CONFIG_SYNC */
80#endif /* CONFIG_TEGRA_GK20A_NVHOST */
81#endif /* __NVGPU_NVHOST_H__ */
diff --git a/drivers/gpu/nvgpu/include/nvgpu/page_allocator.h b/drivers/gpu/nvgpu/include/nvgpu/page_allocator.h
new file mode 100644
index 00000000..a6e02058
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/page_allocator.h
@@ -0,0 +1,185 @@
1/*
2 * Copyright (c) 2016-2017, 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#ifndef PAGE_ALLOCATOR_PRIV_H
24#define PAGE_ALLOCATOR_PRIV_H
25
26#include <nvgpu/allocator.h>
27#include <nvgpu/nvgpu_mem.h>
28#include <nvgpu/kmem.h>
29#include <nvgpu/list.h>
30#include <nvgpu/rbtree.h>
31
32struct nvgpu_allocator;
33
34/*
35 * This allocator implements the ability to do SLAB style allocation since the
36 * GPU has two page sizes available - 4k and 64k/128k. When the default
37 * granularity is the large page size (64k/128k) small allocations become very
38 * space inefficient. This is most notable in PDE and PTE blocks which are 4k
39 * in size.
40 *
41 * Thus we need the ability to suballocate in 64k pages. The way we do this for
42 * the GPU is as follows. We have several buckets for sub-64K allocations:
43 *
44 * B0 - 4k
45 * B1 - 8k
46 * B3 - 16k
47 * B4 - 32k
48 * B5 - 64k (for when large pages are 128k)
49 *
50 * When an allocation comes in for less than the large page size (from now on
51 * assumed to be 64k) the allocation is satisfied by one of the buckets.
52 */
53struct page_alloc_slab {
54 struct nvgpu_list_node empty;
55 struct nvgpu_list_node partial;
56 struct nvgpu_list_node full;
57
58 int nr_empty;
59 int nr_partial;
60 int nr_full;
61
62 u32 slab_size;
63};
64
65enum slab_page_state {
66 SP_EMPTY,
67 SP_PARTIAL,
68 SP_FULL,
69 SP_NONE
70};
71
72struct page_alloc_slab_page {
73 unsigned long bitmap;
74 u64 page_addr;
75 u32 slab_size;
76
77 u32 nr_objects;
78 u32 nr_objects_alloced;
79
80 enum slab_page_state state;
81
82 struct page_alloc_slab *owner;
83 struct nvgpu_list_node list_entry;
84};
85
86static inline struct page_alloc_slab_page *
87page_alloc_slab_page_from_list_entry(struct nvgpu_list_node *node)
88{
89 return (struct page_alloc_slab_page *)
90 ((uintptr_t)node - offsetof(struct page_alloc_slab_page, list_entry));
91};
92
93/*
94 * Struct to handle internal management of page allocation. It holds a list
95 * of the chunks of pages that make up the overall allocation - much like a
96 * scatter gather table.
97 */
98struct nvgpu_page_alloc {
99 /*
100 * nvgpu_sgt for describing the actual allocation. Convenient for
101 * GMMU mapping.
102 */
103 struct nvgpu_sgt sgt;
104
105 int nr_chunks;
106 u64 length;
107
108 /*
109 * Only useful for the RB tree - since the alloc may have discontiguous
110 * pages the base is essentially irrelevant except for the fact that it
111 * is guarenteed to be unique.
112 */
113 u64 base;
114
115 struct nvgpu_rbtree_node tree_entry;
116
117 /*
118 * Set if this is a slab alloc. Points back to the slab page that owns
119 * this particular allocation. nr_chunks will always be 1 if this is
120 * set.
121 */
122 struct page_alloc_slab_page *slab_page;
123};
124
125static inline struct nvgpu_page_alloc *
126nvgpu_page_alloc_from_rbtree_node(struct nvgpu_rbtree_node *node)
127{
128 return (struct nvgpu_page_alloc *)
129 ((uintptr_t)node - offsetof(struct nvgpu_page_alloc, tree_entry));
130};
131
132struct nvgpu_page_allocator {
133 struct nvgpu_allocator *owner; /* Owner of this allocator. */
134
135 /*
136 * Use a buddy allocator to manage the allocation of the underlying
137 * pages. This lets us abstract the discontiguous allocation handling
138 * out of the annoyingly complicated buddy allocator.
139 */
140 struct nvgpu_allocator source_allocator;
141
142 /*
143 * Page params.
144 */
145 u64 base;
146 u64 length;
147 u64 page_size;
148 u32 page_shift;
149
150 struct nvgpu_rbtree_node *allocs; /* Outstanding allocations. */
151
152 struct page_alloc_slab *slabs;
153 int nr_slabs;
154
155 struct nvgpu_kmem_cache *alloc_cache;
156 struct nvgpu_kmem_cache *slab_page_cache;
157
158 u64 flags;
159
160 /*
161 * Stat tracking.
162 */
163 u64 nr_allocs;
164 u64 nr_frees;
165 u64 nr_fixed_allocs;
166 u64 nr_fixed_frees;
167 u64 nr_slab_allocs;
168 u64 nr_slab_frees;
169 u64 pages_alloced;
170 u64 pages_freed;
171};
172
173static inline struct nvgpu_page_allocator *page_allocator(
174 struct nvgpu_allocator *a)
175{
176 return (struct nvgpu_page_allocator *)(a)->priv;
177}
178
179static inline struct nvgpu_allocator *palloc_owner(
180 struct nvgpu_page_allocator *a)
181{
182 return a->owner;
183}
184
185#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/pmu.h b/drivers/gpu/nvgpu/include/nvgpu/pmu.h
new file mode 100644
index 00000000..045bf34c
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/pmu.h
@@ -0,0 +1,465 @@
1/*
2 * Copyright (c) 2017, 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#ifndef __NVGPU_PMU_H__
24#define __NVGPU_PMU_H__
25
26#include <nvgpu/kmem.h>
27#include <nvgpu/nvgpu_mem.h>
28#include <nvgpu/allocator.h>
29#include <nvgpu/lock.h>
30#include <nvgpu/cond.h>
31#include <nvgpu/thread.h>
32#include <nvgpu/nvgpu_common.h>
33#include <nvgpu/flcnif_cmn.h>
34#include <nvgpu/pmuif/nvgpu_gpmu_cmdif.h>
35
36#define nvgpu_pmu_dbg(g, fmt, args...) \
37 nvgpu_log(g, gpu_dbg_pmu, fmt, ##args)
38
39/* defined by pmu hw spec */
40#define GK20A_PMU_VA_SIZE (512 * 1024 * 1024)
41#define GK20A_PMU_UCODE_SIZE_MAX (256 * 1024)
42#define GK20A_PMU_SEQ_BUF_SIZE 4096
43
44#define GK20A_PMU_TRACE_BUFSIZE 0x4000 /* 4K */
45#define GK20A_PMU_DMEM_BLKSIZE2 8
46
47#define PMU_MODE_MISMATCH_STATUS_MAILBOX_R 6
48#define PMU_MODE_MISMATCH_STATUS_VAL 0xDEADDEAD
49
50/* Falcon Register index */
51#define PMU_FALCON_REG_R0 (0)
52#define PMU_FALCON_REG_R1 (1)
53#define PMU_FALCON_REG_R2 (2)
54#define PMU_FALCON_REG_R3 (3)
55#define PMU_FALCON_REG_R4 (4)
56#define PMU_FALCON_REG_R5 (5)
57#define PMU_FALCON_REG_R6 (6)
58#define PMU_FALCON_REG_R7 (7)
59#define PMU_FALCON_REG_R8 (8)
60#define PMU_FALCON_REG_R9 (9)
61#define PMU_FALCON_REG_R10 (10)
62#define PMU_FALCON_REG_R11 (11)
63#define PMU_FALCON_REG_R12 (12)
64#define PMU_FALCON_REG_R13 (13)
65#define PMU_FALCON_REG_R14 (14)
66#define PMU_FALCON_REG_R15 (15)
67#define PMU_FALCON_REG_IV0 (16)
68#define PMU_FALCON_REG_IV1 (17)
69#define PMU_FALCON_REG_UNDEFINED (18)
70#define PMU_FALCON_REG_EV (19)
71#define PMU_FALCON_REG_SP (20)
72#define PMU_FALCON_REG_PC (21)
73#define PMU_FALCON_REG_IMB (22)
74#define PMU_FALCON_REG_DMB (23)
75#define PMU_FALCON_REG_CSW (24)
76#define PMU_FALCON_REG_CCR (25)
77#define PMU_FALCON_REG_SEC (26)
78#define PMU_FALCON_REG_CTX (27)
79#define PMU_FALCON_REG_EXCI (28)
80#define PMU_FALCON_REG_RSVD0 (29)
81#define PMU_FALCON_REG_RSVD1 (30)
82#define PMU_FALCON_REG_RSVD2 (31)
83#define PMU_FALCON_REG_SIZE (32)
84
85/* Choices for pmu_state */
86#define PMU_STATE_OFF 0 /* PMU is off */
87#define PMU_STATE_STARTING 1 /* PMU is on, but not booted */
88#define PMU_STATE_INIT_RECEIVED 2 /* PMU init message received */
89#define PMU_STATE_ELPG_BOOTING 3 /* PMU is booting */
90#define PMU_STATE_ELPG_BOOTED 4 /* ELPG is initialized */
91#define PMU_STATE_LOADING_PG_BUF 5 /* Loading PG buf */
92#define PMU_STATE_LOADING_ZBC 6 /* Loading ZBC buf */
93#define PMU_STATE_STARTED 7 /* Fully unitialized */
94#define PMU_STATE_EXIT 8 /* Exit PMU state machine */
95
96#define GK20A_PMU_UCODE_NB_MAX_OVERLAY 32
97#define GK20A_PMU_UCODE_NB_MAX_DATE_LENGTH 64
98
99#define PMU_MAX_NUM_SEQUENCES (256)
100#define PMU_SEQ_BIT_SHIFT (5)
101#define PMU_SEQ_TBL_SIZE \
102 (PMU_MAX_NUM_SEQUENCES >> PMU_SEQ_BIT_SHIFT)
103
104#define PMU_INVALID_SEQ_DESC (~0)
105
106enum {
107 GK20A_PMU_DMAIDX_UCODE = 0,
108 GK20A_PMU_DMAIDX_VIRT = 1,
109 GK20A_PMU_DMAIDX_PHYS_VID = 2,
110 GK20A_PMU_DMAIDX_PHYS_SYS_COH = 3,
111 GK20A_PMU_DMAIDX_PHYS_SYS_NCOH = 4,
112 GK20A_PMU_DMAIDX_RSVD = 5,
113 GK20A_PMU_DMAIDX_PELPG = 6,
114 GK20A_PMU_DMAIDX_END = 7
115};
116
117enum {
118 PMU_SEQ_STATE_FREE = 0,
119 PMU_SEQ_STATE_PENDING,
120 PMU_SEQ_STATE_USED,
121 PMU_SEQ_STATE_CANCELLED
122};
123
124/*PG defines used by nvpgu-pmu*/
125#define PMU_PG_IDLE_THRESHOLD_SIM 1000
126#define PMU_PG_POST_POWERUP_IDLE_THRESHOLD_SIM 4000000
127/* TBD: QT or else ? */
128#define PMU_PG_IDLE_THRESHOLD 15000
129#define PMU_PG_POST_POWERUP_IDLE_THRESHOLD 1000000
130
131#define PMU_PG_LPWR_FEATURE_RPPG 0x0
132#define PMU_PG_LPWR_FEATURE_MSCG 0x1
133
134#define PMU_MSCG_DISABLED 0
135#define PMU_MSCG_ENABLED 1
136
137/* Default Sampling Period of AELPG */
138#define APCTRL_SAMPLING_PERIOD_PG_DEFAULT_US (1000000)
139
140/* Default values of APCTRL parameters */
141#define APCTRL_MINIMUM_IDLE_FILTER_DEFAULT_US (100)
142#define APCTRL_MINIMUM_TARGET_SAVING_DEFAULT_US (10000)
143#define APCTRL_POWER_BREAKEVEN_DEFAULT_US (2000)
144#define APCTRL_CYCLES_PER_SAMPLE_MAX_DEFAULT (200)
145
146typedef void (*pmu_callback)(struct gk20a *, struct pmu_msg *, void *, u32,
147 u32);
148
149struct pmu_payload {
150 struct {
151 void *buf;
152 u32 offset;
153 u32 size;
154 u32 fb_size;
155 } in, out;
156};
157
158struct pmu_ucode_desc {
159 u32 descriptor_size;
160 u32 image_size;
161 u32 tools_version;
162 u32 app_version;
163 char date[GK20A_PMU_UCODE_NB_MAX_DATE_LENGTH];
164 u32 bootloader_start_offset;
165 u32 bootloader_size;
166 u32 bootloader_imem_offset;
167 u32 bootloader_entry_point;
168 u32 app_start_offset;
169 u32 app_size;
170 u32 app_imem_offset;
171 u32 app_imem_entry;
172 u32 app_dmem_offset;
173 /* Offset from appStartOffset */
174 u32 app_resident_code_offset;
175 /* Exact size of the resident code
176 * ( potentially contains CRC inside at the end )
177 */
178 u32 app_resident_code_size;
179 /* Offset from appStartOffset */
180 u32 app_resident_data_offset;
181 /* Exact size of the resident code
182 * ( potentially contains CRC inside at the end )
183 */
184 u32 app_resident_data_size;
185 u32 nb_overlays;
186 struct {u32 start; u32 size; } load_ovl[GK20A_PMU_UCODE_NB_MAX_OVERLAY];
187 u32 compressed;
188};
189
190struct pmu_ucode_desc_v1 {
191 u32 descriptor_size;
192 u32 image_size;
193 u32 tools_version;
194 u32 app_version;
195 char date[GK20A_PMU_UCODE_NB_MAX_DATE_LENGTH];
196 u32 bootloader_start_offset;
197 u32 bootloader_size;
198 u32 bootloader_imem_offset;
199 u32 bootloader_entry_point;
200 u32 app_start_offset;
201 u32 app_size;
202 u32 app_imem_offset;
203 u32 app_imem_entry;
204 u32 app_dmem_offset;
205 u32 app_resident_code_offset;
206 u32 app_resident_code_size;
207 u32 app_resident_data_offset;
208 u32 app_resident_data_size;
209 u32 nb_imem_overlays;
210 u32 nb_dmem_overlays;
211 struct {u32 start; u32 size; } load_ovl[64];
212 u32 compressed;
213};
214
215struct pmu_queue {
216
217 /* used by hw, for BIOS/SMI queue */
218 u32 mutex_id;
219 u32 mutex_lock;
220 /* used by sw, for LPQ/HPQ queue */
221 struct nvgpu_mutex mutex;
222
223 /* current write position */
224 u32 position;
225 /* physical dmem offset where this queue begins */
226 u32 offset;
227 /* logical queue identifier */
228 u32 id;
229 /* physical queue index */
230 u32 index;
231 /* in bytes */
232 u32 size;
233
234 /* open-flag */
235 u32 oflag;
236 bool opened; /* opened implies locked */
237};
238
239struct pmu_mutex {
240 u32 id;
241 u32 index;
242 u32 ref_cnt;
243};
244
245struct pmu_sequence {
246 u8 id;
247 u32 state;
248 u32 desc;
249 struct pmu_msg *msg;
250 union {
251 struct pmu_allocation_v0 in_v0;
252 struct pmu_allocation_v1 in_v1;
253 struct pmu_allocation_v2 in_v2;
254 struct pmu_allocation_v3 in_v3;
255 };
256 struct nvgpu_mem *in_mem;
257 union {
258 struct pmu_allocation_v0 out_v0;
259 struct pmu_allocation_v1 out_v1;
260 struct pmu_allocation_v2 out_v2;
261 struct pmu_allocation_v3 out_v3;
262 };
263 struct nvgpu_mem *out_mem;
264 u8 *out_payload;
265 pmu_callback callback;
266 void *cb_params;
267};
268
269struct nvgpu_pg_init {
270 bool state_change;
271 struct nvgpu_cond wq;
272 struct nvgpu_thread state_task;
273};
274
275struct nvgpu_pmu {
276 struct gk20a *g;
277 struct nvgpu_falcon *flcn;
278
279 union {
280 struct pmu_ucode_desc *desc;
281 struct pmu_ucode_desc_v1 *desc_v1;
282 };
283 struct nvgpu_mem ucode;
284
285 struct nvgpu_mem pg_buf;
286
287 /* TBD: remove this if ZBC seq is fixed */
288 struct nvgpu_mem seq_buf;
289 struct nvgpu_mem trace_buf;
290 bool buf_loaded;
291
292 struct pmu_sha1_gid gid_info;
293
294 struct pmu_queue queue[PMU_QUEUE_COUNT];
295
296 struct pmu_sequence *seq;
297 unsigned long pmu_seq_tbl[PMU_SEQ_TBL_SIZE];
298 u32 next_seq_desc;
299
300 struct pmu_mutex *mutex;
301 u32 mutex_cnt;
302
303 struct nvgpu_mutex pmu_copy_lock;
304 struct nvgpu_mutex pmu_seq_lock;
305
306 struct nvgpu_allocator dmem;
307
308 u32 *ucode_image;
309 bool pmu_ready;
310
311 u32 zbc_save_done;
312
313 u32 stat_dmem_offset[PMU_PG_ELPG_ENGINE_ID_INVALID_ENGINE];
314
315 u32 elpg_stat;
316
317 u32 mscg_stat;
318 u32 mscg_transition_state;
319
320 int pmu_state;
321
322#define PMU_ELPG_ENABLE_ALLOW_DELAY_MSEC 1 /* msec */
323 struct nvgpu_pg_init pg_init;
324 struct nvgpu_mutex pg_mutex; /* protect pg-RPPG/MSCG enable/disable */
325 struct nvgpu_mutex elpg_mutex; /* protect elpg enable/disable */
326 /* disable -1, enable +1, <=0 elpg disabled, > 0 elpg enabled */
327 int elpg_refcnt;
328
329 union {
330 struct pmu_perfmon_counter_v2 perfmon_counter_v2;
331 struct pmu_perfmon_counter_v0 perfmon_counter_v0;
332 };
333 u32 perfmon_state_id[PMU_DOMAIN_GROUP_NUM];
334
335 bool initialized;
336
337 void (*remove_support)(struct nvgpu_pmu *pmu);
338 bool sw_ready;
339 bool perfmon_ready;
340
341 u32 sample_buffer;
342 u32 load_shadow;
343 u32 load_avg;
344
345 struct nvgpu_mutex isr_mutex;
346 bool isr_enabled;
347
348 bool zbc_ready;
349 union {
350 struct pmu_cmdline_args_v0 args_v0;
351 struct pmu_cmdline_args_v1 args_v1;
352 struct pmu_cmdline_args_v2 args_v2;
353 struct pmu_cmdline_args_v3 args_v3;
354 struct pmu_cmdline_args_v4 args_v4;
355 struct pmu_cmdline_args_v5 args_v5;
356 struct pmu_cmdline_args_v6 args_v6;
357 };
358 unsigned long perfmon_events_cnt;
359 bool perfmon_sampling_enabled;
360 u8 pmu_mode; /*Added for GM20b, and ACR*/
361 u32 falcon_id;
362 u32 aelpg_param[5];
363 u32 override_done;
364
365 struct nvgpu_firmware *fw;
366};
367
368struct pmu_surface {
369 struct nvgpu_mem vidmem_desc;
370 struct nvgpu_mem sysmem_desc;
371 struct flcn_mem_desc_v0 params;
372};
373
374/*PG defines used by nvpgu-pmu*/
375struct pmu_pg_stats_data {
376 u32 gating_cnt;
377 u32 ingating_time;
378 u32 ungating_time;
379 u32 avg_entry_latency_us;
380 u32 avg_exit_latency_us;
381};
382
383/* PMU IPC Methods */
384void nvgpu_pmu_seq_init(struct nvgpu_pmu *pmu);
385
386int nvgpu_pmu_mutex_acquire(struct nvgpu_pmu *pmu, u32 id, u32 *token);
387int nvgpu_pmu_mutex_release(struct nvgpu_pmu *pmu, u32 id, u32 *token);
388
389int nvgpu_pmu_queue_init(struct nvgpu_pmu *pmu, u32 id,
390 union pmu_init_msg_pmu *init);
391bool nvgpu_pmu_queue_is_empty(struct nvgpu_pmu *pmu, struct pmu_queue *queue);
392
393/* send a cmd to pmu */
394int nvgpu_pmu_cmd_post(struct gk20a *g, struct pmu_cmd *cmd,
395 struct pmu_msg *msg, struct pmu_payload *payload,
396 u32 queue_id, pmu_callback callback, void *cb_param,
397 u32 *seq_desc, unsigned long timeout);
398
399int nvgpu_pmu_process_message(struct nvgpu_pmu *pmu);
400
401/* perfmon */
402int nvgpu_pmu_init_perfmon(struct nvgpu_pmu *pmu);
403int nvgpu_pmu_perfmon_start_sampling(struct nvgpu_pmu *pmu);
404int nvgpu_pmu_perfmon_stop_sampling(struct nvgpu_pmu *pmu);
405int nvgpu_pmu_handle_perfmon_event(struct nvgpu_pmu *pmu,
406 struct pmu_perfmon_msg *msg);
407int nvgpu_pmu_load_norm(struct gk20a *g, u32 *load);
408int nvgpu_pmu_load_update(struct gk20a *g);
409void nvgpu_pmu_reset_load_counters(struct gk20a *g);
410void nvgpu_pmu_get_load_counters(struct gk20a *g, u32 *busy_cycles,
411 u32 *total_cycles);
412
413int nvgpu_pmu_handle_therm_event(struct nvgpu_pmu *pmu,
414 struct nv_pmu_therm_msg *msg);
415
416/* PMU init */
417int nvgpu_init_pmu_support(struct gk20a *g);
418int nvgpu_pmu_destroy(struct gk20a *g);
419int nvgpu_pmu_process_init_msg(struct nvgpu_pmu *pmu,
420 struct pmu_msg *msg);
421
422void nvgpu_pmu_state_change(struct gk20a *g, u32 pmu_state,
423 bool post_change_event);
424
425/* NVGPU-PMU MEM alloc */
426void nvgpu_pmu_surface_free(struct gk20a *g, struct nvgpu_mem *mem);
427void nvgpu_pmu_surface_describe(struct gk20a *g, struct nvgpu_mem *mem,
428 struct flcn_mem_desc_v0 *fb);
429int nvgpu_pmu_vidmem_surface_alloc(struct gk20a *g, struct nvgpu_mem *mem,
430 u32 size);
431int nvgpu_pmu_sysmem_surface_alloc(struct gk20a *g, struct nvgpu_mem *mem,
432 u32 size);
433
434/* PMU F/W support */
435int nvgpu_init_pmu_fw_support(struct nvgpu_pmu *pmu);
436int nvgpu_pmu_prepare_ns_ucode_blob(struct gk20a *g);
437
438/* PG init*/
439int nvgpu_pmu_init_powergating(struct gk20a *g);
440int nvgpu_pmu_init_bind_fecs(struct gk20a *g);
441void nvgpu_pmu_setup_hw_load_zbc(struct gk20a *g);
442
443/* PMU reset */
444int nvgpu_pmu_reset(struct gk20a *g);
445
446/* PG enable/disable */
447int nvgpu_pmu_enable_elpg(struct gk20a *g);
448int nvgpu_pmu_disable_elpg(struct gk20a *g);
449int nvgpu_pmu_pg_global_enable(struct gk20a *g, u32 enable_pg);
450
451int nvgpu_pmu_get_pg_stats(struct gk20a *g, u32 pg_engine_id,
452 struct pmu_pg_stats_data *pg_stat_data);
453
454/* AELPG */
455int nvgpu_aelpg_init(struct gk20a *g);
456int nvgpu_aelpg_init_and_enable(struct gk20a *g, u8 ctrl_id);
457int nvgpu_pmu_ap_send_command(struct gk20a *g,
458 union pmu_ap_cmd *p_ap_cmd, bool b_block);
459
460/* PMU debug */
461void nvgpu_pmu_dump_falcon_stats(struct nvgpu_pmu *pmu);
462void nvgpu_pmu_dump_elpg_stats(struct nvgpu_pmu *pmu);
463bool nvgpu_find_hex_in_string(char *strings, struct gk20a *g, u32 *hex_pos);
464
465#endif /* __NVGPU_PMU_H__ */
diff --git a/drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuif_acr.h b/drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuif_acr.h
new file mode 100644
index 00000000..2d31207f
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuif_acr.h
@@ -0,0 +1,113 @@
1/*
2 * Copyright (c) 2017, 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#ifndef _GPMUIFACR_H_
23#define _GPMUIFACR_H_
24
25/* ACR Commands/Message structures */
26
27enum {
28 PMU_ACR_CMD_ID_INIT_WPR_REGION = 0x0,
29 PMU_ACR_CMD_ID_BOOTSTRAP_FALCON,
30 PMU_ACR_CMD_ID_RESERVED,
31 PMU_ACR_CMD_ID_BOOTSTRAP_MULTIPLE_FALCONS,
32};
33
34/*
35 * Initializes the WPR region details
36 */
37struct pmu_acr_cmd_init_wpr_details {
38 u8 cmd_type;
39 u32 regionid;
40 u32 wproffset;
41
42};
43
44/*
45 * falcon ID to bootstrap
46 */
47struct pmu_acr_cmd_bootstrap_falcon {
48 u8 cmd_type;
49 u32 flags;
50 u32 falconid;
51};
52
53/*
54 * falcon ID to bootstrap
55 */
56struct pmu_acr_cmd_bootstrap_multiple_falcons {
57 u8 cmd_type;
58 u32 flags;
59 u32 falconidmask;
60 u32 usevamask;
61 struct falc_u64 wprvirtualbase;
62};
63
64#define PMU_ACR_CMD_BOOTSTRAP_FALCON_FLAGS_RESET_NO 1
65#define PMU_ACR_CMD_BOOTSTRAP_FALCON_FLAGS_RESET_YES 0
66
67
68struct pmu_acr_cmd {
69 union {
70 u8 cmd_type;
71 struct pmu_acr_cmd_bootstrap_falcon bootstrap_falcon;
72 struct pmu_acr_cmd_init_wpr_details init_wpr;
73 struct pmu_acr_cmd_bootstrap_multiple_falcons boot_falcons;
74 };
75};
76
77/* acr messages */
78
79/*
80 * returns the WPR region init information
81 */
82#define PMU_ACR_MSG_ID_INIT_WPR_REGION 0
83
84/*
85 * Returns the Bootstrapped falcon ID to RM
86 */
87#define PMU_ACR_MSG_ID_BOOTSTRAP_FALCON 1
88
89/*
90 * Returns the WPR init status
91 */
92#define PMU_ACR_SUCCESS 0
93#define PMU_ACR_ERROR 1
94
95/*
96 * PMU notifies about bootstrap status of falcon
97 */
98struct pmu_acr_msg_bootstrap_falcon {
99 u8 msg_type;
100 union {
101 u32 errorcode;
102 u32 falconid;
103 };
104};
105
106struct pmu_acr_msg {
107 union {
108 u8 msg_type;
109 struct pmu_acr_msg_bootstrap_falcon acrmsg;
110 };
111};
112
113#endif /* _GPMUIFACR_H_ */
diff --git a/drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuif_ap.h b/drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuif_ap.h
new file mode 100644
index 00000000..e4f6d5c4
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuif_ap.h
@@ -0,0 +1,256 @@
1/*
2 * Copyright (c) 2017, 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#ifndef _GPMUIFAP_H_
23#define _GPMUIFAP_H_
24
25/* PMU Command/Message Interfaces for Adaptive Power */
26/* Macro to get Histogram index */
27#define PMU_AP_HISTOGRAM(idx) (idx)
28#define PMU_AP_HISTOGRAM_CONT (4)
29
30/* Total number of histogram bins */
31#define PMU_AP_CFG_HISTOGRAM_BIN_N (16)
32
33/* Mapping between Idle counters and histograms */
34#define PMU_AP_IDLE_MASK_HIST_IDX_0 (2)
35#define PMU_AP_IDLE_MASK_HIST_IDX_1 (3)
36#define PMU_AP_IDLE_MASK_HIST_IDX_2 (5)
37#define PMU_AP_IDLE_MASK_HIST_IDX_3 (6)
38
39
40/* Mapping between AP_CTRLs and Histograms */
41#define PMU_AP_HISTOGRAM_IDX_GRAPHICS (PMU_AP_HISTOGRAM(1))
42
43/* Mapping between AP_CTRLs and Idle counters */
44#define PMU_AP_IDLE_MASK_GRAPHICS (PMU_AP_IDLE_MASK_HIST_IDX_1)
45
46/* Adaptive Power Controls (AP_CTRL) */
47enum {
48 PMU_AP_CTRL_ID_GRAPHICS = 0x0,
49 PMU_AP_CTRL_ID_MAX,
50};
51
52/* AP_CTRL Statistics */
53struct pmu_ap_ctrl_stat {
54 /*
55 * Represents whether AP is active or not
56 */
57 u8 b_active;
58
59 /* Idle filter represented by histogram bin index */
60 u8 idle_filter_x;
61 u8 rsvd[2];
62
63 /* Total predicted power saving cycles. */
64 s32 power_saving_h_cycles;
65
66 /* Counts how many times AP gave us -ve power benefits. */
67 u32 bad_decision_count;
68
69 /*
70 * Number of times ap structure needs to skip AP iterations
71 * KICK_CTRL from kernel updates this parameter.
72 */
73 u32 skip_count;
74 u8 bin[PMU_AP_CFG_HISTOGRAM_BIN_N];
75};
76
77/* Parameters initialized by INITn APCTRL command */
78struct pmu_ap_ctrl_init_params {
79 /* Minimum idle filter value in Us */
80 u32 min_idle_filter_us;
81
82 /*
83 * Minimum Targeted Saving in Us. AP will update idle thresholds only
84 * if power saving achieved by updating idle thresholds is greater than
85 * Minimum targeted saving.
86 */
87 u32 min_target_saving_us;
88
89 /* Minimum targeted residency of power feature in Us */
90 u32 power_break_even_us;
91
92 /*
93 * Maximum number of allowed power feature cycles per sample.
94 *
95 * We are allowing at max "pgPerSampleMax" cycles in one iteration of AP
96 * AKA pgPerSampleMax in original algorithm.
97 */
98 u32 cycles_per_sample_max;
99};
100
101/* AP Commands/Message structures */
102
103/*
104 * Structure for Generic AP Commands
105 */
106struct pmu_ap_cmd_common {
107 u8 cmd_type;
108 u16 cmd_id;
109};
110
111/*
112 * Structure for INIT AP command
113 */
114struct pmu_ap_cmd_init {
115 u8 cmd_type;
116 u16 cmd_id;
117 u8 rsvd;
118 u32 pg_sampling_period_us;
119};
120
121/*
122 * Structure for Enable/Disable ApCtrl Commands
123 */
124struct pmu_ap_cmd_enable_ctrl {
125 u8 cmd_type;
126 u16 cmd_id;
127
128 u8 ctrl_id;
129};
130
131struct pmu_ap_cmd_disable_ctrl {
132 u8 cmd_type;
133 u16 cmd_id;
134
135 u8 ctrl_id;
136};
137
138/*
139 * Structure for INIT command
140 */
141struct pmu_ap_cmd_init_ctrl {
142 u8 cmd_type;
143 u16 cmd_id;
144 u8 ctrl_id;
145 struct pmu_ap_ctrl_init_params params;
146};
147
148struct pmu_ap_cmd_init_and_enable_ctrl {
149 u8 cmd_type;
150 u16 cmd_id;
151 u8 ctrl_id;
152 struct pmu_ap_ctrl_init_params params;
153};
154
155/*
156 * Structure for KICK_CTRL command
157 */
158struct pmu_ap_cmd_kick_ctrl {
159 u8 cmd_type;
160 u16 cmd_id;
161 u8 ctrl_id;
162
163 u32 skip_count;
164};
165
166/*
167 * Structure for PARAM command
168 */
169struct pmu_ap_cmd_param {
170 u8 cmd_type;
171 u16 cmd_id;
172 u8 ctrl_id;
173
174 u32 data;
175};
176
177/*
178 * Defines for AP commands
179 */
180enum {
181 PMU_AP_CMD_ID_INIT = 0x0,
182 PMU_AP_CMD_ID_INIT_AND_ENABLE_CTRL,
183 PMU_AP_CMD_ID_ENABLE_CTRL,
184 PMU_AP_CMD_ID_DISABLE_CTRL,
185 PMU_AP_CMD_ID_KICK_CTRL,
186};
187
188/*
189 * AP Command
190 */
191union pmu_ap_cmd {
192 u8 cmd_type;
193 struct pmu_ap_cmd_common cmn;
194 struct pmu_ap_cmd_init init;
195 struct pmu_ap_cmd_init_and_enable_ctrl init_and_enable_ctrl;
196 struct pmu_ap_cmd_enable_ctrl enable_ctrl;
197 struct pmu_ap_cmd_disable_ctrl disable_ctrl;
198 struct pmu_ap_cmd_kick_ctrl kick_ctrl;
199};
200
201/*
202 * Structure for generic AP Message
203 */
204struct pmu_ap_msg_common {
205 u8 msg_type;
206 u16 msg_id;
207};
208
209/*
210 * Structure for INIT_ACK Message
211 */
212struct pmu_ap_msg_init_ack {
213 u8 msg_type;
214 u16 msg_id;
215 u8 ctrl_id;
216 u32 stats_dmem_offset;
217};
218
219/*
220 * Defines for AP messages
221 */
222enum {
223 PMU_AP_MSG_ID_INIT_ACK = 0x0,
224};
225
226/*
227 * AP Message
228 */
229union pmu_ap_msg {
230 u8 msg_type;
231 struct pmu_ap_msg_common cmn;
232 struct pmu_ap_msg_init_ack init_ack;
233};
234
235/*
236 * Adaptive Power Controller
237 */
238struct ap_ctrl {
239 u32 stats_dmem_offset;
240 u32 disable_reason_mask;
241 struct pmu_ap_ctrl_stat stat_cache;
242 u8 b_ready;
243};
244
245/*
246 * Adaptive Power structure
247 *
248 * ap structure provides generic infrastructure to make any power feature
249 * adaptive.
250 */
251struct pmu_ap {
252 u32 supported_mask;
253 struct ap_ctrl ap_ctrl[PMU_AP_CTRL_ID_MAX];
254};
255
256#endif /* _GPMUIFAP_H_*/
diff --git a/drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuif_cmn.h b/drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuif_cmn.h
new file mode 100644
index 00000000..f39e7b6c
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuif_cmn.h
@@ -0,0 +1,130 @@
1/*
2 * Copyright (c) 2017, 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#ifndef _GPMUIFCMN_H_
23#define _GPMUIFCMN_H_
24
25/*
26 * Defines the logical queue IDs that must be used when submitting
27 * commands to the PMU
28 */
29/* write by sw, read by pmu, protected by sw mutex lock */
30#define PMU_COMMAND_QUEUE_HPQ 0
31/* write by sw, read by pmu, protected by sw mutex lock */
32#define PMU_COMMAND_QUEUE_LPQ 1
33/* read/write by sw/hw, protected by hw pmu mutex, id = 2 */
34#define PMU_COMMAND_QUEUE_BIOS 2
35/* read/write by sw/hw, protected by hw pmu mutex, id = 3 */
36#define PMU_COMMAND_QUEUE_SMI 3
37/* write by pmu, read by sw, accessed by interrupt handler, no lock */
38#define PMU_MESSAGE_QUEUE 4
39#define PMU_QUEUE_COUNT 5
40
41#define PMU_IS_COMMAND_QUEUE(id) \
42 ((id) < PMU_MESSAGE_QUEUE)
43
44#define PMU_IS_SW_COMMAND_QUEUE(id) \
45 (((id) == PMU_COMMAND_QUEUE_HPQ) || \
46 ((id) == PMU_COMMAND_QUEUE_LPQ))
47
48#define PMU_IS_MESSAGE_QUEUE(id) \
49 ((id) == PMU_MESSAGE_QUEUE)
50
51enum {
52 OFLAG_READ = 0,
53 OFLAG_WRITE
54};
55
56#define QUEUE_SET (true)
57#define QUEUE_GET (false)
58
59#define QUEUE_ALIGNMENT (4)
60
61/* An enumeration containing all valid logical mutex identifiers */
62enum {
63 PMU_MUTEX_ID_RSVD1 = 0,
64 PMU_MUTEX_ID_GPUSER,
65 PMU_MUTEX_ID_QUEUE_BIOS,
66 PMU_MUTEX_ID_QUEUE_SMI,
67 PMU_MUTEX_ID_GPMUTEX,
68 PMU_MUTEX_ID_I2C,
69 PMU_MUTEX_ID_RMLOCK,
70 PMU_MUTEX_ID_MSGBOX,
71 PMU_MUTEX_ID_FIFO,
72 PMU_MUTEX_ID_PG,
73 PMU_MUTEX_ID_GR,
74 PMU_MUTEX_ID_CLK,
75 PMU_MUTEX_ID_RSVD6,
76 PMU_MUTEX_ID_RSVD7,
77 PMU_MUTEX_ID_RSVD8,
78 PMU_MUTEX_ID_RSVD9,
79 PMU_MUTEX_ID_INVALID
80};
81
82#define PMU_MUTEX_ID_IS_VALID(id) \
83 ((id) < PMU_MUTEX_ID_INVALID)
84
85#define PMU_INVALID_MUTEX_OWNER_ID (0)
86
87/*
88 * The PMU's frame-buffer interface block has several slots/indices
89 * which can be bound to support DMA to various surfaces in memory
90 */
91enum {
92 PMU_DMAIDX_UCODE = 0,
93 PMU_DMAIDX_VIRT = 1,
94 PMU_DMAIDX_PHYS_VID = 2,
95 PMU_DMAIDX_PHYS_SYS_COH = 3,
96 PMU_DMAIDX_PHYS_SYS_NCOH = 4,
97 PMU_DMAIDX_RSVD = 5,
98 PMU_DMAIDX_PELPG = 6,
99 PMU_DMAIDX_END = 7
100};
101
102/*
103 * Falcon PMU DMA's minimum size in bytes.
104 */
105#define PMU_DMA_MIN_READ_SIZE_BYTES 16
106#define PMU_DMA_MIN_WRITE_SIZE_BYTES 4
107
108#define PMU_FB_COPY_RW_ALIGNMENT \
109 ((PMU_DMA_MIN_READ_SIZE_BYTES > PMU_DMA_MIN_WRITE_SIZE_BYTES) ? \
110 PMU_DMA_MIN_READ_SIZE_BYTES : PMU_DMA_MIN_WRITE_SIZE_BYTES)
111
112/*
113 * Macros to make aligned versions of RM_PMU_XXX structures. PMU needs aligned
114 * data structures to issue DMA read/write operations.
115 */
116#define NV_PMU_MAKE_ALIGNED_STRUCT(name, size) \
117union name##_aligned { \
118 struct name data; \
119 u8 pad[ALIGN_UP(sizeof(struct name), \
120 (PMU_FB_COPY_RW_ALIGNMENT))]; \
121}
122
123#define NV_PMU_MAKE_ALIGNED_UNION(name, size) \
124union name##_aligned { \
125 union name data; \
126 u8 pad[ALIGN_UP(sizeof(union name), \
127 (PMU_FB_COPY_RW_ALIGNMENT))]; \
128}
129
130#endif /* _GPMUIFCMN_H_*/
diff --git a/drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuif_perfmon.h b/drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuif_perfmon.h
new file mode 100644
index 00000000..f8c15324
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuif_perfmon.h
@@ -0,0 +1,187 @@
1/*
2 * Copyright (c) 2017, 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#ifndef _GPMUIFPERFMON_H_
23#define _GPMUIFPERFMON_H_
24
25/*perfmon task defines*/
26
27#define PMU_DOMAIN_GROUP_PSTATE 0
28#define PMU_DOMAIN_GROUP_GPC2CLK 1
29#define PMU_DOMAIN_GROUP_NUM 2
30
31#define PMU_PERFMON_FLAG_ENABLE_INCREASE (0x00000001)
32#define PMU_PERFMON_FLAG_ENABLE_DECREASE (0x00000002)
33#define PMU_PERFMON_FLAG_CLEAR_PREV (0x00000004)
34
35enum pmu_perfmon_cmd_start_fields {
36 COUNTER_ALLOC
37};
38
39enum {
40 PMU_PERFMON_CMD_ID_START = 0,
41 PMU_PERFMON_CMD_ID_STOP = 1,
42 PMU_PERFMON_CMD_ID_INIT = 2
43};
44
45struct pmu_perfmon_counter_v0 {
46 u8 index;
47 u8 flags;
48 u8 group_id;
49 u8 valid;
50 u16 upper_threshold; /* units of 0.01% */
51 u16 lower_threshold; /* units of 0.01% */
52};
53
54struct pmu_perfmon_counter_v2 {
55 u8 index;
56 u8 flags;
57 u8 group_id;
58 u8 valid;
59 u16 upper_threshold; /* units of 0.01% */
60 u16 lower_threshold; /* units of 0.01% */
61 u32 scale;
62};
63
64struct pmu_perfmon_cmd_start_v3 {
65 u8 cmd_type;
66 u8 group_id;
67 u8 state_id;
68 u8 flags;
69 struct pmu_allocation_v3 counter_alloc;
70};
71
72struct pmu_perfmon_cmd_start_v2 {
73 u8 cmd_type;
74 u8 group_id;
75 u8 state_id;
76 u8 flags;
77 struct pmu_allocation_v2 counter_alloc;
78};
79
80struct pmu_perfmon_cmd_start_v1 {
81 u8 cmd_type;
82 u8 group_id;
83 u8 state_id;
84 u8 flags;
85 struct pmu_allocation_v1 counter_alloc;
86};
87
88struct pmu_perfmon_cmd_start_v0 {
89 u8 cmd_type;
90 u8 group_id;
91 u8 state_id;
92 u8 flags;
93 struct pmu_allocation_v0 counter_alloc;
94};
95
96struct pmu_perfmon_cmd_stop {
97 u8 cmd_type;
98};
99
100struct pmu_perfmon_cmd_init_v3 {
101 u8 cmd_type;
102 u8 to_decrease_count;
103 u8 base_counter_id;
104 u32 sample_period_us;
105 struct pmu_allocation_v3 counter_alloc;
106 u8 num_counters;
107 u8 samples_in_moving_avg;
108 u16 sample_buffer;
109};
110
111struct pmu_perfmon_cmd_init_v2 {
112 u8 cmd_type;
113 u8 to_decrease_count;
114 u8 base_counter_id;
115 u32 sample_period_us;
116 struct pmu_allocation_v2 counter_alloc;
117 u8 num_counters;
118 u8 samples_in_moving_avg;
119 u16 sample_buffer;
120};
121
122struct pmu_perfmon_cmd_init_v1 {
123 u8 cmd_type;
124 u8 to_decrease_count;
125 u8 base_counter_id;
126 u32 sample_period_us;
127 struct pmu_allocation_v1 counter_alloc;
128 u8 num_counters;
129 u8 samples_in_moving_avg;
130 u16 sample_buffer;
131};
132
133struct pmu_perfmon_cmd_init_v0 {
134 u8 cmd_type;
135 u8 to_decrease_count;
136 u8 base_counter_id;
137 u32 sample_period_us;
138 struct pmu_allocation_v0 counter_alloc;
139 u8 num_counters;
140 u8 samples_in_moving_avg;
141 u16 sample_buffer;
142};
143
144struct pmu_perfmon_cmd {
145 union {
146 u8 cmd_type;
147 struct pmu_perfmon_cmd_start_v0 start_v0;
148 struct pmu_perfmon_cmd_start_v1 start_v1;
149 struct pmu_perfmon_cmd_start_v2 start_v2;
150 struct pmu_perfmon_cmd_start_v3 start_v3;
151 struct pmu_perfmon_cmd_stop stop;
152 struct pmu_perfmon_cmd_init_v0 init_v0;
153 struct pmu_perfmon_cmd_init_v1 init_v1;
154 struct pmu_perfmon_cmd_init_v2 init_v2;
155 struct pmu_perfmon_cmd_init_v3 init_v3;
156 };
157};
158
159struct pmu_zbc_cmd {
160 u8 cmd_type;
161 u8 pad;
162 u16 entry_mask;
163};
164
165/* PERFMON MSG */
166enum {
167 PMU_PERFMON_MSG_ID_INCREASE_EVENT = 0,
168 PMU_PERFMON_MSG_ID_DECREASE_EVENT = 1,
169 PMU_PERFMON_MSG_ID_INIT_EVENT = 2,
170 PMU_PERFMON_MSG_ID_ACK = 3
171};
172
173struct pmu_perfmon_msg_generic {
174 u8 msg_type;
175 u8 state_id;
176 u8 group_id;
177 u8 data;
178};
179
180struct pmu_perfmon_msg {
181 union {
182 u8 msg_type;
183 struct pmu_perfmon_msg_generic gen;
184 };
185};
186
187#endif /* _GPMUIFPERFMON_H_ */
diff --git a/drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuif_pg.h b/drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuif_pg.h
new file mode 100644
index 00000000..b1077821
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuif_pg.h
@@ -0,0 +1,336 @@
1/*
2 * Copyright (c) 2017, 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#ifndef _GPMUIFPG_H_
23#define _GPMUIFPG_H_
24
25#include "gpmuif_ap.h"
26#include "gpmuif_pg_rppg.h"
27
28/*PG defines*/
29
30/* Identifier for each PG */
31#define PMU_PG_ELPG_ENGINE_ID_GRAPHICS (0x00000000)
32#define PMU_PG_ELPG_ENGINE_ID_MS (0x00000004)
33#define PMU_PG_ELPG_ENGINE_ID_INVALID_ENGINE (0x00000005)
34#define PMU_PG_ELPG_ENGINE_MAX PMU_PG_ELPG_ENGINE_ID_INVALID_ENGINE
35
36/* PG message */
37enum {
38 PMU_PG_ELPG_MSG_INIT_ACK,
39 PMU_PG_ELPG_MSG_DISALLOW_ACK,
40 PMU_PG_ELPG_MSG_ALLOW_ACK,
41 PMU_PG_ELPG_MSG_FREEZE_ACK,
42 PMU_PG_ELPG_MSG_FREEZE_ABORT,
43 PMU_PG_ELPG_MSG_UNFREEZE_ACK,
44};
45
46struct pmu_pg_msg_elpg_msg {
47 u8 msg_type;
48 u8 engine_id;
49 u16 msg;
50};
51
52enum {
53 PMU_PG_STAT_MSG_RESP_DMEM_OFFSET = 0,
54};
55
56struct pmu_pg_msg_stat {
57 u8 msg_type;
58 u8 engine_id;
59 u16 sub_msg_id;
60 u32 data;
61};
62
63enum {
64 PMU_PG_MSG_ENG_BUF_LOADED,
65 PMU_PG_MSG_ENG_BUF_UNLOADED,
66 PMU_PG_MSG_ENG_BUF_FAILED,
67};
68
69struct pmu_pg_msg_eng_buf_stat {
70 u8 msg_type;
71 u8 engine_id;
72 u8 buf_idx;
73 u8 status;
74};
75
76struct pmu_pg_msg {
77 union {
78 u8 msg_type;
79 struct pmu_pg_msg_elpg_msg elpg_msg;
80 struct pmu_pg_msg_stat stat;
81 struct pmu_pg_msg_eng_buf_stat eng_buf_stat;
82 /* TBD: other pg messages */
83 union pmu_ap_msg ap_msg;
84 struct nv_pmu_rppg_msg rppg_msg;
85 };
86};
87
88/* PG commands */
89enum {
90 PMU_PG_ELPG_CMD_INIT,
91 PMU_PG_ELPG_CMD_DISALLOW,
92 PMU_PG_ELPG_CMD_ALLOW,
93 PMU_PG_ELPG_CMD_FREEZE,
94 PMU_PG_ELPG_CMD_UNFREEZE,
95};
96
97enum {
98 PMU_PG_CMD_ID_ELPG_CMD = 0,
99 PMU_PG_CMD_ID_ENG_BUF_LOAD,
100 PMU_PG_CMD_ID_ENG_BUF_UNLOAD,
101 PMU_PG_CMD_ID_PG_STAT,
102 PMU_PG_CMD_ID_PG_LOG_INIT,
103 PMU_PG_CMD_ID_PG_LOG_FLUSH,
104 PMU_PG_CMD_ID_PG_PARAM,
105 PMU_PG_CMD_ID_ELPG_INIT,
106 PMU_PG_CMD_ID_ELPG_POLL_CTXSAVE,
107 PMU_PG_CMD_ID_ELPG_ABORT_POLL,
108 PMU_PG_CMD_ID_ELPG_PWR_UP,
109 PMU_PG_CMD_ID_ELPG_DISALLOW,
110 PMU_PG_CMD_ID_ELPG_ALLOW,
111 PMU_PG_CMD_ID_AP,
112 RM_PMU_PG_CMD_ID_PSI,
113 RM_PMU_PG_CMD_ID_CG,
114 PMU_PG_CMD_ID_ZBC_TABLE_UPDATE,
115 PMU_PG_CMD_ID_PWR_RAIL_GATE_DISABLE = 0x20,
116 PMU_PG_CMD_ID_PWR_RAIL_GATE_ENABLE,
117 PMU_PG_CMD_ID_PWR_RAIL_SMU_MSG_DISABLE,
118 PMU_PMU_PG_CMD_ID_RPPG = 0x24,
119};
120
121enum {
122 PMU_PG_STAT_CMD_ALLOC_DMEM = 0,
123};
124
125#define PMU_PG_PARAM_CMD_GR_INIT_PARAM 0x0
126#define PMU_PG_PARAM_CMD_MS_INIT_PARAM 0x01
127#define PMU_PG_PARAM_CMD_MCLK_CHANGE 0x04
128#define PMU_PG_PARAM_CMD_POST_INIT 0x06
129#define PMU_PG_PARAM_CMD_SUB_FEATURE_MASK_UPDATE 0x07
130
131#define PMU_PG_FEATURE_GR_SDIV_SLOWDOWN_ENABLED (1 << 0)
132#define PMU_PG_FEATURE_GR_POWER_GATING_ENABLED (1 << 2)
133#define PMU_PG_FEATURE_GR_RPPG_ENABLED (1 << 3)
134
135#define NVGPU_PMU_GR_FEATURE_MASK_RPPG (1 << 3)
136#define NVGPU_PMU_GR_FEATURE_MASK_ALL \
137 ( \
138 NVGPU_PMU_GR_FEATURE_MASK_RPPG \
139 )
140
141#define NVGPU_PMU_MS_FEATURE_MASK_CLOCK_GATING (1 << 0)
142#define NVGPU_PMU_MS_FEATURE_MASK_SW_ASR (1 << 1)
143#define NVGPU_PMU_MS_FEATURE_MASK_RPPG (1 << 8)
144#define NVGPU_PMU_MS_FEATURE_MASK_FB_TRAINING (1 << 5)
145
146#define NVGPU_PMU_MS_FEATURE_MASK_ALL \
147 ( \
148 NVGPU_PMU_MS_FEATURE_MASK_CLOCK_GATING |\
149 NVGPU_PMU_MS_FEATURE_MASK_SW_ASR |\
150 NVGPU_PMU_MS_FEATURE_MASK_RPPG |\
151 NVGPU_PMU_MS_FEATURE_MASK_FB_TRAINING \
152 )
153
154
155struct pmu_pg_cmd_elpg_cmd {
156 u8 cmd_type;
157 u8 engine_id;
158 u16 cmd;
159};
160
161struct pmu_pg_cmd_eng_buf_load_v0 {
162 u8 cmd_type;
163 u8 engine_id;
164 u8 buf_idx;
165 u8 pad;
166 u16 buf_size;
167 u32 dma_base;
168 u8 dma_offset;
169 u8 dma_idx;
170};
171
172struct pmu_pg_cmd_eng_buf_load_v1 {
173 u8 cmd_type;
174 u8 engine_id;
175 u8 buf_idx;
176 u8 pad;
177 struct flcn_mem_desc {
178 struct falc_u64 dma_addr;
179 u16 dma_size;
180 u8 dma_idx;
181 } dma_desc;
182};
183
184struct pmu_pg_cmd_eng_buf_load_v2 {
185 u8 cmd_type;
186 u8 engine_id;
187 u8 buf_idx;
188 u8 pad;
189 struct flcn_mem_desc_v0 dma_desc;
190};
191
192struct pmu_pg_cmd_gr_init_param {
193 u8 cmd_type;
194 u16 sub_cmd_id;
195 u8 featuremask;
196};
197
198struct pmu_pg_cmd_gr_init_param_v1 {
199 u8 cmd_type;
200 u16 sub_cmd_id;
201 u32 featuremask;
202};
203
204struct pmu_pg_cmd_sub_feature_mask_update {
205 u8 cmd_type;
206 u16 sub_cmd_id;
207 u8 ctrl_id;
208 u32 enabled_mask;
209};
210
211struct pmu_pg_cmd_ms_init_param {
212 u8 cmd_type;
213 u16 cmd_id;
214 u8 psi;
215 u8 idle_flipped_test_enabled;
216 u16 psiSettleTimeUs;
217 u8 rsvd[2];
218 u32 support_mask;
219 u32 abort_timeout_us;
220};
221
222struct pmu_pg_cmd_mclk_change {
223 u8 cmd_type;
224 u16 cmd_id;
225 u8 rsvd;
226 u32 data;
227};
228
229#define PG_VOLT_RAIL_IDX_MAX 2
230
231struct pmu_pg_volt_rail {
232 u8 volt_rail_idx;
233 u8 sleep_volt_dev_idx;
234 u8 sleep_vfe_idx;
235 u32 sleep_voltage_uv;
236 u32 therm_vid0_cache;
237 u32 therm_vid1_cache;
238};
239
240struct pmu_pg_cmd_post_init_param {
241 u8 cmd_type;
242 u16 cmd_id;
243 struct pmu_pg_volt_rail pg_volt_rail[PG_VOLT_RAIL_IDX_MAX];
244};
245
246struct pmu_pg_cmd_stat {
247 u8 cmd_type;
248 u8 engine_id;
249 u16 sub_cmd_id;
250 u32 data;
251};
252
253struct pmu_pg_cmd {
254 union {
255 u8 cmd_type;
256 struct pmu_pg_cmd_elpg_cmd elpg_cmd;
257 struct pmu_pg_cmd_eng_buf_load_v0 eng_buf_load_v0;
258 struct pmu_pg_cmd_eng_buf_load_v1 eng_buf_load_v1;
259 struct pmu_pg_cmd_eng_buf_load_v2 eng_buf_load_v2;
260 struct pmu_pg_cmd_stat stat;
261 struct pmu_pg_cmd_gr_init_param gr_init_param;
262 struct pmu_pg_cmd_gr_init_param_v1 gr_init_param_v1;
263 struct pmu_pg_cmd_ms_init_param ms_init_param;
264 struct pmu_pg_cmd_mclk_change mclk_change;
265 struct pmu_pg_cmd_post_init_param post_init;
266 /* TBD: other pg commands */
267 union pmu_ap_cmd ap_cmd;
268 struct nv_pmu_rppg_cmd rppg_cmd;
269 struct pmu_pg_cmd_sub_feature_mask_update sf_mask_update;
270 };
271};
272
273/* Statistics structure for PG features */
274struct pmu_pg_stats_v2 {
275 u32 entry_count;
276 u32 exit_count;
277 u32 abort_count;
278 u32 detection_count;
279 u32 prevention_activate_count;
280 u32 prevention_deactivate_count;
281 u32 powered_up_time_us;
282 u32 entry_latency_us;
283 u32 exit_latency_us;
284 u32 resident_time_us;
285 u32 entry_latency_avg_us;
286 u32 exit_latency_avg_us;
287 u32 entry_latency_max_us;
288 u32 exit_latency_max_us;
289 u32 total_sleep_time_us;
290 u32 total_non_sleep_time_us;
291};
292
293struct pmu_pg_stats_v1 {
294 /* Number of time PMU successfully engaged sleep state */
295 u32 entry_count;
296 /* Number of time PMU exit sleep state */
297 u32 exit_count;
298 /* Number of time PMU aborted in entry sequence */
299 u32 abort_count;
300 /*
301 * Time for which GPU was neither in Sleep state not
302 * executing sleep sequence.
303 */
304 u32 poweredup_timeus;
305 /* Entry and exit latency of current sleep cycle */
306 u32 entry_latency_us;
307 u32 exitlatencyus;
308 /* Resident time for current sleep cycle. */
309 u32 resident_timeus;
310 /* Rolling average entry and exit latencies */
311 u32 entrylatency_avgus;
312 u32 exitlatency_avgus;
313 /* Max entry and exit latencies */
314 u32 entrylatency_maxus;
315 u32 exitlatency_maxus;
316 /* Total time spent in sleep and non-sleep state */
317 u32 total_sleep_timeus;
318 u32 total_nonsleep_timeus;
319};
320
321struct pmu_pg_stats {
322 u64 pg_entry_start_timestamp;
323 u64 pg_ingating_start_timestamp;
324 u64 pg_exit_start_timestamp;
325 u64 pg_ungating_start_timestamp;
326 u32 pg_avg_entry_time_us;
327 u32 pg_ingating_cnt;
328 u32 pg_ingating_time_us;
329 u32 pg_avg_exit_time_us;
330 u32 pg_ungating_count;
331 u32 pg_ungating_time_us;
332 u32 pg_gating_cnt;
333 u32 pg_gating_deny_cnt;
334};
335
336#endif /* _GPMUIFPG_H_*/
diff --git a/drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuif_pg_rppg.h b/drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuif_pg_rppg.h
new file mode 100644
index 00000000..26d38ccb
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuif_pg_rppg.h
@@ -0,0 +1,110 @@
1/*
2 * Copyright (c) 2016-2017, 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#ifndef _GPMUIFRPPG_H_
23#define _GPMUIFRPPG_H_
24
25#define NV_PMU_RPPG_CTRL_ID_GR (0x0000)
26#define NV_PMU_RPPG_CTRL_ID_MS (0x0001)
27#define NV_PMU_RPPG_CTRL_ID_DI (0x0002)
28#define NV_PMU_RPPG_CTRL_ID_MAX (0x0003)
29
30#define NV_PMU_RPPG_CTRL_MASK_ENABLE_ALL (BIT(NV_PMU_RPPG_CTRL_ID_GR) |\
31 BIT(NV_PMU_RPPG_CTRL_ID_MS) |\
32 BIT(NV_PMU_RPPG_CTRL_ID_DI))
33
34#define NV_PMU_RPPG_CTRL_MASK_DISABLE_ALL 0
35
36enum {
37 NV_PMU_RPPG_DOMAIN_ID_GFX = 0x0,
38 NV_PMU_RPPG_DOMAIN_ID_NON_GFX,
39};
40
41struct nv_pmu_rppg_ctrl_stats {
42 u32 entry_count;
43 u32 exit_count;
44};
45
46struct nv_pmu_rppg_cmd_common {
47 u8 cmd_type;
48 u8 cmd_id;
49};
50
51struct nv_pmu_rppg_cmd_init {
52 u8 cmd_type;
53 u8 cmd_id;
54};
55
56struct nv_pmu_rppg_cmd_init_ctrl {
57 u8 cmd_type;
58 u8 cmd_id;
59 u8 ctrl_id;
60 u8 domain_id;
61};
62
63struct nv_pmu_rppg_cmd_stats_reset {
64 u8 cmd_type;
65 u8 cmd_id;
66 u8 ctrl_id;
67};
68
69struct nv_pmu_rppg_cmd {
70 union {
71 u8 cmd_type;
72 struct nv_pmu_rppg_cmd_common cmn;
73 struct nv_pmu_rppg_cmd_init init;
74 struct nv_pmu_rppg_cmd_init_ctrl init_ctrl;
75 struct nv_pmu_rppg_cmd_stats_reset stats_reset;
76 };
77};
78
79enum {
80 NV_PMU_RPPG_CMD_ID_INIT = 0x0,
81 NV_PMU_RPPG_CMD_ID_INIT_CTRL,
82 NV_PMU_RPPG_CMD_ID_STATS_RESET,
83};
84
85
86struct nv_pmu_rppg_msg_common {
87 u8 msg_type;
88 u8 msg_id;
89};
90
91struct nv_pmu_rppg_msg_init_ctrl_ack {
92 u8 msg_type;
93 u8 msg_id;
94 u8 ctrl_id;
95 u32 stats_dmem_offset;
96};
97
98struct nv_pmu_rppg_msg {
99 union {
100 u8 msg_type;
101 struct nv_pmu_rppg_msg_common cmn;
102 struct nv_pmu_rppg_msg_init_ctrl_ack init_ctrl_ack;
103 };
104};
105
106enum {
107 NV_PMU_RPPG_MSG_ID_INIT_CTRL_ACK = 0x0,
108};
109
110#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuif_pmu.h b/drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuif_pmu.h
new file mode 100644
index 00000000..91ef1bda
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuif_pmu.h
@@ -0,0 +1,236 @@
1/*
2 * Copyright (c) 2017, 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#ifndef _GPMUIFPMU_H_
23#define _GPMUIFPMU_H_
24
25#include <nvgpu/flcnif_cmn.h>
26#include "gpmuif_cmn.h"
27
28/* Make sure size of this structure is a multiple of 4 bytes */
29struct pmu_cmdline_args_v0 {
30 u32 cpu_freq_hz;
31 u32 falc_trace_size;
32 u32 falc_trace_dma_base;
33 u32 falc_trace_dma_idx;
34 struct pmu_mem_v0 gc6_ctx;
35};
36
37struct pmu_cmdline_args_v1 {
38 u32 cpu_freq_hz;
39 u32 falc_trace_size;
40 u32 falc_trace_dma_base;
41 u32 falc_trace_dma_idx;
42 u8 secure_mode;
43 struct pmu_mem_v1 gc6_ctx;
44};
45
46struct pmu_cmdline_args_v2 {
47 u32 cpu_freq_hz;
48 u32 falc_trace_size;
49 u32 falc_trace_dma_base;
50 u32 falc_trace_dma_idx;
51 u8 secure_mode;
52 u8 raise_priv_sec;
53 struct pmu_mem_v1 gc6_ctx;
54};
55
56struct pmu_cmdline_args_v3 {
57 u32 reserved;
58 u32 cpu_freq_hz;
59 u32 falc_trace_size;
60 u32 falc_trace_dma_base;
61 u32 falc_trace_dma_idx;
62 u8 secure_mode;
63 u8 raise_priv_sec;
64 struct pmu_mem_v1 gc6_ctx;
65};
66
67struct pmu_cmdline_args_v4 {
68 u32 reserved;
69 u32 cpu_freq_hz;
70 u32 falc_trace_size;
71 struct falc_dma_addr dma_addr;
72 u32 falc_trace_dma_idx;
73 u8 secure_mode;
74 u8 raise_priv_sec;
75 struct pmu_mem_desc_v0 gc6_ctx;
76 u8 pad;
77};
78
79struct pmu_cmdline_args_v5 {
80 u32 cpu_freq_hz;
81 struct flcn_mem_desc_v0 trace_buf;
82 u8 secure_mode;
83 u8 raise_priv_sec;
84 struct flcn_mem_desc_v0 gc6_ctx;
85 struct flcn_mem_desc_v0 init_data_dma_info;
86 u32 dummy;
87};
88
89struct pmu_cmdline_args_v6 {
90 u32 cpu_freq_hz;
91 struct flcn_mem_desc_v0 trace_buf;
92 u8 secure_mode;
93 u8 raise_priv_sec;
94 struct flcn_mem_desc_v0 gc6_ctx;
95 struct flcn_mem_desc_v0 gc6_bsod_ctx;
96 struct flcn_mem_desc_v0 init_data_dma_info;
97 u32 dummy;
98};
99
100/* GPU ID */
101#define PMU_SHA1_GID_SIGNATURE 0xA7C66AD2
102#define PMU_SHA1_GID_SIGNATURE_SIZE 4
103
104#define PMU_SHA1_GID_SIZE 16
105
106struct pmu_sha1_gid {
107 bool valid;
108 u8 gid[PMU_SHA1_GID_SIZE];
109};
110
111struct pmu_sha1_gid_data {
112 u8 signature[PMU_SHA1_GID_SIGNATURE_SIZE];
113 u8 gid[PMU_SHA1_GID_SIZE];
114};
115
116/* PMU INIT MSG */
117enum {
118 PMU_INIT_MSG_TYPE_PMU_INIT = 0,
119};
120
121struct pmu_init_msg_pmu_v0 {
122 u8 msg_type;
123 u8 pad;
124
125 struct {
126 u16 size;
127 u16 offset;
128 u8 index;
129 u8 pad;
130 } queue_info[PMU_QUEUE_COUNT];
131
132 u16 sw_managed_area_offset;
133 u16 sw_managed_area_size;
134};
135
136struct pmu_init_msg_pmu_v1 {
137 u8 msg_type;
138 u8 pad;
139 u16 os_debug_entry_point;
140
141 struct {
142 u16 size;
143 u16 offset;
144 u8 index;
145 u8 pad;
146 } queue_info[PMU_QUEUE_COUNT];
147
148 u16 sw_managed_area_offset;
149 u16 sw_managed_area_size;
150};
151struct pmu_init_msg_pmu_v2 {
152 u8 msg_type;
153 u8 pad;
154 u16 os_debug_entry_point;
155
156 struct {
157 u16 size;
158 u16 offset;
159 u8 index;
160 u8 pad;
161 } queue_info[PMU_QUEUE_COUNT];
162
163 u16 sw_managed_area_offset;
164 u16 sw_managed_area_size;
165 u8 dummy[18];
166};
167
168#define PMU_QUEUE_COUNT_FOR_V4 5
169#define PMU_QUEUE_COUNT_FOR_V3 3
170#define PMU_QUEUE_HPQ_IDX_FOR_V3 0
171#define PMU_QUEUE_LPQ_IDX_FOR_V3 1
172#define PMU_QUEUE_MSG_IDX_FOR_V3 2
173#define PMU_QUEUE_MSG_IDX_FOR_V4 4
174struct pmu_init_msg_pmu_v3 {
175 u8 msg_type;
176 u8 queue_index[PMU_QUEUE_COUNT_FOR_V3];
177 u16 queue_size[PMU_QUEUE_COUNT_FOR_V3];
178 u16 queue_offset;
179
180 u16 sw_managed_area_offset;
181 u16 sw_managed_area_size;
182
183 u16 os_debug_entry_point;
184
185 u8 dummy[18];
186};
187
188struct pmu_init_msg_pmu_v4 {
189 u8 msg_type;
190 u8 queue_index[PMU_QUEUE_COUNT_FOR_V4];
191 u16 queue_size[PMU_QUEUE_COUNT_FOR_V4];
192 u16 queue_offset;
193
194 u16 sw_managed_area_offset;
195 u16 sw_managed_area_size;
196
197 u16 os_debug_entry_point;
198
199 u8 dummy[18];
200};
201
202union pmu_init_msg_pmu {
203 struct pmu_init_msg_pmu_v0 v0;
204 struct pmu_init_msg_pmu_v1 v1;
205 struct pmu_init_msg_pmu_v2 v2;
206 struct pmu_init_msg_pmu_v3 v3;
207 struct pmu_init_msg_pmu_v4 v4;
208};
209
210struct pmu_init_msg {
211 union {
212 u8 msg_type;
213 struct pmu_init_msg_pmu_v1 pmu_init_v1;
214 struct pmu_init_msg_pmu_v0 pmu_init_v0;
215 struct pmu_init_msg_pmu_v2 pmu_init_v2;
216 struct pmu_init_msg_pmu_v3 pmu_init_v3;
217 struct pmu_init_msg_pmu_v4 pmu_init_v4;
218 };
219};
220
221/* robust channel (RC) messages */
222enum {
223 PMU_RC_MSG_TYPE_UNHANDLED_CMD = 0,
224};
225
226struct pmu_rc_msg_unhandled_cmd {
227 u8 msg_type;
228 u8 unit_id;
229};
230
231struct pmu_rc_msg {
232 u8 msg_type;
233 struct pmu_rc_msg_unhandled_cmd unhandled_cmd;
234};
235
236#endif /* _GPMUIFPMU_H_*/
diff --git a/drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuifbios.h b/drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuifbios.h
new file mode 100644
index 00000000..9934d3fd
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuifbios.h
@@ -0,0 +1,50 @@
1/*
2 * Copyright (c) 2016-2017, 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#ifndef _GPMUIFBIOS_H_
23#define _GPMUIFBIOS_H_
24
25struct nv_pmu_bios_vfield_register_segment_super {
26 u8 type;
27 u8 low_bit;
28 u8 high_bit;
29};
30
31struct nv_pmu_bios_vfield_register_segment_reg {
32 struct nv_pmu_bios_vfield_register_segment_super super;
33 u32 addr;
34};
35
36struct nv_pmu_bios_vfield_register_segment_index_reg {
37 struct nv_pmu_bios_vfield_register_segment_super super;
38 u32 addr;
39 u32 reg_index;
40 u32 index;
41};
42
43union nv_pmu_bios_vfield_register_segment {
44 struct nv_pmu_bios_vfield_register_segment_super super;
45 struct nv_pmu_bios_vfield_register_segment_reg reg;
46 struct nv_pmu_bios_vfield_register_segment_index_reg index_reg;
47};
48
49
50#endif /* _GPMUIFBIOS_H_*/
diff --git a/drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuifboardobj.h b/drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuifboardobj.h
new file mode 100644
index 00000000..ee5dfd06
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuifboardobj.h
@@ -0,0 +1,204 @@
1/*
2* Copyright (c) 2016-2017, 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#ifndef _GPMUIFBOARDOBJ_H_
23#define _GPMUIFBOARDOBJ_H_
24
25#include <nvgpu/flcnif_cmn.h>
26#include "ctrl/ctrlboardobj.h"
27
28/*
29 * Base structure describing a BOARDOBJ for communication between Kernel and
30 * PMU.
31 */
32struct nv_pmu_boardobj {
33 u8 type;
34};
35
36/*
37 * Base structure describing a BOARDOBJ for Query interface between Kernel and
38 * PMU.
39 */
40struct nv_pmu_boardobj_query {
41 u8 type;
42};
43
44/*
45 * Virtual base structure describing a BOARDOBJGRP interface between Kernel and
46 * PMU.
47 */
48struct nv_pmu_boardobjgrp_super {
49 u8 type;
50 u8 class_id;
51 u8 obj_slots;
52 u8 rsvd;
53};
54
55struct nv_pmu_boardobjgrp {
56 struct nv_pmu_boardobjgrp_super super;
57 u32 obj_mask;
58};
59
60struct nv_pmu_boardobjgrp_e32 {
61 struct nv_pmu_boardobjgrp_super super;
62 struct ctrl_boardobjgrp_mask_e32 obj_mask;
63};
64
65struct nv_pmu_boardobjgrp_e255 {
66 struct nv_pmu_boardobjgrp_super super;
67 struct ctrl_boardobjgrp_mask_e255 obj_mask;
68};
69
70struct nv_pmu_boardobj_cmd_grp_payload {
71 struct pmu_allocation_v3 dmem_buf;
72 struct flcn_mem_desc_v0 fb;
73 u8 hdr_size;
74 u8 entry_size;
75};
76
77struct nv_pmu_boardobj_cmd_grp {
78 u8 cmd_type;
79 u8 pad[2];
80 u8 class_id;
81 struct nv_pmu_boardobj_cmd_grp_payload grp;
82};
83
84#define NV_PMU_BOARDOBJ_GRP_ALLOC_OFFSET \
85 (NV_OFFSETOF(NV_PMU_BOARDOBJ_CMD_GRP, grp))
86
87struct nv_pmu_boardobj_cmd {
88 union {
89 u8 cmd_type;
90 struct nv_pmu_boardobj_cmd_grp grp;
91 struct nv_pmu_boardobj_cmd_grp grp_set;
92 struct nv_pmu_boardobj_cmd_grp grp_get_status;
93 };
94};
95
96struct nv_pmu_boardobj_msg_grp {
97 u8 msg_type;
98 bool b_success;
99 flcn_status flcn_status;
100 u8 class_id;
101};
102
103struct nv_pmu_boardobj_msg {
104 union {
105 u8 msg_type;
106 struct nv_pmu_boardobj_msg_grp grp;
107 struct nv_pmu_boardobj_msg_grp grp_set;
108 struct nv_pmu_boardobj_msg_grp grp_get_status;
109 };
110};
111
112/*
113* Macro generating structures describing classes which implement
114* NV_PMU_BOARDOBJGRP via the NV_PMU_BOARDBOBJ_CMD_GRP SET interface.
115*
116* @para _eng Name of implementing engine in which this structure is
117* found.
118* @param _class Class ID of Objects within Board Object Group.
119* @param _slots Max number of elements this group can contain.
120*/
121#define NV_PMU_BOARDOBJ_GRP_SET_MAKE(_eng, _class, _slots) \
122 NV_PMU_MAKE_ALIGNED_STRUCT( \
123 nv_pmu_##_eng##_##_class##_boardobjgrp_set_header, one_structure); \
124 NV_PMU_MAKE_ALIGNED_UNION( \
125 nv_pmu_##_eng##_##_class##_boardobj_set_union, one_union); \
126 struct nv_pmu_##_eng##_##_class##_boardobj_grp_set { \
127 union nv_pmu_##_eng##_##_class##_boardobjgrp_set_header_aligned hdr; \
128 union nv_pmu_##_eng##_##_class##_boardobj_set_union_aligned objects[(_slots)];\
129 }
130
131/*
132* Macro generating structures describing classes which implement
133* NV_PMU_BOARDOBJGRP_E32 via the NV_PMU_BOARDBOBJ_CMD_GRP SET interface.
134*
135* @para _eng Name of implementing engine in which this structure is
136* found.
137* @param _class Class ID of Objects within Board Object Group.
138*/
139#define NV_PMU_BOARDOBJ_GRP_SET_MAKE_E32(_eng, _class) \
140 NV_PMU_BOARDOBJ_GRP_SET_MAKE(_eng, _class, \
141 CTRL_BOARDOBJGRP_E32_MAX_OBJECTS)
142
143/*
144* Macro generating structures describing classes which implement
145* NV_PMU_BOARDOBJGRP_E255 via the NV_PMU_BOARDBOBJ_CMD_GRP SET interface.
146*
147* @para _eng Name of implementing engine in which this structure is
148* found.
149* @param _class Class ID of Objects within Board Object Group.
150*/
151#define NV_PMU_BOARDOBJ_GRP_SET_MAKE_E255(_eng, _class) \
152 NV_PMU_BOARDOBJ_GRP_SET_MAKE(_eng, _class, \
153 CTRL_BOARDOBJGRP_E255_MAX_OBJECTS)
154
155/*
156* Macro generating structures for querying dynamic state for classes which
157* implement NV_PMU_BOARDOBJGRP via the NV_PMU_BOARDOBJ_CMD_GRP GET_STATUS
158* interface.
159*
160* @para _eng Name of implementing engine in which this structure is
161* found.
162* @param _class Class ID of Objects within Board Object Group.
163* @param _slots Max number of elements this group can contain.
164*/
165#define NV_PMU_BOARDOBJ_GRP_GET_STATUS_MAKE(_eng, _class, _slots) \
166 NV_PMU_MAKE_ALIGNED_STRUCT( \
167 nv_pmu_##_eng##_##_class##_boardobjgrp_get_status_header, struct); \
168 NV_PMU_MAKE_ALIGNED_UNION( \
169 nv_pmu_##_eng##_##_class##_boardobj_get_status_union, union); \
170 struct nv_pmu_##_eng##_##_class##_boardobj_grp_get_status { \
171 union nv_pmu_##_eng##_##_class##_boardobjgrp_get_status_header_aligned \
172 hdr; \
173 union nv_pmu_##_eng##_##_class##_boardobj_get_status_union_aligned \
174 objects[(_slots)]; \
175 }
176
177/*
178* Macro generating structures for querying dynamic state for classes which
179* implement NV_PMU_BOARDOBJGRP_E32 via the NV_PMU_BOARDOBJ_CMD_GRP GET_STATUS
180* interface.
181*
182* @para _eng Name of implementing engine in which this structure is
183* found.
184* @param _class Class ID of Objects within Board Object Group.
185*/
186#define NV_PMU_BOARDOBJ_GRP_GET_STATUS_MAKE_E32(_eng, _class) \
187 NV_PMU_BOARDOBJ_GRP_GET_STATUS_MAKE(_eng, _class, \
188 CTRL_BOARDOBJGRP_E32_MAX_OBJECTS)
189
190/*
191* Macro generating structures for querying dynamic state for classes which
192* implement NV_PMU_BOARDOBJGRP_E255 via the NV_PMU_BOARDOBJ_CMD_GRP GET_STATUS
193* interface.
194*
195* @para _eng Name of implementing engine in which this structure is
196* found.
197* @param _class Class ID of Objects within Board Object Group.
198*/
199#define NV_PMU_BOARDOBJ_GRP_GET_STATUS_MAKE_E255(_eng, _class) \
200 NV_PMU_BOARDOBJ_GRP_GET_STATUS_MAKE(_eng, _class, \
201 CTRL_BOARDOBJGRP_E255_MAX_OBJECTS)
202
203
204#endif /* _GPMUIFBOARDOBJ_H_ */
diff --git a/drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuifclk.h b/drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuifclk.h
new file mode 100644
index 00000000..2ea0c548
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuifclk.h
@@ -0,0 +1,464 @@
1/*
2* Copyright (c) 2016-2017, 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#ifndef _GPMUIFCLK_H_
24#define _GPMUIFCLK_H_
25
26#include "ctrl/ctrlboardobj.h"
27#include "ctrl/ctrlvolt.h"
28#include "ctrl/ctrlperf.h"
29#include "ctrl/ctrlclk.h"
30#include "gpmuifboardobj.h"
31#include "gpmuifvolt.h"
32#include <nvgpu/flcnif_cmn.h>
33
34enum nv_pmu_clk_clkwhich {
35 clkwhich_mclk = 5,
36 clkwhich_dispclk = 7,
37 clkwhich_gpc2clk = 17,
38 clkwhich_xbar2clk = 19,
39 clkwhich_sys2clk = 20,
40 clkwhich_hub2clk = 21,
41 clkwhich_pwrclk = 24,
42 clkwhich_nvdclk = 25,
43 clkwhich_pciegenclk = 31,
44};
45
46/*
47 * Enumeration of BOARDOBJGRP class IDs within OBJCLK. Used as "classId"
48 * argument for communications between Kernel and PMU via the various generic
49 * BOARDOBJGRP interfaces.
50 */
51#define NV_PMU_CLK_BOARDOBJGRP_CLASS_ID_CLK_DOMAIN 0x00
52#define NV_PMU_CLK_BOARDOBJGRP_CLASS_ID_CLK_PROG 0x01
53#define NV_PMU_CLK_BOARDOBJGRP_CLASS_ID_VIN_DEVICE 0x02
54#define NV_PMU_CLK_BOARDOBJGRP_CLASS_ID_FLL_DEVICE 0x03
55#define NV_PMU_CLK_BOARDOBJGRP_CLASS_ID_CLK_VF_POINT 0x04
56#define NV_PMU_CLK_BOARDOBJGRP_CLASS_ID_CLK_FREQ_CONTROLLER 0x05
57
58/*!
59* CLK_DOMAIN BOARDOBJGRP Header structure. Describes global state about the
60* CLK_DOMAIN feature.
61*/
62struct nv_pmu_clk_clk_domain_boardobjgrp_set_header {
63 struct nv_pmu_boardobjgrp_e32 super;
64 u32 vbios_domains;
65 struct ctrl_boardobjgrp_mask_e32 master_domains_mask;
66 u16 cntr_sampling_periodms;
67 bool b_override_o_v_o_c;
68 bool b_debug_mode;
69 bool b_enforce_vf_monotonicity;
70 bool b_enforce_vf_smoothening;
71 u8 volt_rails_max;
72 struct ctrl_clk_clk_delta deltas;
73};
74
75struct nv_pmu_clk_clk_domain_boardobj_set {
76 struct nv_pmu_boardobj super;
77 enum nv_pmu_clk_clkwhich domain;
78 u32 api_domain;
79 u8 perf_domain_grp_idx;
80};
81
82struct nv_pmu_clk_clk_domain_3x_boardobj_set {
83 struct nv_pmu_clk_clk_domain_boardobj_set super;
84 bool b_noise_aware_capable;
85};
86
87struct nv_pmu_clk_clk_domain_3x_fixed_boardobj_set {
88 struct nv_pmu_clk_clk_domain_3x_boardobj_set super;
89 u16 freq_mhz;
90};
91
92struct nv_pmu_clk_clk_domain_3x_prog_boardobj_set {
93 struct nv_pmu_clk_clk_domain_3x_boardobj_set super;
94 u8 clk_prog_idx_first;
95 u8 clk_prog_idx_last;
96 u8 noise_unaware_ordering_index;
97 u8 noise_aware_ordering_index;
98 bool b_force_noise_unaware_ordering;
99 int factory_offset_khz;
100 short freq_delta_min_mhz;
101 short freq_delta_max_mhz;
102 struct ctrl_clk_clk_delta deltas;
103};
104
105struct nv_pmu_clk_clk_domain_3x_master_boardobj_set {
106 struct nv_pmu_clk_clk_domain_3x_prog_boardobj_set super;
107 u32 slave_idxs_mask;
108};
109
110struct nv_pmu_clk_clk_domain_3x_slave_boardobj_set {
111 struct nv_pmu_clk_clk_domain_3x_prog_boardobj_set super;
112 u8 master_idx;
113};
114
115union nv_pmu_clk_clk_domain_boardobj_set_union {
116 struct nv_pmu_boardobj board_obj;
117 struct nv_pmu_clk_clk_domain_boardobj_set super;
118 struct nv_pmu_clk_clk_domain_3x_boardobj_set v3x;
119 struct nv_pmu_clk_clk_domain_3x_fixed_boardobj_set v3x_fixed;
120 struct nv_pmu_clk_clk_domain_3x_prog_boardobj_set v3x_prog;
121 struct nv_pmu_clk_clk_domain_3x_master_boardobj_set v3x_master;
122 struct nv_pmu_clk_clk_domain_3x_slave_boardobj_set v3x_slave;
123};
124
125NV_PMU_BOARDOBJ_GRP_SET_MAKE_E32(clk, clk_domain);
126
127struct nv_pmu_clk_clk_prog_boardobjgrp_set_header {
128 struct nv_pmu_boardobjgrp_e255 super;
129 u8 slave_entry_count;
130 u8 vf_entry_count;
131};
132
133struct nv_pmu_clk_clk_prog_boardobj_set {
134 struct nv_pmu_boardobj super;
135};
136
137struct nv_pmu_clk_clk_prog_1x_boardobj_set {
138 struct nv_pmu_clk_clk_prog_boardobj_set super;
139 u8 source;
140 u16 freq_max_mhz;
141 union ctrl_clk_clk_prog_1x_source_data source_data;
142};
143
144struct nv_pmu_clk_clk_prog_1x_master_boardobj_set {
145 struct nv_pmu_clk_clk_prog_1x_boardobj_set super;
146 bool b_o_c_o_v_enabled;
147 struct ctrl_clk_clk_prog_1x_master_vf_entry vf_entries[
148 CTRL_CLK_CLK_PROG_1X_MASTER_VF_ENTRY_MAX_ENTRIES];
149 union ctrl_clk_clk_prog_1x_master_source_data source_data;
150 struct ctrl_clk_clk_delta deltas;
151};
152
153struct nv_pmu_clk_clk_prog_1x_master_ratio_boardobj_set {
154 struct nv_pmu_clk_clk_prog_1x_master_boardobj_set super;
155 struct ctrl_clk_clk_prog_1x_master_ratio_slave_entry slave_entries[
156 CTRL_CLK_PROG_1X_MASTER_MAX_SLAVE_ENTRIES];
157};
158
159struct nv_pmu_clk_clk_prog_1x_master_table_boardobj_set {
160 struct nv_pmu_clk_clk_prog_1x_master_boardobj_set super;
161 struct ctrl_clk_clk_prog_1x_master_table_slave_entry
162 slave_entries[CTRL_CLK_PROG_1X_MASTER_MAX_SLAVE_ENTRIES];
163};
164
165union nv_pmu_clk_clk_prog_boardobj_set_union {
166 struct nv_pmu_boardobj board_obj;
167 struct nv_pmu_clk_clk_prog_boardobj_set super;
168 struct nv_pmu_clk_clk_prog_1x_boardobj_set v1x;
169 struct nv_pmu_clk_clk_prog_1x_master_boardobj_set v1x_master;
170 struct nv_pmu_clk_clk_prog_1x_master_ratio_boardobj_set v1x_master_ratio;
171 struct nv_pmu_clk_clk_prog_1x_master_table_boardobj_set v1x_master_table;
172};
173
174NV_PMU_BOARDOBJ_GRP_SET_MAKE_E255(clk, clk_prog);
175
176struct nv_pmu_clk_lut_device_desc {
177 u8 vselect_mode;
178 u16 hysteresis_threshold;
179};
180
181struct nv_pmu_clk_regime_desc {
182 u8 regime_id;
183 u16 fixed_freq_regime_limit_mhz;
184};
185
186struct nv_pmu_clk_clk_fll_device_boardobjgrp_set_header {
187 struct nv_pmu_boardobjgrp_e32 super;
188 struct ctrl_boardobjgrp_mask_e32 lut_prog_master_mask;
189 u32 lut_step_size_uv;
190 u32 lut_min_voltage_uv;
191 u8 lut_num_entries;
192 u16 max_min_freq_mhz;
193};
194
195struct nv_pmu_clk_clk_fll_device_boardobj_set {
196 struct nv_pmu_boardobj super;
197 u8 id;
198 u8 mdiv;
199 u8 vin_idx_logic;
200 u8 vin_idx_sram;
201 u8 rail_idx_for_lut;
202 u16 input_freq_mhz;
203 u32 clk_domain;
204 struct nv_pmu_clk_lut_device_desc lut_device;
205 struct nv_pmu_clk_regime_desc regime_desc;
206 u8 min_freq_vfe_idx;
207 u8 freq_ctrl_idx;
208 struct ctrl_boardobjgrp_mask_e32 lut_prog_broadcast_slave_mask;
209};
210
211union nv_pmu_clk_clk_fll_device_boardobj_set_union {
212 struct nv_pmu_boardobj board_obj;
213 struct nv_pmu_clk_clk_fll_device_boardobj_set super;
214};
215
216NV_PMU_BOARDOBJ_GRP_SET_MAKE_E32(clk, clk_fll_device);
217
218struct nv_pmu_clk_clk_vin_device_boardobjgrp_set_header {
219 struct nv_pmu_boardobjgrp_e32 super;
220 bool b_vin_is_disable_allowed;
221};
222
223struct nv_pmu_clk_clk_vin_device_boardobj_set {
224 struct nv_pmu_boardobj super;
225 u8 id;
226 u8 volt_domain;
227 u32 slope;
228 u32 intercept;
229 u32 flls_shared_mask;
230};
231
232union nv_pmu_clk_clk_vin_device_boardobj_set_union {
233 struct nv_pmu_boardobj board_obj;
234 struct nv_pmu_clk_clk_vin_device_boardobj_set super;
235};
236
237NV_PMU_BOARDOBJ_GRP_SET_MAKE_E32(clk, clk_vin_device);
238
239struct nv_pmu_clk_clk_vf_point_boardobjgrp_set_header {
240 struct nv_pmu_boardobjgrp_e255 super;
241};
242
243struct nv_pmu_clk_clk_vf_point_boardobj_set {
244 struct nv_pmu_boardobj super;
245 u8 vfe_equ_idx;
246 u8 volt_rail_idx;
247};
248
249struct nv_pmu_clk_clk_vf_point_freq_boardobj_set {
250 struct nv_pmu_clk_clk_vf_point_boardobj_set super;
251 u16 freq_mhz;
252 int volt_delta_uv;
253};
254
255struct nv_pmu_clk_clk_vf_point_volt_boardobj_set {
256 struct nv_pmu_clk_clk_vf_point_boardobj_set super;
257 u32 source_voltage_uv;
258 int freq_delta_khz;
259};
260
261union nv_pmu_clk_clk_vf_point_boardobj_set_union {
262 struct nv_pmu_boardobj board_obj;
263 struct nv_pmu_clk_clk_vf_point_boardobj_set super;
264 struct nv_pmu_clk_clk_vf_point_freq_boardobj_set freq;
265 struct nv_pmu_clk_clk_vf_point_volt_boardobj_set volt;
266};
267
268NV_PMU_BOARDOBJ_GRP_SET_MAKE_E255(clk, clk_vf_point);
269
270struct nv_pmu_clk_clk_vf_point_boardobjgrp_get_status_header {
271 struct nv_pmu_boardobjgrp_e255 super;
272};
273
274struct nv_pmu_clk_clk_vf_point_boardobj_get_status {
275 struct nv_pmu_boardobj super;
276 struct ctrl_clk_vf_pair pair;
277};
278
279struct nv_pmu_clk_clk_vf_point_volt_boardobj_get_status {
280 struct nv_pmu_clk_clk_vf_point_boardobj_get_status super;
281 u16 vf_gain_value;
282};
283
284union nv_pmu_clk_clk_vf_point_boardobj_get_status_union {
285 struct nv_pmu_boardobj board_obj;
286 struct nv_pmu_clk_clk_vf_point_boardobj_get_status super;
287 struct nv_pmu_clk_clk_vf_point_volt_boardobj_get_status volt;
288};
289
290NV_PMU_BOARDOBJ_GRP_GET_STATUS_MAKE_E255(clk, clk_vf_point);
291
292#define NV_PMU_VF_INJECT_MAX_CLOCK_DOMAINS (12)
293
294struct nv_pmu_clk_clk_domain_list {
295 u8 num_domains;
296 struct ctrl_clk_clk_domain_list_item clk_domains[
297 NV_PMU_VF_INJECT_MAX_CLOCK_DOMAINS];
298};
299
300struct nv_pmu_clk_vf_change_inject {
301 u8 flags;
302 struct nv_pmu_clk_clk_domain_list clk_list;
303 struct nv_pmu_volt_volt_rail_list volt_list;
304};
305
306#define NV_NV_PMU_CLK_LOAD_FEATURE_VIN (0x00000002)
307#define NV_NV_PMU_CLK_LOAD_ACTION_MASK_VIN_HW_CAL_PROGRAM_YES (0x00000001)
308
309struct nv_pmu_clk_load_payload_freq_controllers {
310 struct ctrl_boardobjgrp_mask_e32 load_mask;
311};
312
313struct nv_pmu_clk_load {
314 u8 feature;
315 u32 action_mask;
316 union {
317 struct nv_pmu_clk_load_payload_freq_controllers freq_controllers;
318 } payload;
319};
320/* CLK_FREQ_CONTROLLER */
321#define NV_NV_PMU_CLK_LOAD_FEATURE_FREQ_CONTROLLER (0x00000003)
322
323#define NV_NV_PMU_CLK_LOAD_ACTION_MASK_FREQ_CONTROLLER_CALLBACK_NO (0x00000000)
324#define NV_NV_PMU_CLK_LOAD_ACTION_MASK_FREQ_CONTROLLER_CALLBACK_YES (0x00000002)
325
326struct nv_pmu_clk_clk_freq_controller_boardobjgrp_set_header {
327 struct nv_pmu_boardobjgrp_e32 super;
328 u32 sampling_period_ms;
329 u8 volt_policy_idx;
330};
331
332struct nv_pmu_clk_clk_freq_controller_boardobj_set {
333 struct nv_pmu_boardobj super;
334 u8 controller_id;
335 u8 parts_freq_mode;
336 bool bdisable;
337 u32 clk_domain;
338 s16 freq_cap_noise_unaware_vmin_above;
339 s16 freq_cap_noise_unaware_vmin_below;
340 s16 freq_hyst_pos_mhz;
341 s16 freq_hyst_neg_mhz;
342};
343
344struct nv_pmu_clk_clk_freq_controller_pi_boardobj_set {
345 struct nv_pmu_clk_clk_freq_controller_boardobj_set super;
346 s32 prop_gain;
347 s32 integ_gain;
348 s32 integ_decay;
349 s32 volt_delta_min;
350 s32 volt_delta_max;
351 u8 slowdown_pct_min;
352 bool bpoison;
353};
354
355union nv_pmu_clk_clk_freq_controller_boardobj_set_union {
356 struct nv_pmu_boardobj board_obj;
357 struct nv_pmu_clk_clk_freq_controller_boardobj_set super;
358 struct nv_pmu_clk_clk_freq_controller_pi_boardobj_set pi;
359};
360
361NV_PMU_BOARDOBJ_GRP_SET_MAKE_E32(clk, clk_freq_controller);
362
363/* CLK CMD ID definitions. */
364#define NV_PMU_CLK_CMD_ID_BOARDOBJ_GRP_SET (0x00000000)
365#define NV_PMU_CLK_CMD_ID_RPC (0x00000001)
366#define NV_PMU_CLK_CMD_ID_BOARDOBJ_GRP_GET_STATUS (0x00000002)
367
368#define NV_PMU_CLK_RPC_ID_LOAD (0x00000002)
369#define NV_PMU_CLK_RPC_ID_CLK_VF_CHANGE_INJECT (0x00000001)
370
371struct nv_pmu_clk_cmd_rpc {
372 u8 cmd_type;
373 u8 pad[3];
374 struct nv_pmu_allocation request;
375};
376
377#define NV_PMU_CLK_CMD_RPC_ALLOC_OFFSET \
378 (offsetof(struct nv_pmu_clk_cmd_rpc, request))
379
380struct nv_pmu_clk_cmd {
381 union {
382 u8 cmd_type;
383 struct nv_pmu_boardobj_cmd_grp grp_set;
384 struct nv_pmu_clk_cmd_rpc rpc;
385 struct nv_pmu_boardobj_cmd_grp grp_get_status;
386 };
387};
388
389struct nv_pmu_clk_rpc {
390 u8 function;
391 bool b_supported;
392 bool b_success;
393 flcn_status flcn_status;
394 union {
395 struct nv_pmu_clk_vf_change_inject clk_vf_change_inject;
396 struct nv_pmu_clk_load clk_load;
397 } params;
398};
399
400/* CLK MSG ID definitions */
401#define NV_PMU_CLK_MSG_ID_BOARDOBJ_GRP_SET (0x00000000)
402#define NV_PMU_CLK_MSG_ID_RPC (0x00000001)
403#define NV_PMU_CLK_MSG_ID_BOARDOBJ_GRP_GET_STATUS (0x00000002)
404
405struct nv_pmu_clk_msg_rpc {
406 u8 msg_type;
407 u8 rsvd[3];
408 struct nv_pmu_allocation response;
409};
410
411#define NV_PMU_CLK_MSG_RPC_ALLOC_OFFSET \
412 offsetof(struct nv_pmu_clk_msg_rpc, response)
413
414struct nv_pmu_clk_msg {
415 union {
416 u8 msg_type;
417 struct nv_pmu_boardobj_msg_grp grp_set;
418 struct nv_pmu_clk_msg_rpc rpc;
419 struct nv_pmu_boardobj_msg_grp grp_get_status;
420 };
421};
422
423struct nv_pmu_clk_clk_vin_device_boardobjgrp_get_status_header {
424 struct nv_pmu_boardobjgrp_e32 super;
425};
426
427struct nv_pmu_clk_clk_vin_device_boardobj_get_status {
428 struct nv_pmu_boardobj_query super;
429 u32 actual_voltage_uv;
430 u32 corrected_voltage_uv;
431 u8 sampled_code;
432 u8 override_code;
433};
434
435union nv_pmu_clk_clk_vin_device_boardobj_get_status_union {
436 struct nv_pmu_boardobj_query board_obj;
437 struct nv_pmu_clk_clk_vin_device_boardobj_get_status super;
438};
439
440NV_PMU_BOARDOBJ_GRP_GET_STATUS_MAKE_E32(clk, clk_vin_device);
441
442struct nv_pmu_clk_lut_vf_entry {
443 u32 entry;
444};
445
446struct nv_pmu_clk_clk_fll_device_boardobjgrp_get_status_header {
447 struct nv_pmu_boardobjgrp_e32 super;
448};
449
450struct nv_pmu_clk_clk_fll_device_boardobj_get_status {
451 struct nv_pmu_boardobj_query super;
452 u8 current_regime_id;
453 u16 min_freq_mhz;
454 struct nv_pmu_clk_lut_vf_entry lut_vf_curve[NV_UNSIGNED_ROUNDED_DIV(CTRL_CLK_LUT_NUM_ENTRIES, 2)];
455};
456
457union nv_pmu_clk_clk_fll_device_boardobj_get_status_union {
458 struct nv_pmu_boardobj_query board_obj;
459 struct nv_pmu_clk_clk_fll_device_boardobj_get_status super;
460};
461
462NV_PMU_BOARDOBJ_GRP_GET_STATUS_MAKE_E32(clk, clk_fll_device);
463
464#endif /*_GPMUIFCLK_H_*/
diff --git a/drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuifperf.h b/drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuifperf.h
new file mode 100644
index 00000000..83d08afc
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuifperf.h
@@ -0,0 +1,126 @@
1/*
2 * Copyright (c) 2016-2017, 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#ifndef _GPMUIFPERF_H_
23#define _GPMUIFPERF_H_
24
25#include "gpmuifvolt.h"
26#include "gpmuifperfvfe.h"
27
28/*
29* Enumeration of BOARDOBJGRP class IDs within OBJPERF. Used as "classId"
30* argument for communications between Kernel and PMU via the various generic
31* BOARDOBJGRP interfaces.
32*/
33#define NV_PMU_PERF_BOARDOBJGRP_CLASS_ID_VFE_VAR 0x00
34#define NV_PMU_PERF_BOARDOBJGRP_CLASS_ID_VFE_EQU 0x01
35
36#define NV_PMU_PERF_CMD_ID_RPC (0x00000002)
37#define NV_PMU_PERF_CMD_ID_BOARDOBJ_GRP_SET (0x00000003)
38#define NV_PMU_PERF_CMD_ID_BOARDOBJ_GRP_GET_STATUS (0x00000004)
39
40struct nv_pmu_perf_cmd_set_object {
41 u8 cmd_type;
42 u8 pad[2];
43 u8 object_type;
44 struct nv_pmu_allocation object;
45};
46
47#define NV_PMU_PERF_SET_OBJECT_ALLOC_OFFSET \
48 (offsetof(struct nv_pmu_perf_cmd_set_object, object))
49
50/* RPC IDs */
51#define NV_PMU_PERF_RPC_ID_VFE_LOAD (0x00000001)
52
53/*!
54* Command requesting execution of the perf RPC.
55*/
56struct nv_pmu_perf_cmd_rpc {
57 u8 cmd_type;
58 u8 pad[3];
59 struct nv_pmu_allocation request;
60};
61
62#define NV_PMU_PERF_CMD_RPC_ALLOC_OFFSET \
63 offsetof(struct nv_pmu_perf_cmd_rpc, request)
64
65/*!
66* Simply a union of all specific PERF commands. Forms the general packet
67* exchanged between the Kernel and PMU when sending and receiving PERF commands
68* (respectively).
69*/
70struct nv_pmu_perf_cmd {
71 union {
72 u8 cmd_type;
73 struct nv_pmu_perf_cmd_set_object set_object;
74 struct nv_pmu_boardobj_cmd_grp grp_set;
75 struct nv_pmu_boardobj_cmd_grp grp_get_status;
76 };
77};
78
79/*!
80* Defines the data structure used to invoke PMU perf RPCs. Same structure is
81* used to return the result of the RPC execution.
82*/
83struct nv_pmu_perf_rpc {
84 u8 function;
85 bool b_supported;
86 bool b_success;
87 flcn_status flcn_status;
88 union {
89 struct nv_pmu_perf_rpc_vfe_equ_eval vfe_equ_eval;
90 struct nv_pmu_perf_rpc_vfe_load vfe_load;
91 } params;
92};
93
94
95/* PERF Message-type Definitions */
96#define NV_PMU_PERF_MSG_ID_RPC (0x00000003)
97#define NV_PMU_PERF_MSG_ID_BOARDOBJ_GRP_SET (0x00000004)
98#define NV_PMU_PERF_MSG_ID_BOARDOBJ_GRP_GET_STATUS (0x00000006)
99#define NV_PMU_PERF_MSG_ID_VFE_CALLBACK (0x00000005)
100
101/*!
102* Message carrying the result of the perf RPC execution.
103*/
104struct nv_pmu_perf_msg_rpc {
105 u8 msg_type;
106 u8 rsvd[3];
107 struct nv_pmu_allocation response;
108};
109
110#define NV_PMU_PERF_MSG_RPC_ALLOC_OFFSET \
111 (offsetof(struct nv_pmu_perf_msg_rpc, response))
112
113/*!
114* Simply a union of all specific PERF messages. Forms the general packet
115* exchanged between the Kernel and PMU when sending and receiving PERF messages
116* (respectively).
117*/
118struct nv_pmu_perf_msg {
119 union {
120 u8 msg_type;
121 struct nv_pmu_perf_msg_rpc rpc;
122 struct nv_pmu_boardobj_msg_grp grp_set;
123 };
124};
125
126#endif /* _GPMUIFPERF_H_*/
diff --git a/drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuifperfvfe.h b/drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuifperfvfe.h
new file mode 100644
index 00000000..18568a4d
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuifperfvfe.h
@@ -0,0 +1,229 @@
1/*
2 * Copyright (c) 2016-2017, 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#ifndef _GPMUIFPERFVFE_H_
23#define _GPMUIFPERFVFE_H_
24
25#include "gpmuifbios.h"
26#include "gpmuifboardobj.h"
27
28#define CTRL_PERF_VFE_EQU_QUADRATIC_COEFF_COUNT 0x03
29#define NV_PMU_PERF_RPC_VFE_EQU_EVAL_VAR_COUNT_MAX 2
30#define NV_PMU_PERF_RPC_VFE_EQU_MONITOR_COUNT_MAX 16
31#define NV_PMU_VFE_VAR_SINGLE_SENSED_FUSE_SEGMENTS_MAX 1
32
33struct nv_pmu_perf_vfe_var_value {
34 u8 var_type;
35 u8 reserved[3];
36 u32 var_value;
37};
38
39union nv_pmu_perf_vfe_equ_result {
40 u32 freq_m_hz;
41 u32 voltu_v;
42 u32 vf_gain;
43 int volt_deltau_v;
44};
45
46struct nv_pmu_perf_rpc_vfe_equ_eval {
47 u8 equ_idx;
48 u8 var_count;
49 u8 output_type;
50 struct nv_pmu_perf_vfe_var_value var_values[
51 NV_PMU_PERF_RPC_VFE_EQU_EVAL_VAR_COUNT_MAX];
52 union nv_pmu_perf_vfe_equ_result result;
53};
54
55struct nv_pmu_perf_rpc_vfe_load {
56 bool b_load;
57};
58
59struct nv_pmu_perf_vfe_var_boardobjgrp_get_status_header {
60 struct nv_pmu_boardobjgrp_e32 super;
61};
62
63struct nv_pmu_perf_vfe_var_get_status_super {
64 struct nv_pmu_boardobj_query board_obj;
65};
66
67struct nv_pmu_perf_vfe_var_single_sensed_fuse_get_status {
68 struct nv_pmu_perf_vfe_var_get_status_super super;
69 u32 fuse_value_integer;
70 u32 fuse_value_hw_integer;
71 u8 fuse_version;
72 bool b_version_check_failed;
73};
74
75union nv_pmu_perf_vfe_var_boardobj_get_status_union {
76 struct nv_pmu_boardobj_query board_obj;
77 struct nv_pmu_perf_vfe_var_get_status_super super;
78 struct nv_pmu_perf_vfe_var_single_sensed_fuse_get_status fuse_status;
79};
80
81NV_PMU_BOARDOBJ_GRP_GET_STATUS_MAKE_E32(perf, vfe_var);
82
83struct nv_pmu_vfe_var {
84 struct nv_pmu_boardobj super;
85 u32 out_range_min;
86 u32 out_range_max;
87};
88
89struct nv_pmu_vfe_var_derived {
90 struct nv_pmu_vfe_var super;
91};
92
93struct nv_pmu_vfe_var_derived_product {
94 struct nv_pmu_vfe_var_derived super;
95 u8 var_idx0;
96 u8 var_idx1;
97};
98
99struct nv_pmu_vfe_var_derived_sum {
100 struct nv_pmu_vfe_var_derived super;
101 u8 var_idx0;
102 u8 var_idx1;
103};
104
105struct nv_pmu_vfe_var_single {
106 struct nv_pmu_vfe_var super;
107 u8 override_type;
108 u32 override_value;
109};
110
111struct nv_pmu_vfe_var_single_frequency {
112 struct nv_pmu_vfe_var_single super;
113};
114
115struct nv_pmu_vfe_var_single_sensed {
116 struct nv_pmu_vfe_var_single super;
117};
118
119struct nv_pmu_vfe_var_single_sensed_fuse_info {
120 u8 segment_count;
121 union nv_pmu_bios_vfield_register_segment segments[
122 NV_PMU_VFE_VAR_SINGLE_SENSED_FUSE_SEGMENTS_MAX];
123};
124
125struct nv_pmu_vfe_var_single_sensed_fuse_vfield_info {
126 struct nv_pmu_vfe_var_single_sensed_fuse_info fuse;
127 u32 fuse_val_default;
128 int hw_correction_scale;
129 int hw_correction_offset;
130 u8 v_field_id;
131};
132
133struct nv_pmu_vfe_var_single_sensed_fuse_ver_vfield_info {
134 struct nv_pmu_vfe_var_single_sensed_fuse_info fuse;
135 u8 ver_expected;
136 bool b_ver_check;
137 bool b_use_default_on_ver_check_fail;
138 u8 v_field_id_ver;
139};
140
141struct nv_pmu_vfe_var_single_sensed_fuse_override_info {
142 u32 fuse_val_override;
143 bool b_fuse_regkey_override;
144};
145
146struct nv_pmu_vfe_var_single_sensed_fuse {
147 struct nv_pmu_vfe_var_single_sensed super;
148 struct nv_pmu_vfe_var_single_sensed_fuse_override_info override_info;
149 struct nv_pmu_vfe_var_single_sensed_fuse_vfield_info vfield_info;
150 struct nv_pmu_vfe_var_single_sensed_fuse_ver_vfield_info vfield_ver_info;
151};
152
153struct nv_pmu_vfe_var_single_sensed_temp {
154 struct nv_pmu_vfe_var_single_sensed super;
155 u8 therm_channel_index;
156 int temp_hysteresis_positive;
157 int temp_hysteresis_negative;
158 int temp_default;
159};
160
161struct nv_pmu_vfe_var_single_voltage {
162 struct nv_pmu_vfe_var_single super;
163};
164
165struct nv_pmu_perf_vfe_var_boardobjgrp_set_header {
166 struct nv_pmu_boardobjgrp_e32 super;
167 u8 polling_periodms;
168};
169
170union nv_pmu_perf_vfe_var_boardobj_set_union {
171 struct nv_pmu_boardobj board_obj;
172 struct nv_pmu_vfe_var var;
173 struct nv_pmu_vfe_var_derived var_derived;
174 struct nv_pmu_vfe_var_derived_product var_derived_product;
175 struct nv_pmu_vfe_var_derived_sum var_derived_sum;
176 struct nv_pmu_vfe_var_single var_single;
177 struct nv_pmu_vfe_var_single_frequency var_single_frequiency;
178 struct nv_pmu_vfe_var_single_sensed var_single_sensed;
179 struct nv_pmu_vfe_var_single_sensed_fuse var_single_sensed_fuse;
180 struct nv_pmu_vfe_var_single_sensed_temp var_single_sensed_temp;
181 struct nv_pmu_vfe_var_single_voltage var_single_voltage;
182};
183
184NV_PMU_BOARDOBJ_GRP_SET_MAKE_E32(perf, vfe_var);
185
186struct nv_pmu_vfe_equ {
187 struct nv_pmu_boardobj super;
188 u8 var_idx;
189 u8 equ_idx_next;
190 u8 output_type;
191 u32 out_range_min;
192 u32 out_range_max;
193};
194
195struct nv_pmu_vfe_equ_compare {
196 struct nv_pmu_vfe_equ super;
197 u8 func_id;
198 u8 equ_idx_true;
199 u8 equ_idx_false;
200 u32 criteria;
201};
202
203struct nv_pmu_vfe_equ_minmax {
204 struct nv_pmu_vfe_equ super;
205 bool b_max;
206 u8 equ_idx0;
207 u8 equ_idx1;
208};
209
210struct nv_pmu_vfe_equ_quadratic {
211 struct nv_pmu_vfe_equ super;
212 u32 coeffs[CTRL_PERF_VFE_EQU_QUADRATIC_COEFF_COUNT];
213};
214
215struct nv_pmu_perf_vfe_equ_boardobjgrp_set_header {
216 struct nv_pmu_boardobjgrp_e255 super;
217};
218
219union nv_pmu_perf_vfe_equ_boardobj_set_union {
220 struct nv_pmu_boardobj board_obj;
221 struct nv_pmu_vfe_equ equ;
222 struct nv_pmu_vfe_equ_compare equ_comapre;
223 struct nv_pmu_vfe_equ_minmax equ_minmax;
224 struct nv_pmu_vfe_equ_quadratic equ_quadratic;
225};
226
227NV_PMU_BOARDOBJ_GRP_SET_MAKE_E255(perf, vfe_equ);
228
229#endif /* _GPMUIFPERFVFE_H_*/
diff --git a/drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuifpmgr.h b/drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuifpmgr.h
new file mode 100644
index 00000000..4ac86092
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuifpmgr.h
@@ -0,0 +1,443 @@
1/*
2* Copyright (c) 2016-2017, 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#ifndef _GPMUIFPMGR_H_
24#define _GPMUIFPMGR_H_
25
26#include "ctrl/ctrlpmgr.h"
27#include "gpmuifboardobj.h"
28#include <nvgpu/flcnif_cmn.h>
29
30struct nv_pmu_pmgr_i2c_device_desc {
31 struct nv_pmu_boardobj super;
32 u8 dcb_index;
33 u16 i2c_address;
34 u32 i2c_flags;
35 u8 i2c_port;
36};
37
38#define NV_PMU_PMGR_I2C_DEVICE_DESC_TABLE_MAX_DEVICES (32)
39
40struct nv_pmu_pmgr_i2c_device_desc_table {
41 u32 dev_mask;
42 struct nv_pmu_pmgr_i2c_device_desc
43 devices[NV_PMU_PMGR_I2C_DEVICE_DESC_TABLE_MAX_DEVICES];
44};
45
46struct nv_pmu_pmgr_pwr_device_desc {
47 struct nv_pmu_boardobj super;
48 u32 power_corr_factor;
49};
50
51#define NV_PMU_PMGR_PWR_DEVICE_INA3221_CH_NUM 0x03
52
53struct nv_pmu_pmgr_pwr_device_desc_ina3221 {
54 struct nv_pmu_pmgr_pwr_device_desc super;
55 u8 i2c_dev_idx;
56 struct ctrl_pmgr_pwr_device_info_rshunt
57 r_shuntm_ohm[NV_PMU_PMGR_PWR_DEVICE_INA3221_CH_NUM];
58 u16 configuration;
59 u16 mask_enable;
60 u32 event_mask;
61 u16 curr_correct_m;
62 s16 curr_correct_b;
63};
64
65union nv_pmu_pmgr_pwr_device_desc_union {
66 struct nv_pmu_boardobj board_obj;
67 struct nv_pmu_pmgr_pwr_device_desc pwr_dev;
68 struct nv_pmu_pmgr_pwr_device_desc_ina3221 ina3221;
69};
70
71struct nv_pmu_pmgr_pwr_device_ba_info {
72 bool b_initialized_and_used;
73};
74
75struct nv_pmu_pmgr_pwr_device_desc_table_header {
76 struct nv_pmu_boardobjgrp_e32 super;
77 struct nv_pmu_pmgr_pwr_device_ba_info ba_info;
78};
79
80NV_PMU_MAKE_ALIGNED_STRUCT(nv_pmu_pmgr_pwr_device_desc_table_header,
81 sizeof(struct nv_pmu_pmgr_pwr_device_desc_table_header));
82NV_PMU_MAKE_ALIGNED_UNION(nv_pmu_pmgr_pwr_device_desc_union,
83 sizeof(union nv_pmu_pmgr_pwr_device_desc_union));
84
85struct nv_pmu_pmgr_pwr_device_desc_table {
86 union nv_pmu_pmgr_pwr_device_desc_table_header_aligned hdr;
87 union nv_pmu_pmgr_pwr_device_desc_union_aligned
88 devices[CTRL_PMGR_PWR_DEVICES_MAX_DEVICES];
89};
90
91union nv_pmu_pmgr_pwr_device_dmem_size {
92 union nv_pmu_pmgr_pwr_device_desc_table_header_aligned pwr_device_hdr;
93 union nv_pmu_pmgr_pwr_device_desc_union_aligned pwr_device;
94};
95
96struct nv_pmu_pmgr_pwr_channel {
97 struct nv_pmu_boardobj super;
98 u8 pwr_rail;
99 u8 ch_idx;
100 u32 volt_fixedu_v;
101 u32 pwr_corr_slope;
102 s32 pwr_corr_offsetm_w;
103 u32 curr_corr_slope;
104 s32 curr_corr_offsetm_a;
105 u32 dependent_ch_mask;
106};
107
108#define NV_PMU_PMGR_PWR_CHANNEL_MAX_CHANNELS 16
109
110#define NV_PMU_PMGR_PWR_CHANNEL_MAX_CHRELATIONSHIPS 16
111
112struct nv_pmu_pmgr_pwr_channel_sensor {
113 struct nv_pmu_pmgr_pwr_channel super;
114 u8 pwr_dev_idx;
115 u8 pwr_dev_prov_idx;
116};
117
118struct nv_pmu_pmgr_pwr_channel_pmu_compactible {
119 u8 pmu_compactible_data[56];
120};
121
122union nv_pmu_pmgr_pwr_channel_union {
123 struct nv_pmu_boardobj board_obj;
124 struct nv_pmu_pmgr_pwr_channel pwr_channel;
125 struct nv_pmu_pmgr_pwr_channel_sensor sensor;
126 struct nv_pmu_pmgr_pwr_channel_pmu_compactible pmu_pwr_channel;
127};
128
129#define NV_PMU_PMGR_PWR_MONITOR_TYPE_NO_POLLING 0x02
130
131struct nv_pmu_pmgr_pwr_monitor_pstate {
132 u32 hw_channel_mask;
133};
134
135union nv_pmu_pmgr_pwr_monitor_type_specific {
136 struct nv_pmu_pmgr_pwr_monitor_pstate pstate;
137};
138
139struct nv_pmu_pmgr_pwr_chrelationship_pmu_compactible {
140 u8 pmu_compactible_data[28];
141};
142
143union nv_pmu_pmgr_pwr_chrelationship_union {
144 struct nv_pmu_boardobj board_obj;
145 struct nv_pmu_pmgr_pwr_chrelationship_pmu_compactible pmu_pwr_chrelationship;
146};
147
148struct nv_pmu_pmgr_pwr_channel_header {
149 struct nv_pmu_boardobjgrp_e32 super;
150 u8 type;
151 union nv_pmu_pmgr_pwr_monitor_type_specific type_specific;
152 u8 sample_count;
153 u16 sampling_periodms;
154 u16 sampling_period_low_powerms;
155 u32 total_gpu_power_channel_mask;
156 u32 physical_channel_mask;
157};
158
159struct nv_pmu_pmgr_pwr_chrelationship_header {
160 struct nv_pmu_boardobjgrp_e32 super;
161};
162
163NV_PMU_MAKE_ALIGNED_STRUCT(nv_pmu_pmgr_pwr_channel_header,
164 sizeof(struct nv_pmu_pmgr_pwr_channel_header));
165NV_PMU_MAKE_ALIGNED_STRUCT(nv_pmu_pmgr_pwr_chrelationship_header,
166 sizeof(struct nv_pmu_pmgr_pwr_chrelationship_header));
167NV_PMU_MAKE_ALIGNED_UNION(nv_pmu_pmgr_pwr_chrelationship_union,
168 sizeof(union nv_pmu_pmgr_pwr_chrelationship_union));
169NV_PMU_MAKE_ALIGNED_UNION(nv_pmu_pmgr_pwr_channel_union,
170 sizeof(union nv_pmu_pmgr_pwr_channel_union));
171
172struct nv_pmu_pmgr_pwr_channel_desc {
173 union nv_pmu_pmgr_pwr_channel_header_aligned hdr;
174 union nv_pmu_pmgr_pwr_channel_union_aligned
175 channels[NV_PMU_PMGR_PWR_CHANNEL_MAX_CHANNELS];
176};
177
178struct nv_pmu_pmgr_pwr_chrelationship_desc {
179 union nv_pmu_pmgr_pwr_chrelationship_header_aligned hdr;
180 union nv_pmu_pmgr_pwr_chrelationship_union_aligned
181 ch_rels[NV_PMU_PMGR_PWR_CHANNEL_MAX_CHRELATIONSHIPS];
182};
183
184union nv_pmu_pmgr_pwr_monitor_dmem_size {
185 union nv_pmu_pmgr_pwr_channel_header_aligned channel_hdr;
186 union nv_pmu_pmgr_pwr_channel_union_aligned channel;
187 union nv_pmu_pmgr_pwr_chrelationship_header_aligned ch_rels_hdr;
188 union nv_pmu_pmgr_pwr_chrelationship_union_aligned ch_rels;
189};
190
191struct nv_pmu_pmgr_pwr_monitor_pack {
192 struct nv_pmu_pmgr_pwr_channel_desc channels;
193 struct nv_pmu_pmgr_pwr_chrelationship_desc ch_rels;
194};
195
196#define NV_PMU_PMGR_PWR_POLICY_MAX_POLICIES 32
197
198#define NV_PMU_PMGR_PWR_POLICY_MAX_POLICY_RELATIONSHIPS 32
199
200struct nv_pmu_pmgr_pwr_policy {
201 struct nv_pmu_boardobj super;
202 u8 ch_idx;
203 u8 num_limit_inputs;
204 u8 limit_unit;
205 u8 sample_mult;
206 u32 limit_curr;
207 u32 limit_min;
208 u32 limit_max;
209 struct ctrl_pmgr_pwr_policy_info_integral integral;
210 enum ctrl_pmgr_pwr_policy_filter_type filter_type;
211 union ctrl_pmgr_pwr_policy_filter_param filter_param;
212};
213
214struct nv_pmu_pmgr_pwr_policy_hw_threshold {
215 struct nv_pmu_pmgr_pwr_policy super;
216 u8 threshold_idx;
217 u8 low_threshold_idx;
218 bool b_use_low_threshold;
219 u16 low_threshold_value;
220};
221
222struct nv_pmu_pmgr_pwr_policy_sw_threshold {
223 struct nv_pmu_pmgr_pwr_policy super;
224 u8 threshold_idx;
225 u8 low_threshold_idx;
226 bool b_use_low_threshold;
227 u16 low_threshold_value;
228 u8 event_id;
229};
230
231struct nv_pmu_pmgr_pwr_policy_pmu_compactible {
232 u8 pmu_compactible_data[68];
233};
234
235union nv_pmu_pmgr_pwr_policy_union {
236 struct nv_pmu_boardobj board_obj;
237 struct nv_pmu_pmgr_pwr_policy pwr_policy;
238 struct nv_pmu_pmgr_pwr_policy_hw_threshold hw_threshold;
239 struct nv_pmu_pmgr_pwr_policy_sw_threshold sw_threshold;
240 struct nv_pmu_pmgr_pwr_policy_pmu_compactible pmu_pwr_policy;
241};
242
243struct nv_pmu_pmgr_pwr_policy_relationship_pmu_compactible {
244 u8 pmu_compactible_data[24];
245};
246
247union nv_pmu_pmgr_pwr_policy_relationship_union {
248 struct nv_pmu_boardobj board_obj;
249 struct nv_pmu_pmgr_pwr_policy_relationship_pmu_compactible pmu_pwr_relationship;
250};
251
252struct nv_pmu_pmgr_pwr_violation_pmu_compactible {
253 u8 pmu_compactible_data[16];
254};
255
256union nv_pmu_pmgr_pwr_violation_union {
257 struct nv_pmu_boardobj board_obj;
258 struct nv_pmu_pmgr_pwr_violation_pmu_compactible violation;
259};
260
261#define NV_PMU_PMGR_PWR_POLICY_DESC_TABLE_VERSION_3X 0x30
262
263NV_PMU_MAKE_ALIGNED_UNION(nv_pmu_pmgr_pwr_policy_union,
264 sizeof(union nv_pmu_pmgr_pwr_policy_union));
265NV_PMU_MAKE_ALIGNED_UNION(nv_pmu_pmgr_pwr_policy_relationship_union,
266 sizeof(union nv_pmu_pmgr_pwr_policy_relationship_union));
267
268#define NV_PMU_PERF_DOMAIN_GROUP_MAX_GROUPS 2
269
270struct nv_pmu_perf_domain_group_limits
271{
272 u32 values[NV_PMU_PERF_DOMAIN_GROUP_MAX_GROUPS];
273} ;
274
275#define NV_PMU_PMGR_RESERVED_PWR_POLICY_MASK_COUNT 0x6
276
277struct nv_pmu_pmgr_pwr_policy_desc_header {
278 struct nv_pmu_boardobjgrp_e32 super;
279 u8 version;
280 bool b_enabled;
281 u8 low_sampling_mult;
282 u8 semantic_policy_tbl[CTRL_PMGR_PWR_POLICY_IDX_NUM_INDEXES];
283 u16 base_sample_period;
284 u16 min_client_sample_period;
285 u32 reserved_pmu_policy_mask[NV_PMU_PMGR_RESERVED_PWR_POLICY_MASK_COUNT];
286 struct nv_pmu_perf_domain_group_limits global_ceiling;
287};
288
289NV_PMU_MAKE_ALIGNED_STRUCT(nv_pmu_pmgr_pwr_policy_desc_header ,
290 sizeof(struct nv_pmu_pmgr_pwr_policy_desc_header ));
291
292struct nv_pmu_pmgr_pwr_policyrel_desc_header {
293 struct nv_pmu_boardobjgrp_e32 super;
294};
295
296NV_PMU_MAKE_ALIGNED_STRUCT(nv_pmu_pmgr_pwr_policyrel_desc_header,
297 sizeof(struct nv_pmu_pmgr_pwr_policyrel_desc_header));
298
299struct nv_pmu_pmgr_pwr_violation_desc_header {
300 struct nv_pmu_boardobjgrp_e32 super;
301};
302
303NV_PMU_MAKE_ALIGNED_STRUCT(nv_pmu_pmgr_pwr_violation_desc_header,
304 sizeof(struct nv_pmu_pmgr_pwr_violation_desc_header));
305NV_PMU_MAKE_ALIGNED_UNION(nv_pmu_pmgr_pwr_violation_union,
306 sizeof(union nv_pmu_pmgr_pwr_violation_union));
307
308struct nv_pmu_pmgr_pwr_policy_desc {
309 union nv_pmu_pmgr_pwr_policy_desc_header_aligned hdr;
310 union nv_pmu_pmgr_pwr_policy_union_aligned
311 policies[NV_PMU_PMGR_PWR_POLICY_MAX_POLICIES];
312};
313
314struct nv_pmu_pmgr_pwr_policyrel_desc {
315 union nv_pmu_pmgr_pwr_policyrel_desc_header_aligned hdr;
316 union nv_pmu_pmgr_pwr_policy_relationship_union_aligned
317 policy_rels[NV_PMU_PMGR_PWR_POLICY_MAX_POLICY_RELATIONSHIPS];
318};
319
320struct nv_pmu_pmgr_pwr_violation_desc {
321 union nv_pmu_pmgr_pwr_violation_desc_header_aligned hdr;
322 union nv_pmu_pmgr_pwr_violation_union_aligned
323 violations[CTRL_PMGR_PWR_VIOLATION_MAX];
324};
325
326union nv_pmu_pmgr_pwr_policy_dmem_size {
327 union nv_pmu_pmgr_pwr_policy_desc_header_aligned policy_hdr;
328 union nv_pmu_pmgr_pwr_policy_union_aligned policy;
329 union nv_pmu_pmgr_pwr_policyrel_desc_header_aligned policy_rels_hdr;
330 union nv_pmu_pmgr_pwr_policy_relationship_union_aligned policy_rels;
331 union nv_pmu_pmgr_pwr_violation_desc_header_aligned violation_hdr;
332 union nv_pmu_pmgr_pwr_violation_union_aligned violation;
333};
334
335struct nv_pmu_pmgr_pwr_policy_pack {
336 struct nv_pmu_pmgr_pwr_policy_desc policies;
337 struct nv_pmu_pmgr_pwr_policyrel_desc policy_rels;
338 struct nv_pmu_pmgr_pwr_violation_desc violations;
339};
340
341#define NV_PMU_PMGR_CMD_ID_SET_OBJECT (0x00000000)
342
343#define NV_PMU_PMGR_MSG_ID_QUERY (0x00000002)
344
345#define NV_PMU_PMGR_CMD_ID_PWR_DEVICES_QUERY (0x00000001)
346
347#define NV_PMU_PMGR_CMD_ID_LOAD (0x00000006)
348
349#define NV_PMU_PMGR_CMD_ID_UNLOAD (0x00000007)
350
351struct nv_pmu_pmgr_cmd_set_object {
352 u8 cmd_type;
353 u8 pad[2];
354 u8 object_type;
355 struct nv_pmu_allocation object;
356};
357
358#define NV_PMU_PMGR_SET_OBJECT_ALLOC_OFFSET (0x04)
359
360#define NV_PMU_PMGR_OBJECT_I2C_DEVICE_DESC_TABLE (0x00000000)
361
362#define NV_PMU_PMGR_OBJECT_PWR_DEVICE_DESC_TABLE (0x00000001)
363
364#define NV_PMU_PMGR_OBJECT_PWR_MONITOR (0x00000002)
365
366#define NV_PMU_PMGR_OBJECT_PWR_POLICY (0x00000005)
367
368struct nv_pmu_pmgr_pwr_devices_query_payload {
369 struct {
370 u32 powerm_w;
371 u32 voltageu_v;
372 u32 currentm_a;
373 } devices[CTRL_PMGR_PWR_DEVICES_MAX_DEVICES];
374};
375
376struct nv_pmu_pmgr_cmd_pwr_devices_query {
377 u8 cmd_type;
378 u8 pad[3];
379 u32 dev_mask;
380 struct nv_pmu_allocation payload;
381};
382
383#define NV_PMU_PMGR_PWR_DEVICES_QUERY_ALLOC_OFFSET (0x08)
384
385struct nv_pmu_pmgr_cmd_load {
386 u8 cmd_type;
387};
388
389struct nv_pmu_pmgr_cmd_unload {
390 u8 cmd_type;
391};
392
393struct nv_pmu_pmgr_cmd {
394 union {
395 u8 cmd_type;
396 struct nv_pmu_pmgr_cmd_set_object set_object;
397 struct nv_pmu_pmgr_cmd_pwr_devices_query pwr_dev_query;
398 struct nv_pmu_pmgr_cmd_load load;
399 struct nv_pmu_pmgr_cmd_unload unload;
400 };
401};
402
403#define NV_PMU_PMGR_MSG_ID_SET_OBJECT (0x00000000)
404
405#define NV_PMU_PMGR_MSG_ID_LOAD (0x00000004)
406
407#define NV_PMU_PMGR_MSG_ID_UNLOAD (0x00000005)
408
409struct nv_pmu_pmgr_msg_set_object {
410 u8 msg_type;
411 bool b_success;
412 flcn_status flcnstatus;
413 u8 object_type;
414};
415
416struct nv_pmu_pmgr_msg_query {
417 u8 msg_type;
418 bool b_success;
419 flcn_status flcnstatus;
420 u8 cmd_type;
421};
422
423struct nv_pmu_pmgr_msg_load {
424 u8 msg_type;
425 bool b_success;
426 flcn_status flcnstatus;
427};
428
429struct nv_pmu_pmgr_msg_unload {
430 u8 msg_type;
431};
432
433struct nv_pmu_pmgr_msg {
434 union {
435 u8 msg_type;
436 struct nv_pmu_pmgr_msg_set_object set_object;
437 struct nv_pmu_pmgr_msg_query query;
438 struct nv_pmu_pmgr_msg_load load;
439 struct nv_pmu_pmgr_msg_unload unload;
440 };
441};
442
443#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuifseq.h b/drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuifseq.h
new file mode 100644
index 00000000..fadad61e
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuifseq.h
@@ -0,0 +1,82 @@
1/*
2* Copyright (c) 2016-2017, 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#ifndef _GPMUIFSEQ_H_
23#define _GPMUIFSEQ_H_
24
25#include <nvgpu/flcnif_cmn.h>
26
27#define PMU_UNIT_SEQ (0x02)
28
29/*!
30* @file gpmuifseq.h
31* @brief PMU Command/Message Interfaces - Sequencer
32*/
33
34/*!
35* Defines the identifiers various high-level types of sequencer commands.
36*
37* _RUN_SCRIPT @ref NV_PMU_SEQ_CMD_RUN_SCRIPT
38*/
39enum {
40 NV_PMU_SEQ_CMD_ID_RUN_SCRIPT = 0,
41};
42
43struct nv_pmu_seq_cmd_run_script {
44 u8 cmd_type;
45 u8 pad[3];
46 struct pmu_allocation_v3 script_alloc;
47 struct pmu_allocation_v3 reg_alloc;
48};
49
50#define NV_PMU_SEQ_CMD_ALLOC_OFFSET 4
51
52#define NV_PMU_SEQ_MSG_ALLOC_OFFSET \
53 (NV_PMU_SEQ_CMD_ALLOC_OFFSET + NV_PMU_CMD_ALLOC_SIZE)
54
55struct nv_pmu_seq_cmd {
56 struct pmu_hdr hdr;
57 union {
58 u8 cmd_type;
59 struct nv_pmu_seq_cmd_run_script run_script;
60 };
61};
62
63enum {
64 NV_PMU_SEQ_MSG_ID_RUN_SCRIPT = 0,
65};
66
67struct nv_pmu_seq_msg_run_script {
68 u8 msg_type;
69 u8 error_code;
70 u16 error_pc;
71 u32 timeout_stat;
72};
73
74struct nv_pmu_seq_msg {
75 struct pmu_hdr hdr;
76 union {
77 u8 msg_type;
78 struct nv_pmu_seq_msg_run_script run_script;
79 };
80};
81
82#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuiftherm.h b/drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuiftherm.h
new file mode 100644
index 00000000..2caf9c9d
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuiftherm.h
@@ -0,0 +1,102 @@
1/*
2* Copyright (c) 2016-2017, 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#ifndef _GPMUIFTHERM_H_
24#define _GPMUIFTHERM_H_
25
26#include <nvgpu/flcnif_cmn.h>
27
28#define NV_PMU_THERM_CMD_ID_RPC 0x00000002
29#define NV_PMU_THERM_MSG_ID_RPC 0x00000002
30#define NV_PMU_THERM_RPC_ID_SLCT 0x00000000
31#define NV_PMU_THERM_RPC_ID_SLCT_EVENT_TEMP_TH_SET 0x00000006
32#define NV_PMU_THERM_EVENT_THERMAL_1 0x00000004
33#define NV_PMU_THERM_CMD_ID_HW_SLOWDOWN_NOTIFICATION 0x00000001
34#define NV_RM_PMU_THERM_HW_SLOWDOWN_NOTIFICATION_REQUEST_ENABLE 0x00000001
35#define NV_PMU_THERM_MSG_ID_EVENT_HW_SLOWDOWN_NOTIFICATION 0x00000001
36
37struct nv_pmu_therm_rpc_slct_event_temp_th_set {
38 s32 temp_threshold;
39 u8 event_id;
40 flcn_status flcn_stat;
41};
42
43struct nv_pmu_therm_rpc_slct {
44 u32 mask_enabled;
45 flcn_status flcn_stat;
46};
47
48struct nv_pmu_therm_rpc {
49 u8 function;
50 bool b_supported;
51 union {
52 struct nv_pmu_therm_rpc_slct slct;
53 struct nv_pmu_therm_rpc_slct_event_temp_th_set slct_event_temp_th_set;
54 } params;
55};
56
57struct nv_pmu_therm_cmd_rpc {
58 u8 cmd_type;
59 u8 pad[3];
60 struct nv_pmu_allocation request;
61};
62
63struct nv_pmu_therm_cmd_hw_slowdown_notification {
64 u8 cmd_type;
65 u8 request;
66};
67
68#define NV_PMU_THERM_CMD_RPC_ALLOC_OFFSET \
69 offsetof(struct nv_pmu_therm_cmd_rpc, request)
70
71struct nv_pmu_therm_cmd {
72 union {
73 u8 cmd_type;
74 struct nv_pmu_therm_cmd_rpc rpc;
75 struct nv_pmu_therm_cmd_hw_slowdown_notification hw_slct_notification;
76 };
77};
78
79struct nv_pmu_therm_msg_rpc {
80 u8 msg_type;
81 u8 rsvd[3];
82 struct nv_pmu_allocation response;
83};
84
85struct nv_pmu_therm_msg_event_hw_slowdown_notification {
86 u8 msg_type;
87 u32 mask;
88};
89
90#define NV_PMU_THERM_MSG_RPC_ALLOC_OFFSET \
91 offsetof(struct nv_pmu_therm_msg_rpc, response)
92
93struct nv_pmu_therm_msg {
94 union {
95 u8 msg_type;
96 struct nv_pmu_therm_msg_rpc rpc;
97 struct nv_pmu_therm_msg_event_hw_slowdown_notification hw_slct_msg;
98 };
99};
100
101#endif
102
diff --git a/drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuifthermsensor.h b/drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuifthermsensor.h
new file mode 100644
index 00000000..994cd5b7
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuifthermsensor.h
@@ -0,0 +1,83 @@
1/*
2* Copyright (c) 2016-2017, 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#ifndef _GPMUIFTHERMSENSOR_H_
24#define _GPMUIFTHERMSENSOR_H_
25
26#include "ctrl/ctrltherm.h"
27#include "gpmuifboardobj.h"
28#include <nvgpu/flcnif_cmn.h>
29
30#define NV_PMU_THERM_BOARDOBJGRP_CLASS_ID_THERM_DEVICE 0x00
31#define NV_PMU_THERM_BOARDOBJGRP_CLASS_ID_THERM_CHANNEL 0x01
32
33#define NV_PMU_THERM_CMD_ID_BOARDOBJ_GRP_SET 0x0000000B
34#define NV_PMU_THERM_MSG_ID_BOARDOBJ_GRP_SET 0x00000008
35
36struct nv_pmu_therm_therm_device_boardobjgrp_set_header {
37 struct nv_pmu_boardobjgrp_e32 super;
38};
39
40struct nv_pmu_therm_therm_device_boardobj_set {
41 struct nv_pmu_boardobj super;
42};
43
44struct nv_pmu_therm_therm_device_i2c_boardobj_set {
45 struct nv_pmu_therm_therm_device_boardobj_set super;
46 u8 i2c_dev_idx;
47};
48
49union nv_pmu_therm_therm_device_boardobj_set_union {
50 struct nv_pmu_boardobj board_obj;
51 struct nv_pmu_therm_therm_device_boardobj_set therm_device;
52 struct nv_pmu_therm_therm_device_i2c_boardobj_set i2c;
53};
54
55NV_PMU_BOARDOBJ_GRP_SET_MAKE_E32(therm, therm_device);
56
57struct nv_pmu_therm_therm_channel_boardobjgrp_set_header {
58 struct nv_pmu_boardobjgrp_e32 super;
59};
60
61struct nv_pmu_therm_therm_channel_boardobj_set {
62 struct nv_pmu_boardobj super;
63 s16 scaling;
64 s16 offset;
65 s32 temp_min;
66 s32 temp_max;
67};
68
69struct nv_pmu_therm_therm_channel_device_boardobj_set {
70 struct nv_pmu_therm_therm_channel_boardobj_set super;
71 u8 therm_dev_idx;
72 u8 therm_dev_prov_idx;
73};
74
75union nv_pmu_therm_therm_channel_boardobj_set_union {
76 struct nv_pmu_boardobj board_obj;
77 struct nv_pmu_therm_therm_channel_boardobj_set therm_channel;
78 struct nv_pmu_therm_therm_channel_device_boardobj_set device;
79};
80
81NV_PMU_BOARDOBJ_GRP_SET_MAKE_E32(therm, therm_channel);
82
83#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuifvolt.h b/drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuifvolt.h
new file mode 100644
index 00000000..c3d540cc
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/pmuif/gpmuifvolt.h
@@ -0,0 +1,335 @@
1/*
2* Copyright (c) 2016-2017, 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#ifndef _GPMUIFVOLT_H_
23#define _GPMUIFVOLT_H_
24
25#include "gpmuifboardobj.h"
26#include <nvgpu/flcnif_cmn.h>
27#include "ctrl/ctrlvolt.h"
28
29#define NV_PMU_VOLT_VALUE_0V_IN_UV (0)
30
31/* ------------- VOLT_RAIL's GRP_SET defines and structures ------------- */
32
33#define NV_PMU_VOLT_BOARDOBJGRP_CLASS_ID_VOLT_RAIL 0x00
34#define NV_PMU_VOLT_BOARDOBJGRP_CLASS_ID_VOLT_DEVICE 0x01
35#define NV_PMU_VOLT_BOARDOBJGRP_CLASS_ID_VOLT_POLICY 0x02
36
37
38struct nv_pmu_volt_volt_rail_boardobjgrp_set_header {
39 struct nv_pmu_boardobjgrp_e32 super;
40};
41
42struct nv_pmu_volt_volt_rail_boardobj_set {
43
44 struct nv_pmu_boardobj super;
45 u8 rel_limit_vfe_equ_idx;
46 u8 alt_rel_limit_vfe_equ_idx;
47 u8 ov_limit_vfe_equ_idx;
48 u8 vmin_limit_vfe_equ_idx;
49 u8 volt_margin_limit_vfe_equ_idx;
50 u8 pwr_equ_idx;
51 u8 volt_dev_idx_default;
52 struct ctrl_boardobjgrp_mask_e32 volt_dev_mask;
53 s32 volt_delta_uv[CTRL_VOLT_RAIL_VOLT_DELTA_MAX_ENTRIES];
54};
55
56union nv_pmu_volt_volt_rail_boardobj_set_union {
57 struct nv_pmu_boardobj board_obj;
58 struct nv_pmu_volt_volt_rail_boardobj_set super;
59};
60
61NV_PMU_BOARDOBJ_GRP_SET_MAKE_E32(volt, volt_rail);
62
63/* ------------ VOLT_DEVICE's GRP_SET defines and structures ------------ */
64
65struct nv_pmu_volt_volt_device_boardobjgrp_set_header {
66 struct nv_pmu_boardobjgrp_e32 super;
67};
68
69struct nv_pmu_volt_volt_device_boardobj_set {
70 struct nv_pmu_boardobj super;
71 u32 switch_delay_us;
72 u32 voltage_min_uv;
73 u32 voltage_max_uv;
74 u32 volt_step_uv;
75};
76
77struct nv_pmu_volt_volt_device_vid_boardobj_set {
78 struct nv_pmu_volt_volt_device_boardobj_set super;
79 s32 voltage_base_uv;
80 s32 voltage_offset_scale_uv;
81 u8 gpio_pin[CTRL_VOLT_VOLT_DEV_VID_VSEL_MAX_ENTRIES];
82 u8 vsel_mask;
83};
84
85struct nv_pmu_volt_volt_device_pwm_boardobj_set {
86 struct nv_pmu_volt_volt_device_boardobj_set super;
87 u32 raw_period;
88 s32 voltage_base_uv;
89 s32 voltage_offset_scale_uv;
90 enum nv_pmu_pmgr_pwm_source pwm_source;
91};
92
93union nv_pmu_volt_volt_device_boardobj_set_union {
94 struct nv_pmu_boardobj board_obj;
95 struct nv_pmu_volt_volt_device_boardobj_set super;
96 struct nv_pmu_volt_volt_device_vid_boardobj_set vid;
97 struct nv_pmu_volt_volt_device_pwm_boardobj_set pwm;
98};
99
100NV_PMU_BOARDOBJ_GRP_SET_MAKE_E32(volt, volt_device);
101
102/* ------------ VOLT_POLICY's GRP_SET defines and structures ------------ */
103struct nv_pmu_volt_volt_policy_boardobjgrp_set_header {
104
105 struct nv_pmu_boardobjgrp_e32 super;
106};
107
108struct nv_pmu_volt_volt_policy_boardobj_set {
109 struct nv_pmu_boardobj super;
110};
111struct nv_pmu_volt_volt_policy_sr_boardobj_set {
112 struct nv_pmu_volt_volt_policy_boardobj_set super;
113 u8 rail_idx;
114};
115
116struct nv_pmu_volt_volt_policy_splt_r_boardobj_set {
117 struct nv_pmu_volt_volt_policy_boardobj_set super;
118 u8 rail_idx_master;
119 u8 rail_idx_slave;
120 u8 delta_min_vfe_equ_idx;
121 u8 delta_max_vfe_equ_idx;
122 s32 offset_delta_min_uv;
123 s32 offset_delta_max_uv;
124};
125
126struct nv_pmu_volt_volt_policy_srms_boardobj_set {
127 struct nv_pmu_volt_volt_policy_splt_r_boardobj_set super;
128 u16 inter_switch_delayus;
129};
130
131/* sr - > single_rail */
132struct nv_pmu_volt_volt_policy_srss_boardobj_set {
133 struct nv_pmu_volt_volt_policy_splt_r_boardobj_set super;
134};
135
136union nv_pmu_volt_volt_policy_boardobj_set_union {
137 struct nv_pmu_boardobj board_obj;
138 struct nv_pmu_volt_volt_policy_boardobj_set super;
139 struct nv_pmu_volt_volt_policy_sr_boardobj_set single_rail;
140 struct nv_pmu_volt_volt_policy_splt_r_boardobj_set split_rail;
141 struct nv_pmu_volt_volt_policy_srms_boardobj_set
142 split_rail_m_s;
143 struct nv_pmu_volt_volt_policy_srss_boardobj_set
144 split_rail_s_s;
145};
146
147NV_PMU_BOARDOBJ_GRP_SET_MAKE_E32(volt, volt_policy);
148
149/* ----------- VOLT_RAIL's GRP_GET_STATUS defines and structures ----------- */
150struct nv_pmu_volt_volt_rail_boardobjgrp_get_status_header {
151 struct nv_pmu_boardobjgrp_e32 super;
152};
153
154struct nv_pmu_volt_volt_rail_boardobj_get_status {
155 struct nv_pmu_boardobj_query super;
156 u32 curr_volt_defaultu_v;
157 u32 rel_limitu_v;
158 u32 alt_rel_limitu_v;
159 u32 ov_limitu_v;
160 u32 max_limitu_v;
161 u32 vmin_limitu_v;
162 s32 volt_margin_limitu_v;
163 u32 rsvd;
164};
165
166union nv_pmu_volt_volt_rail_boardobj_get_status_union {
167 struct nv_pmu_boardobj_query board_obj;
168 struct nv_pmu_volt_volt_rail_boardobj_get_status super;
169};
170
171NV_PMU_BOARDOBJ_GRP_GET_STATUS_MAKE_E32(volt, volt_rail);
172
173/* ---------- VOLT_DEVICE's GRP_GET_STATUS defines and structures ---------- */
174struct nv_pmu_volt_volt_device_boardobjgrp_get_status_header {
175 struct nv_pmu_boardobjgrp_e32 super;
176};
177
178struct nv_pmu_volt_volt_device_boardobj_get_status {
179 struct nv_pmu_boardobj_query super;
180};
181
182union nv_pmu_volt_volt_device_boardobj_get_status_union {
183 struct nv_pmu_boardobj_query board_obj;
184 struct nv_pmu_volt_volt_device_boardobj_get_status super;
185};
186
187NV_PMU_BOARDOBJ_GRP_GET_STATUS_MAKE_E32(volt, volt_device);
188
189/* ---------- VOLT_POLICY's GRP_GET_STATUS defines and structures ---------- */
190struct nv_pmu_volt_volt_policy_boardobjgrp_get_status_header {
191 struct nv_pmu_boardobjgrp_e32 super;
192};
193
194struct nv_pmu_volt_volt_policy_boardobj_get_status {
195 struct nv_pmu_boardobj_query super;
196 u32 offset_volt_requ_v;
197 u32 offset_volt_curru_v;
198};
199
200struct nv_pmu_volt_volt_policy_sr_boardobj_get_status {
201 struct nv_pmu_volt_volt_policy_boardobj_get_status super;
202 u32 curr_voltu_v;
203};
204
205struct nv_pmu_volt_volt_policy_splt_r_boardobj_get_status {
206 struct nv_pmu_volt_volt_policy_boardobj_get_status super;
207 s32 delta_minu_v;
208 s32 delta_maxu_v;
209 s32 orig_delta_minu_v;
210 s32 orig_delta_maxu_v;
211 u32 curr_volt_masteru_v;
212 u32 curr_volt_slaveu_v;
213 bool b_violation;
214};
215
216/* srms -> split_rail_multi_step */
217struct nv_pmu_volt_volt_policy_srms_boardobj_get_status {
218 struct nv_pmu_volt_volt_policy_splt_r_boardobj_get_status super;
219};
220
221/* srss -> split_rail_single_step */
222struct nv_pmu_volt_volt_policy_srss_boardobj_get_status {
223 struct nv_pmu_volt_volt_policy_splt_r_boardobj_get_status super;
224};
225
226union nv_pmu_volt_volt_policy_boardobj_get_status_union {
227 struct nv_pmu_boardobj_query board_obj;
228 struct nv_pmu_volt_volt_policy_boardobj_get_status super;
229 struct nv_pmu_volt_volt_policy_sr_boardobj_get_status single_rail;
230 struct nv_pmu_volt_volt_policy_splt_r_boardobj_get_status split_rail;
231 struct nv_pmu_volt_volt_policy_srms_boardobj_get_status
232 split_rail_m_s;
233 struct nv_pmu_volt_volt_policy_srss_boardobj_get_status
234 split_rail_s_s;
235};
236
237NV_PMU_BOARDOBJ_GRP_GET_STATUS_MAKE_E32(volt, volt_policy);
238
239struct nv_pmu_volt_policy_voltage_data {
240 u8 policy_idx;
241 struct ctrl_perf_volt_rail_list
242 rail_list;
243};
244
245struct nv_pmu_volt_rail_get_voltage {
246 u8 rail_idx;
247 u32 voltage_uv;
248};
249
250struct nv_pmu_volt_volt_rail_set_noise_unaware_vmin {
251 u8 num_rails;
252 struct ctrl_volt_volt_rail_list
253 rail_list;
254};
255
256#define NV_PMU_VOLT_CMD_ID_BOARDOBJ_GRP_SET (0x00000000)
257#define NV_PMU_VOLT_CMD_ID_RPC (0x00000001)
258#define NV_PMU_VOLT_CMD_ID_BOARDOBJ_GRP_GET_STATUS (0x00000002)
259#define NV_PMU_VOLT_RPC_ID_VOLT_RAIL_SET_NOISE_UNAWARE_VMIN (0x00000004)
260
261/*!
262* PMU VOLT RPC calls.
263*/
264#define NV_PMU_VOLT_RPC_ID_LOAD (0x00000000)
265#define NV_PMU_VOLT_RPC_ID_VOLT_POLICY_SET_VOLTAGE (0x00000002)
266#define NV_PMU_VOLT_RPC_ID_VOLT_RAIL_GET_VOLTAGE (0x00000003)
267
268struct nv_pmu_volt_cmd_rpc {
269 u8 cmd_type;
270 u8 pad[3];
271 struct nv_pmu_allocation request;
272};
273
274#define NV_PMU_VOLT_CMD_RPC_ALLOC_OFFSET \
275 offsetof(struct nv_pmu_volt_cmd_rpc, request)
276
277struct nv_pmu_volt_cmd {
278 union {
279 u8 cmd_type;
280 struct nv_pmu_boardobj_cmd_grp grp_set;
281 struct nv_pmu_volt_cmd_rpc rpc;
282 struct nv_pmu_boardobj_cmd_grp grp_get_status;
283 };
284};
285
286struct nv_pmu_volt_rpc {
287 u8 function;
288 bool b_supported;
289 bool b_success;
290 flcn_status flcn_status;
291 union {
292 struct nv_pmu_volt_policy_voltage_data volt_policy_voltage_data;
293 struct nv_pmu_volt_rail_get_voltage volt_rail_get_voltage;
294 struct nv_pmu_volt_volt_rail_set_noise_unaware_vmin
295 volt_rail_set_noise_unaware_vmin;
296 } params;
297};
298
299/*!
300* VOLT MSG ID definitions
301*/
302#define NV_PMU_VOLT_MSG_ID_BOARDOBJ_GRP_SET (0x00000000)
303#define NV_PMU_VOLT_MSG_ID_RPC (0x00000001)
304#define NV_PMU_VOLT_MSG_ID_BOARDOBJ_GRP_GET_STATUS (0x00000002)
305
306/*!
307* Message carrying the result of the VOLT RPC execution.
308*/
309struct nv_pmu_volt_msg_rpc {
310 u8 msg_type;
311 u8 rsvd[3];
312 struct nv_pmu_allocation response;
313};
314
315#define NV_PMU_VOLT_MSG_RPC_ALLOC_OFFSET \
316 offsetof(struct nv_pmu_volt_msg_rpc, response)
317
318struct nv_pmu_volt_msg {
319 union {
320 u8 msg_type;
321 struct nv_pmu_boardobj_msg_grp grp_set;
322 struct nv_pmu_volt_msg_rpc rpc;
323 struct nv_pmu_boardobj_msg_grp grp_get_status;
324 };
325};
326
327#define NV_PMU_VF_INJECT_MAX_VOLT_RAILS (2)
328
329struct nv_pmu_volt_volt_rail_list {
330 u8 num_rails;
331 struct ctrl_perf_volt_rail_list_item
332 rails[NV_PMU_VF_INJECT_MAX_VOLT_RAILS];
333};
334
335#endif /* _GPMUIFVOLT_H_*/
diff --git a/drivers/gpu/nvgpu/include/nvgpu/pmuif/nvgpu_gpmu_cmdif.h b/drivers/gpu/nvgpu/include/nvgpu/pmuif/nvgpu_gpmu_cmdif.h
new file mode 100644
index 00000000..fea6326a
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/pmuif/nvgpu_gpmu_cmdif.h
@@ -0,0 +1,99 @@
1/*
2 * Copyright (c) 2017, 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#ifndef _NVGPUGPMUCMDIF_H_
23#define _NVGPUGPMUCMDIF_H_
24
25#include <nvgpu/flcnif_cmn.h>
26#include "gpmuif_cmn.h"
27#include "gpmuif_pmu.h"
28#include "gpmuif_ap.h"
29#include "gpmuif_pg.h"
30#include "gpmuif_perfmon.h"
31#include "gpmuif_acr.h"
32#include "gpmuifboardobj.h"
33#include "gpmuifclk.h"
34#include "gpmuifperf.h"
35#include "gpmuifperfvfe.h"
36#include "gpmuifpmgr.h"
37#include "gpmuifvolt.h"
38#include "gpmuiftherm.h"
39#include "gpmuifthermsensor.h"
40#include "gpmuifseq.h"
41
42struct pmu_cmd {
43 struct pmu_hdr hdr;
44 union {
45 struct pmu_perfmon_cmd perfmon;
46 struct pmu_pg_cmd pg;
47 struct pmu_zbc_cmd zbc;
48 struct pmu_acr_cmd acr;
49 struct nv_pmu_boardobj_cmd boardobj;
50 struct nv_pmu_perf_cmd perf;
51 struct nv_pmu_volt_cmd volt;
52 struct nv_pmu_clk_cmd clk;
53 struct nv_pmu_pmgr_cmd pmgr;
54 struct nv_pmu_therm_cmd therm;
55 } cmd;
56};
57
58struct pmu_msg {
59 struct pmu_hdr hdr;
60 union {
61 struct pmu_init_msg init;
62 struct pmu_perfmon_msg perfmon;
63 struct pmu_pg_msg pg;
64 struct pmu_rc_msg rc;
65 struct pmu_acr_msg acr;
66 struct nv_pmu_boardobj_msg boardobj;
67 struct nv_pmu_perf_msg perf;
68 struct nv_pmu_volt_msg volt;
69 struct nv_pmu_clk_msg clk;
70 struct nv_pmu_pmgr_msg pmgr;
71 struct nv_pmu_therm_msg therm;
72 } msg;
73};
74
75#define PMU_UNIT_REWIND (0x00)
76#define PMU_UNIT_PG (0x03)
77#define PMU_UNIT_INIT (0x07)
78#define PMU_UNIT_ACR (0x0A)
79#define PMU_UNIT_PERFMON_T18X (0x11)
80#define PMU_UNIT_PERFMON (0x12)
81#define PMU_UNIT_PERF (0x13)
82#define PMU_UNIT_RC (0x1F)
83#define PMU_UNIT_FECS_MEM_OVERRIDE (0x1E)
84#define PMU_UNIT_CLK (0x0D)
85#define PMU_UNIT_THERM (0x14)
86#define PMU_UNIT_PMGR (0x18)
87#define PMU_UNIT_VOLT (0x0E)
88
89#define PMU_UNIT_END (0x23)
90#define PMU_UNIT_INVALID (0xFF)
91
92#define PMU_UNIT_TEST_START (0xFE)
93#define PMU_UNIT_END_SIM (0xFF)
94#define PMU_UNIT_TEST_END (0xFF)
95
96#define PMU_UNIT_ID_IS_VALID(id) \
97 (((id) < PMU_UNIT_END) || ((id) >= PMU_UNIT_TEST_START))
98
99#endif /* _NVGPUGPMUCMDIF_H_*/
diff --git a/drivers/gpu/nvgpu/include/nvgpu/pramin.h b/drivers/gpu/nvgpu/include/nvgpu/pramin.h
new file mode 100644
index 00000000..33702bc8
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/pramin.h
@@ -0,0 +1,45 @@
1/*
2 * Copyright (c) 2017, 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#ifndef __NVGPU_PRAMIN_H__
24#define __NVGPU_PRAMIN_H__
25
26#include <nvgpu/types.h>
27
28struct gk20a;
29struct mm_gk20a;
30struct nvgpu_mem;
31
32/*
33 * This typedef is for functions that get called during the access_batched()
34 * operation.
35 */
36typedef void (*pramin_access_batch_fn)(struct gk20a *g, u32 start, u32 words,
37 u32 **arg);
38
39void nvgpu_pramin_access_batched(struct gk20a *g, struct nvgpu_mem *mem,
40 u32 offset, u32 size,
41 pramin_access_batch_fn loop, u32 **arg);
42
43void nvgpu_init_pramin(struct mm_gk20a *mm);
44
45#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/rbtree.h b/drivers/gpu/nvgpu/include/nvgpu/rbtree.h
new file mode 100644
index 00000000..25740863
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/rbtree.h
@@ -0,0 +1,130 @@
1/*
2 * Copyright (c) 2017, 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#ifndef __NVGPU_RBTREE_H__
24#define __NVGPU_RBTREE_H__
25
26#include <nvgpu/types.h>
27
28struct nvgpu_rbtree_node {
29 u64 key_start;
30 u64 key_end;
31
32 bool is_red; /* !IsRed == IsBlack */
33
34 struct nvgpu_rbtree_node *parent;
35 struct nvgpu_rbtree_node *left;
36 struct nvgpu_rbtree_node *right;
37};
38
39/**
40 * nvgpu_rbtree_insert - insert a new node into rbtree
41 *
42 * @new_node Pointer to new node.
43 * @root Pointer to root of tree
44 *
45 * Nodes with duplicate key_start and overlapping ranges
46 * are not allowed
47 */
48void nvgpu_rbtree_insert(struct nvgpu_rbtree_node *new_node,
49 struct nvgpu_rbtree_node **root);
50
51/**
52 * nvgpu_rbtree_unlink - delete a node from rbtree
53 *
54 * @node Pointer to node to be deleted
55 * @root Pointer to root of tree
56 */
57void nvgpu_rbtree_unlink(struct nvgpu_rbtree_node *node,
58 struct nvgpu_rbtree_node **root);
59
60/**
61 * nvgpu_rbtree_search - search a given key in rbtree
62 *
63 * @key_start Key to be searched in rbtree
64 * @node Node pointer to be returned
65 * @root Pointer to root of tree
66 *
67 * This API will match given key against key_start of each node
68 * In case of a hit, node points to a node with given key
69 * In case of a miss, node is NULL
70 */
71void nvgpu_rbtree_search(u64 key_start, struct nvgpu_rbtree_node **node,
72 struct nvgpu_rbtree_node *root);
73
74/**
75 * nvgpu_rbtree_range_search - search a node with key falling in range
76 *
77 * @key Key to be searched in rbtree
78 * @node Node pointer to be returned
79 * @root Pointer to root of tree
80 *
81 * This API will match given key and find a node where key value
82 * falls within range of {start, end} keys
83 * In case of a hit, node points to a node with given key
84 * In case of a miss, node is NULL
85 */
86void nvgpu_rbtree_range_search(u64 key,
87 struct nvgpu_rbtree_node **node,
88 struct nvgpu_rbtree_node *root);
89
90/**
91 * nvgpu_rbtree_less_than_search - search a node with key lesser than given key
92 *
93 * @key_start Key to be searched in rbtree
94 * @node Node pointer to be returned
95 * @root Pointer to root of tree
96 *
97 * This API will match given key and find a node with highest
98 * key value lesser than given key
99 * In case of a hit, node points to a node with given key
100 * In case of a miss, node is NULL
101 */
102void nvgpu_rbtree_less_than_search(u64 key_start,
103 struct nvgpu_rbtree_node **node,
104 struct nvgpu_rbtree_node *root);
105
106/**
107 * nvgpu_rbtree_enum_start - enumerate tree starting at the node with specified value
108 *
109 * @key_start Key value to begin enumeration from
110 * @node Pointer to first node in the tree
111 * @root Pointer to root of tree
112 *
113 * This API returns node pointer pointing to first node in the rbtree
114 */
115void nvgpu_rbtree_enum_start(u64 key_start,
116 struct nvgpu_rbtree_node **node,
117 struct nvgpu_rbtree_node *root);
118
119/**
120 * nvgpu_rbtree_enum_next - find next node in enumeration
121 *
122 * @node Pointer to next node in the tree
123 * @root Pointer to root of tree
124 *
125 * This API returns node pointer pointing to next node in the rbtree
126 */
127void nvgpu_rbtree_enum_next(struct nvgpu_rbtree_node **node,
128 struct nvgpu_rbtree_node *root);
129
130#endif /* __NVGPU_RBTREE_H__ */
diff --git a/drivers/gpu/nvgpu/include/nvgpu/rwsem.h b/drivers/gpu/nvgpu/include/nvgpu/rwsem.h
new file mode 100644
index 00000000..0366ceff
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/rwsem.h
@@ -0,0 +1,46 @@
1/*
2 * Copyright (c) 2017, 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#ifndef __NVGPU_RWSEM_H__
23#define __NVGPU_RWSEM_H__
24
25#ifdef __KERNEL__
26#include <nvgpu/linux/rwsem.h>
27#else
28#include <nvgpu_rmos/include/rwsem.h>
29#endif
30
31/*
32 * struct nvgpu_rwsem
33 *
34 * Should be implemented per-OS in a separate library
35 * But implementation should adhere to rw_semaphore implementation
36 * as specified in Linux Documentation
37 */
38struct nvgpu_rwsem;
39
40void nvgpu_rwsem_init(struct nvgpu_rwsem *rwsem);
41void nvgpu_rwsem_up_read(struct nvgpu_rwsem *rwsem);
42void nvgpu_rwsem_down_read(struct nvgpu_rwsem *rwsem);
43void nvgpu_rwsem_up_write(struct nvgpu_rwsem *rwsem);
44void nvgpu_rwsem_down_write(struct nvgpu_rwsem *rwsem);
45
46#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/semaphore.h b/drivers/gpu/nvgpu/include/nvgpu/semaphore.h
new file mode 100644
index 00000000..d36a3270
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/semaphore.h
@@ -0,0 +1,340 @@
1/*
2 * Copyright (c) 2014-2017, 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#ifndef SEMAPHORE_GK20A_H
24#define SEMAPHORE_GK20A_H
25
26#include <nvgpu/log.h>
27#include <nvgpu/timers.h>
28#include <nvgpu/atomic.h>
29#include <nvgpu/bug.h>
30#include <nvgpu/kref.h>
31#include <nvgpu/list.h>
32#include <nvgpu/nvgpu_mem.h>
33
34#include "gk20a/gk20a.h"
35#include "gk20a/mm_gk20a.h"
36#include "gk20a/channel_gk20a.h"
37
38#define gpu_sema_dbg(g, fmt, args...) \
39 nvgpu_log(g, gpu_dbg_sema, fmt, ##args)
40#define gpu_sema_verbose_dbg(g, fmt, args...) \
41 nvgpu_log(g, gpu_dbg_sema_v, fmt, ##args)
42
43/*
44 * Max number of channels that can be used is 512. This of course needs to be
45 * fixed to be dynamic but still fast.
46 */
47#define SEMAPHORE_POOL_COUNT 512
48#define SEMAPHORE_SIZE 16
49#define SEMAPHORE_SEA_GROWTH_RATE 32
50
51struct nvgpu_semaphore_sea;
52
53/*
54 * Underlying semaphore data structure. This semaphore can be shared amongst
55 * other semaphore instances.
56 */
57struct nvgpu_semaphore_int {
58 int idx; /* Semaphore index. */
59 u32 offset; /* Offset into the pool. */
60 nvgpu_atomic_t next_value; /* Next available value. */
61 u32 nr_incrs; /* Number of increments programmed. */
62 struct nvgpu_semaphore_pool *p; /* Pool that owns this sema. */
63 struct channel_gk20a *ch; /* Channel that owns this sema. */
64 struct nvgpu_list_node hw_sema_list; /* List of HW semaphores. */
65};
66
67static inline struct nvgpu_semaphore_int *
68nvgpu_semaphore_int_from_hw_sema_list(struct nvgpu_list_node *node)
69{
70 return (struct nvgpu_semaphore_int *)
71 ((uintptr_t)node - offsetof(struct nvgpu_semaphore_int, hw_sema_list));
72};
73
74/*
75 * A semaphore which the rest of the driver actually uses. This consists of a
76 * pointer to a real semaphore and a value to wait for. This allows one physical
77 * semaphore to be shared among an essentially infinite number of submits.
78 */
79struct nvgpu_semaphore {
80 struct nvgpu_semaphore_int *hw_sema;
81
82 nvgpu_atomic_t value;
83 int incremented;
84
85 struct nvgpu_ref ref;
86};
87
88/*
89 * A semaphore pool. Each address space will own exactly one of these.
90 */
91struct nvgpu_semaphore_pool {
92 struct nvgpu_list_node pool_list_entry; /* Node for list of pools. */
93 u64 gpu_va; /* GPU access to the pool. */
94 u64 gpu_va_ro; /* GPU access to the pool. */
95 int page_idx; /* Index into sea bitmap. */
96
97 struct nvgpu_list_node hw_semas; /* List of HW semas. */
98 DECLARE_BITMAP(semas_alloced, PAGE_SIZE / SEMAPHORE_SIZE);
99
100 struct nvgpu_semaphore_sea *sema_sea; /* Sea that owns this pool. */
101
102 struct nvgpu_mutex pool_lock;
103
104 /*
105 * This is the address spaces's personal RW table. Other channels will
106 * ultimately map this page as RO. This is a sub-nvgpu_mem from the
107 * sea's mem.
108 */
109 struct nvgpu_mem rw_mem;
110
111 int mapped;
112
113 /*
114 * Sometimes a channel can be released before other channels are
115 * done waiting on it. This ref count ensures that the pool doesn't
116 * go away until all semaphores using this pool are cleaned up first.
117 */
118 struct nvgpu_ref ref;
119};
120
121static inline struct nvgpu_semaphore_pool *
122nvgpu_semaphore_pool_from_pool_list_entry(struct nvgpu_list_node *node)
123{
124 return (struct nvgpu_semaphore_pool *)
125 ((uintptr_t)node -
126 offsetof(struct nvgpu_semaphore_pool, pool_list_entry));
127};
128
129/*
130 * A sea of semaphores pools. Each pool is owned by a single VM. Since multiple
131 * channels can share a VM each channel gets it's own HW semaphore from the
132 * pool. Channels then allocate regular semaphores - basically just a value that
133 * signifies when a particular job is done.
134 */
135struct nvgpu_semaphore_sea {
136 struct nvgpu_list_node pool_list; /* List of pools in this sea. */
137 struct gk20a *gk20a;
138
139 size_t size; /* Number of pages available. */
140 u64 gpu_va; /* GPU virtual address of sema sea. */
141 u64 map_size; /* Size of the mapping. */
142
143 /*
144 * TODO:
145 * List of pages that we use to back the pools. The number of pages
146 * can grow dynamically since allocating 512 pages for all channels at
147 * once would be a tremendous waste.
148 */
149 int page_count; /* Pages allocated to pools. */
150
151 /*
152 * The read-only memory for the entire semaphore sea. Each semaphore
153 * pool needs a sub-nvgpu_mem that will be mapped as RW in its address
154 * space. This sea_mem cannot be freed until all semaphore_pools have
155 * been freed.
156 */
157 struct nvgpu_mem sea_mem;
158
159 /*
160 * Can't use a regular allocator here since the full range of pools are
161 * not always allocated. Instead just use a bitmap.
162 */
163 DECLARE_BITMAP(pools_alloced, SEMAPHORE_POOL_COUNT);
164
165 struct nvgpu_mutex sea_lock; /* Lock alloc/free calls. */
166};
167
168/*
169 * Semaphore sea functions.
170 */
171struct nvgpu_semaphore_sea *nvgpu_semaphore_sea_create(struct gk20a *gk20a);
172void nvgpu_semaphore_sea_destroy(struct gk20a *g);
173int nvgpu_semaphore_sea_map(struct nvgpu_semaphore_pool *sea,
174 struct vm_gk20a *vm);
175void nvgpu_semaphore_sea_unmap(struct nvgpu_semaphore_pool *sea,
176 struct vm_gk20a *vm);
177struct nvgpu_semaphore_sea *nvgpu_semaphore_get_sea(struct gk20a *g);
178
179/*
180 * Semaphore pool functions.
181 */
182struct nvgpu_semaphore_pool *nvgpu_semaphore_pool_alloc(
183 struct nvgpu_semaphore_sea *sea);
184int nvgpu_semaphore_pool_map(struct nvgpu_semaphore_pool *pool,
185 struct vm_gk20a *vm);
186void nvgpu_semaphore_pool_unmap(struct nvgpu_semaphore_pool *pool,
187 struct vm_gk20a *vm);
188u64 __nvgpu_semaphore_pool_gpu_va(struct nvgpu_semaphore_pool *p, bool global);
189void nvgpu_semaphore_pool_get(struct nvgpu_semaphore_pool *p);
190void nvgpu_semaphore_pool_put(struct nvgpu_semaphore_pool *p);
191
192/*
193 * Semaphore functions.
194 */
195struct nvgpu_semaphore *nvgpu_semaphore_alloc(struct channel_gk20a *ch);
196void nvgpu_semaphore_put(struct nvgpu_semaphore *s);
197void nvgpu_semaphore_get(struct nvgpu_semaphore *s);
198void nvgpu_semaphore_free_hw_sema(struct channel_gk20a *ch);
199
200/*
201 * Return the address of a specific semaphore.
202 *
203 * Don't call this on a semaphore you don't own - the VA returned will make no
204 * sense in your specific channel's VM.
205 */
206static inline u64 nvgpu_semaphore_gpu_rw_va(struct nvgpu_semaphore *s)
207{
208 return __nvgpu_semaphore_pool_gpu_va(s->hw_sema->p, false) +
209 s->hw_sema->offset;
210}
211
212/*
213 * Get the global RO address for the semaphore. Can be called on any semaphore
214 * regardless of whether you own it.
215 */
216static inline u64 nvgpu_semaphore_gpu_ro_va(struct nvgpu_semaphore *s)
217{
218 return __nvgpu_semaphore_pool_gpu_va(s->hw_sema->p, true) +
219 s->hw_sema->offset;
220}
221
222static inline u64 nvgpu_hw_sema_addr(struct nvgpu_semaphore_int *hw_sema)
223{
224 return __nvgpu_semaphore_pool_gpu_va(hw_sema->p, true) +
225 hw_sema->offset;
226}
227
228static inline u32 __nvgpu_semaphore_read(struct nvgpu_semaphore_int *hw_sema)
229{
230 return nvgpu_mem_rd(hw_sema->ch->g,
231 &hw_sema->p->rw_mem, hw_sema->offset);
232}
233
234/*
235 * Read the underlying value from a semaphore.
236 */
237static inline u32 nvgpu_semaphore_read(struct nvgpu_semaphore *s)
238{
239 return __nvgpu_semaphore_read(s->hw_sema);
240}
241
242/*
243 * TODO: handle wrap around... Hmm, how to do this?
244 */
245static inline bool nvgpu_semaphore_is_released(struct nvgpu_semaphore *s)
246{
247 u32 sema_val = nvgpu_semaphore_read(s);
248
249 /*
250 * If the underlying semaphore value is greater than or equal to
251 * the value of the semaphore then the semaphore has been signaled
252 * (a.k.a. released).
253 */
254 return (int)sema_val >= nvgpu_atomic_read(&s->value);
255}
256
257static inline bool nvgpu_semaphore_is_acquired(struct nvgpu_semaphore *s)
258{
259 return !nvgpu_semaphore_is_released(s);
260}
261
262static inline u32 nvgpu_semaphore_get_value(struct nvgpu_semaphore *s)
263{
264 return (u32)nvgpu_atomic_read(&s->value);
265}
266
267static inline u32 nvgpu_semaphore_next_value(struct nvgpu_semaphore *s)
268{
269 return (u32)nvgpu_atomic_read(&s->hw_sema->next_value);
270}
271
272/*
273 * If @force is set then this will not wait for the underlying semaphore to
274 * catch up to the passed semaphore.
275 */
276static inline void __nvgpu_semaphore_release(struct nvgpu_semaphore *s,
277 bool force)
278{
279 struct nvgpu_semaphore_int *hw_sema = s->hw_sema;
280 u32 current_val;
281 u32 val = nvgpu_semaphore_get_value(s);
282 int attempts = 0;
283
284 /*
285 * Wait until the sema value is 1 less than the write value. That
286 * way this function is essentially an increment.
287 *
288 * TODO: tune the wait a little better.
289 */
290 while ((current_val = nvgpu_semaphore_read(s)) < (val - 1)) {
291 if (force)
292 break;
293 nvgpu_msleep(100);
294 attempts += 1;
295 if (attempts > 100) {
296 WARN(1, "Stall on sema release!");
297 return;
298 }
299 }
300
301 /*
302 * If the semaphore has already passed the value we would write then
303 * this is really just a NO-OP.
304 */
305 if (current_val >= val)
306 return;
307
308 nvgpu_mem_wr(hw_sema->ch->g, &hw_sema->p->rw_mem, hw_sema->offset, val);
309
310 gpu_sema_verbose_dbg(hw_sema->p->sema_sea->gk20a,
311 "(c=%d) WRITE %u", hw_sema->ch->chid, val);
312}
313
314static inline void nvgpu_semaphore_release(struct nvgpu_semaphore *s)
315{
316 __nvgpu_semaphore_release(s, false);
317}
318
319/*
320 * Configure a software based increment on this semaphore. This is useful for
321 * when we want the GPU to wait on a SW event before processing a channel.
322 * Another way to describe this is when the GPU needs to wait on a SW pre-fence.
323 * The pre-fence signals SW which in turn calls nvgpu_semaphore_release() which
324 * then allows the GPU to continue.
325 *
326 * Also used to prep a semaphore for an INCR by the GPU.
327 */
328static inline void nvgpu_semaphore_incr(struct nvgpu_semaphore *s)
329{
330 BUG_ON(s->incremented);
331
332 nvgpu_atomic_set(&s->value, nvgpu_atomic_add_return(1, &s->hw_sema->next_value));
333 s->incremented = 1;
334
335 gpu_sema_verbose_dbg(s->hw_sema->p->sema_sea->gk20a,
336 "INCR sema for c=%d (%u)",
337 s->hw_sema->ch->chid,
338 nvgpu_semaphore_next_value(s));
339}
340#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/soc.h b/drivers/gpu/nvgpu/include/nvgpu/soc.h
new file mode 100644
index 00000000..5001f27f
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/soc.h
@@ -0,0 +1,33 @@
1/*
2 * Copyright (c) 2017, 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#ifndef __NVGPU_SOC_H__
23#define __NVGPU_SOC_H__
24
25struct gk20a;
26
27bool nvgpu_platform_is_silicon(struct gk20a *g);
28bool nvgpu_platform_is_simulation(struct gk20a *g);
29bool nvgpu_platform_is_fpga(struct gk20a *g);
30bool nvgpu_is_hypervisor_mode(struct gk20a *g);
31bool nvgpu_is_bpmp_running(struct gk20a *g);
32
33#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/sort.h b/drivers/gpu/nvgpu/include/nvgpu/sort.h
new file mode 100644
index 00000000..51d1dcf3
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/sort.h
@@ -0,0 +1,29 @@
1/*
2 * Copyright (c) 2017, 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#ifndef __NVGPU_SORT_H__
23#define __NVGPU_SORT_H__
24
25#ifdef __KERNEL__
26#include <linux/sort.h>
27#endif
28
29#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/thread.h b/drivers/gpu/nvgpu/include/nvgpu/thread.h
new file mode 100644
index 00000000..79df9cda
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/thread.h
@@ -0,0 +1,79 @@
1/*
2 * Copyright (c) 2017, 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#ifndef __NVGPU_THREAD_H__
24#define __NVGPU_THREAD_H__
25
26#ifdef __KERNEL__
27#include <nvgpu/linux/thread.h>
28#else
29#include <nvgpu_rmos/include/thread.h>
30#endif
31
32/**
33 * nvgpu_thread_create - Create and run a new thread.
34 *
35 * @thread - thread structure to use
36 * @data - data to pass to threadfn
37 * @threadfn - Thread function
38 * @name - name of the thread
39 *
40 * Create a thread and run threadfn in it. The thread stays alive as long as
41 * threadfn is running. As soon as threadfn returns the thread is destroyed.
42 *
43 * threadfn needs to continuously poll nvgpu_thread_should_stop() to determine
44 * if it should exit.
45 */
46int nvgpu_thread_create(struct nvgpu_thread *thread,
47 void *data,
48 int (*threadfn)(void *data), const char *name);
49
50/**
51 * nvgpu_thread_stop - Destroy or request to destroy a thread
52 *
53 * @thread - thread to stop
54 *
55 * Request a thread to stop by setting nvgpu_thread_should_stop() to
56 * true and wait for thread to exit.
57 */
58void nvgpu_thread_stop(struct nvgpu_thread *thread);
59
60/**
61 * nvgpu_thread_should_stop - Query if thread should stop
62 *
63 * @thread
64 *
65 * Return true if thread should exit. Can be run only in the thread's own
66 * context and with the thread as parameter.
67 */
68bool nvgpu_thread_should_stop(struct nvgpu_thread *thread);
69
70/**
71 * nvgpu_thread_is_running - Query if thread is running
72 *
73 * @thread
74 *
75 * Return true if thread is started.
76 */
77bool nvgpu_thread_is_running(struct nvgpu_thread *thread);
78
79#endif /* __NVGPU_THREAD_H__ */
diff --git a/drivers/gpu/nvgpu/include/nvgpu/timers.h b/drivers/gpu/nvgpu/include/nvgpu/timers.h
new file mode 100644
index 00000000..b0df29b6
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/timers.h
@@ -0,0 +1,113 @@
1/*
2 * Copyright (c) 2016-2017, 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#ifndef __NVGPU_TIMERS_H__
24#define __NVGPU_TIMERS_H__
25
26#include <nvgpu/types.h>
27
28struct gk20a;
29
30/*
31 * struct nvgpu_timeout - define a timeout.
32 *
33 * There are two types of timer suported:
34 *
35 * o NVGPU_TIMER_CPU_TIMER
36 * Timer uses the CPU to measure the timeout.
37 *
38 * o NVGPU_TIMER_RETRY_TIMER
39 * Instead of measuring a time limit keep track of the number of times
40 * something has been attempted. After said limit, "expire" the timer.
41 *
42 * Available flags:
43 *
44 * o NVGPU_TIMER_NO_PRE_SI
45 * By default when the system is not running on silicon the timeout
46 * code will ignore the requested timeout. Specifying this flag will
47 * override that behavior and honor the timeout regardless of platform.
48 *
49 * o NVGPU_TIMER_SILENT_TIMEOUT
50 * Do not print any messages on timeout. Normally a simple message is
51 * printed that specifies where the timeout occurred.
52 */
53struct nvgpu_timeout {
54 struct gk20a *g;
55
56 unsigned int flags;
57
58 union {
59 s64 time;
60 struct {
61 u32 max;
62 u32 attempted;
63 } retries;
64 };
65};
66
67/*
68 * Bit 0 specifies the type of timer: CPU or retry.
69 */
70#define NVGPU_TIMER_CPU_TIMER (0x0)
71#define NVGPU_TIMER_RETRY_TIMER (0x1)
72
73/*
74 * Bits 1 through 7 are reserved; bits 8 and up are flags:
75 */
76#define NVGPU_TIMER_NO_PRE_SI (0x1 << 8)
77#define NVGPU_TIMER_SILENT_TIMEOUT (0x1 << 9)
78
79#define NVGPU_TIMER_FLAG_MASK (NVGPU_TIMER_RETRY_TIMER | \
80 NVGPU_TIMER_NO_PRE_SI | \
81 NVGPU_TIMER_SILENT_TIMEOUT)
82
83int nvgpu_timeout_init(struct gk20a *g, struct nvgpu_timeout *timeout,
84 u32 duration, unsigned long flags);
85int nvgpu_timeout_peek_expired(struct nvgpu_timeout *timeout);
86
87#define nvgpu_timeout_expired(__timeout) \
88 __nvgpu_timeout_expired_msg(__timeout, (void *)_THIS_IP_, "")
89
90#define nvgpu_timeout_expired_msg(__timeout, fmt, args...) \
91 __nvgpu_timeout_expired_msg(__timeout, (void *)_THIS_IP_, \
92 fmt, ##args)
93
94/*
95 * Don't use this directly.
96 */
97int __nvgpu_timeout_expired_msg(struct nvgpu_timeout *timeout,
98 void *caller, const char *fmt, ...);
99
100
101/*
102 * Waits and delays.
103 */
104void nvgpu_msleep(unsigned int msecs);
105void nvgpu_usleep_range(unsigned int min_us, unsigned int max_us);
106void nvgpu_udelay(unsigned int usecs);
107
108/*
109 * Timekeeping.
110 */
111s64 nvgpu_current_time_ms(void);
112
113#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/types.h b/drivers/gpu/nvgpu/include/nvgpu/types.h
new file mode 100644
index 00000000..8425c25d
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/types.h
@@ -0,0 +1,31 @@
1/*
2 * Copyright (c) 2017, 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#ifndef __NVGPU_TYPES_H__
23#define __NVGPU_TYPES_H__
24
25#ifdef __KERNEL__
26#include <linux/types.h>
27#else
28#include <nvgpu_rmos/include/types.h>
29#endif
30
31#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/unit.h b/drivers/gpu/nvgpu/include/nvgpu/unit.h
new file mode 100644
index 00000000..ea929916
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/unit.h
@@ -0,0 +1,36 @@
1/*
2 * Copyright (c) 2017, 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#ifndef __NVGPU_UNITS_H__
24#define __NVGPU_UNITS_H__
25
26/*
27 * Enumeration of all units intended to be used by any HAL that requires
28 * unit as parameter.
29 *
30 * Units are added to the enumeration as needed, so it is not complete.
31 */
32enum nvgpu_unit {
33 NVGPU_UNIT_FIFO,
34};
35
36#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/vgpu/vm.h b/drivers/gpu/nvgpu/include/nvgpu/vgpu/vm.h
new file mode 100644
index 00000000..0092fa28
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/vgpu/vm.h
@@ -0,0 +1,31 @@
1/*
2 * Copyright (c) 2017, 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#ifndef __NVGPU_VM_VGPU_H__
24#define __NVGPU_VM_VGPU_H__
25
26#ifdef CONFIG_TEGRA_GR_VIRTUALIZATION
27int vgpu_vm_init(struct gk20a *g, struct vm_gk20a *vm);
28void vgpu_vm_remove(struct vm_gk20a *vm);
29#endif
30
31#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/vidmem.h b/drivers/gpu/nvgpu/include/nvgpu/vidmem.h
new file mode 100644
index 00000000..62c970d3
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/vidmem.h
@@ -0,0 +1,151 @@
1/*
2 * Copyright (c) 2017, 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#ifndef __NVGPU_VIDMEM_H__
24#define __NVGPU_VIDMEM_H__
25
26#include <nvgpu/types.h>
27#include <nvgpu/errno.h>
28#include <nvgpu/nvgpu_mem.h>
29
30struct work_struct;
31
32struct gk20a;
33struct mm_gk20a;
34struct nvgpu_mem;
35
36struct nvgpu_vidmem_buf {
37 /*
38 * Must be a pointer since control of this mem is passed over to the
39 * vidmem background clearing thread when the vidmem buf is freed.
40 */
41 struct nvgpu_mem *mem;
42
43 struct gk20a *g;
44
45 /*
46 * Filled in by each OS - this holds the necessary data to export this
47 * buffer to userspace. This will eventually be replaced by a struct
48 * which shall be defined in the OS specific vidmem.h header file.
49 */
50 void *priv;
51};
52
53#if defined(CONFIG_GK20A_VIDMEM)
54
55/**
56 * nvgpu_vidmem_user_alloc - Allocates a vidmem buffer for userspace
57 *
58 * @g - The GPU.
59 * @bytes - Size of the buffer in bytes.
60 *
61 * Allocate a generic (OS agnostic) vidmem buffer. This does not allocate the OS
62 * specific interfacing for userspace sharing. Instead is is expected that the
63 * OS specific code will allocate that OS specific data and add it to this
64 * buffer.
65 *
66 * The buffer allocated here is intended to use used by userspace, hence the
67 * extra struct over nvgpu_mem. If a vidmem buffer is needed by the kernel
68 * driver only then a simple nvgpu_dma_alloc_vid() or the like is sufficient.
69 *
70 * Returns a pointer to a vidmem buffer on success, 0 otherwise.
71 */
72struct nvgpu_vidmem_buf *nvgpu_vidmem_user_alloc(struct gk20a *g, size_t bytes);
73
74void nvgpu_vidmem_buf_free(struct gk20a *g, struct nvgpu_vidmem_buf *buf);
75
76int nvgpu_vidmem_clear_list_enqueue(struct gk20a *g, struct nvgpu_mem *mem);
77
78bool nvgpu_addr_is_vidmem_page_alloc(u64 addr);
79int nvgpu_vidmem_get_space(struct gk20a *g, u64 *space);
80
81void nvgpu_vidmem_destroy(struct gk20a *g);
82int nvgpu_vidmem_init(struct mm_gk20a *mm);
83
84int nvgpu_vidmem_clear(struct gk20a *g, struct nvgpu_mem *mem);
85
86void nvgpu_vidmem_thread_pause_sync(struct mm_gk20a *mm);
87void nvgpu_vidmem_thread_unpause(struct mm_gk20a *mm);
88
89#else /* !defined(CONFIG_GK20A_VIDMEM) */
90
91/*
92 * When VIDMEM support is not present this interface is used.
93 */
94
95static inline bool nvgpu_addr_is_vidmem_page_alloc(u64 addr)
96{
97 return false;
98}
99
100static inline int nvgpu_vidmem_buf_alloc(struct gk20a *g, size_t bytes)
101{
102 return -ENOSYS;
103}
104
105static inline void nvgpu_vidmem_buf_free(struct gk20a *g,
106 struct nvgpu_vidmem_buf *buf)
107{
108}
109
110static inline int nvgpu_vidmem_get_space(struct gk20a *g, u64 *space)
111{
112 return -ENOSYS;
113}
114
115static inline void nvgpu_vidmem_destroy(struct gk20a *g)
116{
117}
118
119static inline int nvgpu_vidmem_init(struct mm_gk20a *mm)
120{
121 return 0;
122}
123
124static inline int nvgpu_vidmem_clear_all(struct gk20a *g)
125{
126 return -ENOSYS;
127}
128
129static inline int nvgpu_vidmem_clear(struct gk20a *g,
130 struct nvgpu_mem *mem)
131{
132 return -ENOSYS;
133}
134
135static inline void nvgpu_vidmem_thread_pause_sync(struct mm_gk20a *mm)
136{
137}
138
139static inline void nvgpu_vidmem_thread_unpause(struct mm_gk20a *mm)
140{
141}
142
143#endif /* !defined(CONFIG_GK20A_VIDMEM) */
144
145/*
146 * Simple macro for VIDMEM debugging.
147 */
148#define vidmem_dbg(g, fmt, args...) \
149 nvgpu_log(g, gpu_dbg_vidmem, fmt, ##args); \
150
151#endif /* __NVGPU_VIDMEM_H__ */
diff --git a/drivers/gpu/nvgpu/include/nvgpu/vm.h b/drivers/gpu/nvgpu/include/nvgpu/vm.h
new file mode 100644
index 00000000..c0a4124c
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/vm.h
@@ -0,0 +1,299 @@
1/*
2 * Copyright (c) 2017, 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#ifndef __NVGPU_VM_H__
24#define __NVGPU_VM_H__
25
26#include <nvgpu/kref.h>
27#include <nvgpu/list.h>
28#include <nvgpu/rbtree.h>
29#include <nvgpu/types.h>
30#include <nvgpu/gmmu.h>
31#include <nvgpu/nvgpu_mem.h>
32#include <nvgpu/allocator.h>
33
34struct dma_buf;
35
36struct vm_gk20a;
37struct nvgpu_vm_area;
38struct gk20a_comptag_allocator;
39
40/*
41 * Defined by each OS. Allows the common VM code do things to the OS specific
42 * buffer structures.
43 */
44struct nvgpu_os_buffer;
45
46#ifdef __KERNEL__
47#include <nvgpu/linux/vm.h>
48#else
49/* QNX include goes here. */
50#include <nvgpu_rmos/include/vm.h>
51#endif
52
53/**
54 * This header contains the OS agnostic APIs for dealing with VMs. Most of the
55 * VM implementation is system specific - it must translate from a platform's
56 * representation of DMA'able memory to our nvgpu_mem notion.
57 *
58 * However, some stuff is platform agnostic. VM ref-counting and the VM struct
59 * itself are platform agnostic. Also, the initialization and destruction of
60 * VMs is the same across all platforms (for now).
61 *
62 * VM Architecture:
63 * ----------------
64 *
65 * The VM managment in nvgpu is split up as follows: a vm_gk20a struct which
66 * defines an address space. Each address space is a set of page tables and a
67 * GPU Virtual Address (GVA) allocator. Any number of channels may bind to a VM.
68 *
69 * +----+ +----+ +----+ +-----+ +-----+
70 * | C1 | | C2 | ... | Cn | | VM1 | ... | VMn |
71 * +-+--+ +-+--+ +-+--+ +--+--+ +--+--+
72 * | | | | |
73 * | | +----->-----+ |
74 * | +---------------->-----+ |
75 * +------------------------>-----------------+
76 *
77 * Each VM also manages a set of mapped buffers (struct nvgpu_mapped_buf)
78 * which corresponds to _user space_ buffers which have been mapped into this VM.
79 * Kernel space mappings (created by nvgpu_gmmu_map()) are not tracked by VMs.
80 * This may be an architectural bug, but for now it seems to be OK. VMs can be
81 * closed in various ways - refs counts hitting zero, direct calls to the remove
82 * routine, etc. Note: this is going to change. VM cleanup is going to be
83 * homogonized around ref-counts. When a VM is closed all mapped buffers in the
84 * VM are unmapped from the GMMU. This means that those mappings will no longer
85 * be valid and any subsequent access by the GPU will fault. That means one must
86 * ensure the VM is not in use before closing it.
87 *
88 * VMs may also contain VM areas (struct nvgpu_vm_area) which are created for
89 * the purpose of sparse and/or fixed mappings. If userspace wishes to create a
90 * fixed mapping it must first create a VM area - either with a fixed address or
91 * not. VM areas are reserved - other mapping operations will not use the space.
92 * Userspace may then create fixed mappings within that VM area.
93 */
94
95/* map/unmap batch state */
96struct vm_gk20a_mapping_batch {
97 bool gpu_l2_flushed;
98 bool need_tlb_invalidate;
99};
100
101struct nvgpu_mapped_buf {
102 struct vm_gk20a *vm;
103 struct nvgpu_vm_area *vm_area;
104
105 struct nvgpu_ref ref;
106
107 struct nvgpu_rbtree_node node;
108 struct nvgpu_list_node buffer_list;
109 u64 addr;
110 u64 size;
111
112 u32 pgsz_idx;
113
114 u32 flags;
115 u32 kind;
116 bool va_allocated;
117
118 /*
119 * Separate from the nvgpu_os_buffer struct to clearly distinguish
120 * lifetime. A nvgpu_mapped_buf_priv will _always_ be wrapped by a
121 * struct nvgpu_mapped_buf; however, there are times when a struct
122 * nvgpu_os_buffer would be separate. This aims to prevent dangerous
123 * usage of container_of() or the like in OS code.
124 */
125 struct nvgpu_mapped_buf_priv os_priv;
126};
127
128static inline struct nvgpu_mapped_buf *
129nvgpu_mapped_buf_from_buffer_list(struct nvgpu_list_node *node)
130{
131 return (struct nvgpu_mapped_buf *)
132 ((uintptr_t)node - offsetof(struct nvgpu_mapped_buf,
133 buffer_list));
134}
135
136static inline struct nvgpu_mapped_buf *
137mapped_buffer_from_rbtree_node(struct nvgpu_rbtree_node *node)
138{
139 return (struct nvgpu_mapped_buf *)
140 ((uintptr_t)node - offsetof(struct nvgpu_mapped_buf, node));
141}
142
143struct vm_gk20a {
144 struct mm_gk20a *mm;
145 struct gk20a_as_share *as_share; /* as_share this represents */
146 char name[20];
147
148 u64 va_start;
149 u64 va_limit;
150
151 int num_user_mapped_buffers;
152
153 bool big_pages; /* enable large page support */
154 bool enable_ctag;
155
156 u32 big_page_size;
157
158 bool userspace_managed;
159
160 const struct gk20a_mmu_level *mmu_levels;
161
162 struct nvgpu_ref ref;
163
164 struct nvgpu_mutex update_gmmu_lock;
165
166 struct nvgpu_gmmu_pd pdb;
167
168 /*
169 * These structs define the address spaces. In some cases it's possible
170 * to merge address spaces (user and user_lp) and in other cases it's
171 * not. vma[] allows the code to be agnostic to this by always using
172 * address spaces through this pointer array.
173 */
174 struct nvgpu_allocator *vma[gmmu_nr_page_sizes];
175 struct nvgpu_allocator kernel;
176 struct nvgpu_allocator user;
177 struct nvgpu_allocator user_lp;
178
179 struct nvgpu_rbtree_node *mapped_buffers;
180
181 struct nvgpu_list_node vm_area_list;
182
183#ifdef CONFIG_TEGRA_GR_VIRTUALIZATION
184 u64 handle;
185#endif
186 u32 gmmu_page_sizes[gmmu_nr_page_sizes];
187
188 /* if non-NULL, kref_put will use this batch when
189 unmapping. Must hold vm->update_gmmu_lock. */
190 struct vm_gk20a_mapping_batch *kref_put_batch;
191
192 /*
193 * Each address space needs to have a semaphore pool.
194 */
195 struct nvgpu_semaphore_pool *sema_pool;
196
197 /*
198 * Create sync point read only map for sync point range.
199 * Channels sharing same vm will also share same sync point ro map
200 */
201 u64 syncpt_ro_map_gpu_va;
202};
203
204void nvgpu_vm_get(struct vm_gk20a *vm);
205void nvgpu_vm_put(struct vm_gk20a *vm);
206
207int vm_aspace_id(struct vm_gk20a *vm);
208int nvgpu_big_pages_possible(struct vm_gk20a *vm, u64 base, u64 size);
209
210/* batching eliminates redundant cache flushes and invalidates */
211void nvgpu_vm_mapping_batch_start(struct vm_gk20a_mapping_batch *batch);
212void nvgpu_vm_mapping_batch_finish(
213 struct vm_gk20a *vm, struct vm_gk20a_mapping_batch *batch);
214/* called when holding vm->update_gmmu_lock */
215void nvgpu_vm_mapping_batch_finish_locked(
216 struct vm_gk20a *vm, struct vm_gk20a_mapping_batch *batch);
217
218/* get reference to all currently mapped buffers */
219int nvgpu_vm_get_buffers(struct vm_gk20a *vm,
220 struct nvgpu_mapped_buf ***mapped_buffers,
221 int *num_buffers);
222/* put references on the given buffers */
223void nvgpu_vm_put_buffers(struct vm_gk20a *vm,
224 struct nvgpu_mapped_buf **mapped_buffers,
225 int num_buffers);
226
227struct nvgpu_mapped_buf *nvgpu_vm_find_mapping(struct vm_gk20a *vm,
228 struct nvgpu_os_buffer *os_buf,
229 u64 map_addr,
230 u32 flags,
231 int kind);
232
233struct nvgpu_mapped_buf *nvgpu_vm_map(struct vm_gk20a *vm,
234 struct nvgpu_os_buffer *os_buf,
235 struct nvgpu_sgt *sgt,
236 u64 map_addr,
237 u64 map_size,
238 u64 phys_offset,
239 int rw,
240 u32 flags,
241 s16 compr_kind,
242 s16 incompr_kind,
243 struct vm_gk20a_mapping_batch *batch,
244 enum nvgpu_aperture aperture);
245
246void nvgpu_vm_unmap(struct vm_gk20a *vm, u64 offset,
247 struct vm_gk20a_mapping_batch *batch);
248
249/*
250 * Implemented by each OS. Called from within the core VM code to handle OS
251 * specific components of an nvgpu_mapped_buf.
252 */
253void nvgpu_vm_unmap_system(struct nvgpu_mapped_buf *mapped_buffer);
254
255/*
256 * Don't use this outside of the core VM code!
257 */
258void __nvgpu_vm_unmap_ref(struct nvgpu_ref *ref);
259
260u64 nvgpu_os_buf_get_size(struct nvgpu_os_buffer *os_buf);
261
262/*
263 * These all require the VM update lock to be held.
264 */
265struct nvgpu_mapped_buf *__nvgpu_vm_find_mapped_buf(
266 struct vm_gk20a *vm, u64 addr);
267struct nvgpu_mapped_buf *__nvgpu_vm_find_mapped_buf_range(
268 struct vm_gk20a *vm, u64 addr);
269struct nvgpu_mapped_buf *__nvgpu_vm_find_mapped_buf_less_than(
270 struct vm_gk20a *vm, u64 addr);
271
272int nvgpu_insert_mapped_buf(struct vm_gk20a *vm,
273 struct nvgpu_mapped_buf *mapped_buffer);
274void nvgpu_remove_mapped_buf(struct vm_gk20a *vm,
275 struct nvgpu_mapped_buf *mapped_buffer);
276
277struct vm_gk20a *nvgpu_vm_init(struct gk20a *g,
278 u32 big_page_size,
279 u64 low_hole,
280 u64 kernel_reserved,
281 u64 aperture_size,
282 bool big_pages,
283 bool userspace_managed,
284 char *name);
285
286/*
287 * These are private to the VM code but are unfortunately used by the vgpu code.
288 * It appears to be used for an optimization in reducing the number of server
289 * requests to the vgpu server. Basically the vgpu implementation of
290 * map_global_ctx_buffers() sends a bunch of VA ranges over to the RM server.
291 * Ideally the RM server can just batch mappings but until such a time this
292 * will be used by the vgpu code.
293 */
294u64 __nvgpu_vm_alloc_va(struct vm_gk20a *vm, u64 size,
295 enum gmmu_pgsz_gk20a pgsz_idx);
296int __nvgpu_vm_free_va(struct vm_gk20a *vm, u64 addr,
297 enum gmmu_pgsz_gk20a pgsz_idx);
298
299#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/vm_area.h b/drivers/gpu/nvgpu/include/nvgpu/vm_area.h
new file mode 100644
index 00000000..7fc77b29
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/vm_area.h
@@ -0,0 +1,69 @@
1/*
2 * Copyright (c) 2017, 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#ifndef __NVGPU_VM_AREA_H__
24#define __NVGPU_VM_AREA_H__
25
26#include <nvgpu/list.h>
27#include <nvgpu/types.h>
28
29struct vm_gk20a;
30struct gk20a_as_share;
31struct nvgpu_as_alloc_space_args;
32struct nvgpu_as_free_space_args;
33
34struct nvgpu_vm_area {
35 /*
36 * Entry into the list of VM areas owned by a VM.
37 */
38 struct nvgpu_list_node vm_area_list;
39
40 /*
41 * List of buffers mapped into this vm_area.
42 */
43 struct nvgpu_list_node buffer_list_head;
44
45 u32 flags;
46 u32 pgsz_idx;
47 u64 addr;
48 u64 size;
49 bool sparse;
50};
51
52static inline struct nvgpu_vm_area *
53nvgpu_vm_area_from_vm_area_list(struct nvgpu_list_node *node)
54{
55 return (struct nvgpu_vm_area *)
56 ((uintptr_t)node - offsetof(struct nvgpu_vm_area,
57 vm_area_list));
58};
59
60int nvgpu_vm_area_alloc(struct vm_gk20a *vm, u32 pages, u32 page_size,
61 u64 *addr, u32 flags);
62int nvgpu_vm_area_free(struct vm_gk20a *vm, u64 addr);
63
64struct nvgpu_vm_area *nvgpu_vm_area_find(struct vm_gk20a *vm, u64 addr);
65int nvgpu_vm_area_validate_buffer(struct vm_gk20a *vm,
66 u64 map_offset, u64 map_size, int pgsz_idx,
67 struct nvgpu_vm_area **pvm_area);
68
69#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/xve.h b/drivers/gpu/nvgpu/include/nvgpu/xve.h
new file mode 100644
index 00000000..1c47e1c5
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/xve.h
@@ -0,0 +1,67 @@
1/*
2 * Copyright (c) 2017, 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#ifndef __NVGPU_XVE_H__
23#define __NVGPU_XVE_H__
24
25#include <nvgpu/types.h>
26#include <nvgpu/log2.h>
27
28/*
29 * For the available speeds bitmap.
30 */
31#define GPU_XVE_SPEED_2P5 (1 << 0)
32#define GPU_XVE_SPEED_5P0 (1 << 1)
33#define GPU_XVE_SPEED_8P0 (1 << 2)
34#define GPU_XVE_NR_SPEEDS 3
35
36#define GPU_XVE_SPEED_MASK (GPU_XVE_SPEED_2P5 | \
37 GPU_XVE_SPEED_5P0 | \
38 GPU_XVE_SPEED_8P0)
39
40/*
41 * The HW uses a 2 bit field where speed is defined by a number:
42 *
43 * NV_XVE_LINK_CONTROL_STATUS_LINK_SPEED_2P5 = 1
44 * NV_XVE_LINK_CONTROL_STATUS_LINK_SPEED_5P0 = 2
45 * NV_XVE_LINK_CONTROL_STATUS_LINK_SPEED_8P0 = 3
46 *
47 * This isn't ideal for a bitmap with available speeds. So the external
48 * APIs think about speeds as a bit in a bitmap and this function converts
49 * from those bits to the actual HW speed setting.
50 *
51 * @speed_bit must have only 1 bit set and must be one of the 3 available
52 * HW speeds. Not all chips support all speeds so use available_speeds() to
53 * determine what a given chip supports.
54 */
55static inline const char *xve_speed_to_str(u32 speed)
56{
57 if (!speed || !is_power_of_2(speed) ||
58 !(speed & GPU_XVE_SPEED_MASK))
59 return "Unknown ???";
60
61 return speed & GPU_XVE_SPEED_2P5 ? "Gen1" :
62 speed & GPU_XVE_SPEED_5P0 ? "Gen2" :
63 speed & GPU_XVE_SPEED_8P0 ? "Gen3" :
64 "Unknown ???";
65}
66
67#endif