1/*- 2 * Copyright (c) 1998,1999 S�ren Schmidt 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 --- 11 unchanged lines hidden (view full) --- 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: head/sys/dev/ata/ata-all.c 54270 1999-12-07 22:07:18Z sos $ |
29 */ 30 31#include "ata.h" 32#include "apm.h" 33#include "isa.h" 34#include "pci.h" 35#include "atadisk.h" 36#include "atapicd.h" --- 146 unchanged lines hidden (view full) --- 183ata_pcimatch(device_t dev) 184{ 185 if (pci_get_class(dev) != PCIC_STORAGE) 186 return NULL; 187 188 switch (pci_get_devid(dev)) { 189 /* supported chipsets */ 190 case 0x12308086: |
191 return "Intel PIIX ATA controller"; |
192 case 0x70108086: |
193 return "Intel PIIX3 ATA controller"; |
194 case 0x71118086: |
195 return "Intel PIIX4 ATA controller"; |
196 case 0x522910b9: |
197 return "AcerLabs Aladdin ATA controller"; |
198 case 0x4d33105a: |
199 return "Promise Ultra/33 ATA controller"; |
200 case 0x4d38105a: |
201 return "Promise Ultra/66 ATA controller"; |
202 case 0x00041103: |
203 return "HighPoint HPT366 ATA controller"; |
204 case 0x05711106: /* 82c586 & 82c686 */ |
205 switch (pci_read_config(dev, 0x08, 1)) { 206 case 1: 207 return "VIA 82C586 ATA controller"; 208 case 6: 209 return "VIA 82C686 ATA controller"; 210 } 211 return "VIA Apollo ATA controller"; |
212 213 /* unsupported but known chipsets, generic DMA only */ |
214 case 0x05961106: 215 return "VIA 82C596 ATA controller (generic mode)"; |
216 case 0x06401095: |
217 return "CMD 640 ATA controller (generic mode)"; |
218 case 0x06461095: |
219 return "CMD 646 ATA controller (generic mode)"; |
220 case 0xc6931080: |
221 return "Cypress 82C693 ATA controller (generic mode)"; |
222 case 0x01021078: |
223 return "Cyrix 5530 ATA controller (generic mode)"; |
224 default: 225 if (pci_get_class(dev) == PCIC_STORAGE && 226 (pci_get_subclass(dev) == PCIS_STORAGE_IDE)) |
227 return "Unknown PCI ATA controller (generic mode)"; |
228 } 229 return NULL; 230} 231 232static int 233ata_pciprobe(device_t dev) 234{ 235 const char *desc = ata_pcimatch(dev); |
236 |
237 if (desc) { 238 device_set_desc(dev, desc); 239 return 0; 240 } 241 else 242 return ENXIO; 243} 244 --- 596 unchanged lines hidden (view full) --- 841 if (scp->active != ATA_IDLE && scp->active != ATA_REINITING) 842 printf("WARNING: WAIT_READY active=%s\n", active2str(scp->active)); 843 scp->active = ATA_WAIT_READY; 844 outb(scp->ioaddr + ATA_CMD, command); 845 if (ata_wait(scp, device, ATA_S_READY) < 0) { 846 printf("ata%d-%s: timeout waiting for command=%02x s=%02x e=%02x\n", 847 scp->lun, device ? "slave" : "master", command, 848 scp->status, scp->error); |
849 scp->active = ATA_IDLE; |
850 return -1; 851 } |
852 scp->active = ATA_IDLE; |
853 break; 854 855 case ATA_IMMEDIATE: 856 outb(scp->ioaddr + ATA_CMD, command); 857 break; 858 859 default: 860 printf("DANGER: illegal interrupt flag=%s\n", active2str(flags)); --- 87 unchanged lines hidden --- |