xref: /linux/drivers/gpu/drm/nouveau/nvkm/subdev/mc/priv.h (revision ae22a94997b8a03dcb3c922857c203246711f9d4)
1 /* SPDX-License-Identifier: MIT */
2 #ifndef __NVKM_MC_PRIV_H__
3 #define __NVKM_MC_PRIV_H__
4 #define nvkm_mc(p) container_of((p), struct nvkm_mc, subdev)
5 #include <subdev/mc.h>
6 
7 int nvkm_mc_new_(const struct nvkm_mc_func *, struct nvkm_device *, enum nvkm_subdev_type, int,
8 		 struct nvkm_mc **);
9 
10 struct nvkm_mc_map {
11 	u32 stat;
12 	enum nvkm_subdev_type type;
13 	int inst;
14 	bool noauto;
15 };
16 
17 struct nvkm_mc_func {
18 	void (*init)(struct nvkm_mc *);
19 
20 	const struct nvkm_intr_func *intr;
21 	const struct nvkm_intr_data *intrs;
22 	bool intr_nonstall;
23 
24 	const struct nvkm_mc_device_func {
25 		bool (*enabled)(struct nvkm_mc *, u32 mask);
26 		void (*enable)(struct nvkm_mc *, u32 mask);
27 		void (*disable)(struct nvkm_mc *, u32 mask);
28 	} *device;
29 
30 	const struct nvkm_mc_map *reset;
31 
32 	void (*unk260)(struct nvkm_mc *, u32);
33 };
34 
35 void nv04_mc_init(struct nvkm_mc *);
36 extern const struct nvkm_intr_func nv04_mc_intr;
37 bool nv04_mc_intr_pending(struct nvkm_intr *);
38 void nv04_mc_intr_unarm(struct nvkm_intr *);
39 void nv04_mc_intr_rearm(struct nvkm_intr *);
40 extern const struct nvkm_mc_device_func nv04_mc_device;
41 extern const struct nvkm_mc_map nv04_mc_reset[];
42 
43 extern const struct nvkm_intr_data nv17_mc_intrs[];
44 extern const struct nvkm_mc_map nv17_mc_reset[];
45 
46 void nv44_mc_init(struct nvkm_mc *);
47 
48 void nv50_mc_init(struct nvkm_mc *);
49 
50 extern const struct nvkm_intr_func gt215_mc_intr;
51 void gf100_mc_unk260(struct nvkm_mc *, u32);
52 
53 void gk104_mc_init(struct nvkm_mc *);
54 extern const struct nvkm_intr_data gk104_mc_intrs[];
55 extern const struct nvkm_mc_map gk104_mc_reset[];
56 
57 extern const struct nvkm_intr_func gp100_mc_intr;
58 extern const struct nvkm_intr_data gp100_mc_intrs[];
59 #endif
60