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