From a52a50d407d6ac4b6f64c8b71e93d6cbd028e5f7 Mon Sep 17 00:00:00 2001 From: Vijayakumar Date: Fri, 22 Aug 2014 17:22:57 +0530 Subject: gpu: nvgpu: gm20b: dynamically detect priv security for secure boot of falcon based on the config setting and fuse secure no non secure boot is done Change-Id: I5937ba945c5a3a86f72e0f2a9078fcde01977137 Signed-off-by: Vijayakumar Reviewed-on: http://git-master/r/487684 Tested-by: Terje Bergstrom GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gm20b/gr_gm20b.c | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'drivers/gpu/nvgpu/gm20b/gr_gm20b.c') diff --git a/drivers/gpu/nvgpu/gm20b/gr_gm20b.c b/drivers/gpu/nvgpu/gm20b/gr_gm20b.c index c9c32b9f..7949405c 100644 --- a/drivers/gpu/nvgpu/gm20b/gr_gm20b.c +++ b/drivers/gpu/nvgpu/gm20b/gr_gm20b.c @@ -31,12 +31,11 @@ static void gr_gm20b_init_gpc_mmu(struct gk20a *g) gk20a_dbg_info("initialize gpc mmu"); -#ifndef CONFIG_TEGRA_ACR - /* Bypass MMU check for non-secure boot. For - * secure-boot,this register write has no-effect */ - gk20a_writel(g, fb_priv_mmu_phy_secure_r(), 0xffffffff); -#endif - + if (!g->ops.privsecurity) { + /* Bypass MMU check for non-secure boot. For + * secure-boot,this register write has no-effect */ + gk20a_writel(g, fb_priv_mmu_phy_secure_r(), 0xffffffff); + } temp = gk20a_readl(g, fb_mmu_ctrl_r()); temp &= gr_gpcs_pri_mmu_ctrl_vm_pg_size_m() | gr_gpcs_pri_mmu_ctrl_use_pdb_big_page_size_m() | @@ -722,6 +721,13 @@ static int gr_gm20b_load_ctxsw_ucode(struct gk20a *g) return 0; } +#else + +static int gr_gm20b_load_ctxsw_ucode(struct gk20a *g) +{ + return -EPERM; +} + #endif void gm20b_init_gr(struct gpu_ops *gops) @@ -745,11 +751,10 @@ void gm20b_init_gr(struct gpu_ops *gops) gops->gr.init_fs_state = gr_gm20b_ctx_state_floorsweep; gops->gr.set_hww_esr_report_mask = gr_gm20b_set_hww_esr_report_mask; gops->gr.falcon_load_ucode = gr_gm20b_load_ctxsw_ucode_segments; -#ifdef CONFIG_TEGRA_ACR - gops->gr.load_ctxsw_ucode = gr_gm20b_load_ctxsw_ucode; -#else - gops->gr.load_ctxsw_ucode = gr_gk20a_load_ctxsw_ucode; -#endif + if (gops->privsecurity) + gops->gr.load_ctxsw_ucode = gr_gm20b_load_ctxsw_ucode; + else + gops->gr.load_ctxsw_ucode = gr_gk20a_load_ctxsw_ucode; gops->gr.get_gpc_tpc_mask = gr_gm20b_get_gpc_tpc_mask; gops->gr.free_channel_ctx = gk20a_free_channel_ctx; gops->gr.alloc_obj_ctx = gk20a_alloc_obj_ctx; -- cgit v1.2.2