ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / drivers / video / sis / initdef.h
1 /* $XFree86$ */
2 /*
3  * Global definitions for init.c and init301.c
4  *
5  * Copyright (C) 2001-2004 by Thomas Winischhofer, Vienna, Austria
6  *
7  * If distributed as part of the Linux kernel, the following license terms
8  * apply:
9  *
10  * * This program is free software; you can redistribute it and/or modify
11  * * it under the terms of the GNU General Public License as published by
12  * * the Free Software Foundation; either version 2 of the named License,
13  * * or any later version.
14  * *
15  * * This program is distributed in the hope that it will be useful,
16  * * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * * GNU General Public License for more details.
19  * *
20  * * You should have received a copy of the GNU General Public License
21  * * along with this program; if not, write to the Free Software
22  * * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
23  *
24  * Otherwise, the following license terms apply:
25  *
26  * * Redistribution and use in source and binary forms, with or without
27  * * modification, are permitted provided that the following conditions
28  * * are met:
29  * * 1) Redistributions of source code must retain the above copyright
30  * *    notice, this list of conditions and the following disclaimer.
31  * * 2) Redistributions in binary form must reproduce the above copyright
32  * *    notice, this list of conditions and the following disclaimer in the
33  * *    documentation and/or other materials provided with the distribution.
34  * * 3) All advertising materials mentioning features or use of this software
35  * *    must display the following acknowledgement: "This product includes
36  * *    software developed by Thomas Winischhofer, Vienna, Austria."
37  * * 4) The name of the author may not be used to endorse or promote products
38  * *    derived from this software without specific prior written permission.
39  * *
40  * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
41  * * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
42  * * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
43  * * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
44  * * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
45  * * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
46  * * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
47  * * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
48  * * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
49  * * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
50  *
51  * Author:      Thomas Winischhofer <thomas@winischhofer.net>
52  *
53  */
54
55 #ifndef _INITDEF_
56 #define _INITDEF_
57
58 #define IS_SIS330               (HwInfo->jChipType == SIS_330)
59 #define IS_SIS550               (HwInfo->jChipType == SIS_550)
60 #define IS_SIS650               (HwInfo->jChipType == SIS_650)  /* All versions, incl 651, M65x */
61 #define IS_SIS740               (HwInfo->jChipType == SIS_740)
62 #define IS_SIS651               (SiS_Pr->SiS_SysFlags & (SF_Is651 | SF_Is652))
63 #define IS_SISM650              (SiS_Pr->SiS_SysFlags & (SF_IsM650 | SF_IsM652 | SF_IsM653))
64 #define IS_SIS65x               (IS_SIS651 || IS_SISM650)       /* Only special versions of 65x */
65 #define IS_SIS661               (HwInfo->jChipType == SIS_661)
66 #define IS_SIS741               (HwInfo->jChipType == SIS_741)
67 #define IS_SIS660               (HwInfo->jChipType == SIS_660)
68 #define IS_SIS760               (HwInfo->jChipType == SIS_760)
69 #define IS_SIS661741660760      (IS_SIS661 || IS_SIS741 || IS_SIS660 || IS_SIS760)
70 #define IS_SIS650740            ((HwInfo->jChipType >= SIS_650) && (HwInfo->jChipType < SIS_330))
71 #define IS_SIS550650740         (IS_SIS550 || IS_SIS650740)
72 #define IS_SIS650740660         (IS_SIS650 || IS_SIS740 || IS_SIS661741660760)
73 #define IS_SIS550650740660      (IS_SIS550 || IS_SIS650740660)
74
75 /* SiS_VBType */
76 #define VB_SIS301               0x0001
77 #define VB_SIS301B              0x0002
78 #define VB_SIS302B              0x0004
79 #define VB_SIS301LV             0x0008
80 #define VB_SIS302LV             0x0010
81 #define VB_SIS302ELV            0x0020
82 #define VB_SIS301C              0x0040
83 #define VB_NoLCD                0x8000
84 #define VB_SIS301BLV302BLV      (VB_SIS301B|VB_SIS301C|VB_SIS302B|VB_SIS301LV|VB_SIS302LV|VB_SIS302ELV)
85 #define VB_SIS301B302B          (VB_SIS301B|VB_SIS301C|VB_SIS302B)
86 #define VB_SIS301LV302LV        (VB_SIS301LV|VB_SIS302LV|VB_SIS302ELV)
87 #define VB_SISVB                (VB_SIS301 | VB_SIS301BLV302BLV)
88
89 /* VBInfo */
90 #define SetSimuScanMode         0x0001   /* CR 30 */
91 #define SwitchCRT2              0x0002
92 #define SetCRT2ToAVIDEO         0x0004
93 #define SetCRT2ToSVIDEO         0x0008
94 #define SetCRT2ToSCART          0x0010
95 #define SetCRT2ToLCD            0x0020
96 #define SetCRT2ToRAMDAC         0x0040
97 #define SetCRT2ToHiVision       0x0080                  /* for SiS bridge */
98 #define SetCRT2ToCHYPbPr        SetCRT2ToHiVision       /* for Chrontel   */
99 #define SetNTSCTV               0x0000   /* CR 31 */
100 #define SetPALTV                0x0100                  /* Deprecated here, now in TVMode */
101 #define SetInSlaveMode          0x0200
102 #define SetNotSimuMode          0x0400
103 #define SetNotSimuTVMode        SetNotSimuMode
104 #define SetDispDevSwitch        0x0800
105 #define SetCRT2ToYPbPr525750    0x0800
106 #define LoadDACFlag             0x1000
107 #define DisableCRT2Display      0x2000
108 #define DriverMode              0x4000
109 #define HotKeySwitch            0x8000
110 #define SetCRT2ToLCDA           0x8000
111
112 /* v-- Needs change in sis_vga.c if changed (GPIO) --v */
113 #define SetCRT2ToTV             (SetCRT2ToYPbPr525750|SetCRT2ToHiVision|SetCRT2ToSCART|SetCRT2ToSVIDEO|SetCRT2ToAVIDEO)
114 #define SetCRT2ToTVNoYPbPrHiVision (SetCRT2ToSCART | SetCRT2ToSVIDEO | SetCRT2ToAVIDEO)
115 #define SetCRT2ToTVNoHiVision   (SetCRT2ToYPbPr525750 | SetCRT2ToSCART | SetCRT2ToSVIDEO | SetCRT2ToAVIDEO)
116
117 /* SiS_ModeType */
118 #define ModeText                0x00
119 #define ModeCGA                 0x01
120 #define ModeEGA                 0x02
121 #define ModeVGA                 0x03
122 #define Mode15Bpp               0x04
123 #define Mode16Bpp               0x05
124 #define Mode24Bpp               0x06
125 #define Mode32Bpp               0x07
126
127 #define ModeInfoFlag            0x07
128 #define IsTextMode              0x07
129
130 #define DACInfoFlag             0x0018
131 #define MemoryInfoFlag          0x01E0
132 #define MemorySizeShift         5
133
134 /* modeflag */
135 #define Charx8Dot               0x0200
136 #define LineCompareOff          0x0400
137 #define CRT2Mode                0x0800
138 #define HalfDCLK                0x1000
139 #define NoSupportSimuTV         0x2000
140 #define DoubleScanMode          0x8000
141
142 /* Infoflag */
143 #define SupportTV               0x0008
144 #define SupportTV1024           0x0800
145 #define SupportCHTV             0x0800
146 #define Support64048060Hz       0x0800  /* Special for 640x480 LCD */
147 #define SupportHiVision         0x0010
148 #define SupportYPbPr            0x1000  /* TODO */
149 #define SupportLCD              0x0020
150 #define SupportRAMDAC2          0x0040  /* All           (<= 100Mhz) */
151 #define SupportRAMDAC2_135      0x0100  /* All except DH (<= 135Mhz) */
152 #define SupportRAMDAC2_162      0x0200  /* B, C          (<= 162Mhz) */
153 #define SupportRAMDAC2_202      0x0400  /* C             (<= 202Mhz) */
154 #define InterlaceMode           0x0080
155 #define SyncPP                  0x0000
156 #define SyncPN                  0x4000
157 #define SyncNP                  0x8000
158 #define SyncNN                  0xc000
159
160 /* SetFlag */
161 #define ProgrammingCRT2         0x0001
162 #define LowModeTests            0x0002
163 /* #define TVSimuMode           0x0002 - deprecated */
164 /* #define RPLLDIV2XO           0x0004 - deprecated */
165 #define LCDVESATiming           0x0008
166 #define EnableLVDSDDA           0x0010
167 #define SetDispDevSwitchFlag    0x0020
168 #define CheckWinDos             0x0040
169 #define SetDOSMode              0x0080
170
171 /* TVMode flag */
172 #define TVSetPAL                0x0001
173 #define TVSetNTSCJ              0x0002
174 #define TVSetPALM               0x0004
175 #define TVSetPALN               0x0008
176 #define TVSetCHOverScan         0x0010
177 #define TVSetYPbPr525i          0x0020
178 #define TVSetYPbPr525p          0x0040
179 #define TVSetYPbPr750p          0x0080
180 #define TVSetHiVision           0x0100  /* = 1080i, software-wise identical */
181 #define TVSetTVSimuMode         0x0800
182 #define TVRPLLDIV2XO            0x1000
183 #define TVSetNTSC1024           0x2000
184
185 /* YPbPr flag (>=315, <661) */
186 #define YPbPr525p               0x0001  /* 525p */
187 #define YPbPr750p               0x0002  /* 750p */
188 #define YPbPr525i               0x0004  /* 525p */
189 #define YPbPrHiVision           0x0008  /* HiVision or 1080i (bridge type dependent) */
190 #define YPbPrModeMask           (YPbPr750p | YPbPr525p | YPbPr525i | YPbPrHiVision)
191
192 /* SysFlags (to identify special versions) */
193 #define SF_Is651                0x0001
194 #define SF_IsM650               0x0002
195 #define SF_Is652                0x0004
196 #define SF_IsM652               0x0008
197 #define SF_IsM653               0x0010
198 #define SF_IsM661               0x0020
199 #define SF_IsM741               0x0040
200 #define SF_IsM760               0x0080
201
202 /* CR32 (Newer 630, and 315 series)
203
204    [0]   VB connected with CVBS
205    [1]   VB connected with SVHS
206    [2]   VB connected with SCART
207    [3]   VB connected with LCD
208    [4]   VB connected with CRT2 (secondary VGA)
209    [5]   CRT1 monitor is connected
210    [6]   VB connected with Hi-Vision TV
211    [7]   <= 330: VB connected with DVI combo connector
212          >= 661: VB connected to YPbPr
213 */
214
215 /* CR35 (300 series only) */
216 #define TVOverScan              0x10
217 #define TVOverScanShift         4
218
219 /* CR35 (661 series only)
220
221    [0]    1 = PAL, 0 = NTSC
222    [1]    1 = NTSC-J (if D0 = 0)
223    [2]    1 = PALM (if D0 = 1)
224    [3]    1 = PALN (if D0 = 1)
225    [4]    1 = Overscan (Chrontel only)
226    [7:5]  (only if D2 in CR38 is set)
227           000  525i
228           001  525p
229           010  750p
230           011  1080i (or HiVision on 301, 301B)
231
232    These bits are being translated to TVMode flag.
233
234 */
235
236 /*
237    CR37
238
239    [0]   Set 24/18 bit (0/1) RGB to LVDS/TMDS transmitter (set by BIOS)
240    [3:1] External chip
241          300 series:
242             001   SiS301 (never seen)
243             010   LVDS
244             011   LVDS + Tumpion Zurac
245             100   LVDS + Chrontel 7005
246             110   Chrontel 7005
247           315/330 series
248             001   SiS30x (never seen)
249             010   LVDS
250             011   LVDS + Chrontel 7019
251           660 series [2:1] only:
252              reserved (now in CR38)
253           All other combinations reserved
254    [3]    661 only: Pass 1:1 data
255    [4]    LVDS: 0: Panel Link expands / 1: Panel Link does not expand
256           30x:  0: Bridge scales      / 1: Bridge does not scale = Panel scales (if possible)
257    [5]    LCD polarity select
258           0: VESA DMT Standard
259           1: EDID 2.x defined
260    [6]    LCD horizontal polarity select
261           0: High active
262           1: Low active
263    [7]    LCD vertical polarity select
264           0: High active
265           1: Low active
266 */
267
268 /* CR37: LCDInfo */
269 #define LCDRGB18Bit           0x0001
270 #define LCDNonExpanding       0x0010
271 #define LCDSync               0x0020
272 #define LCDPass11             0x0100
273 #define LCDDualLink           0x0200
274
275 #define DontExpandLCD         LCDNonExpanding
276 #define LCDNonExpandingShift       4
277 #define DontExpandLCDShift    LCDNonExpandingShift
278 #define LCDSyncBit            0x00e0
279 #define LCDSyncShift               6
280
281 /* CR38 (315 series) */
282 #define EnableDualEdge          0x01
283 #define SetToLCDA               0x02   /* LCD channel A (301C/302B/30x(E)LV and 650+LVDS only) */
284 #define EnableCHScart           0x04   /* Scart on Ch7019 (unofficial definition - TW) */
285 #define EnableCHYPbPr           0x08   /* YPbPr on Ch7019 (480i HDTV); only on 650/Ch7019 systems */
286 #define EnableSiSYPbPr          0x08   /* Enable YPbPr mode (30xLV/301C only) */
287 #define EnableYPbPr525i         0x00   /* Enable 525i YPbPr mode (30xLV/301C only) (mask 0x30) */
288 #define EnableYPbPr525p         0x10   /* Enable 525p YPbPr mode (30xLV/301C only) (mask 0x30) */
289 #define EnableYPbPr750p         0x20   /* Enable 750p YPbPr mode (30xLV/301C only) (mask 0x30) */
290 #define EnableYPbPr1080i        0x30   /* Enable 1080i YPbPr mode (30xLV/301C only) (mask 0x30) */
291 #define EnablePALM              0x40   /* 1 = Set PALM */
292 #define EnablePALN              0x80   /* 1 = Set PALN */
293 #define EnableNTSCJ             EnablePALM  /* Not BIOS */
294
295 /* CR38 (661 and later)
296   D[7:5]  000 No VB
297           001 301 series VB
298           010 LVDS
299           011 Chrontel 7019
300           100 Conexant
301   D2      Enable YPbPr output (see CR35)
302   D[1:0]  LCDA (like before)
303 */
304
305 #define EnablePALMN             0x40   /* Romflag: 1 = Allow PALM/PALN */
306
307 /* CR39 (650 only) */
308 #define LCDPass1_1              0x01   /* LVDS only; set by driver to pass 1:1 data to LVDS output  */
309 #define Enable302LV_DualLink    0x04   /* 302LV only; enable dual link */
310
311 /* CR39 (661 and later)
312    D[1:0] YPbPr Aspect Ratio
313           00 4:3 letterbox
314           01 4:3
315           10 16:9
316           11 4:3
317 */
318
319 /* CR3B (651+301C)
320    D[1:0] YPbPr Aspect Ratio
321           ?
322 */
323
324 /* CR79 (315/330 series only; not 661 and later)
325    [3-0] Notify driver
326          0001 Mode Switch event (set by BIOS)
327          0010 Epansion On/Off event
328          0011 TV UnderScan/OverScan event
329          0100 Set Brightness event
330          0101 Set Contrast event
331          0110 Set Mute event
332          0111 Set Volume Up/Down event
333    [4]   Enable Backlight Control by BIOS/driver 
334          (set by driver; set means that the BIOS should
335          not touch the backlight registers because eg.
336          the driver already switched off the backlight)
337    [5]   PAL/NTSC (set by BIOS)
338    [6]   Expansion On/Off (set by BIOS; copied to CR32[4])
339    [7]   TV UnderScan/OverScan (set by BIOS)
340 */
341
342 /* LCDResInfo */
343 #define Panel300_800x600        0x01    /* CR36 */
344 #define Panel300_1024x768       0x02
345 #define Panel300_1280x1024      0x03
346 #define Panel300_1280x960       0x04
347 #define Panel300_640x480        0x05
348 #define Panel300_1024x600       0x06
349 #define Panel300_1152x768       0x07
350 #define Panel300_1280x768       0x0a
351 #define Panel300_320x480        0x0e    /* fstn - TW: This is fake, can be any */
352 #define Panel300_Custom         0x0f
353 #define Panel300_Barco1366      0x10
354
355 #define Panel310_800x600        0x01
356 #define Panel310_1024x768       0x02
357 #define Panel310_1280x1024      0x03
358 #define Panel310_640x480        0x04
359 #define Panel310_1024x600       0x05
360 #define Panel310_1152x864       0x06
361 #define Panel310_1280x960       0x07
362 #define Panel310_1152x768       0x08    /* LVDS only */
363 #define Panel310_1400x1050      0x09
364 #define Panel310_1280x768       0x0a
365 #define Panel310_1600x1200      0x0b
366 #define Panel310_640x480_2      0x0c
367 #define Panel310_640x480_3      0x0d
368 #define Panel310_320x480        0x0e    /* fstn - TW: This is fake, can be any */
369 #define Panel310_Custom         0x0f
370
371 #define Panel_800x600           0x01    /* Unified values */
372 #define Panel_1024x768          0x02
373 #define Panel_1280x1024         0x03
374 #define Panel_640x480           0x04
375 #define Panel_1024x600          0x05
376 #define Panel_1152x864          0x06
377 #define Panel_1280x960          0x07
378 #define Panel_1152x768          0x08    /* LVDS only */
379 #define Panel_1400x1050         0x09
380 #define Panel_1280x768          0x0a    /* LVDS only */
381 #define Panel_1600x1200         0x0b
382 #define Panel_640x480_2         0x0c
383 #define Panel_640x480_3         0x0d
384 #define Panel_320x480           0x0e    /* fstn - TW: This is fake, can be any */
385 #define Panel_Custom            0x0f
386 #define Panel_Barco1366         0x10
387 #define Panel_848x480           0x11
388 #define Panel_1280x800          0x12    /* 661etc: 0x0c */
389 #define Panel_1680x1050         0x13    /* 661etc: 0x0d */
390
391 /* Index in ModeResInfo table */
392 #define SIS_RI_320x200    0
393 #define SIS_RI_320x240    1
394 #define SIS_RI_320x400    2
395 #define SIS_RI_400x300    3
396 #define SIS_RI_512x384    4
397 #define SIS_RI_640x400    5
398 #define SIS_RI_640x480    6
399 #define SIS_RI_800x600    7
400 #define SIS_RI_1024x768   8
401 #define SIS_RI_1280x1024  9
402 #define SIS_RI_1600x1200 10
403 #define SIS_RI_1920x1440 11
404 #define SIS_RI_2048x1536 12
405 #define SIS_RI_720x480   13
406 #define SIS_RI_720x576   14
407 #define SIS_RI_1280x960  15
408 #define SIS_RI_800x480   16
409 #define SIS_RI_1024x576  17
410 #define SIS_RI_1280x720  18
411 #define SIS_RI_856x480   19
412 #define SIS_RI_1280x768  20
413 #define SIS_RI_1400x1050 21
414 #define SIS_RI_1152x864  22  /* Up to this SiS conforming */
415 #define SIS_RI_848x480   23
416 #define SIS_RI_1360x768  24
417 #define SIS_RI_1024x600  25
418 #define SIS_RI_1152x768  26
419 #define SIS_RI_768x576   27
420 #define SIS_RI_1360x1024 28
421
422 /* CR5F */
423 #define IsM650                  0x80
424
425 /* Timing data */
426 #define NTSCHT                  1716
427 #define NTSC2HT                 1920
428 #define NTSCVT                  525
429 #define PALHT                   1728
430 #define PALVT                   625
431 #define StHiTVHT                892
432 #define StHiTVVT                1126
433 #define StHiTextTVHT            1000
434 #define StHiTextTVVT            1126
435 #define ExtHiTVHT               2100
436 #define ExtHiTVVT               1125
437
438 /* Indices in (VB)VCLKData tables */
439
440 #define VCLK28                  0x00   /* Index in VCLKData table (300 and 315) */
441 #define VCLK40                  0x04   /* Index in VCLKData table (300 and 315) */
442 #define VCLK65_300              0x09   /* Index in VCLKData table (300) */
443 #define VCLK108_2_300           0x14   /* Index in VCLKData table (300) */
444 #define VCLK81_300              0x3f   /* Index in VCLKData table (300) */
445 #define VCLK108_3_300           0x42   /* Index in VCLKData table (300) */
446 #define VCLK100_300             0x43   /* Index in VCLKData table (300) */
447 #define VCLK34_300              0x3d   /* Index in VCLKData table (300) */
448 #define VCLK65_315              0x0b   /* Index in (VB)VCLKData table (315) */
449 #define VCLK108_2_315           0x19   /* Index in (VB)VCLKData table (315) */
450 #define VCLK81_315              0x5b   /* Index in (VB)VCLKData table (315) */
451 #define VCLK162_315             0x21   /* Index in (VB)VCLKData table (315) */
452 #define VCLK108_3_315           0x45   /* Index in VBVCLKData table (315) */
453 #define VCLK100_315             0x46   /* Index in VBVCLKData table (315) */
454 #define VCLK34_315              0x55   /* Index in VBVCLKData table (315) */
455 #define VCLK68_315              0x0d
456
457 #define TVCLKBASE_300           0x21   /* Indices on TV clocks in VCLKData table (300) */
458 #define TVCLKBASE_315           0x3a   /* Indices on TV clocks in (VB)VCLKData table (315) */
459 #define TVVCLKDIV2              0x00   /* Index relative to TVCLKBASE */
460 #define TVVCLK                  0x01   /* Index relative to TVCLKBASE */
461 #define HiTVVCLKDIV2            0x02   /* Index relative to TVCLKBASE */
462 #define HiTVVCLK                0x03   /* Index relative to TVCLKBASE */
463 #define HiTVSimuVCLK            0x04   /* Index relative to TVCLKBASE */
464 #define HiTVTextVCLK            0x05   /* Index relative to TVCLKBASE */
465 #define YPbPr750pVCLK           0x0f   /* NOT relative to TVCLKBASE ! */
466
467 /* ------------------------------ */
468
469 #define SetSCARTOutput          0x01
470
471 #define HotPlugFunction         0x08
472
473 #define StStructSize            0x06
474
475 #define SIS_VIDEO_CAPTURE       0x00 - 0x30
476 #define SIS_VIDEO_PLAYBACK      0x02 - 0x30
477 #define SIS_CRT2_PORT_04        0x04 - 0x30
478 #define SIS_CRT2_PORT_10        0x10 - 0x30
479 #define SIS_CRT2_PORT_12        0x12 - 0x30
480 #define SIS_CRT2_PORT_14        0x14 - 0x30
481
482 #define ADR_CRT2PtrData         0x20E
483 #define offset_Zurac            0x210   /* TW: Trumpion Zurac data pointer */
484 #define ADR_LVDSDesPtrData      0x212
485 #define ADR_LVDSCRT1DataPtr     0x214
486 #define ADR_CHTVVCLKPtr         0x216
487 #define ADR_CHTVRegDataPtr      0x218
488
489 #define LCDDataLen              8
490 #define HiTVDataLen             12
491 #define TVDataLen               16
492
493 #define LVDSDataLen             6
494 #define LVDSDesDataLen          3
495 #define ActiveNonExpanding      0x40
496 #define ActiveNonExpandingShift 6
497 #define ActivePAL               0x20
498 #define ActivePALShift          5
499 #define ModeSwitchStatus        0x0F
500 #define SoftTVType              0x40
501 #define SoftSettingAddr         0x52
502 #define ModeSettingAddr         0x53
503
504 #define _PanelType00             0x00
505 #define _PanelType01             0x08
506 #define _PanelType02             0x10
507 #define _PanelType03             0x18
508 #define _PanelType04             0x20
509 #define _PanelType05             0x28
510 #define _PanelType06             0x30
511 #define _PanelType07             0x38
512 #define _PanelType08             0x40
513 #define _PanelType09             0x48
514 #define _PanelType0A             0x50
515 #define _PanelType0B             0x58
516 #define _PanelType0C             0x60
517 #define _PanelType0D             0x68
518 #define _PanelType0E             0x70
519 #define _PanelType0F             0x78
520
521 #define PRIMARY_VGA             0     /* 1: SiS is primary vga 0:SiS is secondary vga */
522
523 #define BIOSIDCodeAddr          0x235  /* Offsets to ptrs in BIOS image */
524 #define OEMUtilIDCodeAddr       0x237
525 #define VBModeIDTableAddr       0x239
526 #define OEMTVPtrAddr            0x241
527 #define PhaseTableAddr          0x243
528 #define NTSCFilterTableAddr     0x245
529 #define PALFilterTableAddr      0x247
530 #define OEMLCDPtr_1Addr         0x249
531 #define OEMLCDPtr_2Addr         0x24B
532 #define LCDHPosTable_1Addr      0x24D
533 #define LCDHPosTable_2Addr      0x24F
534 #define LCDVPosTable_1Addr      0x251
535 #define LCDVPosTable_2Addr      0x253
536 #define OEMLCDPIDTableAddr      0x255
537
538 #define VBModeStructSize        5
539 #define PhaseTableSize          4
540 #define FilterTableSize         4
541 #define LCDHPosTableSize        7
542 #define LCDVPosTableSize        5
543 #define OEMLVDSPIDTableSize     4
544 #define LVDSHPosTableSize       4
545 #define LVDSVPosTableSize       6
546
547 #define VB_ModeID               0
548 #define VB_TVTableIndex         1
549 #define VB_LCDTableIndex        2
550 #define VB_LCDHIndex            3
551 #define VB_LCDVIndex            4
552
553 #define OEMLCDEnable            0x0001
554 #define OEMLCDDelayEnable       0x0002
555 #define OEMLCDPOSEnable         0x0004
556 #define OEMTVEnable             0x0100
557 #define OEMTVDelayEnable        0x0200
558 #define OEMTVFlickerEnable      0x0400
559 #define OEMTVPhaseEnable        0x0800
560 #define OEMTVFilterEnable       0x1000
561
562 #define OEMLCDPanelIDSupport    0x0080
563
564 /*
565   =============================================================
566                           for 315 series
567   =============================================================
568 */
569 #define SoftDRAMType        0x80
570 #define SoftSetting_OFFSET  0x52
571 #define SR07_OFFSET  0x7C
572 #define SR15_OFFSET  0x7D
573 #define SR16_OFFSET  0x81
574 #define SR17_OFFSET  0x85
575 #define SR19_OFFSET  0x8D
576 #define SR1F_OFFSET  0x99
577 #define SR21_OFFSET  0x9A
578 #define SR22_OFFSET  0x9B
579 #define SR23_OFFSET  0x9C
580 #define SR24_OFFSET  0x9D
581 #define SR25_OFFSET  0x9E
582 #define SR31_OFFSET  0x9F
583 #define SR32_OFFSET  0xA0
584 #define SR33_OFFSET  0xA1
585
586 #define CR40_OFFSET  0xA2
587 #define SR25_1_OFFSET  0xF6
588 #define CR49_OFFSET  0xF7
589
590 #define VB310Data_1_2_Offset  0xB6
591 #define VB310Data_4_D_Offset  0xB7
592 #define VB310Data_4_E_Offset  0xB8
593 #define VB310Data_4_10_Offset 0xBB
594
595 #define RGBSenseDataOffset    0xBD
596 #define YCSenseDataOffset     0xBF
597 #define VideoSenseDataOffset  0xC1
598 #define OutputSelectOffset    0xF3
599
600 #define ECLK_MCLK_DISTANCE  0x14
601 #define VBIOSTablePointerStart    0x100
602 #define StandTablePtrOffset       VBIOSTablePointerStart+0x02
603 #define EModeIDTablePtrOffset     VBIOSTablePointerStart+0x04
604 #define CRT1TablePtrOffset        VBIOSTablePointerStart+0x06
605 #define ScreenOffsetPtrOffset     VBIOSTablePointerStart+0x08
606 #define VCLKDataPtrOffset         VBIOSTablePointerStart+0x0A
607 #define MCLKDataPtrOffset         VBIOSTablePointerStart+0x0E
608 #define CRT2PtrDataPtrOffset      VBIOSTablePointerStart+0x10
609 #define TVAntiFlickPtrOffset      VBIOSTablePointerStart+0x12
610 #define TVDelayPtr1Offset         VBIOSTablePointerStart+0x14
611 #define TVPhaseIncrPtr1Offset     VBIOSTablePointerStart+0x16
612 #define TVYFilterPtr1Offset       VBIOSTablePointerStart+0x18
613 #define LCDDelayPtr1Offset        VBIOSTablePointerStart+0x20
614 #define TVEdgePtr1Offset          VBIOSTablePointerStart+0x24
615 #define CRT2Delay1Offset          VBIOSTablePointerStart+0x28
616
617 #endif