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/gm206/bios_gm206.h | 56 ++---------------------------------- 1 file changed, 3 insertions(+), 53 deletions(-) (limited to 'drivers/gpu/nvgpu/gm206/bios_gm206.h') diff --git a/drivers/gpu/nvgpu/gm206/bios_gm206.h b/drivers/gpu/nvgpu/gm206/bios_gm206.h index 6fe19fb0..090c7d24 100644 --- a/drivers/gpu/nvgpu/gm206/bios_gm206.h +++ b/drivers/gpu/nvgpu/gm206/bios_gm206.h @@ -14,60 +14,10 @@ #ifndef NVGPU_BIOS_GM206_H #define NVGPU_BIOS_GM206_H -#define PERF_PTRS_WIDTH 0x4 -#define PERF_PTRS_WIDTH_16 0x2 - -#define NV_PCFG 0x88000 - -enum { - CLOCKS_TABLE = 2, - CLOCK_PROGRAMMING_TABLE, - FLL_TABLE, - VIN_TABLE, - FREQUENCY_CONTROLLER_TABLE -}; - -enum { - PERFORMANCE_TABLE = 0, - MEMORY_CLOCK_TABLE, - MEMORY_TWEAK_TABLE, - POWER_CONTROL_TABLE, - THERMAL_CONTROL_TABLE, - THERMAL_DEVICE_TABLE, - THERMAL_COOLERS_TABLE, - PERFORMANCE_SETTINGS_SCRIPT, - CONTINUOUS_VIRTUAL_BINNING_TABLE, - POWER_SENSORS_TABLE = 0xA, - POWER_CAPPING_TABLE = 0xB, - POWER_TOPOLOGY_TABLE = 0xF, - THERMAL_CHANNEL_TABLE = 0x12, - VOLTAGE_RAIL_TABLE = 26, - VOLTAGE_DEVICE_TABLE, - VOLTAGE_POLICY_TABLE, - LOWPOWER_TABLE, - LOWPOWER_GR_TABLE = 32, - LOWPOWER_MS_TABLE = 33, -}; - -enum { - VP_FIELD_TABLE = 0, - VP_FIELD_REGISTER, - VP_TRANSLATION_TABLE, -}; - -struct bit_token { - u8 token_id; - u8 data_version; - u16 data_size; - u16 data_ptr; -} __packed; - +struct gk20a; struct gpu_ops; -void gm206_init_bios(struct gpu_ops *gops); -u8 gm206_bios_read_u8(struct gk20a *g, u32 offset); -s8 gm206_bios_read_s8(struct gk20a *g, u32 offset); -u16 gm206_bios_read_u16(struct gk20a *g, u32 offset); -u32 gm206_bios_read_u32(struct gk20a *g, u32 offset); +int gm206_bios_init(struct gk20a *g); +void gm206_init_bios_ops(struct gpu_ops *gops); #endif -- cgit v1.2.2