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.

292 lines
9.4 KiB

  1. /*++
  2. Copyright (c) 1994 Microsoft Corporation
  3. Module Name:
  4. pcicfg.h
  5. Abstract:
  6. Contains defines for vendor specific PCI configuration
  7. information
  8. Author(s):
  9. Ravisankar Pudipeddi (1 Nov 1997)
  10. Largely derived from pcskhw.h for win 9x
  11. Revision History:
  12. --*/
  13. #ifndef _PCMCIA_PCICFG_H_
  14. #define _PCMCIA_PCICFG_H_
  15. //
  16. // Macros for read/writing to PCI config headers
  17. //
  18. //
  19. // VOID
  20. // GetPciConfigSpace (IN PVOID Extension,
  21. // IN UCHAR Offset,
  22. // IN PUCHAR Buffer,
  23. // IN ULONG Size)
  24. //
  25. #define GetPciConfigSpace(Extension, Offset, Buffer, Size) \
  26. (Extension)->PciBusInterface.GetBusData( \
  27. (Extension)->PciBusInterface.Context, \
  28. PCI_WHICHSPACE_CONFIG, Buffer, Offset, Size);
  29. //
  30. // VOID
  31. // SetPciConfigSpace (IN PVOID Extension,
  32. // IN UCHAR Offset,
  33. // IN PUCHAR Buffer,
  34. // IN ULONG Size)
  35. //
  36. #define SetPciConfigSpace(Extension, Offset, Buffer, Size) \
  37. (Extension)->PciBusInterface.SetBusData( \
  38. (Extension)->PciBusInterface.Context, \
  39. PCI_WHICHSPACE_CONFIG, Buffer, Offset, Size);
  40. //ConfigSpace Registers
  41. #define CFGSPACE_VENDOR_ID 0x00
  42. #define CFGSPACE_DEVICE_ID 0x02
  43. #define CFGSPACE_COMMAND 0x04
  44. #define CFGSPACE_STATUS 0x06
  45. #define CFGSPACE_REV_ID 0x08
  46. #define CFGSPACE_CLASS_CODE 0x09
  47. #define CFGSPACE_CLASSCODE_PI 0x09
  48. #define CFGSPACE_CLASSCODE_SUBCLASS 0x0a
  49. #define CFGSPACE_CLASSCODE_BASECLASS 0x0b
  50. #define CFGSPACE_CACHE_LINESIZE 0x0c
  51. #define CFGSPACE_LATENCY_TIMER 0x0d
  52. #define CFGSPACE_HEADER_TYPE 0x0e
  53. #define CFGSPACE_BIST 0x0f
  54. #define CFGSPACE_REGBASE_ADDR 0x10
  55. #define CFGSPACE_CAPPTR 0x14
  56. #define CFGSPACE_SECOND_STATUS 0x16
  57. #define CFGSPACE_PCI_BUSNUM 0x18
  58. #define CFGSPACE_CARDBUS_BUSNUM 0x19
  59. #define CFGSPACE_SUB_BUSNUM 0x1a
  60. #define CFGSPACE_CB_LATENCY_TIMER 0x1b
  61. #define CFGSPACE_MEMBASE_0 0x1c
  62. #define CFGSPACE_MEMLIMIT_0 0x20
  63. #define CFGSPACE_MEMBASE_1 0x24
  64. #define CFGSPACE_MEMLIMIT_1 0x28
  65. #define CFGSPACE_IOBASE_0 0x2c
  66. #define CFGSPACE_IOLIMIT_0 0x30
  67. #define CFGSPACE_IOBASE_1 0x34
  68. #define CFGSPACE_IOLIMIT_1 0x38
  69. #define CFGSPACE_INT_LINE 0x3c
  70. #define CFGSPACE_INT_PIN 0x3d
  71. #define CFGSPACE_BRIDGE_CTRL 0x3e
  72. #define CFGSPACE_SUBSYS_VENDOR_ID 0x40
  73. #define CFGSPACE_SUBSYS_ID 0x42
  74. #define CFGSPACE_LEGACY_MODE_BASE_ADDR 0x44
  75. //ConfigSpace registers for cardbus cards
  76. #define CBCFG_BAR0 0x10
  77. #define CBCFG_BAR1 0x14
  78. #define CBCFG_BAR2 0x18
  79. #define CBCFG_BAR3 0x1c
  80. #define CBCFG_BAR4 0x20
  81. #define CBCFG_BAR5 0x24
  82. #define CBCFG_CISPTR 0x28
  83. #define CBCFG_SUBSYS_VENDOR_ID 0x2c
  84. #define CBCFG_SUBSYS_ID 0x2e
  85. #define CBCFG_ROMBAR 0x30
  86. #define CBCFG_CAPPTR 0x34
  87. //Command Register bits
  88. #define CMD_IOSPACE_ENABLE 0x0001
  89. #define CMD_MEMSPACE_ENABLE 0x0002
  90. #define CMD_BUSMASTER_ENABLE 0x0004
  91. #define CMD_SPECIALCYCLE_ENABLE 0x0008
  92. #define CMD_MEMWR_INVALIDATE_ENABLE 0x0010
  93. #define CMD_VGA_PALETTE_SNOOP 0x0020
  94. #define CMD_PARITY_ERROR_ENABLE 0x0040
  95. #define CMD_WAIT_CYCLE_CTRL 0x0080
  96. #define CMD_SYSTEM_ERROR_ENABLE 0x0100
  97. #define CMD_FAST_BACKTOBACK_ENABLE 0x0200
  98. //Bridge Control Register bits
  99. #define BCTRL_PERR_RESPONSE_ENABLE 0x0001
  100. #define BCTRL_SERR_ENABLE 0x0002
  101. #define BCTRL_ISA_ENABLE 0x0004
  102. #define BCTRL_VGA_ENABLE 0x0008
  103. #define BCTRL_MASTER_ABORT_MODE 0x0020
  104. #define BCTRL_CRST 0x0040
  105. #define BCTRL_IRQROUTING_ENABLE 0x0080
  106. #define BCTRL_MEMWIN0_PREFETCH_ENABLE 0x0100
  107. #define BCTRL_MEMWIN1_PREFETCH_ENABLE 0x0200
  108. #define BCTRL_WRITE_POSTING_ENABLE 0x0400
  109. #define BCTRL_CL_CSCIRQROUTING_ENABLE 0x0800
  110. //Power Management control bits
  111. #define PME_EN 0x0100
  112. #define PME_STAT 0x8000
  113. //
  114. // TI
  115. //
  116. //ConfigSpace Registers (TI PCI1130)
  117. #define CFGSPACE_TI_SYSTEM_CTRL 0x80
  118. #define CFGSPACE_TI_MM_CTRL 0x84
  119. #define CFGSPACE_TI_RETRY_STATUS 0x90
  120. #define CFGSPACE_TI_CARD_CTRL 0x91
  121. #define CFGSPACE_TI_DEV_CTRL 0x92
  122. //System Control Register bits (TI PCI1130)
  123. #define SYSCTRL_PCICLKRUN_ENABLE 0x00000001
  124. #define SYSCTRL_KEEPCLK_ENABLE 0x00000002
  125. #define SYSCTRL_ASYNC_INTMODE 0x00000004
  126. #define SYSCTRL_PCPCI_DMA_ENABLE 0x00000008
  127. #define SYSCTRL_CBDATAPARITY_SERR 0x00000010
  128. #define SYSCTRL_EXCAIDREV_READONLY 0x00000020
  129. #define SYSCTRL_INTERROGATING 0x00000100
  130. #define SYSCTRL_POWERING_UP 0x00000200
  131. #define SYSCTRL_POWERING_DOWN 0x00000400
  132. #define SYSCTRL_POWER_STREAMING 0x00000800
  133. #define SYSCTRL_SOCKET_ACTIVITY 0x00002000
  134. #define SYSCTRL_PCPCI_DMA_CHAN_MASK 0x00070000
  135. #define SYSCTRL_PCPCI_DMA_CHAN_DISABLED 0x00040000
  136. #define SYSCTRL_PCPCI_DMA_CARD_ENABLE 0x00080000
  137. #define SYSCTRL_REDUCED_ZV_ENABLE 0x00100000
  138. #define SYSCTRL_VCC_PROTECT_OVERRIDE 0x00200000
  139. #define SYSCTRL_SMI_INT_ENABLE 0x01000000
  140. #define SYSCTRL_SMI_INT_ROUTING_SELECT 0x02000000
  141. //Multimedia Control Register bits (TI PCI1250/1260)
  142. #define MMCTRL_ZVEN0 0x01
  143. #define MMCTRL_ZVEN1 0x02
  144. #define MMCTRL_PORTSEL 0x40
  145. #define MMCTRL_ZVOUTEN 0x80
  146. //Retry Status Register bits (TI PCI1130)
  147. #define RETRY_PCIM_RETRY_EXPIRED 0x01
  148. #define RETRY_PCI_RETRY_EXPIRED 0x02
  149. #define RETRY_CBMA_RETRY_EXPIRED 0x04
  150. #define RETRY_CBA_RETRY_EXPIRED 0x08
  151. #define RETRY_CBMB_RETRY_EXPIRED 0x10
  152. #define RETRY_CBB_RETRY_EXPIRED 0x20
  153. #define RETRY_CBRETRY_TIMEOUT_ENABLE 0x40
  154. #define RETRY_PCIRETRY_TIMEOUT_ENABLE 0x80
  155. //Card Control Register bits (TI PCI1130)
  156. #define CARDCTRL_PCCARD_INTFLAG 0x01
  157. #define CARDCTRL_SPKR_ENABLE 0x02
  158. #define CARDCTRL_CSCINT_ENABLE 0x08
  159. #define CARDCTRL_FUNCINT_ENABLE 0x10
  160. #define CARDCTRL_PCIINT_ENABLE 0x20
  161. #define CARDCTRL_ZV_ENABLE 0x40
  162. #define CARDCTRL_RIOUT_ENABLE 0x80
  163. //Device Control Register bits (TI PCI1130)
  164. #define DEVCTRL_INTMODE_MASK 0x06
  165. #define DEVCTRL_INTMODE_DISABLED 0x00
  166. #define DEVCTRL_INTMODE_ISA 0x02
  167. #define DEVCTRL_INTMODE_COMPAQ 0x04
  168. #define DEVCTRL_INTMODE_SERIAL 0x06
  169. #define DEVCTRL_ALWAYS_ONE 0x10
  170. #define DEVCTRL_3V_ENABLE 0x20
  171. #define DEVCTRL_5V_ENABLE 0x40
  172. //
  173. // TOPIC
  174. //
  175. //ConfigSpace Registers (TOPIC95)
  176. #define CFGSPACE_TO_PC16_SKTCTRL 0x90
  177. #define CFGSPACE_TO_SLOT_CTRL 0xa0
  178. #define CFGSPACE_TO_CARD_CTRL 0xa1
  179. #define CFGSPACE_TO_CD_CTRL 0xa3
  180. #define CFGSPACE_TO_CBREG_CTRL 0xa4
  181. //PC Card-16 Socket Control Register bits (TOPIC95)
  182. #define S16CTRL_CSC_ISAIRQ 0x00000001
  183. //Card Control Register bits (TOPIC95)
  184. #define CARDCTRL_INTPIN_ASSIGNMASK 0x30
  185. #define CARDCTRL_INTPIN_NONE 0x00
  186. #define CARDCTRL_INTPIN_INTA 0x01
  187. #define CARDCTRL_INTPIN_INTB 0x02
  188. //Card Detect Control Register bits (TOPIC95)
  189. #define CDCTRL_SW_DETECT 0x01
  190. #define CDCTRL_VS_MASK 0x06
  191. #define CDCTRL_PCCARD_16_32 0x80
  192. //CardBus Socket Register Control Register (TOPIC)
  193. #define CSRCR_TO_CAUDIO_OFF 0x00000002
  194. //
  195. // CL
  196. //
  197. //ConfigSpace Registers (CL PD6834)
  198. #define CFGSPACE_CL_CFGMISC1 0x98
  199. //Cirrus Logic Configuration Miscellaneous 1
  200. #define CL_CFGMISC1_ISACSC 0x02
  201. //
  202. // Opti
  203. //
  204. //ConfigSpace Registers (OPTi 82C824)
  205. #define CFGSPACE_OPTI_HF_CTRL 0x50
  206. #define HFC_COMBINE_CINT_CSTSCHG 0x01
  207. #define HFC_SPKROUT_ENABLE 0x02
  208. #define HFC_CLKRUN_DISBALE 0x04
  209. #define HFC_CD_DEBOUNCE_250MS 0x00
  210. #define HFC_CD_DEBOUNCE_1000MS 0x08
  211. #define HFC_IRQLAT_ON_CLKRUN 0x10
  212. #define HFC_VENDOR_ID_STRAP 0x20
  213. #define HFC_LEGACY_MODE_STRAP 0x40
  214. #define HFC_ZV_SUPPORT 0x80
  215. //ConfigSpace Register (OPTi 82C824)
  216. #define CFGSPACE_OPTI_SF_CTRL2 0x52
  217. #define SFC2_SECOND_IDSEL_ADDR_MASK 0x0f
  218. #define SFC2_SECOND_PCICLK_SKEW_MASK 0xf0
  219. //
  220. // Ricoh
  221. //
  222. //ConfigSpace Registers (RICOH RL5C466)
  223. #define CFGSPACE_RICOH_MISC_CTRL 0x82
  224. #define CFGSPACE_RICOH_IF16_CTRL 0x84
  225. #define CFGSPACE_RICOH_IO16_TIMING0 0x88
  226. #define CFGSPACE_RICOH_MEM16_TIMING0 0x8a
  227. #define CFGSPACE_RICOH_DMA_SLAVE_CFG 0x90
  228. //RICOH 16-bit Interface Control Register bits
  229. #define IF16_INDEX_RANGE_SELECT 0x0008
  230. #define IF16_LEGACY_LEVEL_1 0x0010
  231. #define IF16_LEGACY_LEVEL_2 0x0020
  232. #define IF16_IO16_ENHANCE_TIMING 0x0100
  233. #define IF16_MEM16_ENHANCE_TIMING 0x0200
  234. //
  235. // O2Micro
  236. //
  237. //ConfigSpace Registers (O2Micro)
  238. #define CFGSPACE_O2MICRO_ZVCFG 0x80
  239. #define ZVCFG_SKTA_SUPPORT 0x01
  240. #define ZVCFG_SKTB_SUPPORT 0x02
  241. #endif // _PCMCIA_PCICFG_H_