From fbeca4a8414c03a1564d7a370964187be51a3e6c Mon Sep 17 00:00:00 2001 From: Mahantesh Kumbar Date: Wed, 28 Jun 2017 16:53:41 +0530 Subject: gpu: nvgpu: Falcon controller wait for halt - Added nvgpu_flcn_wait_for_halt() interface to wait for falcon halt, which block till falcon halt or timeout expire for selected falcon controller - Replaced falcon wait for halt code with method nvgpu_flcn_wait_for_halt() NVGPU JIRA-99 Change-Id: Ie1809dc29ff65bddc7ef2859a9ee9b4f0003b127 Signed-off-by: Mahantesh Kumbar Reviewed-on: https://git-master/r/1510201 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Terje Bergstrom GVS: Gerrit_Virtual_Submit Reviewed-by: Vijayakumar Subbu --- drivers/gpu/nvgpu/gm206/bios_gm206.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'drivers/gpu/nvgpu/gm206/bios_gm206.c') diff --git a/drivers/gpu/nvgpu/gm206/bios_gm206.c b/drivers/gpu/nvgpu/gm206/bios_gm206.c index 216fd594..7aec21e7 100644 --- a/drivers/gpu/nvgpu/gm206/bios_gm206.c +++ b/drivers/gpu/nvgpu/gm206/bios_gm206.c @@ -166,8 +166,6 @@ out: static int gm206_bios_preos(struct gk20a *g) { int err = 0; - int val; - struct nvgpu_timeout timeout; gk20a_dbg_fn(""); @@ -196,17 +194,8 @@ static int gm206_bios_preos(struct gk20a *g) gk20a_writel(g, pwr_falcon_cpuctl_r(), pwr_falcon_cpuctl_startcpu_f(1)); - nvgpu_timeout_init(g, &timeout, - PMU_BOOT_TIMEOUT_MAX / - PMU_BOOT_TIMEOUT_DEFAULT, - NVGPU_TIMER_CPU_TIMER); - do { - val = pwr_falcon_cpuctl_halt_intr_v( - gk20a_readl(g, pwr_falcon_cpuctl_r())); - nvgpu_udelay(PMU_BOOT_TIMEOUT_DEFAULT); - } while (!val && !nvgpu_timeout_expired(&timeout)); - - if (nvgpu_timeout_peek_expired(&timeout)) { + if (nvgpu_flcn_wait_for_halt(g->pmu.flcn, + PMU_BOOT_TIMEOUT_MAX / PMU_BOOT_TIMEOUT_DEFAULT)) { err = -ETIMEDOUT; goto out; } -- cgit v1.2.2