coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
ast_tables.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: HPND-sell-variant */
2 /* Ported from xf86-video-ast driver */
3 
4 #ifndef AST_TABLES_H
5 #define AST_TABLES_H
6 
7 /* Std. Table Index Definition */
8 #define TextModeIndex 0
9 #define EGAModeIndex 1
10 #define VGAModeIndex 2
11 #define HiCModeIndex 3
12 #define TrueCModeIndex 4
13 
14 #define Charx8Dot 0x00000001
15 #define HalfDCLK 0x00000002
16 #define DoubleScanMode 0x00000004
17 #define LineCompareOff 0x00000008
18 #define HBorder 0x00000020
19 #define VBorder 0x00000010
20 #define WideScreenMode 0x00000100
21 #define NewModeInfo 0x00000200
22 #define NHSync 0x00000400
23 #define PHSync 0x00000800
24 #define NVSync 0x00001000
25 #define PVSync 0x00002000
26 #define SyncPP (PVSync | PHSync)
27 #define SyncPN (PVSync | NHSync)
28 #define SyncNP (NVSync | PHSync)
29 #define SyncNN (NVSync | NHSync)
30 #define AST2500PreCatchCRT 0x00004000
31 
32 /* DCLK Index */
33 #define VCLK25_175 0x00
34 #define VCLK28_322 0x01
35 #define VCLK31_5 0x02
36 #define VCLK36 0x03
37 #define VCLK40 0x04
38 #define VCLK49_5 0x05
39 #define VCLK50 0x06
40 #define VCLK56_25 0x07
41 #define VCLK65 0x08
42 #define VCLK75 0x09
43 #define VCLK78_75 0x0A
44 #define VCLK94_5 0x0B
45 #define VCLK108 0x0C
46 #define VCLK135 0x0D
47 #define VCLK157_5 0x0E
48 #define VCLK162 0x0F
49 /* #define VCLK193_25 0x10 */
50 #define VCLK154 0x10
51 #define VCLK83_5 0x11
52 #define VCLK106_5 0x12
53 #define VCLK146_25 0x13
54 #define VCLK148_5 0x14
55 #define VCLK71 0x15
56 #define VCLK88_75 0x16
57 #define VCLK119 0x17
58 #define VCLK85_5 0x18
59 #define VCLK97_75 0x19
60 #define VCLK118_25 0x1A
61 
62 static struct ast_vbios_dclk_info dclk_table[] = {
63  {0x2C, 0xE7, 0x03}, /* 00: VCLK25_175 */
64  {0x95, 0x62, 0x03}, /* 01: VCLK28_322 */
65  {0x67, 0x63, 0x01}, /* 02: VCLK31_5 */
66  {0x76, 0x63, 0x01}, /* 03: VCLK36 */
67  {0xEE, 0x67, 0x01}, /* 04: VCLK40 */
68  {0x82, 0x62, 0x01}, /* 05: VCLK49_5 */
69  {0xC6, 0x64, 0x01}, /* 06: VCLK50 */
70  {0x94, 0x62, 0x01}, /* 07: VCLK56_25 */
71  {0x80, 0x64, 0x00}, /* 08: VCLK65 */
72  {0x7B, 0x63, 0x00}, /* 09: VCLK75 */
73  {0x67, 0x62, 0x00}, /* 0A: VCLK78_75 */
74  {0x7C, 0x62, 0x00}, /* 0B: VCLK94_5 */
75  {0x8E, 0x62, 0x00}, /* 0C: VCLK108 */
76  {0x85, 0x24, 0x00}, /* 0D: VCLK135 */
77  {0x67, 0x22, 0x00}, /* 0E: VCLK157_5 */
78  {0x6A, 0x22, 0x00}, /* 0F: VCLK162 */
79  {0x4d, 0x4c, 0x80}, /* 10: VCLK154 */
80  {0xa7, 0x78, 0x80}, /* 11: VCLK83.5 */
81  {0x28, 0x49, 0x80}, /* 12: VCLK106.5 */
82  {0x37, 0x49, 0x80}, /* 13: VCLK146.25 */
83  {0x1f, 0x45, 0x80}, /* 14: VCLK148.5 */
84  {0x47, 0x6c, 0x80}, /* 15: VCLK71 */
85  {0x25, 0x65, 0x80}, /* 16: VCLK88.75 */
86  {0x77, 0x58, 0x80}, /* 17: VCLK119 */
87  {0x32, 0x67, 0x80}, /* 18: VCLK85_5 */
88  {0x6a, 0x6d, 0x80}, /* 19: VCLK97_75 */
89  {0x3b, 0x2c, 0x81}, /* 1A: VCLK118_25 */
90 };
91 
92 static const struct ast_vbios_dclk_info dclk_table_ast2500[] = {
93  {0x2C, 0xE7, 0x03}, /* 00: VCLK25_175 */
94  {0x95, 0x62, 0x03}, /* 01: VCLK28_322 */
95  {0x67, 0x63, 0x01}, /* 02: VCLK31_5 */
96  {0x76, 0x63, 0x01}, /* 03: VCLK36 */
97  {0xEE, 0x67, 0x01}, /* 04: VCLK40 */
98  {0x82, 0x62, 0x01}, /* 05: VCLK49_5 */
99  {0xC6, 0x64, 0x01}, /* 06: VCLK50 */
100  {0x94, 0x62, 0x01}, /* 07: VCLK56_25 */
101  {0x80, 0x64, 0x00}, /* 08: VCLK65 */
102  {0x7B, 0x63, 0x00}, /* 09: VCLK75 */
103  {0x67, 0x62, 0x00}, /* 0A: VCLK78_75 */
104  {0x7C, 0x62, 0x00}, /* 0B: VCLK94_5 */
105  {0x8E, 0x62, 0x00}, /* 0C: VCLK108 */
106  {0x85, 0x24, 0x00}, /* 0D: VCLK135 */
107  {0x67, 0x22, 0x00}, /* 0E: VCLK157_5 */
108  {0x6A, 0x22, 0x00}, /* 0F: VCLK162 */
109  {0x4d, 0x4c, 0x80}, /* 10: VCLK154 */
110  {0x68, 0x6f, 0x80}, /* 11: VCLK83.5 */
111  {0x28, 0x49, 0x80}, /* 12: VCLK106.5 */
112  {0x37, 0x49, 0x80}, /* 13: VCLK146.25 */
113  {0x1f, 0x45, 0x80}, /* 14: VCLK148.5 */
114  {0x47, 0x6c, 0x80}, /* 15: VCLK71 */
115  {0x25, 0x65, 0x80}, /* 16: VCLK88.75 */
116  {0x58, 0x01, 0x42}, /* 17: VCLK119 */
117  {0x32, 0x67, 0x80}, /* 18: VCLK85_5 */
118  {0x6a, 0x6d, 0x80}, /* 19: VCLK97_75 */
119  {0x44, 0x20, 0x43}, /* 1A: VCLK118_25 */
120 };
121 
122 static struct ast_vbios_stdtable vbios_stdtable[] = {
123  /* MD_2_3_400 */
124  {
125  0x67,
126  {0x00, 0x03, 0x00, 0x02},
127  {0x5f, 0x4f, 0x50, 0x82, 0x55, 0x81, 0xbf, 0x1f,
128  0x00, 0x4f, 0x0d, 0x0e, 0x00, 0x00, 0x00, 0x00,
129  0x9c, 0x8e, 0x8f, 0x28, 0x1f, 0x96, 0xb9, 0xa3,
130  0xff},
131  {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x14, 0x07,
132  0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
133  0x0c, 0x00, 0x0f, 0x08},
134  {0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x0e, 0x00,
135  0xff}
136  },
137  /* Mode12/ExtEGATable */
138  {
139  0xe3,
140  {0x01, 0x0f, 0x00, 0x06},
141  {0x5f, 0x4f, 0x50, 0x82, 0x55, 0x81, 0x0b, 0x3e,
142  0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
143  0xe9, 0x8b, 0xdf, 0x28, 0x00, 0xe7, 0x04, 0xe3,
144  0xff},
145  {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x14, 0x07,
146  0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
147  0x01, 0x00, 0x0f, 0x00},
148  {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x0f,
149  0xff}
150  },
151  /* ExtVGATable */
152  {
153  0x2f,
154  {0x01, 0x0f, 0x00, 0x0e},
155  {0x5f, 0x4f, 0x50, 0x82, 0x54, 0x80, 0x0b, 0x3e,
156  0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
157  0xea, 0x8c, 0xdf, 0x28, 0x40, 0xe7, 0x04, 0xa3,
158  0xff},
159  {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
160  0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
161  0x01, 0x00, 0x00, 0x00},
162  {0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0f,
163  0xff}
164  },
165  /* ExtHiCTable */
166  {
167  0x2f,
168  {0x01, 0x0f, 0x00, 0x0e},
169  {0x5f, 0x4f, 0x50, 0x82, 0x54, 0x80, 0x0b, 0x3e,
170  0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
171  0xea, 0x8c, 0xdf, 0x28, 0x40, 0xe7, 0x04, 0xa3,
172  0xff},
173  {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
174  0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
175  0x01, 0x00, 0x00, 0x00},
176  {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x0f,
177  0xff}
178  },
179  /* ExtTrueCTable */
180  {
181  0x2f,
182  {0x01, 0x0f, 0x00, 0x0e},
183  {0x5f, 0x4f, 0x50, 0x82, 0x54, 0x80, 0x0b, 0x3e,
184  0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
185  0xea, 0x8c, 0xdf, 0x28, 0x40, 0xe7, 0x04, 0xa3,
186  0xff},
187  {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
188  0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
189  0x01, 0x00, 0x00, 0x00},
190  {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x0f,
191  0xff}
192  },
193 };
194 
195 static const struct ast_vbios_enhtable res_640x480[] = {
196  { 800, 640, 8, 96, 525, 480, 2, 2, VCLK25_175, /* 60Hz */
197  (SyncNN | HBorder | VBorder | Charx8Dot), 60, 1, 0x2E },
198  { 832, 640, 16, 40, 520, 480, 1, 3, VCLK31_5, /* 72Hz */
199  (SyncNN | HBorder | VBorder | Charx8Dot), 72, 2, 0x2E },
200  { 840, 640, 16, 64, 500, 480, 1, 3, VCLK31_5, /* 75Hz */
201  (SyncNN | Charx8Dot) , 75, 3, 0x2E },
202  { 832, 640, 56, 56, 509, 480, 1, 3, VCLK36, /* 85Hz */
203  (SyncNN | Charx8Dot) , 85, 4, 0x2E },
204  { 832, 640, 56, 56, 509, 480, 1, 3, VCLK36, /* end */
205  (SyncNN | Charx8Dot) , 0xFF, 4, 0x2E },
206 };
207 
208 static const struct ast_vbios_enhtable res_800x600[] = {
209  {1024, 800, 24, 72, 625, 600, 1, 2, VCLK36, /* 56Hz */
210  (SyncPP | Charx8Dot), 56, 1, 0x30 },
211  {1056, 800, 40, 128, 628, 600, 1, 4, VCLK40, /* 60Hz */
212  (SyncPP | Charx8Dot), 60, 2, 0x30 },
213  {1040, 800, 56, 120, 666, 600, 37, 6, VCLK50, /* 72Hz */
214  (SyncPP | Charx8Dot), 72, 3, 0x30 },
215  {1056, 800, 16, 80, 625, 600, 1, 3, VCLK49_5, /* 75Hz */
216  (SyncPP | Charx8Dot), 75, 4, 0x30 },
217  {1048, 800, 32, 64, 631, 600, 1, 3, VCLK56_25, /* 85Hz */
218  (SyncPP | Charx8Dot), 84, 5, 0x30 },
219  {1048, 800, 32, 64, 631, 600, 1, 3, VCLK56_25, /* end */
220  (SyncPP | Charx8Dot), 0xFF, 5, 0x30 },
221 };
222 
223 static const struct ast_vbios_enhtable res_1024x768[] = {
224  {1344, 1024, 24, 136, 806, 768, 3, 6, VCLK65, /* 60Hz */
225  (SyncNN | Charx8Dot), 60, 1, 0x31 },
226  {1328, 1024, 24, 136, 806, 768, 3, 6, VCLK75, /* 70Hz */
227  (SyncNN | Charx8Dot), 70, 2, 0x31 },
228  {1312, 1024, 16, 96, 800, 768, 1, 3, VCLK78_75, /* 75Hz */
229  (SyncPP | Charx8Dot), 75, 3, 0x31 },
230  {1376, 1024, 48, 96, 808, 768, 1, 3, VCLK94_5, /* 85Hz */
231  (SyncPP | Charx8Dot), 84, 4, 0x31 },
232  {1376, 1024, 48, 96, 808, 768, 1, 3, VCLK94_5, /* end */
233  (SyncPP | Charx8Dot), 0xFF, 4, 0x31 },
234 };
235 
236 static const struct ast_vbios_enhtable res_1280x1024[] = {
237  {1688, 1280, 48, 112, 1066, 1024, 1, 3, VCLK108, /* 60Hz */
238  (SyncPP | Charx8Dot), 60, 1, 0x32 },
239  {1688, 1280, 16, 144, 1066, 1024, 1, 3, VCLK135, /* 75Hz */
240  (SyncPP | Charx8Dot), 75, 2, 0x32 },
241  {1728, 1280, 64, 160, 1072, 1024, 1, 3, VCLK157_5, /* 85Hz */
242  (SyncPP | Charx8Dot), 85, 3, 0x32 },
243  {1728, 1280, 64, 160, 1072, 1024, 1, 3, VCLK157_5, /* end */
244  (SyncPP | Charx8Dot), 0xFF, 3, 0x32 },
245 };
246 
247 static const struct ast_vbios_enhtable res_1600x1200[] = {
248  {2160, 1600, 64, 192, 1250, 1200, 1, 3, VCLK162, /* 60Hz */
249  (SyncPP | Charx8Dot), 60, 1, 0x33 },
250  {2160, 1600, 64, 192, 1250, 1200, 1, 3, VCLK162, /* end */
251  (SyncPP | Charx8Dot), 0xFF, 1, 0x33 },
252 };
253 
254 /* 16:9 */
255 static const struct ast_vbios_enhtable res_1360x768[] = {
256  {1792, 1360, 64, 112, 795, 768, 3, 6, VCLK85_5, /* 60Hz */
257  (SyncPP | Charx8Dot | LineCompareOff | WideScreenMode | NewModeInfo), 60, 1, 0x39 },
258  {1792, 1360, 64, 112, 795, 768, 3, 6, VCLK85_5, /* end */
260  AST2500PreCatchCRT), 0xFF, 1, 0x39 },
261 };
262 
263 static const struct ast_vbios_enhtable res_1600x900[] = {
264  {1760, 1600, 48, 32, 926, 900, 3, 5, VCLK97_75, /* 60Hz CVT RB */
266  AST2500PreCatchCRT), 60, 1, 0x3A },
267  {2112, 1600, 88, 168, 934, 900, 3, 5, VCLK118_25, /* 60Hz CVT */
268  (SyncPN | Charx8Dot | LineCompareOff | WideScreenMode | NewModeInfo), 60, 2, 0x3A },
269  {2112, 1600, 88, 168, 934, 900, 3, 5, VCLK118_25, /* 60Hz CVT */
270  (SyncPN | Charx8Dot | LineCompareOff | WideScreenMode | NewModeInfo), 0xFF, 2, 0x3A },
271 };
272 
273 static const struct ast_vbios_enhtable res_1920x1080[] = {
274  {2200, 1920, 88, 44, 1125, 1080, 4, 5, VCLK148_5, /* 60Hz */
276  AST2500PreCatchCRT), 60, 1, 0x38 },
277  {2200, 1920, 88, 44, 1125, 1080, 4, 5, VCLK148_5, /* 60Hz */
279  AST2500PreCatchCRT), 0xFF, 1, 0x38 },
280 };
281 
282 /* 16:10 */
283 static const struct ast_vbios_enhtable res_1280x800[] = {
284  {1440, 1280, 48, 32, 823, 800, 3, 6, VCLK71, /* 60Hz RB */
286  AST2500PreCatchCRT), 60, 1, 0x35 },
287  {1680, 1280, 72,128, 831, 800, 3, 6, VCLK83_5, /* 60Hz */
288  (SyncPN | Charx8Dot | LineCompareOff | WideScreenMode | NewModeInfo), 60, 2, 0x35 },
289  {1680, 1280, 72,128, 831, 800, 3, 6, VCLK83_5, /* 60Hz */
290  (SyncPN | Charx8Dot | LineCompareOff | WideScreenMode | NewModeInfo), 0xFF, 2, 0x35 },
291 
292 };
293 
294 static const struct ast_vbios_enhtable res_1440x900[] = {
295  {1600, 1440, 48, 32, 926, 900, 3, 6, VCLK88_75, /* 60Hz RB */
297  AST2500PreCatchCRT), 60, 1, 0x36 },
298  {1904, 1440, 80,152, 934, 900, 3, 6, VCLK106_5, /* 60Hz */
299  (SyncPN | Charx8Dot | LineCompareOff | WideScreenMode | NewModeInfo), 60, 2, 0x36 },
300  {1904, 1440, 80,152, 934, 900, 3, 6, VCLK106_5, /* 60Hz */
301  (SyncPN | Charx8Dot | LineCompareOff | WideScreenMode | NewModeInfo), 0xFF, 2, 0x36 },
302 };
303 
304 static const struct ast_vbios_enhtable res_1680x1050[] = {
305  {1840, 1680, 48, 32, 1080, 1050, 3, 6, VCLK119, /* 60Hz RB */
307  AST2500PreCatchCRT), 60, 1, 0x37 },
308  {2240, 1680,104,176, 1089, 1050, 3, 6, VCLK146_25, /* 60Hz */
309  (SyncPN | Charx8Dot | LineCompareOff | WideScreenMode | NewModeInfo), 60, 2, 0x37 },
310  {2240, 1680,104,176, 1089, 1050, 3, 6, VCLK146_25, /* 60Hz */
311  (SyncPN | Charx8Dot | LineCompareOff | WideScreenMode | NewModeInfo), 0xFF, 2, 0x37 },
312 };
313 
314 static const struct ast_vbios_enhtable res_1920x1200[] = {
315  {2080, 1920, 48, 32, 1235, 1200, 3, 6, VCLK154, /* 60Hz RB*/
317  AST2500PreCatchCRT), 60, 1, 0x34 },
318  {2080, 1920, 48, 32, 1235, 1200, 3, 6, VCLK154, /* 60Hz RB */
320  AST2500PreCatchCRT), 0xFF, 1, 0x34 },
321 };
322 #endif
static const struct ast_vbios_enhtable res_1440x900[]
Definition: ast_tables.h:294
static struct ast_vbios_stdtable vbios_stdtable[]
Definition: ast_tables.h:122
#define VCLK88_75
Definition: ast_tables.h:56
#define VCLK106_5
Definition: ast_tables.h:52
#define AST2500PreCatchCRT
Definition: ast_tables.h:30
#define VCLK78_75
Definition: ast_tables.h:43
#define VCLK146_25
Definition: ast_tables.h:53
#define VCLK118_25
Definition: ast_tables.h:60
static const struct ast_vbios_enhtable res_800x600[]
Definition: ast_tables.h:208
#define SyncPP
Definition: ast_tables.h:26
#define VBorder
Definition: ast_tables.h:19
static const struct ast_vbios_enhtable res_1360x768[]
Definition: ast_tables.h:255
#define SyncNN
Definition: ast_tables.h:29
#define VCLK31_5
Definition: ast_tables.h:35
static const struct ast_vbios_enhtable res_1024x768[]
Definition: ast_tables.h:223
#define VCLK162
Definition: ast_tables.h:48
#define VCLK148_5
Definition: ast_tables.h:54
#define VCLK85_5
Definition: ast_tables.h:58
static const struct ast_vbios_enhtable res_1280x1024[]
Definition: ast_tables.h:236
#define VCLK49_5
Definition: ast_tables.h:38
static const struct ast_vbios_enhtable res_1600x1200[]
Definition: ast_tables.h:247
#define LineCompareOff
Definition: ast_tables.h:17
#define WideScreenMode
Definition: ast_tables.h:20
#define SyncNP
Definition: ast_tables.h:28
#define SyncPN
Definition: ast_tables.h:27
#define VCLK97_75
Definition: ast_tables.h:59
#define VCLK71
Definition: ast_tables.h:55
#define VCLK119
Definition: ast_tables.h:57
#define VCLK157_5
Definition: ast_tables.h:47
#define VCLK108
Definition: ast_tables.h:45
#define VCLK94_5
Definition: ast_tables.h:44
static const struct ast_vbios_enhtable res_1600x900[]
Definition: ast_tables.h:263
#define VCLK75
Definition: ast_tables.h:42
#define VCLK50
Definition: ast_tables.h:39
#define VCLK83_5
Definition: ast_tables.h:51
static const struct ast_vbios_dclk_info dclk_table_ast2500[]
Definition: ast_tables.h:92
static const struct ast_vbios_enhtable res_1280x800[]
Definition: ast_tables.h:283
#define VCLK36
Definition: ast_tables.h:36
#define VCLK56_25
Definition: ast_tables.h:40
#define Charx8Dot
Definition: ast_tables.h:14
static const struct ast_vbios_enhtable res_1920x1080[]
Definition: ast_tables.h:273
#define VCLK25_175
Definition: ast_tables.h:33
static struct ast_vbios_dclk_info dclk_table[]
Definition: ast_tables.h:62
static const struct ast_vbios_enhtable res_1920x1200[]
Definition: ast_tables.h:314
#define HBorder
Definition: ast_tables.h:18
#define VCLK65
Definition: ast_tables.h:41
#define VCLK40
Definition: ast_tables.h:37
static const struct ast_vbios_enhtable res_640x480[]
Definition: ast_tables.h:195
#define VCLK154
Definition: ast_tables.h:50
#define NewModeInfo
Definition: ast_tables.h:21
#define VCLK135
Definition: ast_tables.h:46
static const struct ast_vbios_enhtable res_1680x1050[]
Definition: ast_tables.h:304