priv.h 1.6 KB
Newer Older
1
/* SPDX-License-Identifier: MIT */
2 3
#ifndef __NVKM_PMU_PRIV_H__
#define __NVKM_PMU_PRIV_H__
4
#define nvkm_pmu(p) container_of((p), struct nvkm_pmu, subdev)
5 6 7
#include <subdev/pmu.h>
#include <subdev/pmu/fuc/os.h>

8
struct nvkm_pmu_func {
9 10 11 12
	struct {
		u32 *data;
		u32  size;
	} code;
13

14 15 16 17 18
	struct {
		u32 *data;
		u32  size;
	} data;

19
	bool (*enabled)(struct nvkm_pmu *);
20 21 22 23 24 25 26
	void (*reset)(struct nvkm_pmu *);
	int (*init)(struct nvkm_pmu *);
	void (*fini)(struct nvkm_pmu *);
	void (*intr)(struct nvkm_pmu *);
	int (*send)(struct nvkm_pmu *, u32 reply[2], u32 process,
		    u32 message, u32 data0, u32 data1);
	void (*recv)(struct nvkm_pmu *);
27
	void (*pgob)(struct nvkm_pmu *, bool);
28
};
29

30 31 32 33 34 35
int gt215_pmu_init(struct nvkm_pmu *);
void gt215_pmu_fini(struct nvkm_pmu *);
void gt215_pmu_intr(struct nvkm_pmu *);
void gt215_pmu_recv(struct nvkm_pmu *);
int gt215_pmu_send(struct nvkm_pmu *, u32[2], u32, u32, u32, u32);

36
bool gf100_pmu_enabled(struct nvkm_pmu *);
B
Ben Skeggs 已提交
37 38
void gf100_pmu_reset(struct nvkm_pmu *);

39
void gk110_pmu_pgob(struct nvkm_pmu *, bool);
40 41

void gm20b_pmu_recv(struct nvkm_pmu *);
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56

struct nvkm_pmu_fwif {
	int version;
	int (*load)(struct nvkm_pmu *, int ver, const struct nvkm_pmu_fwif *);
	const struct nvkm_pmu_func *func;
	const struct nvkm_acr_lsf_func *acr;
};

int gf100_pmu_nofw(struct nvkm_pmu *, int, const struct nvkm_pmu_fwif *);
int gm20b_pmu_load(struct nvkm_pmu *, int, const struct nvkm_pmu_fwif *);

int nvkm_pmu_ctor(const struct nvkm_pmu_fwif *, struct nvkm_device *,
		  int index, struct nvkm_pmu *);
int nvkm_pmu_new_(const struct nvkm_pmu_fwif *, struct nvkm_device *,
		  int index, struct nvkm_pmu **);
57
#endif