From owner-cvs-all Tue Dec 18 18:13:51 2001 Delivered-To: cvs-all@freebsd.org Received: from rutger.owt.com (rutger.owt.com [204.118.6.16]) by hub.freebsd.org (Postfix) with ESMTP id 2E9F437B405; Tue, 18 Dec 2001 18:13:23 -0800 (PST) Received: from owt.com (owt-207-41-94-232.owt.com [207.41.94.232]) by rutger.owt.com (8.9.3/8.9.3) with ESMTP id SAA13031; Tue, 18 Dec 2001 18:13:21 -0800 Message-ID: <3C1FF7C1.7010807@owt.com> Date: Tue, 18 Dec 2001 18:13:21 -0800 From: Kent Stewart User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.4) Gecko/20011128 Netscape6/6.2.1 X-Accept-Language: en-us MIME-Version: 1.0 To: John Baldwin Cc: cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG Subject: Re: cvs commit: src/sys/dev/ata ata-pci.c References: <200112190153.fBJ1rBl16771@freefall.freebsd.org> Content-Type: multipart/mixed; boundary="------------050807030304040409000307" Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG This is a multi-part message in MIME format. --------------050807030304040409000307 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit John Baldwin wrote: > jhb 2001/12/18 17:53:11 PST > > Modified files: > sys/dev/ata ata-pci.c > Log: > Display the right message for the SiS 645 chipset. > > Submitted by: Kent Stewart > > Revision Changes Path > 1.23 +1 -0 src/sys/dev/ata/ata-pci.c If you run -stable on your system, the same changes to -stable are attached. I probably should have finished making ata_find_dev look like current but I got lazy at that point. I have 3 systems running them. A Promise Ultra 100 is about 10% faster. That is a larger difference than the difference between ad0 at UDMA33 and 66. The drives show up as ad0: 19541MB [39703/16/63] at ata0-master UDMA66 ad1: 6679MB [14475/15/63] at ata0-slave UDMA33 ad2: 29311MB [59554/16/63] at ata1-slave UDMA100 Kent -- Kent Stewart Richland, WA mailto:kbstew99@hotmail.com http://users.owt.com/kstewart/index.html FreeBSD News http://daily.daemonnews.org/ --------------050807030304040409000307 Content-Type: text/plain; name="ata-all.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="ata-all.patch" --- ata-all.c.orig Sat Dec 15 03:03:03 2001 +++ ata-all.c Sat Dec 15 20:44:03 2001 @@ -216,7 +216,7 @@ }; int -ata_find_dev(device_t dev, u_int32_t type, u_int32_t revid) +ata_find_dev(device_t dev, u_int32_t devid, u_int32_t revid) { device_t *children, child; int nchildren, i; @@ -228,9 +228,7 @@ child = children[i]; /* check that it's on the same silicon and the device we want */ - if (pci_get_slot(dev) == pci_get_slot(child) && - pci_get_vendor(child) == (type & 0xffff) && - pci_get_device(child) == ((type & 0xffff0000) >> 16) && + if (pci_get_devid(child) == devid && pci_get_revid(child) >= revid) { free(children, M_TEMP); return 1; @@ -297,6 +295,19 @@ return "VIA Apollo ATA controller"; case 0x55131039: + if (ata_find_dev(dev, 0x06301039, 0x30) || + ata_find_dev(dev, 0x06331039, 0x00) || + ata_find_dev(dev, 0x06351039, 0x00) || + ata_find_dev(dev, 0x06451039, 0x00) || + ata_find_dev(dev, 0x07301039, 0x00) || + ata_find_dev(dev, 0x07331039, 0x00) || + ata_find_dev(dev, 0x07351039, 0x00)) + return "SiS 5591 ATA100 controller"; + if (ata_find_dev(dev, 0x05301039, 0x00) || + ata_find_dev(dev, 0x05401039, 0x00) || + ata_find_dev(dev, 0x06201039, 0x00) || + ata_find_dev(dev, 0x06301039, 0x00)) + return "SiS 5591 ATA66 controller"; return "SiS 5591 ATA33 controller"; case 0x06491095: --------------050807030304040409000307 Content-Type: text/plain; name="ata-dma.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="ata-dma.patch" --- ata-dma.c.orig Fri Dec 14 21:44:24 2001 +++ ata-dma.c Sat Dec 15 22:13:55 2001 @@ -520,32 +520,104 @@ break; case 0x55131039: /* SiS 5591 */ - if (udmamode >= 2 && pci_get_revid(parent) > 0xc1) { - error = ata_command(scp, device, ATA_C_SETFEATURES, 0, 0, 0, - ATA_UDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY); - if (bootverbose) - ata_printf(scp, device, - "%s setting UDMA2 on SiS chip\n", - (error) ? "failed" : "success"); - if (!error) { - pci_write_config(parent, 0x40 + (devno << 1), 0xa301, 2); - scp->mode[ATA_DEV(device)] = ATA_UDMA2; - return; + + if (ata_find_dev(parent, 0x06301039, 0x30) || /* SiS 630 */ + ata_find_dev(parent, 0x06331039, 0x00) || /* SiS 633 */ + ata_find_dev(parent, 0x06351039, 0x00) || /* SiS 635 */ + ata_find_dev(parent, 0x06451039, 0x00) || /* SiS 645 */ + ata_find_dev(parent, 0x07301039, 0x00) || /* SiS 730 */ + ata_find_dev(parent, 0x07331039, 0x00) || /* SiS 733 */ + ata_find_dev(parent, 0x07351039, 0x00)) { /* SiS 735 */ + int8_t reg = 0x40 + (devno << 1); + int16_t val = pci_read_config(parent, reg, 2) & 0x0fff; + + if (udmamode >= 5) { + error = ata_command(scp, device, ATA_C_SETFEATURES, 0, 0, 0, + ATA_UDMA5, ATA_C_F_SETXFER, ATA_WAIT_READY); + if (bootverbose) + ata_printf(scp, device, + "%s setting UDMA5 on SiS chip\n", + (error) ? "failed" : "success"); + if (!error) { + pci_write_config(parent, reg, val | 0x8000, 2); + scp->mode[ATA_DEV(device)] = ATA_UDMA5; + return; + } } - } - if (wdmamode >=2 && apiomode >= 4) { - error = ata_command(scp, device, ATA_C_SETFEATURES, 0, 0, 0, - ATA_WDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY); - if (bootverbose) - ata_printf(scp, device, - "%s setting WDMA2 on SiS chip\n", - (error) ? "failed" : "success"); - if (!error) { - pci_write_config(parent, 0x40 + (devno << 1), 0x0301, 2); - scp->mode[ATA_DEV(device)] = ATA_WDMA2; - return; + if (udmamode >= 4) { + error = ata_command(scp, device, ATA_C_SETFEATURES, 0, 0, 0, + ATA_UDMA4, ATA_C_F_SETXFER, ATA_WAIT_READY); + if (bootverbose) + ata_printf(scp, device, + "%s setting UDMA4 on SiS chip\n", + (error) ? "failed" : "success"); + if (!error) { + pci_write_config(parent, reg, val | 0x9000, 2); + scp->mode[ATA_DEV(device)] = ATA_UDMA4; + return; + } } - } + if (udmamode >= 2) { + error = ata_command(scp, device, ATA_C_SETFEATURES, 0, 0, 0, + ATA_UDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY); + if (bootverbose) + ata_printf(scp, device, + "%s setting UDMA2 on SiS chip\n", + (error) ? "failed" : "success"); + if (!error) { + pci_write_config(parent, reg, val | 0xb000, 2); + scp->mode[ATA_DEV(device)] = ATA_UDMA2; + return; + } + } + } else if (ata_find_dev(parent, 0x05301039, 0) || /* SiS 530 */ + ata_find_dev(parent, 0x05401039, 0) || /* SiS 540 */ + ata_find_dev(parent, 0x06201039, 0) || /* SiS 620 */ + ata_find_dev(parent, 0x06301039, 0)) { /* SiS 630 */ + int8_t reg = 0x40 + (devno << 1); + int16_t val = pci_read_config(parent, reg, 2) & 0x0fff; + + if (udmamode >= 4) { + error = ata_command(scp, device, ATA_C_SETFEATURES, 0, 0, 0, + ATA_UDMA4, ATA_C_F_SETXFER, ATA_WAIT_READY); + if (bootverbose) + ata_printf(scp, device, + "%s setting UDMA4 on SiS chip\n", + (error) ? "failed" : "success"); + if (!error) { + pci_write_config(parent, reg, val | 0x9000, 2); + scp->mode[ATA_DEV(device)] = ATA_UDMA4; + return; + } + } + if (udmamode >= 2) { + error = ata_command(scp, device, ATA_C_SETFEATURES, 0, 0, 0, + ATA_UDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY); + if (bootverbose) + ata_printf(scp, device, + "%s setting UDMA2 on SiS chip\n", + (error) ? "failed" : "success"); + if (!error) { + pci_write_config(parent, reg, val | 0xa000, 2); + scp->mode[ATA_DEV(device)] = ATA_UDMA2; + return; + } + } + } else { /* SiS 5591 */ + if (udmamode >= 2 && pci_get_revid(parent) > 0xc1) { + error = ata_command(scp, device, ATA_C_SETFEATURES, 0, 0, 0, + ATA_UDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY); + if (bootverbose) + ata_printf(scp, device, + "%s setting UDMA2 on SiS chip\n", + (error) ? "failed" : "success"); + if (!error) { + pci_write_config(parent, 0x40 + (devno << 1), 0xa301, 2); + scp->mode[ATA_DEV(device)] = ATA_UDMA2; + return; + } + } + } /* we could set PIO mode timings, but we assume the BIOS did that */ break; --------------050807030304040409000307-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message