diff options
Diffstat (limited to 'drivers/gpu/nvgpu/gv11b')
-rw-r--r-- | drivers/gpu/nvgpu/gv11b/hal_gv11b.c | 3 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gv11b/therm_gv11b.c | 75 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gv11b/therm_gv11b.h | 28 |
3 files changed, 105 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c index 9baa3581..f2fb9972 100644 --- a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c | |||
@@ -81,6 +81,7 @@ | |||
81 | #include "gv11b_gating_reglist.h" | 81 | #include "gv11b_gating_reglist.h" |
82 | #include "regops_gv11b.h" | 82 | #include "regops_gv11b.h" |
83 | #include "subctx_gv11b.h" | 83 | #include "subctx_gv11b.h" |
84 | #include "therm_gv11b.h" | ||
84 | 85 | ||
85 | #include <nvgpu/bus.h> | 86 | #include <nvgpu/bus.h> |
86 | #include <nvgpu/debug.h> | 87 | #include <nvgpu/debug.h> |
@@ -553,7 +554,7 @@ static const struct gpu_ops gv11b_ops = { | |||
553 | }, | 554 | }, |
554 | .therm = { | 555 | .therm = { |
555 | .init_therm_setup_hw = gp10b_init_therm_setup_hw, | 556 | .init_therm_setup_hw = gp10b_init_therm_setup_hw, |
556 | .elcg_init_idle_filters = gp10b_elcg_init_idle_filters, | 557 | .elcg_init_idle_filters = gv11b_elcg_init_idle_filters, |
557 | }, | 558 | }, |
558 | .pmu = { | 559 | .pmu = { |
559 | .pmu_setup_elpg = gp10b_pmu_setup_elpg, | 560 | .pmu_setup_elpg = gp10b_pmu_setup_elpg, |
diff --git a/drivers/gpu/nvgpu/gv11b/therm_gv11b.c b/drivers/gpu/nvgpu/gv11b/therm_gv11b.c new file mode 100644 index 00000000..18987119 --- /dev/null +++ b/drivers/gpu/nvgpu/gv11b/therm_gv11b.c | |||
@@ -0,0 +1,75 @@ | |||
1 | /* | ||
2 | * GV11B Therm | ||
3 | * | ||
4 | * Copyright (c) 2015-2017, 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 "gk20a/gk20a.h" | ||
26 | |||
27 | #include <nvgpu/soc.h> | ||
28 | |||
29 | #include <nvgpu/hw/gv11b/hw_therm_gv11b.h> | ||
30 | |||
31 | int gv11b_elcg_init_idle_filters(struct gk20a *g) | ||
32 | { | ||
33 | u32 gate_ctrl, idle_filter; | ||
34 | u32 engine_id; | ||
35 | u32 active_engine_id = 0; | ||
36 | struct fifo_gk20a *f = &g->fifo; | ||
37 | |||
38 | if (nvgpu_platform_is_simulation(g)) | ||
39 | return 0; | ||
40 | |||
41 | gk20a_dbg_info("init clock/power gate reg"); | ||
42 | |||
43 | for (engine_id = 0; engine_id < f->num_engines; engine_id++) { | ||
44 | active_engine_id = f->active_engines_list[engine_id]; | ||
45 | |||
46 | gate_ctrl = gk20a_readl(g, therm_gate_ctrl_r(active_engine_id)); | ||
47 | gate_ctrl = set_field(gate_ctrl, | ||
48 | therm_gate_ctrl_eng_idle_filt_exp_m(), | ||
49 | therm_gate_ctrl_eng_idle_filt_exp__prod_f()); | ||
50 | gate_ctrl = set_field(gate_ctrl, | ||
51 | therm_gate_ctrl_eng_idle_filt_mant_m(), | ||
52 | therm_gate_ctrl_eng_idle_filt_mant__prod_f()); | ||
53 | gate_ctrl = set_field(gate_ctrl, | ||
54 | therm_gate_ctrl_eng_delay_before_m(), | ||
55 | therm_gate_ctrl_eng_delay_before__prod_f()); | ||
56 | gate_ctrl = set_field(gate_ctrl, | ||
57 | therm_gate_ctrl_eng_delay_after_m(), | ||
58 | therm_gate_ctrl_eng_delay_after__prod_f()); | ||
59 | gk20a_writel(g, therm_gate_ctrl_r(active_engine_id), gate_ctrl); | ||
60 | } | ||
61 | |||
62 | idle_filter = gk20a_readl(g, therm_fecs_idle_filter_r()); | ||
63 | idle_filter = set_field(idle_filter, | ||
64 | therm_fecs_idle_filter_value_m(), | ||
65 | therm_fecs_idle_filter_value__prod_f()); | ||
66 | gk20a_writel(g, therm_fecs_idle_filter_r(), idle_filter); | ||
67 | |||
68 | idle_filter = gk20a_readl(g, therm_hubmmu_idle_filter_r()); | ||
69 | idle_filter = set_field(idle_filter, | ||
70 | therm_hubmmu_idle_filter_value_m(), | ||
71 | therm_hubmmu_idle_filter_value__prod_f()); | ||
72 | gk20a_writel(g, therm_hubmmu_idle_filter_r(), idle_filter); | ||
73 | |||
74 | return 0; | ||
75 | } | ||
diff --git a/drivers/gpu/nvgpu/gv11b/therm_gv11b.h b/drivers/gpu/nvgpu/gv11b/therm_gv11b.h new file mode 100644 index 00000000..1d89597b --- /dev/null +++ b/drivers/gpu/nvgpu/gv11b/therm_gv11b.h | |||
@@ -0,0 +1,28 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved. | ||
3 | * | ||
4 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
5 | * copy of this software and associated documentation files (the "Software"), | ||
6 | * to deal in the Software without restriction, including without limitation | ||
7 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
8 | * and/or sell copies of the Software, and to permit persons to whom the | ||
9 | * Software is furnished to do so, subject to the following conditions: | ||
10 | * | ||
11 | * The above copyright notice and this permission notice shall be included in | ||
12 | * all copies or substantial portions of the Software. | ||
13 | * | ||
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
17 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
19 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
20 | * DEALINGS IN THE SOFTWARE. | ||
21 | */ | ||
22 | #ifndef THERM_GV11B_H | ||
23 | #define THERM_GV11B_H | ||
24 | |||
25 | struct gk20a; | ||
26 | int gv11b_elcg_init_idle_filters(struct gk20a *g); | ||
27 | |||
28 | #endif /* THERM_GV11B_H */ | ||