summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorShardar Shariff Md <smohammed@nvidia.com>2016-11-01 09:39:46 -0400
committerDeepak Nibade <dnibade@nvidia.com>2016-12-27 04:56:51 -0500
commit3a032c33fb70453494e0b143a93db61f859381ea (patch)
tree64b323a90cf2c2d3db1ff00cb4ea89c1a0833c60 /drivers
parent3621d35f95d6060d87a31164b7884fc1e896989f (diff)
gpu: nvgpu: gp10b: define fuse macro depend on kernel version
- Define fuse macros depending on kernel version as fuse offset got changed in K4.4 and for K4.4 fuse defines are defined in common header file (tegra-fuse.h) - Use fuse control read/write APIs when reading control registers for K4.4 Bug 200243956 Change-Id: I34dabd1a307d10010cb89ac6a5f1e3f5b177c0fc Signed-off-by: Shardar Shariff Md <smohammed@nvidia.com> Reviewed-on: http://git-master/r/1245825 Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Tested-by: Terje Bergstrom <tbergstrom@nvidia.com> GVS: Gerrit_Virtual_Submit
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/nvgpu/gp10b/gp10b_sysfs.h4
-rw-r--r--drivers/gpu/nvgpu/gp10b/gr_gp10b.c6
-rw-r--r--drivers/gpu/nvgpu/gp10b/hal_gp10b.c3
3 files changed, 13 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gp10b/gp10b_sysfs.h b/drivers/gpu/nvgpu/gp10b/gp10b_sysfs.h
index 7c3d3400..786a3bb0 100644
--- a/drivers/gpu/nvgpu/gp10b/gp10b_sysfs.h
+++ b/drivers/gpu/nvgpu/gp10b/gp10b_sysfs.h
@@ -16,8 +16,12 @@
16#ifndef _GP10B_SYSFS_H_ 16#ifndef _GP10B_SYSFS_H_
17#define _GP10B_SYSFS_H_ 17#define _GP10B_SYSFS_H_
18 18
19#include <linux/version.h>
20
19/*ECC Fuse*/ 21/*ECC Fuse*/
22#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0)
20#define FUSE_OPT_ECC_EN 0x358 23#define FUSE_OPT_ECC_EN 0x358
24#endif
21 25
22void gp10b_create_sysfs(struct device *dev); 26void gp10b_create_sysfs(struct device *dev);
23void gp10b_remove_sysfs(struct device *dev); 27void gp10b_remove_sysfs(struct device *dev);
diff --git a/drivers/gpu/nvgpu/gp10b/gr_gp10b.c b/drivers/gpu/nvgpu/gp10b/gr_gp10b.c
index 0705d8b6..09c2558c 100644
--- a/drivers/gpu/nvgpu/gp10b/gr_gp10b.c
+++ b/drivers/gpu/nvgpu/gp10b/gr_gp10b.c
@@ -17,6 +17,7 @@
17#include <linux/clk.h> 17#include <linux/clk.h>
18#include <linux/delay.h> 18#include <linux/delay.h>
19#include <linux/tegra-fuse.h> 19#include <linux/tegra-fuse.h>
20#include <linux/version.h>
20 21
21#include <dt-bindings/soc/gm20b-fuse.h> 22#include <dt-bindings/soc/gm20b-fuse.h>
22#include <dt-bindings/soc/gp10b-fuse.h> 23#include <dt-bindings/soc/gp10b-fuse.h>
@@ -1533,8 +1534,13 @@ static void gr_gp10b_init_cyclestats(struct gk20a *g)
1533 1534
1534static void gr_gp10b_set_gpc_tpc_mask(struct gk20a *g, u32 gpc_index) 1535static void gr_gp10b_set_gpc_tpc_mask(struct gk20a *g, u32 gpc_index)
1535{ 1536{
1537#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0)
1536 tegra_fuse_writel(0x1, FUSE_FUSEBYPASS_0); 1538 tegra_fuse_writel(0x1, FUSE_FUSEBYPASS_0);
1537 tegra_fuse_writel(0x0, FUSE_WRITE_ACCESS_SW_0); 1539 tegra_fuse_writel(0x0, FUSE_WRITE_ACCESS_SW_0);
1540#else
1541 tegra_fuse_control_write(0x1, FUSE_FUSEBYPASS_0);
1542 tegra_fuse_control_write(0x0, FUSE_WRITE_ACCESS_SW_0);
1543#endif
1538 1544
1539 if (g->gr.gpc_tpc_mask[gpc_index] == 0x1) 1545 if (g->gr.gpc_tpc_mask[gpc_index] == 0x1)
1540 tegra_fuse_writel(0x2, FUSE_OPT_GPU_TPC0_DISABLE_0); 1546 tegra_fuse_writel(0x2, FUSE_OPT_GPU_TPC0_DISABLE_0);
diff --git a/drivers/gpu/nvgpu/gp10b/hal_gp10b.c b/drivers/gpu/nvgpu/gp10b/hal_gp10b.c
index 2699dd7a..f0137a70 100644
--- a/drivers/gpu/nvgpu/gp10b/hal_gp10b.c
+++ b/drivers/gpu/nvgpu/gp10b/hal_gp10b.c
@@ -15,6 +15,7 @@
15 15
16#include <linux/types.h> 16#include <linux/types.h>
17#include <linux/printk.h> 17#include <linux/printk.h>
18#include <linux/version.h>
18 19
19#include <linux/types.h> 20#include <linux/types.h>
20 21
@@ -46,7 +47,9 @@
46#include "gk20a/dbg_gpu_gk20a.h" 47#include "gk20a/dbg_gpu_gk20a.h"
47#include "gk20a/css_gr_gk20a.h" 48#include "gk20a/css_gr_gk20a.h"
48 49
50#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0)
49#define FUSE_OPT_PRIV_SEC_EN_0 0x264 51#define FUSE_OPT_PRIV_SEC_EN_0 0x264
52#endif
50#define PRIV_SECURITY_ENABLED 0x01 53#define PRIV_SECURITY_ENABLED 0x01
51 54
52static struct gpu_ops gp10b_ops = { 55static struct gpu_ops gp10b_ops = {