gpu: nvgpu: add ctxsw_reg bundles for nvgpu-next

Add ctxsw_reg bundle programming for nvgpu-next.

Jira NVGPU-5047

Change-Id: I3df9d89a6615825d224ec5d46b550cd68623e7d7
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2309817
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-by: Lakshmanan M <lm@nvidia.com>
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Vedashree Vidwans
2020-03-09 13:16:59 -07:00
committed by Alex Waterman
parent 75f79cea47
commit a182be7b8d
3 changed files with 16 additions and 0 deletions

View File

@@ -404,6 +404,10 @@ static bool nvgpu_netlist_handle_debugger_region_id(struct gk20a *g,
break;
default:
handled = false;
#if defined(CONFIG_NVGPU_NON_FUSA) && defined(CONFIG_NVGPU_NEXT)
handled = nvgpu_next_netlist_handle_debugger_region_id(g,
region_id, src, size, netlist_vars, &err);
#endif
break;
}
@@ -561,6 +565,9 @@ clean_up:
nvgpu_kfree(g, netlist_vars->ctxsw_regs.pm_rop.l);
nvgpu_kfree(g, netlist_vars->ctxsw_regs.pm_ucgpc.l);
nvgpu_kfree(g, netlist_vars->ctxsw_regs.etpc.l);
#if defined(CONFIG_NVGPU_NON_FUSA) && defined(CONFIG_NVGPU_NEXT)
nvgpu_next_netlist_deinit_ctxsw_regs(g);
#endif
nvgpu_kfree(g, netlist_vars->ctxsw_regs.pm_cau.l);
nvgpu_kfree(g, netlist_vars->ctxsw_regs.perf_sys_control.l);
nvgpu_kfree(g, netlist_vars->ctxsw_regs.perf_fbp_control.l);

View File

@@ -154,6 +154,9 @@ struct nvgpu_netlist_vars {
struct netlist_aiv_list perf_fbp_control;
struct netlist_aiv_list perf_gpc_control;
struct netlist_aiv_list perf_pma_control;
#if defined(CONFIG_NVGPU_HAL_NON_FUSA) && defined(CONFIG_NVGPU_NEXT)
struct nvgpu_next_ctxsw_regs nvgpu_next;
#endif
} ctxsw_regs;
#endif /* CONFIG_NVGPU_DEBUGGER */
};

View File

@@ -204,6 +204,9 @@ int nvgpu_init_sim_netlist_ctx_vars(struct gk20a *g)
if (nvgpu_netlist_alloc_aiv_list(g, etpc_ctxsw_regs) == NULL) {
goto fail;
}
#if defined(CONFIG_NVGPU_NON_FUSA) && defined(CONFIG_NVGPU_NEXT)
nvgpu_next_init_sim_netlist_ctxsw_regs(g);
#endif
#endif /* CONFIG_NVGPU_DEBUGGER */
#if defined(CONFIG_NVGPU_NON_FUSA) && defined(CONFIG_NVGPU_NEXT)
nvgpu_next_init_sim_netlist_ctx_vars(g);
@@ -417,6 +420,9 @@ fail:
nvgpu_kfree(g, pm_gpc_ctxsw_regs->l);
nvgpu_kfree(g, pm_tpc_ctxsw_regs->l);
nvgpu_kfree(g, etpc_ctxsw_regs->l);
#if defined(CONFIG_NVGPU_NON_FUSA) && defined(CONFIG_NVGPU_NEXT)
nvgpu_next_init_sim_netlist_ctxsw_regs_free(g);
#endif
#endif /* CONFIG_NVGPU_DEBUGGER */
return err;