diff options
author | seshendra Gadagottu <sgadagottu@nvidia.com> | 2017-02-06 18:57:12 -0500 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-02-07 18:16:53 -0500 |
commit | f04a84b7ce976e911bf81497796016e149d17082 (patch) | |
tree | efc265ce2726409bdf9e6888e428858222e7d118 /drivers/gpu/nvgpu/gv11b | |
parent | cabba6686643dbb4bd8a023ad4622a49114b5159 (diff) |
gpu: nvgpu: gv11b: chip specific init_elcg_mode
Added thermal registers for gv11b. Implemented chip specific
init_elcg_mode. In thermal control register, engine power auto
control config is removed and added new field for engine holdoff
enable signal.
JIRA GV11B-58
Change-Id: I412d9a232800d25efbdb0a40f14949d3f085fb0e
Signed-off-by: seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: http://git-master/r/1300119
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gv11b')
-rw-r--r-- | drivers/gpu/nvgpu/gv11b/gr_gv11b.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gv11b/gr_gv11b.c b/drivers/gpu/nvgpu/gv11b/gr_gv11b.c index daadef68..3c332bbf 100644 --- a/drivers/gpu/nvgpu/gv11b/gr_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/gr_gv11b.c | |||
@@ -41,6 +41,7 @@ | |||
41 | #include <nvgpu/hw/gv11b/hw_gr_gv11b.h> | 41 | #include <nvgpu/hw/gv11b/hw_gr_gv11b.h> |
42 | #include <nvgpu/hw/gv11b/hw_ram_gv11b.h> | 42 | #include <nvgpu/hw/gv11b/hw_ram_gv11b.h> |
43 | #include <nvgpu/hw/gv11b/hw_pbdma_gv11b.h> | 43 | #include <nvgpu/hw/gv11b/hw_pbdma_gv11b.h> |
44 | #include <nvgpu/hw/gv11b/hw_therm_gv11b.h> | ||
44 | 45 | ||
45 | static bool gr_gv11b_is_valid_class(struct gk20a *g, u32 class_num) | 46 | static bool gr_gv11b_is_valid_class(struct gk20a *g, u32 class_num) |
46 | { | 47 | { |
@@ -1970,6 +1971,39 @@ static void gr_gv11b_write_pm_ptr(struct gk20a *g, | |||
1970 | ctxsw_prog_main_image_pm_ptr_hi_o(), va_hi); | 1971 | ctxsw_prog_main_image_pm_ptr_hi_o(), va_hi); |
1971 | } | 1972 | } |
1972 | 1973 | ||
1974 | void gr_gv11b_init_elcg_mode(struct gk20a *g, u32 mode, u32 engine) | ||
1975 | { | ||
1976 | u32 gate_ctrl; | ||
1977 | |||
1978 | gate_ctrl = gk20a_readl(g, therm_gate_ctrl_r(engine)); | ||
1979 | |||
1980 | switch (mode) { | ||
1981 | case ELCG_RUN: | ||
1982 | gate_ctrl = set_field(gate_ctrl, | ||
1983 | therm_gate_ctrl_eng_clk_m(), | ||
1984 | therm_gate_ctrl_eng_clk_run_f()); | ||
1985 | gate_ctrl = set_field(gate_ctrl, | ||
1986 | therm_gate_ctrl_idle_holdoff_m(), | ||
1987 | therm_gate_ctrl_idle_holdoff_on_f()); | ||
1988 | break; | ||
1989 | case ELCG_STOP: | ||
1990 | gate_ctrl = set_field(gate_ctrl, | ||
1991 | therm_gate_ctrl_eng_clk_m(), | ||
1992 | therm_gate_ctrl_eng_clk_stop_f()); | ||
1993 | break; | ||
1994 | case ELCG_AUTO: | ||
1995 | gate_ctrl = set_field(gate_ctrl, | ||
1996 | therm_gate_ctrl_eng_clk_m(), | ||
1997 | therm_gate_ctrl_eng_clk_auto_f()); | ||
1998 | break; | ||
1999 | default: | ||
2000 | gk20a_err(dev_from_gk20a(g), | ||
2001 | "invalid elcg mode %d", mode); | ||
2002 | } | ||
2003 | |||
2004 | gk20a_writel(g, therm_gate_ctrl_r(engine), gate_ctrl); | ||
2005 | } | ||
2006 | |||
1973 | void gv11b_init_gr(struct gpu_ops *gops) | 2007 | void gv11b_init_gr(struct gpu_ops *gops) |
1974 | { | 2008 | { |
1975 | gp10b_init_gr(gops); | 2009 | gp10b_init_gr(gops); |
@@ -2025,5 +2059,6 @@ void gv11b_init_gr(struct gpu_ops *gops) | |||
2025 | gops->gr.restore_context_header = gv11b_restore_context_header; | 2059 | gops->gr.restore_context_header = gv11b_restore_context_header; |
2026 | gops->gr.write_zcull_ptr = gr_gv11b_write_zcull_ptr; | 2060 | gops->gr.write_zcull_ptr = gr_gv11b_write_zcull_ptr; |
2027 | gops->gr.write_pm_ptr = gr_gv11b_write_pm_ptr; | 2061 | gops->gr.write_pm_ptr = gr_gv11b_write_pm_ptr; |
2062 | gops->gr.init_elcg_mode = gr_gv11b_init_elcg_mode; | ||
2028 | 2063 | ||
2029 | } | 2064 | } |