Commit 48387f0c authored by Alexandre Courbot's avatar Alexandre Courbot Committed by Ben Skeggs

drm/nouveau/secboot: support running ACR on SEC

Add support for running the ACR binary on the SEC falcon.
Signed-off-by: default avatarAlexandre Courbot <acourbot@nvidia.com>
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent c3433603
...@@ -30,7 +30,8 @@ enum nvkm_secboot_falcon { ...@@ -30,7 +30,8 @@ enum nvkm_secboot_falcon {
NVKM_SECBOOT_FALCON_RESERVED = 1, NVKM_SECBOOT_FALCON_RESERVED = 1,
NVKM_SECBOOT_FALCON_FECS = 2, NVKM_SECBOOT_FALCON_FECS = 2,
NVKM_SECBOOT_FALCON_GPCCS = 3, NVKM_SECBOOT_FALCON_GPCCS = 3,
NVKM_SECBOOT_FALCON_END = 4, NVKM_SECBOOT_FALCON_SEC2 = 7,
NVKM_SECBOOT_FALCON_END = 8,
NVKM_SECBOOT_FALCON_INVALID = 0xffffffff, NVKM_SECBOOT_FALCON_INVALID = 0xffffffff,
}; };
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include <subdev/mc.h> #include <subdev/mc.h>
#include <subdev/pmu.h> #include <subdev/pmu.h>
#include <core/msgqueue.h> #include <core/msgqueue.h>
#include <engine/sec2.h>
/** /**
* struct hsf_fw_header - HS firmware descriptor * struct hsf_fw_header - HS firmware descriptor
...@@ -1017,7 +1018,7 @@ acr_r352_reset(struct nvkm_acr *_acr, struct nvkm_secboot *sb, ...@@ -1017,7 +1018,7 @@ acr_r352_reset(struct nvkm_acr *_acr, struct nvkm_secboot *sb,
enum nvkm_secboot_falcon falcon) enum nvkm_secboot_falcon falcon)
{ {
struct acr_r352 *acr = acr_r352(_acr); struct acr_r352 *acr = acr_r352(_acr);
struct nvkm_pmu *pmu = sb->subdev.device->pmu; struct nvkm_msgqueue *queue;
const char *fname = nvkm_secboot_falcon_name[falcon]; const char *fname = nvkm_secboot_falcon_name[falcon];
bool wpr_already_set = sb->wpr_set; bool wpr_already_set = sb->wpr_set;
int ret; int ret;
...@@ -1037,9 +1038,20 @@ acr_r352_reset(struct nvkm_acr *_acr, struct nvkm_secboot *sb, ...@@ -1037,9 +1038,20 @@ acr_r352_reset(struct nvkm_acr *_acr, struct nvkm_secboot *sb,
return ret; return ret;
} }
/* Otherwise just ask the PMU to reset the falcon */ switch (_acr->boot_falcon) {
case NVKM_SECBOOT_FALCON_PMU:
queue = sb->subdev.device->pmu->queue;
break;
case NVKM_SECBOOT_FALCON_SEC2:
queue = sb->subdev.device->sec2->queue;
break;
default:
return -EINVAL;
}
/* Otherwise just ask the LS firmware to reset the falcon */
nvkm_debug(&sb->subdev, "resetting %s falcon\n", fname); nvkm_debug(&sb->subdev, "resetting %s falcon\n", fname);
ret = nvkm_msgqueue_acr_boot_falcon(pmu->queue, falcon); ret = nvkm_msgqueue_acr_boot_falcon(queue, falcon);
if (ret) { if (ret) {
nvkm_error(&sb->subdev, "cannot boot %s falcon\n", fname); nvkm_error(&sb->subdev, "cannot boot %s falcon\n", fname);
return ret; return ret;
......
...@@ -87,6 +87,7 @@ ...@@ -87,6 +87,7 @@
#include <subdev/mc.h> #include <subdev/mc.h>
#include <subdev/timer.h> #include <subdev/timer.h>
#include <subdev/pmu.h> #include <subdev/pmu.h>
#include <engine/sec2.h>
const char * const char *
nvkm_secboot_falcon_name[] = { nvkm_secboot_falcon_name[] = {
...@@ -94,6 +95,7 @@ nvkm_secboot_falcon_name[] = { ...@@ -94,6 +95,7 @@ nvkm_secboot_falcon_name[] = {
[NVKM_SECBOOT_FALCON_RESERVED] = "<reserved>", [NVKM_SECBOOT_FALCON_RESERVED] = "<reserved>",
[NVKM_SECBOOT_FALCON_FECS] = "FECS", [NVKM_SECBOOT_FALCON_FECS] = "FECS",
[NVKM_SECBOOT_FALCON_GPCCS] = "GPCCS", [NVKM_SECBOOT_FALCON_GPCCS] = "GPCCS",
[NVKM_SECBOOT_FALCON_SEC2] = "SEC2",
[NVKM_SECBOOT_FALCON_END] = "<invalid>", [NVKM_SECBOOT_FALCON_END] = "<invalid>",
}; };
/** /**
...@@ -133,11 +135,17 @@ nvkm_secboot_oneinit(struct nvkm_subdev *subdev) ...@@ -133,11 +135,17 @@ nvkm_secboot_oneinit(struct nvkm_subdev *subdev)
case NVKM_SECBOOT_FALCON_PMU: case NVKM_SECBOOT_FALCON_PMU:
sb->boot_falcon = subdev->device->pmu->falcon; sb->boot_falcon = subdev->device->pmu->falcon;
break; break;
case NVKM_SECBOOT_FALCON_SEC2:
/* we must keep SEC2 alive forever since ACR will run on it */
nvkm_engine_ref(&subdev->device->sec2->engine);
sb->boot_falcon = subdev->device->sec2->falcon;
break;
default: default:
nvkm_error(subdev, "Unmanaged boot falcon %s!\n", nvkm_error(subdev, "Unmanaged boot falcon %s!\n",
nvkm_secboot_falcon_name[sb->acr->boot_falcon]); nvkm_secboot_falcon_name[sb->acr->boot_falcon]);
return -EINVAL; return -EINVAL;
} }
nvkm_debug(subdev, "using %s falcon for ACR\n", sb->boot_falcon->name);
/* Call chip-specific init function */ /* Call chip-specific init function */
if (sb->func->oneinit) if (sb->func->oneinit)
......
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