summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/therm_gk20a.c
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2016-09-13 13:52:05 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2016-10-19 23:43:50 -0400
commitf4b05d295fe821d2871ba22dde178674359fe563 (patch)
tree8f2ae393a1763efe488c76ff76427dea167041a5 /drivers/gpu/nvgpu/gk20a/therm_gk20a.c
parentbf29bd942201e17f55ff0894833a84b8f6c0bf97 (diff)
gpu: nvgpu: Move ELCG programming to therm
Move ELCG parameter programming to a new function in therm, elcg_init_idle_filter. Implement gk20a variant and use it for gk20a and gm20b. JIRA DNVGPU-74 Change-Id: I8ef400f3a6195311fb9e7da8db6c34993d62f461 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/1220433 (cherry picked from commit f6654ae4d83d31cd40b317bf55922964bbfa575d) Reviewed-on: http://git-master/r/1239421 GVS: Gerrit_Virtual_Submit
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/therm_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/therm_gk20a.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/therm_gk20a.c b/drivers/gpu/nvgpu/gk20a/therm_gk20a.c
index da8e2894..e983a814 100644
--- a/drivers/gpu/nvgpu/gk20a/therm_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/therm_gk20a.c
@@ -110,7 +110,51 @@ int gk20a_init_therm_support(struct gk20a *g)
110 return err; 110 return err;
111} 111}
112 112
113int gk20a_elcg_init_idle_filters(struct gk20a *g)
114{
115 u32 gate_ctrl, idle_filter;
116 u32 engine_id;
117 u32 active_engine_id = 0;
118 struct fifo_gk20a *f = &g->fifo;
119 struct gk20a_platform *platform = dev_get_drvdata(g->dev);
120
121 gk20a_dbg_fn("");
122
123 for (engine_id = 0; engine_id < f->num_engines; engine_id++) {
124 active_engine_id = f->active_engines_list[engine_id];
125 gate_ctrl = gk20a_readl(g, therm_gate_ctrl_r(active_engine_id));
126
127 if (platform->is_fmodel) {
128 gate_ctrl = set_field(gate_ctrl,
129 therm_gate_ctrl_eng_delay_after_m(),
130 therm_gate_ctrl_eng_delay_after_f(4));
131 }
132
133 /* 2 * (1 << 9) = 1024 clks */
134 gate_ctrl = set_field(gate_ctrl,
135 therm_gate_ctrl_eng_idle_filt_exp_m(),
136 therm_gate_ctrl_eng_idle_filt_exp_f(9));
137 gate_ctrl = set_field(gate_ctrl,
138 therm_gate_ctrl_eng_idle_filt_mant_m(),
139 therm_gate_ctrl_eng_idle_filt_mant_f(2));
140 gk20a_writel(g, therm_gate_ctrl_r(active_engine_id), gate_ctrl);
141 }
142
143 /* default fecs_idle_filter to 0 */
144 idle_filter = gk20a_readl(g, therm_fecs_idle_filter_r());
145 idle_filter &= ~therm_fecs_idle_filter_value_m();
146 gk20a_writel(g, therm_fecs_idle_filter_r(), idle_filter);
147 /* default hubmmu_idle_filter to 0 */
148 idle_filter = gk20a_readl(g, therm_hubmmu_idle_filter_r());
149 idle_filter &= ~therm_hubmmu_idle_filter_value_m();
150 gk20a_writel(g, therm_hubmmu_idle_filter_r(), idle_filter);
151
152 gk20a_dbg_fn("done");
153 return 0;
154}
155
113void gk20a_init_therm_ops(struct gpu_ops *gops) 156void gk20a_init_therm_ops(struct gpu_ops *gops)
114{ 157{
115 gops->therm.init_therm_setup_hw = gk20a_init_therm_setup_hw; 158 gops->therm.init_therm_setup_hw = gk20a_init_therm_setup_hw;
159 gops->therm.elcg_init_idle_filters = gk20a_elcg_init_idle_filters;
116} 160}