From owner-freebsd-hackers Sun Dec 2 0:44:41 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from freebsd.dk (fw-rl0.freebsd.dk [212.242.86.114]) by hub.freebsd.org (Postfix) with ESMTP id 24F6737B417; Sun, 2 Dec 2001 00:44:36 -0800 (PST) Received: (from sos@localhost) by freebsd.dk (8.11.6/8.11.6) id fB28iTi52838; Sun, 2 Dec 2001 09:44:29 +0100 (CET) (envelope-from sos) From: Søren Schmidt Message-Id: <200112020844.fB28iTi52838@freebsd.dk> Subject: Re: UDMA33 and SiS5591 on FreeBSD 4.4-RELEASE In-Reply-To: <3C09D6F9.7070504@ns.aus.com> To: rsharpe@ns.aus.com Date: Sun, 2 Dec 2001 09:44:29 +0100 (CET) Cc: Greg Lehey , Zwane Mwaikambo , freebsd-hackers@FreeBSD.ORG Reply-To: sos@freebsd.dk X-Mailer: ELM [version 2.4ME+ PL94b (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=ISO-8859-1 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG It seems Richard Sharpe wrote: > Attached is the patch I am using, which is based on what Greg gave me. > It tries UDMA5 first, and steps down ... The following patch is bogus, it doesn't set the chip to the prober mode (always sets it to UDMA2), it just set the disk, this wont work guys... I have a SiS patch in the works (for current that is), that should take care of the ATA mode setup... The geometry is a different matter.... > Richard Sharpe, rsharpe@ns.aus.com, LPIC-1 > www.samba.org, www.ethereal.com, SAMS Teach Yourself Samba > in 24 Hours, Special Edition, Using Samba > --- ata-dma.c.orig Wed Oct 31 07:29:52 2001 > +++ ata-dma.c Fri Nov 30 14:38:52 2001 > @@ -519,30 +519,61 @@ > 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 (bootverbose) > + printf ("SiS 5513/5591, udmamode %d\n", udmamode); > + if (pci_get_revid(parent) > 0xc1) { > + udmamode = 5; /* Force it to 100 */ > + if (udmamode >= 5) { /* Claims UDMA 100 */ > + 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, 0x40 + (devno << 1), 0xa301, 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) { /* Claims UDMA 66 */ > + 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, 0x40 + (devno << 1), 0xa301, 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, 0x40 + (devno << 1), 0xa301, 2); > + scp->mode[ATA_DEV(device)] = ATA_UDMA2; > + 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; > + } > } > } > /* we could set PIO mode timings, but we assume the BIOS did that */ -Søren To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message