Commit 1e2115d8 authored by Alexandre Courbot's avatar Alexandre Courbot Committed by Ben Skeggs

drm/nouveau/pmu: instanciate the falcon in PMU device

Have an instance of nvkm_falcon in the PMU structure, ready to be used
by other subdevs (i.e. secboot).
Signed-off-by: default avatarAlexandre Courbot <acourbot@nvidia.com>
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent e72da6e0
#ifndef __NVKM_PMU_H__ #ifndef __NVKM_PMU_H__
#define __NVKM_PMU_H__ #define __NVKM_PMU_H__
#include <core/subdev.h> #include <core/subdev.h>
#include <engine/falcon.h>
struct nvkm_pmu { struct nvkm_pmu {
const struct nvkm_pmu_func *func; const struct nvkm_pmu_func *func;
struct nvkm_subdev subdev; struct nvkm_subdev subdev;
struct nvkm_falcon *falcon;
struct { struct {
u32 base; u32 base;
......
...@@ -116,6 +116,8 @@ nvkm_pmu_init(struct nvkm_subdev *subdev) ...@@ -116,6 +116,8 @@ nvkm_pmu_init(struct nvkm_subdev *subdev)
static void * static void *
nvkm_pmu_dtor(struct nvkm_subdev *subdev) nvkm_pmu_dtor(struct nvkm_subdev *subdev)
{ {
struct nvkm_pmu *pmu = nvkm_pmu(subdev);
nvkm_falcon_del(&pmu->falcon);
return nvkm_pmu(subdev); return nvkm_pmu(subdev);
} }
...@@ -136,7 +138,7 @@ nvkm_pmu_ctor(const struct nvkm_pmu_func *func, struct nvkm_device *device, ...@@ -136,7 +138,7 @@ nvkm_pmu_ctor(const struct nvkm_pmu_func *func, struct nvkm_device *device,
pmu->func = func; pmu->func = func;
INIT_WORK(&pmu->recv.work, nvkm_pmu_recv); INIT_WORK(&pmu->recv.work, nvkm_pmu_recv);
init_waitqueue_head(&pmu->recv.wait); init_waitqueue_head(&pmu->recv.wait);
return 0; return nvkm_falcon_v1_new(&pmu->subdev, "PMU", 0x10a000, &pmu->falcon);
} }
int int
......
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