diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2017-02-09 11:17:47 -0500 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-02-17 16:46:32 -0500 |
commit | 53465def649b813987ca0d4a7ced744305204b82 (patch) | |
tree | cdff16681cb0442de3b1a8bd151b2a38c0bc5311 /drivers/gpu/nvgpu/perf/vfe_var.c | |
parent | 29a79e6b80c6a0da489d8b0a470c86e2fec9c355 (diff) |
gpu: nvgpu: Generalize BIOS code
Most of BIOS parsing code is not specific to any particular GPU. Move
most of the code to generic files, and leave only chip specific parts
dealing with microcontroller boot into chip specific files.
As most of the parsing is generic, they do not need to be called via
HALs so remove the HALs and change the calls into direct function
calls.
All definitions meant to be used outside BIOS code itself are now in
<nvgpu/bios.h>
Change-Id: Id48e94c74511d6e95645e90e5bba5c12ef8da45d
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1302222
GVS: Gerrit_Virtual_Submit
Diffstat (limited to 'drivers/gpu/nvgpu/perf/vfe_var.c')
-rw-r--r-- | drivers/gpu/nvgpu/perf/vfe_var.c | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/drivers/gpu/nvgpu/perf/vfe_var.c b/drivers/gpu/nvgpu/perf/vfe_var.c index d1e1d76c..7170f502 100644 --- a/drivers/gpu/nvgpu/perf/vfe_var.c +++ b/drivers/gpu/nvgpu/perf/vfe_var.c | |||
@@ -11,13 +11,13 @@ | |||
11 | * more details. | 11 | * more details. |
12 | */ | 12 | */ |
13 | 13 | ||
14 | #include <nvgpu/bios.h> | ||
15 | |||
14 | #include "gk20a/gk20a.h" | 16 | #include "gk20a/gk20a.h" |
15 | #include "perf.h" | 17 | #include "perf.h" |
16 | #include "vfe_var.h" | 18 | #include "vfe_var.h" |
17 | #include "include/bios.h" | ||
18 | #include "boardobj/boardobjgrp.h" | 19 | #include "boardobj/boardobjgrp.h" |
19 | #include "boardobj/boardobjgrp_e32.h" | 20 | #include "boardobj/boardobjgrp_e32.h" |
20 | #include "gm206/bios_gm206.h" | ||
21 | #include "ctrl/ctrlclk.h" | 21 | #include "ctrl/ctrlclk.h" |
22 | #include "ctrl/ctrlvolt.h" | 22 | #include "ctrl/ctrlvolt.h" |
23 | #include "gk20a/pmu_gk20a.h" | 23 | #include "gk20a/pmu_gk20a.h" |
@@ -179,17 +179,14 @@ u32 dev_init_get_vfield_info(struct gk20a *g, | |||
179 | u8 *psegmentcount = NULL; | 179 | u8 *psegmentcount = NULL; |
180 | u32 status = 0; | 180 | u32 status = 0; |
181 | 181 | ||
182 | if (!g->ops.bios.get_perf_table_ptrs) | 182 | vfieldregtableptr = (u8 *)nvgpu_bios_get_perf_table_ptrs(g, |
183 | return -EINVAL; | ||
184 | |||
185 | vfieldregtableptr = (u8 *)g->ops.bios.get_perf_table_ptrs(g, | ||
186 | g->bios.virt_token, VP_FIELD_REGISTER); | 183 | g->bios.virt_token, VP_FIELD_REGISTER); |
187 | if (vfieldregtableptr == NULL) { | 184 | if (vfieldregtableptr == NULL) { |
188 | status = -EINVAL; | 185 | status = -EINVAL; |
189 | goto done; | 186 | goto done; |
190 | } | 187 | } |
191 | 188 | ||
192 | vfieldtableptr = (u8 *)g->ops.bios.get_perf_table_ptrs(g, | 189 | vfieldtableptr = (u8 *)nvgpu_bios_get_perf_table_ptrs(g, |
193 | g->bios.virt_token, VP_FIELD_TABLE); | 190 | g->bios.virt_token, VP_FIELD_TABLE); |
194 | if (vfieldtableptr == NULL) { | 191 | if (vfieldtableptr == NULL) { |
195 | status = -EINVAL; | 192 | status = -EINVAL; |
@@ -864,12 +861,7 @@ static u32 devinit_get_vfe_var_table(struct gk20a *g, | |||
864 | 861 | ||
865 | gk20a_dbg_info(""); | 862 | gk20a_dbg_info(""); |
866 | 863 | ||
867 | if (!g->ops.bios.get_perf_table_ptrs) { | 864 | vfevars_tbl_ptr = (u8 *)nvgpu_bios_get_perf_table_ptrs(g, |
868 | status = -EINVAL; | ||
869 | goto done; | ||
870 | } | ||
871 | |||
872 | vfevars_tbl_ptr = (u8 *)g->ops.bios.get_perf_table_ptrs(g, | ||
873 | g->bios.perf_token, | 865 | g->bios.perf_token, |
874 | CONTINUOUS_VIRTUAL_BINNING_TABLE); | 866 | CONTINUOUS_VIRTUAL_BINNING_TABLE); |
875 | if (vfevars_tbl_ptr == NULL) { | 867 | if (vfevars_tbl_ptr == NULL) { |