From af9e70f4d17638d5131e558730d8783255b4779e Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Mon, 21 Aug 2017 09:35:16 -0700 Subject: gpu: nvgpu: Copy vbios_min_version to struct gk20a Accessing vbios_min_version in gk20a_platform creates an extra dependency to Linux. Copy it to struct gk20a at driver initialization. Change-Id: I9ff5dbeb1fecc6dc44a62f7affc24fd52c2bab26 Signed-off-by: Terje Bergstrom Reviewed-on: https://git-master.nvidia.com/r/1542837 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/linux/driver_common.c | 1 + drivers/gpu/nvgpu/gk20a/gk20a.h | 3 +++ drivers/gpu/nvgpu/gm206/bios_gm206.c | 5 +---- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/nvgpu/common/linux/driver_common.c b/drivers/gpu/nvgpu/common/linux/driver_common.c index bf372859..d1905c86 100644 --- a/drivers/gpu/nvgpu/common/linux/driver_common.c +++ b/drivers/gpu/nvgpu/common/linux/driver_common.c @@ -139,6 +139,7 @@ static void nvgpu_init_vbios_vars(struct gk20a *g) struct gk20a_platform *platform = dev_get_drvdata(dev_from_gk20a(g)); __nvgpu_set_enabled(g, NVGPU_PMU_RUN_PREOS, platform->run_preos); + g->vbios_min_version = platform->vbios_min_version; } static void nvgpu_init_mm_vars(struct gk20a *g) diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index ab2d0b7f..8f097cac 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h @@ -1259,6 +1259,9 @@ struct gk20a { * from monitoring power, current and voltage */ bool power_sensor_missing; + /* The minimum VBIOS version supported */ + u32 vbios_min_version; + /* memory training sequence and mclk switch scripts */ u32 mem_config_idx; diff --git a/drivers/gpu/nvgpu/gm206/bios_gm206.c b/drivers/gpu/nvgpu/gm206/bios_gm206.c index 381b3840..7be77ad3 100644 --- a/drivers/gpu/nvgpu/gm206/bios_gm206.c +++ b/drivers/gpu/nvgpu/gm206/bios_gm206.c @@ -22,7 +22,6 @@ #include #include "gk20a/gk20a.h" -#include "gk20a/platform_gk20a.h" #include "gm20b/fifo_gm20b.h" #include "bios_gm206.h" #include "gp106/mclk_gp106.h" @@ -171,7 +170,6 @@ out: int gm206_bios_init(struct gk20a *g) { unsigned int i; - struct gk20a_platform *platform = dev_get_drvdata(dev_from_gk20a(g)); #ifdef CONFIG_DEBUG_FS struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g); struct dentry *d; @@ -223,8 +221,7 @@ int gm206_bios_init(struct gk20a *g) if (err) return err; - if (g->gpu_characteristics.vbios_version < - platform->vbios_min_version) { + if (g->gpu_characteristics.vbios_version < g->vbios_min_version) { nvgpu_err(g, "unsupported VBIOS version %08x", g->gpu_characteristics.vbios_version); return -EINVAL; -- cgit v1.2.2