1 #ifndef __NVKM_PMU_H__
2 #define __NVKM_PMU_H__
3 #include <core/subdev.h>
4 
5 struct nvkm_pmu {
6 	struct nvkm_subdev base;
7 
8 	struct {
9 		u32 base;
10 		u32 size;
11 	} send;
12 
13 	struct {
14 		u32 base;
15 		u32 size;
16 
17 		struct work_struct work;
18 		wait_queue_head_t wait;
19 		u32 process;
20 		u32 message;
21 		u32 data[2];
22 	} recv;
23 
24 	int  (*message)(struct nvkm_pmu *, u32[2], u32, u32, u32, u32);
25 	void (*pgob)(struct nvkm_pmu *, bool);
26 };
27 
28 static inline struct nvkm_pmu *
29 nvkm_pmu(void *obj)
30 {
31 	return (void *)nvkm_subdev(obj, NVDEV_SUBDEV_PMU);
32 }
33 
34 extern struct nvkm_oclass *gt215_pmu_oclass;
35 extern struct nvkm_oclass *gf100_pmu_oclass;
36 extern struct nvkm_oclass *gf110_pmu_oclass;
37 extern struct nvkm_oclass *gk104_pmu_oclass;
38 extern struct nvkm_oclass *gk110_pmu_oclass;
39 extern struct nvkm_oclass *gk208_pmu_oclass;
40 extern struct nvkm_oclass *gk20a_pmu_oclass;
41 
42 /* interface to MEMX process running on PMU */
43 struct nvkm_memx;
44 int  nvkm_memx_init(struct nvkm_pmu *, struct nvkm_memx **);
45 int  nvkm_memx_fini(struct nvkm_memx **, bool exec);
46 void nvkm_memx_wr32(struct nvkm_memx *, u32 addr, u32 data);
47 void nvkm_memx_wait(struct nvkm_memx *, u32 addr, u32 mask, u32 data, u32 nsec);
48 void nvkm_memx_nsec(struct nvkm_memx *, u32 nsec);
49 void nvkm_memx_wait_vblank(struct nvkm_memx *);
50 void nvkm_memx_train(struct nvkm_memx *);
51 int  nvkm_memx_train_result(struct nvkm_pmu *, u32 *, int);
52 void nvkm_memx_block(struct nvkm_memx *);
53 void nvkm_memx_unblock(struct nvkm_memx *);
54 #endif
55