diff options
Diffstat (limited to 'drivers/gpu/nvgpu')
-rw-r--r-- | drivers/gpu/nvgpu/gp10b/therm_gp10b.c | 53 |
1 files changed, 46 insertions, 7 deletions
diff --git a/drivers/gpu/nvgpu/gp10b/therm_gp10b.c b/drivers/gpu/nvgpu/gp10b/therm_gp10b.c index 471edb87..7bf0c0e5 100644 --- a/drivers/gpu/nvgpu/gp10b/therm_gp10b.c +++ b/drivers/gpu/nvgpu/gp10b/therm_gp10b.c | |||
@@ -3,7 +3,7 @@ | |||
3 | * | 3 | * |
4 | * GP10B Therm | 4 | * GP10B Therm |
5 | * | 5 | * |
6 | * Copyright (c) 2015, NVIDIA CORPORATION. All rights reserved. | 6 | * Copyright (c) 2015-2016, 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, |
@@ -20,6 +20,8 @@ | |||
20 | 20 | ||
21 | static int gp10b_init_therm_setup_hw(struct gk20a *g) | 21 | static int gp10b_init_therm_setup_hw(struct gk20a *g) |
22 | { | 22 | { |
23 | u32 v; | ||
24 | |||
23 | gk20a_dbg_fn(""); | 25 | gk20a_dbg_fn(""); |
24 | 26 | ||
25 | /* program NV_THERM registers */ | 27 | /* program NV_THERM registers */ |
@@ -27,14 +29,51 @@ static int gp10b_init_therm_setup_hw(struct gk20a *g) | |||
27 | therm_use_a_ext_therm_1_enable_f() | | 29 | therm_use_a_ext_therm_1_enable_f() | |
28 | therm_use_a_ext_therm_2_enable_f()); | 30 | therm_use_a_ext_therm_2_enable_f()); |
29 | gk20a_writel(g, therm_evt_ext_therm_0_r(), | 31 | gk20a_writel(g, therm_evt_ext_therm_0_r(), |
30 | therm_evt_ext_therm_0_slow_factor_f( | 32 | therm_evt_ext_therm_0_slow_factor_f(0x2)); |
31 | therm_evt_ext_therm_0_slow_factor_init_v())); | ||
32 | gk20a_writel(g, therm_evt_ext_therm_1_r(), | 33 | gk20a_writel(g, therm_evt_ext_therm_1_r(), |
33 | therm_evt_ext_therm_1_slow_factor_f( | 34 | therm_evt_ext_therm_1_slow_factor_f(0x6)); |
34 | therm_evt_ext_therm_1_slow_factor_init_v())); | ||
35 | gk20a_writel(g, therm_evt_ext_therm_2_r(), | 35 | gk20a_writel(g, therm_evt_ext_therm_2_r(), |
36 | therm_evt_ext_therm_2_slow_factor_f( | 36 | therm_evt_ext_therm_2_slow_factor_f(0xe)); |
37 | therm_evt_ext_therm_2_slow_factor_init_v())); | 37 | |
38 | gk20a_writel(g, therm_grad_stepping_table_r(0), | ||
39 | therm_grad_stepping_table_slowdown_factor0_f( | ||
40 | therm_grad_stepping_table_slowdown_factor0_fpdiv_by1p5_f()) | | ||
41 | therm_grad_stepping_table_slowdown_factor1_f( | ||
42 | therm_grad_stepping_table_slowdown_factor0_fpdiv_by2_f()) | | ||
43 | therm_grad_stepping_table_slowdown_factor2_f( | ||
44 | therm_grad_stepping_table_slowdown_factor0_fpdiv_by4_f()) | | ||
45 | therm_grad_stepping_table_slowdown_factor3_f( | ||
46 | therm_grad_stepping_table_slowdown_factor0_fpdiv_by8_f()) | | ||
47 | therm_grad_stepping_table_slowdown_factor4_f( | ||
48 | therm_grad_stepping_table_slowdown_factor0_fpdiv_by8_f())); | ||
49 | |||
50 | gk20a_writel(g, therm_grad_stepping_table_r(1), | ||
51 | therm_grad_stepping_table_slowdown_factor0_f( | ||
52 | therm_grad_stepping_table_slowdown_factor0_fpdiv_by8_f()) | | ||
53 | therm_grad_stepping_table_slowdown_factor1_f( | ||
54 | therm_grad_stepping_table_slowdown_factor0_fpdiv_by8_f()) | | ||
55 | therm_grad_stepping_table_slowdown_factor2_f( | ||
56 | therm_grad_stepping_table_slowdown_factor0_fpdiv_by8_f()) | | ||
57 | therm_grad_stepping_table_slowdown_factor3_f( | ||
58 | therm_grad_stepping_table_slowdown_factor0_fpdiv_by8_f()) | | ||
59 | therm_grad_stepping_table_slowdown_factor4_f( | ||
60 | therm_grad_stepping_table_slowdown_factor0_fpdiv_by8_f())); | ||
61 | |||
62 | v = gk20a_readl(g, therm_clk_timing_r(0)); | ||
63 | v |= therm_clk_timing_grad_slowdown_enabled_f(); | ||
64 | gk20a_writel(g, therm_clk_timing_r(0), v); | ||
65 | |||
66 | v = gk20a_readl(g, therm_config2_r()); | ||
67 | v |= therm_config2_grad_enable_f(1); | ||
68 | v |= therm_config2_slowdown_factor_extended_f(1); | ||
69 | gk20a_writel(g, therm_config2_r(), v); | ||
70 | |||
71 | gk20a_writel(g, therm_grad_stepping1_r(), | ||
72 | therm_grad_stepping1_pdiv_duration_f(32)); | ||
73 | |||
74 | v = gk20a_readl(g, therm_grad_stepping0_r()); | ||
75 | v |= therm_grad_stepping0_feature_enable_f(); | ||
76 | gk20a_writel(g, therm_grad_stepping0_r(), v); | ||
38 | 77 | ||
39 | return 0; | 78 | return 0; |
40 | } | 79 | } |