From 9132bb52a6ac6a4845007b755feeb3a074069e72 Mon Sep 17 00:00:00 2001 From: Thomas Fleury Date: Thu, 19 Jan 2017 16:05:08 -0800 Subject: gpu: nvgpu: add flag for over power monitoring On PG418, we hard code SW threshold table for over power monitoring. On PG419, there is a dedicated INA for over power monitoring. It is programmed in VBIOS devinit. Added a platform flag to indicate if devinit has already taken care of programming. Jira DNVGPU-206 Change-Id: I28e70ac5621b692864a24e0eadb6d24b9957c0af Signed-off-by: Thomas Fleury Reviewed-on: http://git-master/r/1291813 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/pmgr/pwrpolicy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/gpu/nvgpu/pmgr/pwrpolicy.c') diff --git a/drivers/gpu/nvgpu/pmgr/pwrpolicy.c b/drivers/gpu/nvgpu/pmgr/pwrpolicy.c index 1e7e19a3..2b0be8d8 100644 --- a/drivers/gpu/nvgpu/pmgr/pwrpolicy.c +++ b/drivers/gpu/nvgpu/pmgr/pwrpolicy.c @@ -508,6 +508,7 @@ static inline void devinit_unpack_pwr_policy_entry( static u32 devinit_get_pwr_policy_table(struct gk20a *g, struct pmgr_pwr_policy *ppwrpolicyobjs) { + struct gk20a_platform *platform = gk20a_get_platform(g->dev); u32 status = 0; u8 *ptr = NULL; struct boardobj *boardobj; @@ -518,7 +519,6 @@ static u32 devinit_get_pwr_policy_table(struct gk20a *g, u16 pwr_policy_size; bool integral_control = false; u32 hw_threshold_policy_index = 0; - u32 sw_threshold_policy_index = 0; union pwr_policy_data_union pwr_policy_data; gk20a_dbg_info(""); @@ -684,7 +684,7 @@ static u32 devinit_get_pwr_policy_table(struct gk20a *g, ++obj_index; } - if (!sw_threshold_policy_index) { + if (platform->hardcode_sw_threshold) { status = _pwr_policy_construct_WAR_SW_Threshold_policy(g, ppwrpolicyobjs, &pwr_policy_data, -- cgit v1.2.2