Home | History | Annotate | Line # | Download | only in subdev
      1 /*	$NetBSD: bar.h,v 1.3 2021/12/18 23:45:33 riastradh Exp $	*/
      2 
      3 /* SPDX-License-Identifier: MIT */
      4 #ifndef __NVKM_BAR_H__
      5 #define __NVKM_BAR_H__
      6 #include <core/subdev.h>
      7 struct nvkm_vma;
      8 
      9 struct nvkm_bar {
     10 	const struct nvkm_bar_func *func;
     11 	struct nvkm_subdev subdev;
     12 
     13 	spinlock_t lock;
     14 	bool bar2;
     15 
     16 	/* whether the BAR supports to be ioremapped WC or should be uncached */
     17 	bool iomap_uncached;
     18 };
     19 
     20 struct nvkm_vmm *nvkm_bar_bar1_vmm(struct nvkm_device *);
     21 void nvkm_bar_bar1_reset(struct nvkm_device *);
     22 void nvkm_bar_bar2_init(struct nvkm_device *);
     23 void nvkm_bar_bar2_fini(struct nvkm_device *);
     24 void nvkm_bar_bar2_reset(struct nvkm_device *);
     25 struct nvkm_vmm *nvkm_bar_bar2_vmm(struct nvkm_device *);
     26 void nvkm_bar_flush(struct nvkm_bar *);
     27 
     28 int nv50_bar_new(struct nvkm_device *, int, struct nvkm_bar **);
     29 int g84_bar_new(struct nvkm_device *, int, struct nvkm_bar **);
     30 int gf100_bar_new(struct nvkm_device *, int, struct nvkm_bar **);
     31 int gk20a_bar_new(struct nvkm_device *, int, struct nvkm_bar **);
     32 int gm107_bar_new(struct nvkm_device *, int, struct nvkm_bar **);
     33 int gm20b_bar_new(struct nvkm_device *, int, struct nvkm_bar **);
     34 int tu102_bar_new(struct nvkm_device *, int, struct nvkm_bar **);
     35 #endif
     36