diff options
author | Sunny He <suhe@nvidia.com> | 2017-08-01 20:10:42 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-08-21 16:06:07 -0400 |
commit | 5f010177de985c901c33c914efe70a8498a5974f (patch) | |
tree | 1b1a2ac1ab71608a0754a7eb64222f5d198e793c /drivers/gpu/nvgpu/gp106/acr_gp106.c | |
parent | b50b379c192714d0d08c3f2d33e90c95cf795253 (diff) |
gpu: nvgpu: Reorg pmu HAL initialization
Reorganize HAL initialization to remove inheritance and construct
the gpu_ops struct at compile time. This patch only covers the
pmu 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: I8839ac99e87153637005e23b3013237f57275c54
Signed-off-by: Sunny He <suhe@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1530982
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
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>
Diffstat (limited to 'drivers/gpu/nvgpu/gp106/acr_gp106.c')
-rw-r--r-- | drivers/gpu/nvgpu/gp106/acr_gp106.c | 25 |
1 files changed, 4 insertions, 21 deletions
diff --git a/drivers/gpu/nvgpu/gp106/acr_gp106.c b/drivers/gpu/nvgpu/gp106/acr_gp106.c index 929036a3..bd47f467 100644 --- a/drivers/gpu/nvgpu/gp106/acr_gp106.c +++ b/drivers/gpu/nvgpu/gp106/acr_gp106.c | |||
@@ -56,9 +56,6 @@ typedef int (*get_ucode_details)(struct gk20a *g, | |||
56 | /*Externs*/ | 56 | /*Externs*/ |
57 | 57 | ||
58 | /*Forwards*/ | 58 | /*Forwards*/ |
59 | static int gp106_bootstrap_hs_flcn(struct gk20a *g); | ||
60 | |||
61 | static int gp106_prepare_ucode_blob(struct gk20a *g); | ||
62 | 59 | ||
63 | /*Globals*/ | 60 | /*Globals*/ |
64 | static get_ucode_details pmu_acr_supp_ucode_list[] = { | 61 | static get_ucode_details pmu_acr_supp_ucode_list[] = { |
@@ -67,7 +64,7 @@ static get_ucode_details pmu_acr_supp_ucode_list[] = { | |||
67 | gpccs_ucode_details, | 64 | gpccs_ucode_details, |
68 | }; | 65 | }; |
69 | 66 | ||
70 | static void gp106_wpr_info(struct gk20a *g, struct wpr_carveout_info *inf) | 67 | void gp106_wpr_info(struct gk20a *g, struct wpr_carveout_info *inf) |
71 | { | 68 | { |
72 | inf->nonwpr_base = g->mm.vidmem.bootstrap_base; | 69 | inf->nonwpr_base = g->mm.vidmem.bootstrap_base; |
73 | inf->wpr_base = inf->nonwpr_base + GP106_DGPU_WPR_OFFSET; | 70 | inf->wpr_base = inf->nonwpr_base + GP106_DGPU_WPR_OFFSET; |
@@ -80,7 +77,7 @@ static void flcn64_set_dma(struct falc_u64 *dma_addr, u64 value) | |||
80 | dma_addr->hi |= u64_hi32(value); | 77 | dma_addr->hi |= u64_hi32(value); |
81 | } | 78 | } |
82 | 79 | ||
83 | static int gp106_alloc_blob_space(struct gk20a *g, | 80 | int gp106_alloc_blob_space(struct gk20a *g, |
84 | size_t size, struct nvgpu_mem *mem) | 81 | size_t size, struct nvgpu_mem *mem) |
85 | { | 82 | { |
86 | struct wpr_carveout_info wpr_inf; | 83 | struct wpr_carveout_info wpr_inf; |
@@ -105,20 +102,6 @@ static int gp106_alloc_blob_space(struct gk20a *g, | |||
105 | NVGPU_DMA_NO_KERNEL_MAPPING, wpr_inf.size, mem, | 102 | NVGPU_DMA_NO_KERNEL_MAPPING, wpr_inf.size, mem, |
106 | wpr_inf.nonwpr_base); | 103 | wpr_inf.nonwpr_base); |
107 | } | 104 | } |
108 | |||
109 | void gp106_init_secure_pmu(struct gpu_ops *gops) | ||
110 | { | ||
111 | gops->pmu.prepare_ucode = gp106_prepare_ucode_blob; | ||
112 | gops->pmu.pmu_setup_hw_and_bootstrap = gp106_bootstrap_hs_flcn; | ||
113 | gops->pmu.get_wpr = gp106_wpr_info; | ||
114 | gops->pmu.alloc_blob_space = gp106_alloc_blob_space; | ||
115 | gops->pmu.pmu_populate_loader_cfg = gp106_pmu_populate_loader_cfg; | ||
116 | gops->pmu.flcn_populate_bl_dmem_desc = gp106_flcn_populate_bl_dmem_desc; | ||
117 | gops->pmu.falcon_wait_for_halt = sec2_wait_for_halt; | ||
118 | gops->pmu.falcon_clear_halt_interrupt_status = | ||
119 | sec2_clear_halt_interrupt_status; | ||
120 | gops->pmu.init_falcon_setup_hw = init_sec2_setup_hw1; | ||
121 | } | ||
122 | /* TODO - check if any free blob res needed*/ | 105 | /* TODO - check if any free blob res needed*/ |
123 | 106 | ||
124 | int pmu_ucode_details(struct gk20a *g, struct flcn_ucode_img_v1 *p_img) | 107 | int pmu_ucode_details(struct gk20a *g, struct flcn_ucode_img_v1 *p_img) |
@@ -373,7 +356,7 @@ rel_sig: | |||
373 | return err; | 356 | return err; |
374 | } | 357 | } |
375 | 358 | ||
376 | static int gp106_prepare_ucode_blob(struct gk20a *g) | 359 | int gp106_prepare_ucode_blob(struct gk20a *g) |
377 | { | 360 | { |
378 | 361 | ||
379 | int err; | 362 | int err; |
@@ -1040,7 +1023,7 @@ int lsf_gen_wpr_requirements(struct gk20a *g, | |||
1040 | 1023 | ||
1041 | /*Loads ACR bin to FB mem and bootstraps PMU with bootloader code | 1024 | /*Loads ACR bin to FB mem and bootstraps PMU with bootloader code |
1042 | * start and end are addresses of ucode blob in non-WPR region*/ | 1025 | * start and end are addresses of ucode blob in non-WPR region*/ |
1043 | static int gp106_bootstrap_hs_flcn(struct gk20a *g) | 1026 | int gp106_bootstrap_hs_flcn(struct gk20a *g) |
1044 | { | 1027 | { |
1045 | struct mm_gk20a *mm = &g->mm; | 1028 | struct mm_gk20a *mm = &g->mm; |
1046 | struct vm_gk20a *vm = mm->pmu.vm; | 1029 | struct vm_gk20a *vm = mm->pmu.vm; |