aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/sis/initdef.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/sis/initdef.h')
-rw-r--r--drivers/video/sis/initdef.h145
1 files changed, 91 insertions, 54 deletions
diff --git a/drivers/video/sis/initdef.h b/drivers/video/sis/initdef.h
index 55a82d6dc4cf..264b55a5947b 100644
--- a/drivers/video/sis/initdef.h
+++ b/drivers/video/sis/initdef.h
@@ -3,7 +3,7 @@
3/* 3/*
4 * Global definitions for init.c and init301.c 4 * Global definitions for init.c and init301.c
5 * 5 *
6 * Copyright (C) 2001-2004 by Thomas Winischhofer, Vienna, Austria 6 * Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria
7 * 7 *
8 * If distributed as part of the Linux kernel, the following license terms 8 * If distributed as part of the Linux kernel, the following license terms
9 * apply: 9 * apply:
@@ -53,19 +53,20 @@
53#ifndef _INITDEF_ 53#ifndef _INITDEF_
54#define _INITDEF_ 54#define _INITDEF_
55 55
56#define IS_SIS330 (HwInfo->jChipType == SIS_330) 56#define IS_SIS330 (SiS_Pr->ChipType == SIS_330)
57#define IS_SIS550 (HwInfo->jChipType == SIS_550) 57#define IS_SIS550 (SiS_Pr->ChipType == SIS_550)
58#define IS_SIS650 (HwInfo->jChipType == SIS_650) /* All versions, incl 651, M65x */ 58#define IS_SIS650 (SiS_Pr->ChipType == SIS_650) /* All versions, incl 651, M65x */
59#define IS_SIS740 (HwInfo->jChipType == SIS_740) 59#define IS_SIS740 (SiS_Pr->ChipType == SIS_740)
60#define IS_SIS651 (SiS_Pr->SiS_SysFlags & (SF_Is651 | SF_Is652)) 60#define IS_SIS651 (SiS_Pr->SiS_SysFlags & (SF_Is651 | SF_Is652))
61#define IS_SISM650 (SiS_Pr->SiS_SysFlags & (SF_IsM650 | SF_IsM652 | SF_IsM653)) 61#define IS_SISM650 (SiS_Pr->SiS_SysFlags & (SF_IsM650 | SF_IsM652 | SF_IsM653))
62#define IS_SIS65x (IS_SIS651 || IS_SISM650) /* Only special versions of 65x */ 62#define IS_SIS65x (IS_SIS651 || IS_SISM650) /* Only special versions of 65x */
63#define IS_SIS661 (HwInfo->jChipType == SIS_661) 63#define IS_SIS661 (SiS_Pr->ChipType == SIS_661)
64#define IS_SIS741 (HwInfo->jChipType == SIS_741) 64#define IS_SIS741 (SiS_Pr->ChipType == SIS_741)
65#define IS_SIS660 (HwInfo->jChipType == SIS_660) 65#define IS_SIS660 (SiS_Pr->ChipType == SIS_660)
66#define IS_SIS760 (HwInfo->jChipType == SIS_760) 66#define IS_SIS760 (SiS_Pr->ChipType == SIS_760)
67#define IS_SIS661741660760 (IS_SIS661 || IS_SIS741 || IS_SIS660 || IS_SIS760) 67#define IS_SIS761 (SiS_Pr->ChipType == SIS_761)
68#define IS_SIS650740 ((HwInfo->jChipType >= SIS_650) && (HwInfo->jChipType < SIS_330)) 68#define IS_SIS661741660760 (IS_SIS661 || IS_SIS741 || IS_SIS660 || IS_SIS760 || IS_SIS761)
69#define IS_SIS650740 ((SiS_Pr->ChipType >= SIS_650) && (SiS_Pr->ChipType < SIS_330))
69#define IS_SIS550650740 (IS_SIS550 || IS_SIS650740) 70#define IS_SIS550650740 (IS_SIS550 || IS_SIS650740)
70#define IS_SIS650740660 (IS_SIS650 || IS_SIS740 || IS_SIS661741660760) 71#define IS_SIS650740660 (IS_SIS650 || IS_SIS740 || IS_SIS661741660760)
71#define IS_SIS550650740660 (IS_SIS550 || IS_SIS650740660) 72#define IS_SIS550650740660 (IS_SIS550 || IS_SIS650740660)
@@ -73,24 +74,37 @@
73#define SISGETROMW(x) (ROMAddr[(x)] | (ROMAddr[(x)+1] << 8)) 74#define SISGETROMW(x) (ROMAddr[(x)] | (ROMAddr[(x)+1] << 8))
74 75
75/* SiS_VBType */ 76/* SiS_VBType */
76#define VB_SIS301 0x0001 77#define VB_SIS301 0x0001
77#define VB_SIS301B 0x0002 78#define VB_SIS301B 0x0002
78#define VB_SIS302B 0x0004 79#define VB_SIS302B 0x0004
79#define VB_SIS301LV 0x0008 80#define VB_SIS301LV 0x0008
80#define VB_SIS302LV 0x0010 81#define VB_SIS302LV 0x0010
81#define VB_SIS302ELV 0x0020 82#define VB_SIS302ELV 0x0020
82#define VB_SIS301C 0x0040 83#define VB_SIS301C 0x0040
84#define VB_SIS307T 0x0080
85#define VB_SIS307LV 0x0100
83#define VB_UMC 0x4000 86#define VB_UMC 0x4000
84#define VB_NoLCD 0x8000 87#define VB_NoLCD 0x8000
85#define VB_SIS301BLV302BLV (VB_SIS301B|VB_SIS301C|VB_SIS302B|VB_SIS301LV|VB_SIS302LV|VB_SIS302ELV) 88#define VB_SIS30xB (VB_SIS301B | VB_SIS301C | VB_SIS302B | VB_SIS307T)
86#define VB_SIS301B302B (VB_SIS301B|VB_SIS301C|VB_SIS302B) 89#define VB_SIS30xC (VB_SIS301C | VB_SIS307T)
87#define VB_SIS301LV302LV (VB_SIS301LV|VB_SIS302LV|VB_SIS302ELV) 90#define VB_SISTMDS (VB_SIS301 | VB_SIS301B | VB_SIS301C | VB_SIS302B | VB_SIS307T)
88#define VB_SISVB (VB_SIS301 | VB_SIS301BLV302BLV) 91#define VB_SISLVDS (VB_SIS301LV | VB_SIS302LV | VB_SIS302ELV | VB_SIS307LV)
89#define VB_SISTMDS (VB_SIS301 | VB_SIS301B302B) 92#define VB_SIS30xBLV (VB_SIS30xB | VB_SISLVDS)
90#define VB_SISLVDS VB_SIS301LV302LV 93#define VB_SIS30xCLV (VB_SIS30xC | VB_SIS302ELV | VB_SIS307LV)
91#define VB_SISLCDA (VB_SIS302B|VB_SIS301C|VB_SIS301LV|VB_SIS302LV|VB_SIS302ELV) 94#define VB_SISVB (VB_SIS301 | VB_SIS30xBLV)
92#define VB_SISYPBPR (VB_SIS301C|VB_SIS301LV|VB_SIS302LV|VB_SIS302ELV) 95#define VB_SISLCDA (VB_SIS302B | VB_SIS301C | VB_SIS307T | VB_SISLVDS)
93#define VB_SISHIVISION (VB_SIS301|VB_SIS301B|VB_SIS302B) 96#define VB_SISTMDSLCDA (VB_SIS301C | VB_SIS307T)
97#define VB_SISPART4SCALER (VB_SIS301C | VB_SIS307T | VB_SIS302ELV | VB_SIS307LV)
98#define VB_SISHIVISION (VB_SIS301 | VB_SIS301B | VB_SIS302B)
99#define VB_SISYPBPR (VB_SIS301C | VB_SIS307T | VB_SIS301LV | VB_SIS302LV | VB_SIS302ELV | VB_SIS307LV)
100#define VB_SISTAP4SCALER (VB_SIS301C | VB_SIS307T | VB_SIS302ELV | VB_SIS307LV)
101#define VB_SISPART4OVERFLOW (VB_SIS301C | VB_SIS307T | VB_SIS302LV | VB_SIS302ELV | VB_SIS307LV)
102#define VB_SISPWD (VB_SIS301C | VB_SIS307T | VB_SISLVDS)
103#define VB_SISEMI (VB_SIS302LV | VB_SIS302ELV | VB_SIS307LV)
104#define VB_SISPOWER (VB_SIS301C | VB_SIS307T | VB_SIS302LV | VB_SIS302ELV | VB_SIS307LV)
105#define VB_SISDUALLINK (VB_SIS302LV | VB_SIS302ELV | VB_SIS307T | VB_SIS307LV)
106#define VB_SISVGA2 VB_SISTMDS
107#define VB_SISRAMDAC202 (VB_SIS301C | VB_SIS307T)
94 108
95/* VBInfo */ 109/* VBInfo */
96#define SetSimuScanMode 0x0001 /* CR 30 */ 110#define SetSimuScanMode 0x0001 /* CR 30 */
@@ -160,6 +174,7 @@
160#define SupportRAMDAC2_202 0x0400 /* C (<= 202Mhz) */ 174#define SupportRAMDAC2_202 0x0400 /* C (<= 202Mhz) */
161#define InterlaceMode 0x0080 175#define InterlaceMode 0x0080
162#define SyncPP 0x0000 176#define SyncPP 0x0000
177#define HaveWideTiming 0x2000 /* Have specific wide- and non-wide timing */
163#define SyncPN 0x4000 178#define SyncPN 0x4000
164#define SyncNP 0x8000 179#define SyncNP 0x8000
165#define SyncNN 0xc000 180#define SyncNN 0xc000
@@ -188,6 +203,7 @@
188#define TVSetTVSimuMode 0x0200 /* new 0x200, prev. 0x800 */ 203#define TVSetTVSimuMode 0x0200 /* new 0x200, prev. 0x800 */
189#define TVRPLLDIV2XO 0x0400 /* prev 0x1000 */ 204#define TVRPLLDIV2XO 0x0400 /* prev 0x1000 */
190#define TVSetNTSC1024 0x0800 /* new 0x100, prev. 0x2000 */ 205#define TVSetNTSC1024 0x0800 /* new 0x100, prev. 0x2000 */
206#define TVSet525p1024 0x1000 /* TW */
191#define TVAspect43 0x2000 207#define TVAspect43 0x2000
192#define TVAspect169 0x4000 208#define TVAspect169 0x4000
193#define TVAspect43LB 0x8000 209#define TVAspect43LB 0x8000
@@ -208,7 +224,8 @@
208#define SF_IsM661 0x0020 224#define SF_IsM661 0x0020
209#define SF_IsM741 0x0040 225#define SF_IsM741 0x0040
210#define SF_IsM760 0x0080 226#define SF_IsM760 0x0080
211#define SF_760LFB 0x8000 /* 760: We have LFB */ 227#define SF_760UMA 0x4000 /* 76x: We have UMA */
228#define SF_760LFB 0x8000 /* 76x: We have LFB */
212 229
213/* CR32 (Newer 630, and 315 series) 230/* CR32 (Newer 630, and 315 series)
214 231
@@ -228,25 +245,19 @@
228#define TVOverScanShift 4 245#define TVOverScanShift 4
229 246
230/* CR35 (661 series only) 247/* CR35 (661 series only)
231
232 [0] 1 = PAL, 0 = NTSC 248 [0] 1 = PAL, 0 = NTSC
233 [1] 1 = NTSC-J (if D0 = 0) 249 [1] 1 = NTSC-J (if D0 = 0)
234 [2] 1 = PALM (if D0 = 1) 250 [2] 1 = PALM (if D0 = 1)
235 [3] 1 = PALN (if D0 = 1) 251 [3] 1 = PALN (if D0 = 1)
236 [4] 1 = Overscan (Chrontel only) 252 [4] 1 = Overscan (Chrontel only)
237 [7:5] (only if D2 in CR38 is set) 253 [7:5] (only if D2 in CR38 is set)
238 000 525i 254 000 525i
239 001 525p 255 001 525p
240 010 750p 256 010 750p
241 011 1080i (or HiVision on 301, 301B) 257 011 1080i (or HiVision on 301, 301B)
242
243 These bits are being translated to TVMode flag.
244
245*/ 258*/
246 259
247/* 260/* CR37
248 CR37
249
250 [0] Set 24/18 bit (0/1) RGB to LVDS/TMDS transmitter (set by BIOS) 261 [0] Set 24/18 bit (0/1) RGB to LVDS/TMDS transmitter (set by BIOS)
251 [3:1] External chip 262 [3:1] External chip
252 300 series: 263 300 series:
@@ -260,7 +271,7 @@
260 010 LVDS 271 010 LVDS
261 011 LVDS + Chrontel 7019 272 011 LVDS + Chrontel 7019
262 660 series [2:1] only: 273 660 series [2:1] only:
263 reserved (now in CR38) 274 reserved (chip type now in CR38)
264 All other combinations reserved 275 All other combinations reserved
265 [3] 661 only: Pass 1:1 data 276 [3] 661 only: Pass 1:1 data
266 [4] LVDS: 0: Panel Link expands / 1: Panel Link does not expand 277 [4] LVDS: 0: Panel Link expands / 1: Panel Link does not expand
@@ -320,6 +331,7 @@
320#define Enable302LV_DualLink 0x04 /* 302LV only; enable dual link */ 331#define Enable302LV_DualLink 0x04 /* 302LV only; enable dual link */
321 332
322/* CR39 (661 and later) 333/* CR39 (661 and later)
334 D[7] LVDS (SiS or third party)
323 D[1:0] YPbPr Aspect Ratio 335 D[1:0] YPbPr Aspect Ratio
324 00 4:3 letterbox 336 00 4:3 letterbox
325 01 4:3 337 01 4:3
@@ -341,7 +353,7 @@
341 0101 Set Contrast event 353 0101 Set Contrast event
342 0110 Set Mute event 354 0110 Set Mute event
343 0111 Set Volume Up/Down event 355 0111 Set Volume Up/Down event
344 [4] Enable Backlight Control by BIOS/driver 356 [4] Enable Backlight Control by BIOS/driver
345 (set by driver; set means that the BIOS should 357 (set by driver; set means that the BIOS should
346 not touch the backlight registers because eg. 358 not touch the backlight registers because eg.
347 the driver already switched off the backlight) 359 the driver already switched off the backlight)
@@ -350,6 +362,26 @@
350 [7] TV UnderScan/OverScan (set by BIOS) 362 [7] TV UnderScan/OverScan (set by BIOS)
351*/ 363*/
352 364
365/* CR7C - 661 and later
366 [7] DualEdge enabled (or: to be enabled)
367 [6] CRT2 = TV/LCD/VGA enabled (or: to be enabled)
368 [5] Init done (set at end of SiS_Init)
369 {4] LVDS LCD capabilities
370 [3] LVDS LCD capabilities
371 [2] LVDS LCD capabilities (PWD)
372 [1] LVDS LCD capabilities (PWD)
373 [0] LVDS=1, TMDS=0 (SiS or third party)
374*/
375
376/* CR7E - 661 and later
377 VBType:
378 [7] LVDS (third party)
379 [3] 301C
380 [2] 302LV
381 [1] 301LV
382 [0] 301B
383*/
384
353/* LCDResInfo */ 385/* LCDResInfo */
354#define Panel300_800x600 0x01 /* CR36 */ 386#define Panel300_800x600 0x01 /* CR36 */
355#define Panel300_1024x768 0x02 387#define Panel300_1024x768 0x02
@@ -359,7 +391,6 @@
359#define Panel300_1024x600 0x06 391#define Panel300_1024x600 0x06
360#define Panel300_1152x768 0x07 392#define Panel300_1152x768 0x07
361#define Panel300_1280x768 0x0a 393#define Panel300_1280x768 0x0a
362#define Panel300_320x480 0x0e /* fstn - This is fake, can be any */
363#define Panel300_Custom 0x0f 394#define Panel300_Custom 0x0f
364#define Panel300_Barco1366 0x10 395#define Panel300_Barco1366 0x10
365 396
@@ -374,9 +405,9 @@
374#define Panel310_1400x1050 0x09 405#define Panel310_1400x1050 0x09
375#define Panel310_1280x768 0x0a 406#define Panel310_1280x768 0x0a
376#define Panel310_1600x1200 0x0b 407#define Panel310_1600x1200 0x0b
377#define Panel310_640x480_2 0x0c 408#define Panel310_320x240_2 0x0c /* xSTN */
378#define Panel310_640x480_3 0x0d 409#define Panel310_320x240_3 0x0d /* xSTN */
379#define Panel310_320x480 0x0e /* fstn - TW: This is fake, can be any */ 410#define Panel310_320x240_1 0x0e /* xSTN - This is fake, can be any */
380#define Panel310_Custom 0x0f 411#define Panel310_Custom 0x0f
381 412
382#define Panel661_800x600 0x01 413#define Panel661_800x600 0x01
@@ -386,7 +417,7 @@
386#define Panel661_1024x600 0x05 417#define Panel661_1024x600 0x05
387#define Panel661_1152x864 0x06 418#define Panel661_1152x864 0x06
388#define Panel661_1280x960 0x07 419#define Panel661_1280x960 0x07
389#define Panel661_1152x768 0x08 420#define Panel661_1280x854 0x08
390#define Panel661_1400x1050 0x09 421#define Panel661_1400x1050 0x09
391#define Panel661_1280x768 0x0a 422#define Panel661_1280x768 0x0a
392#define Panel661_1600x1200 0x0b 423#define Panel661_1600x1200 0x0b
@@ -410,14 +441,16 @@
410#define Panel_1680x1050 0x0d /* 661etc */ 441#define Panel_1680x1050 0x0d /* 661etc */
411#define Panel_1280x720 0x0e /* 661etc */ 442#define Panel_1280x720 0x0e /* 661etc */
412#define Panel_Custom 0x0f /* MUST BE 0x0f (for DVI DDC detection) */ 443#define Panel_Custom 0x0f /* MUST BE 0x0f (for DVI DDC detection) */
413#define Panel_320x480 0x10 /* SiS 550 fstn - TW: This is fake, can be any */ 444#define Panel_320x240_1 0x10 /* SiS 550 xSTN */
414#define Panel_Barco1366 0x11 445#define Panel_Barco1366 0x11
415#define Panel_848x480 0x12 446#define Panel_848x480 0x12
416#define Panel_640x480_2 0x13 /* SiS 550 */ 447#define Panel_320x240_2 0x13 /* SiS 550 xSTN */
417#define Panel_640x480_3 0x14 /* SiS 550 */ 448#define Panel_320x240_3 0x14 /* SiS 550 xSTN */
418#define Panel_1280x768_2 0x15 /* 30xLV */ 449#define Panel_1280x768_2 0x15 /* 30xLV */
419#define Panel_1280x768_3 0x16 /* (unused) */ 450#define Panel_1280x768_3 0x16 /* (unused) */
420#define Panel_1280x800_2 0x17 /* 30xLV */ 451#define Panel_1280x800_2 0x17 /* 30xLV */
452#define Panel_856x480 0x18
453#define Panel_1280x854 0x19 /* 661etc */
421 454
422/* Index in ModeResInfo table */ 455/* Index in ModeResInfo table */
423#define SIS_RI_320x200 0 456#define SIS_RI_320x200 0
@@ -454,6 +487,7 @@
454#define SIS_RI_1920x1080 31 487#define SIS_RI_1920x1080 31
455#define SIS_RI_960x540 32 488#define SIS_RI_960x540 32
456#define SIS_RI_960x600 33 489#define SIS_RI_960x600 33
490#define SIS_RI_1280x854 34
457 491
458/* CR5F */ 492/* CR5F */
459#define IsM650 0x80 493#define IsM650 0x80
@@ -482,16 +516,18 @@
482#define VCLK100_300 0x43 /* Index in VCLKData table (300) */ 516#define VCLK100_300 0x43 /* Index in VCLKData table (300) */
483#define VCLK34_300 0x3d /* Index in VCLKData table (300) */ 517#define VCLK34_300 0x3d /* Index in VCLKData table (300) */
484#define VCLK_CUSTOM_300 0x47 518#define VCLK_CUSTOM_300 0x47
485#define VCLK65_315 0x0b /* Index in (VB)VCLKData table (315) */ 519
486#define VCLK108_2_315 0x19 /* Index in (VB)VCLKData table (315) */ 520#define VCLK65_315 0x0b /* Indices in (VB)VCLKData table (315) */
487#define VCLK81_315 0x5b /* Index in (VB)VCLKData table (315) */ 521#define VCLK108_2_315 0x19
488#define VCLK162_315 0x5e /* Index in (VB)VCLKData table (315) */ 522#define VCLK81_315 0x5b
489#define VCLK108_3_315 0x45 /* Index in VBVCLKData table (315) */ 523#define VCLK162_315 0x5e
490#define VCLK100_315 0x46 /* Index in VBVCLKData table (315) */ 524#define VCLK108_3_315 0x45
525#define VCLK100_315 0x46
491#define VCLK34_315 0x55 526#define VCLK34_315 0x55
492#define VCLK68_315 0x0d 527#define VCLK68_315 0x0d
493#define VCLK_1280x800_315_2 0x5c /* Index in VBVCLKData table (315) */ 528#define VCLK_1280x800_315_2 0x5c
494#define VCLK121_315 0x5d /* Index in VBVCLKData table (315) */ 529#define VCLK121_315 0x5d
530#define VCLK130_315 0x72
495#define VCLK_1280x720 0x5f 531#define VCLK_1280x720 0x5f
496#define VCLK_1280x768_2 0x60 532#define VCLK_1280x768_2 0x60
497#define VCLK_1280x768_3 0x61 /* (unused?) */ 533#define VCLK_1280x768_3 0x61 /* (unused?) */
@@ -507,6 +543,7 @@
507#define VCLK_1152x864 0x64 543#define VCLK_1152x864 0x64
508#define VCLK_1360x768 0x58 544#define VCLK_1360x768 0x58
509#define VCLK_1280x800_315 0x6c 545#define VCLK_1280x800_315 0x6c
546#define VCLK_1280x854 0x76
510 547
511#define TVCLKBASE_300 0x21 /* Indices on TV clocks in VCLKData table (300) */ 548#define TVCLKBASE_300 0x21 /* Indices on TV clocks in VCLKData table (300) */
512#define TVCLKBASE_315 0x3a /* Indices on TV clocks in (VB)VCLKData table (315) */ 549#define TVCLKBASE_315 0x3a /* Indices on TV clocks in (VB)VCLKData table (315) */