diff options
author | Deepak Nibade <dnibade@nvidia.com> | 2018-04-06 09:08:18 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-04-10 14:23:11 -0400 |
commit | 78151bb6f9cf9f355c57a28df0c7e4cd867c3322 (patch) | |
tree | aa7413d9caae2766ce7f81384336af0556bfe63a /drivers/gpu/nvgpu/gk20a | |
parent | 19aa748be53787da6abe435ea7043a7827d0fde0 (diff) |
gpu: nvgpu: use HAL for chiplet offset
We currently use hard coded values of NV_PERF_PMMGPC_CHIPLET_OFFSET and
NV_PMM_FBP_STRIDE which are incorrect for Volta
Add new GR HAL get_pmm_per_chiplet_offset() to get correct value per-chip
Set gr_gm20b_get_pmm_per_chiplet_offset() for older chips
Set gr_gv11b_get_pmm_per_chiplet_offset() for Volta
Use HAL instead of hard coded values wherever required
Bug 200398811
Jira NVGPU-556
Change-Id: I947e7febd4f84fae740a1bc74f99d72e1df523aa
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1690028
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.h | 1 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gr_gk20a.c | 8 |
2 files changed, 5 insertions, 4 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index edc1c5ff..c2a8d6ce 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h | |||
@@ -470,6 +470,7 @@ struct gpu_ops { | |||
470 | u32 addr, | 470 | u32 addr, |
471 | u32 *priv_addr_table, | 471 | u32 *priv_addr_table, |
472 | u32 *num_registers); | 472 | u32 *num_registers); |
473 | u32 (*get_pmm_per_chiplet_offset)(void); | ||
473 | } gr; | 474 | } gr; |
474 | struct { | 475 | struct { |
475 | void (*init_hw)(struct gk20a *g); | 476 | void (*init_hw)(struct gk20a *g); |
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c index 04d00e55..e4344b9f 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c | |||
@@ -63,9 +63,7 @@ | |||
63 | #include <nvgpu/hw/gk20a/hw_pbdma_gk20a.h> | 63 | #include <nvgpu/hw/gk20a/hw_pbdma_gk20a.h> |
64 | 64 | ||
65 | #define BLK_SIZE (256) | 65 | #define BLK_SIZE (256) |
66 | #define NV_PMM_FBP_STRIDE 0x1000 | ||
67 | #define NV_PERF_PMM_FBP_ROUTER_STRIDE 0x0200 | 66 | #define NV_PERF_PMM_FBP_ROUTER_STRIDE 0x0200 |
68 | #define NV_PERF_PMMGPC_CHIPLET_OFFSET 0x1000 | ||
69 | #define NV_PERF_PMMGPCROUTER_STRIDE 0x0200 | 67 | #define NV_PERF_PMMGPCROUTER_STRIDE 0x0200 |
70 | #define NV_PCFG_BASE 0x00088000 | 68 | #define NV_PCFG_BASE 0x00088000 |
71 | #define NV_XBAR_MXBAR_PRI_GPC_GNIC_STRIDE 0x0020 | 69 | #define NV_XBAR_MXBAR_PRI_GPC_GNIC_STRIDE 0x0020 |
@@ -7563,7 +7561,7 @@ static int add_ctxsw_buffer_map_entries_gpcs(struct gk20a *g, | |||
7563 | count, offset, max_cnt, base, ~0)) | 7561 | count, offset, max_cnt, base, ~0)) |
7564 | return -EINVAL; | 7562 | return -EINVAL; |
7565 | 7563 | ||
7566 | base = (NV_PERF_PMMGPC_CHIPLET_OFFSET * gpc_num); | 7564 | base = (g->ops.gr.get_pmm_per_chiplet_offset() * gpc_num); |
7567 | if (add_ctxsw_buffer_map_entries(map, | 7565 | if (add_ctxsw_buffer_map_entries(map, |
7568 | &g->gr.ctx_vars.ctxsw_regs.perf_gpc, | 7566 | &g->gr.ctx_vars.ctxsw_regs.perf_gpc, |
7569 | count, offset, max_cnt, base, ~0)) | 7567 | count, offset, max_cnt, base, ~0)) |
@@ -7703,7 +7701,9 @@ static int gr_gk20a_create_hwpm_ctxsw_buffer_offset_map(struct gk20a *g) | |||
7703 | &g->gr.ctx_vars.ctxsw_regs.fbp, | 7701 | &g->gr.ctx_vars.ctxsw_regs.fbp, |
7704 | &count, &offset, | 7702 | &count, &offset, |
7705 | hwpm_ctxsw_reg_count_max, 0, | 7703 | hwpm_ctxsw_reg_count_max, 0, |
7706 | g->gr.num_fbps, NV_PMM_FBP_STRIDE, ~0)) | 7704 | g->gr.num_fbps, |
7705 | g->ops.gr.get_pmm_per_chiplet_offset(), | ||
7706 | ~0)) | ||
7707 | goto cleanup; | 7707 | goto cleanup; |
7708 | 7708 | ||
7709 | /* Add entries from _LIST_nv_perf_fbprouter_ctx_regs */ | 7709 | /* Add entries from _LIST_nv_perf_fbprouter_ctx_regs */ |