summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSunny He <suhe@nvidia.com>2017-06-27 18:09:58 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-07-27 19:34:37 -0400
commit3c556c5e9573ffa69bfe64ed1401ed4a9141acb3 (patch)
tree27db3b86e0b4b46f1343ac88f01f164ab3599461
parent2b98e1308d49b9c941d8fa6fc87f67108d6d9370 (diff)
gpu: nvgpu: gv11b: Reorg ce2 HAL initialization
Reorganize HAL initialization to remove inheritance and construct the gpu_ops struct at compile time. This patch only covers the ce2 sub-module of the gpu_ops struct. Perform HAL function assignments in hal_gxxxx.c through the population of a chip-specific copy of gpu_ops. Jira NVGPU-74 Change-Id: Ia2d715a471d7e23420691a461e9442780176ea13 Signed-off-by: Sunny He <suhe@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1509633 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
-rw-r--r--drivers/gpu/nvgpu/gv11b/ce_gv11b.c11
-rw-r--r--drivers/gpu/nvgpu/gv11b/ce_gv11b.h5
-rw-r--r--drivers/gpu/nvgpu/gv11b/hal_gv11b.c8
3 files changed, 12 insertions, 12 deletions
diff --git a/drivers/gpu/nvgpu/gv11b/ce_gv11b.c b/drivers/gpu/nvgpu/gv11b/ce_gv11b.c
index 9716c6d6..8bf636b1 100644
--- a/drivers/gpu/nvgpu/gv11b/ce_gv11b.c
+++ b/drivers/gpu/nvgpu/gv11b/ce_gv11b.c
@@ -28,7 +28,7 @@
28#include <nvgpu/hw/gv11b/hw_ce_gv11b.h> 28#include <nvgpu/hw/gv11b/hw_ce_gv11b.h>
29#include <nvgpu/hw/gv11b/hw_top_gv11b.h> 29#include <nvgpu/hw/gv11b/hw_top_gv11b.h>
30 30
31static u32 gv11b_ce_get_num_pce(struct gk20a *g) 31u32 gv11b_ce_get_num_pce(struct gk20a *g)
32{ 32{
33 /* register contains a bitmask indicating which physical copy 33 /* register contains a bitmask indicating which physical copy
34 * engines are present (and not floorswept). 34 * engines are present (and not floorswept).
@@ -41,7 +41,7 @@ static u32 gv11b_ce_get_num_pce(struct gk20a *g)
41 return num_pce; 41 return num_pce;
42} 42}
43 43
44static void gv11b_ce_isr(struct gk20a *g, u32 inst_id, u32 pri_base) 44void gv11b_ce_isr(struct gk20a *g, u32 inst_id, u32 pri_base)
45{ 45{
46 u32 ce_intr = gk20a_readl(g, ce_intr_status_r(inst_id)); 46 u32 ce_intr = gk20a_readl(g, ce_intr_status_r(inst_id));
47 u32 clear_intr = 0; 47 u32 clear_intr = 0;
@@ -102,10 +102,3 @@ void gv11b_ce_mthd_buffer_fault_in_bar2_fault(struct gk20a *g)
102 } 102 }
103 } 103 }
104} 104}
105
106void gv11b_init_ce(struct gpu_ops *gops)
107{
108 gp10b_init_ce(gops);
109 gops->ce2.isr_stall = gv11b_ce_isr;
110 gops->ce2.get_num_pce = gv11b_ce_get_num_pce;
111}
diff --git a/drivers/gpu/nvgpu/gv11b/ce_gv11b.h b/drivers/gpu/nvgpu/gv11b/ce_gv11b.h
index 23053199..ce60ad3e 100644
--- a/drivers/gpu/nvgpu/gv11b/ce_gv11b.h
+++ b/drivers/gpu/nvgpu/gv11b/ce_gv11b.h
@@ -19,10 +19,11 @@
19#ifndef __CE_GV11B_H__ 19#ifndef __CE_GV11B_H__
20#define __CE_GV11B_H__ 20#define __CE_GV11B_H__
21 21
22struct gpu_ops; 22struct gk20a;
23 23
24void gv11b_init_ce(struct gpu_ops *gops);
25void gv11b_ce_mthd_buffer_fault_in_bar2_fault(struct gk20a *g); 24void gv11b_ce_mthd_buffer_fault_in_bar2_fault(struct gk20a *g);
26u32 gv11b_ce_get_num_lce(struct gk20a *g); 25u32 gv11b_ce_get_num_lce(struct gk20a *g);
26u32 gv11b_ce_get_num_pce(struct gk20a *g);
27void gv11b_ce_isr(struct gk20a *g, u32 inst_id, u32 pri_base);
27 28
28#endif /*__CE2_GV11B_H__*/ 29#endif /*__CE2_GV11B_H__*/
diff --git a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c
index 3ebeb205..e585e9b1 100644
--- a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c
+++ b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c
@@ -34,6 +34,7 @@
34 34
35#include "gp10b/ltc_gp10b.h" 35#include "gp10b/ltc_gp10b.h"
36#include "gp10b/mc_gp10b.h" 36#include "gp10b/mc_gp10b.h"
37#include "gp10b/ce_gp10b.h"
37#include "gp10b/priv_ring_gp10b.h" 38#include "gp10b/priv_ring_gp10b.h"
38#include "gp10b/fifo_gp10b.h" 39#include "gp10b/fifo_gp10b.h"
39 40
@@ -160,6 +161,11 @@ static const struct gpu_ops gv11b_ops = {
160 .sync_debugfs = gp10b_ltc_sync_debugfs, 161 .sync_debugfs = gp10b_ltc_sync_debugfs,
161#endif 162#endif
162 }, 163 },
164 .ce2 = {
165 .isr_stall = gv11b_ce_isr,
166 .isr_nonstall = gp10b_ce_nonstall_isr,
167 .get_num_pce = gv11b_ce_get_num_pce,
168 },
163 .clock_gating = { 169 .clock_gating = {
164 .slcg_bus_load_gating_prod = 170 .slcg_bus_load_gating_prod =
165 gv11b_slcg_bus_load_gating_prod, 171 gv11b_slcg_bus_load_gating_prod,
@@ -340,6 +346,7 @@ int gv11b_init_hal(struct gk20a *g)
340 struct nvgpu_gpu_characteristics *c = &g->gpu_characteristics; 346 struct nvgpu_gpu_characteristics *c = &g->gpu_characteristics;
341 347
342 gops->ltc = gv11b_ops.ltc; 348 gops->ltc = gv11b_ops.ltc;
349 gops->ce2 = gv11b_ops.ce2;
343 gops->clock_gating = gv11b_ops.clock_gating; 350 gops->clock_gating = gv11b_ops.clock_gating;
344 gops->fifo = gv11b_ops.fifo; 351 gops->fifo = gv11b_ops.fifo;
345 gops->mc = gv11b_ops.mc; 352 gops->mc = gv11b_ops.mc;
@@ -364,7 +371,6 @@ int gv11b_init_hal(struct gk20a *g)
364 gv11b_init_gr(g); 371 gv11b_init_gr(g);
365 gv11b_init_fecs_trace_ops(gops); 372 gv11b_init_fecs_trace_ops(gops);
366 gv11b_init_fb(gops); 373 gv11b_init_fb(gops);
367 gv11b_init_ce(gops);
368 gv11b_init_gr_ctx(gops); 374 gv11b_init_gr_ctx(gops);
369 gv11b_init_mm(gops); 375 gv11b_init_mm(gops);
370 gv11b_init_pmu_ops(g); 376 gv11b_init_pmu_ops(g);