drm/nouveau/secboot: use nvkm_mc_enable/disable()
authorBen Skeggs <bskeggs@redhat.com>
Sun, 29 May 2016 22:57:55 +0000 (08:57 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Thu, 14 Jul 2016 01:53:25 +0000 (11:53 +1000)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/include/nvkm/subdev/secboot.h
drivers/gpu/drm/nouveau/nvkm/subdev/secboot/base.c

index fe8e9e04ec81972e111acb9acd52213e94ec4514..b04c38c07761e60554396cae8e51f9114058f86e 100644 (file)
@@ -45,7 +45,6 @@ struct nvkm_secboot {
 
        enum nvkm_devidx devidx;
        u32 base;
-       u32 enable_mask;
 };
 #define nvkm_secboot(p) container_of((p), struct nvkm_secboot, subdev)
 
index 7d72a8143bbd0212ebfbc7e53bb7a11d27c6b335..57c6a58d1141809e425ea8a8db9a28b86d37ef00 100644 (file)
@@ -71,12 +71,11 @@ nvkm_secboot_falcon_enable(struct nvkm_secboot *sb)
        int ret;
 
        /* enable engine */
-       nvkm_mask(device, 0x200, sb->enable_mask, sb->enable_mask);
-       nvkm_rd32(device, 0x200);
+       nvkm_mc_enable(device, sb->devidx);
        ret = nvkm_wait_msec(device, 10, sb->base + 0x10c, 0x6, 0x0);
        if (ret < 0) {
-               nvkm_mask(device, 0x200, sb->enable_mask, 0x0);
                nvkm_error(&sb->subdev, "Falcon mem scrubbing timeout\n");
+               nvkm_mc_disable(device, sb->devidx);
                return ret;
        }
 
@@ -103,7 +102,7 @@ nvkm_secboot_falcon_disable(struct nvkm_secboot *sb)
        falcon_wait_idle(device, sb->base);
 
        /* disable engine */
-       nvkm_mask(device, 0x200, sb->enable_mask, 0x0);
+       nvkm_mc_disable(device, sb->devidx);
 
        return 0;
 }
@@ -271,7 +270,6 @@ nvkm_secboot_ctor(const struct nvkm_secboot_func *func,
        case NVKM_SECBOOT_FALCON_PMU:
                sb->devidx = NVKM_SUBDEV_PMU;
                sb->base = 0x10a000;
-               sb->enable_mask = 0x2000;
                break;
        default:
                nvkm_error(&sb->subdev, "invalid secure boot falcon\n");