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