summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gp106/sec2_gp106.c
diff options
context:
space:
mode:
authorAlex Waterman <alexw@nvidia.com>2017-10-06 14:30:29 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-10-24 18:16:49 -0400
commit2a285d0607a20694476399f5719e74dbc26fcd58 (patch)
treeef0246e3ca7b933ce3ea4c74061f61cc2e394b8b /drivers/gpu/nvgpu/gp106/sec2_gp106.c
parent748331cbab1c7af26ab1fbae5ead2cdaff22806a (diff)
gpu: nvgpu: Cleanup generic MM code in gk20a/mm_gk20a.c
Move much of the remaining generic MM code to a new common location: common/mm/mm.c. Also add a corresponding <nvgpu/mm.h> header. This mostly consists of init and cleanup code to handle the common MM data structures like the VIDMEM code, address spaces for various engines, etc. A few more indepth changes were made as well. 1. alloc_inst_block() has been added to the MM HAL. This used to be defined directly in the gk20a code but it used a register. As a result, if this register hypothetically changes in the future, it would need to become a HAL anyway. This path preempts that and for now just defines all HALs to use the gk20a version. 2. Rename as much as possible: global functions are, for the most part, prepended with nvgpu (there are a few exceptions which I have yet to decide what to do with). Functions that are static are renamed to be as consistent with their functionality as possible since in some cases function effect and function name have diverged. JIRA NVGPU-30 Change-Id: Ic948f1ecc2f7976eba4bb7169a44b7226bb7c0b5 Signed-off-by: Alex Waterman <alexw@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1574499 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gp106/sec2_gp106.c')
-rw-r--r--drivers/gpu/nvgpu/gp106/sec2_gp106.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/gp106/sec2_gp106.c b/drivers/gpu/nvgpu/gp106/sec2_gp106.c
index 9f0fe375..26ded39e 100644
--- a/drivers/gpu/nvgpu/gp106/sec2_gp106.c
+++ b/drivers/gpu/nvgpu/gp106/sec2_gp106.c
@@ -22,6 +22,7 @@
22 22
23#include <nvgpu/pmu.h> 23#include <nvgpu/pmu.h>
24#include <nvgpu/falcon.h> 24#include <nvgpu/falcon.h>
25#include <nvgpu/mm.h>
25 26
26#include "gk20a/gk20a.h" 27#include "gk20a/gk20a.h"
27#include "sec2_gp106.h" 28#include "sec2_gp106.h"
@@ -88,7 +89,7 @@ int bl_bootstrap_sec2(struct nvgpu_pmu *pmu,
88 89
89 gk20a_writel(g, psec_falcon_nxtctx_r(), 90 gk20a_writel(g, psec_falcon_nxtctx_r(),
90 pwr_pmu_new_instblk_ptr_f( 91 pwr_pmu_new_instblk_ptr_f(
91 gk20a_mm_inst_block_addr(g, &mm->pmu.inst_block) >> 12) | 92 nvgpu_inst_block_addr(g, &mm->pmu.inst_block) >> 12) |
92 pwr_pmu_new_instblk_valid_f(1) | 93 pwr_pmu_new_instblk_valid_f(1) |
93 nvgpu_aperture_mask(g, &mm->pmu.inst_block, 94 nvgpu_aperture_mask(g, &mm->pmu.inst_block,
94 pwr_pmu_new_instblk_target_sys_coh_f(), 95 pwr_pmu_new_instblk_target_sys_coh_f(),
@@ -154,7 +155,7 @@ void init_pmu_setup_hw1(struct gk20a *g)
154 pwr_falcon_itfen_ctxen_enable_f()); 155 pwr_falcon_itfen_ctxen_enable_f());
155 gk20a_writel(g, pwr_pmu_new_instblk_r(), 156 gk20a_writel(g, pwr_pmu_new_instblk_r(),
156 pwr_pmu_new_instblk_ptr_f( 157 pwr_pmu_new_instblk_ptr_f(
157 gk20a_mm_inst_block_addr(g, &mm->pmu.inst_block) >> 12) | 158 nvgpu_inst_block_addr(g, &mm->pmu.inst_block) >> 12) |
158 pwr_pmu_new_instblk_valid_f(1) | 159 pwr_pmu_new_instblk_valid_f(1) |
159 nvgpu_aperture_mask(g, &mm->pmu.inst_block, 160 nvgpu_aperture_mask(g, &mm->pmu.inst_block,
160 pwr_pmu_new_instblk_target_sys_coh_f(), 161 pwr_pmu_new_instblk_target_sys_coh_f(),