From 313fcdb1d3c12026246df01c81e2ecd212132de8 Mon Sep 17 00:00:00 2001 From: Seshendra Gadagottu Date: Thu, 22 Oct 2015 15:31:43 -0700 Subject: gpu: nvgpu: gp10b: update thermal programming Add required fileds and values for thermal slow-down settings in thermal header file and corrected thermal register programming with correct values. Bug 1695567 Reviewed-on: http://git-master/r/822200 (cherry picked from commit 859d1bda6a059b321d859c887fab8d51d2caa981) Change-Id: Id90ebd46bc3d6e4284a91e7f2b775d78502a3eca Signed-off-by: Seshendra Gadagottu Reviewed-on: http://git-master/r/823013 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gp10b/therm_gp10b.c | 46 +++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 drivers/gpu/nvgpu/gp10b/therm_gp10b.c (limited to 'drivers/gpu/nvgpu/gp10b/therm_gp10b.c') diff --git a/drivers/gpu/nvgpu/gp10b/therm_gp10b.c b/drivers/gpu/nvgpu/gp10b/therm_gp10b.c new file mode 100644 index 00000000..471edb87 --- /dev/null +++ b/drivers/gpu/nvgpu/gp10b/therm_gp10b.c @@ -0,0 +1,46 @@ +/* + * drivers/gpu/nvgpu/gm20b/therm_gk20a.c + * + * GP10B Therm + * + * Copyright (c) 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, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#include "gk20a/gk20a.h" +#include "hw_therm_gp10b.h" + +static int gp10b_init_therm_setup_hw(struct gk20a *g) +{ + gk20a_dbg_fn(""); + + /* program NV_THERM registers */ + 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()); + gk20a_writel(g, therm_evt_ext_therm_0_r(), + therm_evt_ext_therm_0_slow_factor_f( + therm_evt_ext_therm_0_slow_factor_init_v())); + gk20a_writel(g, therm_evt_ext_therm_1_r(), + therm_evt_ext_therm_1_slow_factor_f( + therm_evt_ext_therm_1_slow_factor_init_v())); + gk20a_writel(g, therm_evt_ext_therm_2_r(), + therm_evt_ext_therm_2_slow_factor_f( + therm_evt_ext_therm_2_slow_factor_init_v())); + + return 0; +} + +void gp10b_init_therm_ops(struct gpu_ops *gops) +{ + gops->therm.init_therm_setup_hw = gp10b_init_therm_setup_hw; + +} -- cgit v1.2.2