xref: /netbsd-src/sys/external/bsd/drm2/dist/drm/nouveau/include/nvkm/subdev/instmem.h (revision 41ec02673d281bbb3d38e6c78504ce6e30c228c1)
1 /*	$NetBSD: instmem.h,v 1.3 2021/12/18 23:45:33 riastradh Exp $	*/
2 
3 /* SPDX-License-Identifier: MIT */
4 #ifndef __NVKM_INSTMEM_H__
5 #define __NVKM_INSTMEM_H__
6 #include <core/subdev.h>
7 struct nvkm_memory;
8 
9 struct nvkm_instmem {
10 	const struct nvkm_instmem_func *func;
11 	struct nvkm_subdev subdev;
12 
13 	spinlock_t lock;
14 	struct list_head list;
15 	struct list_head boot;
16 	u32 reserved;
17 
18 	struct nvkm_memory *vbios;
19 	struct nvkm_ramht  *ramht;
20 	struct nvkm_memory *ramro;
21 	struct nvkm_memory *ramfc;
22 };
23 
24 u32 nvkm_instmem_rd32(struct nvkm_instmem *, u32 addr);
25 void nvkm_instmem_wr32(struct nvkm_instmem *, u32 addr, u32 data);
26 int nvkm_instobj_new(struct nvkm_instmem *, u32 size, u32 align, bool zero,
27 		     struct nvkm_memory **);
28 
29 
30 int nv04_instmem_new(struct nvkm_device *, int, struct nvkm_instmem **);
31 int nv40_instmem_new(struct nvkm_device *, int, struct nvkm_instmem **);
32 int nv50_instmem_new(struct nvkm_device *, int, struct nvkm_instmem **);
33 int gk20a_instmem_new(struct nvkm_device *, int, struct nvkm_instmem **);
34 #endif
35