aboutsummaryrefslogtreecommitdiffstats
path: root/include/gk20a
diff options
context:
space:
mode:
authorJoshua Bakita <bakitajoshua@gmail.com>2023-06-28 18:24:25 -0400
committerJoshua Bakita <bakitajoshua@gmail.com>2023-06-28 18:24:25 -0400
commit01e6fac4d61fdd7fff5433942ec93fc2ea1e4df1 (patch)
tree4ef34501728a087be24f4ba0af90f91486bf780b /include/gk20a
parent306a03d18b305e4e573be3b2931978fa10679eb9 (diff)
Include nvgpu headers
These are needed to build on NVIDIA's Jetson boards for the time being. Only a couple structs are required, so it should be fairly easy to remove this dependency at some point in the future.
Diffstat (limited to 'include/gk20a')
-rw-r--r--include/gk20a/ce2_gk20a.c576
-rw-r--r--include/gk20a/ce2_gk20a.h156
-rw-r--r--include/gk20a/clk_gk20a.h134
-rw-r--r--include/gk20a/css_gr_gk20a.c636
-rw-r--r--include/gk20a/css_gr_gk20a.h151
-rw-r--r--include/gk20a/dbg_gpu_gk20a.c388
-rw-r--r--include/gk20a/dbg_gpu_gk20a.h147
-rw-r--r--include/gk20a/fecs_trace_gk20a.c744
-rw-r--r--include/gk20a/fecs_trace_gk20a.h45
-rw-r--r--include/gk20a/fence_gk20a.c319
-rw-r--r--include/gk20a/fence_gk20a.h100
-rw-r--r--include/gk20a/fifo_gk20a.c4649
-rw-r--r--include/gk20a/fifo_gk20a.h471
-rw-r--r--include/gk20a/flcn_gk20a.c759
-rw-r--r--include/gk20a/flcn_gk20a.h29
-rw-r--r--include/gk20a/gk20a.c590
-rw-r--r--include/gk20a/gk20a.h33
-rw-r--r--include/gk20a/gr_ctx_gk20a.c486
-rw-r--r--include/gk20a/gr_ctx_gk20a.h206
-rw-r--r--include/gk20a/gr_ctx_gk20a_sim.c356
-rw-r--r--include/gk20a/gr_gk20a.c8998
-rw-r--r--include/gk20a/gr_gk20a.h851
-rw-r--r--include/gk20a/gr_pri_gk20a.h261
-rw-r--r--include/gk20a/hw_bus_gk20a.h171
-rw-r--r--include/gk20a/hw_ccsr_gk20a.h163
-rw-r--r--include/gk20a/hw_ce2_gk20a.h87
-rw-r--r--include/gk20a/hw_ctxsw_prog_gk20a.h447
-rw-r--r--include/gk20a/hw_falcon_gk20a.h559
-rw-r--r--include/gk20a/hw_fb_gk20a.h263
-rw-r--r--include/gk20a/hw_fifo_gk20a.h619
-rw-r--r--include/gk20a/hw_flush_gk20a.h187
-rw-r--r--include/gk20a/hw_gmmu_gk20a.h283
-rw-r--r--include/gk20a/hw_gr_gk20a.h3807
-rw-r--r--include/gk20a/hw_ltc_gk20a.h455
-rw-r--r--include/gk20a/hw_mc_gk20a.h291
-rw-r--r--include/gk20a/hw_pbdma_gk20a.h575
-rw-r--r--include/gk20a/hw_perf_gk20a.h211
-rw-r--r--include/gk20a/hw_pram_gk20a.h63
-rw-r--r--include/gk20a/hw_pri_ringmaster_gk20a.h159
-rw-r--r--include/gk20a/hw_pri_ringstation_fbp_gk20a.h231
-rw-r--r--include/gk20a/hw_pri_ringstation_gpc_gk20a.h79
-rw-r--r--include/gk20a/hw_pri_ringstation_sys_gk20a.h91
-rw-r--r--include/gk20a/hw_proj_gk20a.h167
-rw-r--r--include/gk20a/hw_pwr_gk20a.h823
-rw-r--r--include/gk20a/hw_ram_gk20a.h443
-rw-r--r--include/gk20a/hw_therm_gk20a.h367
-rw-r--r--include/gk20a/hw_timer_gk20a.h127
-rw-r--r--include/gk20a/hw_top_gk20a.h211
-rw-r--r--include/gk20a/hw_trim_gk20a.h315
-rw-r--r--include/gk20a/mm_gk20a.c654
-rw-r--r--include/gk20a/mm_gk20a.h155
-rw-r--r--include/gk20a/pmu_gk20a.c879
-rw-r--r--include/gk20a/pmu_gk20a.h80
-rw-r--r--include/gk20a/regops_gk20a.c472
-rw-r--r--include/gk20a/regops_gk20a.h90
55 files changed, 34609 insertions, 0 deletions
diff --git a/include/gk20a/ce2_gk20a.c b/include/gk20a/ce2_gk20a.c
new file mode 100644
index 0000000..2a40b08
--- /dev/null
+++ b/include/gk20a/ce2_gk20a.c
@@ -0,0 +1,576 @@
1/*
2 * GK20A Graphics Copy Engine (gr host)
3 *
4 * Copyright (c) 2011-2019, NVIDIA CORPORATION. All rights reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
23 */
24
25#include <nvgpu/kmem.h>
26#include <nvgpu/dma.h>
27#include <nvgpu/os_sched.h>
28#include <nvgpu/log.h>
29#include <nvgpu/enabled.h>
30#include <nvgpu/io.h>
31#include <nvgpu/utils.h>
32#include <nvgpu/channel.h>
33#include <nvgpu/power_features/cg.h>
34
35#include "gk20a.h"
36#include "gk20a/fence_gk20a.h"
37
38#include <nvgpu/hw/gk20a/hw_ce2_gk20a.h>
39#include <nvgpu/hw/gk20a/hw_pbdma_gk20a.h>
40#include <nvgpu/hw/gk20a/hw_ccsr_gk20a.h>
41#include <nvgpu/hw/gk20a/hw_ram_gk20a.h>
42#include <nvgpu/hw/gk20a/hw_top_gk20a.h>
43#include <nvgpu/hw/gk20a/hw_gr_gk20a.h>
44#include <nvgpu/barrier.h>
45
46/*
47 * Copy engine defines line size in pixels
48 */
49#define MAX_CE_SHIFT 31 /* 4Gpixels -1 */
50#define MAX_CE_MASK ((u32) (~(~0U << MAX_CE_SHIFT)))
51#define MAX_CE_ALIGN(a) (a & MAX_CE_MASK)
52
53
54static u32 ce2_nonblockpipe_isr(struct gk20a *g, u32 fifo_intr)
55{
56 nvgpu_log(g, gpu_dbg_intr, "ce2 non-blocking pipe interrupt\n");
57
58 return ce2_intr_status_nonblockpipe_pending_f();
59}
60
61static u32 ce2_blockpipe_isr(struct gk20a *g, u32 fifo_intr)
62{
63 nvgpu_log(g, gpu_dbg_intr, "ce2 blocking pipe interrupt\n");
64
65 return ce2_intr_status_blockpipe_pending_f();
66}
67
68static u32 ce2_launcherr_isr(struct gk20a *g, u32 fifo_intr)
69{
70 nvgpu_log(g, gpu_dbg_intr, "ce2 launch error interrupt\n");
71
72 return ce2_intr_status_launcherr_pending_f();
73}
74
75void gk20a_ce2_isr(struct gk20a *g, u32 inst_id, u32 pri_base)
76{
77 u32 ce2_intr = gk20a_readl(g, ce2_intr_status_r());
78 u32 clear_intr = 0;
79
80 nvgpu_log(g, gpu_dbg_intr, "ce2 isr %08x\n", ce2_intr);
81
82 /* clear blocking interrupts: they exibit broken behavior */
83 if (ce2_intr & ce2_intr_status_blockpipe_pending_f()) {
84 clear_intr |= ce2_blockpipe_isr(g, ce2_intr);
85 }
86
87 if (ce2_intr & ce2_intr_status_launcherr_pending_f()) {
88 clear_intr |= ce2_launcherr_isr(g, ce2_intr);
89 }
90
91 gk20a_writel(g, ce2_intr_status_r(), clear_intr);
92 return;
93}
94
95u32 gk20a_ce2_nonstall_isr(struct gk20a *g, u32 inst_id, u32 pri_base)
96{
97 u32 ops = 0;
98 u32 ce2_intr = gk20a_readl(g, ce2_intr_status_r());
99
100 nvgpu_log(g, gpu_dbg_intr, "ce2 nonstall isr %08x\n", ce2_intr);
101
102 if (ce2_intr & ce2_intr_status_nonblockpipe_pending_f()) {
103 gk20a_writel(g, ce2_intr_status_r(),
104 ce2_nonblockpipe_isr(g, ce2_intr));
105 ops |= (GK20A_NONSTALL_OPS_WAKEUP_SEMAPHORE |
106 GK20A_NONSTALL_OPS_POST_EVENTS);
107 }
108 return ops;
109}
110
111/* static CE app api */
112static void gk20a_ce_put_fences(struct gk20a_gpu_ctx *ce_ctx)
113{
114 u32 i;
115
116 for (i = 0; i < NVGPU_CE_MAX_INFLIGHT_JOBS; i++) {
117 struct gk20a_fence **fence = &ce_ctx->postfences[i];
118 if (*fence) {
119 gk20a_fence_put(*fence);
120 }
121 *fence = NULL;
122 }
123}
124
125/* assume this api should need to call under nvgpu_mutex_acquire(&ce_app->app_mutex) */
126static void gk20a_ce_delete_gpu_context(struct gk20a_gpu_ctx *ce_ctx)
127{
128 struct nvgpu_list_node *list = &ce_ctx->list;
129
130 ce_ctx->gpu_ctx_state = NVGPU_CE_GPU_CTX_DELETED;
131