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.

818 lines
29 KiB

  1. /*** pcskthw.h - PC Card Socket Hardware Definitions
  2. *
  3. * Copyright (c) 1995,1996 Microsoft Corporation
  4. * Author: Michael Tsang (MikeTs)
  5. * Created 08/28/95
  6. *
  7. * MODIFICATION HISTORY
  8. */
  9. #ifndef _PCSKTHW_H
  10. #define _PCSKTHW_H
  11. //#ifdef CARDBUS
  12. /*** CardBus Constants
  13. */
  14. //PCI IDs
  15. #define PCIID_TI_PCI1130 0xac12104c
  16. #define PCIID_TI_PCI1131 0xac15104c
  17. #define PCIID_TI_PCI1031 0xac13104c
  18. #define PCIID_OPTI_82C824 0xc8241045
  19. #define PCIID_OPTI_82C814 0xc8141045 //Docking chip
  20. //#define PCIID_TO_TOPIC95 0x06031179 //Seattle2
  21. #define PCIID_TO_TOPIC95 0x060a1179 //SeattleX
  22. #define PCIID_CL_PD6832 0x11101013
  23. #define PCIID_DBK_DB87144 0x310610b3
  24. #define PCIID_RICOH_RL5C466 0x04661180
  25. //ConfigSpace Registers
  26. #define CFGSPACE_VENDOR_ID 0x00
  27. #define CFGSPACE_DEVICE_ID 0x02
  28. #define CFGSPACE_COMMAND 0x04
  29. #define CFGSPACE_STATUS 0x06
  30. #define CFGSPACE_REV_ID 0x08
  31. #define CFGSPACE_CLASS_CODE 0x09
  32. #define CFGSPACE_CLASSCODE_PI 0x09
  33. #define CFGSPACE_CLASSCODE_SUBCLASS 0x0a
  34. #define CFGSPACE_CLASSCODE_BASECLASS 0x0b
  35. #define CFGSPACE_CACHE_LINESIZE 0x0c
  36. #define CFGSPACE_LATENCY_TIMER 0x0d
  37. #define CFGSPACE_HEADER_TYPE 0x0e
  38. #define CFGSPACE_BIST 0x0f
  39. #define CFGSPACE_REGBASE_ADDR 0x10
  40. #define CFGSPACE_SECOND_STATUS 0x16
  41. #define CFGSPACE_PCI_BUSNUM 0x18
  42. #define CFGSPACE_CARDBUS_BUSNUM 0x19
  43. #define CFGSPACE_SUB_BUSNUM 0x1a
  44. #define CFGSPACE_CB_LATENCY_TIMER 0x1b
  45. #define CFGSPACE_MEMBASE_0 0x1c
  46. #define CFGSPACE_MEMLIMIT_0 0x20
  47. #define CFGSPACE_MEMBASE_1 0x24
  48. #define CFGSPACE_MEMLIMIT_1 0x28
  49. #define CFGSPACE_IOBASE_0 0x2c
  50. #define CFGSPACE_IOLIMIT_0 0x30
  51. #define CFGSPACE_IOBASE_1 0x34
  52. #define CFGSPACE_IOLIMIT_1 0x38
  53. #define CFGSPACE_INT_LINE 0x3c
  54. #define CFGSPACE_INT_PIN 0x3d
  55. #define CFGSPACE_BRIDGE_CTRL 0x3e
  56. #define CFGSPACE_SUBSYS_VENDOR_ID 0x40
  57. #define CFGSPACE_SUBSYS_ID 0x42
  58. #define CFGSPACE_LEGACY_MODE_BASE_ADDR 0x44
  59. //Command Register bits
  60. #define CMD_IOSPACE_ENABLE 0x0001
  61. #define CMD_MEMSPACE_ENABLE 0x0002
  62. #define CMD_BUSMASTER_ENABLE 0x0004
  63. #define CMD_SPECIALCYCLE_ENABLE 0x0008
  64. #define CMD_MEMWR_INVALIDATE_ENABLE 0x0010
  65. #define CMD_VGA_PALETTE_SNOOP 0x0020
  66. #define CMD_PARITY_ERROR_ENABLE 0x0040
  67. #define CMD_WAIT_CYCLE_CTRL 0x0080
  68. #define CMD_SYSTEM_ERROR_ENABLE 0x0100
  69. #define CMD_FAST_BACKTOBACK_ENABLE 0x0200
  70. //Bridge Control Register bits
  71. #define BCTRL_PERR_RESPONSE_ENABLE 0x0001
  72. #define BCTRL_SERR_ENABLE 0x0002
  73. #define BCTRL_ISA_ENABLE 0x0004
  74. #define BCTRL_VGA_ENABLE 0x0008
  75. #define BCTRL_MASTER_ABORT_MODE 0x0020
  76. #define BCTRL_CRST 0x0040
  77. #define BCTRL_IRQROUTING_ENABLE 0x0080
  78. #define BCTRL_MEMWIN0_PREFETCH_ENABLE 0x0100
  79. #define BCTRL_MEMWIN1_PREFETCH_ENABLE 0x0200
  80. #define BCTRL_WRITE_POSTING_ENABLE 0x0400
  81. #define BCTRL_CL_CSCIRQROUTING_ENABLE 0x0800
  82. //ConfigSpace Registers (TI PCI1130)
  83. #define CFGSPACE_TI_SYSTEM_CTRL 0x80
  84. #define CFGSPACE_TI_RETRY_STATUS 0x90
  85. #define CFGSPACE_TI_CARD_CTRL 0x91
  86. #define CFGSPACE_TI_DEV_CTRL 0x92
  87. #define CFGSPACE_TI_BUFF_CTRL 0x93
  88. //ConfigSpace Registers (TOPIC95)
  89. #define CFGSPACE_TO_PC16_SKTCTRL 0x90
  90. #define CFGSPACE_TO_SLOT_CTRL 0xa0
  91. #define CFGSPACE_TO_CARD_CTRL 0xa1
  92. #define CFGSPACE_TO_CD_CTRL 0xa3
  93. #define CFGSPACE_TO_CBREG_CTRL 0xa4
  94. //ConfigSpace Registers (OPTi 82C824)
  95. #define CFGSPACE_OPTI_HF_CTRL 0x50
  96. #define HFC_ZV_SUPPORT 0x80
  97. //ConfigSpace Registers (RICOH RL5C466)
  98. #define CFGSPACE_RICOH_MISC_CTRL 0x82
  99. #define CFGSPACE_RICOH_IF16_CTRL 0x84
  100. #define CFGSPACE_RICOH_IO16_TIMING0 0x88
  101. #define CFGSPACE_RICOH_MEM16_TIMING0 0x8a
  102. #define CFGSPACE_RICOH_DMA_SLAVE_CFG 0x90
  103. //RICOH 16-bit Interface Control Register bits
  104. #define IF16_INDEX_RANGE_SELECT 0x0008
  105. #define IF16_LEGACY_LEVEL_1 0x0010
  106. #define IF16_LEGACY_LEVEL_2 0x0020
  107. #define IF16_IO16_ENHANCE_TIMING 0x0100
  108. #define IF16_MEM16_ENHANCE_TIMING 0x0200
  109. //PC Card-16 Socket Control Register bits (TOPIC95)
  110. #define S16CTRL_CSC_ISAIRQ 0x00000001
  111. //Card Control Register bits (TOPIC95)
  112. #define CARDCTRL_INTPIN_ASSIGNMASK 0x30
  113. #define CARDCTRL_INTPIN_NONE 0x00
  114. #define CARDCTRL_INTPIN_INTA 0x01
  115. #define CARDCTRL_INTPIN_INTB 0x02
  116. //Card Detect Control Register bits (TOPIC95)
  117. #define CDCTRL_SW_DETECT 0x01
  118. #define CDCTRL_VS_MASK 0x06
  119. #define CDCTRL_PCCARD_16_32 0x80
  120. //System Control Register bits (TI PCI1130)
  121. #define SYSCTRL_PCICLKRUN_ENABLE 0x00000001
  122. #define SYSCTRL_KEEPCLK_ENABLE 0x00000002
  123. #define SYSCTRL_ASYNC_INTMODE 0x00000004
  124. #define SYSCTRL_PCPCI_DMA_ENABLE 0x00000008
  125. #define SYSCTRL_CBDATAPARITY_SERR 0x00000010
  126. #define SYSCTRL_EXCAIDREV_READONLY 0x00000020
  127. #define SYSCTRL_INTERROGATING 0x00000100
  128. #define SYSCTRL_POWERING_UP 0x00000200
  129. #define SYSCTRL_POWERING_DOWN 0x00000400
  130. #define SYSCTRL_POWER_STREAMING 0x00000800
  131. #define SYSCTRL_SOCKET_ACTIVITY 0x00001000
  132. #define SYSCTRL_PCPCI_DMA_CHAN_MASK 0x00070000
  133. #define SYSCTRL_PCPCI_DMA_CARD_ENABLE 0x00080000
  134. #define SYSCTRL_REDUCED_ZV_ENABLE 0x00100000
  135. #define SYSCTRL_VCC_PROTECT_OVERRIDE 0x00200000
  136. #define SYSCTRL_SMI_INT_ENABLE 0x01000000
  137. #define SYSCTRL_SMI_INT_ROUTING_SELECT 0x02000000
  138. //Retry Status Register bits (TI PCI1130)
  139. #define RETRY_PCIM_RETRY_EXPIRED 0x01
  140. #define RETRY_PCI_RETRY_EXPIRED 0x02
  141. #define RETRY_CBMA_RETRY_EXPIRED 0x04
  142. #define RETRY_CBA_RETRY_EXPIRED 0x08
  143. #define RETRY_CBMB_RETRY_EXPIRED 0x10
  144. #define RETRY_CBB_RETRY_EXPIRED 0x20
  145. #define RETRY_CBRETRY_TIMEOUT_ENABLE 0x40
  146. #define RETRY_PCIRETRY_TIMEOUT_ENABLE 0x80
  147. //Card Control Register bits (TI PCI1130)
  148. #define CARDCTRL_PCCARD_INTFLAG 0x01
  149. #define CARDCTRL_SPKR_ENABLE 0x02
  150. #define CARDCTRL_CSCINT_ENABLE 0x08
  151. #define CARDCTRL_FUNCINT_ENABLE 0x10
  152. #define CARDCTRL_PCIINT_ENABLE 0x20
  153. #define CARDCTRL_ZV_ENABLE 0x40
  154. #define CARDCTRL_RIOUT_ENABLE 0x80
  155. //Device Control Register bits (TI PCI1130)
  156. #define DEVCTRL_INTMODE_MASK 0x06
  157. #define DEVCTRL_INTMODE_DISABLED 0x00
  158. #define DEVCTRL_INTMODE_ISA 0x02
  159. #define DEVCTRL_INTMODE_COMPAQ 0x04
  160. #define DEVCTRL_INTMODE_SERIAL 0x06
  161. #define DEVCTRL_ALWAYS_ONE 0x10
  162. #define DEVCTRL_3V_ENABLE 0x20
  163. #define DEVCTRL_5V_ENABLE 0x40
  164. //CardBus Registers
  165. #define CBREG_SKTEVENT 0x00
  166. #define CBREG_SKTMASK 0x04
  167. #define CBREG_SKTSTATE 0x08
  168. #define CBREG_SKTFORCE 0x0c
  169. #define CBREG_SKTPOWER 0x10
  170. //Socket Event Register bits
  171. #define SKTEVENT_CSTSCHG 0x00000001L
  172. #define SKTEVENT_CCD1 0x00000002L
  173. #define SKTEVENT_CCD2 0x00000004L
  174. #define SKTEVENT_CCD_MASK (SKTEVENT_CCD1 | SKTEVENT_CCD2)
  175. #define SKTEVENT_POWERCYCLE 0x00000008L
  176. #define SKTEVENT_MASK 0x0000000fL
  177. //Socket Mask Register bits
  178. #define SKTMSK_CSTSCHG 0x00000001L
  179. #define SKTMSK_CCD 0x00000006L
  180. #define SKTMSK_CCD1 0x00000002L
  181. #define SKTMSK_CCD2 0x00000004L
  182. #define SKTMSK_POWERCYCLE 0x00000008L
  183. //Socket Present State Register bits
  184. #define SKTSTATE_CSTSCHG 0x00000001L
  185. #define SKTSTATE_CCD1 0x00000002L
  186. #define SKTSTATE_CCD2 0x00000004L
  187. #define SKTSTATE_CCD_MASK (SKTSTATE_CCD1 | SKTSTATE_CCD2)
  188. #define SKTSTATE_POWERCYCLE 0x00000008L
  189. #define SKTSTATE_CARDTYPE_MASK 0x00000030L
  190. #define SKTSTATE_R2CARD 0x00000010L
  191. #define SKTSTATE_CBCARD 0x00000020L
  192. #define SKTSTATE_OPTI_DOCK 0x00000030L
  193. #define CARDTYPE(dw) ((dw) & SKTSTATE_CARDTYPE_MASK)
  194. #define SKTSTATE_CARDINT 0x00000040L
  195. #define SKTSTATE_NOTACARD 0x00000080L
  196. #define SKTSTATE_DATALOST 0x00000100L
  197. #define SKTSTATE_BADVCCREQ 0x00000200L
  198. #define SKTSTATE_5VCARD 0x00000400L
  199. #define SKTSTATE_3VCARD 0x00000800L
  200. #define SKTSTATE_XVCARD 0x00001000L
  201. #define SKTSTATE_YVCARD 0x00002000L
  202. #define SKTSTATE_CARDVCC_MASK (SKTSTATE_5VCARD | SKTSTATE_3VCARD | \
  203. SKTSTATE_XVCARD | SKTSTATE_YVCARD)
  204. #define SKTSTATE_5VSOCKET 0x10000000L
  205. #define SKTSTATE_3VSOCKET 0x20000000L
  206. #define SKTSTATE_XVSOCKET 0x40000000L
  207. #define SKTSTATE_YVSOCKET 0x80000000L
  208. #define SKTSTATE_SKTVCC_MASK (SKTSTATE_5VSOCKET | \
  209. SKTSTATE_3VSOCKET | \
  210. SKTSTATE_XVSOCKET | \
  211. SKTSTATE_YVSOCKET)
  212. //Socket Froce Register bits
  213. #define SKTFORCE_CSTSCHG 0x00000001L
  214. #define SKTFORCE_CCD1 0x00000002L
  215. #define SKTFORCE_CCD2 0x00000004L
  216. #define SKTFORCE_POWERCYCLE 0x00000008L
  217. #define SKTFORCE_R2CARD 0x00000010L
  218. #define SKTFORCE_CBCARD 0x00000020L
  219. #define SKTFORCE_NOTACARD 0x00000080L
  220. #define SKTFORCE_DATALOST 0x00000100L
  221. #define SKTFORCE_BADVCCREQ 0x00000200L
  222. #define SKTFORCE_5VCARD 0x00000400L
  223. #define SKTFORCE_3VCARD 0x00000800L
  224. #define SKTFORCE_XVCARD 0x00001000L
  225. #define SKTFORCE_YVCARD 0x00002000L
  226. #define SKTFORCE_CVSTEST 0x00004000L
  227. #define SKTFORCE_5VSOCKET 0x10000000L
  228. #define SKTFORCE_3VSOCKET 0x20000000L
  229. #define SKTFORCE_XVSOCKET 0x40000000L
  230. #define SKTFORCE_YVSOCKET 0x80000000L
  231. //Power Control Register bits
  232. #define SKTPOWER_VPP_CONTROL 0x00000007L
  233. #define SKTPOWER_VPP_OFF 0x00000000L
  234. #define SKTPOWER_VPP_120V 0x00000001L
  235. #define SKTPOWER_VPP_050V 0x00000002L
  236. #define SKTPOWER_VPP_033V 0x00000003L
  237. #define SKTPOWER_VPP_0XXV 0x00000004L
  238. #define SKTPOWER_VPP_0YYV 0x00000005L
  239. #define SKTPOWER_VCC_CONTROL 0x00000070L
  240. #define SKTPOWER_VCC_OFF 0x00000000L
  241. #define SKTPOWER_VCC_050V 0x00000020L
  242. #define SKTPOWER_VCC_033V 0x00000030L
  243. #define SKTPOWER_VCC_0XXV 0x00000040L
  244. #define SKTPOWER_VCC_0YYV 0x00000050L
  245. #define SKTPOWER_STOPCLOCK 0x00000080L
  246. //Misc. CardBus Constants
  247. #define NUMWIN_BRIDGE 4 //2 Mem + 2 IO
  248. #define EXCAREG_OFFSET 0x0800
  249. /*** CardBus Type and Structure Definitions
  250. */
  251. typedef struct cfgspace_s {
  252. WORD wVendorID;
  253. WORD wDeviceID;
  254. WORD wCommand;
  255. WORD wStatus;
  256. BYTE bRevID;
  257. BYTE bClassCodePI;
  258. BYTE bClassCodeSubClass;
  259. BYTE bClassCodeBaseClass;
  260. BYTE bCacheLineSize;
  261. BYTE bLatencyTimer;
  262. BYTE bHeaderType;
  263. BYTE bBIST;
  264. DWORD dwRegBaseAddr;
  265. BYTE bPCIBusNum;
  266. BYTE bCBBusNum;
  267. BYTE bSubBusNum;
  268. BYTE bCBLatencyTimer;
  269. DWORD dwMemBase0;
  270. DWORD dwMemLimit0;
  271. DWORD dwMemBase1;
  272. DWORD dwMemLimit1;
  273. DWORD dwIOBase0;
  274. DWORD dwIOLimit0;
  275. DWORD dwIOBase1;
  276. DWORD dwIOLimit1;
  277. BYTE bIntLine;
  278. BYTE bIntPin;
  279. BYTE bBridgeCtrl;
  280. WORD wSubSysVendorID;
  281. WORD wSubSysID;
  282. } CFGSPACE;
  283. typedef CFGSPACE *PCFGSPACE;
  284. typedef struct cbregs_s {
  285. DWORD dwSktEvent;
  286. DWORD dwSktMask;
  287. DWORD dwSktState;
  288. DWORD dwSktForce;
  289. DWORD dwSktPower;
  290. } CBREGS;
  291. typedef CBREGS *PCBREGS;
  292. //#endif //ifdef CARDBUS
  293. /*** 16-Bit Socket Constants
  294. */
  295. //Device IDs for various controllers
  296. #define DEVID_VALID_LO 0x82
  297. #define DEVID_CL 0x82
  298. #define DEVID_VADEM 0x83
  299. #define DEVID_RICOH 0x83
  300. #define DEVID_GEN_PCIC 0x84
  301. #define DEVID_IBM_KING 0x8a
  302. #define DEVID_OPTI_82C824 0x87
  303. #define DEVID_OPTI_82C852 0x8f
  304. //ExCA Registers
  305. #define EXCAREG_IDREV 0x00
  306. #define EXCAREG_VLSI_EA0 0x00
  307. #define EXCAREG_INTERFACE_STATUS 0x01
  308. #define EXCAREG_VLSI_EA1 0x01
  309. #define EXCAREG_POWER_CTRL 0x02
  310. #define EXCAREG_VLSI_EA2 0x02
  311. #define EXCAREG_INT_GENCTRL 0x03
  312. #define EXCAREG_VLSI_EXT_CHIPCTRL 0x03
  313. #define EXCAREG_CARD_STATUS 0x04
  314. #define EXCAREG_CSC_CFG 0x05
  315. #define EXCAREG_WIN_ENABLE 0x06
  316. #define EXCAREG_IO_CTRL 0x07
  317. #define EXCAREG_IOWIN0_START 0x08
  318. #define EXCAREG_IOWIN0_END 0x0a
  319. #define EXCAREG_IOWIN1_START 0x0c
  320. #define EXCAREG_IOWIN1_END 0x0e
  321. #define EXCAREG_MEMWIN0_START 0x10
  322. #define EXCAREG_MEMWIN0_END 0x12
  323. #define EXCAREG_MEMWIN0_OFFSET 0x14
  324. #define EXCAREG_CARDDET_GENCTRL 0x16
  325. #define EXCAREG_CL_MISC_CTRL1 0x16
  326. #define EXCAREG_TO_ADDITIONAL_GENCTRL 0x16
  327. #define EXCAREG_CL_FIFO_CTRL 0x17
  328. #define EXCAREG_KING_CVS 0x17
  329. #define EXCAREG_MEMWIN1_START 0x18
  330. #define EXCAREG_MEMWIN1_END 0x1a
  331. #define EXCAREG_MEMWIN1_OFFSET 0x1c
  332. #define EXCAREG_GLOBAL_CTRL 0x1e
  333. #define EXCAREG_CL_MISC_CTRL2 0x1e
  334. #define EXCAREG_CL_CHIP_INFO 0x1f
  335. #define EXCAREG_VADEM_VSENSE 0x1f
  336. #define EXCAREG_MEMWIN2_START 0x20
  337. #define EXCAREG_MEMWIN2_END 0x22
  338. #define EXCAREG_MEMWIN2_OFFSET 0x24
  339. #define EXCAREG_CL_ATA_CTRL 0x26
  340. #define EXCAREG_MEMWIN3_START 0x28
  341. #define EXCAREG_MEMWIN3_END 0x2a
  342. #define EXCAREG_MEMWIN3_OFFSET 0x2c
  343. #define EXCAREG_CL_EXT_INDEX 0x2e
  344. #define EXCAREG_CL_EXT_DATA 0x2f
  345. #define EXCAREG_VADEM_VSEL 0x2f
  346. #define EXCAREG_RICOH_MISC_CTRL1 0x2f
  347. #define EXCAREG_MEMWIN4_START 0x30
  348. #define EXCAREG_MEMWIN4_END 0x32
  349. #define EXCAREG_MEMWIN4_OFFSET 0x34
  350. #define EXCAREG_CL_IOWIN0_OFFSET 0x36
  351. #define EXCAREG_CL_IOWIN1_OFFSET 0x38
  352. #define EXCAREG_CL_SETUP_TIMING0 0x3a
  353. #define EXCAREG_VADEM_MISC 0x3a
  354. #define EXCAREG_CL_COMMAND_TIMING0 0x3b
  355. #define EXCAREG_DBK_ZV_ENABLE 0x3b
  356. #define EXCAREG_TO_MMI_CTRL 0x3c
  357. #define EXCAREG_CL_RECOVERY_TIMING0 0x3c
  358. #define EXCAREG_CL_SETUP_TIMING1 0x3d
  359. #define EXCAREG_CL_COMMAND_TIMING1 0x3e
  360. #define EXCAREG_TO_FUNC_CTRL 0x3e
  361. #define EXCAREG_CL_RECOVERY_TIMING1 0x3f
  362. #define EXCAREG_MEMWIN0_HI 0x40
  363. #define EXCAREG_MEMWIN1_HI 0x41
  364. #define EXCAREG_MEMWIN2_HI 0x42
  365. #define EXCAREG_MEMWIN3_HI 0x43
  366. #define EXCAREG_MEMWIN4_HI 0x44
  367. #define EXCAREG_CL_IOWIN0_HI 0x45
  368. #define EXCAREG_CL_IOWIN1_HI 0x46
  369. #define EXCAREG_CL_EXT_CTRL1 0x103
  370. #define EXCAREG_CL_EXTERNAL_DATA 0x10a
  371. #define EXCAREG_CL_EXT_CTRL2 0x10b
  372. #define EXCAREG_CL_MISC_CTRL3 0x125
  373. #define EXCAREG_CL_MASK_REV 0x134
  374. #define EXCAREG_CL_PRODUCT_ID 0x135
  375. #define EXCAREG_CL_DEV_CAP_A 0x136
  376. #define EXCAREG_CL_DEV_CAP_B 0x137
  377. #define EXCAREG_CL_DEV_IMP_A 0x138
  378. #define EXCAREG_CL_DEV_IMP_B 0x139
  379. #define EXCAREG_CL_DEV_IMP_C 0x13a
  380. #define EXCAREG_CL_DEV_IMP_D 0x13b
  381. //TI PCI-1130 specific registers
  382. #define EXCAREG_TI_MEMWIN_PAGE 0x40
  383. //ID and Revision Register bits
  384. #define IDREV_REV_MASK 0x0f
  385. #define IDREV_IFID_MASK 0xc0
  386. #define IDREV_IFID_IO 0x00
  387. #define IDREV_IFID_MEM 0x40
  388. #define IDREV_IFID_IOMEM 0x80
  389. //Interface Status Register bits
  390. #define IFS_BVD_MASK 0x03
  391. #define IFS_BVD1 0x01
  392. #define IFS_BVD2 0x02
  393. #define IFS_CD_MASK 0x0c
  394. #define IFS_CD1 0x04
  395. #define IFS_CD2 0x08
  396. #define IFS_WP 0x10
  397. #define IFS_RDYBSY 0x20
  398. #define IFS_CARDPWR_ACTIVE 0x40
  399. #define IFS_VPP_VALID 0x80
  400. //Power and RESETDRV Control Register bits
  401. #define PC_VPP1_MASK 0x03
  402. #define PC_VPP2_MASK 0x0c
  403. #define PC_CARDPWR_ENABLE 0x10
  404. #define PC_AUTOPWR_ENABLE 0x20
  405. #define PC_RESETDRV_DISABLE 0x40
  406. #define PC_OUTPUT_ENABLE 0x80
  407. #define PC_VPP_NO_CONNECT 0x00
  408. #define PC_VPP_SETTO_VCC 0x01
  409. #define PC_VPP_SETTO_VPP 0x02
  410. #define PC_VPP_RESERVED 0x03
  411. #define PC_VPP_VLSI_MASK 0x03
  412. #define PC_VPP_VLSI_NO_CONNECT 0x00
  413. #define PC_VPP_VLSI_050V 0x01
  414. #define PC_VPP_VLSI_120V 0x02
  415. #define PC_VPP_VLSI_RESERVED 0x03
  416. #define PC_VCC_TOPIC_033V 0x08
  417. #define PC_VCC_VLSI_MASK 0x18
  418. #define PC_VCC_VLSI_NO_CONNECT 0x00
  419. #define PC_VCC_VLSI_RESERVED 0x08
  420. #define PC_VCC_VLSI_050V 0x10
  421. #define PC_VCC_VLSI_033V 0x18
  422. #define PC_VPP_KING_MASK 0x03
  423. #define PC_VPP_KING_NO_CONNECT 0x00
  424. #define PC_VPP_KING_050V 0x01
  425. #define PC_VPP_KING_120V 0x02
  426. #define PC_VPP_KING_SETTO_VCC 0x03
  427. #define PC_VCC_KING_MASK 0x0c
  428. #define PC_VCC_KING_NO_CONNECT 0x00
  429. #define PC_VCC_KING_050V 0x04
  430. #define PC_VCC_KING_RESERVED 0x08
  431. #define PC_VCC_KING_033V 0x0c
  432. #define PC_VPP_OPTI_MASK 0x03
  433. #define PC_VPP_OPTI_NO_CONNECT 0x00
  434. #define PC_VPP_OPTI_SETTO_VCC 0x01
  435. #define PC_VPP_OPTI_120V 0x02
  436. #define PC_VPP_OPTI_0V 0x03
  437. #define PC_VCC_OPTI_MASK 0x18
  438. #define PC_VCC_OPTI_NO_CONNECT 0x00
  439. #define PC_VCC_OPTI_033V 0x08
  440. #define PC_VCC_OPTI_050V 0x10
  441. #define PC_VCC_OPTI_0XXV 0x18
  442. //Interrupt and General Control Register bits
  443. #define IGC_IRQ_MASK 0x0f
  444. #define IGC_INTR_ENABLE 0x10
  445. #define IGC_PCCARD_IO 0x20
  446. #define IGC_PCCARD_RESETLO 0x40
  447. #define IGC_RINGIND_ENABLE 0x80
  448. //Card Status Change Register bits
  449. #define CSC_CHANGE_MASK 0x0f
  450. #define CSC_BATT_DEAD 0x01
  451. #define CSC_BATT_WARNING 0x02
  452. #define CSC_BATT_MASK (CSC_BATT_DEAD | CSC_BATT_WARNING)
  453. #define CSC_READY_CHANGE 0x04
  454. #define CSC_CD_CHANGE 0x08
  455. //Card Status Change Interrupt Configuration Register bits
  456. #define CSCFG_ENABLE_MASK 0x0f
  457. #define CSCFG_BATT_DEAD 0x01
  458. #define CSCFG_BATT_WARNING 0x02
  459. #define CSCFG_BATT_MASK (CSCFG_BATT_DEAD | CSCFG_BATT_WARNING)
  460. #define CSCFG_READY_ENABLE 0x04
  461. #define CSCFG_CD_ENABLE 0x08
  462. #define CSCFG_IRQ_MASK 0xf0
  463. //Address Window Enable Register bits
  464. #define WE_MEM0_ENABLE 0x01
  465. #define WE_MEM1_ENABLE 0x02
  466. #define WE_MEM2_ENABLE 0x04
  467. #define WE_MEM3_ENABLE 0x08
  468. #define WE_MEM4_ENABLE 0x10
  469. #define WE_MEMWIN_MASK (WE_MEM0_ENABLE | WE_MEM1_ENABLE | \
  470. WE_MEM2_ENABLE | WE_MEM3_ENABLE | \
  471. WE_MEM4_ENABLE)
  472. #define WE_MEMCS16_DECODE 0x20
  473. #define WE_IO0_ENABLE 0x40
  474. #define WE_IO1_ENABLE 0x80
  475. #define WE_IOWIN_MASK (WE_IO0_ENABLE | WE_IO1_ENABLE)
  476. //I/O Control Register bits
  477. #define IOC_IO0_MASK 0x0f
  478. #define IOC_IO0_DATASIZE 0x01
  479. #define IOC_IO0_IOCS16 0x02
  480. #define IOC_IO0_ZEROWS 0x04
  481. #define IOC_IO0_WAITSTATE 0x08
  482. #define IOC_IO1_MASK 0xf0
  483. #define IOC_IO1_DATASIZE 0x10
  484. #define IOC_IO1_IOCS16 0x20
  485. #define IOC_IO1_ZEROWS 0x40
  486. #define IOC_IO1_WAITSTATE 0x80
  487. //Card Detection and General Control Register
  488. #define CDGC_SW_DET_INT 0x20
  489. //Memory Window Start Register bits
  490. #define MEMBASE_ADDR_MASK 0x0fff
  491. #define MEMBASE_ZEROWS 0x4000
  492. #define MEMBASE_16BIT 0x8000
  493. //Memory Window Stop Register bits
  494. #define MEMEND_ADDR_MASK 0x0fff
  495. #define MEMEND_WS_MASK 0xc000
  496. //Memory Window Offset Register bits
  497. #define MEMOFF_ADDR_MASK 0x3fff
  498. #define MEMOFF_REG_ACTIVE 0x4000
  499. #define MEMOFF_WP 0x8000
  500. //Cirrus Logic Miscellaneous Control 1 Register bits
  501. #define CL_MC1_5V_DETECT 0x01
  502. #define CL_MC1_MM_ENABLE 0x01
  503. #define CL_MC1_VCC_33V 0x02
  504. #define CL_MC1_PULSE_MGMT_INT 0x04
  505. #define CL_MC1_PULSE_SYSTEM_IRQ 0x08
  506. #define CL_MC1_SPKR_ENABLE 0x10
  507. #define CL_MC1_INPACK_ENABLE 0x80
  508. //Cirrus Logic Miscellaneous Control 2 Register bits
  509. #define CL_MC2_BFS 0x01
  510. #define CL_MC2_LPDYNAMIC_MODE 0x02
  511. #define CL_MC2_SUSPEND 0x04
  512. #define CL_MC2_5VCORE 0x08
  513. #define CL_MC2_DRIVELED_ENABLE 0x10
  514. #define CL_MC2_TIMERCLK_DIVIDE 0x10
  515. #define CL_MC2_3STATE_BIT7 0x20
  516. #define CL_MC2_DMA_SYSTEM 0x40
  517. #define CL_MC2_IRQ15_RIOUT 0x80
  518. //Cirrus Logic Miscellaneous Control 3 Register bits
  519. #define CL_MC3_INTMODE_MASK 0x03
  520. #define CL_MC3_INTMODE_SERIAL 0x00
  521. #define CL_MC3_INTMODE_EXTHW 0x01
  522. #define CL_MC3_INTMODE_PCIWAY 0x02
  523. #define CL_MC3_INTMODE_PCI 0x03 //default
  524. #define CL_MC3_PWRMODE_MASK 0x0c
  525. #define CL_MC3_HWSUSPEND_ENABLE 0x10
  526. #define CL_MC3_MM_ARM 0x80
  527. //Cirrus Logic Chip Info Register bits
  528. #define CL_CI_REV_MASK 0x1e
  529. #define CL_CI_DUAL_SOCKET 0x20
  530. #define CL_CI_CHIP_ID 0xc0
  531. //Cirrus Logic Mask Revision Register bits
  532. #define CL_MSKREV_MASK 0x0f
  533. //Cirrus Logic Product ID Register bits
  534. #define CL_PID_PRODUCT_CODE_MASK 0x0f
  535. #define CL_PID_FAMILY_CODE_MASK 0xf0
  536. //Cirrus Logic Device Capability Register A bits
  537. #define CL_CAPA_NUMSKT_MASK 0x03
  538. #define CL_CAPA_IDE_INTERFACE 0x04
  539. #define CL_CAPA_SLAVE_DMA 0x08
  540. #define CL_CAPA_CPSTB_CAPABLE 0x20
  541. #define CL_CAPA_PER_SKT_LED 0x80
  542. //Cirrus Logic Device Capability Register B bits
  543. #define CL_CAPB_CARDBUS_CAPABLE 0x01
  544. #define CL_CAPB_LOCK_SUPPORT 0x02
  545. #define CL_CAPB_CLKRUN_SUPPORT 0x04
  546. #define CL_CAPB_EXT_DEF 0x80
  547. //Cirrus Logic Device Implementation Register A bits
  548. #define CL_IMPA_NUMSKT_MASK 0x03
  549. #define CL_IMPA_SLAVE_DMA 0x04
  550. #define CL_IMPA_VS1_VS2 0x08
  551. #define CL_IMPA_GPSTB_A 0x10
  552. #define CL_IMPA_GPSTB_B 0x20
  553. #define CL_IMPA_HW_SUSPEND 0x40
  554. #define CL_IMPA_RI_OUT 0x80
  555. //Cirrus Logic Device Implementation Register B bits
  556. #define CL_IMPB_033_VCC 0x01
  557. #define CL_IMPB_050_VCC 0x02
  558. #define CL_IMPB_0YY_VCC 0x04
  559. #define CL_IMPB_0XX_VCC 0x08
  560. #define CL_IMPB_120_VPP 0x10
  561. #define CL_IMPB_VPP_VCC_1A 0x20
  562. #define CL_IMPB_RFRATED_SKT 0x40
  563. //Cirrus Logic Device Implementation Register C bits
  564. #define CL_IMPC_LED 0x01
  565. #define CL_IMPC_PER_SKT_LED 0x02
  566. #define CL_IMPC_SPK 0x04
  567. #define CL_IMPC_ZVP_A 0x08
  568. #define CL_IMPC_ZVP_B 0x10
  569. //Cirrus Logic Device Implementation Register D bits
  570. #define CL_IMPD_CLKRUN 0x01
  571. #define CL_IMPD_LOCK 0x02
  572. #define CL_IMPD_EXT_CLK 0x40
  573. //Cirrus Logic Extension Registers
  574. #define CLEXTREG_EXTCTRL_1 0x03
  575. #define CLEXTREG_MEMWIN0_HIADDR 0x05
  576. #define CLEXTREG_MEMWIN1_HIADDR 0x06
  577. #define CLEXTREG_MEMWIN2_HIADDR 0x07
  578. #define CLEXTREG_MEMWIN3_HIADDR 0x08
  579. #define CLEXTREG_MEMWIN4_HIADDR 0x09
  580. #define CLEXTREG_EXT_DATA 0x0a
  581. #define CLEXTREG_EXTCTRL_2 0x0b
  582. //Cirrus Logic External Data Register bits (Index=0x6f,ExtIndex=0x0a)
  583. #define CL_EDATA_A_VS1 0x01
  584. #define CL_EDATA_A_VS2 0x02
  585. #define CL_EDATA_A_5V (CL_EDATA_A_VS1 | CL_EDATA_A_VS2)
  586. #define CL_EDATA_B_VS1 0x04
  587. #define CL_EDATA_B_VS2 0x08
  588. #define CL_EDATA_B_5V (CL_EDATA_B_VS1 | CL_EDATA_B_VS2)
  589. //Toshiba TOPIC95 Function Control Register bits
  590. #define TO_FCTRL_CARDPWR_ENABLE 0x01
  591. #define TO_FCTRL_VSSTATUS_ENABLE 0x02
  592. #define TO_FCTRL_PPEC_TIMING_ENABLE 0x04
  593. #define TO_FCTRL_CARD_TIMING_ENABLE 0x08
  594. #define TO_FCTRL_CARD_MEMPAGE_ENABLE 0x10
  595. #define TO_FCTRL_DMA_ENABLE 0x20
  596. #define TO_FCTRL_PWRCTRL_BUFFER_ENABLE 0x40
  597. //Toshiba TOPIC95 Multimedia Interface Control Register bits
  598. #define TO_MMI_VIDEO_CTRL 0x01
  599. #define TO_MMI_AUDIO_CTRL 0x02
  600. #define TO_MMI_REV_BIT 0x80
  601. //Toshiba TOPIC95 Addition General Control Register bits
  602. #define TO_GCTRL_CARDREMOVAL_RESET 0x02
  603. #define TO_GCTRL_SWCD_INT 0x20
  604. //Databook DB87144 Zoom Video Port Enable Register
  605. #define DBK_ZVE_MODE_MASK 0x03
  606. #define DBK_ZVE_STANDARD_MODE 0x00
  607. #define DBK_ZVE_MM_MODE 0x03
  608. //OPTi Global Control Register bits
  609. #define OPTI_ZV_ENABLE 0x20
  610. //VLSI ELC Constants
  611. #define VLSI_ELC_ALIAS 0x8000
  612. #define VLSI_EA2_EA_ENABLE 0x10
  613. #define VLSI_CC_VS1 0x04
  614. //VADEM Constants
  615. #define VADEM_UNLOCK_SEQ1 0x0e
  616. #define VADEM_UNLOCK_SEQ2 0x37
  617. #define VADEM_MISC_UNLOCK_VADEMREV 0xc0
  618. #define VADEM_IDREV_VG469_REV 0x0c
  619. #define VADEM_VSEL_VCC_MASK 0x03
  620. #define VADEM_VSEL_VCC_050V 0x00
  621. #define VADEM_VSEL_VCC_033V 0x01
  622. #define VADEM_VSEL_VCC_XXXV 0x02
  623. #define VADEM_VSEL_VCC_033VB 0x03
  624. #define VADEM_VSEL_SKT_MIXEDVOLT 0x40
  625. #define VADEM_VSENSE_A_VS1 0x01
  626. #define VADEM_VSENSE_A_VS2 0x02
  627. #define VADEM_VSENSE_B_VS1 0x04
  628. #define VADEM_VSENSE_B_VS2 0x08
  629. #define VADEM_VSENSE_050V_ONLY 0x03
  630. //IBM King Constants
  631. #define KING_CVS_VS1 0x01
  632. #define KING_CVS_VS2 0x02
  633. #define KING_CVS_VS_MASK (KING_CVS_VS1 | KING_CVS_VS2)
  634. #define KING_CVS_5V (KING_CVS_VS1 | KING_CVS_VS2)
  635. #define KING_CVS_GPI 0x80
  636. //Ricoh RL5C466 Miscellaneous Control 1 Register bits
  637. #define RICOH_MC1_VS 0x01
  638. #define RICOH_MC1_IREQ_SENSE_SEL 0x02
  639. #define RICOH_MC1_INPACK_ENABLE 0x04
  640. #define RICOH_MC1_ZV_ENABLE 0x08
  641. #define RICOH_MC1_DMA_ENABLE_MASK 0x30
  642. #define RICOH_MC1_DMA_DISABLE 0x00
  643. #define RICOH_MC1_DMA_INPACK 0x10
  644. #define RICOH_MC1_DMA_IOIS16 0x20
  645. #define RICOH_MC1_DMA_SPKR 0x30
  646. //Misc. Constants
  647. #define EXCAREGBASE_SPACE 0x40
  648. #define NUMWIN_PCCARD16 7 //5 mem + 2 io per socket
  649. #define NUMWIN_PC16_MEM 5
  650. #define NUMWIN_PC16_IO 2
  651. #define PCCARD_IOWIN_START 5
  652. //These are default values for the slowest and fastest memory speeds supported.
  653. //It may be necessary to change the actual values with arguments, if the bus
  654. //speed is not the default 8MHz/8.33MHz, which gives 120ns-125ns per cycle.
  655. //Note that the SLOW_MEM_SPEED should be the same as the default
  656. //WaitToSpeed[3], and FAST_MEM_SPEED might as well be 1ns, since the socket
  657. //will support arbitrarily fast memory.
  658. #define SLOW_MEM_SPEED 0x72 //700ns
  659. #define FAST_MEM_SPEED 0x08 //1ns
  660. #define RESET_DELAY 2000 //2ms
  661. #define PWRON_DELAY 300000 //300ms
  662. //I/O Control Register default nibble values
  663. //The Xircom net PC cards fails with a 16-bit wait on the AcerNote which
  664. //has a Cirrus Logic controller. Why the addition of a wait state causes
  665. //this to fail is a mystery. The Socket EA PC card fails on the IBM ThinkPad
  666. //755 if the 16-bit wait state is not set.
  667. #define DEF_IOC_8BIT 0x00
  668. #define DEF_IOC_16BIT (IOC_IO0_DATASIZE | IOC_IO0_IOCS16 | \
  669. IOC_IO0_WAITSTATE)
  670. /*** ExCA Type and Structure Definitions
  671. */
  672. typedef struct excaregs_s {
  673. BYTE bIDRev; //0x00
  674. BYTE bInterfaceStatus; //0x01
  675. BYTE bPowerControl; //0x02
  676. BYTE bIntGenControl; //0x03
  677. BYTE bCardStatusChange; //0x04
  678. BYTE bCardStatusIntConfig; //0x05
  679. BYTE bWindowEnable; //0x06
  680. BYTE bIOControl; //0x07
  681. BYTE bIO0StartLo; //0x08
  682. BYTE bIO0StartHi; //0x09
  683. BYTE bIO0StopLo; //0x0a
  684. BYTE bIO0StopHi; //0x0b
  685. BYTE bIO1StartLo; //0x0c
  686. BYTE bIO1StartHi; //0x0d
  687. BYTE bIO1StopLo; //0x0e
  688. BYTE bIO1StopHi; //0x0f
  689. BYTE bMem0StartLo; //0x10
  690. BYTE bMem0StartHi; //0x11
  691. BYTE bMem0StopLo; //0x12
  692. BYTE bMem0StopHi; //0x13
  693. BYTE bMem0OffsetLo; //0x14
  694. BYTE bMem0OffsetHi; //0x15
  695. WORD wReserved0; //0x16
  696. BYTE bMem1StartLo; //0x18
  697. BYTE bMem1StartHi; //0x19
  698. BYTE bMem1StopLo; //0x1a
  699. BYTE bMem1StopHi; //0x1b
  700. BYTE bMem1OffsetLo; //0x1c
  701. BYTE bMem1OffsetHi; //0x1d
  702. WORD wReserved1; //0x1e
  703. BYTE bMem2StartLo; //0x20
  704. BYTE bMem2StartHi; //0x21
  705. BYTE bMem2StopLo; //0x22
  706. BYTE bMem2StopHi; //0x23
  707. BYTE bMem2OffsetLo; //0x24
  708. BYTE bMem2OffsetHi; //0x25
  709. WORD wReserved2; //0x26
  710. BYTE bMem3StartLo; //0x28
  711. BYTE bMem3StartHi; //0x29
  712. BYTE bMem3StopLo; //0x2a
  713. BYTE bMem3StopHi; //0x2b
  714. BYTE bMem3OffsetLo; //0x2c
  715. BYTE bMem3OffsetHi; //0x2d
  716. WORD wReserved3; //0x2e
  717. BYTE bMem4StartLo; //0x30
  718. BYTE bMem4StartHi; //0x31
  719. BYTE bMem4StopLo; //0x32
  720. BYTE bMem4StopHi; //0x33
  721. BYTE bMem4OffsetLo; //0x34
  722. BYTE bMem4OffsetHi; //0x35
  723. WORD wReserved4; //0x36
  724. DWORD dgReserved5; //0x38
  725. DWORD dgReserved6; //0x3c
  726. } EXCAREGS;
  727. typedef EXCAREGS *PEXCAREGS;
  728. #endif //ifndef _PCSKTHW_H