From 53465def649b813987ca0d4a7ced744305204b82 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Thu, 9 Feb 2017 08:17:47 -0800 Subject: 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 Change-Id: Id48e94c74511d6e95645e90e5bba5c12ef8da45d Signed-off-by: Terje Bergstrom Reviewed-on: http://git-master/r/1302222 GVS: Gerrit_Virtual_Submit --- drivers/gpu/nvgpu/perf/vfe_equ.c | 9 +++------ drivers/gpu/nvgpu/perf/vfe_var.c | 18 +++++------------- 2 files changed, 8 insertions(+), 19 deletions(-) (limited to 'drivers/gpu/nvgpu/perf') diff --git a/drivers/gpu/nvgpu/perf/vfe_equ.c b/drivers/gpu/nvgpu/perf/vfe_equ.c index 3a5b9f45..f8a79a22 100644 --- a/drivers/gpu/nvgpu/perf/vfe_equ.c +++ b/drivers/gpu/nvgpu/perf/vfe_equ.c @@ -11,13 +11,13 @@ * more details. */ +#include + #include "gk20a/gk20a.h" #include "perf.h" #include "vfe_equ.h" -#include "include/bios.h" #include "boardobj/boardobjgrp.h" #include "boardobj/boardobjgrp_e255.h" -#include "gm206/bios_gm206.h" #include "ctrl/ctrlclk.h" #include "ctrl/ctrlvolt.h" #include "gk20a/pmu_gk20a.h" @@ -147,10 +147,7 @@ static u32 devinit_get_vfe_equ_table(struct gk20a *g, gk20a_dbg_info(""); - if (!g->ops.bios.get_perf_table_ptrs) - return -EINVAL; - - vfeequs_tbl_ptr = (u8 *)g->ops.bios.get_perf_table_ptrs(g, + vfeequs_tbl_ptr = (u8 *)nvgpu_bios_get_perf_table_ptrs(g, g->bios.perf_token, CONTINUOUS_VIRTUAL_BINNING_TABLE); 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 @@ * more details. */ +#include + #include "gk20a/gk20a.h" #include "perf.h" #include "vfe_var.h" -#include "include/bios.h" #include "boardobj/boardobjgrp.h" #include "boardobj/boardobjgrp_e32.h" -#include "gm206/bios_gm206.h" #include "ctrl/ctrlclk.h" #include "ctrl/ctrlvolt.h" #include "gk20a/pmu_gk20a.h" @@ -179,17 +179,14 @@ u32 dev_init_get_vfield_info(struct gk20a *g, u8 *psegmentcount = NULL; u32 status = 0; - if (!g->ops.bios.get_perf_table_ptrs) - return -EINVAL; - - vfieldregtableptr = (u8 *)g->ops.bios.get_perf_table_ptrs(g, + vfieldregtableptr = (u8 *)nvgpu_bios_get_perf_table_ptrs(g, g->bios.virt_token, VP_FIELD_REGISTER); if (vfieldregtableptr == NULL) { status = -EINVAL; goto done; } - vfieldtableptr = (u8 *)g->ops.bios.get_perf_table_ptrs(g, + vfieldtableptr = (u8 *)nvgpu_bios_get_perf_table_ptrs(g, g->bios.virt_token, VP_FIELD_TABLE); if (vfieldtableptr == NULL) { status = -EINVAL; @@ -864,12 +861,7 @@ static u32 devinit_get_vfe_var_table(struct gk20a *g, gk20a_dbg_info(""); - if (!g->ops.bios.get_perf_table_ptrs) { - status = -EINVAL; - goto done; - } - - vfevars_tbl_ptr = (u8 *)g->ops.bios.get_perf_table_ptrs(g, + vfevars_tbl_ptr = (u8 *)nvgpu_bios_get_perf_table_ptrs(g, g->bios.perf_token, CONTINUOUS_VIRTUAL_BINNING_TABLE); if (vfevars_tbl_ptr == NULL) { -- cgit v1.2.2