diff options
author | Mahantesh Kumbar <mkumbar@nvidia.com> | 2017-06-28 07:23:41 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-07-04 02:44:30 -0400 |
commit | fbeca4a8414c03a1564d7a370964187be51a3e6c (patch) | |
tree | 4ba412c53e52678b9e115fd1ec80655bd2380f46 /drivers/gpu/nvgpu/gm206 | |
parent | 2f712e22303471b8dd2f9388c874d12b07aed258 (diff) |
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 <mkumbar@nvidia.com>
Reviewed-on: https://git-master/r/1510201
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gm206')
-rw-r--r-- | drivers/gpu/nvgpu/gm206/bios_gm206.c | 15 |
1 files changed, 2 insertions, 13 deletions
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: | |||
166 | static int gm206_bios_preos(struct gk20a *g) | 166 | static int gm206_bios_preos(struct gk20a *g) |
167 | { | 167 | { |
168 | int err = 0; | 168 | int err = 0; |
169 | int val; | ||
170 | struct nvgpu_timeout timeout; | ||
171 | 169 | ||
172 | gk20a_dbg_fn(""); | 170 | gk20a_dbg_fn(""); |
173 | 171 | ||
@@ -196,17 +194,8 @@ static int gm206_bios_preos(struct gk20a *g) | |||
196 | gk20a_writel(g, pwr_falcon_cpuctl_r(), | 194 | gk20a_writel(g, pwr_falcon_cpuctl_r(), |
197 | pwr_falcon_cpuctl_startcpu_f(1)); | 195 | pwr_falcon_cpuctl_startcpu_f(1)); |
198 | 196 | ||
199 | nvgpu_timeout_init(g, &timeout, | 197 | if (nvgpu_flcn_wait_for_halt(g->pmu.flcn, |
200 | PMU_BOOT_TIMEOUT_MAX / | 198 | PMU_BOOT_TIMEOUT_MAX / PMU_BOOT_TIMEOUT_DEFAULT)) { |
201 | PMU_BOOT_TIMEOUT_DEFAULT, | ||
202 | NVGPU_TIMER_CPU_TIMER); | ||
203 | do { | ||
204 | val = pwr_falcon_cpuctl_halt_intr_v( | ||
205 | gk20a_readl(g, pwr_falcon_cpuctl_r())); | ||
206 | nvgpu_udelay(PMU_BOOT_TIMEOUT_DEFAULT); | ||
207 | } while (!val && !nvgpu_timeout_expired(&timeout)); | ||
208 | |||
209 | if (nvgpu_timeout_peek_expired(&timeout)) { | ||
210 | err = -ETIMEDOUT; | 199 | err = -ETIMEDOUT; |
211 | goto out; | 200 | goto out; |
212 | } | 201 | } |