[2/2] secboot: fix falcon reset

Submitted by Alexandre Courbot on March 9, 2016, 11:30 a.m.

Details

Message ID 1457523022-3947-2-git-send-email-acourbot@nvidia.com
State New
Headers show
Series "Series without cover letter" ( rev: 1 ) in Nouveau

Not browsing as part of any series.

Commit Message

Alexandre Courbot March 9, 2016, 11:30 a.m.
The falcon reset procedure expecting a falcon in an initialized state,
which was accidentally provided by the PMU subdev. Make sure that
secboot can manage the falcon on its own.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
---
 drm/nouveau/nvkm/subdev/secboot/base.c | 22 +++++++---------------
 1 file changed, 7 insertions(+), 15 deletions(-)

Patch hide | download patch | download mbox

diff --git a/drm/nouveau/nvkm/subdev/secboot/base.c b/drm/nouveau/nvkm/subdev/secboot/base.c
index 05c62549c39b..520facf9bc07 100644
--- a/drm/nouveau/nvkm/subdev/secboot/base.c
+++ b/drm/nouveau/nvkm/subdev/secboot/base.c
@@ -95,24 +95,16 @@  static int
 nvkm_secboot_falcon_disable(struct nvkm_secboot *sb)
 {
 	struct nvkm_device *device = sb->subdev.device;
-	int ret;
 
-	ret = falcon_clear_halt_interrupt(device, sb->base);
-	if (ret)
-		return ret;
+	/* disable IRQs and wait for any previous code to complete */
+	nvkm_mask(device, 0x644, sb->irq_mask, 0x0);
+	nvkm_mask(device, 0x640, sb->irq_mask, 0x0);
+	nvkm_wr32(device, sb->base + 0x014, 0xff);
 
-	ret = falcon_wait_idle(device, sb->base);
-	if (ret)
-		return ret;
+	falcon_wait_idle(device, sb->base);
 
-	if ((nvkm_rd32(device, 0x200) & sb->enable_mask) != 0) {
-		/* disable IRQs */
-		nvkm_mask(device, 0x644, sb->irq_mask, 0x0);
-		nvkm_mask(device, 0x640, sb->irq_mask, 0x0);
-		nvkm_wr32(device, sb->base + 0x014, 0xff);
-		/* disable engine */
-		nvkm_mask(device, 0x200, sb->enable_mask, 0x0);
-	}
+	/* disable engine */
+	nvkm_mask(device, 0x200, sb->enable_mask, 0x0);
 
 	return 0;
 }