Leaked source code of windows server 2003
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.

627 lines
29 KiB

  1. /************************************************************************/
  2. /* */
  3. /* SETUP_CX.H */
  4. /* */
  5. /* Aug 27 1993 (c) 1993, ATI Technologies Incorporated. */
  6. /************************************************************************/
  7. /********************** PolyTron RCS Utilities
  8. $Revision: 1.17 $
  9. $Date: 15 Apr 1996 13:52:36 $
  10. $Author: RWolff $
  11. $Log: S:/source/wnt/ms11/miniport/archive/setup_cx.h_v $
  12. *
  13. * Rev 1.17 15 Apr 1996 13:52:36 RWolff
  14. * Fallback to claiming 32k of BIOS if we can't get the full 64k, to avoid
  15. * conflict with Adaptec 154x adapters with their BIOS segment set to
  16. * 0xC800:0000 or 0xCC00:0000
  17. *
  18. * Rev 1.16 10 Apr 1996 17:04:48 RWolff
  19. * Now claims our BIOS segment in order to allow access to our hardware
  20. * capability table in the BIOS on P6 Alder machines.
  21. *
  22. * Rev 1.15 01 Mar 1996 12:12:34 RWolff
  23. * VGA Graphics Index and Graphics Data are now handled as separate
  24. * registers rather than as offsets into the block of VGA registers.
  25. *
  26. * Rev 1.14 29 Jan 1996 17:03:12 RWolff
  27. * Replaced list of device IDs for Mach 64 cards with list of device IDs
  28. * for non-Mach 64 cards.
  29. *
  30. * Rev 1.13 23 Jan 1996 17:53:04 RWolff
  31. * Added GT to list of Mach 64 cards capable of supporting block I/O.
  32. *
  33. * Rev 1.12 23 Jan 1996 11:51:24 RWolff
  34. * Removed conditionally-compiled code to use VideoPortGetAccessRanges()
  35. * to find block I/O cards, since this function remaps the I/O base
  36. * address and this is incompatible with the use of INT 10.
  37. *
  38. * Rev 1.11 12 Jan 1996 11:19:12 RWolff
  39. * ASIC type definitions used in workaround for VideoPortGetBaseAddress()
  40. * not working are now conditionally compiled.
  41. *
  42. * Rev 1.10 23 Nov 1995 11:35:12 RWolff
  43. * Temporary fixes to allow detection of block-relocatable GX-F2s until
  44. * Microsoft fixes VideoPortGetAccessRanges().
  45. *
  46. * Rev 1.9 24 Aug 1995 15:40:46 RWolff
  47. * Changed detection of block I/O cards to match Microsoft's
  48. * standard for plug-and-play.
  49. *
  50. * Rev 1.8 27 Feb 1995 17:47:32 RWOLFF
  51. * Added prototype for new routine IsPackedIO_cx().
  52. *
  53. * Rev 1.7 24 Feb 1995 12:28:04 RWOLFF
  54. * Added support for relocatable I/O
  55. *
  56. * Rev 1.6 04 Jan 1995 13:23:36 RWOLFF
  57. * Locked out two memory-mapped registers that were causing problems
  58. * on some platforms.
  59. *
  60. * Rev 1.5 23 Dec 1994 10:48:10 ASHANMUG
  61. * ALPHA/Chrontel-DAC
  62. *
  63. * Rev 1.4 18 Nov 1994 11:55:02 RWOLFF
  64. * Prototype for new routine, renamed register to CLOCK_CNTL to match latest
  65. * documentation, restricted this register to I/O operation only, since it
  66. * isn't reliable in memory mapped form.
  67. *
  68. * Rev 1.3 31 Aug 1994 16:31:20 RWOLFF
  69. * No longer claims VGA_SLEEP register, which we didn't access and which
  70. * conflicted with DigiBoard.
  71. *
  72. * Rev 1.3 31 Aug 1994 16:30:36 RWOLFF
  73. * No longer claims VGA_SLEEP register, which we didn't access and which
  74. * conflicted with DigiBoard.
  75. *
  76. * Rev 1.2 20 Jul 1994 12:58:38 RWOLFF
  77. * Added support for multiple I/O base addresses for accelerator registers.
  78. *
  79. * Rev 1.1 30 Jun 1994 18:16:08 RWOLFF
  80. * Added prototype and definitions for IsApertureConflict_cx() (moved from
  81. * QUERY_CX.C).
  82. *
  83. * Rev 1.0 31 Jan 1994 11:48:44 RWOLFF
  84. * Initial revision.
  85. *
  86. * Rev 1.0 05 Nov 1993 13:37:06 RWOLFF
  87. * Initial revision.
  88. End of PolyTron RCS section *****************/
  89. #ifdef DOC
  90. SETUP_CX.H - Header file for SETUP_CX.C
  91. #endif
  92. /*
  93. * Prototypes for functions supplied by SETUP_CX.C
  94. */
  95. extern VP_STATUS CompatIORangesUsable_cx(INTERFACE_TYPE SystemBus);
  96. extern VP_STATUS CompatMMRangesUsable_cx(void);
  97. extern int WaitForIdle_cx(void);
  98. extern void CheckFIFOSpace_cx(WORD SpaceNeeded);
  99. extern BOOL IsApertureConflict_cx(struct query_structure *QueryPtr);
  100. extern USHORT GetIOBase_cx(void);
  101. extern BOOL IsPackedIO_cx(void);
  102. /*
  103. * Definitions and global variables used in searching for
  104. * block I/O relocatable cards.
  105. */
  106. #define ATI_MAX_BLOCK_CARDS 16 /* AH values A0 through AF for INT 10 */
  107. extern UCHAR LookForAnotherCard;
  108. /*
  109. * Definitions used internally by SETUP_CX.C
  110. */
  111. #ifdef INCLUDE_SETUP_CX
  112. /*
  113. * Avoid runtime bugs due to overflowing the address range arrays
  114. * in the HW_DEVICE_EXTENSION structure.
  115. *
  116. * If more address ranges are added without increasing
  117. * NUM_DRIVER_ACCESS_RANGES, we will get a compile-time error because
  118. * too many entries in DriverIORange[] will be initialized. If
  119. * NUM_DRIVER_ACCESS_RANGES is increased beyond the size of
  120. * the arrays in the HW_DEVICE_EXTENSION structure, the "#if"
  121. * statement will generate a compile-time error.
  122. *
  123. * We can't use an implicit size on DriverIORange[] and define
  124. * NUM_DRIVER_ACCESS_RANGES as sizeof(DriverIORange)/sizeof(VIDEO_ACCESS_RANGE)
  125. * because the expression in a #if statement can't use the
  126. * sizeof() operator.
  127. */
  128. #define NUM_DRIVER_ACCESS_RANGES 107
  129. /*
  130. * Indicate whether the specified address range is in I/O space or
  131. * memory mapped space. These values are intended to make it easier
  132. * to read the Driver??Range[] structures.
  133. */
  134. #define ISinIO TRUE
  135. #define ISinMEMORY FALSE
  136. /*
  137. * Indicate that this register is not available in the current (either
  138. * I/O or memory mapped) form.
  139. */
  140. #define DONT_USE -1
  141. /*
  142. * Definitions and arrays to allow accelerator registers with variable
  143. * bases to be built in DriverIORange_cx[]. Definitions mark the first
  144. * accelerator register in the array (VGA registers have a fixed base),
  145. * and the number of registers to loop through while building the
  146. * accelerator registers. The arrays contain the variable portions
  147. * of the registers in the order they appear in DriverIORange_cx[],
  148. * and the base addresses.
  149. */
  150. #define FIRST_REG_TO_BUILD 8
  151. #define NUM_REGS_TO_BUILD 30
  152. USHORT VariableRegisterBases[NUM_BASE_ADDRESSES] = {
  153. M64_STD_BASE_ADDR,
  154. M64_ALT_BASE_ADDR_1,
  155. M64_ALT_BASE_ADDR_2
  156. };
  157. USHORT VariableRegisterOffsets[NUM_REGS_TO_BUILD] = {
  158. IO_CRTC_H_TOTAL_DISP,
  159. IO_CRTC_H_SYNC_STRT_WID,
  160. IO_CRTC_V_TOTAL_DISP,
  161. IO_CRTC_V_SYNC_STRT_WID,
  162. IO_CRTC_CRNT_VLINE,
  163. IO_CRTC_OFF_PITCH,
  164. IO_CRTC_INT_CNTL,
  165. IO_CRTC_GEN_CNTL,
  166. IO_OVR_CLR,
  167. IO_OVR_WID_LEFT_RIGHT,
  168. IO_OVR_WID_TOP_BOTTOM,
  169. IO_CUR_CLR0,
  170. IO_CUR_CLR1,
  171. IO_CUR_OFFSET,
  172. IO_CUR_HORZ_VERT_POSN,
  173. IO_CUR_HORZ_VERT_OFF,
  174. IO_SCRATCH_REG0,
  175. IO_SCRATCH_REG1,
  176. IO_CLOCK_CNTL,
  177. IO_BUS_CNTL,
  178. IO_MEM_CNTL,
  179. IO_MEM_VGA_WP_SEL,
  180. IO_MEM_VGA_RP_SEL,
  181. IO_DAC_REGS,
  182. IO_DAC_CNTL,
  183. IO_GEN_TEST_CNTL,
  184. IO_CONFIG_CNTL,
  185. IO_CONFIG_CHIP_ID,
  186. IO_CONFIG_STAT0,
  187. IO_CONFIG_STAT1
  188. };
  189. /*
  190. * For cards with relocatable I/O, the I/O registers
  191. * are in a dense block, with each register at the
  192. * same DWORD index into the block as it is into the
  193. * block of memory mapped registers.
  194. */
  195. USHORT RelocatableRegisterOffsets[NUM_REGS_TO_BUILD] = {
  196. MM_CRTC_H_TOTAL_DISP,
  197. MM_CRTC_H_SYNC_STRT_WID,
  198. MM_CRTC_V_TOTAL_DISP,
  199. MM_CRTC_V_SYNC_STRT_WID,
  200. MM_CRTC_CRNT_VLINE,
  201. MM_CRTC_OFF_PITCH,
  202. MM_CRTC_INT_CNTL,
  203. MM_CRTC_GEN_CNTL,
  204. MM_OVR_CLR,
  205. MM_OVR_WID_LEFT_RIGHT,
  206. MM_OVR_WID_TOP_BOTTOM,
  207. MM_CUR_CLR0,
  208. MM_CUR_CLR1,
  209. MM_CUR_OFFSET,
  210. MM_CUR_HORZ_VERT_POSN,
  211. MM_CUR_HORZ_VERT_OFF,
  212. MM_SCRATCH_REG0,
  213. MM_SCRATCH_REG1,
  214. MM_CLOCK_CNTL,
  215. MM_BUS_CNTL,
  216. MM_MEM_CNTL,
  217. MM_MEM_VGA_WP_SEL,
  218. MM_MEM_VGA_RP_SEL,
  219. MM_DAC_REGS,
  220. MM_DAC_CNTL,
  221. MM_GEN_TEST_CNTL,
  222. MM_CONFIG_CNTL,
  223. MM_CONFIG_CHIP_ID,
  224. MM_CONFIG_STAT0,
  225. MM_CONFIG_STAT1
  226. };
  227. /*
  228. * Number of registers which exist in I/O mapped form. When we claim the
  229. * VGA and linear apertures, we will temporarily park their address
  230. * ranges immediately after the I/O mapped registers.
  231. */
  232. #define NUM_IO_REGISTERS 38
  233. #define VGA_APERTURE_ENTRY NUM_IO_REGISTERS
  234. #define LFB_ENTRY 1 /* Offset into DriverApertureRange_cx[] */
  235. /*
  236. * Size of BIOS block to claim. On some machines, we must claim the
  237. * region occupied by our video BIOS in order to be able to detect
  238. * a Mach 64, but if we claim the full 64k when we have only a 32k
  239. * BIOS (Mach 64 cards are available with both 32k and 64k BIOSes)
  240. * and the driver for a SCSI card with its BIOS segment in the second
  241. * 32k claims its BIOS segment, we will be rejected.
  242. */
  243. #define CLAIM_64k_BIOS 0
  244. #define CLAIM_32k_BIOS 1
  245. #define CLAIM_APERTURE_ONLY 2
  246. #define NUM_CLAIM_SIZES 3
  247. ULONG VgaResourceSize[NUM_CLAIM_SIZES] =
  248. {
  249. 0x30000, /* Text and graphics screens, and 64k BIOS area */
  250. 0x28000, /* Text and graphics screens, and 32k BIOS area */
  251. 0x20000 /* Text and graphics screens only */
  252. };
  253. /*
  254. * Memory ranges we need to claim. The first is the VGA aperture, which
  255. * is always at a fixed location. The second is the linear framebuffer,
  256. * which we don't yet know where or how big it is. This information
  257. * will be filled in when we get it.
  258. *
  259. * In the VGA aperture, we must claim the graphics screen (A0000-AFFFF)
  260. * since this is used as the paged aperture, the text screens (B0000-B7FFF
  261. * and B8000-BFFFF) since the memory-mapped registers are here when we
  262. * use the paged aperture, and we use off-screen memory here to store our
  263. * query information, and the video BIOS (C0000-CFFFF) since we must
  264. * retrieve some information (signature string, table of maximum pixel
  265. * clock frequency for each resolution/refresh pair) from this region.
  266. * Since these areas are contiguous, and we do not need exclusive access
  267. * to any of them, claim them as a single block.
  268. */
  269. VIDEO_ACCESS_RANGE DriverApertureRange_cx[2] = {
  270. {0xA0000, 0, 0, ISinMEMORY, TRUE, TRUE},
  271. {0, 0, 0, ISinMEMORY, TRUE, FALSE}
  272. };
  273. /*
  274. * Structure list is address, 0 or "not available" flag, length,
  275. * inIOspace, visible, shareable. This order matches the enumeration
  276. * in AMACHCX.H.
  277. *
  278. * VGAWonder-compatible I/O ranges come first in no particular order,
  279. * followed by the coprocessor registers in increasing order of I/O and
  280. * memory mapped addresses. This order was chosen because all the VGA
  281. * addresses are I/O mapped, as are the non-GUI coprocessor registers,
  282. * while the GUI coprocessor registers are only available as memory mapped.
  283. *
  284. * Since all the I/O mapped registers are in a block at the beginning of
  285. * the structure, we can feed VideoPortVerifyAccessRanges() a truncated
  286. * version of the structure (all I/O mapped registers, but none that are
  287. * only available as memory-mapped) to claim the I/O address space we need.
  288. *
  289. * The I/O addresses shown for accelerator registers are for reference only,
  290. * to show which register goes in which location. The actual register
  291. * value will be built "on the fly", since these registers have variable
  292. * base addresses.
  293. */
  294. VIDEO_ACCESS_RANGE DriverIORange_cx[NUM_DRIVER_ACCESS_RANGES] = {
  295. {IO_VGA_BASE_IO_PORT , 0 , IO_VGA_START_BREAK_PORT - IO_VGA_BASE_IO_PORT + 1, ISinIO, TRUE, TRUE},
  296. {IO_VGA_END_BREAK_PORT , 0 , IO_VGA_MAX_IO_PORT - IO_VGA_END_BREAK_PORT + 1, ISinIO, TRUE, TRUE},
  297. {IO_VGA_SEQ_IND , 0 , 2, ISinIO, TRUE , TRUE},
  298. {IO_VGA_SEQ_DATA , 0 , 1, ISinIO, TRUE , TRUE},
  299. {IO_VGA_GRAX_IND , 0 , 2, ISinIO, TRUE , TRUE},
  300. {IO_VGA_GRAX_DATA , 0 , 1, ISinIO, TRUE , TRUE},
  301. {IO_reg1CE , 0 , 2, ISinIO, TRUE , TRUE},
  302. {IO_reg1CF , 0 , 1, ISinIO, TRUE , TRUE},
  303. {IO_CRTC_H_TOTAL_DISP , 0 , 4, ISinIO, TRUE , FALSE},
  304. {IO_CRTC_H_SYNC_STRT_WID , 0 , 4, ISinIO, TRUE , FALSE},
  305. {IO_CRTC_V_TOTAL_DISP , 0 , 4, ISinIO, TRUE , FALSE}, // 10
  306. {IO_CRTC_V_SYNC_STRT_WID , 0 , 4, ISinIO, TRUE , FALSE},
  307. {IO_CRTC_CRNT_VLINE , 0 , 4, ISinIO, TRUE , FALSE},
  308. {IO_CRTC_OFF_PITCH , 0 , 4, ISinIO, TRUE , FALSE},
  309. {IO_CRTC_INT_CNTL , 0 , 4, ISinIO, TRUE , FALSE},
  310. {IO_CRTC_GEN_CNTL , 0 , 4, ISinIO, TRUE , FALSE},
  311. {IO_OVR_CLR , 0 , 4, ISinIO, TRUE , FALSE},
  312. {IO_OVR_WID_LEFT_RIGHT , 0 , 4, ISinIO, TRUE , FALSE},
  313. {IO_OVR_WID_TOP_BOTTOM , 0 , 4, ISinIO, TRUE , FALSE},
  314. {IO_CUR_CLR0 , 0 , 4, ISinIO, TRUE , FALSE},
  315. {IO_CUR_CLR1 , 0 , 4, ISinIO, TRUE , FALSE}, // 20
  316. {IO_CUR_OFFSET , 0 , 4, ISinIO, TRUE , FALSE},
  317. {IO_CUR_HORZ_VERT_POSN , 0 , 4, ISinIO, TRUE , FALSE},
  318. {IO_CUR_HORZ_VERT_OFF , 0 , 4, ISinIO, TRUE , FALSE},
  319. {IO_SCRATCH_REG0 , 0 , 4, ISinIO, TRUE , FALSE},
  320. {IO_SCRATCH_REG1 , 0 , 4, ISinIO, TRUE , FALSE},
  321. {IO_CLOCK_CNTL , 0 , 4, ISinIO, TRUE , FALSE},
  322. {IO_BUS_CNTL , 0 , 4, ISinIO, TRUE , FALSE},
  323. {IO_MEM_CNTL , 0 , 4, ISinIO, TRUE , FALSE},
  324. {IO_MEM_VGA_WP_SEL , 0 , 4, ISinIO, TRUE , FALSE},
  325. {IO_MEM_VGA_RP_SEL , 0 , 4, ISinIO, TRUE , FALSE}, // 30
  326. {IO_DAC_REGS , 0 , 4, ISinIO, TRUE , FALSE},
  327. {IO_DAC_CNTL , 0 , 4, ISinIO, TRUE , FALSE},
  328. {IO_GEN_TEST_CNTL , 0 , 4, ISinIO, TRUE , FALSE},
  329. {IO_CONFIG_CNTL , 0 , 4, ISinIO, TRUE , FALSE},
  330. {IO_CONFIG_CHIP_ID , 0 , 4, ISinIO, TRUE , FALSE},
  331. {IO_CONFIG_STAT0 , 0 , 4, ISinIO, TRUE , FALSE},
  332. {IO_CONFIG_STAT1 , 0 , 4, ISinIO, TRUE , FALSE},
  333. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE},
  334. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE},
  335. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE}, // 40
  336. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE},
  337. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE},
  338. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE},
  339. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE},
  340. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE},
  341. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE},
  342. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE},
  343. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE},
  344. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE},
  345. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE}, // 50
  346. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE},
  347. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE},
  348. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE},
  349. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE},
  350. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE},
  351. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE},
  352. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE},
  353. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE},
  354. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE},
  355. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE}, // 60
  356. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE},
  357. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE},
  358. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE},
  359. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE},
  360. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE},
  361. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE},
  362. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE},
  363. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE},
  364. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE},
  365. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE}, // 70
  366. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE},
  367. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE},
  368. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE},
  369. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE},
  370. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE},
  371. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE},
  372. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE},
  373. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE},
  374. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE},
  375. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE}, // 80
  376. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE},
  377. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE},
  378. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE},
  379. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE},
  380. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE},
  381. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE},
  382. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE},
  383. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE},
  384. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE},
  385. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE}, // 90
  386. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE},
  387. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE},
  388. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE},
  389. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE},
  390. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE},
  391. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE},
  392. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE},
  393. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE},
  394. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE},
  395. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE}, // 100
  396. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE},
  397. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE},
  398. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE},
  399. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE},
  400. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE},
  401. {FALSE , DONT_USE , 0, ISinIO, TRUE , FALSE}
  402. };
  403. #if NUM_DRIVER_ACCESS_RANGES > NUM_ADDRESS_RANGES_ALLOWED
  404. Insufficient address ranges for 68800CX-compatible graphics cards.
  405. #endif
  406. #define DONT_USE -1 /* Shows that this register is not memory mapped */
  407. /*
  408. * Structure list is address, 0 or "not available" flag, length,
  409. * inIOspace, visible, shareable. This order matches the enumeration
  410. * in AMACHCX.H.
  411. *
  412. * The registers in this structure are in the same order as in
  413. * DriverIORange_cx[], except here we are defining memory mapped
  414. * registers instead of I/O mapped registers.
  415. *
  416. * Some registers are grouped to allow block writes larger than
  417. * the 32 bit register size. To allow this, let Windows NT think
  418. * that the size of this register is actually the total size (in
  419. * bytes) of all remaining registers in the group.
  420. */
  421. VIDEO_ACCESS_RANGE DriverMMRange_cx[NUM_DRIVER_ACCESS_RANGES] = {
  422. {FALSE , DONT_USE , 0, ISinMEMORY, TRUE, FALSE},
  423. {FALSE , DONT_USE , 0, ISinMEMORY, TRUE, FALSE},
  424. {FALSE , DONT_USE , 0, ISinMEMORY, TRUE, FALSE},
  425. {FALSE , DONT_USE , 0, ISinMEMORY, TRUE, FALSE},
  426. {FALSE , DONT_USE , 0, ISinMEMORY, TRUE, FALSE},
  427. {FALSE , DONT_USE , 0, ISinMEMORY, TRUE, FALSE},
  428. {FALSE , DONT_USE , 0, ISinMEMORY, TRUE, FALSE},
  429. {FALSE , DONT_USE , 0, ISinMEMORY, TRUE, FALSE},
  430. {MM_CRTC_H_TOTAL_DISP , 0 , 4, ISinMEMORY, TRUE, FALSE},
  431. {MM_CRTC_H_SYNC_STRT_WID , 0 , 4, ISinMEMORY, TRUE, FALSE},
  432. {MM_CRTC_V_TOTAL_DISP , 0 , 4, ISinMEMORY, TRUE, FALSE}, // 10
  433. {MM_CRTC_V_SYNC_STRT_WID , 0 , 4, ISinMEMORY, TRUE, FALSE},
  434. {MM_CRTC_CRNT_VLINE , 0 , 4, ISinMEMORY, TRUE, FALSE},
  435. {MM_CRTC_OFF_PITCH , 0 , 4, ISinMEMORY, TRUE, FALSE},
  436. {MM_CRTC_INT_CNTL , 0 , 4, ISinMEMORY, TRUE, FALSE},
  437. {MM_CRTC_GEN_CNTL , 0 , 4, ISinMEMORY, TRUE, FALSE},
  438. {MM_OVR_CLR , 0 , 4, ISinMEMORY, TRUE, FALSE},
  439. {MM_OVR_WID_LEFT_RIGHT , 0 , 4, ISinMEMORY, TRUE, FALSE},
  440. {MM_OVR_WID_TOP_BOTTOM , 0 , 4, ISinMEMORY, TRUE, FALSE},
  441. {MM_CUR_CLR0 , 0 , 4, ISinMEMORY, TRUE, FALSE},
  442. {MM_CUR_CLR1 , 0 , 4, ISinMEMORY, TRUE, FALSE}, // 20
  443. {MM_CUR_OFFSET , 0 , 4, ISinMEMORY, TRUE, FALSE},
  444. {MM_CUR_HORZ_VERT_POSN , 0 , 4, ISinMEMORY, TRUE, FALSE},
  445. {MM_CUR_HORZ_VERT_OFF , 0 , 4, ISinMEMORY, TRUE, FALSE},
  446. {MM_SCRATCH_REG0 , 0 , 4, ISinMEMORY, TRUE, FALSE},
  447. {MM_SCRATCH_REG1 , 0 , 4, ISinMEMORY, TRUE, FALSE},
  448. {FALSE , DONT_USE , 0, ISinMEMORY, TRUE, FALSE},
  449. {MM_BUS_CNTL , 0 , 4, ISinMEMORY, TRUE, FALSE},
  450. {MM_MEM_CNTL , 0 , 4, ISinMEMORY, TRUE, FALSE},
  451. {MM_MEM_VGA_WP_SEL , 0 , 4, ISinMEMORY, TRUE, FALSE},
  452. {MM_MEM_VGA_RP_SEL , 0 , 4, ISinMEMORY, TRUE, FALSE}, // 30
  453. {FALSE , DONT_USE , 0, ISinMEMORY, TRUE, FALSE},
  454. {FALSE , DONT_USE , 0, ISinMEMORY, TRUE, FALSE},
  455. {MM_GEN_TEST_CNTL , 0 , 4, ISinMEMORY, TRUE, FALSE},
  456. {FALSE , DONT_USE , 0, ISinMEMORY, TRUE, FALSE},
  457. {MM_CONFIG_CHIP_ID , 0 , 4, ISinMEMORY, TRUE, FALSE},
  458. {MM_CONFIG_STAT0 , 0 , 4, ISinMEMORY, TRUE, FALSE},
  459. {MM_CONFIG_STAT1 , 0 , 4, ISinMEMORY, TRUE, FALSE},
  460. {MM_DST_OFF_PITCH , 0 , 4, ISinMEMORY, TRUE, FALSE},
  461. {MM_DST_X , 0 , 4, ISinMEMORY, TRUE, FALSE},
  462. {MM_DST_Y , 0 , 4, ISinMEMORY, TRUE, FALSE}, // 40
  463. {MM_DST_Y_X , 0 , 4, ISinMEMORY, TRUE, FALSE},
  464. {MM_DST_WIDTH , 0 , 4, ISinMEMORY, TRUE, FALSE},
  465. {MM_DST_HEIGHT , 0 , 4, ISinMEMORY, TRUE, FALSE},
  466. {MM_DST_HEIGHT_WIDTH , 0 , 4, ISinMEMORY, TRUE, FALSE},
  467. {MM_DST_X_WIDTH , 0 , 4, ISinMEMORY, TRUE, FALSE},
  468. {MM_DST_BRES_LNTH , 0 , 4, ISinMEMORY, TRUE, FALSE},
  469. {MM_DST_BRES_ERR , 0 , 4, ISinMEMORY, TRUE, FALSE},
  470. {MM_DST_BRES_INC , 0 , 4, ISinMEMORY, TRUE, FALSE},
  471. {MM_DST_BRES_DEC , 0 , 4, ISinMEMORY, TRUE, FALSE},
  472. {MM_DST_CNTL , 0 , 4, ISinMEMORY, TRUE, FALSE}, // 50
  473. {MM_SRC_OFF_PITCH , 0 , 4, ISinMEMORY, TRUE, FALSE},
  474. {MM_SRC_X , 0 , 4, ISinMEMORY, TRUE, FALSE},
  475. {MM_SRC_Y , 0 , 4, ISinMEMORY, TRUE, FALSE},
  476. {MM_SRC_Y_X , 0 , 4, ISinMEMORY, TRUE, FALSE},
  477. {MM_SRC_WIDTH1 , 0 , 4, ISinMEMORY, TRUE, FALSE},
  478. {MM_SRC_HEIGHT1 , 0 , 4, ISinMEMORY, TRUE, FALSE},
  479. {MM_SRC_HEIGHT1_WIDTH1 , 0 , 4, ISinMEMORY, TRUE, FALSE},
  480. {MM_SRC_X_START , 0 , 4, ISinMEMORY, TRUE, FALSE},
  481. {MM_SRC_Y_START , 0 , 4, ISinMEMORY, TRUE, FALSE},
  482. {MM_SRC_Y_X_START , 0 , 4, ISinMEMORY, TRUE, FALSE}, // 60
  483. {MM_SRC_WIDTH2 , 0 , 4, ISinMEMORY, TRUE, FALSE},
  484. {MM_SRC_HEIGHT2 , 0 , 4, ISinMEMORY, TRUE, FALSE},
  485. {MM_SRC_HEIGHT2_WIDTH2 , 0 , 4, ISinMEMORY, TRUE, FALSE},
  486. {MM_SRC_CNTL , 0 , 4, ISinMEMORY, TRUE, FALSE},
  487. {MM_HOST_DATA0 , 0 ,64, ISinMEMORY, TRUE, FALSE},
  488. {MM_HOST_DATA1 , 0 ,60, ISinMEMORY, TRUE, FALSE},
  489. {MM_HOST_DATA2 , 0 ,56, ISinMEMORY, TRUE, FALSE},
  490. {MM_HOST_DATA3 , 0 ,52, ISinMEMORY, TRUE, FALSE},
  491. {MM_HOST_DATA4 , 0 ,48, ISinMEMORY, TRUE, FALSE},
  492. {MM_HOST_DATA5 , 0 ,44, ISinMEMORY, TRUE, FALSE}, // 70
  493. {MM_HOST_DATA6 , 0 ,40, ISinMEMORY, TRUE, FALSE},
  494. {MM_HOST_DATA7 , 0 ,36, ISinMEMORY, TRUE, FALSE},
  495. {MM_HOST_DATA8 , 0 ,32, ISinMEMORY, TRUE, FALSE},
  496. {MM_HOST_DATA9 , 0 ,28, ISinMEMORY, TRUE, FALSE},
  497. {MM_HOST_DATA10 , 0 ,24, ISinMEMORY, TRUE, FALSE},
  498. {MM_HOST_DATA11 , 0 ,20, ISinMEMORY, TRUE, FALSE},
  499. {MM_HOST_DATA12 , 0 ,16, ISinMEMORY, TRUE, FALSE},
  500. {MM_HOST_DATA13 , 0 ,12, ISinMEMORY, TRUE, FALSE},
  501. {MM_HOST_DATA14 , 0 , 8, ISinMEMORY, TRUE, FALSE},
  502. {MM_HOST_DATA15 , 0 , 4, ISinMEMORY, TRUE, FALSE}, // 80
  503. {MM_HOST_CNTL , 0 , 4, ISinMEMORY, TRUE, FALSE},
  504. {MM_PAT_REG0 , 0 , 8, ISinMEMORY, TRUE, FALSE},
  505. {MM_PAT_REG1 , 0 , 4, ISinMEMORY, TRUE, FALSE},
  506. {MM_PAT_CNTL , 0 , 4, ISinMEMORY, TRUE, FALSE},
  507. {MM_SC_LEFT , 0 , 4, ISinMEMORY, TRUE, FALSE},
  508. {MM_SC_RIGHT , 0 , 4, ISinMEMORY, TRUE, FALSE},
  509. {MM_SC_LEFT_RIGHT , 0 , 4, ISinMEMORY, TRUE, FALSE},
  510. {MM_SC_TOP , 0 , 4, ISinMEMORY, TRUE, FALSE},
  511. {MM_SC_BOTTOM , 0 , 4, ISinMEMORY, TRUE, FALSE},
  512. {MM_SC_TOP_BOTTOM , 0 , 4, ISinMEMORY, TRUE, FALSE}, // 90
  513. {MM_DP_BKGD_CLR , 0 , 4, ISinMEMORY, TRUE, FALSE},
  514. {MM_DP_FRGD_CLR , 0 , 4, ISinMEMORY, TRUE, FALSE},
  515. {MM_DP_WRITE_MASK , 0 , 4, ISinMEMORY, TRUE, FALSE},
  516. {MM_DP_CHAIN_MASK , 0 , 4, ISinMEMORY, TRUE, FALSE},
  517. {MM_DP_PIX_WIDTH , 0 , 4, ISinMEMORY, TRUE, FALSE},
  518. {MM_DP_MIX , 0 , 4, ISinMEMORY, TRUE, FALSE},
  519. {MM_DP_SRC , 0 , 4, ISinMEMORY, TRUE, FALSE},
  520. {MM_CLR_CMP_CLR , 0 , 4, ISinMEMORY, TRUE, FALSE},
  521. {MM_CLR_CMP_MSK , 0 , 4, ISinMEMORY, TRUE, FALSE},
  522. {MM_CLR_CMP_CNTL , 0 , 4, ISinMEMORY, TRUE, FALSE}, // 100
  523. {MM_FIFO_STAT , 0 , 4, ISinMEMORY, TRUE, FALSE},
  524. {MM_CONTEXT_MASK , 0 , 4, ISinMEMORY, TRUE, FALSE},
  525. {MM_CONTEXT_SAVE_CNTL , 0 , 4, ISinMEMORY, TRUE, FALSE},
  526. {MM_CONTEXT_LOAD_CNTL , 0 , 4, ISinMEMORY, TRUE, FALSE},
  527. {MM_GUI_TRAJ_CNTL , 0 , 4, ISinMEMORY, TRUE, FALSE},
  528. {MM_GUI_STAT , 0 , 4, ISinMEMORY, TRUE, FALSE}
  529. };
  530. /*
  531. * Device IDs for PCI configuration registers. Only non-Mach 64
  532. * IDs are listed here, since future IDs will (for the forseeable
  533. * future) almost certainly be Mach 64 cards, so we can assume
  534. * that any ID we haven't rejected is a Mach 64, which we should
  535. * accept.
  536. *
  537. * Currently, the Mach 32 AX is our only PCI card which is not
  538. * a Mach 64.
  539. */
  540. #define ATI_DEVID_M32AX 0x4158
  541. #endif /* defined INCLUDE_SETUP_CX */