diff options
author | Shardar Shariff Md <smohammed@nvidia.com> | 2016-11-01 09:36:06 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2016-11-11 05:18:40 -0500 |
commit | cc4208a27831faf95409b491aa29b8a161bf630a (patch) | |
tree | 57200cca04b4d477bed934577c16b7ccdf93ae83 /drivers/gpu/nvgpu/gm20b/gr_gm20b.c | |
parent | 5855fe26cb401d6d139b930ab48bb1106301585f (diff) |
gpu: nvgpu: 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: I5a86ef58d9de17a273aea8d3ce8ad5772444dac2
Signed-off-by: Shardar Shariff Md <smohammed@nvidia.com>
Reviewed-on: http://git-master/r/1245824
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
GVS: Gerrit_Virtual_Submit
Diffstat (limited to 'drivers/gpu/nvgpu/gm20b/gr_gm20b.c')
-rw-r--r-- | drivers/gpu/nvgpu/gm20b/gr_gm20b.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gm20b/gr_gm20b.c b/drivers/gpu/nvgpu/gm20b/gr_gm20b.c index 7903af79..23144275 100644 --- a/drivers/gpu/nvgpu/gm20b/gr_gm20b.c +++ b/drivers/gpu/nvgpu/gm20b/gr_gm20b.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/io.h> | 18 | #include <linux/io.h> |
19 | #include <linux/tegra-fuse.h> | 19 | #include <linux/tegra-fuse.h> |
20 | #include <linux/vmalloc.h> | 20 | #include <linux/vmalloc.h> |
21 | #include <linux/version.h> | ||
21 | 22 | ||
22 | #include <dt-bindings/soc/gm20b-fuse.h> | 23 | #include <dt-bindings/soc/gm20b-fuse.h> |
23 | 24 | ||
@@ -513,8 +514,13 @@ static void gr_gm20b_set_gpc_tpc_mask(struct gk20a *g, u32 gpc_index) | |||
513 | tegra_clk_writel(CLK_RST_CONTROLLER_MISC_CLK_ENB_0_ALL_VISIBLE, | 514 | tegra_clk_writel(CLK_RST_CONTROLLER_MISC_CLK_ENB_0_ALL_VISIBLE, |
514 | CLK_RST_CONTROLLER_MISC_CLK_ENB_0); | 515 | CLK_RST_CONTROLLER_MISC_CLK_ENB_0); |
515 | 516 | ||
517 | #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0) | ||
516 | tegra_fuse_writel(0x1, FUSE_FUSEBYPASS_0); | 518 | tegra_fuse_writel(0x1, FUSE_FUSEBYPASS_0); |
517 | tegra_fuse_writel(0x0, FUSE_WRITE_ACCESS_SW_0); | 519 | tegra_fuse_writel(0x0, FUSE_WRITE_ACCESS_SW_0); |
520 | #else | ||
521 | tegra_fuse_control_write(0x1, FUSE_FUSEBYPASS_0); | ||
522 | tegra_fuse_control_write(0x0, FUSE_WRITE_ACCESS_SW_0); | ||
523 | #endif | ||
518 | 524 | ||
519 | if (g->gr.gpc_tpc_mask[gpc_index] == 0x1) { | 525 | if (g->gr.gpc_tpc_mask[gpc_index] == 0x1) { |
520 | tegra_fuse_writel(0x0, FUSE_OPT_GPU_TPC0_DISABLE_0); | 526 | tegra_fuse_writel(0x0, FUSE_OPT_GPU_TPC0_DISABLE_0); |