From 004a1880ed80f3b384cf3d0d37e0a58eff29fcaf Mon Sep 17 00:00:00 2001 From: Seshendra Gadagottu Date: Fri, 23 Oct 2015 12:02:55 -0700 Subject: gpu: nvgpu: update thermal programming Add required fileds and values for thermal slow-down settings in thermal header file and implemented chip specific thermal register programming Reviewed-on: http://git-master/r/822199 (cherry picked from commit 9e8a745b8295af002b9780c83caa8dc7b22cc737) Change-Id: I016b18ed230fa6c104eada2e166ccd1a5f2ace36 Signed-off-by: Seshendra Gadagottu Reviewed-on: http://git-master/r/823012 GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gk20a/therm_gk20a.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/therm_gk20a.c') diff --git a/drivers/gpu/nvgpu/gk20a/therm_gk20a.c b/drivers/gpu/nvgpu/gk20a/therm_gk20a.c index fd4149ae..1c1b8419 100644 --- a/drivers/gpu/nvgpu/gk20a/therm_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/therm_gk20a.c @@ -3,7 +3,7 @@ * * GK20A Therm * - * Copyright (c) 2011-2014, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2011-2015, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -38,13 +38,20 @@ static int gk20a_init_therm_setup_hw(struct gk20a *g) u32 v; /* program NV_THERM registers */ - gk20a_writel(g, therm_use_a_r(), NV_THERM_USE_A_INIT); + gk20a_writel(g, therm_use_a_r(), therm_use_a_ext_therm_0_enable_f() | + therm_use_a_ext_therm_1_enable_f() | + therm_use_a_ext_therm_2_enable_f()); + /* priority for EXT_THERM_0 event set to highest */ gk20a_writel(g, therm_evt_ext_therm_0_r(), - NV_THERM_EVT_EXT_THERM_0_INIT); + therm_evt_ext_therm_0_slow_factor_f(1) | + therm_evt_ext_therm_0_priority_f(3)); gk20a_writel(g, therm_evt_ext_therm_1_r(), - NV_THERM_EVT_EXT_THERM_1_INIT); + therm_evt_ext_therm_1_slow_factor_f(2) | + therm_evt_ext_therm_1_priority_f(2)); gk20a_writel(g, therm_evt_ext_therm_2_r(), - NV_THERM_EVT_EXT_THERM_2_INIT); + therm_evt_ext_therm_2_slow_factor_f(3) | + therm_evt_ext_therm_2_priority_f(1)); + gk20a_writel(g, therm_grad_stepping_table_r(0), therm_grad_stepping_table_slowdown_factor0_f(therm_grad_stepping_table_slowdown_factor0_fpdiv_by1p5_f()) | @@ -92,9 +99,15 @@ int gk20a_init_therm_support(struct gk20a *g) if (err) return err; - err = gk20a_init_therm_setup_hw(g); + if (g->ops.therm.init_therm_setup_hw) + err = g->ops.therm.init_therm_setup_hw(g); if (err) return err; return err; } + +void gk20a_init_therm_ops(struct gpu_ops *gops) +{ + gops->therm.init_therm_setup_hw = gk20a_init_therm_setup_hw; +} -- cgit v1.2.2