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.

239 lines
6.5 KiB

  1. /*++
  2. Copyright (c) 1990 Microsoft Corporation
  3. Copyright (c) 1991 NCR Corporation
  4. Module Name:
  5. mca.h
  6. Abstract:
  7. This module contains the defines and structure definitions for
  8. Micro Channel machines.
  9. Author:
  10. David Risner (o-ncrdr) 21-Jul-1991
  11. Revision History:
  12. --*/
  13. #ifndef _MCA_
  14. #define _MCA_
  15. //
  16. // Define the DMA page register structure (for 8237 compatibility)
  17. //
  18. typedef struct _DMA_PAGE{
  19. UCHAR Reserved1;
  20. UCHAR Channel2;
  21. UCHAR Channel3;
  22. UCHAR Channel1;
  23. UCHAR Reserved2[3];
  24. UCHAR Channel0;
  25. UCHAR Reserved3;
  26. UCHAR Channel6;
  27. UCHAR Channel7;
  28. UCHAR Channel5;
  29. UCHAR Reserved4[3];
  30. UCHAR RefreshPage;
  31. } DMA_PAGE, *PDMA_PAGE;
  32. //
  33. // Define DMA 1 address and count structure (for 8237 compatibility)
  34. //
  35. typedef struct _DMA1_ADDRESS_COUNT {
  36. UCHAR DmaBaseAddress;
  37. UCHAR DmaBaseCount;
  38. } DMA1_ADDRESS_COUNT, *PDMA1_ADDRESS_COUNT;
  39. //
  40. // Define DMA 2 address and count structure (for 8237 compatibility)
  41. //
  42. typedef struct _DMA2_ADDRESS_COUNT {
  43. UCHAR DmaBaseAddress;
  44. UCHAR Reserved1;
  45. UCHAR DmaBaseCount;
  46. UCHAR Reserved2;
  47. } DMA2_ADDRESS_COUNT, *PDMA2_ADDRESS_COUNT;
  48. //
  49. // Define DMA 1 control register structure (for 8237 compatibility)
  50. //
  51. typedef struct _DMA1_CONTROL {
  52. DMA1_ADDRESS_COUNT DmaAddressCount[4];
  53. UCHAR DmaStatus;
  54. UCHAR DmaRequest;
  55. UCHAR SingleMask;
  56. UCHAR Mode;
  57. UCHAR ClearBytePointer;
  58. UCHAR MasterClear;
  59. UCHAR ClearMask;
  60. UCHAR AllMask;
  61. } DMA1_CONTROL, *PDMA1_CONTROL;
  62. //
  63. // Define DMA 2 control register structure (for 8237 compatibility)
  64. //
  65. typedef struct _DMA2_CONTROL {
  66. DMA2_ADDRESS_COUNT DmaAddressCount[4];
  67. UCHAR DmaStatus;
  68. UCHAR Reserved1;
  69. UCHAR DmaRequest;
  70. UCHAR Reserved2;
  71. UCHAR SingleMask;
  72. UCHAR Reserved3;
  73. UCHAR Mode;
  74. UCHAR Reserved4;
  75. UCHAR ClearBytePointer;
  76. UCHAR Reserved5;
  77. UCHAR MasterClear;
  78. UCHAR Reserved6;
  79. UCHAR ClearMask;
  80. UCHAR Reserved7;
  81. UCHAR AllMask;
  82. UCHAR Reserved8;
  83. } DMA2_CONTROL, *PDMA2_CONTROL;
  84. typedef struct _MCA_DMA_CONTROLLER {
  85. UCHAR DmaFunctionLsb; // Offset 0x018
  86. UCHAR DmaFunctionMsb; // Offset 0x019
  87. UCHAR DmaFunctionData; // Offset 0x01a
  88. UCHAR Reserved01;
  89. UCHAR ScbAttentionPort; // Offset 0x01c
  90. UCHAR ScbCommandPort; // Offset 0x01d
  91. UCHAR Reserved02;
  92. UCHAR ScbStatusPort; // Offset 0x01f
  93. } MCA_DMA_CONTROLLER, *PMCA_DMA_CONTROLLER;
  94. //
  95. // Define Programmable Option Select register set
  96. //
  97. typedef struct _PROGRAMMABLE_OPTION_SELECT {
  98. UCHAR AdapterIdLsb;
  99. UCHAR AdapterIdMsb;
  100. UCHAR OptionSelectData1;
  101. UCHAR OptionSelectData2;
  102. UCHAR OptionSelectData3;
  103. UCHAR OptionSelectData4;
  104. UCHAR SubaddressExtensionLsb;
  105. UCHAR SubaddressExtensionMsb;
  106. } PROGRAMMABLE_OPTION_SELECT, *PPROGRAMMABLE_OPTION_SELECT;
  107. //
  108. // Define Micro Channel i/o address map
  109. //
  110. typedef struct _MCA_CONTROL {
  111. DMA1_CONTROL Dma1BasePort; // Offset 0x000
  112. UCHAR Reserved0[8];
  113. UCHAR ExtendedDmaBasePort[8]; // Offset 0x018
  114. UCHAR Interrupt1ControlPort0; // Offset 0x020
  115. UCHAR Interrupt1ControlPort1; // Offset 0x021
  116. UCHAR Reserved1[64 - 1];
  117. UCHAR SystemControlPortB; // Offset 0x061
  118. UCHAR Reserved2[32 - 2];
  119. DMA_PAGE DmaPageLowPort; // Offset 0x080
  120. UCHAR Reserved3;
  121. UCHAR CardSelectedFeedback; // Offset 0x091
  122. UCHAR SystemControlPortA; // Offset 0x092
  123. UCHAR Reserved4;
  124. UCHAR SystemBoardSetup; // Offset 0x094
  125. UCHAR Reserved5;
  126. UCHAR AdapterSetup; // Offset 0x096
  127. UCHAR AdapterSetup2; // Offset 0x097
  128. UCHAR Reserved7[8];
  129. UCHAR Interrupt2ControlPort0; // Offset 0x0a0
  130. UCHAR Interrupt2ControlPort1; // Offset 0x0a1
  131. UCHAR Reserved8[32-2];
  132. DMA2_CONTROL Dma2BasePort; // Offset 0x0c0
  133. UCHAR Reserved9[32];
  134. PROGRAMMABLE_OPTION_SELECT Pos; // Offset 0x100
  135. } MCA_CONTROL, *PMCA_CONTROL;
  136. //
  137. // Define POS adapter setup equates for use with AdapterSetup field above
  138. //
  139. #define MCA_ADAPTER_SETUP_ON 0x008
  140. #define MCA_ADAPTER_SETUP_OFF 0x000
  141. //
  142. // Define DMA Extended Function register
  143. //
  144. typedef struct _DMA_EXTENDED_FUNCTION {
  145. UCHAR ChannelNumber : 3;
  146. UCHAR Reserved : 1;
  147. UCHAR Command : 4;
  148. } DMA_EXTENDED_FUNCTION, *PDMA_EXTENDED_FUNCTION;
  149. //
  150. // Define Command values
  151. //
  152. #define WRITE_IO_ADDRESS 0x00 // write I/O address reg
  153. #define WRITE_MEMORY_ADDRESS 0x20 // write memory address reg
  154. #define READ_MEMORY_ADDRESS 0x30 // read memory address reg
  155. #define WRITE_TRANSFER_COUNT 0x40 // write transfer count reg
  156. #define READ_TRANSFER_COUNT 0x50 // read transfer count reg
  157. #define READ_STATUS 0x60 // read status register
  158. #define WRITE_MODE 0x70 // write mode register
  159. #define WRITE_ARBUS 0x80 // write arbus register
  160. #define SET_MASK_BIT 0x90 // set bit in mask reg
  161. #define CLEAR_MASK_BIT 0xa0 // clear bit in mask reg
  162. #define MASTER_CLEAR 0xd0 // master clear
  163. //
  164. // Define DMA Extended Mode register
  165. //
  166. typedef struct _DMA_EXTENDED_MODE {
  167. UCHAR ProgrammedIo : 1; // 0 = do not use programmed i/o address
  168. UCHAR AutoInitialize : 1;
  169. UCHAR DmaOpcode : 1; // 0 = verify memory, 1 = data transfer
  170. UCHAR TransferDirection : 1; // 0 = read memory, 1 = write memory
  171. UCHAR Reserved1 : 2;
  172. UCHAR DmaWidth : 1; // 0 = 8bit, 1 = 16bit
  173. UCHAR Reserved2 : 1;
  174. } DMA_EXTENDED_MODE, *PDMA_EXTENDED_MODE;
  175. //
  176. // DMA Extended Mode equates for use with the _DMA_EXTENDED_MODE structure.
  177. //
  178. #define DMA_EXT_USE_PIO 0x01
  179. #define DMA_EXT_NO_PIO 0x00
  180. #define DMA_EXT_VERIFY 0x00
  181. #define DMA_EXT_DATA_XFER 0x01
  182. #define DMA_EXT_WIDTH_8_BIT 0x00
  183. #define DMA_EXT_WIDTH_16_BIT 0x01
  184. //
  185. // DMA mode option definitions
  186. //
  187. #define DMA_MODE_READ 0x00 // read data into memory
  188. #define DMA_MODE_WRITE 0x08 // write data from memory
  189. #define DMA_MODE_VERIFY 0x00 // verify data
  190. #define DMA_MODE_TRANSFER 0x04 // transfer data
  191. //
  192. // DMA extended mode constants
  193. //
  194. #define MAX_MCA_DMA_CHANNEL_NUMBER 0x07 // maximum MCA DMA channel number
  195. #endif