xref: /freebsd/sys/dev/ata/ata-pci.h (revision a98ff317388a00b992f1bf8404dee596f9383f5e)
1 /*-
2  * Copyright (c) 2003 - 2008 Søren Schmidt <sos@FreeBSD.org>
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  *    notice, this list of conditions and the following disclaimer,
10  *    without modification, immediately at the beginning of the file.
11  * 2. Redistributions in binary form must reproduce the above copyright
12  *    notice, this list of conditions and the following disclaimer in the
13  *    documentation and/or other materials provided with the distribution.
14  *
15  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25  *
26  * $FreeBSD$
27  */
28 
29 /* structure holding chipset config info */
30 struct ata_chip_id {
31     u_int32_t           chipid;
32     u_int8_t            chiprev;
33     int                 cfg1;
34     int                 cfg2;
35     u_int8_t            max_dma;
36     const char          *text;
37 };
38 
39 #define ATA_PCI_MAX_CH	8
40 
41 /* structure describing a PCI ATA controller */
42 struct ata_pci_controller {
43     device_t            dev;
44     int                 r_type1;
45     int                 r_rid1;
46     struct resource     *r_res1;
47     int                 r_type2;
48     int                 r_rid2;
49     struct resource     *r_res2;
50     int                 r_irq_rid;
51     struct resource     *r_irq;
52     void                *handle;
53     const struct ata_chip_id *chip;
54     int			legacy;
55     int                 channels;
56     int			ichannels;
57     int                 (*chipinit)(device_t);
58     int                 (*chipdeinit)(device_t);
59     int                 (*suspend)(device_t);
60     int                 (*resume)(device_t);
61     int                 (*ch_attach)(device_t);
62     int                 (*ch_detach)(device_t);
63     int                 (*ch_suspend)(device_t);
64     int                 (*ch_resume)(device_t);
65     void                (*reset)(device_t);
66     int                 (*setmode)(device_t, int, int);
67     int                 (*getrev)(device_t, int);
68     struct {
69     void                (*function)(void *);
70     void                *argument;
71     } interrupt[ATA_PCI_MAX_CH];
72     void                *chipset_data;
73 };
74 
75 /* defines for known chipset PCI id's */
76 #define ATA_ACARD_ID            0x1191
77 #define ATA_ATP850              0x00021191
78 #define ATA_ATP850A             0x00041191
79 #define ATA_ATP850R             0x00051191
80 #define ATA_ATP860A             0x00061191
81 #define ATA_ATP860R             0x00071191
82 #define ATA_ATP865A             0x00081191
83 #define ATA_ATP865R             0x00091191
84 
85 #define ATA_ACER_LABS_ID        0x10b9
86 #define ATA_ALI_1533            0x153310b9
87 #define ATA_ALI_5228            0x522810b9
88 #define ATA_ALI_5229            0x522910b9
89 #define ATA_ALI_5281            0x528110b9
90 #define ATA_ALI_5287            0x528710b9
91 #define ATA_ALI_5288            0x528810b9
92 #define ATA_ALI_5289            0x528910b9
93 
94 #define ATA_AMD_ID              0x1022
95 #define ATA_AMD755              0x74011022
96 #define ATA_AMD756              0x74091022
97 #define ATA_AMD766              0x74111022
98 #define ATA_AMD768              0x74411022
99 #define ATA_AMD8111             0x74691022
100 #define ATA_AMD5536             0x209a1022
101 #define ATA_AMD_HUDSON2_S1	0x78001022
102 #define ATA_AMD_HUDSON2_S2	0x78011022
103 #define ATA_AMD_HUDSON2_S3	0x78021022
104 #define ATA_AMD_HUDSON2_S4	0x78031022
105 #define ATA_AMD_HUDSON2_S5	0x78041022
106 #define ATA_AMD_HUDSON2		0x780c1022
107 
108 #define ATA_ADAPTEC_ID          0x9005
109 #define ATA_ADAPTEC_1420        0x02419005
110 #define ATA_ADAPTEC_1430        0x02439005
111 
112 #define ATA_ATI_ID              0x1002
113 #define ATA_ATI_IXP200          0x43491002
114 #define ATA_ATI_IXP300          0x43691002
115 #define ATA_ATI_IXP300_S1       0x436e1002
116 #define ATA_ATI_IXP400          0x43761002
117 #define ATA_ATI_IXP400_S1       0x43791002
118 #define ATA_ATI_IXP400_S2       0x437a1002
119 #define ATA_ATI_IXP600          0x438c1002
120 #define ATA_ATI_IXP600_S1       0x43801002
121 #define ATA_ATI_IXP700          0x439c1002
122 #define ATA_ATI_IXP700_S1       0x43901002
123 #define	ATA_ATI_IXP700_S2	0x43911002
124 #define	ATA_ATI_IXP700_S3	0x43921002
125 #define	ATA_ATI_IXP700_S4	0x43931002
126 #define	ATA_ATI_IXP800_S1	0x43941002
127 #define	ATA_ATI_IXP800_S2	0x43951002
128 
129 #define ATA_CENATEK_ID          0x16ca
130 #define ATA_CENATEK_ROCKET      0x000116ca
131 
132 #define ATA_CYRIX_ID            0x1078
133 #define ATA_CYRIX_5530          0x01021078
134 
135 #define ATA_CYPRESS_ID          0x1080
136 #define ATA_CYPRESS_82C693      0xc6931080
137 
138 #define ATA_DEC_21150           0x00221011
139 #define ATA_DEC_21150_1         0x00231011
140 
141 #define ATA_HIGHPOINT_ID        0x1103
142 #define ATA_HPT366              0x00041103
143 #define ATA_HPT372              0x00051103
144 #define ATA_HPT302              0x00061103
145 #define ATA_HPT371              0x00071103
146 #define ATA_HPT374              0x00081103
147 
148 #define ATA_INTEL_ID            0x8086
149 #define ATA_I960RM              0x09628086
150 #define ATA_I82371FB            0x12308086
151 #define ATA_I82371SB            0x70108086
152 #define ATA_I82371AB            0x71118086
153 #define ATA_I82443MX            0x71998086
154 #define ATA_I82451NX            0x84ca8086
155 #define ATA_I82372FB            0x76018086
156 #define ATA_I82801AB            0x24218086
157 #define ATA_I82801AA            0x24118086
158 #define ATA_I82801BA            0x244a8086
159 #define ATA_I82801BA_1          0x244b8086
160 #define ATA_I82801CA            0x248a8086
161 #define ATA_I82801CA_1          0x248b8086
162 #define ATA_I82801DB            0x24cb8086
163 #define ATA_I82801DB_1          0x24ca8086
164 #define ATA_I82801EB            0x24db8086
165 #define ATA_I82801EB_S1         0x24d18086
166 #define ATA_I82801EB_R1         0x24df8086
167 #define ATA_I6300ESB            0x25a28086
168 #define ATA_I6300ESB_S1         0x25a38086
169 #define ATA_I6300ESB_R1         0x25b08086
170 #define ATA_I63XXESB2           0x269e8086
171 #define ATA_I63XXESB2_S1        0x26808086
172 #define ATA_I63XXESB2_S2        0x26818086
173 #define ATA_I63XXESB2_R1        0x26828086
174 #define ATA_I63XXESB2_R2        0x26838086
175 #define ATA_I82801FB            0x266f8086
176 #define ATA_I82801FB_S1         0x26518086
177 #define ATA_I82801FB_R1         0x26528086
178 #define ATA_I82801FBM           0x26538086
179 #define ATA_I82801GB            0x27df8086
180 #define ATA_I82801GB_S1         0x27c08086
181 #define ATA_I82801GB_AH         0x27c18086
182 #define ATA_I82801GB_R1         0x27c38086
183 #define ATA_I82801GBM_S1        0x27c48086
184 #define ATA_I82801GBM_AH        0x27c58086
185 #define ATA_I82801GBM_R1        0x27c68086
186 #define ATA_I82801HB_S1         0x28208086
187 #define ATA_I82801HB_AH6        0x28218086
188 #define ATA_I82801HB_R1         0x28228086
189 #define ATA_I82801HB_AH4        0x28248086
190 #define ATA_I82801HB_S2         0x28258086
191 #define ATA_I82801HBM           0x28508086
192 #define ATA_I82801HBM_S1        0x28288086
193 #define ATA_I82801HBM_S2        0x28298086
194 #define ATA_I82801HBM_S3        0x282a8086
195 #define ATA_I82801IB_S1         0x29208086
196 #define ATA_I82801IB_S3         0x29218086
197 #define ATA_I82801IB_AH6        0x29228086
198 #define ATA_I82801IB_AH4        0x29238086
199 #define ATA_I82801IB_R1         0x29258086
200 #define ATA_I82801IB_S2         0x29268086
201 #define ATA_I82801IBM_S1        0x29288086
202 #define ATA_I82801IBM_AH        0x29298086
203 #define ATA_I82801IBM_R1        0x292a8086
204 #define ATA_I82801IBM_S2        0x292d8086
205 #define ATA_I82801JIB_S1        0x3a208086
206 #define ATA_I82801JIB_AH        0x3a228086
207 #define ATA_I82801JIB_R1        0x3a258086
208 #define ATA_I82801JIB_S2        0x3a268086
209 #define ATA_I82801JD_S1         0x3a008086
210 #define ATA_I82801JD_AH         0x3a028086
211 #define ATA_I82801JD_R1         0x3a058086
212 #define ATA_I82801JD_S2         0x3a068086
213 #define ATA_I82801JI_S1         0x3a208086
214 #define ATA_I82801JI_AH         0x3a228086
215 #define ATA_I82801JI_R1         0x3a258086
216 #define ATA_I82801JI_S2         0x3a268086
217 
218 #define ATA_5Series_S1          0x3b208086
219 #define ATA_5Series_S2          0x3b218086
220 #define ATA_5Series_AH1         0x3b228086
221 #define ATA_5Series_AH2         0x3b238086
222 #define ATA_5Series_R1          0x3b258086
223 #define ATA_5Series_S3          0x3b268086
224 #define ATA_5Series_S4          0x3b288086
225 #define ATA_5Series_AH3         0x3b298086
226 #define ATA_5Series_R2          0x3b2c8086
227 #define ATA_5Series_S5          0x3b2d8086
228 #define ATA_5Series_S6          0x3b2e8086
229 #define ATA_5Series_AH4         0x3b2f8086
230 
231 #define ATA_CPT_S1              0x1c008086
232 #define ATA_CPT_S2              0x1c018086
233 #define ATA_CPT_AH1             0x1c028086
234 #define ATA_CPT_AH2             0x1c038086
235 #define ATA_CPT_R1              0x1c048086
236 #define ATA_CPT_R2              0x1c058086
237 #define ATA_CPT_S3              0x1c088086
238 #define ATA_CPT_S4              0x1c098086
239 
240 #define ATA_PBG_S1		0x1d008086
241 #define ATA_PBG_AH1		0x1d028086
242 #define ATA_PBG_R1		0x1d048086
243 #define ATA_PBG_R2		0x1d068086
244 #define ATA_PBG_R3		0x28268086
245 #define ATA_PBG_S2		0x1d088086
246 
247 #define ATA_PPT_S1		0x1e008086
248 #define ATA_PPT_S2		0x1e018086
249 #define ATA_PPT_AH1		0x1e028086
250 #define ATA_PPT_AH2		0x1e038086
251 #define ATA_PPT_R1		0x1e048086
252 #define ATA_PPT_R2		0x1e058086
253 #define ATA_PPT_R3		0x1e068086
254 #define ATA_PPT_R4		0x1e078086
255 #define ATA_PPT_S3		0x1e088086
256 #define ATA_PPT_S4		0x1e098086
257 #define ATA_PPT_R5		0x1e0e8086
258 #define ATA_PPT_R6		0x1e0f8086
259 
260 #define ATA_LPT_S1		0x8c008086
261 #define ATA_LPT_S2		0x8c018086
262 #define ATA_LPT_AH1		0x8c028086
263 #define ATA_LPT_AH2		0x8c038086
264 #define ATA_LPT_R1		0x8c048086
265 #define ATA_LPT_R2		0x8c058086
266 #define ATA_LPT_R3		0x8c068086
267 #define ATA_LPT_R4		0x8c078086
268 #define ATA_LPT_S3		0x8c088086
269 #define ATA_LPT_S4		0x8c098086
270 #define ATA_LPT_R5		0x8c0e8086
271 #define ATA_LPT_R6		0x8c0f8086
272 
273 #define ATA_I31244              0x32008086
274 #define ATA_ISCH                0x811a8086
275 #define ATA_DH89XXCC            0x23238086
276 
277 #define ATA_COLETOCRK_AH1       0x23a38086
278 #define ATA_COLETOCRK_S1        0x23a18086
279 #define ATA_COLETOCRK_S2        0x23a68086
280 
281 #define ATA_ITE_ID              0x1283
282 #define ATA_IT8211F             0x82111283
283 #define ATA_IT8212F             0x82121283
284 #define ATA_IT8213F             0x82131283
285 
286 #define ATA_JMICRON_ID          0x197b
287 #define ATA_JMB360              0x2360197b
288 #define ATA_JMB361              0x2361197b
289 #define ATA_JMB362              0x2362197b
290 #define ATA_JMB363              0x2363197b
291 #define ATA_JMB365              0x2365197b
292 #define ATA_JMB366              0x2366197b
293 #define ATA_JMB368              0x2368197b
294 
295 #define ATA_MARVELL_ID          0x11ab
296 #define ATA_M88SX5040           0x504011ab
297 #define ATA_M88SX5041           0x504111ab
298 #define ATA_M88SX5080           0x508011ab
299 #define ATA_M88SX5081           0x508111ab
300 #define ATA_M88SX6041           0x604111ab
301 #define ATA_M88SX6042           0x604211ab
302 #define ATA_M88SX6081           0x608111ab
303 #define ATA_M88SX7042           0x704211ab
304 #define ATA_M88SE6101           0x610111ab
305 #define ATA_M88SE6102           0x610211ab
306 #define ATA_M88SE6111           0x611111ab
307 #define ATA_M88SE6121           0x612111ab
308 #define ATA_M88SE6141           0x614111ab
309 #define ATA_M88SE6145           0x614511ab
310 #define ATA_MARVELL2_ID         0x1b4b
311 
312 #define ATA_MICRON_ID           0x1042
313 #define ATA_MICRON_RZ1000       0x10001042
314 #define ATA_MICRON_RZ1001       0x10011042
315 
316 #define ATA_NATIONAL_ID         0x100b
317 #define ATA_SC1100              0x0502100b
318 
319 #define ATA_NETCELL_ID          0x169c
320 #define ATA_NETCELL_SR          0x0044169c
321 
322 #define ATA_NVIDIA_ID           0x10de
323 #define ATA_NFORCE1             0x01bc10de
324 #define ATA_NFORCE2             0x006510de
325 #define ATA_NFORCE2_PRO         0x008510de
326 #define ATA_NFORCE2_PRO_S1      0x008e10de
327 #define ATA_NFORCE3             0x00d510de
328 #define ATA_NFORCE3_PRO         0x00e510de
329 #define ATA_NFORCE3_PRO_S1      0x00e310de
330 #define ATA_NFORCE3_PRO_S2      0x00ee10de
331 #define ATA_NFORCE_MCP04        0x003510de
332 #define ATA_NFORCE_MCP04_S1     0x003610de
333 #define ATA_NFORCE_MCP04_S2     0x003e10de
334 #define ATA_NFORCE_CK804        0x005310de
335 #define ATA_NFORCE_CK804_S1     0x005410de
336 #define ATA_NFORCE_CK804_S2     0x005510de
337 #define ATA_NFORCE_MCP51        0x026510de
338 #define ATA_NFORCE_MCP51_S1     0x026610de
339 #define ATA_NFORCE_MCP51_S2     0x026710de
340 #define ATA_NFORCE_MCP55        0x036e10de
341 #define ATA_NFORCE_MCP55_S1     0x037e10de
342 #define ATA_NFORCE_MCP55_S2     0x037f10de
343 #define ATA_NFORCE_MCP61        0x03ec10de
344 #define ATA_NFORCE_MCP61_S1     0x03e710de
345 #define ATA_NFORCE_MCP61_S2     0x03f610de
346 #define ATA_NFORCE_MCP61_S3     0x03f710de
347 #define ATA_NFORCE_MCP65        0x044810de
348 #define ATA_NFORCE_MCP65_A0     0x044c10de
349 #define ATA_NFORCE_MCP65_A1     0x044d10de
350 #define ATA_NFORCE_MCP65_A2     0x044e10de
351 #define ATA_NFORCE_MCP65_A3     0x044f10de
352 #define ATA_NFORCE_MCP65_A4     0x045c10de
353 #define ATA_NFORCE_MCP65_A5     0x045d10de
354 #define ATA_NFORCE_MCP65_A6     0x045e10de
355 #define ATA_NFORCE_MCP65_A7     0x045f10de
356 #define ATA_NFORCE_MCP67        0x056010de
357 #define ATA_NFORCE_MCP67_A0     0x055010de
358 #define ATA_NFORCE_MCP67_A1     0x055110de
359 #define ATA_NFORCE_MCP67_A2     0x055210de
360 #define ATA_NFORCE_MCP67_A3     0x055310de
361 #define ATA_NFORCE_MCP67_A4     0x055410de
362 #define ATA_NFORCE_MCP67_A5     0x055510de
363 #define ATA_NFORCE_MCP67_A6     0x055610de
364 #define ATA_NFORCE_MCP67_A7     0x055710de
365 #define ATA_NFORCE_MCP67_A8     0x055810de
366 #define ATA_NFORCE_MCP67_A9     0x055910de
367 #define ATA_NFORCE_MCP67_AA     0x055A10de
368 #define ATA_NFORCE_MCP67_AB     0x055B10de
369 #define ATA_NFORCE_MCP67_AC     0x058410de
370 #define ATA_NFORCE_MCP73        0x056c10de
371 #define ATA_NFORCE_MCP73_A0     0x07f010de
372 #define ATA_NFORCE_MCP73_A1     0x07f110de
373 #define ATA_NFORCE_MCP73_A2     0x07f210de
374 #define ATA_NFORCE_MCP73_A3     0x07f310de
375 #define ATA_NFORCE_MCP73_A4     0x07f410de
376 #define ATA_NFORCE_MCP73_A5     0x07f510de
377 #define ATA_NFORCE_MCP73_A6     0x07f610de
378 #define ATA_NFORCE_MCP73_A7     0x07f710de
379 #define ATA_NFORCE_MCP73_A8     0x07f810de
380 #define ATA_NFORCE_MCP73_A9     0x07f910de
381 #define ATA_NFORCE_MCP73_AA     0x07fa10de
382 #define ATA_NFORCE_MCP73_AB     0x07fb10de
383 #define ATA_NFORCE_MCP77        0x075910de
384 #define ATA_NFORCE_MCP77_A0     0x0ad010de
385 #define ATA_NFORCE_MCP77_A1     0x0ad110de
386 #define ATA_NFORCE_MCP77_A2     0x0ad210de
387 #define ATA_NFORCE_MCP77_A3     0x0ad310de
388 #define ATA_NFORCE_MCP77_A4     0x0ad410de
389 #define ATA_NFORCE_MCP77_A5     0x0ad510de
390 #define ATA_NFORCE_MCP77_A6     0x0ad610de
391 #define ATA_NFORCE_MCP77_A7     0x0ad710de
392 #define ATA_NFORCE_MCP77_A8     0x0ad810de
393 #define ATA_NFORCE_MCP77_A9     0x0ad910de
394 #define ATA_NFORCE_MCP77_AA     0x0ada10de
395 #define ATA_NFORCE_MCP77_AB     0x0adb10de
396 #define ATA_NFORCE_MCP79_A0     0x0ab410de
397 #define ATA_NFORCE_MCP79_A1     0x0ab510de
398 #define ATA_NFORCE_MCP79_A2     0x0ab610de
399 #define ATA_NFORCE_MCP79_A3     0x0ab710de
400 #define ATA_NFORCE_MCP79_A4     0x0ab810de
401 #define ATA_NFORCE_MCP79_A5     0x0ab910de
402 #define ATA_NFORCE_MCP79_A6     0x0aba10de
403 #define ATA_NFORCE_MCP79_A7     0x0abb10de
404 #define ATA_NFORCE_MCP79_A8     0x0abc10de
405 #define ATA_NFORCE_MCP79_A9     0x0abd10de
406 #define ATA_NFORCE_MCP79_AA     0x0abe10de
407 #define ATA_NFORCE_MCP79_AB     0x0abf10de
408 #define ATA_NFORCE_MCP89_A0     0x0d8410de
409 #define ATA_NFORCE_MCP89_A1     0x0d8510de
410 #define ATA_NFORCE_MCP89_A2     0x0d8610de
411 #define ATA_NFORCE_MCP89_A3     0x0d8710de
412 #define ATA_NFORCE_MCP89_A4     0x0d8810de
413 #define ATA_NFORCE_MCP89_A5     0x0d8910de
414 #define ATA_NFORCE_MCP89_A6     0x0d8a10de
415 #define ATA_NFORCE_MCP89_A7     0x0d8b10de
416 #define ATA_NFORCE_MCP89_A8     0x0d8c10de
417 #define ATA_NFORCE_MCP89_A9     0x0d8d10de
418 #define ATA_NFORCE_MCP89_AA     0x0d8e10de
419 #define ATA_NFORCE_MCP89_AB     0x0d8f10de
420 
421 #define ATA_PROMISE_ID          0x105a
422 #define ATA_PDC20246            0x4d33105a
423 #define ATA_PDC20262            0x4d38105a
424 #define ATA_PDC20263            0x0d38105a
425 #define ATA_PDC20265            0x0d30105a
426 #define ATA_PDC20267            0x4d30105a
427 #define ATA_PDC20268            0x4d68105a
428 #define ATA_PDC20269            0x4d69105a
429 #define ATA_PDC20270            0x6268105a
430 #define ATA_PDC20271            0x6269105a
431 #define ATA_PDC20275            0x1275105a
432 #define ATA_PDC20276            0x5275105a
433 #define ATA_PDC20277            0x7275105a
434 #define ATA_PDC20318            0x3318105a
435 #define ATA_PDC20319            0x3319105a
436 #define ATA_PDC20371            0x3371105a
437 #define ATA_PDC20375            0x3375105a
438 #define ATA_PDC20376            0x3376105a
439 #define ATA_PDC20377            0x3377105a
440 #define ATA_PDC20378            0x3373105a
441 #define ATA_PDC20379            0x3372105a
442 #define ATA_PDC20571            0x3571105a
443 #define ATA_PDC20575            0x3d75105a
444 #define ATA_PDC20579            0x3574105a
445 #define ATA_PDC20771            0x3570105a
446 #define ATA_PDC40518            0x3d18105a
447 #define ATA_PDC40519            0x3519105a
448 #define ATA_PDC40718            0x3d17105a
449 #define ATA_PDC40719            0x3515105a
450 #define ATA_PDC40775            0x3d73105a
451 #define ATA_PDC40779            0x3577105a
452 #define ATA_PDC20617            0x6617105a
453 #define ATA_PDC20618            0x6626105a
454 #define ATA_PDC20619            0x6629105a
455 #define ATA_PDC20620            0x6620105a
456 #define ATA_PDC20621            0x6621105a
457 #define ATA_PDC20622            0x6622105a
458 #define ATA_PDC20624            0x6624105a
459 #define ATA_PDC81518            0x8002105a
460 
461 #define ATA_SERVERWORKS_ID      0x1166
462 #define ATA_ROSB4_ISA           0x02001166
463 #define ATA_ROSB4               0x02111166
464 #define ATA_CSB5                0x02121166
465 #define ATA_CSB6                0x02131166
466 #define ATA_CSB6_1              0x02171166
467 #define ATA_HT1000              0x02141166
468 #define ATA_HT1000_S1           0x024b1166
469 #define ATA_HT1000_S2           0x024a1166
470 #define ATA_K2			0x02401166
471 #define ATA_FRODO4		0x02411166
472 #define ATA_FRODO8		0x02421166
473 
474 #define ATA_SILICON_IMAGE_ID    0x1095
475 #define ATA_SII3114             0x31141095
476 #define ATA_SII3512             0x35121095
477 #define ATA_SII3112             0x31121095
478 #define ATA_SII3112_1           0x02401095
479 #define ATA_SII3124		0x31241095
480 #define ATA_SII3132		0x31321095
481 #define ATA_SII3132_1		0x02421095
482 #define ATA_SII3132_2		0x02441095
483 #define ATA_SII0680             0x06801095
484 #define ATA_CMD646              0x06461095
485 #define ATA_CMD648              0x06481095
486 #define ATA_CMD649              0x06491095
487 
488 #define ATA_SIS_ID              0x1039
489 #define ATA_SISSOUTH            0x00081039
490 #define ATA_SIS5511             0x55111039
491 #define ATA_SIS5513             0x55131039
492 #define ATA_SIS5517             0x55171039
493 #define ATA_SIS5518             0x55181039
494 #define ATA_SIS5571             0x55711039
495 #define ATA_SIS5591             0x55911039
496 #define ATA_SIS5596             0x55961039
497 #define ATA_SIS5597             0x55971039
498 #define ATA_SIS5598             0x55981039
499 #define ATA_SIS5600             0x56001039
500 #define ATA_SIS530              0x05301039
501 #define ATA_SIS540              0x05401039
502 #define ATA_SIS550              0x05501039
503 #define ATA_SIS620              0x06201039
504 #define ATA_SIS630              0x06301039
505 #define ATA_SIS635              0x06351039
506 #define ATA_SIS633              0x06331039
507 #define ATA_SIS640              0x06401039
508 #define ATA_SIS645              0x06451039
509 #define ATA_SIS646              0x06461039
510 #define ATA_SIS648              0x06481039
511 #define ATA_SIS650              0x06501039
512 #define ATA_SIS651              0x06511039
513 #define ATA_SIS652              0x06521039
514 #define ATA_SIS655              0x06551039
515 #define ATA_SIS658              0x06581039
516 #define ATA_SIS661              0x06611039
517 #define ATA_SIS730              0x07301039
518 #define ATA_SIS733              0x07331039
519 #define ATA_SIS735              0x07351039
520 #define ATA_SIS740              0x07401039
521 #define ATA_SIS745              0x07451039
522 #define ATA_SIS746              0x07461039
523 #define ATA_SIS748              0x07481039
524 #define ATA_SIS750              0x07501039
525 #define ATA_SIS751              0x07511039
526 #define ATA_SIS752              0x07521039
527 #define ATA_SIS755              0x07551039
528 #define ATA_SIS961              0x09611039
529 #define ATA_SIS962              0x09621039
530 #define ATA_SIS963              0x09631039
531 #define ATA_SIS964              0x09641039
532 #define ATA_SIS965              0x09651039
533 #define ATA_SIS180              0x01801039
534 #define ATA_SIS181              0x01811039
535 #define ATA_SIS182              0x01821039
536 
537 #define ATA_VIA_ID              0x1106
538 #define ATA_VIA82C571           0x05711106
539 #define ATA_VIA82C586           0x05861106
540 #define ATA_VIA82C596           0x05961106
541 #define ATA_VIA82C686           0x06861106
542 #define ATA_VIA8231             0x82311106
543 #define ATA_VIA8233             0x30741106
544 #define ATA_VIA8233A            0x31471106
545 #define ATA_VIA8233C            0x31091106
546 #define ATA_VIA8235             0x31771106
547 #define ATA_VIA8237             0x32271106
548 #define ATA_VIA8237A            0x05911106
549 #define ATA_VIA8237S		0x53371106
550 #define ATA_VIA8237_5372	0x53721106
551 #define ATA_VIA8237_7372	0x73721106
552 #define ATA_VIA8251             0x33491106
553 #define ATA_VIA8361             0x31121106
554 #define ATA_VIA8363             0x03051106
555 #define ATA_VIA8371             0x03911106
556 #define ATA_VIA8662             0x31021106
557 #define ATA_VIA6410             0x31641106
558 #define ATA_VIA6420             0x31491106
559 #define ATA_VIA6421             0x32491106
560 #define ATA_VIACX700IDE         0x05811106
561 #define ATA_VIACX700            0x83241106
562 #define ATA_VIASATAIDE          0x53241106
563 #define ATA_VIAVX800            0x83531106
564 #define ATA_VIASATAIDE2         0xc4091106
565 #define ATA_VIAVX855            0x84091106
566 #define ATA_VIASATAIDE3         0x90011106
567 #define ATA_VIAVX900            0x84101106
568 
569 /* global prototypes ata-pci.c */
570 int ata_pci_probe(device_t dev);
571 int ata_pci_attach(device_t dev);
572 int ata_pci_detach(device_t dev);
573 int ata_pci_suspend(device_t dev);
574 int ata_pci_resume(device_t dev);
575 int ata_pci_read_ivar(device_t dev, device_t child, int which, uintptr_t *result);
576 int ata_pci_write_ivar(device_t dev, device_t child, int which, uintptr_t value);
577 uint32_t ata_pci_read_config(device_t dev, device_t child, int reg, int width);
578 void ata_pci_write_config(device_t dev, device_t child, int reg,
579     uint32_t val, int width);
580 int ata_pci_print_child(device_t dev, device_t child);
581 int ata_pci_child_location_str(device_t dev, device_t child, char *buf,
582     size_t buflen);
583 struct 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);
584 int ata_pci_release_resource(device_t dev, device_t child, int type, int rid, struct resource *r);
585 int 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);
586  int ata_pci_teardown_intr(device_t dev, device_t child, struct resource *irq, void *cookie);
587 int ata_pci_ch_attach(device_t dev);
588 int ata_pci_ch_detach(device_t dev);
589 int ata_pci_status(device_t dev);
590 void ata_pci_hw(device_t dev);
591 void ata_pci_dmainit(device_t dev);
592 void ata_pci_dmafini(device_t dev);
593 const char *ata_pcivendor2str(device_t dev);
594 int ata_legacy(device_t);
595 void ata_generic_intr(void *data);
596 int ata_generic_chipinit(device_t dev);
597 int ata_generic_setmode(device_t dev, int target, int mode);
598 int ata_setup_interrupt(device_t dev, void *intr_func);
599 void ata_set_desc(device_t dev);
600 const struct ata_chip_id *ata_match_chip(device_t dev, const struct ata_chip_id *index);
601 const struct ata_chip_id *ata_find_chip(device_t dev, const struct ata_chip_id *index, int slot);
602 int ata_mode2idx(int mode);
603 
604 /* global prototypes from chipsets/ata-*.c */
605 int ata_ahci_chipinit(device_t);
606 int ata_marvell_edma_chipinit(device_t);
607 int ata_sii_chipinit(device_t);
608 
609 /* externs */
610 extern devclass_t ata_pci_devclass;
611 
612 MALLOC_DECLARE(M_ATAPCI);
613 
614 /* macro for easy definition of all driver module stuff */
615 #define ATA_DECLARE_DRIVER(dname) \
616 static device_method_t __CONCAT(dname,_methods)[] = { \
617     DEVMETHOD(device_probe,     __CONCAT(dname,_probe)), \
618     DEVMETHOD(device_attach,    ata_pci_attach), \
619     DEVMETHOD(device_detach,    ata_pci_detach), \
620     DEVMETHOD(device_suspend,   ata_pci_suspend), \
621     DEVMETHOD(device_resume,    ata_pci_resume), \
622     DEVMETHOD(device_shutdown,  bus_generic_shutdown), \
623     DEVMETHOD(bus_read_ivar,		ata_pci_read_ivar), \
624     DEVMETHOD(bus_write_ivar,		ata_pci_write_ivar), \
625     DEVMETHOD(bus_alloc_resource,       ata_pci_alloc_resource), \
626     DEVMETHOD(bus_release_resource,     ata_pci_release_resource), \
627     DEVMETHOD(bus_activate_resource,    bus_generic_activate_resource), \
628     DEVMETHOD(bus_deactivate_resource,  bus_generic_deactivate_resource), \
629     DEVMETHOD(bus_setup_intr,           ata_pci_setup_intr), \
630     DEVMETHOD(bus_teardown_intr,        ata_pci_teardown_intr), \
631     DEVMETHOD(pci_read_config,		ata_pci_read_config), \
632     DEVMETHOD(pci_write_config,		ata_pci_write_config), \
633     DEVMETHOD(bus_print_child,		ata_pci_print_child), \
634     DEVMETHOD(bus_child_location_str,	ata_pci_child_location_str), \
635     DEVMETHOD_END \
636 }; \
637 static driver_t __CONCAT(dname,_driver) = { \
638         "atapci", \
639         __CONCAT(dname,_methods), \
640         sizeof(struct ata_pci_controller) \
641 }; \
642 DRIVER_MODULE(dname, pci, __CONCAT(dname,_driver), ata_pci_devclass, NULL, NULL); \
643 MODULE_VERSION(dname, 1); \
644 MODULE_DEPEND(dname, ata, 1, 1, 1); \
645 MODULE_DEPEND(dname, atapci, 1, 1, 1);
646