pcmciareg.h revision 1.2 1 1.2 thorpej /* $NetBSD: pcmciareg.h,v 1.2 1997/10/16 23:27:38 thorpej Exp $ */
2 1.2 thorpej
3 1.2 thorpej /*
4 1.2 thorpej * Copyright (c) 1997 Marc Horowitz. All rights reserved.
5 1.2 thorpej *
6 1.2 thorpej * Redistribution and use in source and binary forms, with or without
7 1.2 thorpej * modification, are permitted provided that the following conditions
8 1.2 thorpej * are met:
9 1.2 thorpej * 1. Redistributions of source code must retain the above copyright
10 1.2 thorpej * notice, this list of conditions and the following disclaimer.
11 1.2 thorpej * 2. Redistributions in binary form must reproduce the above copyright
12 1.2 thorpej * notice, this list of conditions and the following disclaimer in the
13 1.2 thorpej * documentation and/or other materials provided with the distribution.
14 1.2 thorpej * 3. All advertising materials mentioning features or use of this software
15 1.2 thorpej * must display the following acknowledgement:
16 1.2 thorpej * This product includes software developed by Marc Horowitz.
17 1.2 thorpej * 4. The name of the author may not be used to endorse or promote products
18 1.2 thorpej * derived from this software without specific prior written permission.
19 1.2 thorpej *
20 1.2 thorpej * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
21 1.2 thorpej * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
22 1.2 thorpej * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
23 1.2 thorpej * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
24 1.2 thorpej * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
25 1.2 thorpej * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 1.2 thorpej * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 1.2 thorpej * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 1.2 thorpej * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29 1.2 thorpej * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 1.2 thorpej */
31 1.2 thorpej
32 1.2 thorpej /* most of this is from the PCMCIA PC Card Standard, Release 2.1 */
33 1.2 thorpej
34 1.2 thorpej /*
35 1.2 thorpej * CIS Tuples
36 1.2 thorpej */
37 1.2 thorpej
38 1.2 thorpej /* Layer 1 Basic Compatibility Tuples */
39 1.2 thorpej #define PCMCIA_CISTPL_NULL 0x00
40 1.2 thorpej #define PCMCIA_CISTPL_DEVICE 0x01
41 1.2 thorpej #define PCMCIA_DTYPE_MASK 0xF0
42 1.2 thorpej #define PCMCIA_DTYPE_NULL 0x00
43 1.2 thorpej #define PCMCIA_DTYPE_ROM 0x10
44 1.2 thorpej #define PCMCIA_DTYPE_OTPROM 0x20
45 1.2 thorpej #define PCMCIA_DTYPE_EPROM 0x30
46 1.2 thorpej #define PCMCIA_DTYPE_EEPROM 0x40
47 1.2 thorpej #define PCMCIA_DTYPE_FLASH 0x50
48 1.2 thorpej #define PCMCIA_DTYPE_SRAM 0x60
49 1.2 thorpej #define PCMCIA_DTYPE_DRAM 0x70
50 1.2 thorpej #define PCMCIA_DTYPE_FUNCSPEC 0xD0
51 1.2 thorpej #define PCMCIA_DTYPE_EXTEND 0xE0
52 1.2 thorpej #define PCMCIA_DSPEED_MASK 0x07
53 1.2 thorpej #define PCMCIA_DSPEED_NULL 0x00
54 1.2 thorpej #define PCMCIA_DSPEED_250NS 0x01
55 1.2 thorpej #define PCMCIA_DSPEED_200NS 0x02
56 1.2 thorpej #define PCMCIA_DSPEED_150NS 0x03
57 1.2 thorpej #define PCMCIA_DSPEED_100NS 0x04
58 1.2 thorpej #define PCMCIA_DSPEED_EXT 0x05
59 1.2 thorpej
60 1.2 thorpej /*
61 1.2 thorpej * the 2.1 docs have 0x02-0x07 as reserved, but the linux drivers list the
62 1.2 thorpej * follwing tuple code values. I have at least one card (3com 3c562
63 1.2 thorpej * lan+modem) which has a code 0x06 tuple, so I'm going to assume that these
64 1.2 thorpej * are for real
65 1.2 thorpej */
66 1.2 thorpej
67 1.2 thorpej #define PCMCIA_CISTPL_LONGLINK_CB 0x02
68 1.2 thorpej #define PCMCIA_CISTPL_CONFIG_CB 0x04
69 1.2 thorpej #define PCMCIA_CISTPL_CFTABLE_ENTRY_CB 0x05
70 1.2 thorpej #define PCMCIA_CISTPL_LONGLINK_MFC 0x06
71 1.2 thorpej #define PCMCIA_MFC_MEM_ATTR 0x00
72 1.2 thorpej #define PCMCIA_MFC_MEM_COMMON 0x01
73 1.2 thorpej #define PCMCIA_CISTPL_BAR 0x07
74 1.2 thorpej
75 1.2 thorpej #define PCMCIA_CISTPL_CHECKSUM 0x10
76 1.2 thorpej #define PCMCIA_CISTPL_LONGLINK_A 0x11
77 1.2 thorpej #define PCMCIA_CISTPL_LONGLINK_C 0x12
78 1.2 thorpej #define PCMCIA_CISTPL_LINKTARGET 0x13
79 1.2 thorpej #define PCMCIA_CISTPL_NO_LINK 0x14
80 1.2 thorpej #define PCMCIA_CISTPL_VERS_1 0x15
81 1.2 thorpej #define PCMCIA_CISTPL_ALTSTR 0x16
82 1.2 thorpej #define PCMCIA_CISTPL_DEVICE_A 0x17
83 1.2 thorpej #define PCMCIA_CISTPL_JEDEC_C 0x18
84 1.2 thorpej #define PCMCIA_CISTPL_JEDEC_A 0x19
85 1.2 thorpej #define PCMCIA_CISTPL_CONFIG 0x1A
86 1.2 thorpej #define PCMCIA_TPCC_RASZ_MASK 0x03
87 1.2 thorpej #define PCMCIA_TPCC_RASZ_SHIFT 0
88 1.2 thorpej #define PCMCIA_TPCC_RMSZ_MASK 0x3C
89 1.2 thorpej #define PCMCIA_TPCC_RMSZ_SHIFT 2
90 1.2 thorpej #define PCMCIA_TPCC_RFSZ_MASK 0xC0
91 1.2 thorpej #define PCMCIA_TPCC_RFSZ_SHIFT 6
92 1.2 thorpej #define PCMCIA_CISTPL_CFTABLE_ENTRY 0x1B
93 1.2 thorpej #define PCMCIA_TPCE_INDX_INTFACE 0x80
94 1.2 thorpej #define PCMCIA_TPCE_INDX_DEFAULT 0x40
95 1.2 thorpej #define PCMCIA_TPCE_INDX_NUM_MASK 0x3F
96 1.2 thorpej #define PCMCIA_TPCE_IF_MWAIT 0x80
97 1.2 thorpej #define PCMCIA_TPCE_IF_RDYBSY 0x40
98 1.2 thorpej #define PCMCIA_TPCE_IF_WP 0x20
99 1.2 thorpej #define PCMCIA_TPCE_IF_BVD 0x10
100 1.2 thorpej #define PCMCIA_TPCE_IF_IFTYPE 0x0F
101 1.2 thorpej #define PCMCIA_IFTYPE_MEMORY 0
102 1.2 thorpej #define PCMCIA_IFTYPE_IO 1
103 1.2 thorpej #define PCMCIA_TPCE_FS_MISC 0x80
104 1.2 thorpej #define PCMCIA_TPCE_FS_MEMSPACE_MASK 0x60
105 1.2 thorpej #define PCMCIA_TPCE_FS_MEMSPACE_NONE 0x00
106 1.2 thorpej #define PCMCIA_TPCE_FS_MEMSPACE_LENGTH 0x20
107 1.2 thorpej #define PCMCIA_TPCE_FS_MEMSPACE_LENGTHADDR 0x40
108 1.2 thorpej #define PCMCIA_TPCE_FS_MEMSPACE_TABLE 0x60
109 1.2 thorpej #define PCMCIA_TPCE_FS_IRQ 0x10
110 1.2 thorpej #define PCMCIA_TPCE_FS_IOSPACE 0x08
111 1.2 thorpej #define PCMCIA_TPCE_FS_TIMING 0x04
112 1.2 thorpej #define PCMCIA_TPCE_FS_POWER_MASK 0x03
113 1.2 thorpej #define PCMCIA_TPCE_FS_POWER_NONE 0x00
114 1.2 thorpej #define PCMCIA_TPCE_FS_POWER_VCC 0x01
115 1.2 thorpej #define PCMCIA_TPCE_FS_POWER_VCCVPP1 0x02
116 1.2 thorpej #define PCMCIA_TPCE_FS_POWER_VCCVPP1VPP2 0x03
117 1.2 thorpej #define PCMCIA_TPCE_TD_RESERVED_MASK 0xE0
118 1.2 thorpej #define PCMCIA_TPCE_TD_RDYBSY_MASK 0x1C
119 1.2 thorpej #define PCMCIA_TPCE_TD_WAIT_MASK 0x03
120 1.2 thorpej #define PCMCIA_TPCE_IO_HASRANGE 0x80
121 1.2 thorpej #define PCMCIA_TPCE_IO_BUSWIDTH_16BIT 0x40
122 1.2 thorpej #define PCMCIA_TPCE_IO_BUSWIDTH_8BIT 0x20
123 1.2 thorpej #define PCMCIA_TPCE_IO_IOADDRLINES_MASK 0x1F
124 1.2 thorpej #define PCMCIA_TPCE_IO_RANGE_LENGTHSIZE_MASK 0xC0
125 1.2 thorpej #define PCMCIA_TPCE_IO_RANGE_LENGTHSIZE_NONE 0x00
126 1.2 thorpej #define PCMCIA_TPCE_IO_RANGE_LENGTHSIZE_ONE 0x40
127 1.2 thorpej #define PCMCIA_TPCE_IO_RANGE_LENGTHSIZE_TWO 0x80
128 1.2 thorpej #define PCMCIA_TPCE_IO_RANGE_LENGTHSIZE_FOUR 0xC0
129 1.2 thorpej #define PCMCIA_TPCE_IO_RANGE_ADDRSIZE_MASK 0x30
130 1.2 thorpej #define PCMCIA_TPCE_IO_RANGE_ADDRSIZE_NONE 0x00
131 1.2 thorpej #define PCMCIA_TPCE_IO_RANGE_ADDRSIZE_ONE 0x10
132 1.2 thorpej #define PCMCIA_TPCE_IO_RANGE_ADDRSIZE_TWO 0x20
133 1.2 thorpej #define PCMCIA_TPCE_IO_RANGE_ADDRSIZE_FOUR 0x30
134 1.2 thorpej #define PCMCIA_TPCE_IO_RANGE_COUNT 0x0F
135 1.2 thorpej #define PCMCIA_TPCE_IR_SHARE 0x80
136 1.2 thorpej #define PCMCIA_TPCE_IR_PULSE 0x40
137 1.2 thorpej #define PCMCIA_TPCE_IR_LEVEL 0x20
138 1.2 thorpej #define PCMCIA_TPCE_IR_HASMASK 0x10
139 1.2 thorpej #define PCMCIA_TPCE_IR_IRQ 0x0F
140 1.2 thorpej #define PCMCIA_TPCE_MS_HOSTADDR 0x80
141 1.2 thorpej #define PCMCIA_TPCE_MS_CARDADDR_SIZE_MASK 0x60
142 1.2 thorpej #define PCMCIA_TPCE_MS_CARDADDR_SIZE_SHIFT 5
143 1.2 thorpej #define PCMCIA_TPCE_MS_LENGTH_SIZE_MASK 0x18
144 1.2 thorpej #define PCMCIA_TPCE_MS_LENGTH_SIZE_SHIFT 3
145 1.2 thorpej #define PCMCIA_TPCE_MS_COUNT 0x07
146 1.2 thorpej #define PCMCIA_TPCE_MI_EXT 0x80
147 1.2 thorpej #define PCMCIA_TPCE_MI_RESERVED 0x40
148 1.2 thorpej #define PCMCIA_TPCE_MI_PWRDOWN 0x20
149 1.2 thorpej #define PCMCIA_TPCE_MI_READONLY 0x10
150 1.2 thorpej #define PCMCIA_TPCE_MI_AUDIO 0x08
151 1.2 thorpej #define PCMCIA_TPCE_MI_MAXTWINS 0x07
152 1.2 thorpej #define PCMCIA_CISTPL_DEVICE_OC 0x1C
153 1.2 thorpej #define PCMCIA_CISTPL_DEVICE_OA 0x1D
154 1.2 thorpej #define PCMCIA_CISTPL_DEVICE_GEO 0x1E
155 1.2 thorpej #define PCMCIA_CISTPL_DEVICE_GEO_A 0x1F
156 1.2 thorpej
157 1.2 thorpej /* Layer 2 Data Recording Format Tuples */
158 1.2 thorpej
159 1.2 thorpej #define PCMCIA_CISTPL_MANFID 0x20
160 1.2 thorpej #define PCMCIA_CISTPL_FUNCID 0x21
161 1.2 thorpej #define PCMCIA_CISTPL_FUNCE 0x22
162 1.2 thorpej #define PCMCIA_CISTPL_SWIL 0x23
163 1.2 thorpej /* #define PCMCIA_CISTPL_RESERVED 0x24-0x3F */
164 1.2 thorpej #define PCMCIA_CISTPL_VERS_2 0x40
165 1.2 thorpej #define PCMCIA_CISTPL_FORMAT 0x41
166 1.2 thorpej #define PCMCIA_CISTPL_GEOMETRY 0x42
167 1.2 thorpej #define PCMCIA_CISTPL_BYTEORDER 0x43
168 1.2 thorpej #define PCMCIA_CISTPL_DATE 0x44
169 1.2 thorpej #define PCMCIA_CISTPL_BATTERY 0x45
170 1.2 thorpej
171 1.2 thorpej /* Layer 3 Data Organization Tuples */
172 1.2 thorpej
173 1.2 thorpej #define PCMCIA_CISTPL_ORG 0x46
174 1.2 thorpej /* #define PCMCIA_CISTPL_RESERVED 0x47-0x7F */
175 1.2 thorpej
176 1.2 thorpej /* Layer 4 System-Specific Standard Tuples */
177 1.2 thorpej
178 1.2 thorpej /* #define PCMCIA_CISTPL_RESERVED 0x80-0xFE */
179 1.2 thorpej #define PCMCIA_CISTPL_END 0xFF
180 1.2 thorpej
181 1.2 thorpej /*
182 1.2 thorpej * Card Configuration Registers
183 1.2 thorpej */
184 1.2 thorpej
185 1.2 thorpej #define PCMCIA_CCR_OPTION 0x00
186 1.2 thorpej #define PCMCIA_CCR_OPTION_SRESET 0x80
187 1.2 thorpej #define PCMCIA_CCR_OPTION_LEVIREQ 0x40
188 1.2 thorpej #define PCMCIA_CCR_OPTION_CFINDEX 0x3F
189 1.2 thorpej #define PCMCIA_CCR_OPTION_IREQ_ENABLE 0x04
190 1.2 thorpej #define PCMCIA_CCR_OPTION_ADDR_DECODE 0x02
191 1.2 thorpej #define PCMCIA_CCR_OPTION_FUNC_ENABLE 0x01
192 1.2 thorpej #define PCMCIA_CCR_STATUS 0x02
193 1.2 thorpej #define PCMCIA_CCR_STATUS_PINCHANGED 0x80
194 1.2 thorpej #define PCMCIA_CCR_STATUS_SIGCHG 0x40
195 1.2 thorpej #define PCMCIA_CCR_STATUS_IOIS8 0x20
196 1.2 thorpej #define PCMCIA_CCR_STATUS_RESERVED1 0x10
197 1.2 thorpej #define PCMCIA_CCR_STATUS_AUDIO 0x08
198 1.2 thorpej #define PCMCIA_CCR_STATUS_PWRDWN 0x04
199 1.2 thorpej #define PCMCIA_CCR_STATUS_INTR 0x02
200 1.2 thorpej #define PCMCIA_CCR_STATUS_INTRACK 0x01
201 1.2 thorpej #define PCMCIA_CCR_PIN 0x04
202 1.2 thorpej #define PCMCIA_CCR_PIN_CBVD1 0x80
203 1.2 thorpej #define PCMCIA_CCR_PIN_CBVD2 0x40
204 1.2 thorpej #define PCMCIA_CCR_PIN_CRDYBSY 0x20
205 1.2 thorpej #define PCMCIA_CCR_PIN_CWPROT 0x10
206 1.2 thorpej #define PCMCIA_CCR_PIN_RBVD1 0x08
207 1.2 thorpej #define PCMCIA_CCR_PIN_RBVD2 0x04
208 1.2 thorpej #define PCMCIA_CCR_PIN_RRDYBSY 0x02
209 1.2 thorpej #define PCMCIA_CCR_PIN_RWPROT 0x01
210 1.2 thorpej #define PCMCIA_CCR_SOCKETCOPY 0x06
211 1.2 thorpej #define PCMCIA_CCR_SOCKETCOPY_RESERVED 0x80
212 1.2 thorpej #define PCMCIA_CCR_SOCKETCOPY_COPY_MASK 0x70
213 1.2 thorpej #define PCMCIA_CCR_SOCKETCOPY_COPY_SHIFT 4
214 1.2 thorpej #define PCMCIA_CCR_SOCKETCOPY_SOCKET_MASK 0x0F
215 1.2 thorpej #define PCMCIA_CCR_IOBASE0 0x0A
216 1.2 thorpej #define PCMCIA_CCR_IOBASE1 0x0C
217 1.2 thorpej #define PCMCIA_CCR_IOBASE2 0x0E
218 1.2 thorpej #define PCMCIA_CCR_IOBASE3 0x10
219 1.2 thorpej #define PCMCIA_CCR_IOSIZE 0x12
220 1.2 thorpej
221 1.2 thorpej #define PCMCIA_CCR_SIZE 0x14
222