From 95ef0315b99e32adbffc23bc8804a0127d3af10a Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Thu, 9 Mar 2017 14:10:00 -0800 Subject: gpu: nvgpu: Use GPU's own fuse registers Read fuse values from GPU's own fuse registers instead of Tegra fuse registers whenever possible. This reduces the number of dependencies to Linux fuse code. Some fuses do not have a corresponding register in GPU, so they're left as is. Change-Id: Id9f2f4da897f3e20b20c300a67f705e3fa5ba35a Signed-off-by: Terje Bergstrom Reviewed-on: http://git-master/r/1318278 Reviewed-by: svccoveritychecker GVS: Gerrit_Virtual_Submit Reviewed-by: Konsta Holtta --- drivers/gpu/nvgpu/gm20b/hal_gm20b.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'drivers/gpu/nvgpu/gm20b/hal_gm20b.c') diff --git a/drivers/gpu/nvgpu/gm20b/hal_gm20b.c b/drivers/gpu/nvgpu/gm20b/hal_gm20b.c index e036215f..d9fb2c53 100644 --- a/drivers/gpu/nvgpu/gm20b/hal_gm20b.c +++ b/drivers/gpu/nvgpu/gm20b/hal_gm20b.c @@ -14,8 +14,6 @@ */ #include -#include -#include #include "gk20a/gk20a.h" #include "gk20a/dbg_gpu_gk20a.h" @@ -39,10 +37,7 @@ #include "therm_gm20b.h" #include - -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0) -#define FUSE_OPT_PRIV_SEC_DIS_0 0x264 -#endif +#include #define PRIV_SECURITY_DISABLE 0x01 @@ -197,8 +192,8 @@ int gm20b_init_hal(struct gk20a *g) if (platform->is_fmodel) { gops->privsecurity = 1; } else { - tegra_fuse_readl(FUSE_OPT_PRIV_SEC_DIS_0, &val); - if (val & PRIV_SECURITY_DISABLE) { + val = gk20a_readl(g, fuse_opt_priv_sec_en_r()); + if (!val) { gk20a_dbg_info("priv security is disabled in HW"); gops->privsecurity = 0; } else { @@ -210,8 +205,8 @@ int gm20b_init_hal(struct gk20a *g) gk20a_dbg_info("running ASIM with PRIV security disabled"); gops->privsecurity = 0; } else { - tegra_fuse_readl(FUSE_OPT_PRIV_SEC_DIS_0, &val); - if (val & PRIV_SECURITY_DISABLE) { + val = gk20a_readl(g, fuse_opt_priv_sec_en_r()); + if (!val) { gops->privsecurity = 0; } else { gk20a_dbg_info("priv security is not supported but enabled"); -- cgit v1.2.2