Deleted Added
full compact
ata-pci.c (82053) ata-pci.c (82458)
1/*-
2 * Copyright (c) 1998,1999,2000,2001 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 *
1/*-
2 * Copyright (c) 1998,1999,2000,2001 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-pci.c 82053 2001-08-21 11:35:47Z sos $
28 * $FreeBSD: head/sys/dev/ata/ata-pci.c 82458 2001-08-28 08:59:17Z sos $
29 */
30
31#include <sys/param.h>
32#include <sys/systm.h>
33#include <sys/kernel.h>
34#include <sys/disk.h>
35#include <sys/module.h>
36#include <sys/bus.h>

--- 87 unchanged lines hidden (view full) ---

124 if (ata_find_dev(dev, 0x05861106, 0x02))
125 return "VIA 82C586 ATA33 controller";
126 if (ata_find_dev(dev, 0x05861106, 0))
127 return "VIA 82C586 ATA controller";
128 if (ata_find_dev(dev, 0x05961106, 0x12))
129 return "VIA 82C596 ATA66 controller";
130 if (ata_find_dev(dev, 0x05961106, 0))
131 return "VIA 82C596 ATA33 controller";
29 */
30
31#include <sys/param.h>
32#include <sys/systm.h>
33#include <sys/kernel.h>
34#include <sys/disk.h>
35#include <sys/module.h>
36#include <sys/bus.h>

--- 87 unchanged lines hidden (view full) ---

124 if (ata_find_dev(dev, 0x05861106, 0x02))
125 return "VIA 82C586 ATA33 controller";
126 if (ata_find_dev(dev, 0x05861106, 0))
127 return "VIA 82C586 ATA controller";
128 if (ata_find_dev(dev, 0x05961106, 0x12))
129 return "VIA 82C596 ATA66 controller";
130 if (ata_find_dev(dev, 0x05961106, 0))
131 return "VIA 82C596 ATA33 controller";
132 if (ata_find_dev(dev, 0x06861106, 0x40))
132 if (ata_find_dev(dev, 0x06861106, 0x40) ||
133 ata_find_dev(dev, 0x30741106, 0))
133 return "VIA 82C686 ATA100 controller";
134 if (ata_find_dev(dev, 0x06861106, 0))
135 return "VIA 82C686 ATA66 controller";
136 return "VIA Apollo ATA controller";
137
138 case 0x55131039:
139 return "SiS 5591 ATA33 controller";
140

--- 189 unchanged lines hidden (view full) ---

330 /* set DMA read & end-of-sector fifo flush */
331 pci_write_config(dev, 0x46,
332 (pci_read_config(dev, 0x46, 1) & 0x0c) | 0xf0, 1);
333
334 /* set sector size */
335 pci_write_config(dev, 0x60, DEV_BSIZE, 2);
336 pci_write_config(dev, 0x68, DEV_BSIZE, 2);
337
134 return "VIA 82C686 ATA100 controller";
135 if (ata_find_dev(dev, 0x06861106, 0))
136 return "VIA 82C686 ATA66 controller";
137 return "VIA Apollo ATA controller";
138
139 case 0x55131039:
140 return "SiS 5591 ATA33 controller";
141

--- 189 unchanged lines hidden (view full) ---

331 /* set DMA read & end-of-sector fifo flush */
332 pci_write_config(dev, 0x46,
333 (pci_read_config(dev, 0x46, 1) & 0x0c) | 0xf0, 1);
334
335 /* set sector size */
336 pci_write_config(dev, 0x60, DEV_BSIZE, 2);
337 pci_write_config(dev, 0x68, DEV_BSIZE, 2);
338
338 /* prepare for ATA-66 on the 82C686 and rev 0x12 and newer 82C596's */
339 if (ata_find_dev(dev, 0x06861106, 0) ||
339 /* prepare for ATA-66 on the 82C686a and rev 0x12 and newer 82C596's */
340 if ((ata_find_dev(dev, 0x06861106, 0) &&
341 !ata_find_dev(dev, 0x06861106, 0x40)) ||
340 ata_find_dev(dev, 0x05961106, 0x12))
341 pci_write_config(dev, 0x50, 0x030b030b, 4);
342 ata_find_dev(dev, 0x05961106, 0x12))
343 pci_write_config(dev, 0x50, 0x030b030b, 4);
342
343 break;
344
345 case 0x10001042: /* RZ 100? known bad, no DMA */
346 case 0x10011042:
347 case 0x06401095: /* CMD 640 known bad, no DMA */
348 sc->bmio = NULL;
349 device_printf(dev, "Busmastering DMA disabled\n");
350 }

--- 339 unchanged lines hidden ---
344 break;
345
346 case 0x10001042: /* RZ 100? known bad, no DMA */
347 case 0x10011042:
348 case 0x06401095: /* CMD 640 known bad, no DMA */
349 sc->bmio = NULL;
350 device_printf(dev, "Busmastering DMA disabled\n");
351 }

--- 339 unchanged lines hidden ---