ata-pci.h revision 176891
1111188Ssos/*-
2165759Ssos * Copyright (c) 2003 - 2007 S�ren Schmidt <sos@FreeBSD.org>
3111188Ssos * All rights reserved.
4111188Ssos *
5111188Ssos * Redistribution and use in source and binary forms, with or without
6111188Ssos * modification, are permitted provided that the following conditions
7111188Ssos * are met:
8111188Ssos * 1. Redistributions of source code must retain the above copyright
9111188Ssos *    notice, this list of conditions and the following disclaimer,
10111188Ssos *    without modification, immediately at the beginning of the file.
11111188Ssos * 2. Redistributions in binary form must reproduce the above copyright
12111188Ssos *    notice, this list of conditions and the following disclaimer in the
13111188Ssos *    documentation and/or other materials provided with the distribution.
14111188Ssos *
15111188Ssos * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16111188Ssos * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17111188Ssos * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18111188Ssos * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19111188Ssos * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20111188Ssos * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21111188Ssos * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22111188Ssos * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23111188Ssos * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24111188Ssos * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25111188Ssos *
26111188Ssos * $FreeBSD: head/sys/dev/ata/ata-pci.h 176891 2008-03-07 09:29:19Z sos $
27111188Ssos */
28111188Ssos
29111188Ssos/* structure holding chipset config info */
30111188Ssosstruct ata_chip_id {
31144330Ssos    u_int32_t           chipid;
32144330Ssos    u_int8_t            chiprev;
33144330Ssos    int                 cfg1;
34144330Ssos    int                 cfg2;
35144330Ssos    u_int8_t            max_dma;
36144330Ssos    char                *text;
37111188Ssos};
38111188Ssos
39111188Ssos/* structure describing a PCI ATA controller */
40111188Ssosstruct ata_pci_controller {
41144330Ssos    device_t            dev;
42144330Ssos    int                 r_type1;
43144330Ssos    int                 r_rid1;
44144330Ssos    struct resource     *r_res1;
45144330Ssos    int                 r_type2;
46144330Ssos    int                 r_rid2;
47144330Ssos    struct resource     *r_res2;
48144330Ssos    struct resource     *r_irq;
49144330Ssos    void                *handle;
50144330Ssos    struct ata_chip_id  *chip;
51144330Ssos    int                 channels;
52144330Ssos    int                 (*chipinit)(device_t);
53144667Ssos    int                 (*allocate)(device_t);
54145713Ssos    int                 (*locking)(device_t, int);
55145713Ssos    void                (*reset)(device_t);
56145713Ssos    void                (*dmainit)(device_t);
57145713Ssos    void                (*setmode)(device_t, int);
58111188Ssos    struct {
59144330Ssos    void                (*function)(void *);
60144330Ssos    void                *argument;
61146178Ssos    } interrupt[8];     /* XXX SOS max ch# for now */
62111188Ssos};
63111188Ssos
64144330Ssos/* structure for SATA connection update hotplug/hotswap support */
65144330Ssosstruct ata_connect_task {
66144330Ssos    struct task task;
67144330Ssos    device_t    dev;
68144330Ssos    int         action;
69144330Ssos#define ATA_C_ATTACH    1
70144330Ssos#define ATA_C_DETACH    2
71144330Ssos};
72144330Ssos
73111188Ssos/* defines for known chipset PCI id's */
74144330Ssos#define ATA_ACARD_ID            0x1191
75144330Ssos#define ATA_ATP850              0x00021191
76144330Ssos#define ATA_ATP850A             0x00041191
77144330Ssos#define ATA_ATP850R             0x00051191
78144330Ssos#define ATA_ATP860A             0x00061191
79144330Ssos#define ATA_ATP860R             0x00071191
80144330Ssos#define ATA_ATP865A             0x00081191
81144330Ssos#define ATA_ATP865R             0x00091191
82111188Ssos
83144330Ssos#define ATA_AMD_ID              0x1022
84144330Ssos#define ATA_AMD755              0x74011022
85144330Ssos#define ATA_AMD756              0x74091022
86144330Ssos#define ATA_AMD766              0x74111022
87144330Ssos#define ATA_AMD768              0x74411022
88144330Ssos#define ATA_AMD8111             0x74691022
89172436Sphk#define ATA_AMD5536             0x209a1022
90111188Ssos
91144330Ssos#define ATA_ACER_LABS_ID        0x10b9
92154515Ssos#define ATA_ALI_1533            0x153310b9
93144330Ssos#define ATA_ALI_5229            0x522910b9
94145713Ssos#define ATA_ALI_5281            0x528110b9
95145713Ssos#define ATA_ALI_5287            0x528710b9
96146112Ssos#define ATA_ALI_5288            0x528810b9
97145713Ssos#define ATA_ALI_5289            0x528910b9
98111188Ssos
99154515Ssos#define ATA_ATI_ID              0x1002
100154515Ssos#define ATA_ATI_IXP200          0x43491002
101154515Ssos#define ATA_ATI_IXP300          0x43691002
102173734Ssos#define ATA_ATI_IXP300_S1       0x436e1002
103154515Ssos#define ATA_ATI_IXP400          0x43761002
104154515Ssos#define ATA_ATI_IXP400_S1       0x43791002
105154515Ssos#define ATA_ATI_IXP400_S2       0x437a1002
106173734Ssos#define ATA_ATI_IXP600          0x438c1002
107176891Ssos#define ATA_ATI_IXP600_S1       0x43801002
108173734Ssos#define ATA_ATI_IXP700          0x439c1002
109176891Ssos#define ATA_ATI_IXP700_S1       0x43901002
110151267Ssos
111144330Ssos#define ATA_CENATEK_ID          0x16ca
112144330Ssos#define ATA_CENATEK_ROCKET      0x000116ca
113138555Ssos
114144330Ssos#define ATA_CYRIX_ID            0x1078
115144330Ssos#define ATA_CYRIX_5530          0x01021078
116111188Ssos
117144330Ssos#define ATA_CYPRESS_ID          0x1080
118144330Ssos#define ATA_CYPRESS_82C693      0xc6931080
119111188Ssos
120144330Ssos#define ATA_DEC_21150           0x00221011
121144330Ssos#define ATA_DEC_21150_1         0x00231011
122111188Ssos
123144330Ssos#define ATA_HIGHPOINT_ID        0x1103
124144330Ssos#define ATA_HPT366              0x00041103
125144330Ssos#define ATA_HPT372              0x00051103
126144330Ssos#define ATA_HPT302              0x00061103
127144330Ssos#define ATA_HPT371              0x00071103
128144330Ssos#define ATA_HPT374              0x00081103
129111188Ssos
130144330Ssos#define ATA_INTEL_ID            0x8086
131144330Ssos#define ATA_I960RM              0x09628086
132144330Ssos#define ATA_I82371FB            0x12308086
133144330Ssos#define ATA_I82371SB            0x70108086
134144330Ssos#define ATA_I82371AB            0x71118086
135144330Ssos#define ATA_I82443MX            0x71998086
136144330Ssos#define ATA_I82451NX            0x84ca8086
137144330Ssos#define ATA_I82372FB            0x76018086
138144330Ssos#define ATA_I82801AB            0x24218086
139144330Ssos#define ATA_I82801AA            0x24118086
140144330Ssos#define ATA_I82801BA            0x244a8086
141144330Ssos#define ATA_I82801BA_1          0x244b8086
142144330Ssos#define ATA_I82801CA            0x248a8086
143144330Ssos#define ATA_I82801CA_1          0x248b8086
144144330Ssos#define ATA_I82801DB            0x24cb8086
145144330Ssos#define ATA_I82801DB_1          0x24ca8086
146144330Ssos#define ATA_I82801EB            0x24db8086
147144330Ssos#define ATA_I82801EB_S1         0x24d18086
148144330Ssos#define ATA_I82801EB_R1         0x24df8086
149144330Ssos#define ATA_I6300ESB            0x25a28086
150144330Ssos#define ATA_I6300ESB_S1         0x25a38086
151144330Ssos#define ATA_I6300ESB_R1         0x25b08086
152161291Ssos#define ATA_I63XXESB2           0x269e8086
153161291Ssos#define ATA_I63XXESB2_S1        0x26808086
154161291Ssos#define ATA_I63XXESB2_S2        0x26818086
155161291Ssos#define ATA_I63XXESB2_R1        0x26828086
156161291Ssos#define ATA_I63XXESB2_R2        0x26838086
157144330Ssos#define ATA_I82801FB            0x266f8086
158144330Ssos#define ATA_I82801FB_S1         0x26518086
159144330Ssos#define ATA_I82801FB_R1         0x26528086
160161291Ssos#define ATA_I82801FBM           0x26538086
161146266Ssos#define ATA_I82801GB            0x27df8086
162146266Ssos#define ATA_I82801GB_S1         0x27c08086
163161291Ssos#define ATA_I82801GB_AH         0x27c18086
164146266Ssos#define ATA_I82801GB_R1         0x27c38086
165161291Ssos#define ATA_I82801GBM_S1        0x27c48086
166161291Ssos#define ATA_I82801GBM_AH        0x27c58086
167161291Ssos#define ATA_I82801GBM_R1        0x27c68086
168161291Ssos#define ATA_I82801HB_S1         0x28208086
169161291Ssos#define ATA_I82801HB_AH6        0x28218086
170161291Ssos#define ATA_I82801HB_R1         0x28228086
171161291Ssos#define ATA_I82801HB_AH4        0x28248086
172161291Ssos#define ATA_I82801HB_S2         0x28258086
173161291Ssos#define ATA_I82801HBM_S1        0x28298086
174161291Ssos#define ATA_I82801HBM_S2        0x282a8086
175172134Ssimon#define ATA_I82801IB_S1         0x29208086
176172499Sdelphij#define ATA_I82801IB_AH2        0x29218086
177172134Ssimon#define ATA_I82801IB_AH6        0x29228086
178172134Ssimon#define ATA_I82801IB_AH4        0x29238086
179172134Ssimon#define ATA_I82801IB_S2         0x29268086
180154515Ssos#define ATA_I31244              0x32008086
181111188Ssos
182144330Ssos#define ATA_ITE_ID              0x1283
183148731Ssos#define ATA_IT8211F             0x82111283
184144330Ssos#define ATA_IT8212F             0x82121283
185138555Ssos
186161291Ssos#define ATA_JMICRON_ID          0x197b
187161291Ssos#define ATA_JMB360              0x2360197b
188161291Ssos#define ATA_JMB361              0x2361197b
189161291Ssos#define ATA_JMB363              0x2363197b
190161291Ssos#define ATA_JMB365              0x2365197b
191161291Ssos#define ATA_JMB366              0x2366197b
192165759Ssos#define ATA_JMB368              0x2368197b
193154829Ssos
194153753Ssos#define ATA_MARVELL_ID          0x11ab
195153753Ssos#define ATA_M88SX5040           0x504011ab
196153753Ssos#define ATA_M88SX5041           0x504111ab
197153753Ssos#define ATA_M88SX5080           0x508011ab
198153753Ssos#define ATA_M88SX5081           0x508111ab
199153753Ssos#define ATA_M88SX6041           0x604111ab
200153753Ssos#define ATA_M88SX6081           0x608111ab
201165768Ssos#define ATA_M88SX6101           0x610111ab
202165768Ssos#define ATA_M88SX6145           0x614511ab
203153753Ssos
204144330Ssos#define ATA_MICRON_ID           0x1042
205144330Ssos#define ATA_MICRON_RZ1000       0x10001042
206144330Ssos#define ATA_MICRON_RZ1001       0x10011042
207119404Ssos
208144330Ssos#define ATA_NATIONAL_ID         0x100b
209144330Ssos#define ATA_SC1100              0x0502100b
210111188Ssos
211166477Srink#define ATA_NETCELL_ID          0x169c
212166477Srink#define ATA_NETCELL_SR          0x0044169c
213166477Srink
214144330Ssos#define ATA_NVIDIA_ID           0x10de
215144330Ssos#define ATA_NFORCE1             0x01bc10de
216144330Ssos#define ATA_NFORCE2             0x006510de
217153473Ssos#define ATA_NFORCE2_PRO         0x008510de
218153473Ssos#define ATA_NFORCE2_PRO_S1      0x008e10de
219144330Ssos#define ATA_NFORCE3             0x00d510de
220144330Ssos#define ATA_NFORCE3_PRO         0x00e510de
221144330Ssos#define ATA_NFORCE3_PRO_S1      0x00e310de
222144330Ssos#define ATA_NFORCE3_PRO_S2      0x00ee10de
223153473Ssos#define ATA_NFORCE_MCP04        0x003510de
224153473Ssos#define ATA_NFORCE_MCP04_S1     0x003610de
225153473Ssos#define ATA_NFORCE_MCP04_S2     0x003e10de
226153473Ssos#define ATA_NFORCE_CK804        0x005310de
227153473Ssos#define ATA_NFORCE_CK804_S1     0x005410de
228153473Ssos#define ATA_NFORCE_CK804_S2     0x005510de
229153473Ssos#define ATA_NFORCE_MCP51        0x026510de
230153473Ssos#define ATA_NFORCE_MCP51_S1     0x026610de
231153473Ssos#define ATA_NFORCE_MCP51_S2     0x026710de
232153473Ssos#define ATA_NFORCE_MCP55        0x036e10de
233153473Ssos#define ATA_NFORCE_MCP55_S1     0x037e10de
234153473Ssos#define ATA_NFORCE_MCP55_S2     0x037f10de
235171025Ssos#define ATA_NFORCE_MCP61        0x03ec10de
236171025Ssos#define ATA_NFORCE_MCP61_S1     0x03e710de
237171025Ssos#define ATA_NFORCE_MCP61_S2     0x03f610de
238171025Ssos#define ATA_NFORCE_MCP61_S3     0x03f710de
239173734Ssos#define ATA_NFORCE_MCP65        0x044810de
240173734Ssos#define ATA_NFORCE_MCP67        0x056010de
241173734Ssos#define ATA_NFORCE_MCP73        0x056c10de
242173734Ssos#define ATA_NFORCE_MCP77        0x075910de
243134687Ssos
244144330Ssos#define ATA_PROMISE_ID          0x105a
245144330Ssos#define ATA_PDC20246            0x4d33105a
246144330Ssos#define ATA_PDC20262            0x4d38105a
247144330Ssos#define ATA_PDC20263            0x0d38105a
248144330Ssos#define ATA_PDC20265            0x0d30105a
249144330Ssos#define ATA_PDC20267            0x4d30105a
250144330Ssos#define ATA_PDC20268            0x4d68105a
251144330Ssos#define ATA_PDC20269            0x4d69105a
252144330Ssos#define ATA_PDC20270            0x6268105a
253144330Ssos#define ATA_PDC20271            0x6269105a
254144330Ssos#define ATA_PDC20275            0x1275105a
255144330Ssos#define ATA_PDC20276            0x5275105a
256144330Ssos#define ATA_PDC20277            0x7275105a
257144330Ssos#define ATA_PDC20318            0x3318105a
258144330Ssos#define ATA_PDC20319            0x3319105a
259144330Ssos#define ATA_PDC20371            0x3371105a
260144330Ssos#define ATA_PDC20375            0x3375105a
261144330Ssos#define ATA_PDC20376            0x3376105a
262144330Ssos#define ATA_PDC20377            0x3377105a
263144330Ssos#define ATA_PDC20378            0x3373105a
264144330Ssos#define ATA_PDC20379            0x3372105a
265144330Ssos#define ATA_PDC20571            0x3571105a
266144330Ssos#define ATA_PDC20575            0x3d75105a
267144330Ssos#define ATA_PDC20579            0x3574105a
268154515Ssos#define ATA_PDC20771            0x3570105a
269144330Ssos#define ATA_PDC40518            0x3d18105a
270145191Ssos#define ATA_PDC40519            0x3519105a
271148992Ssos#define ATA_PDC40718            0x3d17105a
272148992Ssos#define ATA_PDC40719            0x3515105a
273154515Ssos#define ATA_PDC40775            0x3d73105a
274154515Ssos#define ATA_PDC40779            0x3577105a
275144330Ssos#define ATA_PDC20617            0x6617105a
276144330Ssos#define ATA_PDC20618            0x6626105a
277144330Ssos#define ATA_PDC20619            0x6629105a
278144330Ssos#define ATA_PDC20620            0x6620105a
279144330Ssos#define ATA_PDC20621            0x6621105a
280144330Ssos#define ATA_PDC20622            0x6622105a
281154515Ssos#define ATA_PDC20624            0x6624105a
282154515Ssos#define ATA_PDC81518            0x8002105a
283111188Ssos
284144330Ssos#define ATA_SERVERWORKS_ID      0x1166
285144330Ssos#define ATA_ROSB4_ISA           0x02001166
286144330Ssos#define ATA_ROSB4               0x02111166
287144330Ssos#define ATA_CSB5                0x02121166
288144330Ssos#define ATA_CSB6                0x02131166
289144330Ssos#define ATA_CSB6_1              0x02171166
290161291Ssos#define ATA_HT1000              0x02141166
291161291Ssos#define ATA_HT1000_S1           0x024b1166
292161291Ssos#define ATA_HT1000_S2           0x024a1166
293162230Ssos#define ATA_K2			0x02401166
294162230Ssos#define ATA_FRODO4		0x02411166
295162230Ssos#define ATA_FRODO8		0x02421166
296111188Ssos
297144330Ssos#define ATA_SILICON_IMAGE_ID    0x1095
298144330Ssos#define ATA_SII3114             0x31141095
299144330Ssos#define ATA_SII3512             0x35121095
300144330Ssos#define ATA_SII3112             0x31121095
301144330Ssos#define ATA_SII3112_1           0x02401095
302167386Ssos#define ATA_SII3124		0x31241095
303167386Ssos#define ATA_SII3132		0x31321095
304144330Ssos#define ATA_SII0680             0x06801095
305144330Ssos#define ATA_CMD646              0x06461095
306144330Ssos#define ATA_CMD648              0x06481095
307144330Ssos#define ATA_CMD649              0x06491095
308111188Ssos
309144330Ssos#define ATA_SIS_ID              0x1039
310144330Ssos#define ATA_SISSOUTH            0x00081039
311144330Ssos#define ATA_SIS5511             0x55111039
312144330Ssos#define ATA_SIS5513             0x55131039
313144330Ssos#define ATA_SIS5517             0x55171039
314144330Ssos#define ATA_SIS5518             0x55181039
315144330Ssos#define ATA_SIS5571             0x55711039
316144330Ssos#define ATA_SIS5591             0x55911039
317144330Ssos#define ATA_SIS5596             0x55961039
318144330Ssos#define ATA_SIS5597             0x55971039
319144330Ssos#define ATA_SIS5598             0x55981039
320144330Ssos#define ATA_SIS5600             0x56001039
321144330Ssos#define ATA_SIS530              0x05301039
322144330Ssos#define ATA_SIS540              0x05401039
323144330Ssos#define ATA_SIS550              0x05501039
324144330Ssos#define ATA_SIS620              0x06201039
325144330Ssos#define ATA_SIS630              0x06301039
326144330Ssos#define ATA_SIS635              0x06351039
327144330Ssos#define ATA_SIS633              0x06331039
328144330Ssos#define ATA_SIS640              0x06401039
329144330Ssos#define ATA_SIS645              0x06451039
330144330Ssos#define ATA_SIS646              0x06461039
331144330Ssos#define ATA_SIS648              0x06481039
332144330Ssos#define ATA_SIS650              0x06501039
333144330Ssos#define ATA_SIS651              0x06511039
334144330Ssos#define ATA_SIS652              0x06521039
335144330Ssos#define ATA_SIS655              0x06551039
336144330Ssos#define ATA_SIS658              0x06581039
337144330Ssos#define ATA_SIS661              0x06611039
338144330Ssos#define ATA_SIS730              0x07301039
339144330Ssos#define ATA_SIS733              0x07331039
340144330Ssos#define ATA_SIS735              0x07351039
341144330Ssos#define ATA_SIS740              0x07401039
342144330Ssos#define ATA_SIS745              0x07451039
343144330Ssos#define ATA_SIS746              0x07461039
344144330Ssos#define ATA_SIS748              0x07481039
345144330Ssos#define ATA_SIS750              0x07501039
346144330Ssos#define ATA_SIS751              0x07511039
347144330Ssos#define ATA_SIS752              0x07521039
348144330Ssos#define ATA_SIS755              0x07551039
349144330Ssos#define ATA_SIS961              0x09611039
350144330Ssos#define ATA_SIS962              0x09621039
351144330Ssos#define ATA_SIS963              0x09631039
352144330Ssos#define ATA_SIS964              0x09641039
353144382Ssos#define ATA_SIS965              0x09651039
354144330Ssos#define ATA_SIS180              0x01801039
355144330Ssos#define ATA_SIS181              0x01811039
356144382Ssos#define ATA_SIS182              0x01821039
357111188Ssos
358144330Ssos#define ATA_VIA_ID              0x1106
359144330Ssos#define ATA_VIA82C571           0x05711106
360144330Ssos#define ATA_VIA82C586           0x05861106
361144330Ssos#define ATA_VIA82C596           0x05961106
362144330Ssos#define ATA_VIA82C686           0x06861106
363144330Ssos#define ATA_VIA8231             0x82311106
364144330Ssos#define ATA_VIA8233             0x30741106
365144330Ssos#define ATA_VIA8233A            0x31471106
366144330Ssos#define ATA_VIA8233C            0x31091106
367144330Ssos#define ATA_VIA8235             0x31771106
368144330Ssos#define ATA_VIA8237             0x32271106
369161883Ssos#define ATA_VIA8237A            0x05911106
370172446Ssos#define ATA_VIA8237S		0x53371106
371153415Ssos#define ATA_VIA8251             0x33491106
372144330Ssos#define ATA_VIA8361             0x31121106
373144330Ssos#define ATA_VIA8363             0x03051106
374144330Ssos#define ATA_VIA8371             0x03911106
375144330Ssos#define ATA_VIA8662             0x31021106
376144330Ssos#define ATA_VIA6410             0x31641106
377144330Ssos#define ATA_VIA6420             0x31491106
378144808Ssos#define ATA_VIA6421             0x32491106
379144330Ssos
380111188Ssos/* chipset setup related defines */
381154515Ssos#define AHCI            1
382144330Ssos#define ATPOLD          1
383111188Ssos
384144330Ssos#define ALIOLD          0x01
385144330Ssos#define ALINEW          0x02
386144667Ssos#define ALISATA         0x04
387111188Ssos
388176891Ssos#define ATIPATA		0x01
389176891Ssos#define ATISATA		0x02
390176891Ssos#define ATIAHCI		0x04
391176891Ssos
392144330Ssos#define HPT366          0
393144330Ssos#define HPT370          1
394144330Ssos#define HPT372          2
395144330Ssos#define HPT374          3
396144330Ssos#define HPTOLD          0x01
397111188Ssos
398165768Ssos#define MV50XX          50
399165768Ssos#define MV60XX          60
400165768Ssos#define MV61XX          61
401153753Ssos
402144330Ssos#define PROLD           0
403144330Ssos#define PRNEW           1
404144330Ssos#define PRTX            2
405144330Ssos#define PRMIO           3
406144330Ssos#define PRTX4           0x01
407144330Ssos#define PRSX4X          0x02
408144330Ssos#define PRSX6K          0x04
409144330Ssos#define PRPATA          0x08
410144330Ssos#define PRCMBO          0x10
411144330Ssos#define PRCMBO2         0x20
412144330Ssos#define PRSATA          0x40
413144330Ssos#define PRSATA2         0x80
414111188Ssos
415144330Ssos#define SWKS33          0
416144330Ssos#define SWKS66          1
417144330Ssos#define SWKS100         2
418160096Ssos#define SWKSMIO         3
419111188Ssos
420144330Ssos#define SIIMEMIO        1
421167386Ssos#define SIIPRBIO        2
422144330Ssos#define SIIINTR         0x01
423144330Ssos#define SIISETCLK       0x02
424144330Ssos#define SIIBUG          0x04
425144330Ssos#define SII4CH          0x08
426111188Ssos
427144330Ssos#define SIS_SOUTH       1
428144330Ssos#define SISSATA         2
429144330Ssos#define SIS133NEW       3
430144330Ssos#define SIS133OLD       4
431144330Ssos#define SIS100NEW       5
432144330Ssos#define SIS100OLD       6
433144330Ssos#define SIS66           7
434144330Ssos#define SIS33           8
435111188Ssos
436144330Ssos#define VIA33           0
437144330Ssos#define VIA66           1
438144330Ssos#define VIA100          2
439144330Ssos#define VIA133          3
440144330Ssos#define AMDNVIDIA       4
441144808Ssos
442160616Ssos#define AMDCABLE        0x0001
443160616Ssos#define AMDBUG          0x0002
444160616Ssos#define NVIDIA          0x0004
445160616Ssos#define NV4             0x0010
446161227Ssos#define NVQ             0x0020
447160616Ssos#define VIACLK          0x0100
448160616Ssos#define VIABUG          0x0200
449160616Ssos#define VIABAR          0x0400
450160616Ssos#define VIAAHCI         0x0800
451111188Ssos
452144808Ssos
453144330Ssos/* global prototypes ata-pci.c */
454144330Ssosint ata_pci_probe(device_t dev);
455144330Ssosint ata_pci_attach(device_t dev);
456144330Ssosint ata_pci_detach(device_t dev);
457144330Ssosstruct resource * ata_pci_alloc_resource(device_t dev, device_t child, int type, int *rid, u_long start, u_long end, u_long count, u_int flags);
458144330Ssosint ata_pci_release_resource(device_t dev, device_t child, int type, int rid, struct resource *r);
459166901Spisoint ata_pci_setup_intr(device_t dev, device_t child, struct resource *irq, int flags, driver_filter_t *filter, driver_intr_t *function, void *argument, void **cookiep);
460144330Ssos int ata_pci_teardown_intr(device_t dev, device_t child, struct resource *irq, void *cookie);
461144790Ssosint ata_pci_allocate(device_t dev);
462154507Ssosvoid ata_pci_hw(device_t dev);
463154507Ssosint ata_pci_status(device_t dev);
464173734Ssosvoid ata_pci_dmainit(device_t dev);
465173734Ssoschar *ata_pcivendor2str(device_t dev);
466128530Ssos
467154507Ssos
468144330Ssos/* global prototypes ata-chipset.c */
469111188Ssosint ata_generic_ident(device_t);
470173734Ssosint ata_ahci_ident(device_t);
471111188Ssosint ata_acard_ident(device_t);
472111188Ssosint ata_ali_ident(device_t);
473111188Ssosint ata_amd_ident(device_t);
474151267Ssosint ata_ati_ident(device_t);
475111188Ssosint ata_cyrix_ident(device_t);
476111188Ssosint ata_cypress_ident(device_t);
477111188Ssosint ata_highpoint_ident(device_t);
478111188Ssosint ata_intel_ident(device_t);
479138555Ssosint ata_ite_ident(device_t);
480154829Ssosint ata_jmicron_ident(device_t);
481153753Ssosint ata_marvell_ident(device_t);
482119404Ssosint ata_national_ident(device_t);
483111188Ssosint ata_nvidia_ident(device_t);
484166477Srinkint ata_netcell_ident(device_t);
485111188Ssosint ata_promise_ident(device_t);
486111188Ssosint ata_serverworks_ident(device_t);
487111188Ssosint ata_sii_ident(device_t);
488111188Ssosint ata_sis_ident(device_t);
489111188Ssosint ata_via_ident(device_t);
490144330Ssosint ata_legacy(device_t);
491144330Ssos
492144330Ssos/* global prototypes ata-dma.c */
493145713Ssosvoid ata_dmainit(device_t);
494