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.

1107 lines
40 KiB

  1. /* tcic2.h Mon Jul 25 1994 18:30:04 zema */
  2. /*
  3. Module: tcic2.h
  4. Function:
  5. Definitions for DB86082 (TCIC-2/N) PCMCIA
  6. V2 interface controller chip.
  7. Version:
  8. V6.62f Mon Jul 25 1994 18:30:04 zema Edit level 34
  9. Copyright Notice:
  10. This file is in the public domain. It was created by:
  11. Databook Inc.
  12. Building E, Suite 6
  13. 3495 Winton Place
  14. Rochester, NY 14623
  15. Telephone: +1-716-292-5720
  16. Fax: +1-716-292-5737
  17. BBS: +1-716-292-5741
  18. Email: support@databook.com
  19. Compuserve: go databook
  20. This code is provided as-is. Databook makes no warrantees of
  21. any kind as to its correctness or suitability for any purpose,
  22. and disclaims all liability for any loss or damage resulting from
  23. the use of this file, including without limitation contingent,
  24. special, or other liability.
  25. Author:
  26. Terry Moore, Databook Inc. April 1991
  27. Revision history:
  28. 1.00a Mon Apr 15 1991 19:16:41 tmm
  29. Module created.
  30. 6.62f Mon Jul 25 1994 18:30:04 zema
  31. Incorporated define of a Chip's Silicon ID into ILOCKTEST define. ex.-
  32. #define SILID_DBxxxx (n)
  33. #define ILOCKTEST_DBxxxx ((SILID_DBxxxx) << ILOCKTEST_ID_SHFT)
  34. */
  35. /*****************************************************************************\
  36. This file contains a set of common definitions for the Databook/Fujitsu
  37. family of memory and I/O card controller chips, known by Databook as the
  38. TCIC family.
  39. When this file is included it will define symbols for one or more chips,
  40. depending on whether the following symbols are defined:
  41. MB86301 gets definitions for the Fujitsu 86301
  42. DB86081 gets definitions for the Databook TCIC-2/P
  43. DB86082 gets definitions for the Databook TCIC-2/N.
  44. DB86082A gets definitions for 86082a, and for the 86082.
  45. For backwards compatibility, the file "mcic.h" will define MB86301, then
  46. call this file.
  47. \*****************************************************************************/
  48. #ifndef _TCIC2_H_ /* prevent multiple includes */
  49. #define _TCIC2_H_
  50. //
  51. // Memory window sizes that will be allocated
  52. // for this controller - to map card memory
  53. //
  54. #define TCIC_WINDOW_SIZE 0x8000 //(32K)
  55. #define TCIC_WINDOW_ALIGNMENT 0x8000 //(32K)
  56. #define NUMSOCKETS 2
  57. #define CHIPBASE 0x240
  58. /* register definitions */
  59. #define R_DATA 0 /* data register */
  60. #define R_ADDR 2 /* address register */
  61. #define R_ADDR2 (R_ADDR+2) /* high order word of address register */
  62. #define R_SCTRL 6 /* socket ctrl register */
  63. #define R_SSTAT 7 /* socket status register */
  64. #define R_MODE 8 /* controller mode register */
  65. #define R_PWR 9 /* controller power register */
  66. #define R_EDC 10 /* EDC register */
  67. #define R_ICSR 12 /* interrupt control/status register */
  68. #define R_IENA 13 /* interrupt enable register */
  69. #define R_AUX 14 /* auxiliary control registers */
  70. /*
  71. The TCIC-2 family defines architectural extensions for handling multiple
  72. sockets with a single chip. Much of this is handled via a "socket select"
  73. field in the address register.
  74. We define the fields first as bit fields within the high order word
  75. of the address register, as this will be the most convenient way for
  76. software to access them; for completeness, and for the benefit of C code, we
  77. define the fields as part of the ULONG that represents the entire address
  78. register.
  79. */
  80. /**** first, some simple definitions ****/
  81. #define TCIC_SS_SHFT 12 /* default location for the
  82. socket select bits
  83. */
  84. #define TCIC_SS_MASK (7 << TCIC_SS_SHFT) /* default mask for the
  85. socket select bits
  86. */
  87. /* bits in ADDR2 */
  88. #define ADR2_REG (1 << 15) /* select REG space */
  89. #define ADR2_SS_SHFT TCIC_SS_SHFT /* select sockets the usual
  90. way */
  91. #define ADR2_SS_MASK TCIC_SS_MASK /* ditto */
  92. #define ADR2_INDREG (1 << 11) /* access indirect registers
  93. || (not card data)
  94. */
  95. #define ADR2_IO (1 << 10) /* select I/O cycles, readback
  96. || card /IORD, /IOWR in diag-
  97. || nostic mode.
  98. */
  99. /* Bits in address register */
  100. #define ADDR_REG ((unsigned long) ADR2_REG << 16) /* OR with this for REG space */
  101. #define ADDR_SS_SHFT ((unsigned long) ADR2_SS_SHFT + 16)
  102. /* shift count, cast so that
  103. || you'll get the right type
  104. || if you use it but forget
  105. || to cast the left arg.
  106. */
  107. #define ADDR_SS_MASK ((unsigned long) ADR2_SS_MASK << 16)
  108. #define ADDR_INDREG ((unsigned long) ADR2_INDREG << 16)
  109. #define ADDR_IO ((unsigned long) ADR2_IO << 16)
  110. #define ADDR_SPACE_SIZE ((unsigned long) 1 << 26)
  111. #define ADDR_MASK (ADDR_SPACE_SIZE - 1)
  112. /* following bits are defined in diagnostic mode */
  113. #define ADDR_DIAG_NREG ((unsigned long) 1 << 31) /* inverted! */
  114. #define ADDR_DIAG_NCEH ((unsigned long) 1 << 30)
  115. #define ADDR_DIAG_NCEL ((unsigned long) 1 << 29)
  116. #define ADDR_DIAG_NCWR ((unsigned long) 1 << 28)
  117. #define ADDR_DIAG_NCRD ((unsigned long) 1 << 27)
  118. #define ADDR_DIAG_CRESET ((unsigned long) 1 << 26)
  119. /* Bits in socket control register */
  120. #define SCTRL_ENA (1 << 0) /* enable access to card */
  121. #define SCTRL_INCMODE (3 << 3) /* mask for increment mode: */
  122. #define SCTRL_INCMODE_AUTO (3 << 3) /* auto-increment mode */
  123. #define SCTRL_INCMODE_HOLD (0 << 3) /* byte hold mode */
  124. #define SCTRL_INCMODE_WORD (1 << 3) /* word hold mode */
  125. #define SCTRL_INCMODE_REG (2 << 3) /* reg-space increment mode */
  126. #define SCTRL_EDCSUM (1 << 5) /* if set, use checksum (not CRC) */
  127. #define SCTRL_RESET (1 << 7) /* internal software reset */
  128. /**** the status register (read-only): R_SSTAT ****/
  129. #define SSTAT_6US (1 << 0) /* 6 microseconds have elapsed */
  130. #define SSTAT_10US (1 << 1) /* 10 microseconds have elapsed */
  131. #define SSTAT_PROGTIME (1 << 2) /* programming pulse timeout */
  132. #define SSTAT_LBAT1 (1 << 3) /* low battery 1 */
  133. #define SSTAT_LBAT2 (1 << 4) /* low battery 2 */
  134. #define SSTAT_BATOK (0 << 3) /* battery is OK */
  135. #define SSTAT_BATBAD1 (1 << 3) /* battery is low */
  136. #define SSTAT_BATLO (2 << 3) /* battery is getting low */
  137. #define SSTAT_BATBAD2 (3 << 3) /* battery is low */
  138. #define SSTAT_RDY (1 << 5) /* card is ready (not busy) */
  139. #define SSTAT_WP (1 << 6) /* card is write-protected */
  140. #define SSTAT_CD (1 << 7) /* card present */
  141. /**** mode register contents (R_MODE) ****/
  142. #define MODE_PGMMASK (0x1F) /* the programming mode bits */
  143. #define MODE_NORMAL (0) /* normal mode */
  144. #define MODE_PGMWR (1 << 0) /* assert /WR */
  145. #define MODE_PGMRD (1 << 1) /* assert /RD */
  146. #define MODE_PGMCE (1 << 2) /* assert /CEx */
  147. #define MODE_PGMDBW (1 << 3) /* databus in write mode */
  148. #define MODE_PGMWORD (1 << 4) /* word programming mode */
  149. #define MODE_AUXSEL_SHFT (5) /* shift count for aux regs */
  150. #define MODE_AUXSEL_MASK (7 << 5) /* the aux-reg select bits */
  151. #define MODE_AR_TCTL (0 << MODE_AUXSEL_SHFT) /* timing control */
  152. #define MODE_AR_PCTL (1 << MODE_AUXSEL_SHFT) /* pulse control */
  153. #define MODE_AR_WCTL (2 << MODE_AUXSEL_SHFT) /* wait-state control */
  154. #define MODE_AR_EXTERN (3 << MODE_AUXSEL_SHFT) /* external reg select */
  155. #define MODE_AR_PDATA (4 << MODE_AUXSEL_SHFT) /* programming data reg */
  156. #define MODE_AR_SYSCFG (5 << MODE_AUXSEL_SHFT) /* system config reg */
  157. #define MODE_AR_ILOCK (6 << MODE_AUXSEL_SHFT) /* interlock control reg */
  158. #define MODE_AR_TEST (7 << MODE_AUXSEL_SHFT) /* test control reg */
  159. #define PWR_VCC_SHFT (0) /* the VCC ctl shift */
  160. #define PWR_VCC_MASK (3 << PWR_VCC_SHFT)
  161. #define PWR_VPP_SHFT (3) /* the VPP ctl shift */
  162. #define PWR_VPP_MASK (3 << PWR_VPP_SHFT)
  163. #define PWR_ENA (1 << 5) /* on 084, successors, this
  164. || must be set to turn on
  165. || power.
  166. */
  167. #define PWR_VCC5V (1 << 2) /* enable +5 (not +3) */
  168. #define PWR_VOFF_POFF (0) /* turn off VCC, VPP */
  169. #define PWR_VON_PVCC (1) /* turn on VCC, VPP=VCC */
  170. #define PWR_VON_PVPP (2) /* turn on VCC, VPP=12V */
  171. #define PWR_VON_POFF (3) /* turn on VCC, VPP=0V */
  172. #define PWR_CLIMENA (1 << 6) /* the current-limit enable */
  173. #define PWR_CLIMSTAT (1 << 7) /* current limit sense (r/o) */
  174. /**** int CSR ****/
  175. #define ICSR_IOCHK (1 << 7) /* I/O check */
  176. #define ICSR_CDCHG (1 << 6) /* card status change: top 5
  177. || bits of SSTAT register.
  178. */
  179. #define ICSR_ERR (1 << 5) /* error condition */
  180. #define ICSR_PROGTIME (1 << 4) /* program timer ding */
  181. #define ICSR_ILOCK (1 << 3) /* interlock change */
  182. #define ICSR_STOPCPU (1 << 2) /* Stop CPU was asserted */
  183. #define ICSR_SET (1 << 1) /* (w/o: enable writes that set bits */
  184. #define ICSR_CLEAR (1 << 0) /* (w/o: enable writes that clear */
  185. #define ICSR_JAM (ICSR_SET|ICSR_CLEAR) /* jam value into ICSR */
  186. /**** interrupt enable bits ****/
  187. #define IENA_CDCHG (1 << 6) /* enable INT when ICSR_CDCHG is set */
  188. #define IENA_ERR (1 << 5) /* enable INT when ICSR_ERR is set */
  189. #define IENA_PROGTIME (1 << 4) /* enable INT when ICSR_PROGTIME " */
  190. #define IENA_ILOCK (1 << 3) /* enable INT when ICSR_ILOCK is set */
  191. #define IENA_CFG_MASK (3 << 0) /* select the bits for IRQ config: */
  192. #define IENA_CFG_OFF (0 << 0) /* IRQ is high-impedance */
  193. #define IENA_CFG_OD (1 << 0) /* IRQ is active low, open drain. */
  194. #define IENA_CFG_LOW (2 << 0) /* IRQ is active low, totem pole */
  195. #define IENA_CFG_HIGH (3 << 0) /* IRQ is active high, totem pole */
  196. /**** aux registers ****/
  197. #define WAIT_COUNT_MASK (0x1F) /* the count of 1/2 wait states */
  198. #define WAIT_COUNT_SHFT (0) /* the wait-count shift */
  199. #define WAIT_ASYNC (1 << 5) /* set for asynch, clear for synch cycles */
  200. #define WAIT_SENSE (1 << 6) /* select rising (1) or falling (0)
  201. || edge of wait clock as reference
  202. || edge.
  203. */
  204. #define WAIT_SRC (1 << 7) /* select constant clock (0) or bus
  205. || clock (1) as the timing source
  206. */
  207. /**** some derived constants ****/
  208. #define WAIT_BCLK (1 * WAIT_SRC)
  209. #define WAIT_CCLK (0 * WAIT_SRC)
  210. #define WAIT_RISING (1 * WAIT_SENSE)
  211. #define WAIT_FALLING (0 * WAIT_SENSE)
  212. /**** high byte ****/
  213. #define WCTL_WR (1 << 8) /* control: pulse write */
  214. #define WCTL_RD (1 << 9) /* control: pulse read */
  215. #define WCTL_CE (1 << 10) /* control: pulse chip ena */
  216. #define WCTL_LLBAT1 (1 << 11) /* status: latched LBAT1 */
  217. #define WCTL_LLBAT2 (1 << 12) /* status: latched LBAT2 */
  218. #define WCTL_LRDY (1 << 13) /* status: latched RDY */
  219. #define WCTL_LWP (1 << 14) /* status: latched WP */
  220. #define WCTL_LCD (1 << 15) /* status: latched CD */
  221. /**** the same thing, from a byte perspective ****/
  222. #define AR_WCTL_WAIT (R_AUX + 0) /* the wait state control byte */
  223. #define AR_WCTL_XCSR (R_AUX + 1) /* extended control/status */
  224. #define XCSR_WR (1 << 0) /* control: pulse write */
  225. #define XCSR_RD (1 << 1) /* control: pulse read */
  226. #define XCSR_CE (1 << 2) /* control: pulse chip ena */
  227. #define XCSR_LLBAT1 (1 << 3) /* status: latched LBAT1 */
  228. #define XCSR_LLBAT2 (1 << 4) /* status: latched LBAT2 */
  229. #define XCSR_LRDY (1 << 5) /* status: latched RDY */
  230. #define XCSR_LWP (1 << 6) /* status: latched WP */
  231. #define XCSR_LCD (1 << 7) /* status: latched CD */
  232. /**** prog timers ****/
  233. #define TCTL_6US_SHFT (0) /* the shift count for the 6 us ctr */
  234. #define TCTL_10US_SHFT (8) /* the shift count for the 10 us ctr */
  235. #define TCTL_6US_MASK (0xFF << TCTL_6US_SHFT)
  236. #define TCTL_10US_MASK (0xFF << TCTL_10US_SHFT)
  237. #define AR_TCTL_6US (R_AUX + 0) /* the byte access handle */
  238. #define AR_TCTL_10US (R_AUX + 1) /* the byte access handle */
  239. /**** The programming pulse register ****/
  240. #define AR_PULSE_LO (R_AUX + 0)
  241. #define AR_PULSE_HI (R_AUX + 1)
  242. /**** The programming data register ****/
  243. #define AR_PDATA_LO (R_AUX + 0)
  244. #define AR_PDATA_HI (R_AUX + 1)
  245. /**** the system configuration register ****/
  246. /*
  247. || The bottom four bits specify the steering of the socket IRQ. On
  248. || the 2N, the socket IRQ is (by default) pointed at the dedicated
  249. || pin.
  250. */
  251. #define SYSCFG_IRQ_MASK (0xF) /* mask for this bit field. */
  252. #define SYSCFG_SSIRQDFLT (0) /* default: use SKTIRQ (2/N)
  253. || disable (2/P)
  254. */
  255. #define SYSCFG_SSIRQ (0x1) /* use SKTIRQ (explicit) (2/N)
  256. || do not use (2/P)
  257. */
  258. #define SYSCFG_SIRQ3 (0x3) /* use IRQ3 */
  259. #define SYSCFG_SIRQ4 (0x4) /* use IRQ4 */
  260. #define SYSCFG_SIRQ5 (0x5) /* use IRQ5 (2/N) */
  261. #define SYSCFG_SIRQ6 (0x6) /* use IRQ6 (2/N) */
  262. #define SYSCFG_SIRQ7 (0x7) /* use IRQ7 (2/N) */
  263. #define SYSCFG_SIRQ10 (0xA) /* use IRQ10 */
  264. #define SYSCFG_SIRQ14 (0xE) /* use IRQ14 */
  265. #define SYSCFG_MCSFULL (1 << 4) /*
  266. If set, use full address (a[12:23]) for MCS16 generation.
  267. If clear, run in ISA-compatible mode (only using a[17:23]).
  268. With many chip sets, the TCIC-2/N's timing will will allow full
  269. address decoding to be used rather than limiting us to LA[17:23];
  270. thus we can get around the ISA spec which limits the granularity
  271. of bus sizing to 128K blocks.
  272. */
  273. #define SYSCFG_IO1723 (1 << 5) /*
  274. Flag indicating that LA[17:23] can be trusted to be zero during a true
  275. I/O cycle. Setting this bit will allow us to reduce power consumption
  276. further by eliminating I/O address broadcasts for memory cycles.
  277. Unfortunately, you cannot trust LA[17:23] to be zero on all systems,
  278. because the ISA specs do not require that LA[17:23] be zero when an
  279. alternate bus master runs an I/O cycle. However, on a palmtop or
  280. notebook, it is a good guess.
  281. */
  282. #define SYSCFG_MCSXB (1 << 6) /*
  283. If set, assume presence of an external buffer for MCS16: operate
  284. the driver as a totem-pole output.
  285. If clear, run in psuedo-ISA mode; output is open drain. But note
  286. that on the 082 the output buffers cannot drive a 300-ohm
  287. load.
  288. */
  289. #define SYSCFG_ICSXB (1 << 7) /*
  290. If set, assume presence of an external buffer for IOCS16*; operate
  291. the buffer as a totem-pole output.
  292. If clear, run in psuedo-ISA mode; output is open drain. But note
  293. that on the 082 the output buffers cannot drive a 300-ohm
  294. load.
  295. */
  296. #define SYSCFG_NOPDN (1 << 8) /*
  297. If set, disable the auto power-down sequencing. The chip will
  298. run card cycles somewhat more quickly (though perhaps not
  299. significantly so); but it will dissipate significantly more power.
  300. If clear, the low-power operating modes are enabled. This
  301. causes the part to go into low-power mode automatically at
  302. system reset.
  303. */
  304. #define SYSCFG_MPSEL_SHFT (9)
  305. #define SYSCFG_MPSEL_MASK (7 << 9) /*
  306. This field controls the operation of the multipurpose pin on the
  307. 86082. It has the following codes:
  308. */
  309. #define SYSCFGMPSEL_OFF (0 << SYSCFG_MPSEL_SHFT) /*
  310. This is the reset state; it indicates that the Multi-purpose
  311. pin is not used. The pin will be held in a high-impedance
  312. state. It can be read by monitoring SYSCFG_MPSENSE.
  313. */
  314. #define SYSCFGMPSEL_NEEDCLK (1 << SYSCFG_MPSEL_SHFT) /*
  315. NMULTI is an output.
  316. External indication that CCLK or BCLK are needed in order
  317. to complete an internal operation. External logic can use
  318. this to control the clocks coming to the chip.
  319. */
  320. #define SYSCFGMPSEL_MIO (2 << SYSCFG_MPSEL_SHFT) /*
  321. NMULTI is an input; it is an unambiguous M/IO signal, issued
  322. with timing similar to the LA[] lines.
  323. */
  324. #define SYSCFGMPSEL_EXTSEL (3 << SYSCFG_MPSEL_SHFT) /*
  325. NMULTI is an output; it is the external register select
  326. pulse, generated whenever software attempts to access
  327. aux register AR_EXTRN. Of course, the 86082 will ignore
  328. writes to AR_EXTRN, and will float the data bus if
  329. the CPU reads from AR_EXTRN.
  330. */
  331. /* (4 << SCFG_MPSEL_SHFT) is reserved */
  332. #define SYSCFGMPSEL_RI (5 << SYSCFG_MPSEL_SHFT) /*
  333. NMULTI is an output; it indicates a RI (active-going)
  334. transition has occurred lately on a an appropriately-
  335. configured socket. The output is active low.
  336. */
  337. /*
  338. Codes 4, 6 and 7 are reserved, and must NOT be output. It is
  339. indeed possibly hazardous to your system to encode values in
  340. this field that do not match your hardware!
  341. */
  342. /* 1 << 12 reserved */
  343. #define SYSCFG_MPSENSE (1 << 13) /*
  344. This bit, when read, returns the sense of the multi-purpose
  345. pin.
  346. */
  347. #define SYSCFG_AUTOBUSY (1 << 14) /*
  348. This bit, when set, causes the busy led to be gated with the
  349. SYSCFG_ACC bit. When clear, the busy led reflects whether the
  350. socket is actually enabled. If AUTOBUSY is set and ACC is clear,
  351. then the busy light will be off, even if a socket is enabled.
  352. If AUTOBUSY is clear, then the busy light will be on if either
  353. socket is enabled.
  354. Note, that when in a programming mode, you should either clear this
  355. bit (causing the busy light to be on whenever the socket is enabled)
  356. or set both this bit and the ACC bit (causing the light to be on
  357. all the time).
  358. On the '084 and '184, this bit is per-socket.
  359. */
  360. #define SYSCFG_ACC (1<<15) /*
  361. This bit will be set automatically by the hardware whenever the CPU
  362. accesses data on a card. It can be cleared under software control.
  363. In AUTOBUSY mode, it has the additional effect of turning on the
  364. busy light.
  365. Since we'll tristate the command lines as the card is going out of
  366. the socket, and since the shared lines idle low, there's no real
  367. danger if the busy light is off even though the socket is enabled.
  368. On the '084 and '184, this bit is per-socket.
  369. */
  370. /*
  371. C0: The interlock control register.
  372. */
  373. #define AR_ILOCK (R_AUX+0) /* symbolic handle for low byte */
  374. #define ILOCK_OUT (1 << 0) /* interlock output
  375. || per-socket on x84
  376. */
  377. #define ILOCK_SENSE (1 << 1) /* (r/o) interlock sense
  378. || 0 -> /cilock not asserted;
  379. || 1 -> /cilock is asserted.
  380. || per-socket on x84.
  381. */
  382. #define ILOCK_CRESET (1 << 2) /* card reset output level (S) */
  383. #define ILOCK_CRESENA (1 << 3) /* enable card reset output (S) */
  384. #define ILOCK_CWAIT (1 << 4) /* enable card wait (S) */
  385. #define ILOCK_CWAITSNS (1 << 5) /* (r/o) sense current state of wait
  386. || 0 -> /cwait not asserted;
  387. || 1 -> /cwait is asserted
  388. || (S)
  389. */
  390. /* the shift count & mask for the hold-time control */
  391. #define ILOCK_HOLD_SHIFT 6 /* shift count for the hold-time ctl (G) */
  392. #define ILOCK_HOLD_MASK (3 << ILOCK_HOLD_SHIFT)
  393. /*
  394. || quick hold mode waits until we observe that the strobe is high,
  395. || guaranteeing 10ns or so of hold time.
  396. */
  397. #define ILOCK_HOLD_QUICK (0 << ILOCK_HOLD_SHIFT)
  398. /*
  399. || CCLK hold mode waits (asynchronously) for an edge on CCLK. Minimum is 1
  400. || CCLK + epsilon; maximum is 2 CCLKs + epsilon.
  401. ||
  402. || for the 86081 & '82, this mode enables the multi-step
  403. || sequencer that generates setup and hold times based on CCLK. This
  404. || is the recommended mode of operation for the '81 and '82.
  405. */
  406. #define ILOCK_HOLD_CCLK (3 << ILOCK_HOLD_SHIFT)
  407. /**** The following bits are only present on the x84 and later parts ****/
  408. #define ILOCK_INPACK (1 << 11) /* (r/o, S) this bit is a diagnostic
  409. || read-back for card input
  410. || acknowledge.
  411. || The sense is inverted from the
  412. || level at the pin.
  413. */
  414. #define ILOCK_CP0 (1 << 12) /* (r/o, S) this bit is a diagnostic
  415. || monitor for card present pin 0.
  416. || The sense is inverted from the
  417. || level at the pin.
  418. */
  419. #define ILOCK_CP1 (1 << 13) /* (r/o, S) this bit is a diagnostic
  420. || monitor for card present pin 1.
  421. || The sense is inverted from the
  422. || level at the pin.
  423. */
  424. #define ILOCK_VS1 (1 << 14) /* (r/o, S) this bit is the primary
  425. || monitor for Card Voltage Sense
  426. || pin 1.
  427. || The sense is inverted from the
  428. || level at the pin.
  429. */
  430. #define ILOCK_VS2 (1 << 15) /* (r/o, S) this bit is the primary
  431. || monitor for Card Voltage Sense
  432. || pin 2.
  433. || The sense is inverted from the
  434. || level at the pin.
  435. */
  436. /*
  437. Silicon Version Register
  438. In diagnostic mode, the high byte of the interlock register is defined as the
  439. silicon identity byte.
  440. In order to read this byte, the chip must be placed in diagnostic
  441. mode by setting bit 15 of the TESTDIAG register. (This may or may
  442. not be enforced by the silicon.)
  443. The layout is:
  444. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
  445. m <-------ID-------> <----ILOCK---->
  446. The fields are:
  447. m Always reset.
  448. ID This field is one of the following:
  449. 0x02 the db86082
  450. 0x03 the db86082a
  451. 0x04 the db86084
  452. 0x05 the DB86072ES, (Engineering Sample)
  453. 0x07 the db86082bES, (Engineering Sample)
  454. 0x08 the db86084a
  455. 0x14 the DB86184
  456. 0x15 the DB86072, (Production)
  457. 0x17 the db86082b, (Production)
  458. */
  459. /*
  460. || Defines for Silicon IDs described above.
  461. ||
  462. || Use the following convention for defining SILID_DBxxxxxY:
  463. ||
  464. || SILID_DBxxxxx_1 The First step of chip.
  465. || SILID_DBxxxxxA The Second step of chip.
  466. || SILID_DBxxxxxB The Third step of chip.
  467. || SILID_DBxxxxx... The ... step of chip.
  468. ||
  469. || SILID_DBxxxxx"step of chip"_ES An Engineering Sample of chip.
  470. ||
  471. */
  472. #define SILID_DB86082_1 (0x02)
  473. #define SILID_DB86082A (0x03)
  474. #define SILID_DB86082B_ES (0x07)
  475. #define SILID_DB86082B (0x17)
  476. #define SILID_DB86084_1 (0x04)
  477. #define SILID_DB86084A (0x08)
  478. #define SILID_DB86184_1 (0x14)
  479. #define SILID_DB86072_1_ES (0x05)
  480. #define SILID_DB86072_1 (0x15)
  481. /**** the high order bits (in diag mode) give the chip version ****/
  482. #define AR_ILOCK_ID (R_AUX + 1)
  483. #define ILOCKTEST_ID_SHFT 8 /* the shift count */
  484. #define ILOCKTEST_ID_MASK (0x7F << ILOCKTEST_ID_SHFT)
  485. /* the mask for the field */
  486. /*
  487. || Use the following convention for defining ILOCKTEST_DBxxxxxY:
  488. ||
  489. || ILOCKTEST_DBxxxxx_1 The First step of chip.
  490. || ILOCKTEST_DBxxxxxA The Second step of chip.
  491. || ILOCKTEST_DBxxxxxB The Third step of chip.
  492. || ILOCKTEST_DBxxxxx... The ... step of chip.
  493. ||
  494. || ILOCKTEST_DBxxxxx"step of chip"_ES An Engineering Sample of chip.
  495. ||
  496. */
  497. #define ILOCKTEST_TCIC2N_1 ((SILID_DB86082_1) << ILOCKTEST_ID_SHFT)
  498. #define ILOCKTEST_DB86082_1 ILOCKTEST_TCIC2N_1
  499. #define ILOCKTEST_TCIC2N_2 ((SILID_DB86082A) << ILOCKTEST_ID_SHFT)
  500. #define ILOCKTEST_DB86082A ILOCKTEST_TCIC2N_2
  501. #define ILOCKTEST_TCIC2N_3 ((SILID_DB86082B_ES) << ILOCKTEST_ID_SHFT)
  502. #define ILOCKTEST_DB86082B_ES ILOCKTEST_TCIC2N_3
  503. #define ILOCKTEST_DB86082B ((SILID_DB86082B) << ILOCKTEST_ID_SHFT)
  504. #define ILOCKTEST_DB86084_1 ((SILID_DB86084_1) << ILOCKTEST_ID_SHFT)
  505. #define ILOCKTEST_DB86084A ((SILID_DB86084A) << ILOCKTEST_ID_SHFT)
  506. #define ILOCKTEST_DB86184_1 ((SILID_DB86184_1) << ILOCKTEST_ID_SHFT)
  507. #define ILOCKTEST_DB86072_1 ((SILID_DB86072_1) << ILOCKTEST_ID_SHFT)
  508. #define ILOCKTEST_DB86072_1_ES ((SILID_DB86072_1_ES) << ILOCKTEST_ID_SHFT)
  509. /**** the test control register ****/
  510. #define AR_TEST (R_AUX + 0)
  511. #define TEST_AEN (1 << 0) /* force card AEN */
  512. #define TEST_CEN (1 << 1) /* force card CEN */
  513. #define TEST_CTR (1 << 2) /* test programming pulse, address ctrs */
  514. #define TEST_ENA (1 << 3) /* force card-present (for test), and
  515. || special VPP test mode
  516. */
  517. #define TEST_IO (1 << 4) /* feed back some I/O signals
  518. || internally.
  519. */
  520. #define TEST_OUT1 (1 << 5) /* force special address output mode */
  521. #define TEST_ZPB (1 << 6) /* enter ZPB test mode */
  522. #define TEST_WAIT (1 << 7) /* force-enable WAIT pin */
  523. #define TEST_PCTR (1 << 8) /* program counter in read-test mode */
  524. #define TEST_VCTL (1 << 9) /* force-enable power-supply controls */
  525. #define TEST_EXTA (1 << 10) /* external access doesn't override
  526. || internal decoding.
  527. */
  528. #define TEST_DRIVECDB (1 << 11) /* drive the card data bus all the time */
  529. #define TEST_ISTP (1 << 12) /* turn off CCLK to the interrupt CSR */
  530. #define TEST_BSTP (1 << 13) /* turn off BCLK internal to the chip */
  531. #define TEST_CSTP (1 << 14) /* turn off CCLK except to int CSR */
  532. #define TEST_DIAG (1 << 15) /* enable diagnostic read-back mode */
  533. /*
  534. Indirectly Addressed Registers
  535. Indirect address Function
  536. ---------------- --------
  537. [$000:$003] Socket configuration registers for socket 0.
  538. [$008:$00A] Socket configuration registers for socket 1.
  539. (we allow for up to 8 sockets per adapter)
  540. [$00B:$0FF] reserved
  541. [$100:$107] Memory window 0 translation registers:
  542. $100: reserved;
  543. $102: base window address
  544. $104: map to card address
  545. $106: control register.
  546. [$108:$10F] Memory window 1 translation registers
  547. [$110:$117] Memory window 2 translation registers
  548. ...
  549. [$138:$13F] Memory window 7 translation registers
  550. [$140:$147] Memory window 8 translation registers
  551. [$148:$14F] Memory window 9 translation registers
  552. (the architecture reserves room for up to
  553. 32 windows.)
  554. [$200:$203] I/O window 0 translation registers
  555. [$204:$207] I/O window 1 translation registers
  556. [$208:$20B] I/O window 2 translation registers
  557. [$20C:$20F] I/O window 3 translation registers
  558. [$210:$2FF]
  559. [$300:$301] Adapter configuration register 0 ('x84 and later)
  560. [$320:$321] Configuration ROM CSR.
  561. [$380:$381] Plug and Play ISA read port and address port reister
  562. [$382:$383] Plug and Play ISA configuration sequence number and
  563. logical device number register.
  564. [$384:$385] Plug and Play chip ID/test register.
  565. [$386:$387] Plug and Play config selection register.
  566. [$386:$3FFFFFF] Reserved -- do not read or write.
  567. */
  568. /*
  569. Bit definitions:
  570. 1) The Indirect Socket Configuration Registers:
  571. */
  572. #define IR_SCFG_S(skt) (0 + (skt) * 8) /* base indices of socket config */
  573. #define IR_SCFG_S0 IR_SCFG_S(0) /* base indices of socket config */
  574. #define IR_SCFG_S1 IR_SCFG_S(1) /* regs for socket 0, 1 */
  575. #define IR_MWIN_BASE 0x100 /* where they start */
  576. #define IR_MWIN_NUM_082 8 /* number of memory windows */
  577. #define IR_MWIN_NUM_082A 10 /* number of memory windows in 082a */
  578. #define IR_MWIN_NUM_082B 10 /* number of memory windows in 082b */
  579. #define IR_MWIN_NUM_084 10 /* number of memory windows in 084 */
  580. #define IR_MWIN_NUM_184 10 /* number of memory windows in 184 */
  581. #define IR_MWIN_NUM_072 10 /* number of memory windows in 072 */
  582. #define IR_MWIN_NUM_MAX 32 /* make arrays of windows this big */
  583. #define IR_MWIN_SIZE 8 /* 8 bytes per window descriptor */
  584. #define IR_MBASE_X 2 /* index to the memory base controlreg */
  585. #define IR_MMAP_X 4 /* index to the memory map control reg */
  586. #define IR_MCTL_X 6 /* index to the memory window control reg */
  587. #define IR_MBASE_W(w) (IR_MWIN_BASE + (w) * IR_MWIN_SIZE + IR_MBASE_X)
  588. #define IR_MMAP_W(w) (IR_MWIN_BASE + (w) * IR_MWIN_SIZE + IR_MMAP_X)
  589. #define IR_MCTL_W(w) (IR_MWIN_BASE + (w) * IR_MWIN_SIZE + IR_MCTL_X)
  590. #define IR_IOWIN_BASE 0x200 /* where they start */
  591. #define IR_IOWIN_SIZE 4 /* bytes per window descriptor */
  592. #define IR_IOWIN_NUM 4 /* we have 4 of them on the 082 */
  593. /* should be defined as 0 on the
  594. 86301 */
  595. #define IR_IOBASE_X 0 /* index to the I/O base register */
  596. #define IR_IOCTL_X 2 /* index to the I/O window control register */
  597. #define IR_IOBASE_W(w) (IR_IOWIN_BASE + (w) * IR_IOWIN_SIZE + IR_IOBASE_X)
  598. #define IR_IOCTL_W(w) (IR_IOWIN_BASE + (w) * IR_IOWIN_SIZE + IR_IOCTL_X)
  599. /**** patterns in the indirect registers ****/
  600. #define IRSCFG_IRQ_MASK (0xF) /* mask for this bit field */
  601. #define IRSCFG_IRQOFF (0) /* disable */
  602. #define IRSCFG_SIRQ (0x1) /* use SKTIRQ (2/N) */
  603. #define IRSCFG_IRQ3 (0x3) /* use IRQ3 */
  604. #define IRSCFG_IRQ4 (0x4) /* use IRQ4 */
  605. #define IRSCFG_IRQ5 (0x5) /* use IRQ5 */
  606. #define IRSCFG_IRQ6 (0x6) /* use IRQ6 */
  607. #define IRSCFG_IRQ7 (0x7) /* use IRQ7 */
  608. #define IRSCFG_IRQ9 (0x9) /* use IRQ9 */
  609. #define IRSCFG_IRQ10 (0xA) /* use IRQ10 */
  610. #define IRSCFG_IRQ11 (0xB) /* use IRQ11 */
  611. #define IRSCFG_IRQ12 (0xC) /* use IRQ12 */
  612. #define IRSCFG_IRQ14 (0xE) /* use IRQ14 */
  613. #define IRSCFG_IRQ15 (0xF) /* use IRQ15 */
  614. #define IRSCFG_IRQOC (1 << 4) /* selected IRQ is
  615. || open-collector, and active
  616. || low; otherwise it's totem-
  617. || pole and active hi.
  618. */
  619. #define IRSCFG_PCVT (1 << 5) /* convert level-mode IRQ
  620. || to pulse mode, or stretch
  621. || pulses from card.
  622. */
  623. #define IRSCFG_IRDY (1 << 6) /* interrupt from RDY (not
  624. || from /IREQ). Used with
  625. || ATA drives.
  626. */
  627. #define IRSCFG_ATA (1 << 7) /* Special ATA drive mode.
  628. || CEL/H become CE1/2 in
  629. || the IDE sense; CEL is
  630. || activated for even window
  631. || matches, and CEH for
  632. || odd window matches.
  633. */
  634. #define IRSCFG_DMA_SHIFT 8 /* offset to DMA selects; */
  635. #define IRSCFG_DMA_MASK (0x7 << IRSCFG_DMA_SHIFT)
  636. #define IRSCFG_DMAOFF (0 << IRSCFG_DMA_SHIFT) /* disable DMA */
  637. #define IRSCFG_DREQ2 (2 << IRSCFG_DMA_SHIFT) /* enable DMA on DRQ2 */
  638. #define IRSCFG_IOSTS (1 << 11) /* enable I/O status mode;
  639. || allows CIORD/CIOWR to
  640. || become low-Z.
  641. */
  642. #define IRSCFG_SPKR (1 << 12) /* enable SPKR output from
  643. || this card
  644. */
  645. #define IRSCFG_FINPACK (1 << 13) /* force card input
  646. || acknowledge during I/O
  647. || cycles. Has no effect
  648. || if no windows map to card
  649. */
  650. #define IRSCFG_DELWR (1 << 14) /* force -all- data to
  651. || meet 60ns setup time
  652. || ("DELay WRite")
  653. */
  654. #define IRSCFG_HD7IDE (1 << 15) /* Enable special IDE
  655. || data register mode: odd
  656. || byte addresses in odd
  657. || I/O windows will not
  658. || drive HD7.
  659. */
  660. /***** bits in the second config register *****/
  661. #define IR_SCF2_S(skt) (IR_SCFG_S(skt) + 2) /* index to second config reg */
  662. #define IR_SCF2_S0 IR_SCF2_S(0) /* second config for socket 0 */
  663. #define IR_SCF2_S1 IR_SCF2_S(1) /* second config for socket 0 */
  664. #define IRSCF2_RI (1 << 0) /* enable RI pin from STSCHG
  665. || (2/N)
  666. */
  667. #define IRSCF2_IDBR (1 << 1) /* force I/O data bus routing
  668. || for this socket, regardless
  669. || of cycle type. (2/N)
  670. */
  671. #define IRSCF2_MDBR (1 << 2) /* force memory window data
  672. || bus routing for this
  673. || socket, regardless of cycle
  674. || type. (2/N)
  675. */
  676. #define IRSCF2_MLBAT1 (1 << 3) /* disable status change
  677. || ints from LBAT1 (or
  678. || "STSCHG"
  679. */
  680. #define IRSCF2_MLBAT2 (1 << 4) /* disable status change
  681. || ints from LBAT2 (or
  682. || "SPKR"
  683. */
  684. #define IRSCF2_MRDY (1 << 5) /* disable status change ints
  685. || from RDY/BSY (or /IREQ).
  686. || note that you get ints on
  687. || both high- and low-going
  688. || edges if this is enabled.
  689. */
  690. #define IRSCF2_MWP (1 << 6) /* disable status-change ints
  691. || from WP (or /IOIS16).
  692. || If you're using status
  693. || change ints, you better set
  694. || this once an I/O window is
  695. || enabled, before accessing
  696. || it.
  697. */
  698. #define IRSCF2_MCD (1 << 7) /* disable status-change ints
  699. || from Card Detect.
  700. */
  701. /*
  702. || note that these bits match the top 5 bits of the socket status register
  703. || in order and sense.
  704. */
  705. #define IRSCF2_DMASRC_MASK (0x3 << 8) /* mask for this bit field */
  706. /*-- DMA Source --*/
  707. #define IRSCF2_DRQ_BVD2 (0x0 << 8) /* BVD2 */
  708. #define IRSCF2_DRQ_IOIS16 (0x1 << 8) /* IOIS16 */
  709. #define IRSCF2_DRQ_INPACK (0x2 << 8) /* INPACK */
  710. #define IRSCF2_DRQ_FORCE (0x3 << 8) /* Force it */
  711. /* reserved (0xFC00) */ /* top 6 bits are RFU */
  712. /****************************************************************************\
  713. |
  714. | The memory window control registers.
  715. |
  716. \****************************************************************************/
  717. /*
  718. || The BASE ADDRESS register establishes a correspondence between
  719. || a host bus address and a particular memory window.
  720. ||
  721. || The MAP ADDRESS register establishes a correspondence between a
  722. || window and a particular card address. The contents of this register
  723. || are ADDED to the address from the host, and (therefore) are not
  724. || independent of the value in the BASE ADDRESS register. That is,
  725. || the value to put into the MAP ADDRESS register to map to page
  726. || 0 of common space is NOT (in general) 0; it is, rather, (-window
  727. || base address), in twos complement.
  728. ||
  729. || Of course, you must use the twos complement of the actual window
  730. || base, NOT of the value that's actually in the BASE ADDRESS register;
  731. || that value also has the window size encoded in it.
  732. ||
  733. || The window enable bit for a given window is automatically cleared whenever
  734. || you write to the BASE ADDRESS register.
  735. */
  736. /**** the base register ****/
  737. #define MBASE_ILV (1 << 15) /* rfu */
  738. #define MBASE_4K (1 << MBASE_4K_BIT) /* if set, addresses are 4K */
  739. #define MBASE_4K_BIT 14 /* (bit shift count) */
  740. #define MBASE_HA_SHFT (12) /* shift host addresses
  741. || right this much
  742. */
  743. #define MBASE_HA_MASK (0xFFF) /* mask for host address
  744. || bits in this register
  745. */
  746. #define MBASE_HA2BASE(ha) \
  747. ( \
  748. ((USHORT) ((ha) >> MBASE_HA_SHFT) & MBASE_HA_MASK) \
  749. | \
  750. (((USHORT) (ha) & (1 << 11)) << (MBASE_4K_BIT - 11)) \
  751. )
  752. #define MBASE_BASE2HA(base) \
  753. ( \
  754. ((ULONG) ((base) & MBASE_HA_MASK) << MBASE_HA_SHFT) \
  755. | \
  756. (((base) & MBASE_4K) >> (MBASE_4K_BIT - 11)) \
  757. )
  758. /**** the card mapping register ****/
  759. #define MMAP_CA_SHFT 12 /* shift card address right this much */
  760. #define MMAP_CA_MASK (0x3FFF) /* then mask with this */
  761. #define MMAP_REG (1 << 15) /* the REG bit */
  762. /**** the mem window control register ****/
  763. #define MCTL_WSCNT_MASK 0x1F /* the wait-state mask register */
  764. #define MCTL_WSCNT_SHFT 0 /* how to align it */
  765. /* reserved (1<<5) -- this bit is reserved */
  766. #define MCTL_QUIET (1<<6) /* the window is quiet */
  767. #define MCTL_WP (1<<7) /* prohibit writes via this window */
  768. #define MCTL_ACC (1<<8) /* if set, we've used this window */
  769. #define MCTL_KE (1<<9) /* enable caching on this window */
  770. #define MCTL_EDC (1<<10) /* enable EDC on this window */
  771. #define MCTL_B8 (1<<11) /* force window to be 8 bits */
  772. #define MCTL_SS_SHFT (TCIC_SS_SHFT) /* socket select in standard place (bits 12-14) */
  773. #define MCTL_SS_MASK (TCIC_SS_MASK) /* ditto for mask */
  774. #define MCTL_ENA (1<<15) /* enable the window */
  775. /**** the I/O base register ****/
  776. /*
  777. || the base and length are encoded here, pretty much as they are for the
  778. || memory base register; however, a 17th bit is needed, and can be found
  779. || in the I/O window control register (IOCTL_TINY).
  780. */
  781. /**** the I/O control register ****/
  782. #define ICTL_WSCNT_MASK MCTL_WSCNT_MASK /* these are the same */
  783. #define ICTL_WSCNT_SFHT MCTL_WSCNT_SHFT /* and are shown this way to ensure
  784. || that you can use the same code to
  785. ||generate them, if you like
  786. */
  787. #define ICTL_PASS16 (1 << 5) /* If this bit is set, then all 16
  788. || bits of an I/O address will be
  789. || passed through to the card, even
  790. || if the window is only a 10-bit
  791. || window. If reset, then only 10
  792. || bits will be passed if this is a
  793. || 1K window, even if HA[15:10] were
  794. || non-zero. Regardless of the
  795. || value of this bit, the 082 always
  796. || acts as if this bit were clear.
  797. */
  798. #define ICTL_QUIET MCTL_QUIET /* more commonality */
  799. #define ICTL_1K (1 << 7) /* ignore ha[15:10] in comparisons;
  800. || this makes us 100% PC compatible.
  801. */
  802. #define ICTL_ACC MCTL_ACC /* more commonality */
  803. #define ICTL_TINY (1 << 9) /* window is exactly 1 byte long */
  804. #define ICTL_B16 (1 << 10) /* I/O mode stuff; force 16 bit, but
  805. || also encodes stuff; see below.
  806. */
  807. #define ICTL_B8 (MCTL_B8)
  808. /* B8 and B16, taken together, define the bus width for this window: */
  809. #define ICTL_BW_MASK (ICTL_B8 | ICTL_B16) /* the field itself. */
  810. #define ICTL_BW_DYN (0) /* use CIOIS16 */
  811. #define ICTL_BW_8 (ICTL_B8) /* force 8-bit (no /HIOCS16) */
  812. #define ICTL_BW_16 (ICTL_B16) /* force 16-bit (force HIOCS16) */
  813. #define ICTL_BW_ATA (ICTL_B8|ICTL_B16) /* ATA mode IOCS16 */
  814. /*
  815. "ATA mode IOCS16" means that this window is to be used with an ATA/IDE-like
  816. drive. /HIOCS16 is asserted for references to addresses 0, 8, ... within
  817. the window; it is deasserted for all other addresses.
  818. */
  819. /* socket is selected in the usual way, using the usual fields */
  820. #define ICTL_SS_SHFT (TCIC_SS_SHFT) /* the shift count for the socket
  821. || for this window (12)
  822. */
  823. #define ICTL_SS_MASK (TCIC_SS_MASK) /* the mask for the field (0x7000) */
  824. #define ICTL_ENA (MCTL_ENA) /* enable the window (same fn/same bit) */
  825. /****************************************************************************\
  826. |
  827. | The TCIC architecture V2.0 registers
  828. |
  829. \****************************************************************************/
  830. #define IR_ADPTCFG0 0x300 /* The primary adapter config register */
  831. #define IRADPCF0_PNPCS (1 << 0) /* if set, using PnP to set base addr */
  832. #define IRADPCF0_MULTI (1 << 1) /* if set, NMULTI# functions are available */
  833. #define IRADPCF0_EE1K (1 << 2) /* if set, if EEPROM is present, it's 1K (max) */
  834. #define IRADPCF0_EE (1 << 3) /* if set, EE control is present */
  835. #define IRADPCF0_DRQ2 (1 << 4) /* if set, DMA is possible */
  836. #define IRADPCF0_IRQ6 (1 << 5) /* if set, IRQ6 is available */
  837. #define IRADPCF0_IRQ9 (1 << 6) /* if set, IRQ9 is available */
  838. #define IRADPCF0_IRQ12 (1 << 7) /* if set, IRQ12 is available */
  839. #define IRADPCF0_IRQ15 (1 << 8) /* if set, IRQ15 is available */
  840. #define IRADPCF0_3V (1 << 9) /* if set, CVS & 3V/5V are enabled */
  841. #define IRADPCF0_BUSYLED (1 << 10) /* if set, we have busy light(s) */
  842. #define IRADPCF0_BUSYSKT (1 << 11) /* if set, busy lights are per skt */
  843. #define IRADPCF0_ILOCK (1 << 12) /* if set, we have interlocks */
  844. #define IRADPCF0_ILOCKSKT (1 << 13) /* if set, ilocks are per-skt */
  845. #define IRADPCF0_NONSTD (1 << 14) /* if set, a hardware-specific driver
  846. || is required.
  847. */
  848. #define IRADPCF0_READY (1 << 15) /* if set, TCIC has finished power-up
  849. || self configuration.
  850. */
  851. #define IR_ROMCSR 0x320 /* the config ROM csr */
  852. #define IR_ROMCSR_ADDR_MASK 0xFF /* the WORD address bits */
  853. #define IR_ROMCSR_CMD_SHFT 12 /* the ROM command bit offset */
  854. #define IR_ROMCSR_CMD_MASK (3 << 12)
  855. #define IR_ROMCSR_GO (1 << 14) /* set this bit to process a command */
  856. #define IR_ROMCSR_BUSY (1 << 15) /* r/o: set while working */
  857. /**** the READ command -- data shows up in PDATA ****/
  858. #define IR_ROMCSR_READCMD(a) \
  859. ((2 << IR_ROMCSR_CMD_SHFT) | \
  860. ((a) & IR_ROMCSR_ADDR_MASK))
  861. /**** the WRITE command ****/
  862. #define IR_ROMCSR_WRITECMD(a) \
  863. ((1 << IR_ROMCSR_CMD_SHFT) | \
  864. ((a) & IR_ROMCSR_ADDR_MASK))
  865. /**** the ERASE WORD command ****/
  866. #define IR_ROMCSR_ERASEWDCMD(a) \
  867. ((3 << IR_ROMCSR_CMD_SHFT) | \
  868. ((a) & IR_ROMCSR_ADDR_MASK))
  869. /**** the WRITE-ENABLE command ****/
  870. #define IR_ROMCSR_WRITEENA \
  871. ((0 << IR_ROMCSR_CMD_SHFT) | \
  872. ((0x03) & IR_ROMCSR_ADDR_MASK))
  873. /**** the WRITE-DISABLE command ****/
  874. #define IR_ROMCSR_WRITEDSA \
  875. ((0 << IR_ROMCSR_CMD_SHFT) | \
  876. ((0x00) & IR_ROMCSR_ADDR_MASK))
  877. /****************************************************************************\
  878. |
  879. | The plug and play test registers
  880. |
  881. \****************************************************************************/
  882. #define IR_PNPADDRP 0x380 /* PnP ISA: read port, address port */
  883. #define IRPNPADDR_ADDR_MASK 0x00FF /* the last value written to the
  884. || PnP address register.
  885. */
  886. #define IRPNPADDR_ADDR_SHFT 0
  887. #define IRPNPADDR_RDP_MASK 0xFF00 /* the last value written to the read-
  888. || data port-address PnP register.
  889. */
  890. #define IRPNPADDR_RDP_SHFT 8
  891. /**** handy place to figure out CSN, LDN ****/
  892. #define IR_PNPCSNLDN 0x382 /* PnP ISA: card seq no, log dev no */
  893. #define IRPNPCSN_LDN_MASK 0xFF00 /* the last value written to this
  894. || chip's PnP logical dev # reg.
  895. */
  896. #define IRPNPCSN_LDN_SHFT 8
  897. #define IRPNPCSN_CSN_MASK 0x00FF /* the last value written to this
  898. || chip's PnP CSN register.
  899. */
  900. #define IRPNPCSN_CSN_SHFT 0
  901. /**** handy place to figure out chip ID ****/
  902. #define IR_PNPTEST 0x384 /* PnP ISA: chip id */
  903. #define IRPNPTEST_CHIPID_MASK 0x00FF /* the Chip ID captured during the last
  904. || PnP wake-up seqeunce.
  905. */
  906. #define IRPNPTEST_CHIPID_SHFT 0
  907. #define IRPNPTEST_LSTCFGCTL_SHFT 8 /* the last value written to cfgctl */
  908. #define IRPNPTEST_LSTCFGCTL_MASK (7 << IRPNPTEST_LSTCFGCTL_SHFT)
  909. #define IRPNPTEST_ISO2ND (1 << 11)
  910. #define IRPNPTEST_MTCH1ST (1 << 12)
  911. #define IRPNPTEST_STATE_SHFT 13
  912. #define IRPNPTEST_STATE_MASK (3 << IRPNPTEST_STATE_SHFT)
  913. #define IRPNPTEST_STATE_WFK (0 << IRPNPTEST_STATE_SHFT)
  914. #define IRPNPTEST_STATE_SLP (1 << IRPNPTEST_STATE_SHFT)
  915. #define IRPNPTEST_STATE_ISO (2 << IRPNPTEST_STATE_SHFT)
  916. #define IRPNPTEST_STATE_CFG (3 << IRPNPTEST_STATE_SHFT)
  917. /**** the following register lets us see what PNP software has done ****/
  918. #define IR_PNPCFG 0x386 /* PnP ISA: configuration info */
  919. #define IRPNPCFG_IRQ_SHFT 0
  920. #define IRPNPCFG_IRQ_MASK (0xF << IRPNPCFG_IRQ_SHFT)
  921. #define IRPNPCFG_IRQLVL (1 << 4) /* Level IRQ selected */
  922. #define IRPNPCFG_IRQHIGH (1 << 5) /* active high IRQ select */
  923. #define IRPNPCFG_DMA_SHFT 8
  924. #define IRPNPCFG_DMA_MASK (7 << IRPNPCFG_DMA_SHFT)
  925. /**** end of tcic2.h ****/
  926. #endif /* _TCIC2_H_ */