1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_BAR_PRIV_H__
3#define __NVKM_BAR_PRIV_H__
4#define nvkm_bar(p) container_of((p), struct nvkm_bar, subdev)
5#include <subdev/bar.h>
6
7int r535_bar_new_(const struct nvkm_bar_func *,
8		  struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_bar **);
9
10void nvkm_bar_ctor(const struct nvkm_bar_func *, struct nvkm_device *,
11		   enum nvkm_subdev_type, int, struct nvkm_bar *);
12
13struct nvkm_bar_func {
14	void *(*dtor)(struct nvkm_bar *);
15	int (*oneinit)(struct nvkm_bar *);
16	void (*init)(struct nvkm_bar *);
17
18	struct {
19		void (*init)(struct nvkm_bar *);
20		void (*fini)(struct nvkm_bar *);
21		void (*wait)(struct nvkm_bar *);
22		struct nvkm_vmm *(*vmm)(struct nvkm_bar *);
23	} bar1, bar2;
24
25	void (*flush)(struct nvkm_bar *);
26};
27
28void nv50_bar_bar1_fini(struct nvkm_bar *);
29void nv50_bar_bar2_fini(struct nvkm_bar *);
30
31void g84_bar_flush(struct nvkm_bar *);
32
33void gf100_bar_bar1_fini(struct nvkm_bar *);
34void gf100_bar_bar2_fini(struct nvkm_bar *);
35
36void gm107_bar_bar1_wait(struct nvkm_bar *);
37#endif
38