From 794f6837d64de76fe2c31afe3461904f02bf4a32 Mon Sep 17 00:00:00 2001 From: Vinod G Date: Tue, 4 Dec 2018 16:09:58 -0800 Subject: [PATCH] gpu: nvgpu: Add hal for bios_init in TU104 Add hal function for bios_init in TU104. dGpu vdk doesnot have bios support. JIRA NVGPU-1564 Change-Id: I172de6eeeaf63e9b26ae697405baa936096fe447 Signed-off-by: Vinod G Reviewed-on: https://git-master.nvidia.com/r/1965595 Reviewed-by: svc-misra-checker Reviewed-by: svc-mobile-coverity GVS: Gerrit_Virtual_Submit Reviewed-by: Seshendra Gadagottu Reviewed-by: Terje Bergstrom Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/tu104/bios_tu104.c | 10 ++++++++++ drivers/gpu/nvgpu/tu104/bios_tu104.h | 1 + drivers/gpu/nvgpu/tu104/hal_tu104.c | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/nvgpu/tu104/bios_tu104.c b/drivers/gpu/nvgpu/tu104/bios_tu104.c index fa18b47b8..830520ab6 100644 --- a/drivers/gpu/nvgpu/tu104/bios_tu104.c +++ b/drivers/gpu/nvgpu/tu104/bios_tu104.c @@ -26,6 +26,7 @@ #include #include "tu104/bios_tu104.h" +#include "gp106/bios_gp106.h" #include "nvgpu/hw/tu104/hw_gc6_tu104.h" @@ -63,3 +64,12 @@ int tu104_bios_verify_devinit(struct gk20a *g) return -ETIMEDOUT; } + +int tu104_bios_init(struct gk20a *g) +{ + if (nvgpu_is_enabled(g, NVGPU_IS_FMODEL)) { + return 0; + } + + return gp106_bios_init(g); +} diff --git a/drivers/gpu/nvgpu/tu104/bios_tu104.h b/drivers/gpu/nvgpu/tu104/bios_tu104.h index b4e29a15a..dd510a420 100644 --- a/drivers/gpu/nvgpu/tu104/bios_tu104.h +++ b/drivers/gpu/nvgpu/tu104/bios_tu104.h @@ -26,5 +26,6 @@ struct gk20a; int tu104_bios_verify_devinit(struct gk20a *g); +int tu104_bios_init(struct gk20a *g); #endif /* NVGPU_BIOS_TU104_H */ diff --git a/drivers/gpu/nvgpu/tu104/hal_tu104.c b/drivers/gpu/nvgpu/tu104/hal_tu104.c index a31064e4e..ae0aad523 100644 --- a/drivers/gpu/nvgpu/tu104/hal_tu104.c +++ b/drivers/gpu/nvgpu/tu104/hal_tu104.c @@ -308,7 +308,7 @@ static int tu104_init_gpu_characteristics(struct gk20a *g) static const struct gpu_ops tu104_ops = { .bios = { - .init = gp106_bios_init, + .init = tu104_bios_init, .preos_wait_for_halt = NULL, .preos_reload_check = NULL, .devinit = NULL,