1 /* SPDX-License-Identifier: MIT */
2 #ifndef __NVKM_FB_RAM_PRIV_H__
3 #define __NVKM_FB_RAM_PRIV_H__
4 #include "priv.h"
5 
6 int  nvkm_ram_ctor(const struct nvkm_ram_func *, struct nvkm_fb *,
7 		   enum nvkm_ram_type, u64 size, struct nvkm_ram *);
8 int  nvkm_ram_new_(const struct nvkm_ram_func *, struct nvkm_fb *,
9 		   enum nvkm_ram_type, u64 size, struct nvkm_ram **);
10 void nvkm_ram_del(struct nvkm_ram **);
11 int  nvkm_ram_init(struct nvkm_ram *);
12 
13 extern const struct nvkm_ram_func nv04_ram_func;
14 
15 int  nv50_ram_ctor(const struct nvkm_ram_func *, struct nvkm_fb *,
16 		   struct nvkm_ram *);
17 
18 int gf100_ram_new_(const struct nvkm_ram_func *, struct nvkm_fb *,
19 		   struct nvkm_ram **);
20 int  gf100_ram_ctor(const struct nvkm_ram_func *, struct nvkm_fb *,
21 		    struct nvkm_ram *);
22 u32  gf100_ram_probe_fbp(const struct nvkm_ram_func *,
23 			 struct nvkm_device *, int, int *);
24 u32  gf100_ram_probe_fbp_amount(const struct nvkm_ram_func *, u32,
25 				struct nvkm_device *, int, int *);
26 u32  gf100_ram_probe_fbpa_amount(struct nvkm_device *, int);
27 int gf100_ram_init(struct nvkm_ram *);
28 int gf100_ram_calc(struct nvkm_ram *, u32);
29 int gf100_ram_prog(struct nvkm_ram *);
30 void gf100_ram_tidy(struct nvkm_ram *);
31 
32 u32 gf108_ram_probe_fbp_amount(const struct nvkm_ram_func *, u32,
33 			       struct nvkm_device *, int, int *);
34 
35 int gk104_ram_new_(const struct nvkm_ram_func *, struct nvkm_fb *,
36 		   struct nvkm_ram **);
37 void *gk104_ram_dtor(struct nvkm_ram *);
38 int gk104_ram_init(struct nvkm_ram *);
39 int gk104_ram_calc(struct nvkm_ram *, u32);
40 int gk104_ram_prog(struct nvkm_ram *);
41 void gk104_ram_tidy(struct nvkm_ram *);
42 
43 u32 gm107_ram_probe_fbp(const struct nvkm_ram_func *,
44 			struct nvkm_device *, int, int *);
45 
46 u32 gm200_ram_probe_fbp_amount(const struct nvkm_ram_func *, u32,
47 			       struct nvkm_device *, int, int *);
48 
49 /* RAM type-specific MR calculation routines */
50 int nvkm_sddr2_calc(struct nvkm_ram *);
51 int nvkm_sddr3_calc(struct nvkm_ram *);
52 int nvkm_gddr3_calc(struct nvkm_ram *);
53 int nvkm_gddr5_calc(struct nvkm_ram *, bool nuts);
54 
55 int nv04_ram_new(struct nvkm_fb *, struct nvkm_ram **);
56 int nv10_ram_new(struct nvkm_fb *, struct nvkm_ram **);
57 int nv1a_ram_new(struct nvkm_fb *, struct nvkm_ram **);
58 int nv20_ram_new(struct nvkm_fb *, struct nvkm_ram **);
59 int nv40_ram_new(struct nvkm_fb *, struct nvkm_ram **);
60 int nv41_ram_new(struct nvkm_fb *, struct nvkm_ram **);
61 int nv44_ram_new(struct nvkm_fb *, struct nvkm_ram **);
62 int nv49_ram_new(struct nvkm_fb *, struct nvkm_ram **);
63 int nv4e_ram_new(struct nvkm_fb *, struct nvkm_ram **);
64 int nv50_ram_new(struct nvkm_fb *, struct nvkm_ram **);
65 int gt215_ram_new(struct nvkm_fb *, struct nvkm_ram **);
66 int mcp77_ram_new(struct nvkm_fb *, struct nvkm_ram **);
67 int gf100_ram_new(struct nvkm_fb *, struct nvkm_ram **);
68 int gf108_ram_new(struct nvkm_fb *, struct nvkm_ram **);
69 int gk104_ram_new(struct nvkm_fb *, struct nvkm_ram **);
70 int gm107_ram_new(struct nvkm_fb *, struct nvkm_ram **);
71 int gm200_ram_new(struct nvkm_fb *, struct nvkm_ram **);
72 int gp100_ram_new(struct nvkm_fb *, struct nvkm_ram **);
73 #endif
74