drm/nouveau/secboot: add lazy-bootstrap flag
authorAlexandre Courbot <acourbot@nvidia.com>
Wed, 14 Dec 2016 08:02:50 +0000 (17:02 +0900)
committerBen Skeggs <bskeggs@redhat.com>
Fri, 17 Feb 2017 05:14:32 +0000 (15:14 +1000)
When the PMU firmware is present, the falcons it manages need to have
the lazy-bootstrap flag of their WPR header set so the ACR does not boot
them. Add support for this.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nvkm/subdev/secboot/acr_r352.c
drivers/gpu/drm/nouveau/nvkm/subdev/secboot/acr_r352.h

index d4f04239b124754ede076fc512ad7a523e396242..421cf78d2aa5927f437a84c49dc6170ea4cba3e0 100644 (file)
@@ -241,6 +241,10 @@ acr_r352_ls_img_fill_headers(struct acr_r352 *acr,
        whdr->bootstrap_owner = acr->base.boot_falcon;
        whdr->status = LSF_IMAGE_STATUS_COPY;
 
+       /* Skip bootstrapping falcons started by someone else than ACR */
+       if (acr->lazy_bootstrap & BIT(_img->falcon_id))
+               whdr->lazy_bootstrap = 1;
+
        /* Align, save off, and include an LSB header size */
        offset = ALIGN(offset, LSF_LSB_HEADER_ALIGN);
        whdr->lsb_offset = offset;
index f335dced1e61a8405924b44a8e049b247275265c..ad5923b0fd3ced6500b2a4a81c323192df5492a9 100644 (file)
@@ -223,6 +223,9 @@ struct acr_r352 {
        /* Firmware already loaded? */
        bool firmware_ok;
 
+       /* Falcons to lazy-bootstrap */
+       u32 lazy_bootstrap;
+
        /* To keep track of the state of all managed falcons */
        enum {
                /* In non-secure state, no firmware loaded, no privileges*/