tcic.h
上传用户:luoyougen
上传日期:2008-05-12
资源大小:23136k
文件大小:7k
源码类别:

VxWorks

开发平台:

C/C++

  1. /* tcic.h - Databook TCIC/2 PCMCIA Host Bus Adaptor Chip header */
  2. /* Copyright 1984-1996 Wind River Systems, Inc. */
  3. /* Copyright (c) 1994 David A. Hinds -- All Rights Reserved */
  4. /*
  5. modification history
  6. --------------------
  7. 01b,22feb96,hdn  cleaned up.
  8. 01a,03oct95,hdn  written based on David Hinds's version 2.2.3.
  9. */
  10. #ifndef __INCtcich
  11. #define __INCtcich
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15. #ifndef _ASMLANGUAGE
  16. #define TCIC_MAX_SOCKS 2 /* number of sockets */
  17. #define TCIC_MEM_WINDOWS 4 /* number of memory windows */
  18. #define TCIC_IO_WINDOWS 2 /* number of io windows */
  19. /* offsets of registers from TCIC_BASE */
  20. #define TCIC_DATA 0x00
  21. #define TCIC_ADDR 0x02
  22. #define TCIC_SCTRL 0x06
  23. #define TCIC_SSTAT 0x07
  24. #define TCIC_MODE 0x08
  25. #define TCIC_PWR 0x09
  26. #define TCIC_EDC 0x0A
  27. #define TCIC_ICSR 0x0C
  28. #define TCIC_IENA 0x0D
  29. #define TCIC_AUX 0x0E
  30. #define TCIC_SS_SHFT 12
  31. #define TCIC_SS_MASK 0x7000
  32. /* Flags for TCIC_ADDR */
  33. #define TCIC_ADR2_REG 0x8000
  34. #define TCIC_ADR2_INDREG 0x0800
  35. #define TCIC_ADDR_REG 0x80000000
  36. #define TCIC_ADDR_SS_SHFT (TCIC_SS_SHFT+16)
  37. #define TCIC_ADDR_SS_MASK (TCIC_SS_MASK<<16)
  38. #define TCIC_ADDR_INDREG 0x08000000
  39. #define TCIC_ADDR_IO 0x04000000
  40. #define TCIC_ADDR_MASK 0x03ffffff
  41. /* Flags for TCIC_SCTRL */
  42. #define TCIC_SCTRL_ENA 0x01
  43. #define TCIC_SCTRL_INCMODE 0x18
  44. #define TCIC_SCTRL_INCMODE_HOLD 0x00
  45. #define TCIC_SCTRL_INCMODE_WORD 0x08
  46. #define TCIC_SCTRL_INCMODE_REG 0x10
  47. #define TCIC_SCTRL_INCMODE_AUTO 0x18
  48. #define TCIC_SCTRL_EDCSUM 0x20
  49. #define TCIC_SCTRL_RESET 0x80
  50. /* Flags for TCIC_SSTAT */
  51. #define TCIC_SSTAT_6US 0x01
  52. #define TCIC_SSTAT_10US 0x02
  53. #define TCIC_SSTAT_PROGTIME 0x04
  54. #define TCIC_SSTAT_LBAT1 0x08
  55. #define TCIC_SSTAT_LBAT2 0x10
  56. #define TCIC_SSTAT_RDY 0x20 /* Inverted */
  57. #define TCIC_SSTAT_WP 0x40
  58. #define TCIC_SSTAT_CD 0x80 /* Card detect */
  59. /* Flags for TCIC_MODE */
  60. #define TCIC_MODE_PGMMASK 0x1f
  61. #define TCIC_MODE_NORMAL 0x00
  62. #define TCIC_MODE_PGMWR 0x01
  63. #define TCIC_MODE_PGMRD 0x02
  64. #define TCIC_MODE_PGMCE 0x04
  65. #define TCIC_MODE_PGMDBW 0x08
  66. #define TCIC_MODE_PGMWORD 0x10
  67. #define TCIC_MODE_AUXSEL_MASK 0xe0
  68. /* Registers accessed through TCIC_AUX, by setting TCIC_MODE */
  69. #define TCIC_AUX_TCTL (0<<5)
  70. #define TCIC_AUX_PCTL (1<<5)
  71. #define TCIC_AUX_WCTL (2<<5)
  72. #define TCIC_AUX_EXTERN (3<<5)
  73. #define TCIC_AUX_PDATA (4<<5)
  74. #define TCIC_AUX_SYSCFG (5<<5)
  75. #define TCIC_AUX_ILOCK (6<<5)
  76. #define TCIC_AUX_TEST (7<<5)
  77. /* Flags for TCIC_PWR */
  78. #define TCIC_PWR_VCC(sock) (0x01<<(sock))
  79. #define TCIC_PWR_VCC_MASK 0x03
  80. #define TCIC_PWR_VPP(sock) (0x08<<(sock))
  81. #define TCIC_PWR_VPP_MASK 0x18
  82. #define TCIC_PWR_CLIMENA 0x40
  83. #define TCIC_PWR_CLIMSTAT 0x80
  84. /* Flags for TCIC_ICSR */
  85. #define TCIC_ICSR_CLEAR 0x01
  86. #define TCIC_ICSR_SET 0x02
  87. #define TCIC_ICSR_STOPCPU 0x04
  88. #define TCIC_ICSR_ILOCK 0x08
  89. #define TCIC_ICSR_PROGTIME 0x10
  90. #define TCIC_ICSR_ERR 0x20
  91. #define TCIC_ICSR_CDCHG 0x40
  92. #define TCIC_ICSR_IOCHK 0x80
  93. /* Flags for TCIC_IENA */
  94. #define TCIC_IENA_CFG_MASK 0x03
  95. #define TCIC_IENA_CFG_OFF 0x00 /* disabled */
  96. #define TCIC_IENA_CFG_OD 0x01 /* active low, open drain */
  97. #define TCIC_IENA_CFG_LOW 0x02 /* active low, totem pole */
  98. #define TCIC_IENA_CFG_HIGH 0x03 /* active high, totem pole */
  99. #define TCIC_IENA_ILOCK 0x08
  100. #define TCIC_IENA_PROGTIME 0x10
  101. #define TCIC_IENA_ERR 0x20 /* overcurrent or iochk */
  102. #define TCIC_IENA_CDCHG 0x40
  103. /* Flags for TCIC_AUX_WCTL */
  104. #define TCIC_WAIT_COUNT_MASK 0x001f
  105. #define TCIC_WAIT_ASYNC 0x0020
  106. #define TCIC_WAIT_SENSE 0x0040
  107. #define TCIC_WAIT_SRC 0x0080
  108. #define TCIC_WCTL_WR 0x0100
  109. #define TCIC_WCTL_RD 0x0200
  110. #define TCIC_WCTL_CE 0x0400
  111. #define TCIC_WCTL_LLBAT1 0x0800
  112. #define TCIC_WCTL_LLBAT2 0x1000
  113. #define TCIC_WCTL_LRDY 0x2000
  114. #define TCIC_WCTL_LWP 0x4000
  115. #define TCIC_WCTL_LCD 0x8000
  116. /* Flags for TCIC_AUX_SYSCFG */
  117. #define TCIC_SYSCFG_IRQ_MASK 0x000f
  118. #define TCIC_SYSCFG_MCSFULL 0x0010
  119. #define TCIC_SYSCFG_IO1723 0x0020
  120. #define TCIC_SYSCFG_MCSXB 0x0040
  121. #define TCIC_SYSCFG_ICSXB 0x0080
  122. #define TCIC_SYSCFG_NOPDN 0x0100
  123. #define TCIC_SYSCFG_MPSEL_SHFT 9
  124. #define TCIC_SYSCFG_MPSEL_MASK 0x0e00
  125. #define TCIC_SYSCFG_MPSENSE 0x2000
  126. #define TCIC_SYSCFG_AUTOBUSY 0x4000
  127. #define TCIC_SYSCFG_ACC 0x8000
  128. #define TCIC_ILOCK_OUT 0x01
  129. #define TCIC_ILOCK_SENSE 0x02
  130. #define TCIC_ILOCK_CRESET 0x04
  131. #define TCIC_ILOCK_CRESENA 0x08
  132. #define TCIC_ILOCK_CWAIT 0x10
  133. #define TCIC_ILOCK_CWAITSNS 0x20
  134. #define TCIC_ILOCK_HOLD_MASK 0xc0
  135. #define TCIC_ILOCK_HOLD_CCLK 0xc0
  136. #define TCIC_ILOCKTEST_ID_SH 8
  137. #define TCIC_ILOCKTEST_ID_MASK 0x7f00
  138. #define TCIC_ILOCKTEST_MCIC_1 0x8000
  139. #define TCIC_TEST_DIAG 0x8000
  140. /* Indirectly addressed registers */
  141. #define TCIC_SCF1(sock) ((sock)<<3)
  142. #define TCIC_SCF2(sock) (((sock)<<3)+2)
  143. /* Flags for SCF1 */
  144. #define TCIC_SCF1_IRQ_MASK 0x000f
  145. #define TCIC_SCF1_IRQ_OFF 0x0000
  146. #define TCIC_SCF1_IRQOC 0x0010
  147. #define TCIC_SCF1_PCVT 0x0020
  148. #define TCIC_SCF1_IRDY 0x0040
  149. #define TCIC_SCF1_ATA 0x0080
  150. #define TCIC_SCF1_DMA_SHIFT 8
  151. #define TCIC_SCF1_DMA_OFF 0
  152. #define TCIC_SCF1_DREQ2 2
  153. #define TCIC_SCF1_IOSTS 0x0800
  154. #define TCIC_SCF1_SPKR 0x1000
  155. #define TCIC_SCF1_FINPACK 0x2000
  156. #define TCIC_SCF1_DELWR 0x4000
  157. #define TCIC_SCF1_HD7IDE 0x8000
  158. /* Flags for SCF2 */
  159. #define TCIC_SCF2_RI 0x0001
  160. #define TCIC_SCF2_IDBR 0x0002
  161. #define TCIC_SCF2_MDBR 0x0004
  162. #define TCIC_SCF2_MLBAT1 0x0008
  163. #define TCIC_SCF2_MLBAT2 0x0010
  164. #define TCIC_SCF2_MRDY 0x0020
  165. #define TCIC_SCF2_MWP 0x0040
  166. #define TCIC_SCF2_MCD 0x0080
  167. /* Indirect addresses for memory window registers */
  168. #define TCIC_MWIN(sock,map) (0x100+(((map)+((sock)<<2))<<3))
  169. #define TCIC_MBASE_X 2
  170. #define TCIC_MMAP_X 4
  171. #define TCIC_MCTL_X 6
  172. #define TCIC_MBASE_4K_BIT 0x4000
  173. #define TCIC_MBASE_HA_SHFT 12
  174. #define TCIC_MBASE_HA_MASK 0x0fff
  175. #define TCIC_MMAP_REG 0x8000
  176. #define TCIC_MMAP_CA_SHFT 12
  177. #define TCIC_MMAP_CA_MASK 0x3fff
  178. #define TCIC_MCTL_WSCNT_MASK 0x001f
  179. #define TCIC_MCTL_WCLK 0x0020
  180. #define TCIC_MCTL_WCLK_CCLK 0x0000
  181. #define TCIC_MCTL_WCLK_BCLK 0x0020
  182. #define TCIC_MCTL_QUIET 0x0040
  183. #define TCIC_MCTL_WP 0x0080
  184. #define TCIC_MCTL_ACC 0x0100
  185. #define TCIC_MCTL_KE 0x0200
  186. #define TCIC_MCTL_EDC 0x0400
  187. #define TCIC_MCTL_B8 0x0800
  188. #define TCIC_MCTL_SS_SHFT TCIC_SS_SHFT
  189. #define TCIC_MCTL_SS_MASK TCIC_SS_MASK
  190. #define TCIC_MCTL_ENA 0x8000
  191. /* Indirect addresses for I/O window registers */
  192. #define TCIC_IWIN(sock,map) (0x200+(((map)+((sock)<<1))<<2))
  193. #define TCIC_IBASE_X 0
  194. #define TCIC_ICTL_X 2
  195. #define TCIC_ICTL_WSCNT_MASK TCIC_MCTL_WSCNT_MASK
  196. #define TCIC_ICTL_QUIET TCIC_MCTL_QUIET
  197. #define TCIC_ICTL_1K 0x0080
  198. #define TCIC_ICTL_PASS16 0x0100
  199. #define TCIC_ICTL_ACC TCIC_MCTL_ACC
  200. #define TCIC_ICTL_TINY 0x0200
  201. #define TCIC_ICTL_B16 0x0400
  202. #define TCIC_ICTL_B8 TCIC_MCTL_B8
  203. #define TCIC_ICTL_BW_MASK (TCIC_ICTL_B16|TCIC_ICTL_B8)
  204. #define TCIC_ICTL_BW_DYN 0
  205. #define TCIC_ICTL_BW_8 TCIC_ICTL_B8
  206. #define TCIC_ICTL_BW_16 TCIC_ICTL_B16
  207. #define TCIC_ICTL_BW_ATA (TCIC_ICTL_B16|TCIC_ICTL_B8)
  208. #define TCIC_ICTL_SS_SHFT TCIC_SS_SHFT
  209. #define TCIC_ICTL_SS_MASK TCIC_SS_MASK
  210. #define TCIC_ICTL_ENA TCIC_MCTL_ENA
  211. /* function declarations */
  212. #if defined(__STDC__) || defined(__cplusplus)
  213. extern int  tcicInit (int ioBase, int intVec, int intLevel,
  214.  FUNCPTR showRtn);
  215. extern void tcicShow (int sock);
  216. #else
  217. extern int  tcicInit ();
  218. extern void tcicShow ();
  219. #endif  /* __STDC__ */
  220. #endif /* _ASMLANGUAGE */
  221. #ifdef __cplusplus
  222. }
  223. #endif
  224. #endif /* __INCtcich */