summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gm20b/hal_gm20b.c
diff options
context:
space:
mode:
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);