summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gv11b/therm_gv11b.c
diff options
context:
space:
mode:
authorSeema Khowala <seemaj@nvidia.com>2017-09-28 19:57:16 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-10-03 16:35:48 -0400
commitf63f96866dd3cd696e37cf7e83d419cca4f965fa (patch)
tree7d457855a5018e41fc6d3d53df003c506abf5cb3 /drivers/gpu/nvgpu/gv11b/therm_gv11b.c
parent058485d28538b033636180c11592a9088878c807 (diff)
gpu: nvgpu: gv11b: init therm regs for pwr/clk
init *eng_delay*, *eng_idle_filt*, *fecs_idle_filter* and *hubmmu_idle_filter* in therm regs. Change-Id: I4ab5374084e993cd96ef28ace87b6013b996178d Signed-off-by: Seema Khowala <seemaj@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1570556 Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-by: Seshendra Gadagottu <sgadagottu@nvidia.com> Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gv11b/therm_gv11b.c')
-rw-r--r--drivers/gpu/nvgpu/gv11b/therm_gv11b.c75
1 files changed, 75 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gv11b/therm_gv11b.c b/drivers/gpu/nvgpu/gv11b/therm_gv11b.c
new file mode 100644
index 00000000..18987119
--- /dev/null
+++ b/drivers/gpu/nvgpu/gv11b/therm_gv11b.c
@@ -0,0 +1,75 @@
1/*
2 * GV11B Therm
3 *
4 * Copyright (c) 2015-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
25#include "gk20a/gk20a.h"
26
27#include <nvgpu/soc.h>
28
29#include <nvgpu/hw/gv11b/hw_therm_gv11b.h>
30
31int gv11b_elcg_init_idle_filters(struct gk20a *g)
32{
33 u32 gate_ctrl, idle_filter;
34 u32 engine_id;
35 u32 active_engine_id = 0;
36 struct fifo_gk20a *f = &g->fifo;
37
38 if (nvgpu_platform_is_simulation(g))
39 return 0;
40
41 gk20a_dbg_info("init clock/power gate reg");
42
43 for (engine_id = 0; engine_id < f->num_engines; engine_id++) {
44 active_engine_id = f->active_engines_list[engine_id];
45
46 gate_ctrl = gk20a_readl(g, therm_gate_ctrl_r(active_engine_id));
47 gate_ctrl = set_field(gate_ctrl,
48 therm_gate_ctrl_eng_idle_filt_exp_m(),
49 therm_gate_ctrl_eng_idle_filt_exp__prod_f());
50 gate_ctrl = set_field(gate_ctrl,
51 therm_gate_ctrl_eng_idle_filt_mant_m(),
52 therm_gate_ctrl_eng_idle_filt_mant__prod_f());
53 gate_ctrl = set_field(gate_ctrl,
54 therm_gate_ctrl_eng_delay_before_m(),
55 therm_gate_ctrl_eng_delay_before__prod_f());
56 gate_ctrl = set_field(gate_ctrl,
57 therm_gate_ctrl_eng_delay_after_m(),
58 therm_gate_ctrl_eng_delay_after__prod_f());
59 gk20a_writel(g, therm_gate_ctrl_r(active_engine_id), gate_ctrl);
60 }
61
62 idle_filter = gk20a_readl(g, therm_fecs_idle_filter_r());
63 idle_filter = set_field(idle_filter,
64 therm_fecs_idle_filter_value_m(),
65 therm_fecs_idle_filter_value__prod_f());
66 gk20a_writel(g, therm_fecs_idle_filter_r(), idle_filter);
67
68 idle_filter = gk20a_readl(g, therm_hubmmu_idle_filter_r());
69 idle_filter = set_field(idle_filter,
70 therm_hubmmu_idle_filter_value_m(),
71 therm_hubmmu_idle_filter_value__prod_f());
72 gk20a_writel(g, therm_hubmmu_idle_filter_r(), idle_filter);
73
74 return 0;
75}