summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSeshendra Gadagottu <sgadagottu@nvidia.com>2016-01-22 17:25:16 -0500
committerTerje Bergstrom <tbergstrom@nvidia.com>2016-01-27 12:53:31 -0500
commitc43053761b4c74c584f22f31c3d8585df8c6d233 (patch)
tree23614c0144acf8d1b594d86f3717fe7ca1c7fc5d /drivers
parent8fb33d92b03b9ee2db421c69252822d09477cce5 (diff)
gpu: nvgpu: add support for therm gate ctrl
During gpu init, therm gate control is required to add delay cycles before clock gating. Bug 1717152 Change-Id: Ifabc428cf7b49e49964dc994eba2c38af4aa1a91 Signed-off-by: Seshendra Gadagottu <sgadagottu@nvidia.com> Reviewed-on: http://git-master/r/936443 Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.h1
-rw-r--r--drivers/gpu/nvgpu/gk20a/hw_therm_gk20a.h10
-rw-r--r--drivers/gpu/nvgpu/gk20a/priv_ring_gk20a.c6
-rw-r--r--drivers/gpu/nvgpu/gm20b/hw_therm_gm20b.h10
4 files changed, 24 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h
index a58a1eed..b02d6111 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/gk20a.h
@@ -414,6 +414,7 @@ struct gpu_ops {
414 } mm; 414 } mm;
415 struct { 415 struct {
416 int (*init_therm_setup_hw)(struct gk20a *g); 416 int (*init_therm_setup_hw)(struct gk20a *g);
417 int (*update_therm_gate_ctrl)(struct gk20a *g);
417 } therm; 418 } therm;
418 struct { 419 struct {
419 int (*prepare_ucode)(struct gk20a *g); 420 int (*prepare_ucode)(struct gk20a *g);
diff --git a/drivers/gpu/nvgpu/gk20a/hw_therm_gk20a.h b/drivers/gpu/nvgpu/gk20a/hw_therm_gk20a.h
index d4c04116..3f3052ab 100644
--- a/drivers/gpu/nvgpu/gk20a/hw_therm_gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/hw_therm_gk20a.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2012-2015, NVIDIA CORPORATION. All rights reserved. 2 * Copyright (c) 2012-2016, NVIDIA CORPORATION. All rights reserved.
3 * 3 *
4 * This program is free software; you can redistribute it and/or modify it 4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License, 5 * under the terms and conditions of the GNU General Public License,
@@ -198,6 +198,14 @@ static inline u32 therm_gate_ctrl_eng_idle_filt_mant_m(void)
198{ 198{
199 return 0x7 << 13; 199 return 0x7 << 13;
200} 200}
201static inline u32 therm_gate_ctrl_eng_delay_before_f(u32 v)
202{
203 return (v & 0xf) << 16;
204}
205static inline u32 therm_gate_ctrl_eng_delay_before_m(void)
206{
207 return 0xf << 16;
208}
201static inline u32 therm_gate_ctrl_eng_delay_after_f(u32 v) 209static inline u32 therm_gate_ctrl_eng_delay_after_f(u32 v)
202{ 210{
203 return (v & 0xf) << 20; 211 return (v & 0xf) << 20;
diff --git a/drivers/gpu/nvgpu/gk20a/priv_ring_gk20a.c b/drivers/gpu/nvgpu/gk20a/priv_ring_gk20a.c
index b35403a7..cad74359 100644
--- a/drivers/gpu/nvgpu/gk20a/priv_ring_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/priv_ring_gk20a.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * GK20A priv ring 2 * GK20A priv ring
3 * 3 *
4 * Copyright (c) 2011-2014, NVIDIA CORPORATION. All rights reserved. 4 * Copyright (c) 2011-2016, NVIDIA CORPORATION. All rights reserved.
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify it 6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License, 7 * under the terms and conditions of the GNU General Public License,
@@ -39,6 +39,10 @@ void gk20a_reset_priv_ring(struct gk20a *g)
39 0x2); 39 0x2);
40 40
41 gk20a_readl(g, pri_ringstation_sys_decode_config_r()); 41 gk20a_readl(g, pri_ringstation_sys_decode_config_r());
42
43 if (g->ops.therm.update_therm_gate_ctrl)
44 g->ops.therm.update_therm_gate_ctrl(g);
45
42} 46}
43 47
44void gk20a_priv_ring_isr(struct gk20a *g) 48void gk20a_priv_ring_isr(struct gk20a *g)
diff --git a/drivers/gpu/nvgpu/gm20b/hw_therm_gm20b.h b/drivers/gpu/nvgpu/gm20b/hw_therm_gm20b.h
index a0d8ffc9..e8a5b6a5 100644
--- a/drivers/gpu/nvgpu/gm20b/hw_therm_gm20b.h
+++ b/drivers/gpu/nvgpu/gm20b/hw_therm_gm20b.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved. 2 * Copyright (c) 2014-2016, NVIDIA CORPORATION. All rights reserved.
3 * 3 *
4 * This program is free software; you can redistribute it and/or modify it 4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License, 5 * under the terms and conditions of the GNU General Public License,
@@ -186,6 +186,14 @@ static inline u32 therm_gate_ctrl_eng_idle_filt_mant_m(void)
186{ 186{
187 return 0x7 << 13; 187 return 0x7 << 13;
188} 188}
189static inline u32 therm_gate_ctrl_eng_delay_before_f(u32 v)
190{
191 return (v & 0xf) << 16;
192}
193static inline u32 therm_gate_ctrl_eng_delay_before_m(void)
194{
195 return 0xf << 16;
196}
189static inline u32 therm_gate_ctrl_eng_delay_after_f(u32 v) 197static inline u32 therm_gate_ctrl_eng_delay_after_f(u32 v)
190{ 198{
191 return (v & 0xf) << 20; 199 return (v & 0xf) << 20;