Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1039 lines
36 KiB

  1. /*/****************************************************************************
  2. * name: mga.h
  3. *
  4. * description: This file contains all the definitions related to the MGA
  5. * hardware. As CADDI is coded partly in C and in ASM the
  6. * permitted definitions are simple #define .
  7. *
  8. * designed:
  9. * last modified: $Author: ctoutant $, $Date: 94/06/10 09:38:20 $
  10. *
  11. * version: $Id: MGA.H 1.29 94/06/10 09:38:20 ctoutant Exp $
  12. *
  13. ******************************************************************************/
  14. /*****************************************************************************
  15. ADDRESSING SECTION:
  16. This section contains all the definitions to access a ressource on the MGA.
  17. The way to build an address is divided in three parts:
  18. mga_base_address + device_offset + register_offset
  19. mga_base_address: Where is mapped the MGA in the system,
  20. device_offset: The offset of the device (i.e. Titan) in the MGA space,
  21. register_offset: The offset of the register in the device space.
  22. Base addresses and Offsets are in BYTE units as 80x86 physical addresses.
  23. */
  24. #define MGA_ISA_BASE_1 0xac000
  25. #define MGA_ISA_BASE_2 0xc8000
  26. #define MGA_ISA_BASE_3 0xcc000
  27. #define MGA_ISA_BASE_4 0xd0000
  28. #define MGA_ISA_BASE_5 0xd4000
  29. #define MGA_ISA_BASE_6 0xd8000
  30. #define MGA_ISA_BASE_7 0xdc000
  31. /*** #define MGA_WIDEBUS_BASE_1 ***/
  32. #define TITAN_OFFSET 0x1c00
  33. #define SRC_WIN_OFFSET 0x0000
  34. #define PSEUDO_DMA_WIN_OFFSET 0x0000
  35. #define DST_WIN_OFFSET 0x2000
  36. #define RAMDAC_OFFSET 0x3c00 /*** BYTE ACCESSES ONLY ***/
  37. #define DUBIC_OFFSET 0x3c80 /*** BYTE ACCESSES ONLY ***/
  38. #define VIWIC_OFFSET 0x3d00 /*** BYTE ACCESSES ONLY ***/
  39. #define CLKGEN_OFFSET 0x3d80 /*** BYTE ACCESSES ONLY ***/
  40. #define EXPDEV_OFFSET 0x3e00 /*** BYTE ACCESSES ONLY ***/
  41. /*** As per Titan (Drawing Engine) specification 1.0 ***/
  42. #define TITAN_DRAWING_ENGINE_RANGE 0x1ff
  43. #define TITAN_GO 0x100
  44. #define TITAN_DWGCTL 0x000
  45. #define TITAN_MACCESS 0x004
  46. #define TITAN_MCTLWTST 0x008
  47. #define TITAN_DST0 0x010
  48. #define TITAN_DST1 0x014
  49. #define TITAN_ZMSK 0x018
  50. #define TITAN_PLNWT 0x01C
  51. #define TITAN_BCOL 0x020
  52. #define TITAN_FCOL 0x024
  53. #define TITAN_SRCBLT 0x02C
  54. #define TITAN_SRC0 0x030
  55. #define TITAN_SRC1 0x034
  56. #define TITAN_SRC2 0x038
  57. #define TITAN_SRC3 0x03C
  58. #define TITAN_XYSTRT 0x040
  59. #define TITAN_XYEND 0x044
  60. #define TITAN_SHIFT 0x050
  61. #define TITAN_SGN 0x058
  62. #define TITAN_LEN 0x05C
  63. #define TITAN_AR0 0x060
  64. #define TITAN_AR1 0x064
  65. #define TITAN_AR2 0x068
  66. #define TITAN_AR3 0x06C
  67. #define TITAN_AR4 0x070
  68. #define TITAN_AR5 0x074
  69. #define TITAN_AR6 0x078
  70. #define TITAN_PITCH 0x08C
  71. #define TITAN_YDST 0x090
  72. #define TITAN_YDSTORG 0x094
  73. #define TITAN_YTOP 0x098
  74. #define TITAN_YBOT 0x09C
  75. #define TITAN_CXLEFT 0x0A0
  76. #define TITAN_CXRIGHT 0x0A4
  77. #define TITAN_FXLEFT 0x0A8
  78. #define TITAN_FXRIGHT 0x0AC
  79. #define TITAN_XDST 0x0B0
  80. #define TITAN_DR0 0x0C0
  81. #define TITAN_DR1 0x0C4
  82. #define TITAN_DR2 0x0C8
  83. #define TITAN_DR3 0x0CC
  84. #define TITAN_DR4 0x0D0
  85. #define TITAN_DR5 0x0D4
  86. #define TITAN_DR6 0x0D8
  87. #define TITAN_DR7 0x0DC
  88. #define TITAN_DR8 0x0E0
  89. #define TITAN_DR9 0x0E4
  90. #define TITAN_DR10 0x0E8
  91. #define TITAN_DR11 0x0EC
  92. #define TITAN_DR12 0x0F0
  93. #define TITAN_DR13 0x0F4
  94. #define TITAN_DR14 0x0F8
  95. #define TITAN_DR15 0x0FC
  96. /*** As per Titan (Host Interface Non-VGA) specification 0.2 ***/
  97. #define TITAN_SRCPAGE 0x200
  98. #define TITAN_DSTPAGE 0x204
  99. #define TITAN_BYTACCDATA 0x208
  100. #define TITAN_ADRGEN 0x20c
  101. #define TITAN_FIFOSTATUS 0x210
  102. #define TITAN_STATUS 0x214
  103. #define TITAN_ICLEAR 0x218
  104. #define TITAN_IEN 0x21c
  105. #define TITAN_RST 0x240
  106. #define TITAN_TEST 0x244
  107. #define TITAN_REV 0x248
  108. #define TITAN_CONFIG 0x250
  109. #define TITAN_OPMODE 0x254
  110. #define TITAN_CRT_CTRL 0x25c
  111. #define TITAN_VCOUNT 0x260
  112. /*** As per Titan (Host Interface VGA/CRTC) specification 0.2 ***/
  113. #define TITAN_0_CRTC_ADDR 0x3b4
  114. #define TITAN_0_CRTC_DATA 0x3b5
  115. #define TITAN_0_MISC_ISTAT1 0x3ba
  116. #define TITAN_0_FEAT_CTL_W 0x3ba
  117. #define TITAN_ATTR_ADDR 0x3c0
  118. #define TITAN_ATTR_DATA 0x3c1
  119. #define TITAN_MISC_ISTAT0 0x3c2
  120. #define TITAN_MISC_OUT_W 0x3c2
  121. #define TITAN_VGA_SUBSYS 0x3c3
  122. #define TITAN_SEQ_ADDR 0x3c4
  123. #define TITAN_SEQ_DATA 0x3c5
  124. #define TITAN_DAC_STATUS 0x3c7
  125. #define TITAN_ATTR_DATA_W 0x3c5
  126. #define TITAN_FEAT_CTL_R 0x3ca
  127. #define TITAN_MISC_OUT_R 0x3cc
  128. #define TITAN_GCTL_ADDR 0x3ce
  129. #define TITAN_GCTL_DATA 0x3cf
  130. #define TITAN_1_CRTC_ADDR 0x3d4
  131. #define TITAN_1_CRTC_DATA 0x3d5
  132. #define TITAN_1_MISC_ISTAT1 0x3da
  133. #define TITAN_1_FEAT_CTL_W 0x3da
  134. #define TITAN_AUX_ADDR 0x3de
  135. #define TITAN_AUX_DATA 0x3df
  136. /*** As per Dubic specification 0.2 ***/
  137. #define DUBIC_DUB_SEL 0x00 /*** BYTE ACCESSES ONLY ***/
  138. #define DUBIC_NDX_PTR 0x04 /*** BYTE ACCESSES ONLY ***/
  139. #define DUBIC_DATA 0x08 /*** BYTE ACCESSES ONLY ***/
  140. #define DUBIC_DUB_MOUS 0x0c /*** BYTE ACCESSES ONLY ***/
  141. #define DUBIC_MOUSE0 0x10 /*** BYTE ACCESSES ONLY ***/
  142. #define DUBIC_MOUSE1 0x14 /*** BYTE ACCESSES ONLY ***/
  143. #define DUBIC_MOUSE2 0x18 /*** BYTE ACCESSES ONLY ***/
  144. #define DUBIC_MOUSE3 0x1c /*** BYTE ACCESSES ONLY ***/
  145. /*****************************************************************************/
  146. /*****************************************************************************
  147. DUBIC INDEX TO REGISTERS (NDX_PTR)
  148. These are the index values to access the Dubic indexed registers via NDX_PTR
  149. */
  150. /*** As per Dubic specification 0.2 ***/
  151. #define DUBIC_DUB_CTL 0x00
  152. #define DUBIC_KEY_COL 0x01
  153. #define DUBIC_KEY_MSK 0x02
  154. #define DUBIC_DBX_MIN 0x03
  155. #define DUBIC_DBX_MAX 0x04
  156. #define DUBIC_DBY_MIN 0x05
  157. #define DUBIC_DBY_MAX 0x06
  158. #define DUBIC_OVS_COL 0x07
  159. #define DUBIC_CUR_X 0x08
  160. #define DUBIC_CUR_Y 0x09
  161. #define DUBIC_DUB_CTL2 0x0A
  162. #define DUBIC_CUR_COL0 0x0c
  163. #define DUBIC_CUR_COL1 0x0d
  164. #define DUBIC_CRC_CTL 0x0e
  165. #define DUBIC_CRC_DAT 0x0f
  166. /*****************************************************************************/
  167. /* DUBIC FIELDS */
  168. #define DUBIC_DB_SEL_M 0x00000001
  169. #define DUBIC_DB_SEL_A 0
  170. #define DUBIC_DB_SEL_DBA 0x00000000
  171. #define DUBIC_DB_SEL_DBB 0x00000001
  172. #define DUBIC_DB_EN_M 0x00000002
  173. #define DUBIC_DB_EN_A 1
  174. #define DUBIC_DB_EN_OFF 0x00000000
  175. #define DUBIC_DB_EN_ON 0x00000002
  176. #define DUBIC_IMOD_M 0x0000000c
  177. #define DUBIC_IMOD_A 2
  178. #define DUBIC_IMOD_32 0x00000000
  179. #define DUBIC_IMOD_16 0x00000004
  180. #define DUBIC_IMOD_8 0x00000008
  181. #define DUBIC_LVID_M 0x00000070
  182. #define DUBIC_LVID_A 4
  183. #define DUBIC_LVID_OFF 0x00000000
  184. #define DUBIC_LVID_COL_EQ 0x00000010
  185. #define DUBIC_LVID_COL_GE 0x00000020
  186. #define DUBIC_LVID_COL_LE 0x00000030
  187. #define DUBIC_LVID_DB 0x00000040
  188. #define DUBIC_LVID_COL_EQ_DB 0x00000050
  189. #define DUBIC_LVID_COL_GE_DB 0x00000060
  190. #define DUBIC_LVID_COL_LE_DB 0x00000070
  191. #define DUBIC_FBM_M 0x00000380
  192. #define DUBIC_FBM_A 7
  193. #define DUBIC_START_BK_M 0x00000c00
  194. #define DUBIC_START_BK_A 10
  195. #define DUBIC_VSYNC_POL_M 0x00001000
  196. #define DUBIC_VSYNC_POL_A 12
  197. #define DUBIC_HSYNC_POL_M 0x00002000
  198. #define DUBIC_HSYNC_POL_A 13
  199. #define DUBIC_DACTYPE_M 0x0000c000
  200. #define DUBIC_DACTYPE_A 14
  201. #define DUBIC_INT_EN_M 0x00010000
  202. #define DUBIC_INT_EN_A 16
  203. #define DUBIC_GENLOCK_M 0x00040000
  204. #define DUBIC_GENLOCK_A 18
  205. #define DUBIC_BLANK_SEL_M 0x00080000
  206. #define DUBIC_BLANK_SEL_A 19
  207. #define DUBIC_SYNC_DEL_M 0x00f00000
  208. #define DUBIC_SYNC_DEL_A 20
  209. #define DUBIC_VGA_EN_M 0x01000000
  210. #define DUBIC_VGA_EN_A 24
  211. #define DUBIC_SRATE_M 0x7e000000
  212. #define DUBIC_SRATE_A 25
  213. #define DUBIC_BLANKDEL_M 0x80000000
  214. #define DUBIC_BLANKDEL_A 31
  215. #define DUBIC_CSYNCEN_M 0x00000001
  216. #define DUBIC_CSYNCEN_A 0
  217. #define DUBIC_SYNCEN_M 0x00000002
  218. #define DUBIC_SYNCEN_A 1
  219. #define DUBIC_LASEREN_M 0x00000004
  220. #define DUBIC_LASEREN_A 2
  221. #define DUBIC_LASERSCL_M 0x00000018
  222. #define DUBIC_LASERSCL_A 3
  223. #define DUBIC_LVIDFIELD_M 0x00000020
  224. #define DUBIC_LVIDFIELD_A 5
  225. #define DUBIC_CLKSEL_M 0x00000040
  226. #define DUBIC_CLKSEL_A 6
  227. #define DUBIC_LDCLKEN_M 0x00000080
  228. #define DUBIC_LDCLKEN_A 7
  229. /*****************************************************************************
  230. TITAN Drawing Engine field masks and values as per Titan specification 1.0
  231. */
  232. #define TITAN_OPCOD_M 0x0000000f
  233. #define TITAN_OPCOD_A 0
  234. #define TITAN_OPCOD_LINE_OPEN 0x00000000
  235. #define TITAN_OPCOD_AUTOLINE_OPEN 0x00000001
  236. #define TITAN_OPCOD_LINE_CLOSE 0x00000002
  237. #define TITAN_OPCOD_AUTOLINE_CLOSE 0x00000003
  238. #define TITAN_OPCOD_TRAP 0x00000004
  239. #define TITAN_OPCOD_BITBLT 0x00000008
  240. #define TITAN_OPCOD_ILOAD 0x00000009
  241. #define TITAN_OPCOD_IDUMP 0x0000000a
  242. #define TITAN_ATYPE_M 0x00000030
  243. #define TITAN_ATYPE_A 4
  244. #define TITAN_ATYPE_RPL 0x00000000
  245. #define TITAN_ATYPE_RSTR 0x00000010
  246. #define TITAN_ATYPE_ANTI 0x00000020
  247. #define TITAN_ATYPE_ZI 0x00000030
  248. #define TITAN_BLOCKM_M 0x00000040
  249. #define TITAN_BLOCKM_A 6
  250. #define TITAN_BLOCKM_OFF 0x00000000
  251. #define TITAN_BLOCKM_ON 0x00000040
  252. #define TITAN_LINEAR_M 0x00000080
  253. #define TITAN_LINEAR_A 7
  254. #define TITAN_LINEAR_OFF 0x00000000
  255. #define TITAN_LINEAR_ON 0x00000080 /*** spec 2.5 ***/
  256. #define TITAN_BOP_M 0x000f0000
  257. #define TITAN_BOP_A 16
  258. #define TITAN_BOP_CLEAR 0x00000000
  259. #define TITAN_BOP_NOT_D_OR_S 0x00010000
  260. #define TITAN_BOP_D_AND_NOTS 0x00020000
  261. #define TITAN_BOP_NOTS 0x00030000
  262. #define TITAN_BOP_NOTD_AND_S 0x00040000
  263. #define TITAN_BOP_NOTD 0x00050000
  264. #define TITAN_BOP_D_XOR_S 0x00060000
  265. #define TITAN_BOP_NOT_D_AND_S 0x00070000
  266. #define TITAN_BOP_D_AND_S 0x00080000
  267. #define TITAN_BOP_NOT_D_XOR_S 0x00090000
  268. #define TITAN_BOP_D 0x000a0000
  269. #define TITAN_BOP_D_OR_NOTS 0x000b0000
  270. #define TITAN_BOP_S 0x000c0000
  271. #define TITAN_BOP_NOTD_OR_S 0x000d0000
  272. #define TITAN_BOP_D_OR_S 0x000e0000
  273. #define TITAN_BOP_SET 0x000f0000
  274. #define TITAN_TRANS_M 0x00f00000
  275. #define TITAN_TRANS_A 20
  276. #define TITAN_ALPHADIT_M 0x01000000
  277. #define TITAN_ALPHADIT_A 24
  278. #define TITAN_ALPHADIT_FCOL 0x00000000
  279. #define TITAN_ALPHADIT_RED 0x01000000
  280. #define TITAN_BLTMOD_M 0x06000000
  281. #define TITAN_BLTMOD_A 25
  282. #define TITAN_BLTMOD_BMONO 0x00000000
  283. #define TITAN_BLTMOD_BPLAN 0x02000000
  284. #define TITAN_BLTMOD_BFCOL 0x04000000
  285. #define TITAN_BLTMOD_BUCOL 0x06000000
  286. #define TITAN_ZDRWEN_M 0x02000000
  287. #define TITAN_ZDRWEN_A 25
  288. #define TITAN_ZDRWEN_OFF 0x00000000
  289. #define TITAN_ZDRWEN_ON 0x02000000
  290. #define TITAN_ZLTE_M 0x04000000
  291. #define TITAN_ZLTE_A 26
  292. #define TITAN_ZLTE_LT 0x00000000
  293. #define TITAN_ZLTE_LTE 0x04000000
  294. #define TITAN_TRANSC_M 0x40000000 /* spec 2.2 */
  295. #define TITAN_TRANSC_A 30
  296. #define TITAN_TRANSC_OPAQUE 0x00000000
  297. #define TITAN_TRANSC_TRANSPARENT 0x40000000
  298. #define TITAN_AFOR_M 0x08000000
  299. #define TITAN_AFOR_A 27
  300. #define TITAN_AFOR_ALU 0x00000000
  301. #define TITAN_AFOR_FCOL 0x08000000
  302. #define TITAN_HBGR_M 0x08000000
  303. #define TITAN_HBGR_A 27
  304. #define TITAN_ABAC_M 0x10000000
  305. #define TITAN_ABAC_A 28
  306. #define TITAN_ABAC_DEST 0x00000000
  307. #define TITAN_ABAC_BCOL 0x10000000
  308. #define TITAN_HCPRS_M 0x10000000
  309. #define TITAN_HCPRS_A 28
  310. #define TITAN_HCPRS_SRC32 0x00000000
  311. #define TITAN_HCPRS_SRC24 0x10000000
  312. #define TITAN_PATTERN_M 0x20000000
  313. #define TITAN_PATTERN_A 29
  314. #define TITAN_PATTERN_OFF 0x00000000
  315. #define TITAN_PATTERN_ON 0x20000000
  316. #define TITAN_PWIDTH_M 0x00000003
  317. #define TITAN_PWIDTH_A 0
  318. #define TITAN_PWIDTH_PW8 0x00000000
  319. #define TITAN_PWIDTH_PW16 0x00000001
  320. /* PACK PIXEL */
  321. #define TITAN_PWIDTH_PW24 0x00000012
  322. #define TITAN_PWIDTH_PW32 0x00000002
  323. #define TITAN_PWIDTH_PW32I 0x00000003
  324. #define TITAN_FBC_M 0x0000000c
  325. #define TITAN_FBC_A 2
  326. #define TITAN_FBC_SBUF 0x00000000
  327. #define TITAN_FBC_DBUFA 0x00000008
  328. #define TITAN_FBC_DBUFB 0x0000000c
  329. #define TITAN_ZCOL_M 0x0000000f
  330. #define TITAN_ZCOL_A 0
  331. #define TITAN_PLNZMSK_M 0x000000f0
  332. #define TITAN_PLNZMSK_A 4
  333. #define TITAN_ZTEN_M 0x00000100
  334. #define TITAN_ZTEN_A 8
  335. #define TITAN_ZTEN_OFF 0x00000000
  336. #define TITAN_ZTEN_ON 0x00000100
  337. #define TITAN_ZCOLBLK_M 0x00000200
  338. #define TITAN_ZCOLBLK_A 9
  339. #define TITAN_FUNCNT_M 0x0000007f
  340. #define TITAN_FUNCNT_A 0
  341. #define TITAN_X_OFF_M 0x0000000f
  342. #define TITAN_X_OFF_A 0
  343. #define TITAN_Y_OFF_M 0x00000070
  344. #define TITAN_Y_OFF_A 4
  345. #define TITAN_FUNOFF_M 0x003f0000
  346. #define TITAN_FUNOFF_A 16
  347. #define TITAN_SDYDXL_M 0x00000001
  348. #define TITAN_SDYDXL_A 0
  349. #define TITAN_SDYDXL_Y_MAJOR 0x00000000
  350. #define TITAN_SDYDXL_X_MAJOR 0x00000001
  351. #define TITAN_SCANLEFT_M 0x00000001
  352. #define TITAN_SCANLEFT_A 0
  353. #define TITAN_SCANLEFT_OFF 0x00000000
  354. #define TITAN_SCANLEFT_ON 0x00000001
  355. #define TITAN_SDXL_M 0x00000002
  356. #define TITAN_SDXL_A 1
  357. #define TITAN_SDXL_POS 0x00000000
  358. #define TITAN_SDXL_NEG 0x00000002
  359. #define TITAN_SDY_M 0x00000004
  360. #define TITAN_SDY_A 2
  361. #define TITAN_SDY_POS 0x00000000
  362. #define TITAN_SDY_NEG 0x00000004
  363. #define TITAN_SDXR_M 0x00000020
  364. #define TITAN_SDXR_A 5
  365. #define TITAN_SDXR_POS 0x00000000
  366. #define TITAN_SDXR_NEG 0x00000020
  367. #define TITAN_YLIN_M 0x00008000
  368. #define TITAN_YLIN_A 15
  369. #define TITAN_AR0_M 0x0003ffff
  370. /*****************************************************************************/
  371. /*****************************************************************************
  372. TITAN HostInterface field masks and values as per Host Interface spec 0.20
  373. */
  374. #define TITAN_FIFOCOUNT_M 0x0000007f
  375. #define TITAN_FIFOCOUNT_A 0
  376. #define TITAN_BFULL_M 0x00000100
  377. #define TITAN_BFULL_A 8
  378. #define TITAN_BEMPTY_M 0x00000200
  379. #define TITAN_BEMPTY_A 9
  380. #define TITAN_BYTEACCADDR_M 0x007f0000
  381. #define TITAN_BYTEACCADDR_A 16
  382. #define TITAN_ADDRGENSTATE_M 0x3f000000
  383. #define TITAN_ADDRGENSTATE_A 24
  384. #define TITAN_BFERRISTS_M 0x00000001
  385. #define TITAN_BFERRISTS_A 0
  386. #define TITAN_DMATCISTS_M 0x00000002
  387. #define TITAN_DMATCISTS_A 1
  388. #define TITAN_PICKISTS_M 0x00000004
  389. #define TITAN_PICKISTS_A 2
  390. #define TITAN_VSYNCSTS_M 0x00000008
  391. #define TITAN_VSYNCSTS_A 3
  392. #define TITAN_VSYNCSTS_SET 0x00000008
  393. #define TITAN_VSYNCSTS_CLR 0x00000000
  394. #define TITAN_BYTEFLAG_M 0x00000f00
  395. #define TITAN_BYTEFLAG_A 8
  396. #define TITAN_DWGENGSTS_M 0x00010000
  397. #define TITAN_DWGENGSTS_A 16
  398. #define TITAN_DWGENGSTS_BUSY 0x00010000
  399. #define TITAN_DWGENGSTS_IDLE 0x00000000
  400. #define TITAN_BFERRICLR_M 0x00000001
  401. #define TITAN_BFERRICLR_A 0
  402. #define TITAN_DMATCICLR_M 0x00000002
  403. #define TITAN_DMATCICLR_A 1
  404. #define TITAN_PICKICLR_M 0x00000004
  405. #define TITAN_PICKICLR_A 2
  406. #define TITAN_BFERRIEN_M 0x00000001
  407. #define TITAN_BFERRIEN_A 0
  408. #define TITAN_DMATCIEN_M 0x00000002
  409. #define TITAN_DMATCIEN_A 1
  410. #define TITAN_PICKIEN_M 0x00000004
  411. #define TITAN_PICKIEN_A 2
  412. #define TITAN_VSYNCIEN_M 0x00000008
  413. #define TITAN_VSYNCIEN_A 3
  414. #define TITAN_SOFTRESET_M 0x00000001
  415. #define TITAN_SOFTRESET_A 0
  416. #define TITAN_SOFTRESET_SET 0x00000001
  417. #define TITAN_SOFTRESET_CLR 0x00000000
  418. #define TITAN_VGATEST_M 0x00000001
  419. #define TITAN_VGATEST_A 0
  420. #define TITAN_ROBITWREN_M 0x00000100
  421. #define TITAN_ROBITWREN_A 8
  422. #define TITAN_CHIPREV_M 0x0000000f
  423. #define TITAN_CHIPREV_A 0
  424. #define TITAN_NODUBIC_M 0x00000010
  425. #define TITAN_NODUBIC_A 4
  426. #define TITAN_CONFIG_M 0x00000003 /*** BYTE ACCESS ONLY ***/
  427. #define TITAN_CONFIG_A 0
  428. #define TITAN_CONFIG_8 0x00000000
  429. #define TITAN_CONFIG_16 0x00000001
  430. #define TITAN_CONFIG_16N 0x00000003
  431. #define TITAN_DRIVERDY_M 0x00000100
  432. #define TITAN_DRIVERDY_A 8
  433. #define TITAN_BIOSEN_M 0x00000200
  434. #define TITAN_BIOSEN_A 9
  435. #define TITAN_VGAEN_M 0x00000400
  436. #define TITAN_VGAEN_A 10
  437. #define TITAN_LEVELIRQ_M 0x00000800
  438. #define TITAN_LEVELIRQ_A 11
  439. #define TITAN_EXPDEV_M 0x00010000
  440. #define TITAN_EXPDEV_A 16
  441. #define TITAN_MAPSEL_M 0x07000000
  442. #define TITAN_MAPSEL_A 24
  443. #define TITAN_MAPSEL_DISABLED 0x00000000
  444. #define TITAN_MAPSEL_BASE_1 0x01000000
  445. #define TITAN_MAPSEL_BASE_2 0x02000000
  446. #define TITAN_MAPSEL_BASE_3 0x03000000
  447. #define TITAN_MAPSEL_BASE_4 0x04000000
  448. #define TITAN_MAPSEL_BASE_5 0x05000000
  449. #define TITAN_MAPSEL_BASE_6 0x06000000
  450. #define TITAN_MAPSEL_BASE_7 0x07000000
  451. #define TITAN_POSEIDON_M 0x08000000
  452. #define TITAN_POSEIDON_A 27
  453. #define TITAN_PCI_M 0x08000000
  454. #define TITAN_PCI_A 27
  455. #define TITAN_ISA_M 0x10000000
  456. #define TITAN_ISA_A 28
  457. #define TITAN_ISA_ISA_BUS 0x10000000
  458. #define TITAN_ISA_WIDE_BUS 0x00000000
  459. #define TITAN_PSEUDODMA_M 0x00000001
  460. #define TITAN_PSEUDODMA_A 0
  461. #define TITAN_DMAACT_M 0x00000002
  462. #define TITAN_DMAACT_A 1
  463. #define TITAN_DMAMOD_M 0x0000000c
  464. #define TITAN_DMAMOD_A 2
  465. #define TITAN_DMAMOD_GENERAL_WR 0x00000000
  466. #define TITAN_DMAMOD_BLIT_WR 0x00000004
  467. #define TITAN_DMAMOD_VECTOR_WR 0x00000008
  468. #define TITAN_DMAMOD_BLIT_RD 0x0000000c
  469. #define TITAN_NOWAIT_M 0x00000010
  470. #define TITAN_NOWAIT_A 4
  471. #define TITAN_MOUSEEN_M 0x00000100
  472. #define TITAN_MOUSEEN_A 8
  473. #define TITAN_MOUSEMAP_M 0x00000200
  474. #define TITAN_MOUSEMAP_A 9
  475. #define TITAN_ZTAGEN_M 0x00000400
  476. #define TITAN_ZTAGEN_A 10
  477. #define TITAN_VBANK0_M 0x00000800
  478. #define TITAN_VBANK0_A 11
  479. #define TITAN_RFHCNT_M 0x000f0000
  480. #define TITAN_RFHCNT_A 16
  481. #define TITAN_FBM_M 0x00f00000
  482. #define TITAN_FBM_A 20
  483. #define TITAN_HYPERPG_M 0x03000000
  484. #define TITAN_HYPERPG_A 24
  485. #define TITAN_HYPERPG_NOHYPER 0x00000000
  486. #define TITAN_HYPERPG_SELHYPER 0x01000000
  487. #define TITAN_HYPERPG_ALLHYPER 0x02000000
  488. #define TITAN_HYPERPG_RESERVED 0x03000000
  489. #define TITAN_TRAM_M 0x04000000
  490. #define TITAN_TRAM_A 26
  491. #define TITAN_TRAM_256X8 0x00000000
  492. #define TITAN_TRAM_256X16 0x04000000
  493. #define TITAN_CRTCBPP_M 0x00000003
  494. #define TITAN_CRTCBPP_A 0
  495. #define TITAN_CRTCBPP_8 0x00000000
  496. #define TITAN_CRTCBPP_16 0x00000001
  497. #define TITAN_CRTCBPP_32 0x00000002
  498. #define TITAN_ALW_M 0x00000004
  499. #define TITAN_ALW_A 2
  500. #define TITAN_INTERLACE_M 0x00000018
  501. #define TITAN_INTERLACE_A 3
  502. #define TITAN_INTERLACE_OFF 0x00000000
  503. #define TITAN_INTERLACE_768 0x00000008
  504. #define TITAN_INTERLACE_1024 0x00000010
  505. #define TITAN_INTERLACE_1280 0x00000018
  506. #define TITAN_VIDEODELAY0_M 0x00000020
  507. #define TITAN_VIDEODELAY0_A 5
  508. #define TITAN_VIDEODELAY1_M 0x00000200
  509. #define TITAN_VIDEODELAY1_A 9
  510. #define TITAN_VIDEODELAY2_M 0x00000400
  511. #define TITAN_VIDEODELAY2_A 10
  512. #define TITAN_VSCALE_M 0x00030000
  513. #define TITAN_VSCALE_A 16
  514. #define TITAN_SYNCDEL_M 0x000C0000
  515. #define TITAN_SYNCDEL_A 18
  516. #define TITAN_DST0_RESERVED1_M 0x0000ffff
  517. #define TITAN_DST0_RESERVED1_A 0
  518. #define TITAN_DST0_PCBREV_M 0x000f0000
  519. #define TITAN_DST0_PCBREV_A 16
  520. #define TITAN_DST0_BLKMODE_M 0x00080000
  521. #define TITAN_DST0_BLKMODE_A 19
  522. #define TITAN_DST0_PRODUCT_M 0x00f00000
  523. #define TITAN_DST0_PRODUCT_A 20
  524. #define TITAN_DST0_RAMBANK_M 0xff000000
  525. #define TITAN_DST0_RAMBANK_A 24
  526. #define TITAN_DST1_RAMBANK_M 0x00000001
  527. #define TITAN_DST1_RAMBANK_A 0
  528. #define TITAN_DST1_RAMBANK0_M 0x00000008
  529. #define TITAN_DST1_RAMBANK0_A 3
  530. #define TITAN_DST1_RAMSPEED_M 0x00000006
  531. #define TITAN_DST1_RAMSPEED_A 1
  532. #define TITAN_DST1_RESERVED1_M 0x0007fff8
  533. #define TITAN_DST1_RESERVED1_A 3
  534. #define TITAN_DST1_200MHZ_M 0x00010000
  535. #define TITAN_DST1_200MHZ_A 16
  536. #define TITAN_DST1_NOMUXES_M 0x00020000
  537. #define TITAN_DST1_NOMUXES_A 17
  538. #define TITAN_DST1_ABOVE1280_M 0x00000010
  539. #define TITAN_DST1_ABOVE1280_A 4
  540. #define TITAN_DST1_HYPERPG_M 0x00180000
  541. #define TITAN_DST1_HYPERPG_A 19
  542. #define TITAN_DST1_EXPDEV_M 0x00200000
  543. #define TITAN_DST1_EXPDEV_A 21
  544. #define TITAN_DST1_TRAM_M 0x00400000
  545. #define TITAN_DST1_TRAM_A 22
  546. #define TITAN_DST1_RESERVED2_M 0xff800000
  547. #define TITAN_DST1_RESERVED2_A 23
  548. /*****************************************************************************
  549. RAMDAC rgisters
  550. */
  551. /*** DIRECT ***/
  552. #define BT481_WADR_PAL 0x00
  553. #define BT481_RADR_PAL 0x0c
  554. #define BT481_WADR_OVL 0x10
  555. #define BT481_RADR_OVL 0x1c
  556. #define BT481_COL_PAL 0x04
  557. #define BT481_COL_OVL 0x14
  558. #define BT481_PIX_RD_MSK 0x08
  559. #define BT481_CMD_REGA 0x18
  560. /*** INDIRECT ***/
  561. #define BT481_RD_MSK 0x00
  562. #define BT481_OVL_MSK 0x01
  563. #define BT481_CMD_REGB 0x02
  564. #define BT481_CUR_REG 0x03
  565. #define BT481_CUR_XLOW 0x04
  566. #define BT481_CUR_XHI 0x05
  567. #define BT481_CUR_YLOW 0x06
  568. #define BT481_CUR_YHI 0x07
  569. /*** DIRECT ***/
  570. #define BT482_WADR_PAL 0x00
  571. #define BT482_RADR_PAL 0x0c
  572. #define BT482_WADR_OVL 0x10
  573. #define BT482_RADR_OVL 0x1c
  574. #define BT482_COL_PAL 0x04
  575. #define BT482_COL_OVL 0x14
  576. #define BT482_PIX_RD_MSK 0x08
  577. #define BT482_CMD_REGA 0x18
  578. /*** INDIRECT ***/
  579. #define BT482_RD_MSK 0x00
  580. #define BT482_OVL_MSK 0x01
  581. #define BT482_CMD_REGB 0x02
  582. #define BT482_CUR_REG 0x03
  583. #define BT482_CUR_XLOW 0x04
  584. #define BT482_CUR_XHI 0x05
  585. #define BT482_CUR_YLOW 0x06
  586. #define BT482_CUR_YHI 0x07
  587. /* Bt482 FIELDS */
  588. #define BT482_EXT_REG_M 0x01
  589. #define BT482_EXT_REG_A 0x00
  590. #define BT482_EXT_REG_EN 0x01
  591. #define BT482_EXT_REG_DIS 0x00
  592. #define BT482_CUR_SEL_M 0x20
  593. #define BT482_CUR_SEL_A 0x05
  594. #define BT482_CUR_SEL_INT 0x00
  595. #define BT482_CUR_SEL_EXT 0x20
  596. #define BT482_DISP_MODE_M 0x10
  597. #define BT482_DISP_MODE_A 0x04
  598. #define BT482_DISP_MODE_I 0x10
  599. #define BT482_DISP_MODE_NI 0x00
  600. #define BT482_CUR_CR3_M 0x08
  601. #define BT482_CUR_CR3_A 0x03
  602. #define BT482_CUR_CR3_RAM 0x08
  603. #define BT482_CUR_CR3_PAL 0x00
  604. #define BT482_CUR_EN_M 0x04
  605. #define BT482_CUR_EN_A 0x02
  606. #define BT482_CUR_EN_ON 0x00
  607. #define BT482_CUR_EN_OFF 0x04
  608. #define BT482_CUR_MODE_M 0x03
  609. #define BT482_CUR_MODE_A 0x00
  610. #define BT482_CUR_MODE_DIS 0x00
  611. #define BT482_CUR_MODE_1 0x01
  612. #define BT482_CUR_MODE_2 0x02
  613. #define BT482_CUR_MODE_3 0x03
  614. /* Bt482 ADRESSE OFFSET FOR EXT. REG. */
  615. #define BT482_OFF_CUR_COL 0x11
  616. /*** DIRECT ***/
  617. #define BT484_WADR_PAL 0x00
  618. #define BT484_RADR_PAL 0x0c
  619. #define BT484_WADR_OVL 0x10
  620. #define BT484_RADR_OVL 0x1c
  621. #define BT484_COL_PAL 0x04
  622. #define BT484_COL_OVL 0x14
  623. #define BT484_PIX_RD_MSK 0x08
  624. #define BT484_CMD_REG0 0x18
  625. #define BT484_CMD_REG1 0x20
  626. #define BT484_CMD_REG2 0x24
  627. #define BT484_STATUS 0x28
  628. #define BT484_CUR_RAM 0x2c
  629. #define BT484_CUR_XLOW 0x30
  630. #define BT484_CUR_XHI 0x34
  631. #define BT484_CUR_YLOW 0x38
  632. #define BT484_CUR_YHI 0x3c
  633. #define BT485_WADR_PAL 0x00
  634. #define BT485_RADR_PAL 0x0c
  635. #define BT485_WADR_OVL 0x10
  636. #define BT485_RADR_OVL 0x1c
  637. #define BT485_COL_PAL 0x04
  638. #define BT485_COL_OVL 0x14
  639. #define BT485_PIX_RD_MSK 0x08
  640. #define BT485_CMD_REG0 0x18
  641. #define BT485_CMD_REG1 0x20
  642. #define BT485_CMD_REG2 0x24
  643. #define BT485_STATUS 0x28
  644. #define BT485_CUR_RAM 0x2c
  645. #define BT485_CUR_XLOW 0x30
  646. #define BT485_CUR_XHI 0x34
  647. #define BT485_CUR_YLOW 0x38
  648. #define BT485_CUR_YHI 0x3c
  649. #define BT485_CMD_REG3 0x28
  650. /*****************************************************************************/
  651. /* Bt485 FIELDS */
  652. /* Command register 0 */
  653. #define BT485_IND_REG3_M 0x80
  654. #define BT485_IND_REG3_A 0x07
  655. #define BT485_IND_REG3_EN 0x80
  656. #define BT485_IND_REG3_DIS 0x00
  657. /* Command register 2 */
  658. #define BT485_DISP_MODE_M 0x08
  659. #define BT485_DISP_MODE_A 0x03
  660. #define BT485_DISP_MODE_I 0x08
  661. #define BT485_DISP_MODE_NI 0x00
  662. #define BT485_CUR_MODE_M 0x03
  663. #define BT485_CUR_MODE_A 0x00
  664. #define BT485_CUR_MODE_DIS 0x00
  665. #define BT485_CUR_MODE_1 0x01
  666. #define BT485_CUR_MODE_2 0x02
  667. #define BT485_CUR_MODE_3 0x03
  668. /* Command register 3 (indirecte) */
  669. #define BT485_CUR_SEL_M 0x04
  670. #define BT485_CUR_SEL_A 0x02
  671. #define BT485_CUR_SEL_32 0x00
  672. #define BT485_CUR_SEL_64 0x04
  673. #define BT485_CUR_MSB_M 0x03
  674. #define BT485_CUR_MSB_A 0x00
  675. #define BT485_CUR_MSB_00 0x00
  676. #define BT485_CUR_MSB_01 0x01
  677. #define BT485_CUR_MSB_10 0x02
  678. #define BT485_CUR_MSB_11 0x03
  679. /* Bt485 ADR OFFSET FOR EXT. reg cmd3 */
  680. #define BT485_OFF_CUR_COL 0x01
  681. #define BT484_ID_M 0xc0
  682. #define BT484_ID 0x40
  683. #define BT485_ID_M 0xc0
  684. #define BT485_ID 0x80
  685. #define ATT20C505_ID_M 0x70
  686. #define ATT20C505_ID 0x50
  687. /*****************************************************************************/
  688. /*** VIEWPOINT REGISTER DIRECT ***/
  689. #define VPOINT_WADR_PAL 0x00
  690. #define VPOINT_COL_PAL 0x04
  691. #define VPOINT_PIX_RD_MSK 0x08
  692. #define VPOINT_RADR_PAL 0x0c
  693. #define VPOINT_INDEX 0x18
  694. #define VPOINT_DATA 0x1c
  695. /*** VIEWPOINT REGISTER INDIRECT ***/
  696. #define VPOINT_CUR_XLOW 0x00
  697. #define VPOINT_CUR_XHI 0x01
  698. #define VPOINT_CUR_YLOW 0x02
  699. #define VPOINT_CUR_YHI 0x03
  700. #define VPOINT_SPRITE_X 0x04
  701. #define VPOINT_SPRITE_Y 0x05
  702. #define VPOINT_CUR_CTL 0x06
  703. #define VPOINT_CUR_RAM_LSB 0x08
  704. #define VPOINT_CUR_RAM_MSB 0x09
  705. #define VPOINT_CUR_RAM_DATA 0x0a
  706. #define VPOINT_WIN_XSTART_LSB 0x10
  707. #define VPOINT_WIN_XSTART_MSB 0x11
  708. #define VPOINT_WIN_XSTOP_LSB 0x12
  709. #define VPOINT_WIN_XSTOP_MSB 0x13
  710. #define VPOINT_WIN_YSTART_LSB 0x14
  711. #define VPOINT_WIN_YSTART_MSB 0x15
  712. #define VPOINT_WIN_YSTOP_LSB 0x16
  713. #define VPOINT_WIN_YSTOP_MSB 0x17
  714. #define VPOINT_MUX_CTL1 0x18
  715. #define VPOINT_MUX_CTL2 0x19
  716. #define VPOINT_INPUT_CLK 0x1a
  717. #define VPOINT_OUTPUT_CLK 0x1b
  718. #define VPOINT_PAL_PAGE 0x1c
  719. #define VPOINT_GEN_CTL 0x1d
  720. #define VPOINT_OVS_RED 0x20
  721. #define VPOINT_OVS_GREEN 0x21
  722. #define VPOINT_OVS_BLUE 0x22
  723. #define VPOINT_CUR_COL0_RED 0x23
  724. #define VPOINT_CUR_COL0_GREEN 0x24
  725. #define VPOINT_CUR_COL0_BLUE 0x25
  726. #define VPOINT_CUR_COL1_RED 0x26
  727. #define VPOINT_CUR_COL1_GREEN 0x27
  728. #define VPOINT_CUR_COL1_BLUE 0x28
  729. #define VPOINT_AUX_CTL 0x29
  730. #define VPOINT_GEN_IO_CTL 0x2a
  731. #define VPOINT_GEN_IO_DATA 0x2b
  732. #define VPOINT_KEY_RED_LOW 0x32
  733. #define VPOINT_KEY_RED_HI 0x33
  734. #define VPOINT_KEY_GREEN_LOW 0x34
  735. #define VPOINT_KEY_GREEN_HI 0x35
  736. #define VPOINT_KEY_BLUE_LOW 0x36
  737. #define VPOINT_KEY_BLUE_HI 0x37
  738. #define VPOINT_KEY_CTL 0x38
  739. #define VPOINT_SENSE_TEST 0x3a
  740. #define VPOINT_TEST_DATA 0x3b
  741. #define VPOINT_CRC_LSB 0x3c
  742. #define VPOINT_CRC_MSB 0x3d
  743. #define VPOINT_CRC_CTL 0x3e
  744. #define VPOINT_ID 0x3f
  745. #define VPOINT_RESET 0xff
  746. /*** ATT20C510 REGISTER DIRECT ***/
  747. #define ATT20C510_WR1 0x00
  748. #define ATT20C510_RMR 0x08
  749. #define ATT20C510_RD1 0x0c
  750. #define ATT20C510_WR2 0x10
  751. #define ATT20C510_CR0 0x18
  752. #define ATT20C510_RD2 0x1c
  753. #define ATT20C510_CR1 0x20
  754. #define ATT20C510_CR2 0x24
  755. #define ATT20C510_ST 0x28
  756. #define ATT20C510_XLOW 0x30
  757. #define ATT20C510_XHIGH 0x34
  758. #define ATT20C510_YLOW 0x38
  759. #define ATT20C510_YHIGH 0x3c
  760. /*** ATT20C510 REGISTER INDIRECT ***/
  761. #define ATT20C510_CR3 0x01
  762. #define ATT20C510_CR4 0x02
  763. #define ATT20C510_TEST 0x03
  764. #define ATT20C510_CR5 0x04
  765. #define ATT20C510_MIR 0x05
  766. #define ATT20C510_DIR 0x06
  767. #define ATT20C510_CC0 0x07
  768. #define ATT20C510_CC1 0x08
  769. /** Clock **/
  770. #define ATT20C510_AA0 0x40
  771. #define ATT20C510_AA1 0x41
  772. #define ATT20C510_AA2 0x42
  773. #define ATT20C510_AB0 0x44
  774. #define ATT20C510_AB1 0x45
  775. #define ATT20C510_AB2 0x46
  776. #define ATT20C510_AD0 0x4c
  777. #define ATT20C510_AD1 0x4d
  778. #define ATT20C510_AD2 0x4e
  779. #define ATT20C510_BC0 0x58
  780. #define ATT20C510_BC1 0x59
  781. #define ATT20C510_BC2 0x5a
  782. /*****************************************************************************/
  783. /*** TVP3026 REGISTER DIRECT ***/
  784. #define TVP3026_WADR_PAL 0x00
  785. #define TVP3026_COL_PAL 0x04
  786. #define TVP3026_PIX_RD_MSK 0x08
  787. #define TVP3026_RADR_PAL 0x0c
  788. #define TVP3026_CUR_COL_ADDR 0x10
  789. #define TVP3026_CUR_COL_DATA 0x14
  790. #define TVP3026_CUR_XLOW 0x30
  791. #define TVP3026_CUR_XHI 0x34
  792. #define TVP3026_CUR_YLOW 0x38
  793. #define TVP3026_CUR_YHI 0x3c
  794. #define TVP3026_INDEX 0x00
  795. #define TVP3026_DATA 0x28
  796. #define TVP3026_CUR_RAM 0x2c
  797. /*** TVP3026 REGISTER INDIRECT ***/
  798. #define TVP3026_SILICON_REV 0x01
  799. #define TVP3026_CURSOR_CTL 0x06
  800. #define TVP3026_LATCH_CTL 0x0f
  801. #define TVP3026_TRUE_COLOR_CTL 0x18
  802. #define TVP3026_MUX_CTL 0x19
  803. #define TVP3026_CLK_SEL 0x1a
  804. #define TVP3026_PAL_PAGE 0x1c
  805. #define TVP3026_GEN_CTL 0x1d
  806. #define TVP3026_MISC_CTL 0x1e
  807. #define TVP3026_GEN_IO_CTL 0x2a
  808. #define TVP3026_GEN_IO_DATA 0x2b
  809. #define TVP3026_PLL_ADDR 0x2c
  810. #define TVP3026_PIX_CLK_DATA 0x2d
  811. #define TVP3026_MEM_CLK_DATA 0x2e
  812. #define TVP3026_LOAD_CLK_DATA 0x2f
  813. #define TVP3026_KEY_RED_LOW 0x32
  814. #define TVP3026_KEY_RED_HI 0x33
  815. #define TVP3026_KEY_GREEN_LOW 0x34
  816. #define TVP3026_KEY_GREEN_HI 0x35
  817. #define TVP3026_KEY_BLUE_LOW 0x36
  818. #define TVP3026_KEY_BLUE_HI 0x37
  819. #define TVP3026_KEY_CTL 0x38
  820. #define TVP3026_MCLK_CTL 0x39
  821. #define TVP3026_SENSE_TEST 0x3a
  822. #define TVP3026_TEST_DATA 0x3b
  823. #define TVP3026_CRC_LSB 0x3c
  824. #define TVP3026_CRC_MSB 0x3d
  825. #define TVP3026_CRC_CTL 0x3e
  826. #define TVP3026_ID 0x3f
  827. #define TVP3026_RESET 0xff
  828. /*****************************************************************************/
  829. /******* ProductType *******/
  830. #define BOARD_MGA_RESERVED 0x07
  831. #define BOARD_MGA_VL 0x0a
  832. #define BOARD_MGA_VL_M 0x0e
  833. #ifdef OS2
  834. #define _Far far
  835. #endif