summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gm20b
diff options
context:
space:
mode:
authorsujeet baranwal <sbaranwal@nvidia.com>2015-03-06 14:55:36 -0500
committerDan Willemsen <dwillemsen@nvidia.com>2015-04-04 21:58:05 -0400
commit2155dfeaba1714bb00cb86af090aa056aec3acfd (patch)
tree545b791cbf1271750f8728e1e5ec30d107a4ef7b /drivers/gpu/nvgpu/gm20b
parent895675e1d5790e2361b22edb50d702f7dd9a8edd (diff)
gpu: nvgpu: Gpu characterstics enhancement
New members are added in nvgpu_gpu_characterstics to export more information required specially from CUDA tools. Change-Id: I907f3bcbd272405a13f47ef6236bc2cff01c6c80 Signed-off-by: Sujeet Baranwal <sbaranwal@nvidia.com> Reviewed-on: http://git-master/r/679202 Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gm20b')
-rw-r--r--drivers/gpu/nvgpu/gm20b/gr_gm20b.c52
-rw-r--r--drivers/gpu/nvgpu/gm20b/hw_fuse_gm20b.h22
-rw-r--r--drivers/gpu/nvgpu/gm20b/hw_top_gm20b.h18
3 files changed, 90 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/gm20b/gr_gm20b.c b/drivers/gpu/nvgpu/gm20b/gr_gm20b.c
index 3d99e94d..c199964f 100644
--- a/drivers/gpu/nvgpu/gm20b/gr_gm20b.c
+++ b/drivers/gpu/nvgpu/gm20b/gr_gm20b.c
@@ -26,6 +26,7 @@
26#include "hw_gr_gm20b.h" 26#include "hw_gr_gm20b.h"
27#include "hw_fifo_gm20b.h" 27#include "hw_fifo_gm20b.h"
28#include "hw_fb_gm20b.h" 28#include "hw_fb_gm20b.h"
29#include "hw_top_gm20b.h"
29#include "hw_proj_gm20b.h" 30#include "hw_proj_gm20b.h"
30#include "hw_ctxsw_prog_gm20b.h" 31#include "hw_ctxsw_prog_gm20b.h"
31#include "hw_fuse_gm20b.h" 32#include "hw_fuse_gm20b.h"
@@ -975,6 +976,52 @@ static int gr_gm20b_update_pc_sampling(struct channel_gk20a *c,
975 return 0; 976 return 0;
976} 977}
977 978
979static u32 gr_gm20b_get_fbp_en_mask(struct gk20a *g)
980{
981 u32 fbp_en_mask, opt_fbio;
982 opt_fbio = gk20a_readl(g, fuse_status_opt_fbio_r());
983 fbp_en_mask = fuse_status_opt_fbio_data_v(opt_fbio);
984 return fbp_en_mask;
985}
986
987static u32 gr_gm20b_get_max_ltc_per_fbp(struct gk20a *g)
988{
989 u32 ltc_per_fbp, reg;
990 reg = gk20a_readl(g, top_ltc_per_fbp_r());
991 ltc_per_fbp = top_ltc_per_fbp_value_v(reg);
992 return ltc_per_fbp;
993}
994
995static u32 gr_gm20b_get_max_lts_per_ltc(struct gk20a *g)
996{
997 u32 lts_per_ltc, reg;
998 reg = gk20a_readl(g, top_slices_per_ltc_r());
999 lts_per_ltc = top_slices_per_ltc_value_v(reg);
1000 return lts_per_ltc;
1001}
1002
1003u32 *gr_gm20b_rop_l2_en_mask(struct gk20a *g)
1004{
1005 struct nvgpu_gpu_characteristics *gpu = &g->gpu_characteristics;
1006 u32 i, tmp, max_fbps_count;
1007 tmp = gk20a_readl(g, top_num_fbps_r());
1008 max_fbps_count = top_num_fbps_value_v(tmp);
1009
1010 /* mask of Rop_L2 for each FBP */
1011 for (i = 0; i < max_fbps_count; i++)
1012 gpu->rop_l2_en_mask[i] = fuse_status_opt_rop_l2_fbp_r(i);
1013
1014 return gpu->rop_l2_en_mask;
1015}
1016
1017static u32 gr_gm20b_get_max_fbps_count(struct gk20a *g)
1018{
1019 u32 tmp, max_fbps_count;
1020 tmp = gk20a_readl(g, top_num_fbps_r());
1021 max_fbps_count = top_num_fbps_value_v(tmp);
1022 return max_fbps_count;
1023}
1024
978void gm20b_init_gr(struct gpu_ops *gops) 1025void gm20b_init_gr(struct gpu_ops *gops)
979{ 1026{
980 gops->gr.init_gpc_mmu = gr_gm20b_init_gpc_mmu; 1027 gops->gr.init_gpc_mmu = gr_gm20b_init_gpc_mmu;
@@ -1020,4 +1067,9 @@ void gm20b_init_gr(struct gpu_ops *gops)
1020 gr_gm20b_update_ctxsw_preemption_mode; 1067 gr_gm20b_update_ctxsw_preemption_mode;
1021 gops->gr.dump_gr_regs = gr_gm20b_dump_gr_status_regs; 1068 gops->gr.dump_gr_regs = gr_gm20b_dump_gr_status_regs;
1022 gops->gr.update_pc_sampling = gr_gm20b_update_pc_sampling; 1069 gops->gr.update_pc_sampling = gr_gm20b_update_pc_sampling;
1070 gops->gr.get_fbp_en_mask = gr_gm20b_get_fbp_en_mask;
1071 gops->gr.get_max_ltc_per_fbp = gr_gm20b_get_max_ltc_per_fbp;
1072 gops->gr.get_max_lts_per_ltc = gr_gm20b_get_max_lts_per_ltc;
1073 gops->gr.get_rop_l2_en_mask = gr_gm20b_rop_l2_en_mask;
1074 gops->gr.get_max_fbps_count = gr_gm20b_get_max_fbps_count;
1023} 1075}
diff --git a/drivers/gpu/nvgpu/gm20b/hw_fuse_gm20b.h b/drivers/gpu/nvgpu/gm20b/hw_fuse_gm20b.h
index 67a82fa2..729d6541 100644
--- a/drivers/gpu/nvgpu/gm20b/hw_fuse_gm20b.h
+++ b/drivers/gpu/nvgpu/gm20b/hw_fuse_gm20b.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2014, NVIDIA CORPORATION. All rights reserved. 2 * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.
3 * 3 *
4 * This program is free software; you can redistribute it and/or modify it 4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License, 5 * under the terms and conditions of the GNU General Public License,
@@ -98,4 +98,24 @@ static inline u32 fuse_ctrl_opt_ram_svop_pdp_override_data_no_f(void)
98{ 98{
99 return 0x0; 99 return 0x0;
100} 100}
101static inline u32 fuse_status_opt_fbio_r(void)
102{
103 return 0x00021c14;
104}
105static inline u32 fuse_status_opt_fbio_data_f(u32 v)
106{
107 return (v & 0xffff) << 0;
108}
109static inline u32 fuse_status_opt_fbio_data_m(void)
110{
111 return 0xffff << 0;
112}
113static inline u32 fuse_status_opt_fbio_data_v(u32 r)
114{
115 return (r >> 0) & 0xffff;
116}
117static inline u32 fuse_status_opt_rop_l2_fbp_r(u32 i)
118{
119 return 0x00021d70 + i*4;
120}
101#endif 121#endif
diff --git a/drivers/gpu/nvgpu/gm20b/hw_top_gm20b.h b/drivers/gpu/nvgpu/gm20b/hw_top_gm20b.h
index 42a82a12..c0ad007d 100644
--- a/drivers/gpu/nvgpu/gm20b/hw_top_gm20b.h
+++ b/drivers/gpu/nvgpu/gm20b/hw_top_gm20b.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2014, NVIDIA CORPORATION. All rights reserved. 2 * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.
3 * 3 *
4 * This program is free software; you can redistribute it and/or modify it 4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License, 5 * under the terms and conditions of the GNU General Public License,
@@ -74,6 +74,22 @@ static inline u32 top_num_fbps_value_v(u32 r)
74{ 74{
75 return (r >> 0) & 0x1f; 75 return (r >> 0) & 0x1f;
76} 76}
77static inline u32 top_ltc_per_fbp_r(void)
78{
79 return 0x00022450;
80}
81static inline u32 top_ltc_per_fbp_value_v(u32 r)
82{
83 return (r >> 0) & 0x1f;
84}
85static inline u32 top_slices_per_ltc_r(void)
86{
87 return 0x0002245c;
88}
89static inline u32 top_slices_per_ltc_value_v(u32 r)
90{
91 return (r >> 0) & 0x1f;
92}
77static inline u32 top_num_ltcs_r(void) 93static inline u32 top_num_ltcs_r(void)
78{ 94{
79 return 0x00022454; 95 return 0x00022454;