summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/therm_gk20a.c
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2018-08-09 12:20:33 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-08-14 18:33:20 -0400
commit91390d857f6302f9c2923ec4188ea7e24ee537a2 (patch)
treee0884e79ea748d2c0bd384c29f805125a7b88fec /drivers/gpu/nvgpu/gk20a/therm_gk20a.c
parent02f9c99e4b4a452ded20978c5ee1e27b775b9224 (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>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/therm_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/therm_gk20a.c111
1 files changed, 0 insertions, 111 deletions
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
34static int gk20a_init_therm_reset_enable_hw(struct gk20a *g)
35{
36 return 0;
37}
38
39static int gk20a_init_therm_setup_sw(struct gk20a *g)
40{
41 return 0;
42}
43
44int 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
71int 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}