summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gm20b/hal_gm20b.c
diff options
context:
space:
mode:
authorVijayakumar <vsubbu@nvidia.com>2014-08-22 07:52:57 -0400
committerDan Willemsen <dwillemsen@nvidia.com>2015-03-18 15:11:04 -0400
commita52a50d407d6ac4b6f64c8b71e93d6cbd028e5f7 (patch)
treeb2aded4cb4f19a14fa0443bc587a6164c234ac30 /drivers/gpu/nvgpu/gm20b/hal_gm20b.c
parent08983f727f0f3574aebb07027060b75e5b6dac6c (diff)
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 <vsubbu@nvidia.com> Reviewed-on: http://git-master/r/487684 Tested-by: Terje Bergstrom <tbergstrom@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gm20b/hal_gm20b.c')
-rw-r--r--drivers/gpu/nvgpu/gm20b/hal_gm20b.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gm20b/hal_gm20b.c b/drivers/gpu/nvgpu/gm20b/hal_gm20b.c
index 5e8fc0ae..1dafc13d 100644
--- a/drivers/gpu/nvgpu/gm20b/hal_gm20b.c
+++ b/drivers/gpu/nvgpu/gm20b/hal_gm20b.c
@@ -27,6 +27,10 @@
27#include "mm_gm20b.h" 27#include "mm_gm20b.h"
28#include "pmu_gm20b.h" 28#include "pmu_gm20b.h"
29#include "clk_gm20b.h" 29#include "clk_gm20b.h"
30#include <linux/tegra-fuse.h>
31
32#define FUSE_OPT_PRIV_SEC_DIS_0 0x264
33#define PRIV_SECURITY_DISABLE 0x01
30 34
31struct gpu_ops gm20b_ops = { 35struct gpu_ops gm20b_ops = {
32 .clock_gating = { 36 .clock_gating = {
@@ -46,6 +50,34 @@ struct gpu_ops gm20b_ops = {
46int gm20b_init_hal(struct gpu_ops *gops) 50int gm20b_init_hal(struct gpu_ops *gops)
47{ 51{
48 *gops = gm20b_ops; 52 *gops = gm20b_ops;
53#ifdef CONFIG_TEGRA_ACR
54 if (tegra_platform_is_linsim()) {
55 gops->privsecurity = 1;
56 } else {
57 if (tegra_fuse_readl(FUSE_OPT_PRIV_SEC_DIS_0) &
58 PRIV_SECURITY_DISABLE) {
59 gk20a_dbg_info("priv security is disabled in HW");
60 gops->privsecurity = 0;
61 } else {
62 gops->privsecurity = 1;
63 }
64 }
65#else
66 if (tegra_platform_is_linsim()) {
67 gk20a_dbg_info("running ASIM with PRIV security disabled");
68 gops->privsecurity = 0;
69 } else {
70 if (tegra_fuse_readl(FUSE_OPT_PRIV_SEC_DIS_0) &
71 PRIV_SECURITY_DISABLE) {
72 gops->privsecurity = 0;
73 } else {
74 gk20a_dbg_info("priv security is not supported but enabled");
75 gops->privsecurity = 1;
76 return -EPERM;
77 }
78 }
79#endif
80
49 gm20b_init_ltc(gops); 81 gm20b_init_ltc(gops);
50 gm20b_init_gr(gops); 82 gm20b_init_gr(gops);
51 gm20b_init_ltc(gops); 83 gm20b_init_ltc(gops);