summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/therm_gk20a.c
diff options
context:
space:
mode:
authorSeshendra Gadagottu <sgadagottu@nvidia.com>2015-10-23 15:02:55 -0400
committerTerje Bergstrom <tbergstrom@nvidia.com>2015-10-27 18:42:08 -0400
commit004a1880ed80f3b384cf3d0d37e0a58eff29fcaf (patch)
treeb1f55beabeeb3b9a411ff609b7c6c4984aae40c6 /drivers/gpu/nvgpu/gk20a/therm_gk20a.c
parent057c6334f7f72071bc87a1793b688b34add7c681 (diff)
gpu: nvgpu: update thermal programming
Add required fileds and values for thermal slow-down settings in thermal header file and implemented chip specific thermal register programming Reviewed-on: http://git-master/r/822199 (cherry picked from commit 9e8a745b8295af002b9780c83caa8dc7b22cc737) Change-Id: I016b18ed230fa6c104eada2e166ccd1a5f2ace36 Signed-off-by: Seshendra Gadagottu <sgadagottu@nvidia.com> Reviewed-on: http://git-master/r/823012 GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/therm_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/therm_gk20a.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/therm_gk20a.c b/drivers/gpu/nvgpu/gk20a/therm_gk20a.c
index fd4149ae..1c1b8419 100644
--- a/drivers/gpu/nvgpu/gk20a/therm_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/therm_gk20a.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * GK20A Therm 4 * GK20A Therm
5 * 5 *
6 * Copyright (c) 2011-2014, NVIDIA CORPORATION. All rights reserved. 6 * Copyright (c) 2011-2015, NVIDIA CORPORATION. All rights reserved.
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify it 8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms and conditions of the GNU General Public License, 9 * under the terms and conditions of the GNU General Public License,
@@ -38,13 +38,20 @@ static int gk20a_init_therm_setup_hw(struct gk20a *g)
38 u32 v; 38 u32 v;
39 39
40 /* program NV_THERM registers */ 40 /* program NV_THERM registers */
41 gk20a_writel(g, therm_use_a_r(), NV_THERM_USE_A_INIT); 41 gk20a_writel(g, therm_use_a_r(), therm_use_a_ext_therm_0_enable_f() |
42 therm_use_a_ext_therm_1_enable_f() |
43 therm_use_a_ext_therm_2_enable_f());
44 /* priority for EXT_THERM_0 event set to highest */
42 gk20a_writel(g, therm_evt_ext_therm_0_r(), 45 gk20a_writel(g, therm_evt_ext_therm_0_r(),
43 NV_THERM_EVT_EXT_THERM_0_INIT); 46 therm_evt_ext_therm_0_slow_factor_f(1) |
47 therm_evt_ext_therm_0_priority_f(3));
44 gk20a_writel(g, therm_evt_ext_therm_1_r(), 48 gk20a_writel(g, therm_evt_ext_therm_1_r(),
45 NV_THERM_EVT_EXT_THERM_1_INIT); 49 therm_evt_ext_therm_1_slow_factor_f(2) |
50 therm_evt_ext_therm_1_priority_f(2));
46 gk20a_writel(g, therm_evt_ext_therm_2_r(), 51 gk20a_writel(g, therm_evt_ext_therm_2_r(),
47 NV_THERM_EVT_EXT_THERM_2_INIT); 52 therm_evt_ext_therm_2_slow_factor_f(3) |
53 therm_evt_ext_therm_2_priority_f(1));
54
48 55
49 gk20a_writel(g, therm_grad_stepping_table_r(0), 56 gk20a_writel(g, therm_grad_stepping_table_r(0),
50 therm_grad_stepping_table_slowdown_factor0_f(therm_grad_stepping_table_slowdown_factor0_fpdiv_by1p5_f()) | 57 therm_grad_stepping_table_slowdown_factor0_f(therm_grad_stepping_table_slowdown_factor0_fpdiv_by1p5_f()) |
@@ -92,9 +99,15 @@ int gk20a_init_therm_support(struct gk20a *g)
92 if (err) 99 if (err)
93 return err; 100 return err;
94 101
95 err = gk20a_init_therm_setup_hw(g); 102 if (g->ops.therm.init_therm_setup_hw)
103 err = g->ops.therm.init_therm_setup_hw(g);
96 if (err) 104 if (err)
97 return err; 105 return err;
98 106
99 return err; 107 return err;
100} 108}
109
110void gk20a_init_therm_ops(struct gpu_ops *gops)
111{
112 gops->therm.init_therm_setup_hw = gk20a_init_therm_setup_hw;
113}