2 * Silicon Motion SM712 frame buffer device
4 * Copyright (C) 2006 Silicon Motion Technology Corp.
5 * Authors: Ge Wang, gewang@siliconmotion.com
6 * Boyod boyod.yang@siliconmotion.com.cn
8 * Copyright (C) 2009 Lemote, Inc.
9 * Author: Wu Zhangjin, wuzhangjin@gmail.com
11 * This file is subject to the terms and conditions of the GNU General Public
12 * License. See the file COPYING in the main directory of this archive for
16 #define SMTC_LINUX_FB_VERSION "version 0.11.2619.21.01 July 27, 2008"
18 #define NR_PALETTE 256
21 #define FB_ACCEL_SMI_LYNX 88
29 #define SCREEN_X_RES 1024
30 #define SCREEN_Y_RES 600
33 /*Assume SM712 graphics chip has 4MB VRAM */
34 #define SM712_VIDEOMEMORYSIZE 0x00400000
35 /*Assume SM722 graphics chip has 8MB VRAM */
36 #define SM722_VIDEOMEMORYSIZE 0x00800000
38 #define dac_reg (0x3c8)
39 #define dac_val (0x3c9)
41 extern char *smtc_RegBaseAddress
;
42 #define smtc_mmiowb(dat, reg) writeb(dat, smtc_RegBaseAddress + reg)
43 #define smtc_mmioww(dat, reg) writew(dat, smtc_RegBaseAddress + reg)
44 #define smtc_mmiowl(dat, reg) writel(dat, smtc_RegBaseAddress + reg)
46 #define smtc_mmiorb(reg) readb(smtc_RegBaseAddress + reg)
47 #define smtc_mmiorw(reg) readw(smtc_RegBaseAddress + reg)
48 #define smtc_mmiorl(reg) readl(smtc_RegBaseAddress + reg)
50 #define SIZE_SR00_SR04 (0x04 - 0x00 + 1)
51 #define SIZE_SR10_SR24 (0x24 - 0x10 + 1)
52 #define SIZE_SR30_SR75 (0x75 - 0x30 + 1)
53 #define SIZE_SR80_SR93 (0x93 - 0x80 + 1)
54 #define SIZE_SRA0_SRAF (0xAF - 0xA0 + 1)
55 #define SIZE_GR00_GR08 (0x08 - 0x00 + 1)
56 #define SIZE_AR00_AR14 (0x14 - 0x00 + 1)
57 #define SIZE_CR00_CR18 (0x18 - 0x00 + 1)
58 #define SIZE_CR30_CR4D (0x4D - 0x30 + 1)
59 #define SIZE_CR90_CRA7 (0xA7 - 0x90 + 1)
60 #define SIZE_VPR (0x6C + 1)
61 #define SIZE_DPR (0x44 + 1)
63 static inline void smtc_crtcw(int reg
, int val
)
65 smtc_mmiowb(reg
, 0x3d4);
66 smtc_mmiowb(val
, 0x3d5);
69 static inline unsigned int smtc_crtcr(int reg
)
71 smtc_mmiowb(reg
, 0x3d4);
72 return smtc_mmiorb(0x3d5);
75 static inline void smtc_grphw(int reg
, int val
)
77 smtc_mmiowb(reg
, 0x3ce);
78 smtc_mmiowb(val
, 0x3cf);
81 static inline unsigned int smtc_grphr(int reg
)
83 smtc_mmiowb(reg
, 0x3ce);
84 return smtc_mmiorb(0x3cf);
87 static inline void smtc_attrw(int reg
, int val
)
90 smtc_mmiowb(reg
, 0x3c0);
92 smtc_mmiowb(val
, 0x3c0);
95 static inline void smtc_seqw(int reg
, int val
)
97 smtc_mmiowb(reg
, 0x3c4);
98 smtc_mmiowb(val
, 0x3c5);
101 static inline unsigned int smtc_seqr(int reg
)
103 smtc_mmiowb(reg
, 0x3c4);
104 return smtc_mmiorb(0x3c5);
107 /* The next structure holds all information relevant for a specific video mode.
115 unsigned char Init_MISC
;
116 unsigned char Init_SR00_SR04
[SIZE_SR00_SR04
];
117 unsigned char Init_SR10_SR24
[SIZE_SR10_SR24
];
118 unsigned char Init_SR30_SR75
[SIZE_SR30_SR75
];
119 unsigned char Init_SR80_SR93
[SIZE_SR80_SR93
];
120 unsigned char Init_SRA0_SRAF
[SIZE_SRA0_SRAF
];
121 unsigned char Init_GR00_GR08
[SIZE_GR00_GR08
];
122 unsigned char Init_AR00_AR14
[SIZE_AR00_AR14
];
123 unsigned char Init_CR00_CR18
[SIZE_CR00_CR18
];
124 unsigned char Init_CR30_CR4D
[SIZE_CR30_CR4D
];
125 unsigned char Init_CR90_CRA7
[SIZE_CR90_CRA7
];
128 /**********************************************************************
130 **********************************************************************/
131 struct ModeInit VGAMode
[] = {
133 /* mode#0: 640 x 480 16Bpp 60Hz */
138 0x03, 0x01, 0x0F, 0x00, 0x0E,
140 { /* Init_SR10_SR24 */
141 0xFF, 0xBE, 0xEF, 0xFF, 0x00, 0x0E, 0x17, 0x2C,
142 0x99, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
143 0xC4, 0x30, 0x02, 0x01, 0x01,
145 { /* Init_SR30_SR75 */
146 0x32, 0x03, 0xA0, 0x09, 0xC0, 0x32, 0x32, 0x32,
147 0x32, 0x32, 0x32, 0x32, 0x00, 0x00, 0x03, 0xFF,
148 0x00, 0xFC, 0x00, 0x00, 0x20, 0x18, 0x00, 0xFC,
149 0x20, 0x0C, 0x44, 0x20, 0x00, 0x32, 0x32, 0x32,
150 0x04, 0x24, 0x63, 0x4F, 0x52, 0x0B, 0xDF, 0xEA,
151 0x04, 0x50, 0x19, 0x32, 0x32, 0x00, 0x00, 0x32,
152 0x01, 0x80, 0x7E, 0x1A, 0x1A, 0x00, 0x00, 0x00,
153 0x50, 0x03, 0x74, 0x14, 0x07, 0x82, 0x07, 0x04,
154 0x00, 0x45, 0x30, 0x30, 0x40, 0x30,
156 { /* Init_SR80_SR93 */
157 0xFF, 0x07, 0x00, 0x6F, 0x7F, 0x7F, 0xFF, 0x32,
158 0xF7, 0x00, 0x00, 0x00, 0xEF, 0xFF, 0x32, 0x32,
159 0x00, 0x00, 0x00, 0x00,
161 { /* Init_SRA0_SRAF */
162 0x00, 0xFF, 0xBF, 0xFF, 0xFF, 0xED, 0xED, 0xED,
163 0x7B, 0xFF, 0xFF, 0xFF, 0xBF, 0xEF, 0xFF, 0xDF,
165 { /* Init_GR00_GR08 */
166 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0F,
169 { /* Init_AR00_AR14 */
170 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
171 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
172 0x41, 0x00, 0x0F, 0x00, 0x00,
174 { /* Init_CR00_CR18 */
175 0x5F, 0x4F, 0x4F, 0x00, 0x53, 0x1F, 0x0B, 0x3E,
176 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
177 0xEA, 0x0C, 0xDF, 0x50, 0x40, 0xDF, 0x00, 0xE3,
180 { /* Init_CR30_CR4D */
181 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x03, 0x20,
182 0x00, 0x00, 0x00, 0x40, 0x00, 0xE7, 0xFF, 0xFD,
183 0x5F, 0x4F, 0x00, 0x54, 0x00, 0x0B, 0xDF, 0x00,
184 0xEA, 0x0C, 0x2E, 0x00, 0x4F, 0xDF,
186 { /* Init_CR90_CRA7 */
187 0x56, 0xDD, 0x5E, 0xEA, 0x87, 0x44, 0x8F, 0x55,
188 0x0A, 0x8F, 0x55, 0x0A, 0x00, 0x00, 0x18, 0x00,
189 0x11, 0x10, 0x0B, 0x0A, 0x0A, 0x0A, 0x0A, 0x00,
193 /* mode#1: 640 x 480 24Bpp 60Hz */
198 0x03, 0x01, 0x0F, 0x00, 0x0E,
200 { /* Init_SR10_SR24 */
201 0xFF, 0xBE, 0xEF, 0xFF, 0x00, 0x0E, 0x17, 0x2C,
202 0x99, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
203 0xC4, 0x30, 0x02, 0x01, 0x01,
205 { /* Init_SR30_SR75 */
206 0x32, 0x03, 0xA0, 0x09, 0xC0, 0x32, 0x32, 0x32,
207 0x32, 0x32, 0x32, 0x32, 0x00, 0x00, 0x03, 0xFF,
208 0x00, 0xFC, 0x00, 0x00, 0x20, 0x18, 0x00, 0xFC,
209 0x20, 0x0C, 0x44, 0x20, 0x00, 0x32, 0x32, 0x32,
210 0x04, 0x24, 0x63, 0x4F, 0x52, 0x0B, 0xDF, 0xEA,
211 0x04, 0x50, 0x19, 0x32, 0x32, 0x00, 0x00, 0x32,
212 0x01, 0x80, 0x7E, 0x1A, 0x1A, 0x00, 0x00, 0x00,
213 0x50, 0x03, 0x74, 0x14, 0x07, 0x82, 0x07, 0x04,
214 0x00, 0x45, 0x30, 0x30, 0x40, 0x30,
216 { /* Init_SR80_SR93 */
217 0xFF, 0x07, 0x00, 0x6F, 0x7F, 0x7F, 0xFF, 0x32,
218 0xF7, 0x00, 0x00, 0x00, 0xEF, 0xFF, 0x32, 0x32,
219 0x00, 0x00, 0x00, 0x00,
221 { /* Init_SRA0_SRAF */
222 0x00, 0xFF, 0xBF, 0xFF, 0xFF, 0xED, 0xED, 0xED,
223 0x7B, 0xFF, 0xFF, 0xFF, 0xBF, 0xEF, 0xFF, 0xDF,
225 { /* Init_GR00_GR08 */
226 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0F,
229 { /* Init_AR00_AR14 */
230 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
231 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
232 0x41, 0x00, 0x0F, 0x00, 0x00,
234 { /* Init_CR00_CR18 */
235 0x5F, 0x4F, 0x4F, 0x00, 0x53, 0x1F, 0x0B, 0x3E,
236 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
237 0xEA, 0x0C, 0xDF, 0x50, 0x40, 0xDF, 0x00, 0xE3,
240 { /* Init_CR30_CR4D */
241 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x03, 0x20,
242 0x00, 0x00, 0x00, 0x40, 0x00, 0xE7, 0xFF, 0xFD,
243 0x5F, 0x4F, 0x00, 0x54, 0x00, 0x0B, 0xDF, 0x00,
244 0xEA, 0x0C, 0x2E, 0x00, 0x4F, 0xDF,
246 { /* Init_CR90_CRA7 */
247 0x56, 0xDD, 0x5E, 0xEA, 0x87, 0x44, 0x8F, 0x55,
248 0x0A, 0x8F, 0x55, 0x0A, 0x00, 0x00, 0x18, 0x00,
249 0x11, 0x10, 0x0B, 0x0A, 0x0A, 0x0A, 0x0A, 0x00,
253 /* mode#0: 640 x 480 32Bpp 60Hz */
258 0x03, 0x01, 0x0F, 0x00, 0x0E,
260 { /* Init_SR10_SR24 */
261 0xFF, 0xBE, 0xEF, 0xFF, 0x00, 0x0E, 0x17, 0x2C,
262 0x99, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
263 0xC4, 0x30, 0x02, 0x01, 0x01,
265 { /* Init_SR30_SR75 */
266 0x32, 0x03, 0xA0, 0x09, 0xC0, 0x32, 0x32, 0x32,
267 0x32, 0x32, 0x32, 0x32, 0x00, 0x00, 0x03, 0xFF,
268 0x00, 0xFC, 0x00, 0x00, 0x20, 0x18, 0x00, 0xFC,
269 0x20, 0x0C, 0x44, 0x20, 0x00, 0x32, 0x32, 0x32,
270 0x04, 0x24, 0x63, 0x4F, 0x52, 0x0B, 0xDF, 0xEA,
271 0x04, 0x50, 0x19, 0x32, 0x32, 0x00, 0x00, 0x32,
272 0x01, 0x80, 0x7E, 0x1A, 0x1A, 0x00, 0x00, 0x00,
273 0x50, 0x03, 0x74, 0x14, 0x07, 0x82, 0x07, 0x04,
274 0x00, 0x45, 0x30, 0x30, 0x40, 0x30,
276 { /* Init_SR80_SR93 */
277 0xFF, 0x07, 0x00, 0x6F, 0x7F, 0x7F, 0xFF, 0x32,
278 0xF7, 0x00, 0x00, 0x00, 0xEF, 0xFF, 0x32, 0x32,
279 0x00, 0x00, 0x00, 0x00,
281 { /* Init_SRA0_SRAF */
282 0x00, 0xFF, 0xBF, 0xFF, 0xFF, 0xED, 0xED, 0xED,
283 0x7B, 0xFF, 0xFF, 0xFF, 0xBF, 0xEF, 0xFF, 0xDF,
285 { /* Init_GR00_GR08 */
286 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0F,
289 { /* Init_AR00_AR14 */
290 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
291 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
292 0x41, 0x00, 0x0F, 0x00, 0x00,
294 { /* Init_CR00_CR18 */
295 0x5F, 0x4F, 0x4F, 0x00, 0x53, 0x1F, 0x0B, 0x3E,
296 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
297 0xEA, 0x0C, 0xDF, 0x50, 0x40, 0xDF, 0x00, 0xE3,
300 { /* Init_CR30_CR4D */
301 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x03, 0x20,
302 0x00, 0x00, 0x00, 0x40, 0x00, 0xE7, 0xFF, 0xFD,
303 0x5F, 0x4F, 0x00, 0x54, 0x00, 0x0B, 0xDF, 0x00,
304 0xEA, 0x0C, 0x2E, 0x00, 0x4F, 0xDF,
306 { /* Init_CR90_CRA7 */
307 0x56, 0xDD, 0x5E, 0xEA, 0x87, 0x44, 0x8F, 0x55,
308 0x0A, 0x8F, 0x55, 0x0A, 0x00, 0x00, 0x18, 0x00,
309 0x11, 0x10, 0x0B, 0x0A, 0x0A, 0x0A, 0x0A, 0x00,
313 { /* mode#2: 800 x 600 16Bpp 60Hz */
318 0x03, 0x01, 0x0F, 0x03, 0x0E,
320 { /* Init_SR10_SR24 */
321 0xFF, 0xBE, 0xEE, 0xFF, 0x00, 0x0E, 0x17, 0x2C,
322 0x99, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
323 0xC4, 0x30, 0x02, 0x01, 0x01,
325 { /* Init_SR30_SR75 */
326 0x34, 0x03, 0x20, 0x09, 0xC0, 0x24, 0x24, 0x24,
327 0x24, 0x24, 0x24, 0x24, 0x00, 0x00, 0x03, 0xFF,
328 0x00, 0xFC, 0x00, 0x00, 0x20, 0x38, 0x00, 0xFC,
329 0x20, 0x0C, 0x44, 0x20, 0x00, 0x24, 0x24, 0x24,
330 0x04, 0x48, 0x83, 0x63, 0x68, 0x72, 0x57, 0x58,
331 0x04, 0x55, 0x59, 0x24, 0x24, 0x00, 0x00, 0x24,
332 0x01, 0x80, 0x7A, 0x1A, 0x1A, 0x00, 0x00, 0x00,
333 0x50, 0x03, 0x74, 0x14, 0x1C, 0x85, 0x35, 0x13,
334 0x02, 0x45, 0x30, 0x35, 0x40, 0x20,
336 { /* Init_SR80_SR93 */
337 0x00, 0x00, 0x00, 0x6F, 0x7F, 0x7F, 0xFF, 0x24,
338 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x24, 0x24,
339 0x00, 0x00, 0x00, 0x00,
341 { /* Init_SRA0_SRAF */
342 0x00, 0xFF, 0xBF, 0xFF, 0xFF, 0xED, 0xED, 0xED,
343 0x7B, 0xFF, 0xFF, 0xFF, 0xBF, 0xEF, 0xBF, 0xDF,
345 { /* Init_GR00_GR08 */
346 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0F,
349 { /* Init_AR00_AR14 */
350 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
351 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
352 0x41, 0x00, 0x0F, 0x00, 0x00,
354 { /* Init_CR00_CR18 */
355 0x7F, 0x63, 0x63, 0x00, 0x68, 0x18, 0x72, 0xF0,
356 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
357 0x58, 0x0C, 0x57, 0x64, 0x40, 0x57, 0x00, 0xE3,
360 { /* Init_CR30_CR4D */
361 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x03, 0x20,
362 0x00, 0x00, 0x00, 0x40, 0x00, 0xE7, 0xBF, 0xFD,
363 0x7F, 0x63, 0x00, 0x69, 0x18, 0x72, 0x57, 0x00,
364 0x58, 0x0C, 0xE0, 0x20, 0x63, 0x57,
366 { /* Init_CR90_CRA7 */
367 0x56, 0x4B, 0x5E, 0x55, 0x86, 0x9D, 0x8E, 0xAA,
368 0xDB, 0x2A, 0xDF, 0x33, 0x00, 0x00, 0x18, 0x00,
369 0x20, 0x1F, 0x1A, 0x19, 0x0F, 0x0F, 0x0F, 0x00,
372 { /* mode#3: 800 x 600 24Bpp 60Hz */
376 0x03, 0x01, 0x0F, 0x03, 0x0E,
378 { /* Init_SR10_SR24 */
379 0xFF, 0xBE, 0xEE, 0xFF, 0x00, 0x0E, 0x17, 0x2C,
380 0x99, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
381 0xC4, 0x30, 0x02, 0x01, 0x01,
383 { /* Init_SR30_SR75 */
384 0x36, 0x03, 0x20, 0x09, 0xC0, 0x36, 0x36, 0x36,
385 0x36, 0x36, 0x36, 0x36, 0x00, 0x00, 0x03, 0xFF,
386 0x00, 0xFC, 0x00, 0x00, 0x20, 0x18, 0x00, 0xFC,
387 0x20, 0x0C, 0x44, 0x20, 0x00, 0x36, 0x36, 0x36,
388 0x04, 0x48, 0x83, 0x63, 0x68, 0x72, 0x57, 0x58,
389 0x04, 0x55, 0x59, 0x36, 0x36, 0x00, 0x00, 0x36,
390 0x01, 0x80, 0x7E, 0x1A, 0x1A, 0x00, 0x00, 0x00,
391 0x50, 0x03, 0x74, 0x14, 0x1C, 0x85, 0x35, 0x13,
392 0x02, 0x45, 0x30, 0x30, 0x40, 0x20,
394 { /* Init_SR80_SR93 */
395 0xFF, 0x07, 0x00, 0x6F, 0x7F, 0x7F, 0xFF, 0x36,
396 0xF7, 0x00, 0x00, 0x00, 0xEF, 0xFF, 0x36, 0x36,
397 0x00, 0x00, 0x00, 0x00,
399 { /* Init_SRA0_SRAF */
400 0x00, 0xFF, 0xBF, 0xFF, 0xFF, 0xED, 0xED, 0xED,
401 0x7B, 0xFF, 0xFF, 0xFF, 0xBF, 0xEF, 0xBF, 0xDF,
403 { /* Init_GR00_GR08 */
404 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0F,
407 { /* Init_AR00_AR14 */
408 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
409 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
410 0x41, 0x00, 0x0F, 0x00, 0x00,
412 { /* Init_CR00_CR18 */
413 0x7F, 0x63, 0x63, 0x00, 0x68, 0x18, 0x72, 0xF0,
414 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
415 0x58, 0x0C, 0x57, 0x64, 0x40, 0x57, 0x00, 0xE3,
418 { /* Init_CR30_CR4D */
419 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x03, 0x20,
420 0x00, 0x00, 0x00, 0x40, 0x00, 0xE7, 0xBF, 0xFD,
421 0x7F, 0x63, 0x00, 0x69, 0x18, 0x72, 0x57, 0x00,
422 0x58, 0x0C, 0xE0, 0x20, 0x63, 0x57,
424 { /* Init_CR90_CRA7 */
425 0x56, 0x4B, 0x5E, 0x55, 0x86, 0x9D, 0x8E, 0xAA,
426 0xDB, 0x2A, 0xDF, 0x33, 0x00, 0x00, 0x18, 0x00,
427 0x20, 0x1F, 0x1A, 0x19, 0x0F, 0x0F, 0x0F, 0x00,
430 { /* mode#7: 800 x 600 32Bpp 60Hz */
435 0x03, 0x01, 0x0F, 0x03, 0x0E,
437 { /* Init_SR10_SR24 */
438 0xFF, 0xBE, 0xEE, 0xFF, 0x00, 0x0E, 0x17, 0x2C,
439 0x99, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
440 0xC4, 0x30, 0x02, 0x01, 0x01,
442 { /* Init_SR30_SR75 */
443 0x34, 0x03, 0x20, 0x09, 0xC0, 0x24, 0x24, 0x24,
444 0x24, 0x24, 0x24, 0x24, 0x00, 0x00, 0x03, 0xFF,
445 0x00, 0xFC, 0x00, 0x00, 0x20, 0x38, 0x00, 0xFC,
446 0x20, 0x0C, 0x44, 0x20, 0x00, 0x24, 0x24, 0x24,
447 0x04, 0x48, 0x83, 0x63, 0x68, 0x72, 0x57, 0x58,
448 0x04, 0x55, 0x59, 0x24, 0x24, 0x00, 0x00, 0x24,
449 0x01, 0x80, 0x7A, 0x1A, 0x1A, 0x00, 0x00, 0x00,
450 0x50, 0x03, 0x74, 0x14, 0x1C, 0x85, 0x35, 0x13,
451 0x02, 0x45, 0x30, 0x35, 0x40, 0x20,
453 { /* Init_SR80_SR93 */
454 0x00, 0x00, 0x00, 0x6F, 0x7F, 0x7F, 0xFF, 0x24,
455 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x24, 0x24,
456 0x00, 0x00, 0x00, 0x00,
458 { /* Init_SRA0_SRAF */
459 0x00, 0xFF, 0xBF, 0xFF, 0xFF, 0xED, 0xED, 0xED,
460 0x7B, 0xFF, 0xFF, 0xFF, 0xBF, 0xEF, 0xBF, 0xDF,
462 { /* Init_GR00_GR08 */
463 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0F,
466 { /* Init_AR00_AR14 */
467 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
468 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
469 0x41, 0x00, 0x0F, 0x00, 0x00,
471 { /* Init_CR00_CR18 */
472 0x7F, 0x63, 0x63, 0x00, 0x68, 0x18, 0x72, 0xF0,
473 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
474 0x58, 0x0C, 0x57, 0x64, 0x40, 0x57, 0x00, 0xE3,
477 { /* Init_CR30_CR4D */
478 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x03, 0x20,
479 0x00, 0x00, 0x00, 0x40, 0x00, 0xE7, 0xBF, 0xFD,
480 0x7F, 0x63, 0x00, 0x69, 0x18, 0x72, 0x57, 0x00,
481 0x58, 0x0C, 0xE0, 0x20, 0x63, 0x57,
483 { /* Init_CR90_CRA7 */
484 0x56, 0x4B, 0x5E, 0x55, 0x86, 0x9D, 0x8E, 0xAA,
485 0xDB, 0x2A, 0xDF, 0x33, 0x00, 0x00, 0x18, 0x00,
486 0x20, 0x1F, 0x1A, 0x19, 0x0F, 0x0F, 0x0F, 0x00,
489 /* We use 1024x768 table to light 1024x600 panel for lemote */
490 { /* mode#4: 1024 x 600 16Bpp 60Hz */
495 0x03, 0x01, 0x0F, 0x00, 0x0E,
497 { /* Init_SR10_SR24 */
498 0xC8, 0x40, 0x14, 0x60, 0x00, 0x0A, 0x17, 0x20,
499 0x51, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
500 0xC4, 0x30, 0x02, 0x00, 0x01,
502 { /* Init_SR30_SR75 */
503 0x22, 0x03, 0x24, 0x09, 0xC0, 0x22, 0x22, 0x22,
504 0x22, 0x22, 0x22, 0x22, 0x00, 0x00, 0x03, 0xFF,
505 0x00, 0xFC, 0x00, 0x00, 0x20, 0x18, 0x00, 0xFC,
506 0x20, 0x0C, 0x44, 0x20, 0x00, 0x22, 0x22, 0x22,
507 0x06, 0x68, 0xA7, 0x7F, 0x83, 0x24, 0xFF, 0x03,
508 0x00, 0x60, 0x59, 0x22, 0x22, 0x00, 0x00, 0x22,
509 0x01, 0x80, 0x7A, 0x1A, 0x1A, 0x00, 0x00, 0x00,
510 0x50, 0x03, 0x16, 0x02, 0x0D, 0x82, 0x09, 0x02,
511 0x04, 0x45, 0x3F, 0x30, 0x40, 0x20,
513 { /* Init_SR80_SR93 */
514 0xFF, 0x07, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x3A,
515 0xF7, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x3A, 0x3A,
516 0x00, 0x00, 0x00, 0x00,
518 { /* Init_SRA0_SRAF */
519 0x00, 0xFB, 0x9F, 0x01, 0x00, 0xED, 0xED, 0xED,
520 0x7B, 0xFB, 0xFF, 0xFF, 0x97, 0xEF, 0xBF, 0xDF,
522 { /* Init_GR00_GR08 */
523 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0F,
526 { /* Init_AR00_AR14 */
527 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
528 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
529 0x41, 0x00, 0x0F, 0x00, 0x00,
531 { /* Init_CR00_CR18 */
532 0xA3, 0x7F, 0x7F, 0x00, 0x85, 0x16, 0x24, 0xF5,
533 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
534 0x03, 0x09, 0xFF, 0x80, 0x40, 0xFF, 0x00, 0xE3,
537 { /* Init_CR30_CR4D */
538 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, 0x20,
539 0x00, 0x00, 0x00, 0x40, 0x00, 0xFF, 0xBF, 0xFF,
540 0xA3, 0x7F, 0x00, 0x82, 0x0b, 0x6f, 0x57, 0x00,
541 0x5c, 0x0f, 0xE0, 0xe0, 0x7F, 0x57,
543 { /* Init_CR90_CRA7 */
544 0x55, 0xD9, 0x5D, 0xE1, 0x86, 0x1B, 0x8E, 0x26,
545 0xDA, 0x8D, 0xDE, 0x94, 0x00, 0x00, 0x18, 0x00,
546 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x15, 0x03,
549 { /* mode#5: 1024 x 768 24Bpp 60Hz */
554 0x03, 0x01, 0x0F, 0x03, 0x0E,
556 { /* Init_SR10_SR24 */
557 0xF3, 0xB6, 0xC0, 0xDD, 0x00, 0x0E, 0x17, 0x2C,
558 0x99, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
559 0xC4, 0x30, 0x02, 0x01, 0x01,
561 { /* Init_SR30_SR75 */
562 0x38, 0x03, 0x20, 0x09, 0xC0, 0x3A, 0x3A, 0x3A,
563 0x3A, 0x3A, 0x3A, 0x3A, 0x00, 0x00, 0x03, 0xFF,
564 0x00, 0xFC, 0x00, 0x00, 0x20, 0x18, 0x00, 0xFC,
565 0x20, 0x0C, 0x44, 0x20, 0x00, 0x00, 0x00, 0x3A,
566 0x06, 0x68, 0xA7, 0x7F, 0x83, 0x24, 0xFF, 0x03,
567 0x00, 0x60, 0x59, 0x3A, 0x3A, 0x00, 0x00, 0x3A,
568 0x01, 0x80, 0x7E, 0x1A, 0x1A, 0x00, 0x00, 0x00,
569 0x50, 0x03, 0x74, 0x14, 0x3B, 0x0D, 0x09, 0x02,
570 0x04, 0x45, 0x30, 0x30, 0x40, 0x20,
572 { /* Init_SR80_SR93 */
573 0xFF, 0x07, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x3A,
574 0xF7, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x3A, 0x3A,
575 0x00, 0x00, 0x00, 0x00,
577 { /* Init_SRA0_SRAF */
578 0x00, 0xFB, 0x9F, 0x01, 0x00, 0xED, 0xED, 0xED,
579 0x7B, 0xFB, 0xFF, 0xFF, 0x97, 0xEF, 0xBF, 0xDF,
581 { /* Init_GR00_GR08 */
582 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0F,
585 { /* Init_AR00_AR14 */
586 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
587 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
588 0x41, 0x00, 0x0F, 0x00, 0x00,
590 { /* Init_CR00_CR18 */
591 0xA3, 0x7F, 0x7F, 0x00, 0x85, 0x16, 0x24, 0xF5,
592 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
593 0x03, 0x09, 0xFF, 0x80, 0x40, 0xFF, 0x00, 0xE3,
596 { /* Init_CR30_CR4D */
597 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, 0x20,
598 0x00, 0x00, 0x00, 0x40, 0x00, 0xFF, 0xBF, 0xFF,
599 0xA3, 0x7F, 0x00, 0x86, 0x15, 0x24, 0xFF, 0x00,
600 0x01, 0x07, 0xE5, 0x20, 0x7F, 0xFF,
602 { /* Init_CR90_CRA7 */
603 0x55, 0xD9, 0x5D, 0xE1, 0x86, 0x1B, 0x8E, 0x26,
604 0xDA, 0x8D, 0xDE, 0x94, 0x00, 0x00, 0x18, 0x00,
605 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x15, 0x03,
608 { /* mode#4: 1024 x 768 32Bpp 60Hz */
613 0x03, 0x01, 0x0F, 0x03, 0x0E,
615 { /* Init_SR10_SR24 */
616 0xF3, 0xB6, 0xC0, 0xDD, 0x00, 0x0E, 0x17, 0x2C,
617 0x99, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
618 0xC4, 0x32, 0x02, 0x01, 0x01,
620 { /* Init_SR30_SR75 */
621 0x38, 0x03, 0x20, 0x09, 0xC0, 0x3A, 0x3A, 0x3A,
622 0x3A, 0x3A, 0x3A, 0x3A, 0x00, 0x00, 0x03, 0xFF,
623 0x00, 0xFC, 0x00, 0x00, 0x20, 0x18, 0x00, 0xFC,
624 0x20, 0x0C, 0x44, 0x20, 0x00, 0x00, 0x00, 0x3A,
625 0x06, 0x68, 0xA7, 0x7F, 0x83, 0x24, 0xFF, 0x03,
626 0x00, 0x60, 0x59, 0x3A, 0x3A, 0x00, 0x00, 0x3A,
627 0x01, 0x80, 0x7E, 0x1A, 0x1A, 0x00, 0x00, 0x00,
628 0x50, 0x03, 0x74, 0x14, 0x3B, 0x0D, 0x09, 0x02,
629 0x04, 0x45, 0x30, 0x30, 0x40, 0x20,
631 { /* Init_SR80_SR93 */
632 0xFF, 0x07, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x3A,
633 0xF7, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x3A, 0x3A,
634 0x00, 0x00, 0x00, 0x00,
636 { /* Init_SRA0_SRAF */
637 0x00, 0xFB, 0x9F, 0x01, 0x00, 0xED, 0xED, 0xED,
638 0x7B, 0xFB, 0xFF, 0xFF, 0x97, 0xEF, 0xBF, 0xDF,
640 { /* Init_GR00_GR08 */
641 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0F,
644 { /* Init_AR00_AR14 */
645 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
646 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
647 0x41, 0x00, 0x0F, 0x00, 0x00,
649 { /* Init_CR00_CR18 */
650 0xA3, 0x7F, 0x7F, 0x00, 0x85, 0x16, 0x24, 0xF5,
651 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
652 0x03, 0x09, 0xFF, 0x80, 0x40, 0xFF, 0x00, 0xE3,
655 { /* Init_CR30_CR4D */
656 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, 0x20,
657 0x00, 0x00, 0x00, 0x40, 0x00, 0xFF, 0xBF, 0xFF,
658 0xA3, 0x7F, 0x00, 0x86, 0x15, 0x24, 0xFF, 0x00,
659 0x01, 0x07, 0xE5, 0x20, 0x7F, 0xFF,
661 { /* Init_CR90_CRA7 */
662 0x55, 0xD9, 0x5D, 0xE1, 0x86, 0x1B, 0x8E, 0x26,
663 0xDA, 0x8D, 0xDE, 0x94, 0x00, 0x00, 0x18, 0x00,
664 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x15, 0x03,
667 { /* mode#6: 320 x 240 16Bpp 60Hz */
672 0x03, 0x01, 0x0F, 0x03, 0x0E,
674 { /* Init_SR10_SR24 */
675 0xF3, 0xB6, 0xC0, 0xDD, 0x00, 0x0E, 0x17, 0x2C,
676 0x99, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
677 0xC4, 0x32, 0x02, 0x01, 0x01,
679 { /* Init_SR30_SR75 */
680 0x38, 0x03, 0x20, 0x09, 0xC0, 0x3A, 0x3A, 0x3A,
681 0x3A, 0x3A, 0x3A, 0x3A, 0x00, 0x00, 0x03, 0xFF,
682 0x00, 0xFC, 0x00, 0x00, 0x20, 0x18, 0x00, 0xFC,
683 0x20, 0x0C, 0x44, 0x20, 0x00, 0x00, 0x00, 0x3A,
684 0x06, 0x68, 0xA7, 0x7F, 0x83, 0x24, 0xFF, 0x03,
685 0x00, 0x60, 0x59, 0x3A, 0x3A, 0x00, 0x00, 0x3A,
686 0x01, 0x80, 0x7E, 0x1A, 0x1A, 0x00, 0x00, 0x00,
687 0x50, 0x03, 0x74, 0x14, 0x08, 0x43, 0x08, 0x43,
688 0x04, 0x45, 0x30, 0x30, 0x40, 0x20,
690 { /* Init_SR80_SR93 */
691 0xFF, 0x07, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x3A,
692 0xF7, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x3A, 0x3A,
693 0x00, 0x00, 0x00, 0x00,
695 { /* Init_SRA0_SRAF */
696 0x00, 0xFB, 0x9F, 0x01, 0x00, 0xED, 0xED, 0xED,
697 0x7B, 0xFB, 0xFF, 0xFF, 0x97, 0xEF, 0xBF, 0xDF,
699 { /* Init_GR00_GR08 */
700 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0F,
703 { /* Init_AR00_AR14 */
704 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
705 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
706 0x41, 0x00, 0x0F, 0x00, 0x00,
708 { /* Init_CR00_CR18 */
709 0xA3, 0x7F, 0x7F, 0x00, 0x85, 0x16, 0x24, 0xF5,
710 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
711 0x03, 0x09, 0xFF, 0x80, 0x40, 0xFF, 0x00, 0xE3,
714 { /* Init_CR30_CR4D */
715 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, 0x20,
716 0x00, 0x00, 0x30, 0x40, 0x00, 0xFF, 0xBF, 0xFF,
717 0x2E, 0x27, 0x00, 0x2b, 0x0c, 0x0F, 0xEF, 0x00,
718 0xFe, 0x0f, 0x01, 0xC0, 0x27, 0xEF,
720 { /* Init_CR90_CRA7 */
721 0x55, 0xD9, 0x5D, 0xE1, 0x86, 0x1B, 0x8E, 0x26,
722 0xDA, 0x8D, 0xDE, 0x94, 0x00, 0x00, 0x18, 0x00,
723 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x15, 0x03,
727 { /* mode#8: 320 x 240 32Bpp 60Hz */
732 0x03, 0x01, 0x0F, 0x03, 0x0E,
734 { /* Init_SR10_SR24 */
735 0xF3, 0xB6, 0xC0, 0xDD, 0x00, 0x0E, 0x17, 0x2C,
736 0x99, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
737 0xC4, 0x32, 0x02, 0x01, 0x01,
739 { /* Init_SR30_SR75 */
740 0x38, 0x03, 0x20, 0x09, 0xC0, 0x3A, 0x3A, 0x3A,
741 0x3A, 0x3A, 0x3A, 0x3A, 0x00, 0x00, 0x03, 0xFF,
742 0x00, 0xFC, 0x00, 0x00, 0x20, 0x18, 0x00, 0xFC,
743 0x20, 0x0C, 0x44, 0x20, 0x00, 0x00, 0x00, 0x3A,
744 0x06, 0x68, 0xA7, 0x7F, 0x83, 0x24, 0xFF, 0x03,
745 0x00, 0x60, 0x59, 0x3A, 0x3A, 0x00, 0x00, 0x3A,
746 0x01, 0x80, 0x7E, 0x1A, 0x1A, 0x00, 0x00, 0x00,
747 0x50, 0x03, 0x74, 0x14, 0x08, 0x43, 0x08, 0x43,
748 0x04, 0x45, 0x30, 0x30, 0x40, 0x20,
750 { /* Init_SR80_SR93 */
751 0xFF, 0x07, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x3A,
752 0xF7, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x3A, 0x3A,
753 0x00, 0x00, 0x00, 0x00,
755 { /* Init_SRA0_SRAF */
756 0x00, 0xFB, 0x9F, 0x01, 0x00, 0xED, 0xED, 0xED,
757 0x7B, 0xFB, 0xFF, 0xFF, 0x97, 0xEF, 0xBF, 0xDF,
759 { /* Init_GR00_GR08 */
760 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0F,
763 { /* Init_AR00_AR14 */
764 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
765 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
766 0x41, 0x00, 0x0F, 0x00, 0x00,
768 { /* Init_CR00_CR18 */
769 0xA3, 0x7F, 0x7F, 0x00, 0x85, 0x16, 0x24, 0xF5,
770 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
771 0x03, 0x09, 0xFF, 0x80, 0x40, 0xFF, 0x00, 0xE3,
774 { /* Init_CR30_CR4D */
775 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, 0x20,
776 0x00, 0x00, 0x30, 0x40, 0x00, 0xFF, 0xBF, 0xFF,
777 0x2E, 0x27, 0x00, 0x2b, 0x0c, 0x0F, 0xEF, 0x00,
778 0xFe, 0x0f, 0x01, 0xC0, 0x27, 0xEF,
780 { /* Init_CR90_CRA7 */
781 0x55, 0xD9, 0x5D, 0xE1, 0x86, 0x1B, 0x8E, 0x26,
782 0xDA, 0x8D, 0xDE, 0x94, 0x00, 0x00, 0x18, 0x00,
783 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x15, 0x03,
788 #define numVGAModes ARRAY_SIZE(VGAMode)