diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2018-08-09 12:20:33 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-08-14 18:33:20 -0400 |
commit | 91390d857f6302f9c2923ec4188ea7e24ee537a2 (patch) | |
tree | e0884e79ea748d2c0bd384c29f805125a7b88fec | |
parent | 02f9c99e4b4a452ded20978c5ee1e27b775b9224 (diff) |
gpu: nvgpu: Move therm HAL to common
Move implementation of therm HAL to common/therm. ELCG and BLCG
code was embedded in gr HAL, so moved that code to therm.
Bump gk20a code to gm20b.
JIRA NVGPU-955
Change-Id: I9b03e52f2832d3a1d89071a577e8ce106aaf603b
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1795989
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
27 files changed, 261 insertions, 271 deletions
diff --git a/drivers/gpu/nvgpu/Makefile b/drivers/gpu/nvgpu/Makefile index 8c289947..4ca4b6d8 100644 --- a/drivers/gpu/nvgpu/Makefile +++ b/drivers/gpu/nvgpu/Makefile | |||
@@ -37,7 +37,12 @@ nvgpu-y += common/bus/bus_gk20a.o \ | |||
37 | common/fb/fb_gp106.o \ | 37 | common/fb/fb_gp106.o \ |
38 | common/fb/fb_gv11b.o \ | 38 | common/fb/fb_gv11b.o \ |
39 | common/fb/fb_gv100.o \ | 39 | common/fb/fb_gv100.o \ |
40 | common/xve/xve_gp106.o | 40 | common/xve/xve_gp106.o \ |
41 | common/therm/therm.o \ | ||
42 | common/therm/therm_gm20b.o \ | ||
43 | common/therm/therm_gp10b.o \ | ||
44 | common/therm/therm_gp106.o \ | ||
45 | common/therm/therm_gv11b.o | ||
41 | 46 | ||
42 | # Linux specific parts of nvgpu. | 47 | # Linux specific parts of nvgpu. |
43 | nvgpu-y += \ | 48 | nvgpu-y += \ |
@@ -204,7 +209,6 @@ nvgpu-y += \ | |||
204 | gk20a/pmu_gk20a.o \ | 209 | gk20a/pmu_gk20a.o \ |
205 | gk20a/flcn_gk20a.o \ | 210 | gk20a/flcn_gk20a.o \ |
206 | gk20a/fence_gk20a.o \ | 211 | gk20a/fence_gk20a.o \ |
207 | gk20a/therm_gk20a.o \ | ||
208 | gk20a/gr_ctx_gk20a_sim.o \ | 212 | gk20a/gr_ctx_gk20a_sim.o \ |
209 | gk20a/gr_ctx_gk20a.o \ | 213 | gk20a/gr_ctx_gk20a.o \ |
210 | gk20a/hal.o \ | 214 | gk20a/hal.o \ |
@@ -221,7 +225,6 @@ nvgpu-y += \ | |||
221 | gm20b/pmu_gm20b.o \ | 225 | gm20b/pmu_gm20b.o \ |
222 | gm20b/mm_gm20b.o \ | 226 | gm20b/mm_gm20b.o \ |
223 | gm20b/regops_gm20b.o \ | 227 | gm20b/regops_gm20b.o \ |
224 | gm20b/therm_gm20b.o \ | ||
225 | gm20b/fuse_gm20b.o \ | 228 | gm20b/fuse_gm20b.o \ |
226 | boardobj/boardobj.o \ | 229 | boardobj/boardobj.o \ |
227 | boardobj/boardobjgrp.o \ | 230 | boardobj/boardobjgrp.o \ |
@@ -268,7 +271,6 @@ nvgpu-y += \ | |||
268 | gp10b/pmu_gp10b.o \ | 271 | gp10b/pmu_gp10b.o \ |
269 | gp10b/hal_gp10b.o \ | 272 | gp10b/hal_gp10b.o \ |
270 | gp10b/regops_gp10b.o \ | 273 | gp10b/regops_gp10b.o \ |
271 | gp10b/therm_gp10b.o \ | ||
272 | gp10b/fecs_trace_gp10b.o \ | 274 | gp10b/fecs_trace_gp10b.o \ |
273 | gp10b/gp10b.o \ | 275 | gp10b/gp10b.o \ |
274 | gp10b/fuse_gp10b.o \ | 276 | gp10b/fuse_gp10b.o \ |
@@ -301,7 +303,6 @@ nvgpu-y += \ | |||
301 | gv11b/acr_gv11b.o \ | 303 | gv11b/acr_gv11b.o \ |
302 | gv11b/subctx_gv11b.o \ | 304 | gv11b/subctx_gv11b.o \ |
303 | gv11b/regops_gv11b.o \ | 305 | gv11b/regops_gv11b.o \ |
304 | gv11b/therm_gv11b.o \ | ||
305 | gv11b/ecc_gv11b.o \ | 306 | gv11b/ecc_gv11b.o \ |
306 | gv100/mm_gv100.o \ | 307 | gv100/mm_gv100.o \ |
307 | gv100/gr_ctx_gv100.o \ | 308 | gv100/gr_ctx_gv100.o \ |
@@ -328,7 +329,6 @@ nvgpu-y += \ | |||
328 | clk/clk.o \ | 329 | clk/clk.o \ |
329 | gp106/clk_gp106.o \ | 330 | gp106/clk_gp106.o \ |
330 | gp106/clk_arb_gp106.o \ | 331 | gp106/clk_arb_gp106.o \ |
331 | gp106/therm_gp106.o \ | ||
332 | pmgr/pwrdev.o \ | 332 | pmgr/pwrdev.o \ |
333 | pmgr/pmgr.o \ | 333 | pmgr/pmgr.o \ |
334 | pmgr/pmgrpmu.o \ | 334 | pmgr/pmgrpmu.o \ |
diff --git a/drivers/gpu/nvgpu/Makefile.sources b/drivers/gpu/nvgpu/Makefile.sources index e8e107ae..e4080013 100644 --- a/drivers/gpu/nvgpu/Makefile.sources +++ b/drivers/gpu/nvgpu/Makefile.sources | |||
@@ -45,6 +45,11 @@ srcs := common/mm/nvgpu_allocator.c \ | |||
45 | common/fb/fb_gv100.c \ | 45 | common/fb/fb_gv100.c \ |
46 | common/fb/fb_gv11b.c \ | 46 | common/fb/fb_gv11b.c \ |
47 | common/xve/xve_gp106.c \ | 47 | common/xve/xve_gp106.c \ |
48 | common/therm/therm.c \ | ||
49 | common/therm/therm_gm20b.c \ | ||
50 | common/therm/therm_gp10b.c \ | ||
51 | common/therm/therm_gv11b.c \ | ||
52 | common/therm/therm_gp106.c \ | ||
48 | common/enabled.c \ | 53 | common/enabled.c \ |
49 | common/pramin.c \ | 54 | common/pramin.c \ |
50 | common/semaphore.c \ | 55 | common/semaphore.c \ |
@@ -138,7 +143,6 @@ srcs := common/mm/nvgpu_allocator.c \ | |||
138 | gk20a/pmu_gk20a.c \ | 143 | gk20a/pmu_gk20a.c \ |
139 | gk20a/flcn_gk20a.c \ | 144 | gk20a/flcn_gk20a.c \ |
140 | gk20a/fence_gk20a.c \ | 145 | gk20a/fence_gk20a.c \ |
141 | gk20a/therm_gk20a.c \ | ||
142 | gk20a/gr_ctx_gk20a_sim.c \ | 146 | gk20a/gr_ctx_gk20a_sim.c \ |
143 | gk20a/gr_ctx_gk20a.c \ | 147 | gk20a/gr_ctx_gk20a.c \ |
144 | gk20a/hal.c \ | 148 | gk20a/hal.c \ |
@@ -154,7 +158,6 @@ srcs := common/mm/nvgpu_allocator.c \ | |||
154 | gm20b/pmu_gm20b.c \ | 158 | gm20b/pmu_gm20b.c \ |
155 | gm20b/mm_gm20b.c \ | 159 | gm20b/mm_gm20b.c \ |
156 | gm20b/regops_gm20b.c \ | 160 | gm20b/regops_gm20b.c \ |
157 | gm20b/therm_gm20b.c \ | ||
158 | gm20b/fuse_gm20b.c \ | 161 | gm20b/fuse_gm20b.c \ |
159 | gp10b/gr_gp10b.c \ | 162 | gp10b/gr_gp10b.c \ |
160 | gp10b/gr_ctx_gp10b.c \ | 163 | gp10b/gr_ctx_gp10b.c \ |
@@ -166,7 +169,6 @@ srcs := common/mm/nvgpu_allocator.c \ | |||
166 | gp10b/pmu_gp10b.c \ | 169 | gp10b/pmu_gp10b.c \ |
167 | gp10b/hal_gp10b.c \ | 170 | gp10b/hal_gp10b.c \ |
168 | gp10b/regops_gp10b.c \ | 171 | gp10b/regops_gp10b.c \ |
169 | gp10b/therm_gp10b.c \ | ||
170 | gp10b/fecs_trace_gp10b.c \ | 172 | gp10b/fecs_trace_gp10b.c \ |
171 | gp10b/gp10b.c \ | 173 | gp10b/gp10b.c \ |
172 | gp10b/fuse_gp10b.c \ | 174 | gp10b/fuse_gp10b.c \ |
@@ -185,7 +187,6 @@ srcs := common/mm/nvgpu_allocator.c \ | |||
185 | gv11b/acr_gv11b.c \ | 187 | gv11b/acr_gv11b.c \ |
186 | gv11b/subctx_gv11b.c \ | 188 | gv11b/subctx_gv11b.c \ |
187 | gv11b/regops_gv11b.c \ | 189 | gv11b/regops_gv11b.c \ |
188 | gv11b/therm_gv11b.c \ | ||
189 | gv11b/ecc_gv11b.c \ | 190 | gv11b/ecc_gv11b.c \ |
190 | gp106/hal_gp106.c \ | 191 | gp106/hal_gp106.c \ |
191 | gp106/mm_gp106.c \ | 192 | gp106/mm_gp106.c \ |
@@ -202,7 +203,6 @@ srcs := common/mm/nvgpu_allocator.c \ | |||
202 | gp106/fuse_gp106.c \ | 203 | gp106/fuse_gp106.c \ |
203 | gp106/clk_gp106.c \ | 204 | gp106/clk_gp106.c \ |
204 | gp106/clk_arb_gp106.c \ | 205 | gp106/clk_arb_gp106.c \ |
205 | gp106/therm_gp106.c \ | ||
206 | gv100/mm_gv100.c \ | 206 | gv100/mm_gv100.c \ |
207 | gv100/gr_ctx_gv100.c \ | 207 | gv100/gr_ctx_gv100.c \ |
208 | gv100/bios_gv100.c \ | 208 | gv100/bios_gv100.c \ |
diff --git a/drivers/gpu/nvgpu/common/therm/therm.c b/drivers/gpu/nvgpu/common/therm/therm.c new file mode 100644 index 00000000..cfe8a2c1 --- /dev/null +++ b/drivers/gpu/nvgpu/common/therm/therm.c | |||
@@ -0,0 +1,46 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. | ||
3 | * | ||
4 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
5 | * copy of this software and associated documentation files (the "Software"), | ||
6 | * to deal in the Software without restriction, including without limitation | ||
7 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
8 | * and/or sell copies of the Software, and to permit persons to whom the | ||
9 | * Software is furnished to do so, subject to the following conditions: | ||
10 | * | ||
11 | * The above copyright notice and this permission notice shall be included in | ||
12 | * all copies or substantial portions of the Software. | ||
13 | * | ||
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
17 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
19 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
20 | * DEALINGS IN THE SOFTWARE. | ||
21 | */ | ||
22 | |||
23 | #include <nvgpu/types.h> | ||
24 | #include <nvgpu/log.h> | ||
25 | #include <nvgpu/therm.h> | ||
26 | |||
27 | #include "gk20a/gk20a.h" | ||
28 | |||
29 | int nvgpu_init_therm_support(struct gk20a *g) | ||
30 | { | ||
31 | u32 err = 0U; | ||
32 | |||
33 | nvgpu_log_fn(g, " "); | ||
34 | |||
35 | if (g->ops.therm.init_therm_setup_hw) | ||
36 | err = g->ops.therm.init_therm_setup_hw(g); | ||
37 | if (err) | ||
38 | return err; | ||
39 | |||
40 | #ifdef CONFIG_DEBUG_FS | ||
41 | if (g->ops.therm.therm_debugfs_init) | ||
42 | g->ops.therm.therm_debugfs_init(g); | ||
43 | #endif | ||
44 | |||
45 | return err; | ||
46 | } | ||
diff --git a/drivers/gpu/nvgpu/gm20b/therm_gm20b.c b/drivers/gpu/nvgpu/common/therm/therm_gm20b.c index e2055376..023ec36a 100644 --- a/drivers/gpu/nvgpu/gm20b/therm_gm20b.c +++ b/drivers/gpu/nvgpu/common/therm/therm_gm20b.c | |||
@@ -77,3 +77,111 @@ int gm20b_init_therm_setup_hw(struct gk20a *g) | |||
77 | 77 | ||
78 | return 0; | 78 | return 0; |
79 | } | 79 | } |
80 | |||
81 | int gm20b_elcg_init_idle_filters(struct gk20a *g) | ||
82 | { | ||
83 | u32 gate_ctrl, idle_filter; | ||
84 | u32 engine_id; | ||
85 | u32 active_engine_id = 0; | ||
86 | struct fifo_gk20a *f = &g->fifo; | ||
87 | |||
88 | nvgpu_log_fn(g, " "); | ||
89 | |||
90 | for (engine_id = 0; engine_id < f->num_engines; engine_id++) { | ||
91 | active_engine_id = f->active_engines_list[engine_id]; | ||
92 | gate_ctrl = gk20a_readl(g, therm_gate_ctrl_r(active_engine_id)); | ||
93 | |||
94 | if (nvgpu_is_enabled(g, NVGPU_IS_FMODEL)) { | ||
95 | gate_ctrl = set_field(gate_ctrl, | ||
96 | therm_gate_ctrl_eng_delay_after_m(), | ||
97 | therm_gate_ctrl_eng_delay_after_f(4)); | ||
98 | } | ||
99 | |||
100 | /* 2 * (1 << 9) = 1024 clks */ | ||
101 | gate_ctrl = set_field(gate_ctrl, | ||
102 | therm_gate_ctrl_eng_idle_filt_exp_m(), | ||
103 | therm_gate_ctrl_eng_idle_filt_exp_f(9)); | ||
104 | gate_ctrl = set_field(gate_ctrl, | ||
105 | therm_gate_ctrl_eng_idle_filt_mant_m(), | ||
106 | therm_gate_ctrl_eng_idle_filt_mant_f(2)); | ||
107 | gk20a_writel(g, therm_gate_ctrl_r(active_engine_id), gate_ctrl); | ||
108 | } | ||
109 | |||
110 | /* default fecs_idle_filter to 0 */ | ||
111 | idle_filter = gk20a_readl(g, therm_fecs_idle_filter_r()); | ||
112 | idle_filter &= ~therm_fecs_idle_filter_value_m(); | ||
113 | gk20a_writel(g, therm_fecs_idle_filter_r(), idle_filter); | ||
114 | /* default hubmmu_idle_filter to 0 */ | ||
115 | idle_filter = gk20a_readl(g, therm_hubmmu_idle_filter_r()); | ||
116 | idle_filter &= ~therm_hubmmu_idle_filter_value_m(); | ||
117 | gk20a_writel(g, therm_hubmmu_idle_filter_r(), idle_filter); | ||
118 | |||
119 | nvgpu_log_fn(g, "done"); | ||
120 | return 0; | ||
121 | } | ||
122 | |||
123 | void gm20b_therm_init_blcg_mode(struct gk20a *g, u32 mode, u32 engine) | ||
124 | { | ||
125 | u32 gate_ctrl; | ||
126 | |||
127 | if (!nvgpu_is_enabled(g, NVGPU_GPU_CAN_BLCG)) | ||
128 | return; | ||
129 | |||
130 | gate_ctrl = gk20a_readl(g, therm_gate_ctrl_r(engine)); | ||
131 | |||
132 | switch (mode) { | ||
133 | case BLCG_RUN: | ||
134 | gate_ctrl = set_field(gate_ctrl, | ||
135 | therm_gate_ctrl_blk_clk_m(), | ||
136 | therm_gate_ctrl_blk_clk_run_f()); | ||
137 | break; | ||
138 | case BLCG_AUTO: | ||
139 | gate_ctrl = set_field(gate_ctrl, | ||
140 | therm_gate_ctrl_blk_clk_m(), | ||
141 | therm_gate_ctrl_blk_clk_auto_f()); | ||
142 | break; | ||
143 | default: | ||
144 | nvgpu_err(g, | ||
145 | "invalid blcg mode %d", mode); | ||
146 | return; | ||
147 | } | ||
148 | |||
149 | gk20a_writel(g, therm_gate_ctrl_r(engine), gate_ctrl); | ||
150 | } | ||
151 | |||
152 | void gm20b_therm_init_elcg_mode(struct gk20a *g, u32 mode, u32 engine) | ||
153 | { | ||
154 | u32 gate_ctrl; | ||
155 | |||
156 | gate_ctrl = gk20a_readl(g, therm_gate_ctrl_r(engine)); | ||
157 | |||
158 | if (!nvgpu_is_enabled(g, NVGPU_GPU_CAN_ELCG)) | ||
159 | return; | ||
160 | |||
161 | switch (mode) { | ||
162 | case ELCG_RUN: | ||
163 | gate_ctrl = set_field(gate_ctrl, | ||
164 | therm_gate_ctrl_eng_clk_m(), | ||
165 | therm_gate_ctrl_eng_clk_run_f()); | ||
166 | gate_ctrl = set_field(gate_ctrl, | ||
167 | therm_gate_ctrl_eng_pwr_m(), | ||
168 | /* set elpg to auto to meet hw expectation */ | ||
169 | therm_gate_ctrl_eng_pwr_auto_f()); | ||
170 | break; | ||
171 | case ELCG_STOP: | ||
172 | gate_ctrl = set_field(gate_ctrl, | ||
173 | therm_gate_ctrl_eng_clk_m(), | ||
174 | therm_gate_ctrl_eng_clk_stop_f()); | ||
175 | break; | ||
176 | case ELCG_AUTO: | ||
177 | gate_ctrl = set_field(gate_ctrl, | ||
178 | therm_gate_ctrl_eng_clk_m(), | ||
179 | therm_gate_ctrl_eng_clk_auto_f()); | ||
180 | break; | ||
181 | default: | ||
182 | nvgpu_err(g, | ||
183 | "invalid elcg mode %d", mode); | ||
184 | } | ||
185 | |||
186 | gk20a_writel(g, therm_gate_ctrl_r(engine), gate_ctrl); | ||
187 | } | ||
diff --git a/drivers/gpu/nvgpu/gm20b/therm_gm20b.h b/drivers/gpu/nvgpu/common/therm/therm_gm20b.h index df0b4219..b6dfc5b6 100644 --- a/drivers/gpu/nvgpu/gm20b/therm_gm20b.h +++ b/drivers/gpu/nvgpu/common/therm/therm_gm20b.h | |||
@@ -26,5 +26,8 @@ | |||
26 | 26 | ||
27 | struct gk20a; | 27 | struct gk20a; |
28 | int gm20b_init_therm_setup_hw(struct gk20a *g); | 28 | int gm20b_init_therm_setup_hw(struct gk20a *g); |
29 | int gm20b_elcg_init_idle_filters(struct gk20a *g); | ||
30 | void gm20b_therm_init_elcg_mode(struct gk20a *g, u32 mode, u32 engine); | ||
31 | void gm20b_therm_init_blcg_mode(struct gk20a *g, u32 mode, u32 engine); | ||
29 | 32 | ||
30 | #endif /* THERM_GM20B_H */ | 33 | #endif /* THERM_GM20B_H */ |
diff --git a/drivers/gpu/nvgpu/gp106/therm_gp106.c b/drivers/gpu/nvgpu/common/therm/therm_gp106.c index 1f82aa7a..1f82aa7a 100644 --- a/drivers/gpu/nvgpu/gp106/therm_gp106.c +++ b/drivers/gpu/nvgpu/common/therm/therm_gp106.c | |||
diff --git a/drivers/gpu/nvgpu/gp106/therm_gp106.h b/drivers/gpu/nvgpu/common/therm/therm_gp106.h index 5debcee7..a92c2e0f 100644 --- a/drivers/gpu/nvgpu/gp106/therm_gp106.h +++ b/drivers/gpu/nvgpu/common/therm/therm_gp106.h | |||
@@ -25,6 +25,8 @@ | |||
25 | #ifndef NVGPU_THERM_GP106_H | 25 | #ifndef NVGPU_THERM_GP106_H |
26 | #define NVGPU_THERM_GP106_H | 26 | #define NVGPU_THERM_GP106_H |
27 | 27 | ||
28 | #include <nvgpu/types.h> | ||
29 | |||
28 | struct gk20a; | 30 | struct gk20a; |
29 | 31 | ||
30 | void gp106_get_internal_sensor_limits(s32 *max_24_8, s32 *min_24_8); | 32 | void gp106_get_internal_sensor_limits(s32 *max_24_8, s32 *min_24_8); |
diff --git a/drivers/gpu/nvgpu/gp10b/therm_gp10b.c b/drivers/gpu/nvgpu/common/therm/therm_gp10b.c index 905ff178..905ff178 100644 --- a/drivers/gpu/nvgpu/gp10b/therm_gp10b.c +++ b/drivers/gpu/nvgpu/common/therm/therm_gp10b.c | |||
diff --git a/drivers/gpu/nvgpu/gp10b/therm_gp10b.h b/drivers/gpu/nvgpu/common/therm/therm_gp10b.h index 2a40b73c..2a40b73c 100644 --- a/drivers/gpu/nvgpu/gp10b/therm_gp10b.h +++ b/drivers/gpu/nvgpu/common/therm/therm_gp10b.h | |||
diff --git a/drivers/gpu/nvgpu/gv11b/therm_gv11b.c b/drivers/gpu/nvgpu/common/therm/therm_gv11b.c index acc2c509..77edd7e1 100644 --- a/drivers/gpu/nvgpu/gv11b/therm_gv11b.c +++ b/drivers/gpu/nvgpu/common/therm/therm_gv11b.c | |||
@@ -101,6 +101,41 @@ int gv11b_init_therm_setup_hw(struct gk20a *g) | |||
101 | return 0; | 101 | return 0; |
102 | } | 102 | } |
103 | 103 | ||
104 | void gv11b_therm_init_elcg_mode(struct gk20a *g, u32 mode, u32 engine) | ||
105 | { | ||
106 | u32 gate_ctrl; | ||
107 | |||
108 | if (!nvgpu_is_enabled(g, NVGPU_GPU_CAN_ELCG)) | ||
109 | return; | ||
110 | |||
111 | gate_ctrl = gk20a_readl(g, therm_gate_ctrl_r(engine)); | ||
112 | |||
113 | switch (mode) { | ||
114 | case ELCG_RUN: | ||
115 | gate_ctrl = set_field(gate_ctrl, | ||
116 | therm_gate_ctrl_eng_clk_m(), | ||
117 | therm_gate_ctrl_eng_clk_run_f()); | ||
118 | gate_ctrl = set_field(gate_ctrl, | ||
119 | therm_gate_ctrl_idle_holdoff_m(), | ||
120 | therm_gate_ctrl_idle_holdoff_on_f()); | ||
121 | break; | ||
122 | case ELCG_STOP: | ||
123 | gate_ctrl = set_field(gate_ctrl, | ||
124 | therm_gate_ctrl_eng_clk_m(), | ||
125 | therm_gate_ctrl_eng_clk_stop_f()); | ||
126 | break; | ||
127 | case ELCG_AUTO: | ||
128 | gate_ctrl = set_field(gate_ctrl, | ||
129 | therm_gate_ctrl_eng_clk_m(), | ||
130 | therm_gate_ctrl_eng_clk_auto_f()); | ||
131 | break; | ||
132 | default: | ||
133 | nvgpu_err(g, "invalid elcg mode %d", mode); | ||
134 | } | ||
135 | |||
136 | gk20a_writel(g, therm_gate_ctrl_r(engine), gate_ctrl); | ||
137 | } | ||
138 | |||
104 | int gv11b_elcg_init_idle_filters(struct gk20a *g) | 139 | int gv11b_elcg_init_idle_filters(struct gk20a *g) |
105 | { | 140 | { |
106 | u32 gate_ctrl, idle_filter; | 141 | u32 gate_ctrl, idle_filter; |
diff --git a/drivers/gpu/nvgpu/gv11b/therm_gv11b.h b/drivers/gpu/nvgpu/common/therm/therm_gv11b.h index bfe6231e..7058af9f 100644 --- a/drivers/gpu/nvgpu/gv11b/therm_gv11b.h +++ b/drivers/gpu/nvgpu/common/therm/therm_gv11b.h | |||
@@ -25,5 +25,6 @@ | |||
25 | struct gk20a; | 25 | struct gk20a; |
26 | int gv11b_elcg_init_idle_filters(struct gk20a *g); | 26 | int gv11b_elcg_init_idle_filters(struct gk20a *g); |
27 | int gv11b_init_therm_setup_hw(struct gk20a *g); | 27 | int gv11b_init_therm_setup_hw(struct gk20a *g); |
28 | void gv11b_therm_init_elcg_mode(struct gk20a *g, u32 mode, u32 engine); | ||
28 | 29 | ||
29 | #endif /* THERM_GV11B_H */ | 30 | #endif /* THERM_GV11B_H */ |
diff --git a/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c b/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c index a257d709..65bf2976 100644 --- a/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c | |||
@@ -36,7 +36,6 @@ | |||
36 | #include "dbg_gpu_gk20a.h" | 36 | #include "dbg_gpu_gk20a.h" |
37 | #include "regops_gk20a.h" | 37 | #include "regops_gk20a.h" |
38 | 38 | ||
39 | #include <nvgpu/hw/gk20a/hw_therm_gk20a.h> | ||
40 | #include <nvgpu/hw/gk20a/hw_gr_gk20a.h> | 39 | #include <nvgpu/hw/gk20a/hw_gr_gk20a.h> |
41 | #include <nvgpu/hw/gk20a/hw_perf_gk20a.h> | 40 | #include <nvgpu/hw/gk20a/hw_perf_gk20a.h> |
42 | #include <nvgpu/hw/gk20a/hw_mc_gk20a.h> | 41 | #include <nvgpu/hw/gk20a/hw_mc_gk20a.h> |
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index 24cfc6ec..859a7b6a 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c | |||
@@ -36,6 +36,7 @@ | |||
36 | #include <nvgpu/ctxsw_trace.h> | 36 | #include <nvgpu/ctxsw_trace.h> |
37 | #include <nvgpu/soc.h> | 37 | #include <nvgpu/soc.h> |
38 | #include <nvgpu/clk_arb.h> | 38 | #include <nvgpu/clk_arb.h> |
39 | #include <nvgpu/therm.h> | ||
39 | 40 | ||
40 | #include <trace/events/gk20a.h> | 41 | #include <trace/events/gk20a.h> |
41 | 42 | ||
@@ -323,7 +324,7 @@ int gk20a_finalize_poweron(struct gk20a *g) | |||
323 | } | 324 | } |
324 | } | 325 | } |
325 | 326 | ||
326 | err = gk20a_init_therm_support(g); | 327 | err = nvgpu_init_therm_support(g); |
327 | if (err) { | 328 | if (err) { |
328 | nvgpu_err(g, "failed to init gk20a therm"); | 329 | nvgpu_err(g, "failed to init gk20a therm"); |
329 | goto done; | 330 | goto done; |
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index 204fd371..5bb91f62 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h | |||
@@ -69,7 +69,6 @@ struct nvgpu_ctxsw_trace_filter; | |||
69 | #include "fifo_gk20a.h" | 69 | #include "fifo_gk20a.h" |
70 | #include "tsg_gk20a.h" | 70 | #include "tsg_gk20a.h" |
71 | #include "pmu_gk20a.h" | 71 | #include "pmu_gk20a.h" |
72 | #include "therm_gk20a.h" | ||
73 | #include "clk/clk.h" | 72 | #include "clk/clk.h" |
74 | #include "perf/perf.h" | 73 | #include "perf/perf.h" |
75 | #include "pmgr/pmgr.h" | 74 | #include "pmgr/pmgr.h" |
@@ -161,6 +160,18 @@ struct nvgpu_gpfifo_userdata { | |||
161 | #define NVGPU_FB_MMU_FAULT_BUF_DISABLED 0U | 160 | #define NVGPU_FB_MMU_FAULT_BUF_DISABLED 0U |
162 | #define NVGPU_FB_MMU_FAULT_BUF_ENABLED 1U | 161 | #define NVGPU_FB_MMU_FAULT_BUF_ENABLED 1U |
163 | 162 | ||
163 | /* Parameters for init_elcg_mode/init_blcg_mode */ | ||
164 | enum { | ||
165 | ELCG_RUN, /* clk always run, i.e. disable elcg */ | ||
166 | ELCG_STOP, /* clk is stopped */ | ||
167 | ELCG_AUTO /* clk will run when non-idle, standard elcg mode */ | ||
168 | }; | ||
169 | |||
170 | enum { | ||
171 | BLCG_RUN, /* clk always run, i.e. disable blcg */ | ||
172 | BLCG_AUTO /* clk will run when non-idle, standard blcg mode */ | ||
173 | }; | ||
174 | |||
164 | struct gpu_ops { | 175 | struct gpu_ops { |
165 | struct { | 176 | struct { |
166 | int (*determine_L2_size_bytes)(struct gk20a *gk20a); | 177 | int (*determine_L2_size_bytes)(struct gk20a *gk20a); |
@@ -425,7 +436,6 @@ struct gpu_ops { | |||
425 | struct nvgpu_mem *mem, u64 gpu_va); | 436 | struct nvgpu_mem *mem, u64 gpu_va); |
426 | void (*set_preemption_buffer_va)(struct gk20a *g, | 437 | void (*set_preemption_buffer_va)(struct gk20a *g, |
427 | struct nvgpu_mem *mem, u64 gpu_va); | 438 | struct nvgpu_mem *mem, u64 gpu_va); |
428 | void (*init_elcg_mode)(struct gk20a *g, u32 mode, u32 engine); | ||
429 | void (*load_tpc_mask)(struct gk20a *g); | 439 | void (*load_tpc_mask)(struct gk20a *g); |
430 | int (*inval_icache)(struct gk20a *g, struct channel_gk20a *ch); | 440 | int (*inval_icache)(struct gk20a *g, struct channel_gk20a *ch); |
431 | int (*trigger_suspend)(struct gk20a *g); | 441 | int (*trigger_suspend)(struct gk20a *g); |
@@ -979,6 +989,8 @@ struct gpu_ops { | |||
979 | } pramin; | 989 | } pramin; |
980 | struct { | 990 | struct { |
981 | int (*init_therm_setup_hw)(struct gk20a *g); | 991 | int (*init_therm_setup_hw)(struct gk20a *g); |
992 | void (*init_elcg_mode)(struct gk20a *g, u32 mode, u32 engine); | ||
993 | void (*init_blcg_mode)(struct gk20a *g, u32 mode, u32 engine); | ||
982 | int (*elcg_init_idle_filters)(struct gk20a *g); | 994 | int (*elcg_init_idle_filters)(struct gk20a *g); |
983 | #ifdef CONFIG_DEBUG_FS | 995 | #ifdef CONFIG_DEBUG_FS |
984 | void (*therm_debugfs_init)(struct gk20a *g); | 996 | void (*therm_debugfs_init)(struct gk20a *g); |
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c index 5539b801..bb54e00e 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c | |||
@@ -61,7 +61,6 @@ | |||
61 | #include <nvgpu/hw/gk20a/hw_top_gk20a.h> | 61 | #include <nvgpu/hw/gk20a/hw_top_gk20a.h> |
62 | #include <nvgpu/hw/gk20a/hw_ltc_gk20a.h> | 62 | #include <nvgpu/hw/gk20a/hw_ltc_gk20a.h> |
63 | #include <nvgpu/hw/gk20a/hw_fb_gk20a.h> | 63 | #include <nvgpu/hw/gk20a/hw_fb_gk20a.h> |
64 | #include <nvgpu/hw/gk20a/hw_therm_gk20a.h> | ||
65 | #include <nvgpu/hw/gk20a/hw_pbdma_gk20a.h> | 64 | #include <nvgpu/hw/gk20a/hw_pbdma_gk20a.h> |
66 | 65 | ||
67 | #define BLK_SIZE (256) | 66 | #define BLK_SIZE (256) |
@@ -4116,72 +4115,6 @@ int gk20a_gr_zbc_set_table(struct gk20a *g, struct gr_gk20a *gr, | |||
4116 | gr_gk20a_add_zbc(g, gr, zbc_val)); | 4115 | gr_gk20a_add_zbc(g, gr, zbc_val)); |
4117 | } | 4116 | } |
4118 | 4117 | ||
4119 | void gr_gk20a_init_blcg_mode(struct gk20a *g, u32 mode, u32 engine) | ||
4120 | { | ||
4121 | u32 gate_ctrl; | ||
4122 | |||
4123 | if (!nvgpu_is_enabled(g, NVGPU_GPU_CAN_BLCG)) | ||
4124 | return; | ||
4125 | |||
4126 | gate_ctrl = gk20a_readl(g, therm_gate_ctrl_r(engine)); | ||
4127 | |||
4128 | switch (mode) { | ||
4129 | case BLCG_RUN: | ||
4130 | gate_ctrl = set_field(gate_ctrl, | ||
4131 | therm_gate_ctrl_blk_clk_m(), | ||
4132 | therm_gate_ctrl_blk_clk_run_f()); | ||
4133 | break; | ||
4134 | case BLCG_AUTO: | ||
4135 | gate_ctrl = set_field(gate_ctrl, | ||
4136 | therm_gate_ctrl_blk_clk_m(), | ||
4137 | therm_gate_ctrl_blk_clk_auto_f()); | ||
4138 | break; | ||
4139 | default: | ||
4140 | nvgpu_err(g, | ||
4141 | "invalid blcg mode %d", mode); | ||
4142 | return; | ||
4143 | } | ||
4144 | |||
4145 | gk20a_writel(g, therm_gate_ctrl_r(engine), gate_ctrl); | ||
4146 | } | ||
4147 | |||
4148 | void gr_gk20a_init_elcg_mode(struct gk20a *g, u32 mode, u32 engine) | ||
4149 | { | ||
4150 | u32 gate_ctrl; | ||
4151 | |||
4152 | gate_ctrl = gk20a_readl(g, therm_gate_ctrl_r(engine)); | ||
4153 | |||
4154 | if (!nvgpu_is_enabled(g, NVGPU_GPU_CAN_ELCG)) | ||
4155 | return; | ||
4156 | |||
4157 | switch (mode) { | ||
4158 | case ELCG_RUN: | ||
4159 | gate_ctrl = set_field(gate_ctrl, | ||
4160 | therm_gate_ctrl_eng_clk_m(), | ||
4161 | therm_gate_ctrl_eng_clk_run_f()); | ||
4162 | gate_ctrl = set_field(gate_ctrl, | ||
4163 | therm_gate_ctrl_eng_pwr_m(), | ||
4164 | /* set elpg to auto to meet hw expectation */ | ||
4165 | therm_gate_ctrl_eng_pwr_auto_f()); | ||
4166 | break; | ||
4167 | case ELCG_STOP: | ||
4168 | gate_ctrl = set_field(gate_ctrl, | ||
4169 | therm_gate_ctrl_eng_clk_m(), | ||
4170 | therm_gate_ctrl_eng_clk_stop_f()); | ||
4171 | break; | ||
4172 | case ELCG_AUTO: | ||
4173 | gate_ctrl = set_field(gate_ctrl, | ||
4174 | therm_gate_ctrl_eng_clk_m(), | ||
4175 | therm_gate_ctrl_eng_clk_auto_f()); | ||
4176 | break; | ||
4177 | default: | ||
4178 | nvgpu_err(g, | ||
4179 | "invalid elcg mode %d", mode); | ||
4180 | } | ||
4181 | |||
4182 | gk20a_writel(g, therm_gate_ctrl_r(engine), gate_ctrl); | ||
4183 | } | ||
4184 | |||
4185 | void gr_gk20a_init_cg_mode(struct gk20a *g, u32 cgmode, u32 mode_config) | 4118 | void gr_gk20a_init_cg_mode(struct gk20a *g, u32 cgmode, u32 mode_config) |
4186 | { | 4119 | { |
4187 | u32 engine_idx; | 4120 | u32 engine_idx; |
@@ -4196,10 +4129,10 @@ void gr_gk20a_init_cg_mode(struct gk20a *g, u32 cgmode, u32 mode_config) | |||
4196 | /* gr_engine supports both BLCG and ELCG */ | 4129 | /* gr_engine supports both BLCG and ELCG */ |
4197 | if ((cgmode == BLCG_MODE) && | 4130 | if ((cgmode == BLCG_MODE) && |
4198 | (engine_info->engine_enum == ENGINE_GR_GK20A)) { | 4131 | (engine_info->engine_enum == ENGINE_GR_GK20A)) { |
4199 | gr_gk20a_init_blcg_mode(g, mode_config, active_engine_id); | 4132 | g->ops.therm.init_blcg_mode(g, mode_config, active_engine_id); |
4200 | break; | 4133 | break; |
4201 | } else if (cgmode == ELCG_MODE) | 4134 | } else if (cgmode == ELCG_MODE) |
4202 | g->ops.gr.init_elcg_mode(g, mode_config, | 4135 | g->ops.therm.init_elcg_mode(g, mode_config, |
4203 | active_engine_id); | 4136 | active_engine_id); |
4204 | else | 4137 | else |
4205 | nvgpu_err(g, "invalid cg mode %d, config %d for " | 4138 | nvgpu_err(g, "invalid cg mode %d, config %d for " |
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h index 2b31b6b6..9c9a3caa 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h | |||
@@ -126,17 +126,6 @@ enum { | |||
126 | }; | 126 | }; |
127 | 127 | ||
128 | enum { | 128 | enum { |
129 | ELCG_RUN, /* clk always run, i.e. disable elcg */ | ||
130 | ELCG_STOP, /* clk is stopped */ | ||
131 | ELCG_AUTO /* clk will run when non-idle, standard elcg mode */ | ||
132 | }; | ||
133 | |||
134 | enum { | ||
135 | BLCG_RUN, /* clk always run, i.e. disable blcg */ | ||
136 | BLCG_AUTO /* clk will run when non-idle, standard blcg mode */ | ||
137 | }; | ||
138 | |||
139 | enum { | ||
140 | NVGPU_EVENT_ID_BPT_INT = 0, | 129 | NVGPU_EVENT_ID_BPT_INT = 0, |
141 | NVGPU_EVENT_ID_BPT_PAUSE, | 130 | NVGPU_EVENT_ID_BPT_PAUSE, |
142 | NVGPU_EVENT_ID_BLOCKING_SYNC, | 131 | NVGPU_EVENT_ID_BLOCKING_SYNC, |
@@ -609,9 +598,6 @@ int gr_gk20a_fecs_set_reglist_bind_inst(struct gk20a *g, | |||
609 | struct nvgpu_mem *inst_block); | 598 | struct nvgpu_mem *inst_block); |
610 | int gr_gk20a_fecs_set_reglist_virtual_addr(struct gk20a *g, u64 pmu_va); | 599 | int gr_gk20a_fecs_set_reglist_virtual_addr(struct gk20a *g, u64 pmu_va); |
611 | 600 | ||
612 | void gr_gk20a_init_elcg_mode(struct gk20a *g, u32 mode, u32 engine); | ||
613 | void gr_gk20a_init_blcg_mode(struct gk20a *g, u32 mode, u32 engine); | ||
614 | |||
615 | void gr_gk20a_init_cg_mode(struct gk20a *g, u32 cgmode, u32 mode_config); | 601 | void gr_gk20a_init_cg_mode(struct gk20a *g, u32 cgmode, u32 mode_config); |
616 | 602 | ||
617 | /* sm */ | 603 | /* sm */ |
diff --git a/drivers/gpu/nvgpu/gk20a/therm_gk20a.c b/drivers/gpu/nvgpu/gk20a/therm_gk20a.c deleted file mode 100644 index b4a81aed..00000000 --- a/drivers/gpu/nvgpu/gk20a/therm_gk20a.c +++ /dev/null | |||
@@ -1,111 +0,0 @@ | |||
1 | /* | ||
2 | * GK20A Therm | ||
3 | * | ||
4 | * Copyright (c) 2011-2018, 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/enabled.h> | ||
26 | #include <nvgpu/io.h> | ||
27 | #include <nvgpu/utils.h> | ||
28 | |||
29 | #include "gk20a.h" | ||
30 | |||
31 | #include <nvgpu/hw/gk20a/hw_gr_gk20a.h> | ||
32 | #include <nvgpu/hw/gk20a/hw_therm_gk20a.h> | ||
33 | |||
34 | static int gk20a_init_therm_reset_enable_hw(struct gk20a *g) | ||
35 | { | ||
36 | return 0; | ||
37 | } | ||
38 | |||
39 | static int gk20a_init_therm_setup_sw(struct gk20a *g) | ||
40 | { | ||
41 | return 0; | ||
42 | } | ||
43 | |||
44 | int gk20a_init_therm_support(struct gk20a *g) | ||
45 | { | ||
46 | u32 err; | ||
47 | |||
48 | nvgpu_log_fn(g, " "); | ||
49 | |||
50 | err = gk20a_init_therm_reset_enable_hw(g); | ||
51 | if (err) | ||
52 | return err; | ||
53 | |||
54 | err = gk20a_init_therm_setup_sw(g); | ||
55 | if (err) | ||
56 | return err; | ||
57 | |||
58 | if (g->ops.therm.init_therm_setup_hw) | ||
59 | err = g->ops.therm.init_therm_setup_hw(g); | ||
60 | if (err) | ||
61 | return err; | ||
62 | |||
63 | #ifdef CONFIG_DEBUG_FS | ||
64 | if (g->ops.therm.therm_debugfs_init) | ||
65 | g->ops.therm.therm_debugfs_init(g); | ||
66 | #endif | ||
67 | |||
68 | return err; | ||
69 | } | ||
70 | |||
71 | int gk20a_elcg_init_idle_filters(struct gk20a *g) | ||
72 | { | ||
73 | u32 gate_ctrl, idle_filter; | ||
74 | u32 engine_id; | ||
75 | u32 active_engine_id = 0; | ||
76 | struct fifo_gk20a *f = &g->fifo; | ||
77 | |||
78 | nvgpu_log_fn(g, " "); | ||
79 | |||
80 | for (engine_id = 0; engine_id < f->num_engines; engine_id++) { | ||
81 | active_engine_id = f->active_engines_list[engine_id]; | ||
82 | gate_ctrl = gk20a_readl(g, therm_gate_ctrl_r(active_engine_id)); | ||
83 | |||
84 | if (nvgpu_is_enabled(g, NVGPU_IS_FMODEL)) { | ||
85 | gate_ctrl = set_field(gate_ctrl, | ||
86 | therm_gate_ctrl_eng_delay_after_m(), | ||
87 | therm_gate_ctrl_eng_delay_after_f(4)); | ||
88 | } | ||
89 | |||
90 | /* 2 * (1 << 9) = 1024 clks */ | ||
91 | gate_ctrl = set_field(gate_ctrl, | ||
92 | therm_gate_ctrl_eng_idle_filt_exp_m(), | ||
93 | therm_gate_ctrl_eng_idle_filt_exp_f(9)); | ||
94 | gate_ctrl = set_field(gate_ctrl, | ||
95 | therm_gate_ctrl_eng_idle_filt_mant_m(), | ||
96 | therm_gate_ctrl_eng_idle_filt_mant_f(2)); | ||
97 | gk20a_writel(g, therm_gate_ctrl_r(active_engine_id), gate_ctrl); | ||
98 | } | ||
99 | |||
100 | /* default fecs_idle_filter to 0 */ | ||
101 | idle_filter = gk20a_readl(g, therm_fecs_idle_filter_r()); | ||
102 | idle_filter &= ~therm_fecs_idle_filter_value_m(); | ||
103 | gk20a_writel(g, therm_fecs_idle_filter_r(), idle_filter); | ||
104 | /* default hubmmu_idle_filter to 0 */ | ||
105 | idle_filter = gk20a_readl(g, therm_hubmmu_idle_filter_r()); | ||
106 | idle_filter &= ~therm_hubmmu_idle_filter_value_m(); | ||
107 | gk20a_writel(g, therm_hubmmu_idle_filter_r(), idle_filter); | ||
108 | |||
109 | nvgpu_log_fn(g, "done"); | ||
110 | return 0; | ||
111 | } | ||
diff --git a/drivers/gpu/nvgpu/gm20b/hal_gm20b.c b/drivers/gpu/nvgpu/gm20b/hal_gm20b.c index e6c4c8d1..05acc0cf 100644 --- a/drivers/gpu/nvgpu/gm20b/hal_gm20b.c +++ b/drivers/gpu/nvgpu/gm20b/hal_gm20b.c | |||
@@ -29,12 +29,13 @@ | |||
29 | #include "common/ptimer/ptimer_gk20a.h" | 29 | #include "common/ptimer/ptimer_gk20a.h" |
30 | #include "common/fb/fb_gk20a.h" | 30 | #include "common/fb/fb_gk20a.h" |
31 | #include "common/fb/fb_gm20b.h" | 31 | #include "common/fb/fb_gm20b.h" |
32 | #include "common/therm/therm_gm20b.h" | ||
33 | #include "common/therm/therm_gm20b.h" | ||
32 | 34 | ||
33 | #include "gk20a/gk20a.h" | 35 | #include "gk20a/gk20a.h" |
34 | #include "gk20a/ce2_gk20a.h" | 36 | #include "gk20a/ce2_gk20a.h" |
35 | #include "gk20a/dbg_gpu_gk20a.h" | 37 | #include "gk20a/dbg_gpu_gk20a.h" |
36 | #include "gk20a/fifo_gk20a.h" | 38 | #include "gk20a/fifo_gk20a.h" |
37 | #include "gk20a/therm_gk20a.h" | ||
38 | #include "gk20a/mm_gk20a.h" | 39 | #include "gk20a/mm_gk20a.h" |
39 | #include "gk20a/css_gr_gk20a.h" | 40 | #include "gk20a/css_gr_gk20a.h" |
40 | #include "gk20a/mc_gk20a.h" | 41 | #include "gk20a/mc_gk20a.h" |
@@ -53,7 +54,6 @@ | |||
53 | #include "pmu_gm20b.h" | 54 | #include "pmu_gm20b.h" |
54 | #include "clk_gm20b.h" | 55 | #include "clk_gm20b.h" |
55 | #include "regops_gm20b.h" | 56 | #include "regops_gm20b.h" |
56 | #include "therm_gm20b.h" | ||
57 | #include "hal_gm20b.h" | 57 | #include "hal_gm20b.h" |
58 | #include "acr_gm20b.h" | 58 | #include "acr_gm20b.h" |
59 | #include "fuse_gm20b.h" | 59 | #include "fuse_gm20b.h" |
@@ -291,7 +291,6 @@ static const struct gpu_ops gm20b_ops = { | |||
291 | .commit_inst = gr_gk20a_commit_inst, | 291 | .commit_inst = gr_gk20a_commit_inst, |
292 | .write_zcull_ptr = gr_gk20a_write_zcull_ptr, | 292 | .write_zcull_ptr = gr_gk20a_write_zcull_ptr, |
293 | .write_pm_ptr = gr_gk20a_write_pm_ptr, | 293 | .write_pm_ptr = gr_gk20a_write_pm_ptr, |
294 | .init_elcg_mode = gr_gk20a_init_elcg_mode, | ||
295 | .load_tpc_mask = gr_gm20b_load_tpc_mask, | 294 | .load_tpc_mask = gr_gm20b_load_tpc_mask, |
296 | .inval_icache = gr_gk20a_inval_icache, | 295 | .inval_icache = gr_gk20a_inval_icache, |
297 | .trigger_suspend = gr_gk20a_trigger_suspend, | 296 | .trigger_suspend = gr_gk20a_trigger_suspend, |
@@ -512,7 +511,9 @@ static const struct gpu_ops gm20b_ops = { | |||
512 | }, | 511 | }, |
513 | .therm = { | 512 | .therm = { |
514 | .init_therm_setup_hw = gm20b_init_therm_setup_hw, | 513 | .init_therm_setup_hw = gm20b_init_therm_setup_hw, |
515 | .elcg_init_idle_filters = gk20a_elcg_init_idle_filters, | 514 | .init_elcg_mode = gm20b_therm_init_elcg_mode, |
515 | .init_blcg_mode = gm20b_therm_init_blcg_mode, | ||
516 | .elcg_init_idle_filters = gm20b_elcg_init_idle_filters, | ||
516 | }, | 517 | }, |
517 | .pmu = { | 518 | .pmu = { |
518 | .pmu_setup_elpg = gm20b_pmu_setup_elpg, | 519 | .pmu_setup_elpg = gm20b_pmu_setup_elpg, |
diff --git a/drivers/gpu/nvgpu/gp106/hal_gp106.c b/drivers/gpu/nvgpu/gp106/hal_gp106.c index 90d25fa0..02a2f0a6 100644 --- a/drivers/gpu/nvgpu/gp106/hal_gp106.c +++ b/drivers/gpu/nvgpu/gp106/hal_gp106.c | |||
@@ -34,6 +34,8 @@ | |||
34 | #include "common/fb/fb_gm20b.h" | 34 | #include "common/fb/fb_gm20b.h" |
35 | #include "common/fb/fb_gp106.h" | 35 | #include "common/fb/fb_gp106.h" |
36 | #include "common/xve/xve_gp106.h" | 36 | #include "common/xve/xve_gp106.h" |
37 | #include "common/therm/therm_gm20b.h" | ||
38 | #include "common/therm/therm_gp106.h" | ||
37 | 39 | ||
38 | #include "gk20a/gk20a.h" | 40 | #include "gk20a/gk20a.h" |
39 | #include "gk20a/fifo_gk20a.h" | 41 | #include "gk20a/fifo_gk20a.h" |
@@ -76,7 +78,6 @@ | |||
76 | #include "gp106/clk_arb_gp106.h" | 78 | #include "gp106/clk_arb_gp106.h" |
77 | #include "gp106/mclk_gp106.h" | 79 | #include "gp106/mclk_gp106.h" |
78 | #include "gp106/bios_gp106.h" | 80 | #include "gp106/bios_gp106.h" |
79 | #include "gp106/therm_gp106.h" | ||
80 | #include "gp106/fifo_gp106.h" | 81 | #include "gp106/fifo_gp106.h" |
81 | #include "gp106/clk_gp106.h" | 82 | #include "gp106/clk_gp106.h" |
82 | #include "gp106/mm_gp106.h" | 83 | #include "gp106/mm_gp106.h" |
@@ -349,7 +350,6 @@ static const struct gpu_ops gp106_ops = { | |||
349 | .commit_inst = gr_gk20a_commit_inst, | 350 | .commit_inst = gr_gk20a_commit_inst, |
350 | .write_zcull_ptr = gr_gk20a_write_zcull_ptr, | 351 | .write_zcull_ptr = gr_gk20a_write_zcull_ptr, |
351 | .write_pm_ptr = gr_gk20a_write_pm_ptr, | 352 | .write_pm_ptr = gr_gk20a_write_pm_ptr, |
352 | .init_elcg_mode = gr_gk20a_init_elcg_mode, | ||
353 | .load_tpc_mask = gr_gm20b_load_tpc_mask, | 353 | .load_tpc_mask = gr_gm20b_load_tpc_mask, |
354 | .inval_icache = gr_gk20a_inval_icache, | 354 | .inval_icache = gr_gk20a_inval_icache, |
355 | .trigger_suspend = gr_gk20a_trigger_suspend, | 355 | .trigger_suspend = gr_gk20a_trigger_suspend, |
@@ -606,6 +606,8 @@ static const struct gpu_ops gp106_ops = { | |||
606 | #ifdef CONFIG_DEBUG_FS | 606 | #ifdef CONFIG_DEBUG_FS |
607 | .therm_debugfs_init = gp106_therm_debugfs_init, | 607 | .therm_debugfs_init = gp106_therm_debugfs_init, |
608 | #endif /* CONFIG_DEBUG_FS */ | 608 | #endif /* CONFIG_DEBUG_FS */ |
609 | .init_elcg_mode = gm20b_therm_init_elcg_mode, | ||
610 | .init_blcg_mode = gm20b_therm_init_blcg_mode, | ||
609 | .elcg_init_idle_filters = gp106_elcg_init_idle_filters, | 611 | .elcg_init_idle_filters = gp106_elcg_init_idle_filters, |
610 | .get_internal_sensor_curr_temp = | 612 | .get_internal_sensor_curr_temp = |
611 | gp106_get_internal_sensor_curr_temp, | 613 | gp106_get_internal_sensor_curr_temp, |
diff --git a/drivers/gpu/nvgpu/gp10b/hal_gp10b.c b/drivers/gpu/nvgpu/gp10b/hal_gp10b.c index 5f55baa3..cfbdc6ce 100644 --- a/drivers/gpu/nvgpu/gp10b/hal_gp10b.c +++ b/drivers/gpu/nvgpu/gp10b/hal_gp10b.c | |||
@@ -32,6 +32,8 @@ | |||
32 | #include "common/fb/fb_gk20a.h" | 32 | #include "common/fb/fb_gk20a.h" |
33 | #include "common/fb/fb_gm20b.h" | 33 | #include "common/fb/fb_gm20b.h" |
34 | #include "common/fb/fb_gp10b.h" | 34 | #include "common/fb/fb_gp10b.h" |
35 | #include "common/therm/therm_gm20b.h" | ||
36 | #include "common/therm/therm_gp10b.h" | ||
35 | 37 | ||
36 | #include "gk20a/gk20a.h" | 38 | #include "gk20a/gk20a.h" |
37 | #include "gk20a/fifo_gk20a.h" | 39 | #include "gk20a/fifo_gk20a.h" |
@@ -56,7 +58,6 @@ | |||
56 | #include "gp10b/gr_ctx_gp10b.h" | 58 | #include "gp10b/gr_ctx_gp10b.h" |
57 | #include "gp10b/fifo_gp10b.h" | 59 | #include "gp10b/fifo_gp10b.h" |
58 | #include "gp10b/regops_gp10b.h" | 60 | #include "gp10b/regops_gp10b.h" |
59 | #include "gp10b/therm_gp10b.h" | ||
60 | #include "gp10b/ecc_gp10b.h" | 61 | #include "gp10b/ecc_gp10b.h" |
61 | 62 | ||
62 | #include "gm20b/ltc_gm20b.h" | 63 | #include "gm20b/ltc_gm20b.h" |
@@ -308,7 +309,6 @@ static const struct gpu_ops gp10b_ops = { | |||
308 | .commit_inst = gr_gk20a_commit_inst, | 309 | .commit_inst = gr_gk20a_commit_inst, |
309 | .write_zcull_ptr = gr_gk20a_write_zcull_ptr, | 310 | .write_zcull_ptr = gr_gk20a_write_zcull_ptr, |
310 | .write_pm_ptr = gr_gk20a_write_pm_ptr, | 311 | .write_pm_ptr = gr_gk20a_write_pm_ptr, |
311 | .init_elcg_mode = gr_gk20a_init_elcg_mode, | ||
312 | .load_tpc_mask = gr_gm20b_load_tpc_mask, | 312 | .load_tpc_mask = gr_gm20b_load_tpc_mask, |
313 | .inval_icache = gr_gk20a_inval_icache, | 313 | .inval_icache = gr_gk20a_inval_icache, |
314 | .trigger_suspend = gr_gk20a_trigger_suspend, | 314 | .trigger_suspend = gr_gk20a_trigger_suspend, |
@@ -573,6 +573,8 @@ static const struct gpu_ops gp10b_ops = { | |||
573 | }, | 573 | }, |
574 | .therm = { | 574 | .therm = { |
575 | .init_therm_setup_hw = gp10b_init_therm_setup_hw, | 575 | .init_therm_setup_hw = gp10b_init_therm_setup_hw, |
576 | .init_elcg_mode = gm20b_therm_init_elcg_mode, | ||
577 | .init_blcg_mode = gm20b_therm_init_blcg_mode, | ||
576 | .elcg_init_idle_filters = gp10b_elcg_init_idle_filters, | 578 | .elcg_init_idle_filters = gp10b_elcg_init_idle_filters, |
577 | }, | 579 | }, |
578 | .pmu = { | 580 | .pmu = { |
diff --git a/drivers/gpu/nvgpu/gv100/hal_gv100.c b/drivers/gpu/nvgpu/gv100/hal_gv100.c index 344ad1e8..7926c35c 100644 --- a/drivers/gpu/nvgpu/gv100/hal_gv100.c +++ b/drivers/gpu/nvgpu/gv100/hal_gv100.c | |||
@@ -35,6 +35,10 @@ | |||
35 | #include "common/fb/fb_gv11b.h" | 35 | #include "common/fb/fb_gv11b.h" |
36 | #include "common/fb/fb_gv100.h" | 36 | #include "common/fb/fb_gv100.h" |
37 | #include "common/xve/xve_gp106.h" | 37 | #include "common/xve/xve_gp106.h" |
38 | #include "common/therm/therm_gm20b.h" | ||
39 | #include "common/therm/therm_gp106.h" | ||
40 | #include "common/therm/therm_gp10b.h" | ||
41 | #include "common/therm/therm_gv11b.h" | ||
38 | 42 | ||
39 | #include "gk20a/gk20a.h" | 43 | #include "gk20a/gk20a.h" |
40 | #include "gk20a/fifo_gk20a.h" | 44 | #include "gk20a/fifo_gk20a.h" |
@@ -61,13 +65,11 @@ | |||
61 | #include "gp106/acr_gp106.h" | 65 | #include "gp106/acr_gp106.h" |
62 | #include "gp106/sec2_gp106.h" | 66 | #include "gp106/sec2_gp106.h" |
63 | #include "gp106/bios_gp106.h" | 67 | #include "gp106/bios_gp106.h" |
64 | #include "gp106/therm_gp106.h" | ||
65 | #include "gp106/clk_gp106.h" | 68 | #include "gp106/clk_gp106.h" |
66 | #include "gp106/flcn_gp106.h" | 69 | #include "gp106/flcn_gp106.h" |
67 | 70 | ||
68 | #include "gp10b/gr_gp10b.h" | 71 | #include "gp10b/gr_gp10b.h" |
69 | #include "gp10b/ltc_gp10b.h" | 72 | #include "gp10b/ltc_gp10b.h" |
70 | #include "gp10b/therm_gp10b.h" | ||
71 | #include "gp10b/mc_gp10b.h" | 73 | #include "gp10b/mc_gp10b.h" |
72 | #include "gp10b/ce_gp10b.h" | 74 | #include "gp10b/ce_gp10b.h" |
73 | #include "gp10b/fifo_gp10b.h" | 75 | #include "gp10b/fifo_gp10b.h" |
@@ -385,7 +387,6 @@ static const struct gpu_ops gv100_ops = { | |||
385 | .commit_inst = gr_gv11b_commit_inst, | 387 | .commit_inst = gr_gv11b_commit_inst, |
386 | .write_zcull_ptr = gr_gv11b_write_zcull_ptr, | 388 | .write_zcull_ptr = gr_gv11b_write_zcull_ptr, |
387 | .write_pm_ptr = gr_gv11b_write_pm_ptr, | 389 | .write_pm_ptr = gr_gv11b_write_pm_ptr, |
388 | .init_elcg_mode = gr_gv11b_init_elcg_mode, | ||
389 | .load_tpc_mask = gr_gv11b_load_tpc_mask, | 390 | .load_tpc_mask = gr_gv11b_load_tpc_mask, |
390 | .inval_icache = gr_gk20a_inval_icache, | 391 | .inval_icache = gr_gk20a_inval_icache, |
391 | .trigger_suspend = gv11b_gr_sm_trigger_suspend, | 392 | .trigger_suspend = gv11b_gr_sm_trigger_suspend, |
@@ -703,6 +704,8 @@ static const struct gpu_ops gv100_ops = { | |||
703 | .therm_debugfs_init = gp106_therm_debugfs_init, | 704 | .therm_debugfs_init = gp106_therm_debugfs_init, |
704 | #endif /* CONFIG_DEBUG_FS */ | 705 | #endif /* CONFIG_DEBUG_FS */ |
705 | /* PROD values match with H/W INIT values */ | 706 | /* PROD values match with H/W INIT values */ |
707 | .init_elcg_mode = gv11b_therm_init_elcg_mode, | ||
708 | .init_blcg_mode = gm20b_therm_init_blcg_mode, | ||
706 | .elcg_init_idle_filters = NULL, | 709 | .elcg_init_idle_filters = NULL, |
707 | .get_internal_sensor_curr_temp = | 710 | .get_internal_sensor_curr_temp = |
708 | gp106_get_internal_sensor_curr_temp, | 711 | gp106_get_internal_sensor_curr_temp, |
diff --git a/drivers/gpu/nvgpu/gv11b/gr_gv11b.c b/drivers/gpu/nvgpu/gv11b/gr_gv11b.c index 058a21e5..c2cf909a 100644 --- a/drivers/gpu/nvgpu/gv11b/gr_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/gr_gv11b.c | |||
@@ -58,7 +58,6 @@ | |||
58 | #include <nvgpu/hw/gv11b/hw_mc_gv11b.h> | 58 | #include <nvgpu/hw/gv11b/hw_mc_gv11b.h> |
59 | #include <nvgpu/hw/gv11b/hw_ram_gv11b.h> | 59 | #include <nvgpu/hw/gv11b/hw_ram_gv11b.h> |
60 | #include <nvgpu/hw/gv11b/hw_pbdma_gv11b.h> | 60 | #include <nvgpu/hw/gv11b/hw_pbdma_gv11b.h> |
61 | #include <nvgpu/hw/gv11b/hw_therm_gv11b.h> | ||
62 | #include <nvgpu/hw/gv11b/hw_perf_gv11b.h> | 61 | #include <nvgpu/hw/gv11b/hw_perf_gv11b.h> |
63 | #include <nvgpu/hw/gv11b/hw_fuse_gv11b.h> | 62 | #include <nvgpu/hw/gv11b/hw_fuse_gv11b.h> |
64 | 63 | ||
@@ -2915,41 +2914,6 @@ void gr_gv11b_write_pm_ptr(struct gk20a *g, | |||
2915 | ctxsw_prog_main_image_pm_ptr_hi_o(), va_hi); | 2914 | ctxsw_prog_main_image_pm_ptr_hi_o(), va_hi); |
2916 | } | 2915 | } |
2917 | 2916 | ||
2918 | void gr_gv11b_init_elcg_mode(struct gk20a *g, u32 mode, u32 engine) | ||
2919 | { | ||
2920 | u32 gate_ctrl; | ||
2921 | |||
2922 | if (!nvgpu_is_enabled(g, NVGPU_GPU_CAN_ELCG)) | ||
2923 | return; | ||
2924 | |||
2925 | gate_ctrl = gk20a_readl(g, therm_gate_ctrl_r(engine)); | ||
2926 | |||
2927 | switch (mode) { | ||
2928 | case ELCG_RUN: | ||
2929 | gate_ctrl = set_field(gate_ctrl, | ||
2930 | therm_gate_ctrl_eng_clk_m(), | ||
2931 | therm_gate_ctrl_eng_clk_run_f()); | ||
2932 | gate_ctrl = set_field(gate_ctrl, | ||
2933 | therm_gate_ctrl_idle_holdoff_m(), | ||
2934 | therm_gate_ctrl_idle_holdoff_on_f()); | ||
2935 | break; | ||
2936 | case ELCG_STOP: | ||
2937 | gate_ctrl = set_field(gate_ctrl, | ||
2938 | therm_gate_ctrl_eng_clk_m(), | ||
2939 | therm_gate_ctrl_eng_clk_stop_f()); | ||
2940 | break; | ||
2941 | case ELCG_AUTO: | ||
2942 | gate_ctrl = set_field(gate_ctrl, | ||
2943 | therm_gate_ctrl_eng_clk_m(), | ||
2944 | therm_gate_ctrl_eng_clk_auto_f()); | ||
2945 | break; | ||
2946 | default: | ||
2947 | nvgpu_err(g, "invalid elcg mode %d", mode); | ||
2948 | } | ||
2949 | |||
2950 | gk20a_writel(g, therm_gate_ctrl_r(engine), gate_ctrl); | ||
2951 | } | ||
2952 | |||
2953 | void gr_gv11b_load_tpc_mask(struct gk20a *g) | 2917 | void gr_gv11b_load_tpc_mask(struct gk20a *g) |
2954 | { | 2918 | { |
2955 | u32 pes_tpc_mask = 0, fuse_tpc_mask; | 2919 | u32 pes_tpc_mask = 0, fuse_tpc_mask; |
diff --git a/drivers/gpu/nvgpu/gv11b/gr_gv11b.h b/drivers/gpu/nvgpu/gv11b/gr_gv11b.h index 0a8a536c..0f29ea24 100644 --- a/drivers/gpu/nvgpu/gv11b/gr_gv11b.h +++ b/drivers/gpu/nvgpu/gv11b/gr_gv11b.h | |||
@@ -158,7 +158,6 @@ void gr_gv11b_write_zcull_ptr(struct gk20a *g, | |||
158 | struct nvgpu_mem *mem, u64 gpu_va); | 158 | struct nvgpu_mem *mem, u64 gpu_va); |
159 | void gr_gv11b_write_pm_ptr(struct gk20a *g, | 159 | void gr_gv11b_write_pm_ptr(struct gk20a *g, |
160 | struct nvgpu_mem *mem, u64 gpu_va); | 160 | struct nvgpu_mem *mem, u64 gpu_va); |
161 | void gr_gv11b_init_elcg_mode(struct gk20a *g, u32 mode, u32 engine); | ||
162 | void gr_gv11b_load_tpc_mask(struct gk20a *g); | 161 | void gr_gv11b_load_tpc_mask(struct gk20a *g); |
163 | void gr_gv11b_set_preemption_buffer_va(struct gk20a *g, | 162 | void gr_gv11b_set_preemption_buffer_va(struct gk20a *g, |
164 | struct nvgpu_mem *mem, u64 gpu_va); | 163 | struct nvgpu_mem *mem, u64 gpu_va); |
diff --git a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c index 05763cce..111a1ea2 100644 --- a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c | |||
@@ -33,6 +33,9 @@ | |||
33 | #include "common/fb/fb_gm20b.h" | 33 | #include "common/fb/fb_gm20b.h" |
34 | #include "common/fb/fb_gp10b.h" | 34 | #include "common/fb/fb_gp10b.h" |
35 | #include "common/fb/fb_gv11b.h" | 35 | #include "common/fb/fb_gv11b.h" |
36 | #include "common/therm/therm_gm20b.h" | ||
37 | #include "common/therm/therm_gp10b.h" | ||
38 | #include "common/therm/therm_gv11b.h" | ||
36 | 39 | ||
37 | #include "gk20a/gk20a.h" | 40 | #include "gk20a/gk20a.h" |
38 | #include "gk20a/fifo_gk20a.h" | 41 | #include "gk20a/fifo_gk20a.h" |
@@ -54,7 +57,6 @@ | |||
54 | #include "gm20b/pmu_gm20b.h" | 57 | #include "gm20b/pmu_gm20b.h" |
55 | 58 | ||
56 | #include "gp10b/ltc_gp10b.h" | 59 | #include "gp10b/ltc_gp10b.h" |
57 | #include "gp10b/therm_gp10b.h" | ||
58 | #include "gp10b/mc_gp10b.h" | 60 | #include "gp10b/mc_gp10b.h" |
59 | #include "gp10b/ce_gp10b.h" | 61 | #include "gp10b/ce_gp10b.h" |
60 | #include "gp10b/fifo_gp10b.h" | 62 | #include "gp10b/fifo_gp10b.h" |
@@ -84,7 +86,6 @@ | |||
84 | #include "fifo_gv11b.h" | 86 | #include "fifo_gv11b.h" |
85 | #include "regops_gv11b.h" | 87 | #include "regops_gv11b.h" |
86 | #include "subctx_gv11b.h" | 88 | #include "subctx_gv11b.h" |
87 | #include "therm_gv11b.h" | ||
88 | #include "ecc_gv11b.h" | 89 | #include "ecc_gv11b.h" |
89 | 90 | ||
90 | #include <nvgpu/ptimer.h> | 91 | #include <nvgpu/ptimer.h> |
@@ -341,7 +342,6 @@ static const struct gpu_ops gv11b_ops = { | |||
341 | .commit_inst = gr_gv11b_commit_inst, | 342 | .commit_inst = gr_gv11b_commit_inst, |
342 | .write_zcull_ptr = gr_gv11b_write_zcull_ptr, | 343 | .write_zcull_ptr = gr_gv11b_write_zcull_ptr, |
343 | .write_pm_ptr = gr_gv11b_write_pm_ptr, | 344 | .write_pm_ptr = gr_gv11b_write_pm_ptr, |
344 | .init_elcg_mode = gr_gv11b_init_elcg_mode, | ||
345 | .load_tpc_mask = gr_gv11b_load_tpc_mask, | 345 | .load_tpc_mask = gr_gv11b_load_tpc_mask, |
346 | .inval_icache = gr_gk20a_inval_icache, | 346 | .inval_icache = gr_gk20a_inval_icache, |
347 | .trigger_suspend = gv11b_gr_sm_trigger_suspend, | 347 | .trigger_suspend = gv11b_gr_sm_trigger_suspend, |
@@ -664,6 +664,8 @@ static const struct gpu_ops gv11b_ops = { | |||
664 | }, | 664 | }, |
665 | .therm = { | 665 | .therm = { |
666 | .init_therm_setup_hw = gv11b_init_therm_setup_hw, | 666 | .init_therm_setup_hw = gv11b_init_therm_setup_hw, |
667 | .init_elcg_mode = gv11b_therm_init_elcg_mode, | ||
668 | .init_blcg_mode = gm20b_therm_init_blcg_mode, | ||
667 | .elcg_init_idle_filters = gv11b_elcg_init_idle_filters, | 669 | .elcg_init_idle_filters = gv11b_elcg_init_idle_filters, |
668 | }, | 670 | }, |
669 | .pmu = { | 671 | .pmu = { |
diff --git a/drivers/gpu/nvgpu/gk20a/therm_gk20a.h b/drivers/gpu/nvgpu/include/nvgpu/therm.h index 303c28f4..41808de8 100644 --- a/drivers/gpu/nvgpu/gk20a/therm_gk20a.h +++ b/drivers/gpu/nvgpu/include/nvgpu/therm.h | |||
@@ -19,13 +19,11 @@ | |||
19 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 19 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
20 | * DEALINGS IN THE SOFTWARE. | 20 | * DEALINGS IN THE SOFTWARE. |
21 | */ | 21 | */ |
22 | #ifndef THERM_GK20A_H | 22 | #ifndef NVGPU_THERM_H |
23 | #define THERM_GK20A_H | 23 | #define NVGPU_THERM_H |
24 | 24 | ||
25 | struct gpu_ops; | ||
26 | struct gk20a; | 25 | struct gk20a; |
27 | 26 | ||
28 | int gk20a_elcg_init_idle_filters(struct gk20a *g); | 27 | int nvgpu_init_therm_support(struct gk20a *g); |
29 | 28 | ||
30 | int gk20a_init_therm_support(struct gk20a *g); | 29 | #endif |
31 | #endif /* THERM_GK20A_H */ | ||
diff --git a/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_hal_gp10b.c b/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_hal_gp10b.c index 15e2717d..aadd17d6 100644 --- a/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_hal_gp10b.c +++ b/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_hal_gp10b.c | |||
@@ -28,6 +28,8 @@ | |||
28 | #include "common/fb/fb_gk20a.h" | 28 | #include "common/fb/fb_gk20a.h" |
29 | #include "common/fb/fb_gm20b.h" | 29 | #include "common/fb/fb_gm20b.h" |
30 | #include "common/fb/fb_gp10b.h" | 30 | #include "common/fb/fb_gp10b.h" |
31 | #include "common/therm/therm_gm20b.h" | ||
32 | #include "common/therm/therm_gp10b.h" | ||
31 | 33 | ||
32 | #include "vgpu/fifo_vgpu.h" | 34 | #include "vgpu/fifo_vgpu.h" |
33 | #include "vgpu/gr_vgpu.h" | 35 | #include "vgpu/gr_vgpu.h" |
@@ -56,7 +58,6 @@ | |||
56 | #include "gp10b/gr_ctx_gp10b.h" | 58 | #include "gp10b/gr_ctx_gp10b.h" |
57 | #include "gp10b/fifo_gp10b.h" | 59 | #include "gp10b/fifo_gp10b.h" |
58 | #include "gp10b/regops_gp10b.h" | 60 | #include "gp10b/regops_gp10b.h" |
59 | #include "gp10b/therm_gp10b.h" | ||
60 | #include "gp10b/fuse_gp10b.h" | 61 | #include "gp10b/fuse_gp10b.h" |
61 | 62 | ||
62 | #include "gm20b/ltc_gm20b.h" | 63 | #include "gm20b/ltc_gm20b.h" |
@@ -182,7 +183,6 @@ static const struct gpu_ops vgpu_gp10b_ops = { | |||
182 | .commit_inst = vgpu_gr_commit_inst, | 183 | .commit_inst = vgpu_gr_commit_inst, |
183 | .write_zcull_ptr = gr_gk20a_write_zcull_ptr, | 184 | .write_zcull_ptr = gr_gk20a_write_zcull_ptr, |
184 | .write_pm_ptr = gr_gk20a_write_pm_ptr, | 185 | .write_pm_ptr = gr_gk20a_write_pm_ptr, |
185 | .init_elcg_mode = gr_gk20a_init_elcg_mode, | ||
186 | .load_tpc_mask = gr_gm20b_load_tpc_mask, | 186 | .load_tpc_mask = gr_gm20b_load_tpc_mask, |
187 | .inval_icache = gr_gk20a_inval_icache, | 187 | .inval_icache = gr_gk20a_inval_icache, |
188 | .trigger_suspend = gr_gk20a_trigger_suspend, | 188 | .trigger_suspend = gr_gk20a_trigger_suspend, |
@@ -440,6 +440,8 @@ static const struct gpu_ops vgpu_gp10b_ops = { | |||
440 | }, | 440 | }, |
441 | .therm = { | 441 | .therm = { |
442 | .init_therm_setup_hw = gp10b_init_therm_setup_hw, | 442 | .init_therm_setup_hw = gp10b_init_therm_setup_hw, |
443 | .init_elcg_mode = gm20b_therm_init_elcg_mode, | ||
444 | .init_blcg_mode = gm20b_therm_init_blcg_mode, | ||
443 | .elcg_init_idle_filters = gp10b_elcg_init_idle_filters, | 445 | .elcg_init_idle_filters = gp10b_elcg_init_idle_filters, |
444 | }, | 446 | }, |
445 | .pmu = { | 447 | .pmu = { |
diff --git a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c b/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c index 995a2c2c..e2410e4e 100644 --- a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c +++ b/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c | |||
@@ -29,6 +29,9 @@ | |||
29 | #include "common/fb/fb_gm20b.h" | 29 | #include "common/fb/fb_gm20b.h" |
30 | #include "common/fb/fb_gp10b.h" | 30 | #include "common/fb/fb_gp10b.h" |
31 | #include "common/fb/fb_gv11b.h" | 31 | #include "common/fb/fb_gv11b.h" |
32 | #include "common/therm/therm_gm20b.h" | ||
33 | #include "common/therm/therm_gp10b.h" | ||
34 | #include "common/therm/therm_gv11b.h" | ||
32 | 35 | ||
33 | #include <gk20a/gk20a.h> | 36 | #include <gk20a/gk20a.h> |
34 | #include <gv11b/hal_gv11b.h> | 37 | #include <gv11b/hal_gv11b.h> |
@@ -63,7 +66,6 @@ | |||
63 | #include <gp10b/ce_gp10b.h> | 66 | #include <gp10b/ce_gp10b.h> |
64 | #include "gp10b/gr_gp10b.h" | 67 | #include "gp10b/gr_gp10b.h" |
65 | #include <gp10b/fifo_gp10b.h> | 68 | #include <gp10b/fifo_gp10b.h> |
66 | #include <gp10b/therm_gp10b.h> | ||
67 | #include <gp10b/ltc_gp10b.h> | 69 | #include <gp10b/ltc_gp10b.h> |
68 | #include <gp10b/fuse_gp10b.h> | 70 | #include <gp10b/fuse_gp10b.h> |
69 | 71 | ||
@@ -76,7 +78,6 @@ | |||
76 | #include <gv11b/mc_gv11b.h> | 78 | #include <gv11b/mc_gv11b.h> |
77 | #include <gv11b/ce_gv11b.h> | 79 | #include <gv11b/ce_gv11b.h> |
78 | #include <gv11b/fifo_gv11b.h> | 80 | #include <gv11b/fifo_gv11b.h> |
79 | #include <gv11b/therm_gv11b.h> | ||
80 | #include <gv11b/regops_gv11b.h> | 81 | #include <gv11b/regops_gv11b.h> |
81 | #include <gv11b/gr_ctx_gv11b.h> | 82 | #include <gv11b/gr_ctx_gv11b.h> |
82 | #include <gv11b/ltc_gv11b.h> | 83 | #include <gv11b/ltc_gv11b.h> |
@@ -200,7 +201,6 @@ static const struct gpu_ops vgpu_gv11b_ops = { | |||
200 | .commit_inst = vgpu_gr_gv11b_commit_inst, | 201 | .commit_inst = vgpu_gr_gv11b_commit_inst, |
201 | .write_zcull_ptr = gr_gv11b_write_zcull_ptr, | 202 | .write_zcull_ptr = gr_gv11b_write_zcull_ptr, |
202 | .write_pm_ptr = gr_gv11b_write_pm_ptr, | 203 | .write_pm_ptr = gr_gv11b_write_pm_ptr, |
203 | .init_elcg_mode = gr_gv11b_init_elcg_mode, | ||
204 | .load_tpc_mask = gr_gv11b_load_tpc_mask, | 204 | .load_tpc_mask = gr_gv11b_load_tpc_mask, |
205 | .inval_icache = gr_gk20a_inval_icache, | 205 | .inval_icache = gr_gk20a_inval_icache, |
206 | .trigger_suspend = gv11b_gr_sm_trigger_suspend, | 206 | .trigger_suspend = gv11b_gr_sm_trigger_suspend, |
@@ -505,6 +505,8 @@ static const struct gpu_ops vgpu_gv11b_ops = { | |||
505 | }, | 505 | }, |
506 | .therm = { | 506 | .therm = { |
507 | .init_therm_setup_hw = gp10b_init_therm_setup_hw, | 507 | .init_therm_setup_hw = gp10b_init_therm_setup_hw, |
508 | .init_elcg_mode = gv11b_therm_init_elcg_mode, | ||
509 | .init_blcg_mode = gm20b_therm_init_blcg_mode, | ||
508 | .elcg_init_idle_filters = gv11b_elcg_init_idle_filters, | 510 | .elcg_init_idle_filters = gv11b_elcg_init_idle_filters, |
509 | }, | 511 | }, |
510 | .pmu = { | 512 | .pmu = { |