Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * tcic.h 1.13 1999/10/25 20:03:34
0003  *
0004  * The contents of this file are subject to the Mozilla Public License
0005  * Version 1.1 (the "License"); you may not use this file except in
0006  * compliance with the License. You may obtain a copy of the License
0007  * at http://www.mozilla.org/MPL/
0008  *
0009  * Software distributed under the License is distributed on an "AS IS"
0010  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
0011  * the License for the specific language governing rights and
0012  * limitations under the License. 
0013  *
0014  * The initial developer of the original code is David A. Hinds
0015  * <dahinds@users.sourceforge.net>.  Portions created by David A. Hinds
0016  * are Copyright (C) 1999 David A. Hinds.  All Rights Reserved.
0017  *
0018  * Alternatively, the contents of this file may be used under the
0019  * terms of the GNU General Public License version 2 (the "GPL"), in which
0020  * case the provisions of the GPL are applicable instead of the
0021  * above.  If you wish to allow the use of your version of this file
0022  * only under the terms of the GPL and not to allow others to use
0023  * your version of this file under the MPL, indicate your decision by
0024  * deleting the provisions above and replace them with the notice and
0025  * other provisions required by the GPL.  If you do not delete the
0026  * provisions above, a recipient may use your version of this file
0027  * under either the MPL or the GPL.
0028  */
0029 
0030 #ifndef _LINUX_TCIC_H
0031 #define _LINUX_TCIC_H
0032 
0033 #define TCIC_BASE       0x240
0034 
0035 /* offsets of registers from TCIC_BASE */
0036 #define TCIC_DATA       0x00
0037 #define TCIC_ADDR       0x02
0038 #define TCIC_SCTRL      0x06
0039 #define TCIC_SSTAT      0x07
0040 #define TCIC_MODE       0x08
0041 #define TCIC_PWR        0x09
0042 #define TCIC_EDC        0x0A
0043 #define TCIC_ICSR       0x0C
0044 #define TCIC_IENA       0x0D
0045 #define TCIC_AUX        0x0E
0046 
0047 #define TCIC_SS_SHFT        12
0048 #define TCIC_SS_MASK        0x7000
0049 
0050 /* Flags for TCIC_ADDR */
0051 #define TCIC_ADR2_REG       0x8000
0052 #define TCIC_ADR2_INDREG    0x0800
0053 
0054 #define TCIC_ADDR_REG       0x80000000
0055 #define TCIC_ADDR_SS_SHFT   (TCIC_SS_SHFT+16)
0056 #define TCIC_ADDR_SS_MASK   (TCIC_SS_MASK<<16)
0057 #define TCIC_ADDR_INDREG    0x08000000
0058 #define TCIC_ADDR_IO        0x04000000
0059 #define TCIC_ADDR_MASK      0x03ffffff
0060 
0061 /* Flags for TCIC_SCTRL */
0062 #define TCIC_SCTRL_ENA      0x01
0063 #define TCIC_SCTRL_INCMODE  0x18
0064 #define TCIC_SCTRL_INCMODE_HOLD 0x00
0065 #define TCIC_SCTRL_INCMODE_WORD 0x08
0066 #define TCIC_SCTRL_INCMODE_REG  0x10
0067 #define TCIC_SCTRL_INCMODE_AUTO 0x18
0068 #define TCIC_SCTRL_EDCSUM   0x20
0069 #define TCIC_SCTRL_RESET    0x80
0070 
0071 /* Flags for TCIC_SSTAT */
0072 #define TCIC_SSTAT_6US      0x01
0073 #define TCIC_SSTAT_10US     0x02
0074 #define TCIC_SSTAT_PROGTIME 0x04
0075 #define TCIC_SSTAT_LBAT1    0x08
0076 #define TCIC_SSTAT_LBAT2    0x10
0077 #define TCIC_SSTAT_RDY      0x20    /* Inverted */
0078 #define TCIC_SSTAT_WP       0x40
0079 #define TCIC_SSTAT_CD       0x80    /* Card detect */
0080 
0081 /* Flags for TCIC_MODE */
0082 #define TCIC_MODE_PGMMASK   0x1f
0083 #define TCIC_MODE_NORMAL    0x00
0084 #define TCIC_MODE_PGMWR     0x01
0085 #define TCIC_MODE_PGMRD     0x02
0086 #define TCIC_MODE_PGMCE     0x04
0087 #define TCIC_MODE_PGMDBW    0x08
0088 #define TCIC_MODE_PGMWORD   0x10
0089 #define TCIC_MODE_AUXSEL_MASK   0xe0
0090 
0091 /* Registers accessed through TCIC_AUX, by setting TCIC_MODE */
0092 #define TCIC_AUX_TCTL       (0<<5)
0093 #define TCIC_AUX_PCTL       (1<<5)
0094 #define TCIC_AUX_WCTL       (2<<5)
0095 #define TCIC_AUX_EXTERN     (3<<5)
0096 #define TCIC_AUX_PDATA      (4<<5)
0097 #define TCIC_AUX_SYSCFG     (5<<5)
0098 #define TCIC_AUX_ILOCK      (6<<5)
0099 #define TCIC_AUX_TEST       (7<<5)
0100 
0101 /* Flags for TCIC_PWR */
0102 #define TCIC_PWR_VCC(sock)  (0x01<<(sock))
0103 #define TCIC_PWR_VCC_MASK   0x03
0104 #define TCIC_PWR_VPP(sock)  (0x08<<(sock))
0105 #define TCIC_PWR_VPP_MASK   0x18
0106 #define TCIC_PWR_CLIMENA    0x40
0107 #define TCIC_PWR_CLIMSTAT   0x80
0108 
0109 /* Flags for TCIC_ICSR */
0110 #define TCIC_ICSR_CLEAR     0x01
0111 #define TCIC_ICSR_SET       0x02
0112 #define TCIC_ICSR_JAM       (TCIC_ICSR_CLEAR|TCIC_ICSR_SET)
0113 #define TCIC_ICSR_STOPCPU   0x04
0114 #define TCIC_ICSR_ILOCK     0x08
0115 #define TCIC_ICSR_PROGTIME  0x10
0116 #define TCIC_ICSR_ERR       0x20
0117 #define TCIC_ICSR_CDCHG     0x40
0118 #define TCIC_ICSR_IOCHK     0x80
0119 
0120 /* Flags for TCIC_IENA */
0121 #define TCIC_IENA_CFG_MASK  0x03
0122 #define TCIC_IENA_CFG_OFF   0x00    /* disabled */
0123 #define TCIC_IENA_CFG_OD    0x01    /* active low, open drain */
0124 #define TCIC_IENA_CFG_LOW   0x02    /* active low, totem pole */
0125 #define TCIC_IENA_CFG_HIGH  0x03    /* active high, totem pole */
0126 #define TCIC_IENA_ILOCK     0x08
0127 #define TCIC_IENA_PROGTIME  0x10
0128 #define TCIC_IENA_ERR       0x20    /* overcurrent or iochk */
0129 #define TCIC_IENA_CDCHG     0x40
0130 
0131 /* Flags for TCIC_AUX_WCTL */
0132 #define TCIC_WAIT_COUNT_MASK    0x001f
0133 #define TCIC_WAIT_ASYNC     0x0020
0134 #define TCIC_WAIT_SENSE     0x0040
0135 #define TCIC_WAIT_SRC       0x0080
0136 #define TCIC_WCTL_WR        0x0100
0137 #define TCIC_WCTL_RD        0x0200
0138 #define TCIC_WCTL_CE        0x0400
0139 #define TCIC_WCTL_LLBAT1    0x0800
0140 #define TCIC_WCTL_LLBAT2    0x1000
0141 #define TCIC_WCTL_LRDY      0x2000
0142 #define TCIC_WCTL_LWP       0x4000
0143 #define TCIC_WCTL_LCD       0x8000
0144 
0145 /* Flags for TCIC_AUX_SYSCFG */
0146 #define TCIC_SYSCFG_IRQ_MASK    0x000f
0147 #define TCIC_SYSCFG_MCSFULL 0x0010
0148 #define TCIC_SYSCFG_IO1723  0x0020
0149 #define TCIC_SYSCFG_MCSXB   0x0040
0150 #define TCIC_SYSCFG_ICSXB   0x0080
0151 #define TCIC_SYSCFG_NOPDN   0x0100
0152 #define TCIC_SYSCFG_MPSEL_SHFT  9
0153 #define TCIC_SYSCFG_MPSEL_MASK  0x0e00
0154 #define TCIC_SYSCFG_MPSENSE 0x2000
0155 #define TCIC_SYSCFG_AUTOBUSY    0x4000
0156 #define TCIC_SYSCFG_ACC     0x8000
0157 
0158 #define TCIC_ILOCK_OUT      0x01
0159 #define TCIC_ILOCK_SENSE    0x02
0160 #define TCIC_ILOCK_CRESET   0x04
0161 #define TCIC_ILOCK_CRESENA  0x08
0162 #define TCIC_ILOCK_CWAIT    0x10
0163 #define TCIC_ILOCK_CWAITSNS 0x20
0164 #define TCIC_ILOCK_HOLD_MASK    0xc0
0165 #define TCIC_ILOCK_HOLD_CCLK    0xc0
0166 
0167 #define TCIC_ILOCKTEST_ID_SH    8
0168 #define TCIC_ILOCKTEST_ID_MASK  0x7f00
0169 #define TCIC_ILOCKTEST_MCIC_1   0x8000
0170 
0171 #define TCIC_ID_DB86082     0x02
0172 #define TCIC_ID_DB86082A    0x03
0173 #define TCIC_ID_DB86084     0x04
0174 #define TCIC_ID_DB86084A    0x08
0175 #define TCIC_ID_DB86072     0x15
0176 #define TCIC_ID_DB86184     0x14
0177 #define TCIC_ID_DB86082B    0x17
0178 
0179 #define TCIC_TEST_DIAG      0x8000
0180 
0181 /*
0182  * Indirectly addressed registers
0183  */
0184 
0185 #define TCIC_SCF1(sock) ((sock)<<3)
0186 #define TCIC_SCF2(sock) (((sock)<<3)+2)
0187 
0188 /* Flags for SCF1 */
0189 #define TCIC_SCF1_IRQ_MASK  0x000f
0190 #define TCIC_SCF1_IRQ_OFF   0x0000
0191 #define TCIC_SCF1_IRQOC     0x0010
0192 #define TCIC_SCF1_PCVT      0x0020
0193 #define TCIC_SCF1_IRDY      0x0040
0194 #define TCIC_SCF1_ATA       0x0080
0195 #define TCIC_SCF1_DMA_SHIFT 8
0196 #define TCIC_SCF1_DMA_MASK  0x0700
0197 #define TCIC_SCF1_DMA_OFF   0
0198 #define TCIC_SCF1_DREQ2     2
0199 #define TCIC_SCF1_IOSTS     0x0800
0200 #define TCIC_SCF1_SPKR      0x1000
0201 #define TCIC_SCF1_FINPACK   0x2000
0202 #define TCIC_SCF1_DELWR     0x4000
0203 #define TCIC_SCF1_HD7IDE    0x8000
0204 
0205 /* Flags for SCF2 */
0206 #define TCIC_SCF2_RI        0x0001
0207 #define TCIC_SCF2_IDBR      0x0002
0208 #define TCIC_SCF2_MDBR      0x0004
0209 #define TCIC_SCF2_MLBAT1    0x0008
0210 #define TCIC_SCF2_MLBAT2    0x0010
0211 #define TCIC_SCF2_MRDY      0x0020
0212 #define TCIC_SCF2_MWP       0x0040
0213 #define TCIC_SCF2_MCD       0x0080
0214 #define TCIC_SCF2_MALL      0x00f8
0215 
0216 /* Indirect addresses for memory window registers */
0217 #define TCIC_MWIN(sock,map) (0x100+(((map)+((sock)<<2))<<3))
0218 #define TCIC_MBASE_X        2
0219 #define TCIC_MMAP_X     4
0220 #define TCIC_MCTL_X     6
0221 
0222 #define TCIC_MBASE_4K_BIT   0x4000
0223 #define TCIC_MBASE_HA_SHFT  12
0224 #define TCIC_MBASE_HA_MASK  0x0fff
0225 
0226 #define TCIC_MMAP_REG       0x8000
0227 #define TCIC_MMAP_CA_SHFT   12
0228 #define TCIC_MMAP_CA_MASK   0x3fff
0229 
0230 #define TCIC_MCTL_WSCNT_MASK    0x001f
0231 #define TCIC_MCTL_WCLK      0x0020
0232 #define TCIC_MCTL_WCLK_CCLK 0x0000
0233 #define TCIC_MCTL_WCLK_BCLK 0x0020
0234 #define TCIC_MCTL_QUIET     0x0040
0235 #define TCIC_MCTL_WP        0x0080
0236 #define TCIC_MCTL_ACC       0x0100
0237 #define TCIC_MCTL_KE        0x0200
0238 #define TCIC_MCTL_EDC       0x0400
0239 #define TCIC_MCTL_B8        0x0800
0240 #define TCIC_MCTL_SS_SHFT   TCIC_SS_SHFT
0241 #define TCIC_MCTL_SS_MASK   TCIC_SS_MASK
0242 #define TCIC_MCTL_ENA       0x8000
0243 
0244 /* Indirect addresses for I/O window registers */
0245 #define TCIC_IWIN(sock,map) (0x200+(((map)+((sock)<<1))<<2))
0246 #define TCIC_IBASE_X        0
0247 #define TCIC_ICTL_X     2
0248 
0249 #define TCIC_ICTL_WSCNT_MASK    TCIC_MCTL_WSCNT_MASK
0250 #define TCIC_ICTL_QUIET     TCIC_MCTL_QUIET
0251 #define TCIC_ICTL_1K        0x0080
0252 #define TCIC_ICTL_PASS16    0x0100
0253 #define TCIC_ICTL_ACC       TCIC_MCTL_ACC
0254 #define TCIC_ICTL_TINY      0x0200
0255 #define TCIC_ICTL_B16       0x0400
0256 #define TCIC_ICTL_B8        TCIC_MCTL_B8
0257 #define TCIC_ICTL_BW_MASK   (TCIC_ICTL_B16|TCIC_ICTL_B8)
0258 #define TCIC_ICTL_BW_DYN    0
0259 #define TCIC_ICTL_BW_8      TCIC_ICTL_B8
0260 #define TCIC_ICTL_BW_16     TCIC_ICTL_B16
0261 #define TCIC_ICTL_BW_ATA    (TCIC_ICTL_B16|TCIC_ICTL_B8)
0262 #define TCIC_ICTL_SS_SHFT   TCIC_SS_SHFT
0263 #define TCIC_ICTL_SS_MASK   TCIC_SS_MASK
0264 #define TCIC_ICTL_ENA       TCIC_MCTL_ENA
0265 
0266 #endif /* _LINUX_TCIC_H */