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.

389 lines
9.4 KiB

  1. /*++
  2. Copyright (c) 1990 Microsoft Corporation
  3. Module Name:
  4. eisa.h
  5. Abstract:
  6. The module defines the structures, and defines for the EISA chip set.
  7. Author:
  8. Jeff Havens (jhavens) 19-Jun-1991
  9. Revision History:
  10. --*/
  11. #ifndef _EISA_
  12. #define _EISA_
  13. //
  14. // Define the DMA page register structure.
  15. //
  16. typedef struct _DMA_PAGE{
  17. UCHAR Reserved1;
  18. UCHAR Channel2;
  19. UCHAR Channel3;
  20. UCHAR Channel1;
  21. UCHAR Reserved2[3];
  22. UCHAR Channel0;
  23. UCHAR Reserved3;
  24. UCHAR Channel6;
  25. UCHAR Channel7;
  26. UCHAR Channel5;
  27. UCHAR Reserved4[3];
  28. UCHAR RefreshPage;
  29. }DMA_PAGE, *PDMA_PAGE;
  30. //
  31. // Define the DMA stop register structure.
  32. //
  33. typedef struct _DMA_CHANNEL_STOP {
  34. UCHAR ChannelLsb;
  35. UCHAR ChannelMsb;
  36. UCHAR ChannelHsb;
  37. UCHAR Reserved;
  38. }DMA_CHANNEL_STOP, *PDMA_CHANNEL_STOP;
  39. //
  40. // Define DMA 1 address and count structure.
  41. //
  42. typedef struct _DMA1_ADDRESS_COUNT {
  43. UCHAR DmaBaseAddress;
  44. UCHAR DmaBaseCount;
  45. }DMA1_ADDRESS_COUNT, *PDMA1_ADDRESS_COUNT;
  46. //
  47. // Define DMA 2 address and count structure.
  48. //
  49. typedef struct _DMA2_ADDRESS_COUNT {
  50. UCHAR DmaBaseAddress;
  51. UCHAR Reserved1;
  52. UCHAR DmaBaseCount;
  53. UCHAR Reserved2;
  54. }DMA2_ADDRESS_COUNT, *PDMA2_ADDRESS_COUNT;
  55. //
  56. // Define DMA 1 control register structure.
  57. //
  58. typedef struct _DMA1_CONTROL {
  59. DMA1_ADDRESS_COUNT DmaAddressCount[4];
  60. UCHAR DmaStatus;
  61. UCHAR DmaRequest;
  62. UCHAR SingleMask;
  63. UCHAR Mode;
  64. UCHAR ClearBytePointer;
  65. UCHAR MasterClear;
  66. UCHAR ClearMask;
  67. UCHAR AllMask;
  68. }DMA1_CONTROL, *PDMA1_CONTROL;
  69. //
  70. // Define DMA 2 control register structure.
  71. //
  72. typedef struct _DMA2_CONTROL {
  73. DMA2_ADDRESS_COUNT DmaAddressCount[4];
  74. UCHAR DmaStatus;
  75. UCHAR Reserved1;
  76. UCHAR DmaRequest;
  77. UCHAR Reserved2;
  78. UCHAR SingleMask;
  79. UCHAR Reserved3;
  80. UCHAR Mode;
  81. UCHAR Reserved4;
  82. UCHAR ClearBytePointer;
  83. UCHAR Reserved5;
  84. UCHAR MasterClear;
  85. UCHAR Reserved6;
  86. UCHAR ClearMask;
  87. UCHAR Reserved7;
  88. UCHAR AllMask;
  89. UCHAR Reserved8;
  90. }DMA2_CONTROL, *PDMA2_CONTROL;
  91. //
  92. // Define Timer control register structure.
  93. //
  94. typedef struct _TIMER_CONTROL {
  95. UCHAR BcdMode : 1;
  96. UCHAR Mode : 3;
  97. UCHAR SelectByte : 2;
  98. UCHAR SelectCounter : 2;
  99. }TIMER_CONTROL, *PTIMER_CONTROL;
  100. //
  101. // Define Timer status register structure.
  102. //
  103. typedef struct _TIMER_STATUS {
  104. UCHAR BcdMode : 1;
  105. UCHAR Mode : 3;
  106. UCHAR SelectByte : 2;
  107. UCHAR CrContentsMoved : 1;
  108. UCHAR OutPin : 1;
  109. }TIMER_STATUS, *PTIMER_STATUS;
  110. //
  111. // Define Mode values.
  112. //
  113. #define TM_SIGNAL_END_OF_COUNT 0
  114. #define TM_ONE_SHOT 1
  115. #define TM_RATE_GENERATOR 2
  116. #define TM_SQUARE_WAVE 3
  117. #define TM_SOFTWARE_STROBE 4
  118. #define TM_HARDWARE_STROBE 5
  119. //
  120. // Define SelectByte values
  121. //
  122. #define SB_COUNTER_LATCH 0
  123. #define SB_LSB_BYTE 1
  124. #define SB_MSB_BYTE 2
  125. #define SB_LSB_THEN_MSB 3
  126. //
  127. // Define SelectCounter values.
  128. //
  129. #define SELECT_COUNTER_0 0
  130. #define SELECT_COUNTER_1 1
  131. #define SELECT_COUNTER_2 2
  132. #define SELECT_READ_BACK 3
  133. //
  134. // Define Timer clock for speaker.
  135. //
  136. #define TIMER_CLOCK_IN 1193167 // 1.193Mhz
  137. //
  138. // Define NMI Status/Control register structure.
  139. //
  140. typedef struct _NMI_STATUS {
  141. UCHAR SpeakerGate : 1;
  142. UCHAR SpeakerData : 1;
  143. UCHAR DisableEisaParity : 1;
  144. UCHAR DisableNmi : 1;
  145. UCHAR RefreshToggle : 1;
  146. UCHAR SpeakerTimer : 1;
  147. UCHAR IochkNmi : 1;
  148. UCHAR ParityNmi : 1;
  149. }NMI_STATUS, *PNMI_STATUS;
  150. //
  151. // Define NMI Enable register structure.
  152. //
  153. typedef struct _NMI_ENABLE {
  154. UCHAR RtClockAddress : 7;
  155. UCHAR NmiDisable : 1;
  156. }NMI_ENABLE, *PNMI_ENABLE;
  157. //
  158. // Define the NMI extended status and control register structure.
  159. //
  160. typedef struct _NMI_EXTENDED_CONTROL {
  161. UCHAR BusReset : 1;
  162. UCHAR EnableNmiPort : 1;
  163. UCHAR EnableFailSafeNmi : 1;
  164. UCHAR EnableBusMasterTimeout : 1;
  165. UCHAR Reserved1 : 1;
  166. UCHAR PendingPortNmi : 1;
  167. UCHAR PendingBusMasterTimeout : 1;
  168. UCHAR PendingFailSafeNmi : 1;
  169. }NMI_EXTENDED_CONTROL, *PNMI_EXTENDED_CONTROL;
  170. //
  171. // Define 82357 register structure.
  172. //
  173. typedef struct _EISA_CONTROL {
  174. DMA1_CONTROL Dma1BasePort; // Offset 0x000
  175. UCHAR Reserved0[16];
  176. UCHAR Interrupt1ControlPort0; // Offset 0x020
  177. UCHAR Interrupt1ControlPort1; // Offset 0x021
  178. UCHAR Reserved1[32 - 2];
  179. UCHAR Timer1; // Offset 0x40
  180. UCHAR RefreshRequest; // Offset 0x41
  181. UCHAR SpeakerTone; // Offset 0x42
  182. UCHAR CommandMode1; // Offset 0x43
  183. UCHAR Reserved17[4];
  184. UCHAR Timer2; // Offset 0x48
  185. UCHAR Reserved13;
  186. UCHAR CpuSpeedControl; // Offset 0x4a
  187. UCHAR CommandMode2; // Offset 0x4b
  188. UCHAR Reserved14[21];
  189. UCHAR NmiStatus; // Offset 0x61
  190. UCHAR Reserved15[14];
  191. UCHAR NmiEnable; // Offset 0x70
  192. UCHAR Reserved16[15];
  193. DMA_PAGE DmaPageLowPort; // Offset 0x080
  194. UCHAR Reserved2[16];
  195. UCHAR Interrupt2ControlPort0; // Offset 0x0a0
  196. UCHAR Interrupt2ControlPort1; // Offset 0x0a1
  197. UCHAR Reserved3[32-2];
  198. DMA2_CONTROL Dma2BasePort; // Offset 0x0c0
  199. UCHAR Reserved4[0x320];
  200. UCHAR Dma1CountHigh[8]; // Offset 0x400
  201. UCHAR Reserved5[2];
  202. UCHAR Dma1ChainingInterrupt; // Offset 0x40a
  203. UCHAR Dma1ExtendedModePort; // Offset 0x40b
  204. UCHAR MasterControlPort; // Offset 0x40c
  205. UCHAR SteppingLevelRegister; // Offset 0x40d
  206. UCHAR IspTest1; // Offset 0x40e
  207. UCHAR IspTest2; // Offset 0x40f
  208. UCHAR Reserved6[81];
  209. UCHAR ExtendedNmiResetControl; // Offset 0x461
  210. UCHAR NmiIoInterruptPort; // Offset 0x462
  211. UCHAR Reserved7;
  212. UCHAR LastMaster; // Offset 0x464
  213. UCHAR Reserved8[27];
  214. DMA_PAGE DmaPageHighPort; // Offset 0x480
  215. UCHAR Reserved12[48];
  216. UCHAR Dma2HighCount[16]; // Offset 0x4c0
  217. UCHAR Interrupt1EdgeLevel; // Offset 0x4d0
  218. UCHAR Interrupt2EdgeLevel; // Offset 0x4d1
  219. UCHAR Reserved9[2];
  220. UCHAR Dma2ChainingInterrupt; // Offset 0x4d4
  221. UCHAR Reserved10;
  222. UCHAR Dma2ExtendedModePort; // Offset 0x4d6
  223. UCHAR Reserved11[9];
  224. DMA_CHANNEL_STOP DmaChannelStop[8]; // Offset 0x4e0
  225. } EISA_CONTROL, *PEISA_CONTROL;
  226. //
  227. // Define initialization command word 1 structure.
  228. //
  229. typedef struct _INITIALIZATION_COMMAND_1 {
  230. UCHAR Icw4Needed : 1;
  231. UCHAR CascadeMode : 1;
  232. UCHAR Unused1 : 2;
  233. UCHAR InitializationFlag : 1;
  234. UCHAR Unused2 : 3;
  235. }INITIALIZATION_COMMAND_1, *PINITIALIZATION_COMMAND_1;
  236. //
  237. // Define initialization command word 4 structure.
  238. //
  239. typedef struct _INITIALIZATION_COMMAND_4 {
  240. UCHAR I80x86Mode : 1;
  241. UCHAR AutoEndOfInterruptMode : 1;
  242. UCHAR Unused1 : 2;
  243. UCHAR SpecialFullyNested : 1;
  244. UCHAR Unused2 : 3;
  245. }INITIALIZATION_COMMAND_4, *PINITIALIZATION_COMMAND_4;
  246. //
  247. // Define EISA interrupt controller operational command values.
  248. // Define operation control word 2 commands.
  249. //
  250. #define NONSPECIFIC_END_OF_INTERRUPT 0x20
  251. #define SPECIFIC_END_OF_INTERRUPT 0x60
  252. //
  253. // Define the IRQL which the slave intterrupts the master controller.
  254. //
  255. #define SLAVE_IRQL_LEVEL 2
  256. //
  257. // Define external EISA interupts
  258. //
  259. #define EISA_EXTERNAL_INTERRUPTS_1 0xf8
  260. #define EISA_EXTERNAL_INTERRUPTS_2 0xbe
  261. //
  262. // Define the DMA mode register structure.
  263. //
  264. typedef struct _DMA_EISA_MODE {
  265. UCHAR Channel : 2;
  266. UCHAR TransferType : 2;
  267. UCHAR AutoInitialize : 1;
  268. UCHAR AddressDecrement : 1;
  269. UCHAR RequestMode : 2;
  270. }DMA_EISA_MODE, *PDMA_EISA_MODE;
  271. //
  272. // Define TransferType values.
  273. //
  274. #define VERIFY_TRANSFER 0x00
  275. #define READ_TRANSFER 0x01 // Read from the device.
  276. #define WRITE_TRANSFER 0x02 // Write to the device.
  277. //
  278. // Define RequestMode values.
  279. //
  280. #define DEMAND_REQUEST_MODE 0x00
  281. #define SINGLE_REQUEST_MODE 0x01
  282. #define BLOCK_REQUEST_MODE 0x02
  283. #define CASCADE_REQUEST_MODE 0x03
  284. //
  285. // Define the DMA extended mode register structure.
  286. //
  287. typedef struct _DMA_EXTENDED_MODE {
  288. UCHAR ChannelNumber : 2;
  289. UCHAR TransferSize : 2;
  290. UCHAR TimingMode : 2;
  291. UCHAR EndOfPacketInput : 1;
  292. UCHAR StopRegisterEnabled : 1;
  293. }DMA_EXTENDED_MODE, *PDMA_EXTENDED_MODE;
  294. //
  295. // Define the DMA extended mode register transfer size values.
  296. //
  297. #define BY_BYTE_8_BITS 0
  298. #define BY_WORD_16_BITS 1
  299. #define BY_BYTE_32_BITS 2
  300. #define BY_BYTE_16_BITS 3
  301. //
  302. // Define the DMA extended mode timing mode values.
  303. //
  304. #define COMPATIBLITY_TIMING 0
  305. #define TYPE_A_TIMING 1
  306. #define TYPE_B_TIMING 2
  307. #define BURST_TIMING 3
  308. #ifndef DMA1_COMMAND_STATUS
  309. //
  310. // Define constants used by Intel 8237A DMA chip
  311. //
  312. #define DMA_SETMASK 4
  313. #define DMA_CLEARMASK 0
  314. #define DMA_READ 4 // These two appear backwards, but I think
  315. #define DMA_WRITE 8 // the DMA docs have them mixed up
  316. #define DMA_SINGLE_TRANSFER 0x40
  317. #define DMA_AUTO_INIT 0x10 // Auto initialization mode
  318. #endif
  319. #endif
  320.