[Nouveau] [PATCH v4 30/33] secboot: write PMU firmware version into register

Alexandre Courbot acourbot at nvidia.com
Mon Nov 21 08:29:27 UTC 2016


The PMU firmware expects its version into this register.

Signed-off-by: Alexandre Courbot <acourbot at nvidia.com>
---
 drm/nouveau/include/nvkm/subdev/pmu.h      | 1 +
 drm/nouveau/nvkm/subdev/pmu/base.c         | 1 +
 drm/nouveau/nvkm/subdev/secboot/acr_r352.c | 3 +++
 3 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drm/nouveau/include/nvkm/subdev/pmu.h b/drm/nouveau/include/nvkm/subdev/pmu.h
index 151003e0500e..71ccb70166d9 100644
--- a/drm/nouveau/include/nvkm/subdev/pmu.h
+++ b/drm/nouveau/include/nvkm/subdev/pmu.h
@@ -7,6 +7,7 @@ struct nvkm_pmu {
 	const struct nvkm_pmu_func *func;
 	const struct nv_pmu_func *nv_func;
 	struct nvkm_subdev subdev;
+	u32 fw_version;
 
 	struct {
 		u32 base;
diff --git a/drm/nouveau/nvkm/subdev/pmu/base.c b/drm/nouveau/nvkm/subdev/pmu/base.c
index 0ca9cafb18c0..517f7942c57e 100644
--- a/drm/nouveau/nvkm/subdev/pmu/base.c
+++ b/drm/nouveau/nvkm/subdev/pmu/base.c
@@ -165,6 +165,7 @@ nvkm_pmu_set_version(struct nvkm_pmu *pmu, u32 version)
 		return -EINVAL;
 	};
 
+	pmu->fw_version = version;
 	nvkm_debug(subdev, "firmware version: 0x%08x\n", version);
 
 	return 0;
diff --git a/drm/nouveau/nvkm/subdev/secboot/acr_r352.c b/drm/nouveau/nvkm/subdev/secboot/acr_r352.c
index bfcfb647f4ad..27b16cb2cfe5 100644
--- a/drm/nouveau/nvkm/subdev/secboot/acr_r352.c
+++ b/drm/nouveau/nvkm/subdev/secboot/acr_r352.c
@@ -770,6 +770,7 @@ acr_r352_bootstrap(struct acr_r352 *acr, struct nvkm_secboot *sb)
 {
 	struct nvkm_subdev *subdev = &sb->subdev;
 	struct nvkm_device *device = subdev->device;
+	struct nvkm_pmu *pmu = device->pmu;
 	unsigned long managed_falcons = acr->base.managed_falcons;
 	int falcon_id;
 	int ret;
@@ -804,6 +805,8 @@ acr_r352_bootstrap(struct acr_r352 *acr, struct nvkm_secboot *sb)
 	if (!nvkm_secboot_is_managed(sb, acr->base.boot_falcon))
 		return 0;
 
+	nvkm_wr32(device, sb->base + 0x080, pmu->fw_version);
+
 	/* Enable interrupts */
 	nvkm_wr32(device, sb->base + 0x10, 0xff);
 	nvkm_mc_intr_mask(device, sb->devidx, true);
-- 
git-series 0.8.10


More information about the Nouveau mailing list