1 1.6 andvar /* $NetBSD: tcic2reg.h,v 1.6 2024/02/09 22:08:34 andvar Exp $ */ 2 1.1 bad 3 1.1 bad /*- 4 1.1 bad * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. 5 1.1 bad * All rights reserved. 6 1.1 bad * 7 1.1 bad * This code is derived from software contributed to The NetBSD Foundation 8 1.1 bad * by Christoph Badura. 9 1.1 bad * 10 1.1 bad * Redistribution and use in source and binary forms, with or without 11 1.1 bad * modification, are permitted provided that the following conditions 12 1.1 bad * are met: 13 1.1 bad * 1. Redistributions of source code must retain the above copyright 14 1.1 bad * notice, this list of conditions and the following disclaimer. 15 1.1 bad * 2. Redistributions in binary form must reproduce the above copyright 16 1.1 bad * notice, this list of conditions and the following disclaimer in the 17 1.1 bad * documentation and/or other materials provided with the distribution. 18 1.1 bad * 19 1.1 bad * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 20 1.1 bad * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 21 1.1 bad * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22 1.1 bad * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 23 1.1 bad * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 1.1 bad * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 1.1 bad * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 1.1 bad * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 1.1 bad * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 1.1 bad * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 1.1 bad * POSSIBILITY OF SUCH DAMAGE. 30 1.1 bad */ 31 1.1 bad 32 1.1 bad /* 33 1.1 bad * All information is from the Databook DB86082 TCIC PC Card Controller for 34 1.1 bad * Notebook PCs -- Hardware Design Guide, March 22, 1994. 35 1.1 bad */ 36 1.1 bad 37 1.1 bad #ifndef _TCIC2REG_H 38 1.1 bad #define _TCIC2REG_H 39 1.1 bad #define TCIC_IOSIZE 16 40 1.1 bad 41 1.1 bad /* TCIC primary registers */ 42 1.1 bad #define TCIC_R_DATA 0 /* Data register, 16 bit */ 43 1.1 bad #define TCIC_R_ADDR 2 /* Address register, 32 bit */ 44 1.1 bad #define TCIC_R_ADDR2 (TCIC_R_ADDR+2) /* high word of addr. reg. */ 45 1.1 bad #define TCIC_R_SCTRL 6 /* Socket control reg., 8 bit */ 46 1.1 bad #define TCIC_R_SSTAT 7 /* Socket status reg., 8 bit */ 47 1.1 bad #define TCIC_R_MODE 8 /* Mode register, 8 bit */ 48 1.1 bad #define TCIC_R_PWR 9 /* Power control reg., 8 bit */ 49 1.1 bad #define TCIC_R_EDC 0xA /* Error detect code, 16 bit */ 50 1.1 bad #define TCIC_R_ICSR 0xC /* Interrupt ctrl/status, 8 bit */ 51 1.1 bad #define TCIC_R_IENA 0xD /* Interrupt enable, 8 bit */ 52 1.1 bad #define TCIC_R_AUX 0xE /* Auxiliary Register, 16 bit */ 53 1.1 bad 54 1.1 bad /* 55 1.1 bad * TCIC auxiliary registers. 56 1.1 bad * These are all 16 bit registers. 57 1.2 wiz * They are accessed by selecting the appropriate index in 58 1.1 bad * bits 7:5 of the mode register. 59 1.1 bad */ 60 1.1 bad #define TCIC_AR_MASK 0xe0 /* for masking the mode reg. */ 61 1.1 bad #define TCIC_AR_TCTL 0x00 /* timing control register */ 62 1.1 bad #define TCIC_AR_PCTL 0x20 /* programming pulse ctrl. */ 63 1.1 bad #define TCIC_AR_WCTL 0x40 /* wait state control */ 64 1.1 bad #define TCIC_AR_EXTERN 0x60 /* external access */ 65 1.1 bad #define TCIC_AR_PDATA 0x80 /* programming data */ 66 1.1 bad #define TCIC_AR_SYSCFG 0xA0 /* system configuration */ 67 1.1 bad #define TCIC_AR_ILOCK 0xC0 /* interlock control/status */ 68 1.1 bad #define TCIC_AR_TEST 0xE0 /* test */ 69 1.1 bad 70 1.1 bad /* 71 1.1 bad * TCIC indirect registers. 72 1.1 bad * These are all 16 bit. 73 1.1 bad * They are accessed by selecting the appropriate address in 74 1.1 bad * bits 9:0 of the address register with indirect register access mode 75 1.1 bad * enabled. 76 1.1 bad */ 77 1.1 bad #define TCIC_WR_MEM_BASE 0x100 /* base address */ 78 1.1 bad #define TCIC_WR_MEM_SHFT 3 /* log2 size of one reg set */ 79 1.1 bad #define TCIC_WR_MEXT_N(n) ((TCIC_WR_MEM_BASE+((n)<<TCIC_WR_MEM_SHFT))+0) 80 1.1 bad #define TCIC_WR_MBASE_N(n) ((TCIC_WR_MEM_BASE+((n)<<TCIC_WR_MEM_SHFT))+2) 81 1.1 bad #define TCIC_WR_MMAP_N(n) ((TCIC_WR_MEM_BASE+((n)<<TCIC_WR_MEM_SHFT))+4) 82 1.1 bad #define TCIC_WR_MCTL_N(n) ((TCIC_WR_MEM_BASE+((n)<<TCIC_WR_MEM_SHFT))+6) 83 1.1 bad 84 1.1 bad #define TCIC_WR_IO_BASE 0x200 /* base address */ 85 1.1 bad #define TCIC_WR_IO_SHFT 2 /* log2 size of one reg set */ 86 1.1 bad #define TCIC_WR_IBASE_N(n) ((TCIC_WR_IO_BASE+((n)<<TCIC_WR_IO_SHFT))+0) 87 1.1 bad #define TCIC_WR_ICTL_N(n) ((TCIC_WR_IO_BASE+((n)<<TCIC_WR_IO_SHFT))+2) 88 1.1 bad 89 1.1 bad #define TCIC_IR_SCF_BASE 0 /* base address */ 90 1.1 bad #define TCIC_IR_SCF_SHFT 3 /* log2 size of one reg set */ 91 1.1 bad #define TCIC_IR_SCF1_N(n) ((TCIC_IR_SCF_BASE+((n)<<TCIC_IR_SCF_SHFT))+0) 92 1.1 bad #define TCIC_IR_SCF2_N(n) ((TCIC_IR_SCF_BASE+((n)<<TCIC_IR_SCF_SHFT))+2) 93 1.1 bad 94 1.1 bad 95 1.1 bad /* Bits in the ADDR2 register */ 96 1.1 bad #define TCIC_SS_SHIFT 12 /* location of socket select bits */ 97 1.1 bad #define TCIC_SS_MASK (7<<(TCIC_SS_SHIFT)) /* socket select mask */ 98 1.1 bad 99 1.1 bad #define TCIC_ADDR2_REG (1 << 15) /* select REG space */ 100 1.1 bad #define TCIC_ADDR2_SS_SHFT TCIC_SS_SHIFT /* select sockets the usual way */ 101 1.1 bad #define TCIC_ADDR2_SS_MASK TCIC_SS_MASK /* ditto */ 102 1.1 bad #define TCIC_ADDR2_INDREG (1 << 11) /* access indirect registers 103 1.1 bad * (not card data) 104 1.1 bad */ 105 1.1 bad #define TCIC_ADDR2_IO (1 << 10) /* select I/O cycles, readback 106 1.1 bad * card /IORD, /IOWR in diag- 107 1.1 bad * nostic mode. 108 1.1 bad */ 109 1.1 bad 110 1.1 bad /* Bits in address register */ 111 1.1 bad #define TCIC_ADDR_REG (u_int32_t) TCIC_ADDR2_REG << 16) /* OR with this for REG space */ 112 1.1 bad #define TCIC_ADDR_SS_SHFT ((u_int32_t) TCIC_ADDR2_SS_SHFT + 16) 113 1.1 bad /* shift count, cast so that 114 1.1 bad * you'll get the right type 115 1.1 bad * if you use it but forget 116 1.1 bad * to cast the left arg. 117 1.1 bad */ 118 1.1 bad #define TCIC_ADDR_SS_MASK ((u_int32_t) TCIC_ADDR2_SS_MASK << 16) 119 1.1 bad #define TCIC_ADDR_INDREG ((u_int32_t) TCIC_ADDR2_INDREG << 16) 120 1.1 bad #define TCIC_ADDR_IO ((u_int32_t) TCIC_ADDR2_IO << 16) 121 1.1 bad 122 1.1 bad #define TCIC_ADDR_SPACE_SIZE ((u_int32_t) 1 << 26) 123 1.1 bad #define TCIC_ADDR_MASK (ADDR_SPACE_SIZE - 1) 124 1.1 bad 125 1.1 bad /* The following bits are defined in diagnostic mode */ 126 1.1 bad #define TCIC_ADDR_DIAG_NREG ((u_int32_t) 1 << 31) /* inverted! */ 127 1.1 bad #define TCIC_ADDR_DIAG_NCEH ((u_int32_t) 1 << 30) 128 1.1 bad #define TCIC_ADDR_DIAG_NCEL ((u_int32_t) 1 << 29) 129 1.1 bad #define TCIC_ADDR_DIAG_NCWR ((u_int32_t) 1 << 28) 130 1.1 bad #define TCIC_ADDR_DIAG_NCRD ((u_int32_t) 1 << 27) 131 1.1 bad #define TCIC_ADDR_DIAG_CRESET ((u_int32_t) 1 << 26) 132 1.1 bad 133 1.1 bad /* Bits in socket control register */ 134 1.1 bad #define TCIC_SCTRL_ENA (1 << 0) /* enable access to card */ 135 1.1 bad #define TCIC_SCTRL_INCMODE (3 << 3) /* mask for increment mode: */ 136 1.1 bad #define TCIC_SCTRL_INCMODE_AUTO (3 << 3) /* auto-increment mode */ 137 1.1 bad #define TCIC_SCTRL_INCMODE_HOLD (0 << 3) /* byte hold mode */ 138 1.1 bad #define TCIC_SCTRL_INCMODE_WORD (1 << 3) /* word hold mode */ 139 1.1 bad #define TCIC_SCTRL_INCMODE_REG (2 << 3) /* reg-space increment mode */ 140 1.1 bad #define TCIC_SCTRL_EDCSUM (1 << 5) /* if set, use checksum (not CRC) */ 141 1.1 bad #define TCIC_SCTRL_RESET (1 << 7) /* internal software reset */ 142 1.1 bad #define TCIC_SCTRL_RSVD 0x46 /* reserved bits, MBZ */ 143 1.1 bad 144 1.1 bad /* Bits in the socket status register */ 145 1.1 bad #define TCIC_SSTAT_6US (1<<0) /* 6 usec have elapsed */ 146 1.1 bad #define TCIC_SSTAT_10US (1<<1) /* 10 usec have elapsed */ 147 1.1 bad #define TCIC_SSTAT_PROGTIME (1<<2) /* programming pulse timeout */ 148 1.1 bad #define TCIC_SSTAT_LBAT1 (1<<3) /* low battery 1 */ 149 1.1 bad #define TCIC_SSTAT_LBAT2 (1<<4) /* low battery 2 */ 150 1.1 bad #define TCIC_SSTAT_BATOK (0<<3) /* battery is OK */ 151 1.1 bad #define TCIC_SSTAT_BATBAD1 (1<<3) /* battery is low */ 152 1.1 bad #define TCIC_SSTAT_BATLO (2<<3) /* battery is getting low */ 153 1.1 bad #define TCIC_SSTAT_BATBAD2 (3<<3) /* battery is low */ 154 1.1 bad #define TCIC_SSTAT_RDY (1<<5) /* card is ready (not busy) */ 155 1.2 wiz #define TCIC_SSTAT_WP (1<<6) /* card is write-protected */ 156 1.1 bad #define TCIC_SSTAT_CD (1<<7) /* card present */ 157 1.1 bad #define TCIC_SSTAT_STAT_MASK 0xf8 158 1.1 bad 159 1.1 bad /* Mode register contents (R_MODE) */ 160 1.1 bad #define TCIC_MODE_PGMMASK (0x1F) /* the programming mode bits */ 161 1.1 bad #define TCIC_MODE_NORMAL (0) /* normal mode */ 162 1.1 bad #define TCIC_MODE_PGMWR (1 << 0) /* assert /WR */ 163 1.1 bad #define TCIC_MODE_PGMRD (1 << 1) /* assert /RD */ 164 1.1 bad #define TCIC_MODE_PGMCE (1 << 2) /* assert /CEx */ 165 1.1 bad #define TCIC_MODE_PGMDBW (1 << 3) /* databus in write mode */ 166 1.1 bad #define TCIC_MODE_PGMWORD (1 << 4) /* word programming mode */ 167 1.1 bad 168 1.1 bad /* Power control register contents (R_PWR) */ 169 1.1 bad #define TCIC_PWR_VCC_SHFT (0) /* the VCC ctl shift */ 170 1.1 bad #define TCIC_PWR_VCC_MASK (3 << TCIC_PWR_VCC_SHFT) 171 1.1 bad 172 1.1 bad #define TCIC_PWR_VPP_SHFT (3) /* the VPP ctl shift */ 173 1.1 bad #define TCIC_PWR_VPP_MASK (3 << TCIC_PWR_VPP_SHFT) 174 1.1 bad #define TCIC_PWR_ENA (1 << 5) /* on 084, successors, this 175 1.1 bad * must be set to turn on 176 1.1 bad * power. 177 1.1 bad */ 178 1.1 bad #define TCIC_PWR_VCC5V (1 << 2) /* enable +5 (not +3) */ 179 1.1 bad #if 0 180 1.1 bad #define TCIC_PWR_VOFF_POFF (0) /* turn off VCC, VPP */ 181 1.1 bad #define TCIC_PWR_VON_PVCC (1) /* turn on VCC, VPP=VCC */ 182 1.1 bad #define TCIC_PWR_VON_PVPP (2) /* turn on VCC, VPP=12V */ 183 1.1 bad #define TCIC_PWR_VON_POFF (3) /* turn on VCC, VPP=0V */ 184 1.1 bad #endif 185 1.1 bad #define TCIC_PWR_VCC_N(n) (1<<((n))) /* VCCSEL for socket n */ 186 1.1 bad #define TCIC_PWR_VPP_N(n) (1<<(3+(n))) /* VPPSEL for socket n */ 187 1.1 bad 188 1.1 bad #define TCIC_PWR_CLIMENA (1 << 6) /* the current-limit enable */ 189 1.1 bad #define TCIC_PWR_CLIMSTAT (1 << 7) /* current limit sense (r/o) */ 190 1.1 bad 191 1.2 wiz /* Bits in the icsr register. */ 192 1.1 bad #define TCIC_ICSR_IOCHK (1<<7) /* I/O check */ 193 1.1 bad #define TCIC_ICSR_CDCHG (1<<6) /* card status change, see SSTAT */ 194 1.1 bad #define TCIC_ICSR_ERR (1<<5) /* error condition */ 195 1.1 bad #define TCIC_ICSR_PROGTIME (1<<4) /* program timer ding */ 196 1.1 bad #define TCIC_ICSR_ILOCK (1<<3) /* interlock change */ 197 1.1 bad #define TCIC_ICSR_STOPCPU (1<<2) /* Stop CPU was asserted */ 198 1.1 bad #define TCIC_ICSR_SET (1<<1) /* (w/o) enable writes that set bits */ 199 1.1 bad #define TCIC_ICSR_CLEAR (1<<0) /* (w/o) enable writes that clear */ 200 1.1 bad #define TCIC_ICSR_JAM (TCIC_ICSR_SET|TCIC_ICSR_CLEAR) 201 1.1 bad /* jam value into ICSR */ 202 1.1 bad 203 1.1 bad /* bits in the interrupt enable register */ 204 1.1 bad #define TCIC_IENA_CDCHG (1 << 6) /* enable INT when ICSR_CDCHG is set */ 205 1.1 bad #define TCIC_IENA_ERR (1 << 5) /* enable INT when ICSR_ERR is set */ 206 1.1 bad #define TCIC_IENA_PROGTIME (1 << 4) /* enable INT when ICSR_PROGTIME " */ 207 1.1 bad #define TCIC_IENA_ILOCK (1 << 3) /* enable INT when ICSR_ILOCK is set */ 208 1.1 bad #define TCIC_IENA_CFG_MASK (3 << 0) /* select the bits for IRQ config: */ 209 1.1 bad #define TCIC_IENA_CFG_OFF (0 << 0) /* IRQ is high-impedance */ 210 1.1 bad #define TCIC_IENA_CFG_OD (1 << 0) /* IRQ is active low, open drain. */ 211 1.1 bad #define TCIC_IENA_CFG_LOW (2 << 0) /* IRQ is active low, totem pole */ 212 1.1 bad #define TCIC_IENA_CFG_HIGH (3 << 0) /* IRQ is active high, totem pole */ 213 1.1 bad #define TCIC_IENA_RSVD 0x84 /* reserved bits, MBZ */ 214 1.1 bad 215 1.1 bad 216 1.1 bad /* 217 1.1 bad * Bits in the auxiliary registers 218 1.1 bad */ 219 1.1 bad 220 1.1 bad /* Bits in the timing control register (AR_TCTL) */ 221 1.1 bad #define TCIC_TCTL_6US_SHFT (0) /* the shift count for the 6 us ctr */ 222 1.1 bad #define TCIC_TCTL_10US_SHFT (8) /* the shift count for the 10 us ctr */ 223 1.1 bad #define TCIC_TCTL_6US_MASK (0xFF << TCIC_TCTL_6US_SHFT) 224 1.1 bad #define TCIC_TCTL_10US_MASK (0xFF << TCIC_TCTL_10US_SHFT) 225 1.1 bad 226 1.1 bad #define TCIC_R_TCTL_6US (TCIC_R_AUX + 0) /* the byte access handle */ 227 1.1 bad #define TCIC_R_TCTL_10US (TCIC_R_AUX + 1) /* the byte access handle */ 228 1.1 bad 229 1.1 bad /* Bits in the programming pulse register (AR_PCTL) */ 230 1.1 bad #define TCIC_R_PULSE_LO (TCIC_R_AUX + 0) 231 1.1 bad #define TCIC_R_PULSE_HI (TCIC_R_AUX + 1) 232 1.1 bad 233 1.1 bad /* Bits in the wait state control register (AR_WCTL) */ 234 1.1 bad #define TCIC_WAIT_COUNT_MASK (0x1F) /* the count of 1/2 wait states */ 235 1.1 bad #define TCIC_WAIT_COUNT_SHFT (0) /* the wait-count shift */ 236 1.1 bad #define TCIC_WAIT_SYNC (1 << 5) /* set for synch, clear for asynch cycles */ 237 1.1 bad #define TCIC_WAIT_ASYNC (0) 238 1.1 bad 239 1.1 bad #define TCIC_WAIT_SENSE (1 << 6) /* select rising (1) or falling (0) 240 1.1 bad * edge of wait clock as reference 241 1.1 bad * edge. 242 1.1 bad */ 243 1.1 bad #define TCIC_WAIT_SRC (1 << 7) /* select constant clock (0) or bus 244 1.1 bad * clock (1) as the timing source 245 1.1 bad */ 246 1.1 bad 247 1.1 bad /* Some derived constants */ 248 1.1 bad #define TCIC_WAIT_BCLK (1 * TCIC_WAIT_SRC) 249 1.1 bad #define TCIC_WAIT_CCLK (0 * TCIC_WAIT_SRC) 250 1.1 bad #define TCIC_WAIT_RISING (1 * TCIC_WAIT_SENSE) 251 1.1 bad #define TCIC_WAIT_FALLING (0 * TCIC_WAIT_SENSE) 252 1.1 bad 253 1.1 bad /* high byte */ 254 1.1 bad #define TCIC_WCTL_WR (1 << 8) /* control: pulse write */ 255 1.1 bad #define TCIC_WCTL_RD (1 << 9) /* control: pulse read */ 256 1.1 bad #define TCIC_WCTL_CE (1 << 10) /* control: pulse chip ena */ 257 1.1 bad #define TCIC_WCTL_LLBAT1 (1 << 11) /* status: latched LBAT1 */ 258 1.1 bad #define TCIC_WCTL_LLBAT2 (1 << 12) /* status: latched LBAT2 */ 259 1.1 bad #define TCIC_WCTL_LRDY (1 << 13) /* status: latched RDY */ 260 1.1 bad #define TCIC_WCTL_LWP (1 << 14) /* status: latched WP */ 261 1.1 bad #define TCIC_WCTL_LCD (1 << 15) /* status: latched CD */ 262 1.1 bad 263 1.1 bad /* The same thing, from a byte perspective */ 264 1.1 bad #define TCIC_R_WCTL_WAIT (TCIC_R_AUX + 0) /* the wait state control byte */ 265 1.1 bad #define TCIC_R_WCTL_XCSR (TCIC_R_AUX + 1) /* extended control/status */ 266 1.1 bad 267 1.1 bad #define TCIC_XCSR_WR (1 << 0) /* control: pulse write */ 268 1.1 bad #define TCIC_XCSR_RD (1 << 1) /* control: pulse read */ 269 1.1 bad #define TCIC_XCSR_CE (1 << 2) /* control: pulse chip ena */ 270 1.1 bad #define TCIC_XCSR_LLBAT1 (1 << 3) /* status: latched LBAT1 */ 271 1.1 bad #define TCIC_XCSR_LLBAT2 (1 << 4) /* status: latched LBAT2 */ 272 1.1 bad #define TCIC_XCSR_LRDY (1 << 5) /* status: latched RDY */ 273 1.1 bad #define TCIC_XCSR_LWP (1 << 6) /* status: latched WP */ 274 1.1 bad #define TCIC_XCSR_LCD (1 << 7) /* status: latched CD */ 275 1.1 bad #define TCIC_XCSR_STAT_MASK 0xf8 276 1.1 bad 277 1.1 bad /* Bits in the programming data register (AR_PDATA) */ 278 1.1 bad #define TCIC_R_PDATA_LO (TCIC_R_AUX + 0) 279 1.1 bad #define TCIC_R_PDATA_HI (TCIC_R_AUX + 1) 280 1.1 bad 281 1.1 bad /* Bits in the system configuration register (AR_SYSCFG) */ 282 1.1 bad /* 283 1.1 bad * The bottom four bits specify the steering of the socket IRQ. On 284 1.1 bad * the 2N, the socket IRQ is (by default) pointed at the dedicated 285 1.1 bad * pin. 286 1.1 bad */ 287 1.1 bad #define TCIC_SYSCFG_IRQ_MASK (0xF) /* mask for this bit field. */ 288 1.1 bad #define TCIC_SYSCFG_SSIRQDFLT (0) /* default: use SKTIRQ (2/N) 289 1.1 bad * disable (2/P) 290 1.1 bad */ 291 1.1 bad #define TCIC_SYSCFG_SSIRQ (0x1) /* use SKTIRQ (explicit) (2/N) 292 1.1 bad * do not use (2/P) 293 1.1 bad */ 294 1.1 bad #define TCIC_SYSCFG_SIRQ3 (0x3) /* use IRQ3 */ 295 1.1 bad #define TCIC_SYSCFG_SIRQ4 (0x4) /* use IRQ4 */ 296 1.1 bad #define TCIC_SYSCFG_SIRQ5 (0x5) /* use IRQ5 (2/N) */ 297 1.1 bad #define TCIC_SYSCFG_SIRQ6 (0x6) /* use IRQ6 (2/N) */ 298 1.1 bad #define TCIC_SYSCFG_SIRQ7 (0x7) /* use IRQ7 (2/N) */ 299 1.1 bad #define TCIC_SYSCFG_SIRQ10 (0xA) /* use IRQ10 */ 300 1.1 bad #define TCIC_SYSCFG_SIRQ14 (0xE) /* use IRQ14 */ 301 1.1 bad 302 1.1 bad #define TCIC_SYSCFG_MCSFULL (1 << 4) 303 1.1 bad /* 304 1.1 bad * If set, use full address (a[12:23]) for MCS16 generation. 305 1.1 bad * If clear, run in ISA-compatible mode (only using a[17:23]). 306 1.1 bad * With many chip sets, the TCIC-2/N's timing will will allow full 307 1.1 bad * address decoding to be used rather than limiting us to LA[17:23]; 308 1.1 bad * thus we can get around the ISA spec which limits the granularity 309 1.1 bad * of bus sizing to 128K blocks. 310 1.1 bad */ 311 1.1 bad #define TCIC_SYSCFG_IO1723 (1 << 5) 312 1.1 bad /* 313 1.1 bad * Flag indicating that LA[17:23] can be trusted to be zero during a 314 1.1 bad * true I/O cycle. Setting this bit will allow us to reduce power 315 1.1 bad * consumption further by eliminating I/O address broadcasts for 316 1.1 bad * memory cycles. 317 1.1 bad * 318 1.1 bad * Unfortunately, you cannot trust LA[17:23] to be zero on all systems, 319 1.1 bad * because the ISA specs do not require that LA[17:23] be zero when an 320 1.1 bad * alternate bus master runs an I/O cycle. However, on a palmtop or 321 1.1 bad * notebook, it is a good guess. 322 1.1 bad */ 323 1.1 bad 324 1.1 bad #define TCIC_SYSCFG_MCSXB (1 << 6) 325 1.1 bad /* 326 1.1 bad * If set, assume presence of an external buffer for MCS16: operate 327 1.1 bad * the driver as a totem-pole output. 328 1.3 perry * 329 1.1 bad * If clear, run in pseudo-ISA mode; output is open drain. But note 330 1.1 bad * that on the 082 the output buffers cannot drive a 300-ohm 331 1.1 bad * load. 332 1.1 bad */ 333 1.1 bad #define TCIC_SYSCFG_ICSXB (1 << 7) 334 1.1 bad /* 335 1.1 bad * If set, assume presence of an external buffer for IOCS16*; operate 336 1.1 bad * the buffer as a totem-pole output. 337 1.3 perry * 338 1.1 bad * If clear, run in pseudo-ISA mode; output is open drain. But note 339 1.1 bad * that on the 082 the output buffers cannot drive a 300-ohm 340 1.1 bad * load. 341 1.1 bad */ 342 1.1 bad #define TCIC_SYSCFG_NOPDN (1 << 8) 343 1.1 bad /* 344 1.1 bad * If set, disable the auto power-down sequencing. The chip will 345 1.1 bad * run card cycles somewhat more quickly (though perhaps not 346 1.1 bad * significantly so); but it will dissipate significantly more power. 347 1.3 perry * 348 1.1 bad * If clear, the low-power operating modes are enabled. This 349 1.1 bad * causes the part to go into low-power mode automatically at 350 1.1 bad * system reset. 351 1.1 bad */ 352 1.1 bad #define TCIC_SYSCFG_MPSEL_SHFT (9) 353 1.1 bad #define TCIC_SYSCFG_MPSEL_MASK (7 << 9) 354 1.1 bad /* 355 1.1 bad * This field controls the operation of the multipurpose pin on the 356 1.1 bad * 86082. It has the following codes: 357 1.1 bad */ 358 1.1 bad #define TCIC_SYSCFG_MPSEL_OFF (0 << TCIC_SYSCFG_MPSEL_SHFT) 359 1.1 bad /* 360 1.1 bad * This is the reset state; it indicates that the Multi-purpose 361 1.1 bad * pin is not used. The pin will be held in a high-impedance 362 1.1 bad * state. It can be read by monitoring SYSCFG_MPSENSE. 363 1.1 bad */ 364 1.1 bad #define TCIC_SYSCFG_MPSEL_NEEDCLK (1 << TCIC_SYSCFG_MPSEL_SHFT) 365 1.1 bad /* 366 1.1 bad * NMULTI is an output. 367 1.1 bad * External indication that CCLK or BCLK are needed in order 368 1.1 bad * to complete an internal operation. External logic can use 369 1.1 bad * this to control the clocks coming to the chip. 370 1.1 bad */ 371 1.1 bad #define TCIC_SYSCFG_MPSEL_MIO (2 << TCIC_SYSCFG_MPSEL_SHFT) 372 1.1 bad /* 373 1.1 bad * NMULTI is an input; it is an unambiguous M/IO signal, issued 374 1.1 bad * with timing similar to the LA[] lines. 375 1.1 bad */ 376 1.1 bad #define TCIC_SYSCFG_MPSEL_EXTSEL (3 << TCIC_SYSCFG_MPSEL_SHFT) 377 1.1 bad /* 378 1.1 bad * NMULTI is an output; it is the external register select 379 1.1 bad * pulse, generated whenever software attempts to access 380 1.1 bad * aux register AR_EXTRN. Of course, the 86082 will ignore 381 1.1 bad * writes to AR_EXTRN, and will float the data bus if 382 1.1 bad * the CPU reads from AR_EXTRN. 383 1.1 bad */ 384 1.1 bad 385 1.1 bad /* (4 << TCIC_SYSCFG_MPSEL_SHFT) is reserved */ 386 1.1 bad 387 1.1 bad #define TCIC_SYSCFG_MPSEL_RI (5 << TCIC_SYSCFG_MPSEL_SHFT) 388 1.1 bad /* 389 1.1 bad * NMULTI is an output; it indicates a RI (active-going) 390 1.1 bad * transition has occurred lately on a an appropriately- 391 1.1 bad * configured socket. The output is active low. 392 1.1 bad */ 393 1.1 bad /* 394 1.1 bad * Codes 4, 6 and 7 are reserved, and must NOT be output. It is 395 1.1 bad * indeed possibly hazardous to your system to encode values in 396 1.1 bad * this field that do not match your hardware! 397 1.1 bad */ 398 1.1 bad 399 1.1 bad /* 1 << 12 reserved */ 400 1.1 bad 401 1.1 bad #define TCIC_SYSCFG_MPSENSE (1 << 13) 402 1.1 bad /* 403 1.1 bad * This bit, when read, returns the sense of the multi-purpose pin. 404 1.1 bad */ 405 1.1 bad 406 1.1 bad #define TCIC_SYSCFG_AUTOBUSY (1 << 14) 407 1.1 bad /* 408 1.1 bad * This bit, when set, causes the busy led to be gated with the 409 1.1 bad * SYSCFG_ACC bit. When clear, the busy led reflects whether the 410 1.1 bad * socket is actually enabled. If AUTOBUSY is set and ACC is clear, 411 1.1 bad * then the busy light will be off, even if a socket is enabled. 412 1.1 bad * If AUTOBUSY is clear, then the busy light will be on if either 413 1.1 bad * socket is enabled. 414 1.3 perry * 415 1.1 bad * Note, that when in a programming mode, you should either clear this 416 1.1 bad * bit (causing the busy light to be on whenever the socket is enabled) 417 1.1 bad * or set both this bit and the ACC bit (causing the light to be on 418 1.1 bad * all the time). 419 1.3 perry * 420 1.1 bad * On the '084 and '184, this bit is per-socket. 421 1.1 bad */ 422 1.1 bad 423 1.3 perry #define TCIC_SYSCFG_ACC (1<<15) 424 1.1 bad /* 425 1.1 bad * This bit will be set automatically by the hardware whenever the CPU 426 1.1 bad * accesses data on a card. It can be cleared under software control. 427 1.3 perry * 428 1.1 bad * In AUTOBUSY mode, it has the additional effect of turning on the 429 1.1 bad * busy light. 430 1.3 perry * 431 1.1 bad * Since we'll tristate the command lines as the card is going out of 432 1.1 bad * the socket, and since the shared lines idle low, there's no real 433 1.1 bad * danger if the busy light is off even though the socket is enabled. 434 1.3 perry * 435 1.1 bad * On the '084 and '184, this bit is per-socket. 436 1.1 bad */ 437 1.1 bad 438 1.1 bad 439 1.1 bad /* Bits in the ilock aux. register. */ 440 1.1 bad #define TCIC_ILOCK_OUT (1 << 0) /* interlock output 441 1.1 bad * per-socket on x84 442 1.1 bad */ 443 1.1 bad #define TCIC_ILOCK_SENSE (1 << 1) /* (r/o) interlock sense 444 1.1 bad * 0 -> /cilock not asserted; 445 1.1 bad * 1 -> /cilock is asserted. 446 1.1 bad * per-socket on x84. 447 1.1 bad */ 448 1.1 bad #define TCIC_ILOCK_CRESET (1 << 2) /* card reset output level(S) */ 449 1.1 bad #define TCIC_ILOCK_CRESENA (1 << 3) /* enable card reset output (S) */ 450 1.1 bad #define TCIC_ILOCK_CWAIT (1 << 4) /* enable card wait (S) */ 451 1.1 bad #define TCIC_ILOCK_CWAITSNS (1 << 5) /* (r/o) sense current state of wait 452 1.1 bad * 0 -> /cwait not asserted; 453 1.1 bad * 1 -> /cwait is asserted 454 1.1 bad * (S) 455 1.1 bad */ 456 1.1 bad /* The shift count & mask for the hold-time control */ 457 1.1 bad #define TCIC_ILOCK_HOLD_SHIFT 6 /* shift count for the hold-time ctl (G) */ 458 1.1 bad #define TCIC_ILOCK_HOLD_MASK (3 << TCIC_ILOCK_HOLD_SHIFT) 459 1.1 bad 460 1.1 bad /* 461 1.1 bad * Quick hold mode waits until we observe that the strobe is high, 462 1.1 bad * guaranteeing 10ns or so of hold time. 463 1.1 bad */ 464 1.1 bad #define TCIC_ILOCK_HOLD_QUICK (0 << TCIC_ILOCK_HOLD_SHIFT) 465 1.1 bad 466 1.1 bad /* 467 1.1 bad * CCLK hold mode waits (asynchronously) for an edge on CCLK. Minimum is 1 468 1.1 bad * CCLK + epsilon; maximum is 2 CCLKs + epsilon. 469 1.1 bad * 470 1.1 bad * for the 86081 & '82, this mode enables the multi-step 471 1.1 bad * sequencer that generates setup and hold times based on CCLK. This 472 1.1 bad * is the recommended mode of operation for the '81 and '82. 473 1.1 bad * 474 1.1 bad */ 475 1.1 bad #define TCIC_ILOCK_HOLD_CCLK (3 << TCIC_ILOCK_HOLD_SHIFT) 476 1.1 bad 477 1.1 bad /* The following bits are only present on the x84 and later parts */ 478 1.1 bad #define TCIC_ILOCK_INPACK (1 << 11) /* (r/o, S) this bit is a diagnostic 479 1.1 bad * read-back for card input 480 1.1 bad * acknowledge. 481 1.1 bad * The sense is inverted from 482 1.1 bad * the level at the pin. 483 1.1 bad */ 484 1.1 bad #define TCIC_ILOCK_CP0 (1 << 12) /* (r/o, S) this bit is a diagnostic 485 1.1 bad * monitor for card present pin 0. 486 1.1 bad * The sense is inverted from the 487 1.1 bad * level at the pin. 488 1.1 bad */ 489 1.1 bad #define TCIC_ILOCK_CP1 (1 << 13) /* (r/o, S) this bit is a diagnostic 490 1.1 bad * monitor for card present pin 1. 491 1.1 bad * The sense is inverted from the 492 1.1 bad * level at the pin. 493 1.1 bad */ 494 1.1 bad #define TCIC_ILOCK_VS1 (1 << 14) /* (r/o, S) this bit is the primary 495 1.1 bad * monitor for Card Voltage Sense 496 1.1 bad * pin 1. 497 1.1 bad * The sense is inverted from the 498 1.1 bad * level at the pin. 499 1.1 bad */ 500 1.1 bad #define TCIC_ILOCK_VS2 (1 << 15) /* (r/o, S) this bit is the primary 501 1.1 bad * monitor for Card Voltage Sense 502 1.1 bad * pin 2. 503 1.1 bad * The sense is inverted from the 504 1.1 bad * level at the pin. 505 1.1 bad */ 506 1.1 bad /* 507 1.1 bad * Silicon Version Register 508 1.1 bad * 509 1.1 bad * In diagnostic mode, the high byte of the interlock register is defined 510 1.1 bad * as the silicon identity byte. 511 1.3 perry * 512 1.1 bad * In order to read this byte, the chip must be placed in diagnostic 513 1.1 bad * mode by setting bit 15 of the TESTDIAG register. (This may or may 514 1.1 bad * not be enforced by the silicon.) 515 1.3 perry * 516 1.1 bad * The layout is: 517 1.3 perry * 518 1.1 bad * 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 519 1.1 bad * m <-------ID-------> <----ILOCK----> 520 1.3 perry * 521 1.1 bad * The fields are: 522 1.3 perry * 523 1.1 bad * m Always reset. 524 1.3 perry * 525 1.1 bad * ID This field is one of the following: 526 1.3 perry * 527 1.1 bad * 0x02 the db86082 528 1.1 bad * 0x03 the db86082a 529 1.1 bad * 0x04 the db86084 530 1.1 bad * 0x05 the DB86072ES, (Engineering Sample) 531 1.1 bad * 0x07 the db86082bES, (Engineering Sample) 532 1.1 bad * 0x08 the db86084a 533 1.1 bad * 0x14 the DB86184 534 1.1 bad * 0x15 the DB86072, (Production) 535 1.1 bad * 0x17 the db86082b, (Production) 536 1.1 bad */ 537 1.1 bad 538 1.1 bad /* 539 1.1 bad * Defines for Chip IDs described above. 540 1.1 bad * 541 1.1 bad * Use the following convention for defining TCIC_CHIPID_DBxxxxxY: 542 1.1 bad * 543 1.1 bad * TCIC_CHIPID_DBxxxxx_1 The First step of chip. 544 1.1 bad * TCIC_CHIPID_DBxxxxxA The Second step of chip. 545 1.1 bad * TCIC_CHIPID_DBxxxxxB The Third step of chip. 546 1.1 bad * TCIC_CHIPID_DBxxxxx... The ... step of chip. 547 1.1 bad * 548 1.1 bad * TCIC_CHIPID_DBxxxxx"step of chip"_ES An Engineering Sample of chip. 549 1.1 bad * 550 1.1 bad */ 551 1.1 bad #define TCIC_CHIPID_DB86082_1 (0x02) 552 1.1 bad #define TCIC_CHIPID_DB86082A (0x03) 553 1.1 bad #define TCIC_CHIPID_DB86082B_ES (0x07) 554 1.1 bad #define TCIC_CHIPID_DB86082B (0x17) 555 1.1 bad 556 1.1 bad #define TCIC_CHIPID_DB86084_1 (0x04) 557 1.1 bad #define TCIC_CHIPID_DB86084A (0x08) 558 1.1 bad 559 1.1 bad #define TCIC_CHIPID_DB86184_1 (0x14) 560 1.1 bad 561 1.1 bad #define TCIC_CHIPID_DB86072_1_ES (0x05) 562 1.1 bad #define TCIC_CHIPID_DB86072_1 (0x15) 563 1.1 bad 564 1.1 bad 565 1.1 bad /* the high order bits (in diag mode) give the chip version */ 566 1.1 bad #define TCIC_R_ILOCK_ID (TCIC_R_AUX + 1) 567 1.1 bad 568 1.1 bad #define TCIC_ILOCKTEST_ID_SHFT 8 /* the shift count */ 569 1.1 bad #define TCIC_ILOCKTEST_ID_MASK (0x7F << TCIC_ILOCKTEST_ID_SHFT) 570 1.1 bad /* the mask for the field */ 571 1.1 bad /* 572 1.1 bad * Use the following convention for defining TCIC_ILOCKTEST_DBxxxxxY: 573 1.1 bad * 574 1.1 bad * TCIC_ILOCKTEST_DBxxxxx_1 The First step of chip. 575 1.1 bad * TCIC_ILOCKTEST_DBxxxxxA The Second step of chip. 576 1.1 bad * TCIC_ILOCKTEST_DBxxxxxB The Third step of chip. 577 1.1 bad * TCIC_ILOCKTEST_DBxxxxx... The ... step of chip. 578 1.1 bad * 579 1.1 bad * TCIC_ILOCKTEST_DBxxxxx"step of chip"_ES An Engineering Sample of chip. 580 1.1 bad * 581 1.1 bad */ 582 1.1 bad #define TCIC_ILOCKTEST_TCIC2N_1 ((TCIC_CHIPID_DB86082_1) << TCIC_ILOCKTEST_ID_SHFT) 583 1.1 bad #define TCIC_ILOCKTEST_DB86082_1 TCIC_ILOCKTEST_TCIC2N_1 584 1.1 bad #define TCIC_ILOCKTEST_TCIC2N_2 ((TCIC_CHIPID_DB86082A) << TCIC_ILOCKTEST_ID_SHFT) 585 1.1 bad #define TCIC_ILOCKTEST_DB86082A TCIC_ILOCKTEST_TCIC2N_2 586 1.1 bad #define TCIC_ILOCKTEST_TCIC2N_3 ((TCIC_CHIPID_DB86082B_ES) << TCIC_ILOCKTEST_ID_SHFT) 587 1.1 bad #define TCIC_ILOCKTEST_DB86082B_ES TCIC_ILOCKTEST_TCIC2N_3 588 1.1 bad 589 1.1 bad #define TCIC_ILOCKTEST_DB86082B ((TCIC_CHIPID_DB86082B) << TCIC_ILOCKTEST_ID_SHFT) 590 1.1 bad 591 1.1 bad #define TCIC_ILOCKTEST_DB86084_1 ((TCIC_CHIPID_DB86084_1) << TCIC_ILOCKTEST_ID_SHFT) 592 1.1 bad #define TCIC_ILOCKTEST_DB86084A ((TCIC_CHIPID_DB86084A) << TCIC_ILOCKTEST_ID_SHFT) 593 1.1 bad 594 1.1 bad #define TCIC_ILOCKTEST_DB86184_1 ((TCIC_CHIPID_DB86184_1) << TCIC_ILOCKTEST_ID_SHFT) 595 1.1 bad 596 1.1 bad #define TCIC_ILOCKTEST_DB86072_1 ((TCIC_CHIPID_DB86072_1) << TCIC_ILOCKTEST_ID_SHFT) 597 1.1 bad #define TCIC_ILOCKTEST_DB86072_1_ES ((TCIC_CHIPID_DB86072_1_ES) << TCIC_ILOCKTEST_ID_SHFT) 598 1.1 bad 599 1.1 bad 600 1.1 bad /* Bits in the test control register (AR_TEST) */ 601 1.1 bad #define TCIC_R_TEST (TCIC_R_AUX + 0) 602 1.1 bad #define TCIC_TEST_AEN (1 << 0) /* force card AEN */ 603 1.1 bad #define TCIC_TEST_CEN (1 << 1) /* force card CEN */ 604 1.1 bad #define TCIC_TEST_CTR (1 << 2) /* test programming pulse, address ctrs */ 605 1.1 bad #define TCIC_TEST_ENA (1 << 3) /* force card-present (for test), and 606 1.1 bad * special VPP test mode 607 1.1 bad */ 608 1.1 bad #define TCIC_TEST_IO (1 << 4) /* feed back some I/O signals 609 1.1 bad * internally. 610 1.1 bad */ 611 1.1 bad #define TCIC_TEST_OUT1 (1 << 5) /* force special address output mode */ 612 1.1 bad #define TCIC_TEST_ZPB (1 << 6) /* enter ZPB test mode */ 613 1.1 bad #define TCIC_TEST_WAIT (1 << 7) /* force-enable WAIT pin */ 614 1.1 bad #define TCIC_TEST_PCTR (1 << 8) /* program counter in read-test mode */ 615 1.1 bad #define TCIC_TEST_VCTL (1 << 9) /* force-enable power-supply controls */ 616 1.1 bad #define TCIC_TEST_EXTA (1 << 10) /* external access doesn't override 617 1.1 bad || internal decoding. 618 1.1 bad */ 619 1.1 bad #define TCIC_TEST_DRIVECDB (1 << 11) /* drive the card data bus all the time */ 620 1.1 bad #define TCIC_TEST_ISTP (1 << 12) /* turn off CCLK to the interrupt CSR */ 621 1.1 bad #define TCIC_TEST_BSTP (1 << 13) /* turn off BCLK internal to the chip */ 622 1.1 bad #define TCIC_TEST_CSTP (1 << 14) /* turn off CCLK except to int CSR */ 623 1.1 bad #define TCIC_TEST_DIAG (1 << 15) /* enable diagnostic read-back mode */ 624 1.1 bad 625 1.1 bad /* Bits in the SCF1 register */ 626 1.1 bad #define TCIC_SCF1_IRQ_MASK (0xF) /* mask for this bit field */ 627 1.1 bad #define TCIC_SCF1_IRQOFF (0) /* disable */ 628 1.1 bad #define TCIC_SCF1_SIRQ (0x1) /* use SKTIRQ (2/N) */ 629 1.1 bad #define TCIC_SCF1_IRQ3 (0x3) /* use IRQ3 */ 630 1.1 bad #define TCIC_SCF1_IRQ4 (0x4) /* use IRQ4 */ 631 1.1 bad #define TCIC_SCF1_IRQ5 (0x5) /* use IRQ5 */ 632 1.1 bad #define TCIC_SCF1_IRQ6 (0x6) /* use IRQ6 */ 633 1.1 bad #define TCIC_SCF1_IRQ7 (0x7) /* use IRQ7 */ 634 1.1 bad #define TCIC_SCF1_IRQ9 (0x9) /* use IRQ9 */ 635 1.1 bad #define TCIC_SCF1_IRQ10 (0xA) /* use IRQ10 */ 636 1.1 bad #define TCIC_SCF1_IRQ11 (0xB) /* use IRQ11 */ 637 1.1 bad #define TCIC_SCF1_IRQ12 (0xC) /* use IRQ12 */ 638 1.1 bad #define TCIC_SCF1_IRQ14 (0xE) /* use IRQ14 */ 639 1.1 bad #define TCIC_SCF1_IRQ15 (0xF) /* use IRQ15 */ 640 1.1 bad 641 1.1 bad /* XXX doc bug? -chb */ 642 1.1 bad #define TCIC_SCF1_IRQOD (1 << 4) 643 1.1 bad #define TCIC_SCF1_IRQOC (0) /* selected IRQ is 644 1.1 bad * open-collector, and active 645 1.1 bad * low; otherwise it's totem- 646 1.1 bad * pole and active hi. 647 1.1 bad */ 648 1.1 bad #define TCIC_SCF1_PCVT (1 << 5) /* convert level-mode IRQ 649 1.1 bad * to pulse mode, or stretch 650 1.1 bad * pulses from card. 651 1.1 bad */ 652 1.1 bad #define TCIC_SCF1_IRDY (1 << 6) /* interrupt from RDY (not 653 1.1 bad * from /IREQ). Used with 654 1.1 bad * ATA drives. 655 1.1 bad */ 656 1.1 bad #define TCIC_SCF1_ATA (1 << 7) /* Special ATA drive mode. 657 1.1 bad * CEL/H become CE1/2 in 658 1.1 bad * the IDE sense; CEL is 659 1.1 bad * activated for even window 660 1.1 bad * matches, and CEH for 661 1.1 bad * odd window matches. 662 1.1 bad */ 663 1.1 bad #define TCIC_SCF1_DMA_SHIFT 8 /* offset to DMA selects; */ 664 1.1 bad #define TCIC_SCF1_DMA_MASK (0x7 << IRSCFG_DMA_SHIFT) 665 1.1 bad 666 1.1 bad #define TCIC_SCF1_DMAOFF (0 << IRSCFG_DMA_SHIFT) /* disable DMA */ 667 1.1 bad #define TCIC_SCF1_DREQ2 (2 << IRSCFG_DMA_SHIFT) /* enable DMA on DRQ2 */ 668 1.1 bad 669 1.1 bad #define TCIC_SCF1_IOSTS (1 << 11) /* enable I/O status mode; 670 1.1 bad * allows CIORD/CIOWR to 671 1.1 bad * become low-Z. 672 1.1 bad */ 673 1.1 bad #define TCIC_SCF1_SPKR (1 << 12) /* enable SPKR output from 674 1.1 bad * this card 675 1.1 bad */ 676 1.1 bad #define TCIC_SCF1_FINPACK (1 << 13) /* force card input 677 1.1 bad * acknowledge during I/O 678 1.1 bad * cycles. Has no effect 679 1.1 bad * if no windows map to card 680 1.1 bad */ 681 1.1 bad #define TCIC_SCF1_DELWR (1 << 14) /* force -all- data to 682 1.1 bad * meet 60ns setup time 683 1.1 bad * ("DELay WRite") 684 1.1 bad */ 685 1.1 bad #define TCIC_SCF1_HD7IDE (1 << 15) /* Enable special IDE 686 1.1 bad * data register mode: odd 687 1.1 bad * byte addresses in odd 688 1.1 bad * I/O windows will not 689 1.1 bad * drive HD7. 690 1.1 bad */ 691 1.1 bad 692 1.1 bad /* Bits in the scrf2 register */ 693 1.1 bad #define TCIC_SCF2_RI (1 << 0) /* enable RI pin from STSCHG 694 1.1 bad * (2/N) 695 1.1 bad `*/ 696 1.1 bad #define TCIC_SCF2_IDBR (1 << 1) /* force I/O data bus routing 697 1.1 bad * for this socket, regardless 698 1.1 bad * of cycle type. (2/N) 699 1.1 bad `*/ 700 1.1 bad #define TCIC_SCF2_MDBR (1 << 2) /* force memory window data 701 1.1 bad * bus routing for this 702 1.1 bad * socket, regardless of cycle 703 1.1 bad * type. (2/N) 704 1.1 bad */ 705 1.1 bad #define TCIC_SCF2_MLBAT1 (1 << 3) /* disable status change 706 1.1 bad * ints from LBAT1 (or 707 1.1 bad * "STSCHG" 708 1.1 bad */ 709 1.1 bad #define TCIC_SCF2_MLBAT2 (1 << 4) /* disable status change 710 1.1 bad * ints from LBAT2 (or "SPKR") 711 1.1 bad */ 712 1.1 bad #define TCIC_SCF2_MRDY (1 << 5) /* disable status change ints 713 1.1 bad * from RDY/BSY (or /IREQ). 714 1.1 bad * note that you get ints on 715 1.1 bad * both high- and low-going 716 1.1 bad * edges if this is enabled. 717 1.1 bad */ 718 1.1 bad #define TCIC_SCF2_MWP (1 << 6) /* disable status-change ints 719 1.1 bad * from WP (or /IOIS16). 720 1.1 bad * If you're using status 721 1.1 bad * change ints, you better set 722 1.1 bad * this once an I/O window is 723 1.1 bad * enabled, before accessing 724 1.1 bad * it. 725 1.1 bad */ 726 1.1 bad #define TCIC_SCF2_MCD (1 << 7) /* disable status-change ints 727 1.1 bad * from Card Detect. 728 1.1 bad */ 729 1.1 bad 730 1.1 bad /* 731 1.1 bad * note that these bits match the top 5 bits of the socket status register 732 1.1 bad * in order and sense. 733 1.1 bad */ 734 1.1 bad #define TCIC_SCF2_DMASRC_MASK (0x3 << 8) /* mask for this bit field */ 735 1.1 bad /*-- DMA Source --*/ 736 1.1 bad #define TCIC_SCF2_DRQ_BVD2 (0x0 << 8) /* BVD2 */ 737 1.1 bad #define TCIC_SCF2_DRQ_IOIS16 (0x1 << 8) /* IOIS16 */ 738 1.1 bad #define TCIC_SCF2_DRQ_INPACK (0x2 << 8) /* INPACK */ 739 1.1 bad #define TCIC_SCF2_DRQ_FORCE (0x3 << 8) /* Force it */ 740 1.1 bad 741 1.1 bad #define TCIC_SCFS2_RSVD (0xFC00) /* top 6 bits are RFU */ 742 1.1 bad 743 1.1 bad /* Bits in the MBASE window registers */ 744 1.1 bad #define TCIC_MBASE_4K (1 << 14) /* window size is 4K */ 745 1.1 bad #define TCIC_MBASE_ADDR_MASK 0x0fff /* bits holding the address */ 746 1.1 bad 747 1.1 bad /* Bits in the MMAP window registers */ 748 1.1 bad #define TCIC_MMAP_ATTR (1 << 15) /* map attr or common space */ 749 1.1 bad #define TCIC_MMAP_ADDR_MASK 0x3fff /* bits holding the address */ 750 1.1 bad 751 1.1 bad /* Bits in the MCTL window registers */ 752 1.1 bad #define TCIC_MCTL_ENA (1 << 15) /* enable this window */ 753 1.1 bad #define TCIC_MCTL_SS_SHIFT 12 754 1.1 bad #define TCIC_MCTL_SS_MASK (7 << TCIC_MCTL_SS_SHIFT) /* which socket does this window map to */ 755 1.1 bad #define TCIC_MCTL_B8 (1 << 11) /* 8/16 bit access select */ 756 1.1 bad #define TCIC_MCTL_EDC (1 << 10) /* do EDC calc. on access */ 757 1.1 bad #define TCIC_MCTL_KE (1 << 9) /* accesses are cacheable */ 758 1.1 bad #define TCIC_MCTL_ACC (1 << 8) /* window has been accessed */ 759 1.1 bad #define TCIC_MCTL_WP (1 << 7) /* window is write protected */ 760 1.1 bad #define TCIC_MCTL_QUIET (1 << 6) /* enable quiet socket mode */ 761 1.1 bad #define TCIC_MCTL_WSCNT_MASK 0x0f /* wait state counter */ 762 1.1 bad 763 1.1 bad /* Bits in the ICTL window registers */ 764 1.6 andvar #define TCIC_ICTL_ENA (1 << 15) /* enable this window */ 765 1.1 bad #define TCIC_ICTL_SS_SHIFT 12 766 1.1 bad #define TCIC_ICTL_SS_MASK (7 << TCIC_ICTL_SS_SHIFT) /* which socket does this window map to */ 767 1.1 bad #define TCIC_ICTL_AUTOSZ 0 /* auto size 8/16 bit acc. */ 768 1.1 bad #define TCIC_ICTL_B8 (1 << 11) /* all accesses 8 bit */ 769 1.1 bad #define TCIC_ICTL_B16 (1 << 10) /* all accesses 16 bit */ 770 1.1 bad #define TCIC_ICTL_ATA (3 << 10) /* special ATA mode */ 771 1.1 bad #define TCIC_ICTL_TINY (1 << 9) /* window size 1 byte */ 772 1.1 bad #define TCIC_ICTL_ACC (1 << 8) /* window has been accessed */ 773 1.1 bad #define TCIC_ICTL_1K (1 << 7) /* only 10 bits io decoding */ 774 1.1 bad #define TCIC_ICTL_QUIET (1 << 6) /* enable quiet socket mode */ 775 1.1 bad #define TCIC_ICTL_PASS16 (1 << 5) /* pass all 16 bits to card */ 776 1.1 bad #define TCIC_ICTL_WSCNT_MASK 0x0f /* wait state counter */ 777 1.1 bad 778 1.1 bad /* Various validity tests */ 779 1.1 bad /* 780 1.1 bad * From Databook sample source: 781 1.1 bad * MODE_AR_SYSCFG must have, with j = ***read*** (***, R_AUX) 782 1.1 bad * and k = (j>>9)&7: 783 1.1 bad * if (k&4) k == 5 784 1.1 bad * And also: 785 1.1 bad * j&0x0f is none of 2, 8, 9, b, c, d, f 786 1.1 bad * if (j&8) must have (j&3 == 2) 787 1.1 bad * Can't have j==2 788 1.1 bad */ 789 1.1 bad #if 0 790 1.1 bad /* this is from the Databook sample code and apparently is wrong */ 791 1.1 bad #define INVALID_AR_SYSCFG(x) ((((x)&0x1000) && (((x)&0x0c00) != 0x0200)) \ 792 1.1 bad || (((((x)&0x08) == 0) || (((x)&0x03) == 2)) \ 793 1.1 bad && ((x) != 0x02))) 794 1.1 bad #else 795 1.1 bad #define INVALID_AR_SYSCFG(x) ((((x)&0x0800) && (((x)&0x0600) != 0x0100)) \ 796 1.1 bad || ((((((x)&0x08) == 0) && (((x)&0x03) == 2)) \ 797 1.1 bad || (((x)&0x03) == 2)) \ 798 1.1 bad && ((x) != 0x02))) 799 1.1 bad #endif 800 1.1 bad /* AR_ILOCK must have bits 6 and 7 the same: */ 801 1.1 bad #define INVALID_AR_ILOCK(x) (((x)&0xc0)==0 || (((x)&0xc0)==0xc0)) 802 1.1 bad 803 1.1 bad /* AR_TEST has some reserved bits: */ 804 1.1 bad #define INVALID_AR_TEST(x) (((x)&0154) != 0) 805 1.1 bad 806 1.1 bad 807 1.1 bad #define TCIC_IO_WINS 2 808 1.1 bad #define TCIC_MAX_MEM_WINS 5 809 1.1 bad 810 1.1 bad /* 811 1.1 bad * Memory window addresses refer to bits A23-A12 of the ISA system memory 812 1.1 bad * address. This is a shift of 12 bits. The LSB contains A19-A12, and the 813 1.1 bad * MSB contains A23-A20, plus some other bits. 814 1.1 bad */ 815 1.1 bad 816 1.1 bad #define TCIC_MEM_SHIFT 12 817 1.1 bad #define TCIC_MEM_PAGESIZE (1<<TCIC_MEM_SHIFT) 818 1.1 bad 819 1.1 bad #endif /* _TCIC2REG_H */ 820