diff --git a/drivers/gpu/nvgpu/gk20a/platform_gk20a.h b/drivers/gpu/nvgpu/gk20a/platform_gk20a.h index 3c2db9246..fa0909ee0 100644 --- a/drivers/gpu/nvgpu/gk20a/platform_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/platform_gk20a.h @@ -255,6 +255,11 @@ struct gk20a_platform { /* true if we run preos microcode on this board */ bool run_preos; + + /* true if we need to program sw threshold for + * power limits + */ + bool hardcode_sw_threshold; }; static inline struct gk20a_platform *gk20a_get_platform( diff --git a/drivers/gpu/nvgpu/pci.c b/drivers/gpu/nvgpu/pci.c index 88b743bce..dd8abc828 100644 --- a/drivers/gpu/nvgpu/pci.c +++ b/drivers/gpu/nvgpu/pci.c @@ -83,6 +83,7 @@ static struct gk20a_platform nvgpu_pci_device[] = { .vidmem_is_vidmem = true, .vbios_min_version = 0x86063000, + .hardcode_sw_threshold = true, }, { /* DEVICE=0x1c36 */ /* ptimer src frequency in hz */ @@ -116,6 +117,7 @@ static struct gk20a_platform nvgpu_pci_device[] = { .vidmem_is_vidmem = true, .vbios_min_version = 0x86062d00, + .hardcode_sw_threshold = true, }, { /* DEVICE=0x1c37 */ /* ptimer src frequency in hz */ @@ -149,6 +151,7 @@ static struct gk20a_platform nvgpu_pci_device[] = { .vidmem_is_vidmem = true, .vbios_min_version = 0x86063000, + .hardcode_sw_threshold = true, } }; diff --git a/drivers/gpu/nvgpu/pmgr/pwrpolicy.c b/drivers/gpu/nvgpu/pmgr/pwrpolicy.c index 1e7e19a34..2b0be8d81 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,