[Nouveau] [PATCH v2 4/15] pmu: instanciate the falcon in PMU device

Alexandre Courbot acourbot at nvidia.com
Tue Dec 13 08:11:20 UTC 2016


Have an instance of nvkm_falcon in the PMU structure, ready to be used
by other subdevs (i.e. secboot).

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

diff --git a/drm/nouveau/include/nvkm/subdev/pmu.h b/drm/nouveau/include/nvkm/subdev/pmu.h
index f37538eb1fe5..342f9a2f32ef 100644
--- a/drm/nouveau/include/nvkm/subdev/pmu.h
+++ b/drm/nouveau/include/nvkm/subdev/pmu.h
@@ -1,10 +1,12 @@
 #ifndef __NVKM_PMU_H__
 #define __NVKM_PMU_H__
 #include <core/subdev.h>
+#include <engine/falcon.h>
 
 struct nvkm_pmu {
 	const struct nvkm_pmu_func *func;
 	struct nvkm_subdev subdev;
+	struct nvkm_falcon falcon;
 
 	struct {
 		u32 base;
diff --git a/drm/nouveau/nvkm/subdev/pmu/base.c b/drm/nouveau/nvkm/subdev/pmu/base.c
index e611ce80f8ef..1e645eec1951 100644
--- a/drm/nouveau/nvkm/subdev/pmu/base.c
+++ b/drm/nouveau/nvkm/subdev/pmu/base.c
@@ -139,5 +139,9 @@ nvkm_pmu_new_(const struct nvkm_pmu_func *func, struct nvkm_device *device,
 	pmu->func = func;
 	INIT_WORK(&pmu->recv.work, nvkm_pmu_recv);
 	init_waitqueue_head(&pmu->recv.wait);
+
+	nvkm_falcon_ctor(&pmu->subdev, &nvkm_falcon_v1_func, "PMU", 0x10a000,
+			 &pmu->falcon);
+
 	return 0;
 }
-- 
git-series 0.8.10


More information about the Nouveau mailing list