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.

195 lines
7.1 KiB

  1. /*++
  2. Copyright (c) 1994 Microsoft Corporation
  3. Module Name:
  4. cb.h
  5. Abstract:
  6. This header contains generic cardbus definitions.
  7. Author(s):
  8. Neil Sandlin (neilsa)
  9. Revisions:
  10. --*/
  11. #ifndef _PCMCIA_CB_H_
  12. #define _PCMCIA_CB_H_
  13. //
  14. // Cardbus register definitions
  15. //
  16. #define CARDBUS_EXCA_REGISTER_BASE 0x800
  17. #define CARDBUS_SOCKET_EVENT_REG 0x0
  18. #define CARDBUS_SOCKET_MASK_REG 0x4
  19. #define CARDBUS_SOCKET_PRESENT_STATE_REG 0x8
  20. #define CARDBUS_SOCKET_FORCE_EVENT_REG 0xc
  21. #define CARDBUS_SOCKET_CONTROL_REG 0x10
  22. //
  23. // Masks for testing SOCKET_PRESENT_STATE Register
  24. //
  25. #define CARDBUS_CARDSTS 0x1
  26. #define CARDBUS_CD1 0x2
  27. #define CARDBUS_CD2 0x4
  28. #define CARDBUS_PWRCYCLE 0x8
  29. #define CARDBUS_16BIT_CARD 0x10
  30. #define CARDBUS_CB_CARD 0x20
  31. #define CARDBUS_READY 0x40
  32. #define CARDBUS_NOT_A_CARD 0x80
  33. #define CARDBUS_DATALOST 0x100
  34. #define CARDBUS_BAD_VCC_REQ 0x200
  35. #define CARDBUS_CARD_SUPPORTS_5V 0x400
  36. #define CARDBUS_CARD_SUPPORTS_3V 0x800
  37. #define CARDBUS_CARD_SUPPORTS_XV 0x1000
  38. #define CARDBUS_CARD_SUPPORTS_YV 0x2000
  39. #define CARDBUS_SOCKET_SUPPORTS_5V 0x10000000
  40. #define CARDBUS_SOCKET_SUPPORTS_3V 0x20000000
  41. #define CARDBUS_SOCKET_SUPPORTS_XV 0x40000000
  42. #define CARDBUS_SOCKET_SUPPORTS_YV 0x80000000
  43. //CardBus Registers
  44. #define CBREG_SKTEVENT 0x00
  45. #define CBREG_SKTMASK 0x04
  46. #define CBREG_SKTSTATE 0x08
  47. #define CBREG_SKTFORCE 0x0c
  48. #define CBREG_SKTPOWER 0x10
  49. //TI CardBus Registers
  50. #define CBREG_TI_SKT_POWER_MANAGEMENT 0x20
  51. #define CBREG_TI_CLKCTRLLEN 0x00010000L
  52. #define CBREG_TI_CLKCTRL 0x00000001L
  53. //O2Micro CardBus Registers
  54. #define CBREG_O2MICRO_ZVCTRL 0x20
  55. #define ZVCTRL_ZV_ENABLE 0x01
  56. //Socket Event Register bits
  57. #define SKTEVENT_CSTSCHG 0x00000001L
  58. #define SKTEVENT_CCD1 0x00000002L
  59. #define SKTEVENT_CCD2 0x00000004L
  60. #define SKTEVENT_CCD_MASK (SKTEVENT_CCD1 | SKTEVENT_CCD2)
  61. #define SKTEVENT_POWERCYCLE 0x00000008L
  62. #define SKTEVENT_MASK 0x0000000fL
  63. //Socket Mask Register bits
  64. #define SKTMSK_CSTSCHG 0x00000001L
  65. #define SKTMSK_CCD 0x00000006L
  66. #define SKTMSK_CCD1 0x00000002L
  67. #define SKTMSK_CCD2 0x00000004L
  68. #define SKTMSK_POWERCYCLE 0x00000008L
  69. //Socket Present State Register bits
  70. #define SKTSTATE_CSTSCHG 0x00000001L
  71. #define SKTSTATE_CCD1 0x00000002L
  72. #define SKTSTATE_CCD2 0x00000004L
  73. #define SKTSTATE_CCD_MASK (SKTSTATE_CCD1 | SKTSTATE_CCD2)
  74. #define SKTSTATE_POWERCYCLE 0x00000008L
  75. #define SKTSTATE_CARDTYPE_MASK 0x00000030L
  76. #define SKTSTATE_R2CARD 0x00000010L
  77. #define SKTSTATE_CBCARD 0x00000020L
  78. #define SKTSTATE_OPTI_DOCK 0x00000030L
  79. #define CARDTYPE(dw) ((dw) & SKTSTATE_CARDTYPE_MASK)
  80. #define SKTSTATE_CARDINT 0x00000040L
  81. #define SKTSTATE_NOTACARD 0x00000080L
  82. #define SKTSTATE_DATALOST 0x00000100L
  83. #define SKTSTATE_BADVCCREQ 0x00000200L
  84. #define SKTSTATE_5VCARD 0x00000400L
  85. #define SKTSTATE_3VCARD 0x00000800L
  86. #define SKTSTATE_XVCARD 0x00001000L
  87. #define SKTSTATE_YVCARD 0x00002000L
  88. #define SKTSTATE_CARDVCC_MASK (SKTSTATE_5VCARD | SKTSTATE_3VCARD | \
  89. SKTSTATE_XVCARD | SKTSTATE_YVCARD)
  90. #define SKTSTATE_5VSOCKET 0x10000000L
  91. #define SKTSTATE_3VSOCKET 0x20000000L
  92. #define SKTSTATE_XVSOCKET 0x40000000L
  93. #define SKTSTATE_YVSOCKET 0x80000000L
  94. #define SKTSTATE_SKTVCC_MASK (SKTSTATE_5VSOCKET | \
  95. SKTSTATE_3VSOCKET | \
  96. SKTSTATE_XVSOCKET | \
  97. SKTSTATE_YVSOCKET)
  98. //Socket Froce Register bits
  99. #define SKTFORCE_CSTSCHG 0x00000001L
  100. #define SKTFORCE_CCD1 0x00000002L
  101. #define SKTFORCE_CCD2 0x00000004L
  102. #define SKTFORCE_POWERCYCLE 0x00000008L
  103. #define SKTFORCE_R2CARD 0x00000010L
  104. #define SKTFORCE_CBCARD 0x00000020L
  105. #define SKTFORCE_NOTACARD 0x00000080L
  106. #define SKTFORCE_DATALOST 0x00000100L
  107. #define SKTFORCE_BADVCCREQ 0x00000200L
  108. #define SKTFORCE_5VCARD 0x00000400L
  109. #define SKTFORCE_3VCARD 0x00000800L
  110. #define SKTFORCE_XVCARD 0x00001000L
  111. #define SKTFORCE_YVCARD 0x00002000L
  112. #define SKTFORCE_CVSTEST 0x00004000L
  113. #define SKTFORCE_5VSOCKET 0x10000000L
  114. #define SKTFORCE_3VSOCKET 0x20000000L
  115. #define SKTFORCE_XVSOCKET 0x40000000L
  116. #define SKTFORCE_YVSOCKET 0x80000000L
  117. //Power Control Register bits
  118. #define SKTPOWER_VPP_CONTROL 0x00000007L
  119. #define SKTPOWER_VPP_OFF 0x00000000L
  120. #define SKTPOWER_VPP_120V 0x00000001L
  121. #define SKTPOWER_VPP_050V 0x00000002L
  122. #define SKTPOWER_VPP_033V 0x00000003L
  123. #define SKTPOWER_VPP_0XXV 0x00000004L
  124. #define SKTPOWER_VPP_0YYV 0x00000005L
  125. #define SKTPOWER_VCC_CONTROL 0x00000070L
  126. #define SKTPOWER_VCC_OFF 0x00000000L
  127. #define SKTPOWER_VCC_050V 0x00000020L
  128. #define SKTPOWER_VCC_033V 0x00000030L
  129. #define SKTPOWER_VCC_0XXV 0x00000040L
  130. #define SKTPOWER_VCC_0YYV 0x00000050L
  131. #define SKTPOWER_STOPCLOCK 0x00000080L
  132. //Misc. CardBus Constants
  133. #define NUMWIN_BRIDGE 4 //2 Mem + 2 IO
  134. #define EXCAREG_OFFSET 0x0800
  135. //
  136. // Number of times we attempt to look at a cardbus device which has
  137. // invalid config space.
  138. //
  139. // This is so that for cards like the Adaptec SlimScsi
  140. // on TI 1250, 1260 etc. power managed controllers,
  141. // the config space needs to be read at least twice
  142. // to ensure reliability
  143. //
  144. #define CARDBUS_CONFIG_RETRY_COUNT 5
  145. //
  146. // The pcmcia spec only specifies 20 msec for the reset setup delay, but
  147. // I'm seeing machine/card combination that need a lot more.
  148. // For example:
  149. // Gateway Solo 9100 with 3Com/Mhz 10/100 LAN CardBus card
  150. // Gateway 2000 Solo with a 3c575-TX
  151. // Toshiba Tecra 540CDT with (unknown)
  152. //
  153. #define PCMCIA_CB_MODEM_READY_DELAY 1000000 // 1 sec
  154. #define PCMCIA_CB_RESET_WIDTH_DELAY 100 // 100 usec
  155. //
  156. // The pcmcia spec says this should be 50msec, but some hardware seems
  157. // to need more (for example, a Thinkpad 600 with a Xircom realport modem)
  158. //
  159. #define PCMCIA_CB_RESET_SETUP_DELAY 100000 // 100 msec
  160. #define PCMCIA_CB_STALL_POWER 400000 //400ms
  161. #endif // _PCMCIA_CB_H_