Skip to contentSkip to conversation

secboot: don't use hardcoded mask to enable falcon

PATCH New Alexandre Courbot 1 participant 2 messages Mar 9, 2016 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 secboot: don't use hardcoded mask to enable falcon

The IRQ mask of the PMU falcon was left - replace it with the proper irq_mask variable.

---
 drm/nouveau/nvkm/subdev/secboot/base.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drm/nouveau/nvkm/subdev/secboot/base.c +2 -2
index b718ba79177c..05c62549c39b 100644
@@ -85,8 +85,8 @@ nvkm_secboot_falcon_enable(struct nvkm_secboot *sb)
 
 	/* enable IRQs */
 	nvkm_wr32(device, sb->base + 0x010, 0xff);
-	nvkm_mask(device, 0x640, sb->irq_mask, 0x1000000);
-	nvkm_mask(device, 0x644, sb->irq_mask, 0x1000000);
+	nvkm_mask(device, 0x640, sb->irq_mask, sb->irq_mask);
+	nvkm_mask(device, 0x644, sb->irq_mask, sb->irq_mask);
 
 	return 0;
 }
Signature · 6 lines
2.7.2

_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau

A message that is not in the archive (sent off-list or not yet received): 1457523022-3947-1-git-send-email-acourbot-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org

#2 lore raw

PATCH 2/2 secboot: fix falcon reset

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.

---
 drm/nouveau/nvkm/subdev/secboot/base.c | 22 +++++++---------------
 1 file changed, 7 insertions(+), 15 deletions(-)
drm/nouveau/nvkm/subdev/secboot/base.c +7 -15
index 05c62549c39b..520facf9bc07 100644
@@ -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;
 }
Signature · 6 lines
2.7.2

_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau