1 #ifndef __NVBIOS_RAMCFG_H__
2 #define __NVBIOS_RAMCFG_H__
3 struct nvbios_ramcfg {
4 	unsigned rammap_ver;
5 	unsigned rammap_hdr;
6 	unsigned rammap_min;
7 	unsigned rammap_max;
8 	union {
9 		struct {
10 			unsigned rammap_10_04_02:1;
11 			unsigned rammap_10_04_08:1;
12 		};
13 		struct {
14 			unsigned rammap_11_08_01:1;
15 			unsigned rammap_11_08_0c:2;
16 			unsigned rammap_11_08_10:1;
17 			unsigned rammap_11_09_01ff:9;
18 			unsigned rammap_11_0a_03fe:9;
19 			unsigned rammap_11_0a_0400:1;
20 			unsigned rammap_11_0a_0800:1;
21 			unsigned rammap_11_0b_01f0:5;
22 			unsigned rammap_11_0b_0200:1;
23 			unsigned rammap_11_0b_0400:1;
24 			unsigned rammap_11_0b_0800:1;
25 			unsigned rammap_11_0d:8;
26 			unsigned rammap_11_0e:8;
27 			unsigned rammap_11_0f:8;
28 			unsigned rammap_11_11_0c:2;
29 		};
30 	};
31 
32 	unsigned ramcfg_ver;
33 	unsigned ramcfg_hdr;
34 	unsigned ramcfg_timing;
35 	union {
36 		struct {
37 			unsigned ramcfg_10_02_01:1;
38 			unsigned ramcfg_10_02_02:1;
39 			unsigned ramcfg_10_02_04:1;
40 			unsigned ramcfg_10_02_08:1;
41 			unsigned ramcfg_10_02_10:1;
42 			unsigned ramcfg_10_02_20:1;
43 			unsigned ramcfg_10_DLLoff:1;
44 			unsigned ramcfg_10_03_0f:4;
45 			unsigned ramcfg_10_04_01:1;
46 			unsigned ramcfg_10_05:8;
47 			unsigned ramcfg_10_06:8;
48 			unsigned ramcfg_10_07:8;
49 			unsigned ramcfg_10_08:8;
50 			unsigned ramcfg_10_09_0f:4;
51 			unsigned ramcfg_10_09_f0:4;
52 		};
53 		struct {
54 			unsigned ramcfg_11_01_01:1;
55 			unsigned ramcfg_11_01_02:1;
56 			unsigned ramcfg_11_01_04:1;
57 			unsigned ramcfg_11_01_08:1;
58 			unsigned ramcfg_11_01_10:1;
59 			unsigned ramcfg_11_01_20:1;
60 			unsigned ramcfg_11_01_40:1;
61 			unsigned ramcfg_11_01_80:1;
62 			unsigned ramcfg_11_02_03:2;
63 			unsigned ramcfg_11_02_04:1;
64 			unsigned ramcfg_11_02_08:1;
65 			unsigned ramcfg_11_02_10:1;
66 			unsigned ramcfg_11_02_40:1;
67 			unsigned ramcfg_11_02_80:1;
68 			unsigned ramcfg_11_03_0f:4;
69 			unsigned ramcfg_11_03_30:2;
70 			unsigned ramcfg_11_03_c0:2;
71 			unsigned ramcfg_11_03_f0:4;
72 			unsigned ramcfg_11_04:8;
73 			unsigned ramcfg_11_06:8;
74 			unsigned ramcfg_11_07_02:1;
75 			unsigned ramcfg_11_07_04:1;
76 			unsigned ramcfg_11_07_08:1;
77 			unsigned ramcfg_11_07_10:1;
78 			unsigned ramcfg_11_07_40:1;
79 			unsigned ramcfg_11_07_80:1;
80 			unsigned ramcfg_11_08_01:1;
81 			unsigned ramcfg_11_08_02:1;
82 			unsigned ramcfg_11_08_04:1;
83 			unsigned ramcfg_11_08_08:1;
84 			unsigned ramcfg_11_08_10:1;
85 			unsigned ramcfg_11_08_20:1;
86 			unsigned ramcfg_11_09:8;
87 		};
88 	};
89 
90 	unsigned timing_ver;
91 	unsigned timing_hdr;
92 	unsigned timing[11];
93 	union {
94 		struct {
95 			unsigned timing_10_WR:8;
96 			unsigned timing_10_WTR:8;
97 			unsigned timing_10_CL:8;
98 			unsigned timing_10_RC:8;
99 			/*empty: 4 */
100 			unsigned timing_10_RFC:8;        /* Byte 5 */
101 			/*empty: 6 */
102 			unsigned timing_10_RAS:8;        /* Byte 7 */
103 			/*empty: 8 */
104 			unsigned timing_10_RP:8;         /* Byte 9 */
105 			unsigned timing_10_RCDRD:8;
106 			unsigned timing_10_RCDWR:8;
107 			unsigned timing_10_RRD:8;
108 			unsigned timing_10_13:8;
109 			unsigned timing_10_ODT:3;
110 			/* empty: 15 */
111 			unsigned timing_10_16:8;
112 			/* empty: 17 */
113 			unsigned timing_10_18:8;
114 			unsigned timing_10_CWL:8;
115 			unsigned timing_10_20:8;
116 			unsigned timing_10_21:8;
117 			/* empty: 22, 23 */
118 			unsigned timing_10_24:8;
119 		};
120 		struct {
121 			unsigned timing_20_2e_03:2;
122 			unsigned timing_20_2e_30:2;
123 			unsigned timing_20_2e_c0:2;
124 			unsigned timing_20_2f_03:2;
125 			unsigned timing_20_2c_003f:6;
126 			unsigned timing_20_2c_1fc0:7;
127 			unsigned timing_20_30_f8:5;
128 			unsigned timing_20_30_07:3;
129 			unsigned timing_20_31_0007:3;
130 			unsigned timing_20_31_0078:4;
131 			unsigned timing_20_31_0780:4;
132 			unsigned timing_20_31_0800:1;
133 			unsigned timing_20_31_7000:3;
134 			unsigned timing_20_31_8000:1;
135 		};
136 	};
137 };
138 
139 u8 nvbios_ramcfg_count(struct nvkm_bios *);
140 u8 nvbios_ramcfg_index(struct nvkm_subdev *);
141 #endif
142