priv.h 1.3 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 9
int nvkm_pmu_ctor(const struct nvkm_pmu_func *, struct nvkm_device *,
		  int index, struct nvkm_pmu *);
10 11
int nvkm_pmu_new_(const struct nvkm_pmu_func *, struct nvkm_device *,
		  int index, struct nvkm_pmu **);
12

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

19 20 21 22 23
	struct {
		u32 *data;
		u32  size;
	} data;

24
	bool (*enabled)(struct nvkm_pmu *);
25 26 27 28 29 30 31
	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 *);
32
	void (*pgob)(struct nvkm_pmu *, bool);
33
};
34

35 36 37 38 39 40
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);

41
bool gf100_pmu_enabled(struct nvkm_pmu *);
B
Ben Skeggs 已提交
42 43
void gf100_pmu_reset(struct nvkm_pmu *);

44
void gk110_pmu_pgob(struct nvkm_pmu *, bool);
45 46

void gm20b_pmu_recv(struct nvkm_pmu *);
47
#endif