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 53719 1999-11-26 19:24:26Z 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 IDE controller";
192 case 0x70108086:
193 return "Intel PIIX3 IDE controller";
194 case 0x71118086:
195 return "Intel PIIX4 IDE controller";
196 case 0x522910b9:
197 return "AcerLabs Aladdin IDE controller";
198 case 0x4d33105a:
199 return "Promise Ultra/33 IDE controller";
200 case 0x4d38105a:
201 return "Promise Ultra/66 IDE controller";
202 case 0x00041103:
203 return "HighPoint HPT366 IDE controller";
204 case 0x05711106: /* 82c586 & 82c686 */
205 return "VIA Apollo IDE controller";
206
207 /* unsupported but known chipsets, generic DMA only */
208 case 0x05961106: /* 82c596 */
209 return "VIA Apollo IDE controller (generic mode)";
210 case 0x06401095:
211 return "CMD 640 IDE controller (generic mode)";
212 case 0x06461095:
213 return "CMD 646 IDE controller (generic mode)";
214 case 0xc6931080:
215 return "Cypress 82C693 IDE controller (generic mode)";
216 case 0x01021078:
217 return "Cyrix 5530 IDE controller (generic mode)";
218 default:
219 if (pci_get_class(dev) == PCIC_STORAGE &&
220 (pci_get_subclass(dev) == PCIS_STORAGE_IDE))
221 return "Unknown PCI IDE controller (generic mode)";
222 }
223 return NULL;
224}
225
226static int
227ata_pciprobe(device_t dev)
228{
229 const char *desc = ata_pcimatch(dev);
230 if (desc) {
231 device_set_desc(dev, desc);
232 return 0;
233 }
234 else
235 return ENXIO;
236}
237
--- 596 unchanged lines hidden (view full) ---
834 if (scp->active != ATA_IDLE && scp->active != ATA_REINITING)
835 printf("WARNING: WAIT_READY active=%s\n", active2str(scp->active));
836 scp->active = ATA_WAIT_READY;
837 outb(scp->ioaddr + ATA_CMD, command);
838 if (ata_wait(scp, device, ATA_S_READY) < 0) {
839 printf("ata%d-%s: timeout waiting for command=%02x s=%02x e=%02x\n",
840 scp->lun, device ? "slave" : "master", command,
841 scp->status, scp->error);
842 return -1;
843 }
844 break;
845
846 case ATA_IMMEDIATE:
847 outb(scp->ioaddr + ATA_CMD, command);
848 break;
849
850 default:
851 printf("DANGER: illegal interrupt flag=%s\n", active2str(flags));
--- 87 unchanged lines hidden ---
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 53719 1999-11-26 19:24:26Z 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 IDE controller";
192 case 0x70108086:
193 return "Intel PIIX3 IDE controller";
194 case 0x71118086:
195 return "Intel PIIX4 IDE controller";
196 case 0x522910b9:
197 return "AcerLabs Aladdin IDE controller";
198 case 0x4d33105a:
199 return "Promise Ultra/33 IDE controller";
200 case 0x4d38105a:
201 return "Promise Ultra/66 IDE controller";
202 case 0x00041103:
203 return "HighPoint HPT366 IDE controller";
204 case 0x05711106: /* 82c586 & 82c686 */
205 return "VIA Apollo IDE controller";
206
207 /* unsupported but known chipsets, generic DMA only */
208 case 0x05961106: /* 82c596 */
209 return "VIA Apollo IDE controller (generic mode)";
210 case 0x06401095:
211 return "CMD 640 IDE controller (generic mode)";
212 case 0x06461095:
213 return "CMD 646 IDE controller (generic mode)";
214 case 0xc6931080:
215 return "Cypress 82C693 IDE controller (generic mode)";
216 case 0x01021078:
217 return "Cyrix 5530 IDE controller (generic mode)";
218 default:
219 if (pci_get_class(dev) == PCIC_STORAGE &&
220 (pci_get_subclass(dev) == PCIS_STORAGE_IDE))
221 return "Unknown PCI IDE controller (generic mode)";
222 }
223 return NULL;
224}
225
226static int
227ata_pciprobe(device_t dev)
228{
229 const char *desc = ata_pcimatch(dev);
230 if (desc) {
231 device_set_desc(dev, desc);
232 return 0;
233 }
234 else
235 return ENXIO;
236}
237
--- 596 unchanged lines hidden (view full) ---
834 if (scp->active != ATA_IDLE && scp->active != ATA_REINITING)
835 printf("WARNING: WAIT_READY active=%s\n", active2str(scp->active));
836 scp->active = ATA_WAIT_READY;
837 outb(scp->ioaddr + ATA_CMD, command);
838 if (ata_wait(scp, device, ATA_S_READY) < 0) {
839 printf("ata%d-%s: timeout waiting for command=%02x s=%02x e=%02x\n",
840 scp->lun, device ? "slave" : "master", command,
841 scp->status, scp->error);
842 return -1;
843 }
844 break;
845
846 case ATA_IMMEDIATE:
847 outb(scp->ioaddr + ATA_CMD, command);
848 break;
849
850 default:
851 printf("DANGER: illegal interrupt flag=%s\n", active2str(flags));
--- 87 unchanged lines hidden ---