summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gm20b/gr_gm20b.c
diff options
context:
space:
mode:
authorSunny He <suhe@nvidia.com>2017-07-24 15:18:38 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-07-26 05:45:14 -0400
commitd59271c7b79080388371877fc2d10574ca42206a (patch)
tree921f6d1ddce07235d7fbd1f27e6510b8cfe56ae7 /drivers/gpu/nvgpu/gm20b/gr_gm20b.c
parentde3ad1a94974b08268a485136f04b8e436ef2579 (diff)
gpu: nvgpu: Remove privsecurity flag from gpu_ops
Replace privsecurity boolean flag in gpu_ops with entry in common flag system. The new common flag is NVGPU_SEC_PRIVSECURITY Jira NVGPU-74 Change-Id: I4b258f5ffbe30a6344ffba0ece51c6f5d47ebec1 Signed-off-by: Sunny He <suhe@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1525713 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Alex Waterman <alexw@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gm20b/gr_gm20b.c')
-rw-r--r--drivers/gpu/nvgpu/gm20b/gr_gm20b.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/gpu/nvgpu/gm20b/gr_gm20b.c b/drivers/gpu/nvgpu/gm20b/gr_gm20b.c
index 5d9cc32c..f60d880d 100644
--- a/drivers/gpu/nvgpu/gm20b/gr_gm20b.c
+++ b/drivers/gpu/nvgpu/gm20b/gr_gm20b.c
@@ -42,7 +42,7 @@ static void gr_gm20b_init_gpc_mmu(struct gk20a *g)
42 42
43 gk20a_dbg_info("initialize gpc mmu"); 43 gk20a_dbg_info("initialize gpc mmu");
44 44
45 if (!g->ops.privsecurity) { 45 if (!nvgpu_is_enabled(g, NVGPU_SEC_PRIVSECURITY)) {
46 /* Bypass MMU check for non-secure boot. For 46 /* Bypass MMU check for non-secure boot. For
47 * secure-boot,this register write has no-effect */ 47 * secure-boot,this register write has no-effect */
48 gk20a_writel(g, fb_priv_mmu_phy_secure_r(), 0xffffffff); 48 gk20a_writel(g, fb_priv_mmu_phy_secure_r(), 0xffffffff);
@@ -680,7 +680,7 @@ static int gr_gm20b_load_ctxsw_ucode_segments(struct gk20a *g, u64 addr_base,
680 gr_gk20a_load_ctxsw_ucode_boot(g, addr_base, segments, reg_offset); 680 gr_gk20a_load_ctxsw_ucode_boot(g, addr_base, segments, reg_offset);
681 681
682 /* start the falcon immediately if PRIV security is disabled*/ 682 /* start the falcon immediately if PRIV security is disabled*/
683 if (!g->ops.privsecurity) { 683 if (!nvgpu_is_enabled(g, NVGPU_SEC_PRIVSECURITY)) {
684 gk20a_writel(g, reg_offset + gr_fecs_cpuctl_r(), 684 gk20a_writel(g, reg_offset + gr_fecs_cpuctl_r(),
685 gr_fecs_cpuctl_startcpu_f(0x01)); 685 gr_fecs_cpuctl_startcpu_f(0x01));
686 } 686 }
@@ -1542,8 +1542,10 @@ static void gm20b_gr_clear_sm_hww(struct gk20a *g, u32 gpc, u32 tpc, u32 sm,
1542 gk20a_writel(g, gr_gpc0_tpc0_sm_hww_warp_esr_r() + offset, 0); 1542 gk20a_writel(g, gr_gpc0_tpc0_sm_hww_warp_esr_r() + offset, 0);
1543} 1543}
1544 1544
1545void gm20b_init_gr(struct gpu_ops *gops) 1545void gm20b_init_gr(struct gk20a *g)
1546{ 1546{
1547 struct gpu_ops *gops = &g->ops;
1548
1547 gops->gr.init_gpc_mmu = gr_gm20b_init_gpc_mmu; 1549 gops->gr.init_gpc_mmu = gr_gm20b_init_gpc_mmu;
1548 gops->gr.bundle_cb_defaults = gr_gm20b_bundle_cb_defaults; 1550 gops->gr.bundle_cb_defaults = gr_gm20b_bundle_cb_defaults;
1549 gops->gr.cb_size_default = gr_gm20b_cb_size_default; 1551 gops->gr.cb_size_default = gr_gm20b_cb_size_default;
@@ -1565,7 +1567,7 @@ void gm20b_init_gr(struct gpu_ops *gops)
1565 gops->gr.init_fs_state = gr_gm20b_init_fs_state; 1567 gops->gr.init_fs_state = gr_gm20b_init_fs_state;
1566 gops->gr.set_hww_esr_report_mask = gr_gm20b_set_hww_esr_report_mask; 1568 gops->gr.set_hww_esr_report_mask = gr_gm20b_set_hww_esr_report_mask;
1567 gops->gr.falcon_load_ucode = gr_gm20b_load_ctxsw_ucode_segments; 1569 gops->gr.falcon_load_ucode = gr_gm20b_load_ctxsw_ucode_segments;
1568 if (gops->privsecurity) 1570 if (nvgpu_is_enabled(g, NVGPU_SEC_PRIVSECURITY))
1569 gops->gr.load_ctxsw_ucode = gr_gm20b_load_ctxsw_ucode; 1571 gops->gr.load_ctxsw_ucode = gr_gm20b_load_ctxsw_ucode;
1570 else 1572 else
1571 gops->gr.load_ctxsw_ucode = gr_gk20a_load_ctxsw_ucode; 1573 gops->gr.load_ctxsw_ucode = gr_gk20a_load_ctxsw_ucode;