Commit 920c58a7 authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/devinit/gm200: replace while loops with PTIMER-based timeout loops

It appears to be safe to access PTIMER on an unposted board with newer
chipsets.
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent d91ccec6
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <subdev/bios.h> #include <subdev/bios.h>
#include <subdev/bios/bit.h> #include <subdev/bios/bit.h>
#include <subdev/bios/pmu.h> #include <subdev/bios/pmu.h>
#include <subdev/timer.h>
static void static void
pmu_code(struct nv50_devinit *init, u32 pmu, u32 img, u32 len, bool sec) pmu_code(struct nv50_devinit *init, u32 pmu, u32 img, u32 len, bool sec)
...@@ -128,8 +129,11 @@ gm200_devinit_post(struct nvkm_devinit *base, bool post) ...@@ -128,8 +129,11 @@ gm200_devinit_post(struct nvkm_devinit *base, bool post)
nvkm_mask(device, 0x000200, 0x00002000, 0x00000000); nvkm_mask(device, 0x000200, 0x00002000, 0x00000000);
nvkm_mask(device, 0x000200, 0x00002000, 0x00002000); nvkm_mask(device, 0x000200, 0x00002000, 0x00002000);
nvkm_rd32(device, 0x000200); nvkm_rd32(device, 0x000200);
while (nvkm_rd32(device, 0x10a10c) & 0x00000006) { if (nvkm_msec(device, 2000,
} if (!(nvkm_rd32(device, 0x10a10c) & 0x00000006))
break;
) < 0)
return -ETIMEDOUT;
} }
ret = pmu_load(init, 0x04, post, &exec, &args); ret = pmu_load(init, 0x04, post, &exec, &args);
...@@ -156,8 +160,11 @@ gm200_devinit_post(struct nvkm_devinit *base, bool post) ...@@ -156,8 +160,11 @@ gm200_devinit_post(struct nvkm_devinit *base, bool post)
if (post) { if (post) {
nvkm_wr32(device, 0x10a040, 0x00005000); nvkm_wr32(device, 0x10a040, 0x00005000);
pmu_exec(init, exec); pmu_exec(init, exec);
while (!(nvkm_rd32(device, 0x10a040) & 0x00002000)) { if (nvkm_msec(device, 2000,
} if (nvkm_rd32(device, 0x10a040) & 0x00002000)
break;
) < 0)
return -ETIMEDOUT;
} }
/* load and execute some other ucode image (bios therm?) */ /* load and execute some other ucode image (bios therm?) */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment