initdef.h 25 KB

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