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/therm/thrmchannel.c | 8 +++----- drivers/gpu/nvgpu/therm/thrmdev.c | 8 +++----- drivers/gpu/nvgpu/therm/thrmpmu.c | 1 - 3 files changed, 6 insertions(+), 11 deletions(-) (limited to 'drivers/gpu/nvgpu/therm') diff --git a/drivers/gpu/nvgpu/therm/thrmchannel.c b/drivers/gpu/nvgpu/therm/thrmchannel.c index f253a196..a09a4599 100644 --- a/drivers/gpu/nvgpu/therm/thrmchannel.c +++ b/drivers/gpu/nvgpu/therm/thrmchannel.c @@ -11,9 +11,10 @@ * more details. */ +#include + #include "gk20a/gk20a.h" #include "thrmchannel.h" -#include "include/bios.h" #include "boardobj/boardobjgrp.h" #include "boardobj/boardobjgrp_e32.h" #include @@ -130,10 +131,7 @@ static u32 devinit_get_therm_channel_table(struct gk20a *g, gk20a_dbg_info(""); - if (!g->ops.bios.get_perf_table_ptrs) - return -EINVAL; - - therm_channel_table_ptr = (u8 *)g->ops.bios.get_perf_table_ptrs(g, + therm_channel_table_ptr = (u8 *)nvgpu_bios_get_perf_table_ptrs(g, g->bios.perf_token, THERMAL_CHANNEL_TABLE); if (therm_channel_table_ptr == NULL) { status = -EINVAL; diff --git a/drivers/gpu/nvgpu/therm/thrmdev.c b/drivers/gpu/nvgpu/therm/thrmdev.c index 3ff199e7..199343e0 100644 --- a/drivers/gpu/nvgpu/therm/thrmdev.c +++ b/drivers/gpu/nvgpu/therm/thrmdev.c @@ -11,9 +11,10 @@ * more details. */ +#include + #include "gk20a/gk20a.h" #include "thrmdev.h" -#include "include/bios.h" #include "boardobj/boardobjgrp.h" #include "boardobj/boardobjgrp_e32.h" #include @@ -80,10 +81,7 @@ static u32 devinit_get_therm_device_table(struct gk20a *g, gk20a_dbg_info(""); - if (!g->ops.bios.get_perf_table_ptrs) - return -EINVAL; - - therm_device_table_ptr = (u8 *)g->ops.bios.get_perf_table_ptrs(g, + therm_device_table_ptr = (u8 *)nvgpu_bios_get_perf_table_ptrs(g, g->bios.perf_token, THERMAL_DEVICE_TABLE); if (therm_device_table_ptr == NULL) { status = -EINVAL; diff --git a/drivers/gpu/nvgpu/therm/thrmpmu.c b/drivers/gpu/nvgpu/therm/thrmpmu.c index a06d3b92..50df55c0 100644 --- a/drivers/gpu/nvgpu/therm/thrmpmu.c +++ b/drivers/gpu/nvgpu/therm/thrmpmu.c @@ -12,7 +12,6 @@ */ #include "gk20a/gk20a.h" -#include "include/bios.h" #include "boardobj/boardobjgrp.h" #include "boardobj/boardobjgrp_e32.h" #include "thrmpmu.h" -- cgit v1.2.2