gpu: nvgpu: Remove TPC powergate from safety build

- Remove non-safe TPC powergate feature from the safety
  build by introducing a new flag:
  CONFIG_NVGPU_TPC_POWERGATE

- Move nvgpu_init_power_gate_gr() under same compile time flag.
  and move HAL function gr_gv11b_powergate_tpc() to tpc_gv11b.c

- Also, remove the negative test scenario and
  usage of tpc_powergate from unit tests

JIRA NVGPU-4149

Change-Id: If489482401e94de499e472b16b1bc091b00992e6
Signed-off-by: Divya Singhatwaria <dsinghatwari@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2242323
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Divya Singhatwaria
2019-11-19 15:12:55 +05:30
committed by Alex Waterman
parent 836abc253d
commit 84a24c9593
14 changed files with 57 additions and 55 deletions

View File

@@ -115,18 +115,6 @@ static int falcon_sw_init(struct gk20a *g, u32 falcon_id)
return 0;
}
/* generic for passing in a u32 */
static int return_success_u32_param(struct gk20a *g, u32 dummy)
{
return 0;
}
/* generic for passing in a u32 and returning int */
static int return_failure_u32_param(struct gk20a *g, u32 dummy)
{
return -1;
}
/* generic for passing in a u32 and returning u32 */
static u32 return_u32_u32_param(struct gk20a *g, u32 dummy)
{
@@ -524,7 +512,6 @@ static void set_poweron_funcs_success(struct gk20a *g)
g->ops.falcon.falcon_sw_init = falcon_sw_init;
falcon_fail_on_id = U32_MAX; /* don't fail */
g->ops.fuse.fuse_status_opt_tpc_gpc = return_u32_u32_param;
g->ops.tpc.tpc_powergate = return_success_u32_param;
g->ops.falcon.falcon_sw_free = no_return_u32_param;
/* used in support functions */
@@ -580,16 +567,6 @@ int test_poweron(struct unit_module *m, struct gk20a *g, void *args)
"nvgpu_finalize_poweron errantly returned success\n");
}
falcon_fail_on_id = U32_MAX; /* stop failing */
g->ops.tpc.tpc_powergate = return_failure_u32_param;
nvgpu_set_power_state(g, NVGPU_STATE_POWERED_OFF);
err = nvgpu_finalize_poweron(g);
if (err == 0) {
unit_return_fail(m,
"nvgpu_finalize_poweron errantly returned success\n");
}
g->ops.tpc.tpc_powergate = return_success_u32_param;
/* test the case of already being powered on */
nvgpu_set_power_state(g, NVGPU_STATE_POWERED_ON);
err = nvgpu_finalize_poweron(g);
@@ -616,7 +593,6 @@ int test_poweron_branches(struct unit_module *m, struct gk20a *g, void *args)
g->ops.clk.init_clk_support = NULL;
g->ops.fb.init_fbpa = NULL;
g->ops.fb.mem_unlock = NULL;
g->ops.tpc.tpc_powergate = NULL;
g->ops.therm.elcg_init_idle_filters = NULL;
g->ops.ecc.ecc_init_support = NULL;
g->ops.channel.resume_all_serviceable_ch = NULL;