FreeBSD/Linux Kernel Cross Reference
sys/dev/ata/ata-pci.h
1 /*-
2 * Copyright (c) 2003 - 2005 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 * 3. The name of the author may not be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 * $FreeBSD: src/sys/dev/ata/ata-pci.h,v 1.49.2.3.2.1 2005/10/14 09:34:50 scottl Exp $
29 */
30
31 /* structure holding chipset config info */
32 struct ata_chip_id {
33 u_int32_t chipid;
34 u_int8_t chiprev;
35 int cfg1;
36 int cfg2;
37 u_int8_t max_dma;
38 char *text;
39 };
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 struct resource *r_irq;
51 void *handle;
52 struct ata_chip_id *chip;
53 int channels;
54 int (*chipinit)(device_t);
55 int (*allocate)(device_t);
56 int (*locking)(device_t, int);
57 void (*reset)(device_t);
58 void (*dmainit)(device_t);
59 void (*setmode)(device_t, int);
60 struct {
61 void (*function)(void *);
62 void *argument;
63 } interrupt[8]; /* XXX SOS max ch# for now */
64 };
65
66 /* structure for SATA connection update hotplug/hotswap support */
67 struct ata_connect_task {
68 struct task task;
69 device_t dev;
70 int action;
71 #define ATA_C_ATTACH 1
72 #define ATA_C_DETACH 2
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_AMD_ID 0x1022
86 #define ATA_AMD755 0x74011022
87 #define ATA_AMD756 0x74091022
88 #define ATA_AMD766 0x74111022
89 #define ATA_AMD768 0x74411022
90 #define ATA_AMD8111 0x74691022
91
92 #define ATA_ACER_LABS_ID 0x10b9
93 #define ATA_ALI_1533 0x153310b9
94 #define ATA_ALI_5229 0x522910b9
95 #define ATA_ALI_5281 0x528110b9
96 #define ATA_ALI_5287 0x528710b9
97 #define ATA_ALI_5288 0x528810b9
98 #define ATA_ALI_5289 0x528910b9
99
100 #define ATA_ATI_ID 0x1002
101 #define ATA_ATI_IXP200 0x43491002
102 #define ATA_ATI_IXP300 0x43691002
103 #define ATA_ATI_IXP400 0x43761002
104 #define ATA_ATI_IXP300_S1 0x436e1002
105 #define ATA_ATI_IXP400_S1 0x43791002
106 #define ATA_ATI_IXP400_S2 0x437a1002
107
108 #define ATA_CENATEK_ID 0x16ca
109 #define ATA_CENATEK_ROCKET 0x000116ca
110
111 #define ATA_CYRIX_ID 0x1078
112 #define ATA_CYRIX_5530 0x01021078
113
114 #define ATA_CYPRESS_ID 0x1080
115 #define ATA_CYPRESS_82C693 0xc6931080
116
117 #define ATA_DEC_21150 0x00221011
118 #define ATA_DEC_21150_1 0x00231011
119
120 #define ATA_HIGHPOINT_ID 0x1103
121 #define ATA_HPT366 0x00041103
122 #define ATA_HPT372 0x00051103
123 #define ATA_HPT302 0x00061103
124 #define ATA_HPT371 0x00071103
125 #define ATA_HPT374 0x00081103
126
127 #define ATA_INTEL_ID 0x8086
128 #define ATA_I960RM 0x09628086
129 #define ATA_I82371FB 0x12308086
130 #define ATA_I82371SB 0x70108086
131 #define ATA_I82371AB 0x71118086
132 #define ATA_I82443MX 0x71998086
133 #define ATA_I82451NX 0x84ca8086
134 #define ATA_I82372FB 0x76018086
135 #define ATA_I82801AB 0x24218086
136 #define ATA_I82801AA 0x24118086
137 #define ATA_I82801BA 0x244a8086
138 #define ATA_I82801BA_1 0x244b8086
139 #define ATA_I82801CA 0x248a8086
140 #define ATA_I82801CA_1 0x248b8086
141 #define ATA_I82801DB 0x24cb8086
142 #define ATA_I82801DB_1 0x24ca8086
143 #define ATA_I82801EB 0x24db8086
144 #define ATA_I82801EB_S1 0x24d18086
145 #define ATA_I82801EB_R1 0x24df8086
146 #define ATA_I6300ESB 0x25a28086
147 #define ATA_I6300ESB_S1 0x25a38086
148 #define ATA_I6300ESB_R1 0x25b08086
149 #define ATA_I82801FB 0x266f8086
150 #define ATA_I82801FB_S1 0x26518086
151 #define ATA_I82801FB_R1 0x26528086
152 #define ATA_I82801FB_M 0x26538086
153 #define ATA_I82801GB 0x27df8086
154 #define ATA_I82801GB_S1 0x27c08086
155 #define ATA_I82801GB_R1 0x27c38086
156 #define ATA_I82801GB_AH 0x27c18086
157 #define ATA_I82801GB_M 0x27c58086
158 #define ATA_I31244 0x32008086
159
160 #define ATA_ITE_ID 0x1283
161 #define ATA_IT8211F 0x82111283
162 #define ATA_IT8212F 0x82121283
163
164 #define ATA_MICRON_ID 0x1042
165 #define ATA_MICRON_RZ1000 0x10001042
166 #define ATA_MICRON_RZ1001 0x10011042
167
168 #define ATA_NATIONAL_ID 0x100b
169 #define ATA_SC1100 0x0502100b
170
171 #define ATA_NVIDIA_ID 0x10de
172 #define ATA_NFORCE1 0x01bc10de
173 #define ATA_NFORCE2 0x006510de
174 #define ATA_NFORCE2_MCP 0x008510de
175 #define ATA_NFORCE2_MCP_S1 0x008e10de
176 #define ATA_NFORCE3 0x00d510de
177 #define ATA_NFORCE3_PRO 0x00e510de
178 #define ATA_NFORCE3_PRO_S1 0x00e310de
179 #define ATA_NFORCE3_PRO_S2 0x00ee10de
180 #define ATA_NFORCE3_MCP 0x003510de
181 #define ATA_NFORCE3_MCP_S1 0x003610de
182 #define ATA_NFORCE3_MCP_S2 0x003e10de
183 #define ATA_NFORCE4 0x005310de
184 #define ATA_NFORCE4_S1 0x005410de
185 #define ATA_NFORCE4_S2 0x005510de
186
187
188 #define ATA_PROMISE_ID 0x105a
189 #define ATA_PDC20246 0x4d33105a
190 #define ATA_PDC20262 0x4d38105a
191 #define ATA_PDC20263 0x0d38105a
192 #define ATA_PDC20265 0x0d30105a
193 #define ATA_PDC20267 0x4d30105a
194 #define ATA_PDC20268 0x4d68105a
195 #define ATA_PDC20269 0x4d69105a
196 #define ATA_PDC20270 0x6268105a
197 #define ATA_PDC20271 0x6269105a
198 #define ATA_PDC20275 0x1275105a
199 #define ATA_PDC20276 0x5275105a
200 #define ATA_PDC20277 0x7275105a
201 #define ATA_PDC20318 0x3318105a
202 #define ATA_PDC20319 0x3319105a
203 #define ATA_PDC20371 0x3371105a
204 #define ATA_PDC20375 0x3375105a
205 #define ATA_PDC20376 0x3376105a
206 #define ATA_PDC20377 0x3377105a
207 #define ATA_PDC20378 0x3373105a
208 #define ATA_PDC20379 0x3372105a
209 #define ATA_PDC20571 0x3571105a
210 #define ATA_PDC20575 0x3d75105a
211 #define ATA_PDC20579 0x3574105a
212 #define ATA_PDC20580 0x3570105a
213 #define ATA_PDC40518 0x3d18105a
214 #define ATA_PDC40519 0x3519105a
215 #define ATA_PDC40718 0x3d17105a
216 #define ATA_PDC40719 0x3515105a
217 #define ATA_PDC20617 0x6617105a
218 #define ATA_PDC20618 0x6626105a
219 #define ATA_PDC20619 0x6629105a
220 #define ATA_PDC20620 0x6620105a
221 #define ATA_PDC20621 0x6621105a
222 #define ATA_PDC20622 0x6622105a
223
224 #define ATA_SERVERWORKS_ID 0x1166
225 #define ATA_ROSB4_ISA 0x02001166
226 #define ATA_ROSB4 0x02111166
227 #define ATA_CSB5 0x02121166
228 #define ATA_CSB6 0x02131166
229 #define ATA_CSB6_1 0x02171166
230
231 #define ATA_SILICON_IMAGE_ID 0x1095
232 #define ATA_SII3114 0x31141095
233 #define ATA_SII3512 0x35121095
234 #define ATA_SII3112 0x31121095
235 #define ATA_SII3112_1 0x02401095
236 #define ATA_SII0680 0x06801095
237 #define ATA_CMD646 0x06461095
238 #define ATA_CMD648 0x06481095
239 #define ATA_CMD649 0x06491095
240
241 #define ATA_SIS_ID 0x1039
242 #define ATA_SISSOUTH 0x00081039
243 #define ATA_SIS5511 0x55111039
244 #define ATA_SIS5513 0x55131039
245 #define ATA_SIS5517 0x55171039
246 #define ATA_SIS5518 0x55181039
247 #define ATA_SIS5571 0x55711039
248 #define ATA_SIS5591 0x55911039
249 #define ATA_SIS5596 0x55961039
250 #define ATA_SIS5597 0x55971039
251 #define ATA_SIS5598 0x55981039
252 #define ATA_SIS5600 0x56001039
253 #define ATA_SIS530 0x05301039
254 #define ATA_SIS540 0x05401039
255 #define ATA_SIS550 0x05501039
256 #define ATA_SIS620 0x06201039
257 #define ATA_SIS630 0x06301039
258 #define ATA_SIS635 0x06351039
259 #define ATA_SIS633 0x06331039
260 #define ATA_SIS640 0x06401039
261 #define ATA_SIS645 0x06451039
262 #define ATA_SIS646 0x06461039
263 #define ATA_SIS648 0x06481039
264 #define ATA_SIS650 0x06501039
265 #define ATA_SIS651 0x06511039
266 #define ATA_SIS652 0x06521039
267 #define ATA_SIS655 0x06551039
268 #define ATA_SIS658 0x06581039
269 #define ATA_SIS661 0x06611039
270 #define ATA_SIS730 0x07301039
271 #define ATA_SIS733 0x07331039
272 #define ATA_SIS735 0x07351039
273 #define ATA_SIS740 0x07401039
274 #define ATA_SIS745 0x07451039
275 #define ATA_SIS746 0x07461039
276 #define ATA_SIS748 0x07481039
277 #define ATA_SIS750 0x07501039
278 #define ATA_SIS751 0x07511039
279 #define ATA_SIS752 0x07521039
280 #define ATA_SIS755 0x07551039
281 #define ATA_SIS961 0x09611039
282 #define ATA_SIS962 0x09621039
283 #define ATA_SIS963 0x09631039
284 #define ATA_SIS964 0x09641039
285 #define ATA_SIS965 0x09651039
286 #define ATA_SIS180 0x01801039
287 #define ATA_SIS181 0x01811039
288 #define ATA_SIS182 0x01821039
289
290 #define ATA_VIA_ID 0x1106
291 #define ATA_VIA82C571 0x05711106
292 #define ATA_VIA82C586 0x05861106
293 #define ATA_VIA82C596 0x05961106
294 #define ATA_VIA82C686 0x06861106
295 #define ATA_VIA8231 0x82311106
296 #define ATA_VIA8233 0x30741106
297 #define ATA_VIA8233A 0x31471106
298 #define ATA_VIA8233C 0x31091106
299 #define ATA_VIA8235 0x31771106
300 #define ATA_VIA8237 0x32271106
301 #define ATA_VIA8361 0x31121106
302 #define ATA_VIA8363 0x03051106
303 #define ATA_VIA8371 0x03911106
304 #define ATA_VIA8662 0x31021106
305 #define ATA_VIA6410 0x31641106
306 #define ATA_VIA6420 0x31491106
307 #define ATA_VIA6421 0x32491106
308
309 /* chipset setup related defines */
310 #define ATPOLD 1
311
312 #define ALIOLD 0x01
313 #define ALINEW 0x02
314 #define ALISATA 0x04
315
316 #define HPT366 0
317 #define HPT370 1
318 #define HPT372 2
319 #define HPT374 3
320 #define HPTOLD 0x01
321
322 #define PROLD 0
323 #define PRNEW 1
324 #define PRTX 2
325 #define PRMIO 3
326 #define PRTX4 0x01
327 #define PRSX4X 0x02
328 #define PRSX6K 0x04
329 #define PRPATA 0x08
330 #define PRCMBO 0x10
331 #define PRCMBO2 0x20
332 #define PRSATA 0x40
333 #define PRSATA2 0x80
334
335 #define SWKS33 0
336 #define SWKS66 1
337 #define SWKS100 2
338
339 #define SIIMEMIO 1
340 #define SIIINTR 0x01
341 #define SIISETCLK 0x02
342 #define SIIBUG 0x04
343 #define SII4CH 0x08
344
345 #define SIS_SOUTH 1
346 #define SISSATA 2
347 #define SIS133NEW 3
348 #define SIS133OLD 4
349 #define SIS100NEW 5
350 #define SIS100OLD 6
351 #define SIS66 7
352 #define SIS33 8
353
354 #define VIA33 0
355 #define VIA66 1
356 #define VIA100 2
357 #define VIA133 3
358 #define AMDNVIDIA 4
359
360 #define AMDCABLE 0x01
361 #define AMDBUG 0x02
362 #define NVIDIA 0x04
363 #define NV4OFF 0x08
364 #define VIACLK 0x10
365 #define VIABUG 0x20
366 #define VIABAR 0x40
367
368
369 /* global prototypes ata-pci.c */
370 int ata_pci_probe(device_t dev);
371 int ata_pci_attach(device_t dev);
372 int ata_pci_detach(device_t dev);
373 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);
374 int ata_pci_release_resource(device_t dev, device_t child, int type, int rid, struct resource *r);
375 int ata_pci_setup_intr(device_t dev, device_t child, struct resource *irq, int flags, driver_intr_t *function, void *argument, void **cookiep);
376 int ata_pci_teardown_intr(device_t dev, device_t child, struct resource *irq, void *cookie);
377 int ata_pci_allocate(device_t dev);
378
379 /* global prototypes ata-chipset.c */
380 int ata_generic_ident(device_t);
381 int ata_acard_ident(device_t);
382 int ata_ali_ident(device_t);
383 int ata_amd_ident(device_t);
384 int ata_ati_ident(device_t);
385 int ata_cyrix_ident(device_t);
386 int ata_cypress_ident(device_t);
387 int ata_highpoint_ident(device_t);
388 int ata_intel_ident(device_t);
389 int ata_ite_ident(device_t);
390 int ata_national_ident(device_t);
391 int ata_nvidia_ident(device_t);
392 int ata_promise_ident(device_t);
393 int ata_serverworks_ident(device_t);
394 int ata_sii_ident(device_t);
395 int ata_sis_ident(device_t);
396 int ata_via_ident(device_t);
397 int ata_legacy(device_t);
398 struct ata_chip_id *ata_match_chip(device_t, struct ata_chip_id *);
399
400 /* global prototypes ata-dma.c */
401 void ata_dmainit(device_t);
Cache object: e3adf2ae9e33947374c0242dccd117c1
|