summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gm20b
diff options
context:
space:
mode:
authorDeepak Nibade <dnibade@nvidia.com>2017-05-23 08:31:43 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-06-15 08:43:48 -0400
commit7d16f7e52c0f8ce8604e992a617a3f98545fcf07 (patch)
treee14b73435e847ddda77b4a72466b6aae44b9ff80 /drivers/gpu/nvgpu/gm20b
parenteb8db3e4df159210ca9c7f834dbbc939a5c67a96 (diff)
gpu: nvgpu: use fuse APIs from <nvgpu/fuse.h>
Remove <soc/tegra/fuse.h> includes and include <nvgpu/fuse.h> header to remove direct dependency on platform specific header Use specific APIs like below to read/write fuses nvgpu_tegra_fuse_write_bypass() nvgpu_tegra_fuse_write_opt_gpu_tpc0_disable() Remove old code which was compiled for kernel versions less than 4.4 since we support only k4.4 and greater versions now Jira NVGPU-75 Change-Id: Iddd8e1a8da7effbce2aff217e8e25f7de04962d6 Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: http://git-master/r/1497518 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gm20b')
-rw-r--r--drivers/gpu/nvgpu/gm20b/clk_gm20b.c4
-rw-r--r--drivers/gpu/nvgpu/gm20b/gr_gm20b.c19
-rw-r--r--drivers/gpu/nvgpu/gm20b/gr_gm20b.h8
-rw-r--r--drivers/gpu/nvgpu/gm20b/pmu_gm20b.c5
4 files changed, 12 insertions, 24 deletions
diff --git a/drivers/gpu/nvgpu/gm20b/clk_gm20b.c b/drivers/gpu/nvgpu/gm20b/clk_gm20b.c
index ceeb457a..8dfc5636 100644
--- a/drivers/gpu/nvgpu/gm20b/clk_gm20b.c
+++ b/drivers/gpu/nvgpu/gm20b/clk_gm20b.c
@@ -240,8 +240,6 @@ found_match:
240 240
241/* GPCPLL NA/DVFS mode methods */ 241/* GPCPLL NA/DVFS mode methods */
242 242
243#define FUSE_RESERVED_CALIB 0x204
244
245static inline int fuse_get_gpcpll_adc_rev(u32 val) 243static inline int fuse_get_gpcpll_adc_rev(u32 val)
246{ 244{
247 return (val >> 30) & 0x3; 245 return (val >> 30) & 0x3;
@@ -264,7 +262,7 @@ static int nvgpu_fuse_calib_gpcpll_get_adc(int *slope_uv, int *intercept_uv)
264 u32 val; 262 u32 val;
265 int ret; 263 int ret;
266 264
267 ret = nvgpu_tegra_fuse_read(FUSE_RESERVED_CALIB, &val); 265 ret = nvgpu_tegra_fuse_read_reserved_calib(&val);
268 if (ret) 266 if (ret)
269 return ret; 267 return ret;
270 268
diff --git a/drivers/gpu/nvgpu/gm20b/gr_gm20b.c b/drivers/gpu/nvgpu/gm20b/gr_gm20b.c
index c6e451e1..b7fb1ac5 100644
--- a/drivers/gpu/nvgpu/gm20b/gr_gm20b.c
+++ b/drivers/gpu/nvgpu/gm20b/gr_gm20b.c
@@ -13,14 +13,13 @@
13 * more details. 13 * more details.
14 */ 14 */
15 15
16#include <soc/tegra/fuse.h>
17
18#include <dt-bindings/soc/gm20b-fuse.h> 16#include <dt-bindings/soc/gm20b-fuse.h>
19 17
20#include <nvgpu/kmem.h> 18#include <nvgpu/kmem.h>
21#include <nvgpu/log.h> 19#include <nvgpu/log.h>
22#include <nvgpu/enabled.h> 20#include <nvgpu/enabled.h>
23#include <nvgpu/debug.h> 21#include <nvgpu/debug.h>
22#include <nvgpu/fuse.h>
24 23
25#include "gk20a/gk20a.h" 24#include "gk20a/gk20a.h"
26#include "gk20a/gr_gk20a.h" 25#include "gk20a/gr_gk20a.h"
@@ -548,18 +547,18 @@ static u32 gr_gm20b_get_gpc_tpc_mask(struct gk20a *g, u32 gpc_index)
548 547
549static void gr_gm20b_set_gpc_tpc_mask(struct gk20a *g, u32 gpc_index) 548static void gr_gm20b_set_gpc_tpc_mask(struct gk20a *g, u32 gpc_index)
550{ 549{
551 tegra_fuse_control_write(0x1, FUSE_FUSEBYPASS_0); 550 nvgpu_tegra_fuse_write_bypass(0x1);
552 tegra_fuse_control_write(0x0, FUSE_WRITE_ACCESS_SW_0); 551 nvgpu_tegra_fuse_write_access_sw(0x0);
553 552
554 if (g->gr.gpc_tpc_mask[gpc_index] == 0x1) { 553 if (g->gr.gpc_tpc_mask[gpc_index] == 0x1) {
555 tegra_fuse_control_write(0x0, FUSE_OPT_GPU_TPC0_DISABLE_0); 554 nvgpu_tegra_fuse_write_opt_gpu_tpc0_disable(0x0);
556 tegra_fuse_control_write(0x1, FUSE_OPT_GPU_TPC1_DISABLE_0); 555 nvgpu_tegra_fuse_write_opt_gpu_tpc1_disable(0x1);
557 } else if (g->gr.gpc_tpc_mask[gpc_index] == 0x2) { 556 } else if (g->gr.gpc_tpc_mask[gpc_index] == 0x2) {
558 tegra_fuse_control_write(0x1, FUSE_OPT_GPU_TPC0_DISABLE_0); 557 nvgpu_tegra_fuse_write_opt_gpu_tpc0_disable(0x1);
559 tegra_fuse_control_write(0x0, FUSE_OPT_GPU_TPC1_DISABLE_0); 558 nvgpu_tegra_fuse_write_opt_gpu_tpc1_disable(0x0);
560 } else { 559 } else {
561 tegra_fuse_control_write(0x0, FUSE_OPT_GPU_TPC0_DISABLE_0); 560 nvgpu_tegra_fuse_write_opt_gpu_tpc0_disable(0x0);
562 tegra_fuse_control_write(0x0, FUSE_OPT_GPU_TPC1_DISABLE_0); 561 nvgpu_tegra_fuse_write_opt_gpu_tpc1_disable(0x0);
563 } 562 }
564} 563}
565 564
diff --git a/drivers/gpu/nvgpu/gm20b/gr_gm20b.h b/drivers/gpu/nvgpu/gm20b/gr_gm20b.h
index b94259c5..e7dd091a 100644
--- a/drivers/gpu/nvgpu/gm20b/gr_gm20b.h
+++ b/drivers/gpu/nvgpu/gm20b/gr_gm20b.h
@@ -28,14 +28,6 @@ enum {
28 MAXWELL_CHANNEL_GPFIFO_A= 0xB06F, 28 MAXWELL_CHANNEL_GPFIFO_A= 0xB06F,
29}; 29};
30 30
31#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0)
32#define tegra_fuse_control_write tegra_fuse_writel
33#define FUSE_FUSEBYPASS_0 0x24
34#define FUSE_WRITE_ACCESS_SW_0 0x30
35#define FUSE_OPT_GPU_TPC0_DISABLE_0 0x30C
36#define FUSE_OPT_GPU_TPC1_DISABLE_0 0x33C
37#endif
38
39#define NVB197_SET_ALPHA_CIRCULAR_BUFFER_SIZE 0x02dc 31#define NVB197_SET_ALPHA_CIRCULAR_BUFFER_SIZE 0x02dc
40#define NVB197_SET_CIRCULAR_BUFFER_SIZE 0x1280 32#define NVB197_SET_CIRCULAR_BUFFER_SIZE 0x1280
41#define NVB197_SET_SHADER_EXCEPTIONS 0x1528 33#define NVB197_SET_SHADER_EXCEPTIONS 0x1528
diff --git a/drivers/gpu/nvgpu/gm20b/pmu_gm20b.c b/drivers/gpu/nvgpu/gm20b/pmu_gm20b.c
index d501163f..5609a8cc 100644
--- a/drivers/gpu/nvgpu/gm20b/pmu_gm20b.c
+++ b/drivers/gpu/nvgpu/gm20b/pmu_gm20b.c
@@ -13,10 +13,9 @@
13 * more details. 13 * more details.
14 */ 14 */
15 15
16#include <soc/tegra/fuse.h>
17
18#include <nvgpu/timers.h> 16#include <nvgpu/timers.h>
19#include <nvgpu/pmu.h> 17#include <nvgpu/pmu.h>
18#include <nvgpu/fuse.h>
20 19
21#include "gk20a/gk20a.h" 20#include "gk20a/gk20a.h"
22#include "gk20a/pmu_gk20a.h" 21#include "gk20a/pmu_gk20a.h"
@@ -269,7 +268,7 @@ static void pmu_dump_security_fuses_gm20b(struct gk20a *g)
269 gk20a_readl(g, fuse_opt_sec_debug_en_r())); 268 gk20a_readl(g, fuse_opt_sec_debug_en_r()));
270 nvgpu_err(g, "FUSE_OPT_PRIV_SEC_EN_0 : 0x%x", 269 nvgpu_err(g, "FUSE_OPT_PRIV_SEC_EN_0 : 0x%x",
271 gk20a_readl(g, fuse_opt_priv_sec_en_r())); 270 gk20a_readl(g, fuse_opt_priv_sec_en_r()));
272 tegra_fuse_readl(FUSE_GCPLEX_CONFIG_FUSE_0, &val); 271 nvgpu_tegra_fuse_read_gcplex_config_fuse(&val);
273 nvgpu_err(g, "FUSE_GCPLEX_CONFIG_FUSE_0 : 0x%x", 272 nvgpu_err(g, "FUSE_GCPLEX_CONFIG_FUSE_0 : 0x%x",
274 val); 273 val);
275} 274}