From 7c5cf70268ca038f85686fbdec29729d1a9024c1 Mon Sep 17 00:00:00 2001 From: David Nieto Date: Tue, 8 Aug 2017 12:50:55 -0700 Subject: gpu: nvgpu: add support for pre-os FW Pre-os firmware takes care, among others, of the control of FAN till the driver takes over its control. On some GPUs not enabling this FW can lead tp physical board damage, hence it is needed to run this firmware. JIRA: NVGPUGV100-9 Change-Id: I18d54cfd5eb64ecec79c5dae67ac8d5bb1facf36 Signed-off-by: David Nieto Reviewed-on: https://git-master.nvidia.com/r/1549035 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: svc-mobile-coverity Reviewed-by: svccoveritychecker Reviewed-by: Vijayakumar Subbu Reviewed-by: Konsta Holtta GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gp106/bios_gp106.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'drivers/gpu/nvgpu/gp106/bios_gp106.c') diff --git a/drivers/gpu/nvgpu/gp106/bios_gp106.c b/drivers/gpu/nvgpu/gp106/bios_gp106.c index b7e031c6..3178ae53 100644 --- a/drivers/gpu/nvgpu/gp106/bios_gp106.c +++ b/drivers/gpu/nvgpu/gp106/bios_gp106.c @@ -135,6 +135,16 @@ out: return err; } +int gp106_bios_preos_wait_for_halt(struct gk20a *g) +{ + int err = 0; + + if (nvgpu_flcn_wait_for_halt(g->pmu.flcn, PMU_BOOT_TIMEOUT_MAX / 1000)) + err = -ETIMEDOUT; + + return err; +} + static int gp106_bios_preos(struct gk20a *g) { int err = 0; @@ -146,6 +156,9 @@ static int gp106_bios_preos(struct gk20a *g) goto out; } + if (g->ops.bios.preos_reload_check) + g->ops.bios.preos_reload_check(g); + upload_code(g, g->bios.preos.bootloader_phys_base, g->bios.preos.bootloader, g->bios.preos.bootloader_size, @@ -161,11 +174,7 @@ static int gp106_bios_preos(struct gk20a *g) nvgpu_flcn_bootstrap(g->pmu.flcn, g->bios.preos.code_entry_point); - if (nvgpu_flcn_wait_for_halt(g->pmu.flcn, - PMU_BOOT_TIMEOUT_MAX / 1000)) { - err = -ETIMEDOUT; - goto out; - } + err = g->ops.bios.preos_wait_for_halt(g); nvgpu_flcn_clear_halt_intr_status(g->pmu.flcn, gk20a_get_gr_idle_timeout(g)); -- cgit v1.2.2