Fixed compatibility of output.
[AROS.git] / compiler / include / libraries / pccard.h
blob2a5c65c5809819a37dae4da2f1da82ca7a69bc8d
1 /*
2 Copyright © 2011, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #ifndef LIBRARIES_PCCARD_H
7 #define LIBRARIES_PCCARD_H
9 #ifndef EXEC_TYPES_H
10 #include <exec/types.h>
11 #endif
12 #ifndef UTILITY_TAGITEM_H
13 #include <utility/tagitem.h>
14 #endif
16 /* General */
17 /* ======= */
19 #define PCCARDNAME "pccard.library"
21 #define PCCARD_MAXTUPLESIZE 0xff
24 /* Tuple types */
25 /* =========== */
27 #define PCCARD_TPL_NULL 0x00
28 #define PCCARD_TPL_DEVICE 0x01
29 #define PCCARD_TPL_LONGLINKCB 0x02
30 #define PCCARD_TPL_CONFIGCB 0x04
31 #define PCCARD_TPL_CFTABLEENTRYCB 0x05
32 #define PCCARD_TPL_LONGLINKMFC 0x06
33 #define PCCARD_TPL_BAR 0x07
34 #define PCCARD_TPL_CHECKSUM 0x10
35 #define PCCARD_TPL_LONGLINKA 0x11
36 #define PCCARD_TPL_LONGLINKC 0x12
37 #define PCCARD_TPL_LINKTARGET 0x13
38 #define PCCARD_TPL_NOLINK 0x14
39 #define PCCARD_TPL_VERS1 0x15
40 #define PCCARD_TPL_ALTSTR 0x16
41 #define PCCARD_TPL_DEVICEA 0x17
42 #define PCCARD_TPL_JEDECC 0x18
43 #define PCCARD_TPL_JEDECA 0x19
44 #define PCCARD_TPL_CONFIG 0x1a
45 #define PCCARD_TPL_CFTABLEENTRY 0x1b
46 #define PCCARD_TPL_DEVICEOC 0x1c
47 #define PCCARD_TPL_DEVICEOA 0x1d
48 #define PCCARD_TPL_DEVICEGEO 0x1e
49 #define PCCARD_TPL_DEVICEGEOA 0x1f
50 #define PCCARD_TPL_MANFID 0x20
51 #define PCCARD_TPL_FUNCID 0x21
52 #define PCCARD_TPL_FUNCE 0x22
53 #define PCCARD_TPL_SWIL 0x23
54 #define PCCARD_TPL_END 0xff
55 #define PCCARD_TPL_VERS2 0x40
56 #define PCCARD_TPL_FORMAT 0x41
57 #define PCCARD_TPL_GEOMETRY 0x42
58 #define PCCARD_TPL_BYTEORDER 0x43
59 #define PCCARD_TPL_DATE 0x44
60 #define PCCARD_TPL_BATTERY 0x45
61 #define PCCARD_TPL_ORG 0x46
64 /* Tags for GetTupleTags() */
65 /* ======================= */
67 #define PCCARD_RegisterBase (TAG_USER+0)
68 #define PCCARD_ModeCount (TAG_USER+1)
69 #define PCCARD_ModeNo (TAG_USER+2)
70 #define PCCARD_Flags (TAG_USER+3)
71 #define PCCARD_IOFlags (TAG_USER+4)
72 #define PCCARD_IOLineCount (TAG_USER+5)
73 #define PCCARD_IOWinCount (TAG_USER+6)
74 #define PCCARD_IOWinBases (TAG_USER+7) /* Array of ULONGs */
75 #define PCCARD_IOWinLengths (TAG_USER+8) /* Array of ULONGs */
76 #define PCCARD_VCCPowerTags (TAG_USER+9)
77 #define PCCARD_VPP1PowerTags (TAG_USER+10)
78 #define PCCARD_VPP2PowerTags (TAG_USER+11)
79 #define PCCARD_NominalVoltage (TAG_USER+12)
80 #define PCCARD_MinVoltage (TAG_USER+13)
81 #define PCCARD_MaxVoltage (TAG_USER+14)
82 #define PCCARD_StaticCurrent (TAG_USER+15)
83 #define PCCARD_AverageCurrent (TAG_USER+16)
84 #define PCCARD_PeakCurrent (TAG_USER+17)
85 #define PCCARD_DownCurrent (TAG_USER+18)
86 #define PCCARD_Type (TAG_USER+19)
87 #define PCCARD_WaitTimingTags (TAG_USER+20)
88 #define PCCARD_ReadyTimingTags (TAG_USER+21)
89 #define PCCARD_ReservedTimingTags (TAG_USER+22)
90 #define PCCARD_Value (TAG_USER+23)
91 #define PCCARD_Scale (TAG_USER+24)
92 #define PCCARD_IRQFlags (TAG_USER+25)
93 #define PCCARD_IRQMask (TAG_USER+26)
94 #define PCCARD_MemWinCount (TAG_USER+27)
95 #define PCCARD_MemWinBases (TAG_USER+28) /* Array of ULONGs */
96 #define PCCARD_MemWinHostBases (TAG_USER+29) /* Array of ULONGs */
97 #define PCCARD_MemWinLengths (TAG_USER+30) /* Array of ULONGs */
98 #define PCCARD_MajorVersion (TAG_USER+31)
99 #define PCCARD_MinorVersion (TAG_USER+32)
100 #define PCCARD_InfoStringCount (TAG_USER+33)
101 #define PCCARD_InfoStrings (TAG_USER+34) /* Array of "TEXT *"s */
102 #define PCCARD_RegionCount (TAG_USER+35)
103 #define PCCARD_RegionLists (TAG_USER+36) /* Array of TagLists */
104 #define PCCARD_Speed (TAG_USER+37)
105 #define PCCARD_Base (TAG_USER+38)
106 #define PCCARD_Length (TAG_USER+39)
107 #define PCCARD_Maker (TAG_USER+40)
108 #define PCCARD_Product (TAG_USER+41)
111 /* Values used in tags */
112 /* =================== */
114 /* Types of memory region */
116 #define PCCARD_DTYPE_NULL 0x00
117 #define PCCARD_DTYPE_ROM 0x01
118 #define PCCARD_DTYPE_OTPROM 0x02
119 #define PCCARD_DTYPE_EPROM 0x03
120 #define PCCARD_DTYPE_EEPROM 0x04
121 #define PCCARD_DTYPE_FLASH 0x05
122 #define PCCARD_DTYPE_SRAM 0x06
123 #define PCCARD_DTYPE_DRAM 0x07
124 #define PCCARD_DTYPE_FUNCSPEC 0x0d
125 #define PCCARD_DTYPE_EXTEND 0x0e
127 /* Card Functions */
129 #define PCCARD_FUNC_MULTI 0x00
130 #define PCCARD_FUNC_MEMORY 0x01
131 #define PCCARD_FUNC_SERIAL 0x02
132 #define PCCARD_FUNC_PARALLEL 0x03
133 #define PCCARD_FUNC_FIXED 0x04
134 #define PCCARD_FUNC_VIDEO 0x05
135 #define PCCARD_FUNC_NETWORK 0x06
136 #define PCCARD_FUNC_AIMS 0x07
137 #define PCCARD_FUNC_SCSI 0x08
139 /* Flags in IRQFlags tag */
141 #define PCCARD_IRQB_NMI 0
142 #define PCCARD_IRQB_IOCK 1
143 #define PCCARD_IRQB_BERR 2
144 #define PCCARD_IRQB_VEND 3
145 #define PCCARD_IRQB_LEVEL 5
146 #define PCCARD_IRQB_PULSE 6
147 #define PCCARD_IRQB_SHARE 7
149 #define PCCARD_IRQF_NMI (1<<PCCARD_IRQB_NMI)
150 #define PCCARD_IRQF_IOCK (1<<PCCARD_IRQB_IOCK)
151 #define PCCARD_IRQF_BERR (1<<PCCARD_IRQB_BERR)
152 #define PCCARD_IRQF_VEND (1<<PCCARD_IRQB_VEND)
153 #define PCCARD_IRQF_LEVEL (1<<PCCARD_IRQB_LEVEL)
154 #define PCCARD_IRQF_PULSE (1<<PCCARD_IRQB_PULSE)
155 #define PCCARD_IRQF_SHARE (1<<PCCARD_IRQB_SHARE)
157 /* Flags for Device Regions */
159 #define PCCARD_REGIONB_WP 0
161 #define PCCARD_REGIONF_WP (1<<PCCARD_REGIONB_WP)
163 /* Flags in PCCARD_Flags tag for PCCARD_TPL_FUNCID */
165 #define PCCARD_SYSINITB_POST 0
166 #define PCCARD_SYSINITB_ROM 1
168 #define PCCARD_SYSINITF_POST (1<<PCCARD_SYSINITB_POST)
169 #define PCCARD_SYSINITF_ROM (1<<PCCARD_SYSINITB_ROM)
171 /* Flags in PCCARD_Flags tag for power tag lists */
173 #define PCCARD_POWERB_HIGHZOK 0
174 #define PCCARD_POWERB_HIGHZREQ 1
176 #define PCCARD_POWERF_HIGHZOK (1<<PCCARD_POWERB_HIGHZOK)
177 #define PCCARD_POWERF_HIGHZREQ (1<<PCCARD_POWERB_HIGHZREQ)
179 /* Flags in PCCARD_IOFlags tag */
181 #define PCCARD_IOB_8BIT 5
182 #define PCCARD_IOB_16BIT 6
184 #define PCCARD_IOF_8BIT (1<<PCCARD_IOB_8BIT)
185 #define PCCARD_IOF_16BIT (1<<PCCARD_IOB_16BIT)
187 /* Flags in PCCARD_Flags tag for PCCARD_TPL_CFTABLEENTRY */
189 #define PCCARD_CFTABLEB_DEFAULT 0
190 #define PCCARD_CFTABLEB_BVDS 1
191 #define PCCARD_CFTABLEB_WP 2
192 #define PCCARD_CFTABLEB_RDYBSY 3
193 #define PCCARD_CFTABLEB_MWAIT 4
194 #define PCCARD_CFTABLEB_AUDIO 11
195 #define PCCARD_CFTABLEB_READONLY 12
196 #define PCCARD_CFTABLEB_PWRDOWN 13
198 #define PCCARD_CFTABLEF_DEFAULT (1<<PCCARD_CFTABLEB_DEFAULT)
199 #define PCCARD_CFTABLEF_BVDS (1<<PCCARD_CFTABLEB_BVDS)
200 #define PCCARD_CFTABLEF_WP (1<<PCCARD_CFTABLEB_WP)
201 #define PCCARD_CFTABLEF_RDYBSY (1<<PCCARD_CFTABLEB_RDYBSY)
202 #define PCCARD_CFTABLEF_MWAIT (1<<PCCARD_CFTABLEB_MWAIT)
203 #define PCCARD_CFTABLEF_AUDIO (1<<PCCARD_CFTABLEB_AUDIO)
204 #define PCCARD_CFTABLEF_READONLY (1<<PCCARD_CFTABLEB_READONLY)
205 #define PCCARD_CFTABLEF_PWRDOWN (1<<PCCARD_CFTABLEB_PWRDOWN)
208 /* Registers */
209 /* ========= */
211 /* Register Offsets */
213 #define PCCARD_REG_COR 0x00
214 #define PCCARD_REG_CCSR 0x02
215 #define PCCARD_REG_PRR 0x04
216 #define PCCARD_REG_SCR 0x06
217 #define PCCARD_REG_ESR 0x08
218 #define PCCARD_REG_IOBASE0 0x0a
219 #define PCCARD_REG_IOBASE1 0x0c
220 #define PCCARD_REG_IOBASE2 0x0e
221 #define PCCARD_REG_IOBASE3 0x10
222 #define PCCARD_REG_IOSIZE 0x12
224 /* Configuration Option Register */
226 #define PCCARD_REG_CORB_FUNCENABLE 0
227 #define PCCARD_REG_CORB_ADDRDECODE 1
228 #define PCCARD_REG_CORB_IREQENABLE 2
229 #define PCCARD_REG_CORB_LEVELREQ 6
230 #define PCCARD_REG_CORB_SOFTRESET 7
232 #define PCCARD_REG_CORF_FUNCENABLE (1<<PCCARD_REG_CORB_FUNCENABLE)
233 #define PCCARD_REG_CORF_ADDRDECODE (1<<PCCARD_REG_CORB_ADDRDECODE)
234 #define PCCARD_REG_CORF_IREQENABLE (1<<PCCARD_REG_CORB_IREQENABLE)
235 #define PCCARD_REG_CORF_LEVELREQ (1<<PCCARD_REG_CORB_LEVELREQ)
236 #define PCCARD_REG_CORF_SOFTRESET (1<<PCCARD_REG_CORB_SOFTRESET)
238 #define PCCARD_REG_COR_CONFIGMASK 0x3f
239 #define PCCARD_REG_COR_MFCCONFIGMASK 0x38
241 /* Card Configuration and Status Register */
243 #define PCCARD_REG_CCSRB_INTACK 0
244 #define PCCARD_REG_CCSRB_INTPENDING 1
245 #define PCCARD_REG_CCSRB_POWERDOWN 2
246 #define PCCARD_REG_CCSRB_AUDIOENABLE 3
247 #define PCCARD_REG_CCSRB_IOIS8 5
248 #define PCCARD_REG_CCSRB_SIGCHGENABLE 6
249 #define PCCARD_REG_CCSRB_CHANGED 7
251 #define PCCARD_REG_CCSRF_INTACK (1<<PCCARD_REG_CCSRB_INTACK)
252 #define PCCARD_REG_CCSRF_INTPENDING (1<<PCCARD_REG_CCSRB_INTPENDING)
253 #define PCCARD_REG_CCSRF_POWERDOWN (1<<PCCARD_REG_CCSRB_POWERDOWN)
254 #define PCCARD_REG_CCSRF_AUDIOENABLE (1<<PCCARD_REG_CCSRB_AUDIOENABLE)
255 #define PCCARD_REG_CCSRF_IOIS8 (1<<PCCARD_REG_CCSRB_IOIS8)
256 #define PCCARD_REG_CCSRF_SIGCHGENABLE (1<<PCCARD_REG_CCSRB_SIGCHGENABLE)
257 #define PCCARD_REG_CCSRF_CHANGED (1<<PCCARD_REG_CCSRB_CHANGED)
259 /* Pin Replacement Register */
261 #define PCCARD_REG_PRRB_WPSTATUS 0
262 #define PCCARD_REG_PRRB_READYSTATUS 1
263 #define PCCARD_REG_PRRB_BVD2STATUS 2
264 #define PCCARD_REG_PRRB_BVD1STATUS 3
265 #define PCCARD_REG_PRRB_WPEVENT 4
266 #define PCCARD_REG_PRRB_READYEVENT 5
267 #define PCCARD_REG_PRRB_BVD2EVENT 6
268 #define PCCARD_REG_PRRB_BVD1EVENT 7
270 #define PCCARD_REG_PRRF_WPSTATUS (1<<PCCARD_REG_PRRB_WPSTATUS)
271 #define PCCARD_REG_PRRF_READYSTATUS (1<<PCCARD_REG_PRRB_READYSTATUS)
272 #define PCCARD_REG_PRRF_BVD2STATUS (1<<PCCARD_REG_PRRB_BVD2STATUS)
273 #define PCCARD_REG_PRRF_BVD1STATUS (1<<PCCARD_REG_PRRB_BVD1STATUS)
274 #define PCCARD_REG_PRRF_WPEVENT (1<<PCCARD_REG_PRRB_WPEVENT)
275 #define PCCARD_REG_PRRF_READYEVENT (1<<PCCARD_REG_PRRB_READYEVENT)
276 #define PCCARD_REG_PRRF_BVD2EVENT (1<<PCCARD_REG_PRRB_BVD2EVENT)
277 #define PCCARD_REG_PRRF_BVD1EVENT (1<<PCCARD_REG_PRRB_BVD1EVENT)
279 /* Socket and Copy Register */
281 #define PCCARD_REG_SCR_SOCKETNUMMASK 0x0f
282 #define PCCARD_REG_SCR_COPYNUMMASK 0x70
284 /* Extended Status Register */
286 #define PCCARD_REG_ESRB_REQATTNENABLE 0
287 #define PCCARD_REG_ESRB_REQATTN 4
289 #define PCCARD_REG_ESRF_REQATTNENABLE (1<<PCCARD_REG_ESRB_REQATTNENABLE)
290 #define PCCARD_REG_ESRF_REQATTN (1<<PCCARD_REG_ESRB_REQATTN)
293 #endif