summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gv11b/therm_gv11b.c
diff options
context:
space:
mode:
authorseshendra Gadagottu <sgadagottu@nvidia.com>2017-12-12 14:36:42 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2017-12-14 18:11:26 -0500
commit65513bc33d65c921cd556a72e4e9263565dca4bf (patch)
tree60576c70fc394347d2e004d2f1e2b9db5fa50d33 /drivers/gpu/nvgpu/gv11b/therm_gv11b.c
parent28a642f6bbf62dce632d6d4ef75eabc1da0128ef (diff)
gpu: nvgpu: gv11b: update thermal settings
For gv11b, update thermal settings as per hw POR: 1.Created gv11b specific HAL for init_therm_setup_hw 2.Update steps for gradual slowdown to 1x,1.5x,2x,4x,8x,16x,32x. 3.Modified gradual step duration cycles to 4. Bug 200365110 Change-Id: I93c28a3394857aacdf3d304103c9e7c25d4ad344 Signed-off-by: seshendra Gadagottu <sgadagottu@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1616600 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gv11b/therm_gv11b.c')
-rw-r--r--drivers/gpu/nvgpu/gv11b/therm_gv11b.c62
1 files changed, 62 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gv11b/therm_gv11b.c b/drivers/gpu/nvgpu/gv11b/therm_gv11b.c
index 18987119..f2d929fa 100644
--- a/drivers/gpu/nvgpu/gv11b/therm_gv11b.c
+++ b/drivers/gpu/nvgpu/gv11b/therm_gv11b.c
@@ -28,6 +28,68 @@
28 28
29#include <nvgpu/hw/gv11b/hw_therm_gv11b.h> 29#include <nvgpu/hw/gv11b/hw_therm_gv11b.h>
30 30
31int gv11b_init_therm_setup_hw(struct gk20a *g)
32{
33 u32 v;
34
35 gk20a_dbg_fn("");
36
37 /* program NV_THERM registers */
38 gk20a_writel(g, therm_use_a_r(), therm_use_a_ext_therm_0_enable_f() |
39 therm_use_a_ext_therm_1_enable_f() |
40 therm_use_a_ext_therm_2_enable_f());
41 gk20a_writel(g, therm_evt_ext_therm_0_r(),
42 therm_evt_ext_therm_0_slow_factor_f(0x2));
43 gk20a_writel(g, therm_evt_ext_therm_1_r(),
44 therm_evt_ext_therm_1_slow_factor_f(0x6));
45 gk20a_writel(g, therm_evt_ext_therm_2_r(),
46 therm_evt_ext_therm_2_slow_factor_f(0xe));
47
48 gk20a_writel(g, therm_grad_stepping_table_r(0),
49 therm_grad_stepping_table_slowdown_factor0_f(
50 therm_grad_stepping_table_slowdown_factor0_fpdiv_by1_f()) |
51 therm_grad_stepping_table_slowdown_factor1_f(
52 therm_grad_stepping_table_slowdown_factor0_fpdiv_by1p5_f()) |
53 therm_grad_stepping_table_slowdown_factor2_f(
54 therm_grad_stepping_table_slowdown_factor0_fpdiv_by2_f()) |
55 therm_grad_stepping_table_slowdown_factor3_f(
56 therm_grad_stepping_table_slowdown_factor0_fpdiv_by4_f()) |
57 therm_grad_stepping_table_slowdown_factor4_f(
58 therm_grad_stepping_table_slowdown_factor0_fpdiv_by8_f()));
59
60 gk20a_writel(g, therm_grad_stepping_table_r(1),
61 therm_grad_stepping_table_slowdown_factor0_f(
62 therm_grad_stepping_table_slowdown_factor0_fpdiv_by16_f()) |
63 therm_grad_stepping_table_slowdown_factor1_f(
64 therm_grad_stepping_table_slowdown_factor0_fpdiv_by32_f()) |
65 therm_grad_stepping_table_slowdown_factor2_f(
66 therm_grad_stepping_table_slowdown_factor0_fpdiv_by32_f()) |
67 therm_grad_stepping_table_slowdown_factor3_f(
68 therm_grad_stepping_table_slowdown_factor0_fpdiv_by32_f()) |
69 therm_grad_stepping_table_slowdown_factor4_f(
70 therm_grad_stepping_table_slowdown_factor0_fpdiv_by32_f()));
71
72 v = gk20a_readl(g, therm_clk_timing_r(0));
73 v |= therm_clk_timing_grad_slowdown_enabled_f();
74 gk20a_writel(g, therm_clk_timing_r(0), v);
75
76 v = gk20a_readl(g, therm_config2_r());
77 v |= therm_config2_grad_enable_f(1);
78 v |= therm_config2_slowdown_factor_extended_f(1);
79 v = set_field(v, therm_config2_grad_step_duration_m(),
80 therm_config2_grad_step_duration_f(0));
81 gk20a_writel(g, therm_config2_r(), v);
82
83 gk20a_writel(g, therm_grad_stepping1_r(),
84 therm_grad_stepping1_pdiv_duration_f(0x40));
85
86 v = gk20a_readl(g, therm_grad_stepping0_r());
87 v |= therm_grad_stepping0_feature_enable_f();
88 gk20a_writel(g, therm_grad_stepping0_r(), v);
89
90 return 0;
91}
92
31int gv11b_elcg_init_idle_filters(struct gk20a *g) 93int gv11b_elcg_init_idle_filters(struct gk20a *g)
32{ 94{
33 u32 gate_ctrl, idle_filter; 95 u32 gate_ctrl, idle_filter;