It seems Richard Seaman, Jr. wrote:
> On Wed, Dec 08, 1999 at 12:55:35PM +0100, Poul-Henning Kamp wrote:
> >
> > In a few days time the wd driver will be retired from FreeBSDs
> > i386 architecture.
> >
>
> Since the ata driver does not support DMA on my chipset, at
> least the last time I tried (SiS 5591), it would be nice
> to leave the wd driver in the tree for a while, even if its
> not the default. Possibly there are others in the same boat?
OK, you asked for it, following is a patch to support the
sis 5591 chipset. Remember this is done blindfolded, I
have no HW to test on, but you guys do :)
Let me know what happens...
Index: ata-all.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/ata/ata-all.c,v
retrieving revision 1.33
diff -u -r1.33 ata-all.c
--- ata-all.c 1999/12/07 22:07:18 1.33
+++ ata-all.c 1999/12/08 13:57:27
@@ -195,12 +195,6 @@
return "Intel PIIX4 ATA controller";
case 0x522910b9:
return "AcerLabs Aladdin ATA controller";
- case 0x4d33105a:
- return "Promise Ultra/33 ATA controller";
- case 0x4d38105a:
- return "Promise Ultra/66 ATA controller";
- case 0x00041103:
- return "HighPoint HPT366 ATA controller";
case 0x05711106: /* 82c586 & 82c686 */
switch (pci_read_config(dev, 0x08, 1)) {
case 1:
@@ -209,6 +203,14 @@
return "VIA 82C686 ATA controller";
}
return "VIA Apollo ATA controller";
+ case 0x55131039:
+ return "SiS 5591 ATA controller";
+ case 0x4d33105a:
+ return "Promise Ultra/33 ATA controller";
+ case 0x4d38105a:
+ return "Promise Ultra/66 ATA controller";
+ case 0x00041103:
+ return "HighPoint HPT366 ATA controller";
/* unsupported but known chipsets, generic DMA only */
case 0x05961106:
Index: ata-dma.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/ata/ata-dma.c,v
retrieving revision 1.21
diff -u -r1.21 ata-dma.c
--- ata-dma.c 1999/12/07 22:07:18 1.21
+++ ata-dma.c 1999/12/08 13:57:34
@@ -297,6 +297,42 @@
/* we could set PIO mode timings, but we assume the BIOS did that */
break;
+ case 0x55131039: /* SiS 5591 */
+ devno = (scp->unit << 1) + ((device == ATA_MASTER) ? 0 : 1);
+ if (udmamode >= 2) {
+ int16_t word4x = pci_read_config(scp->dev, 0x40 + (devno << 1), 2);
+
+ pci_write_config(scp->dev, 0x40 + (devno << 1), 0xa301, 2);
+ error = ata_command(scp, device, ATA_C_SETFEATURES, 0, 0, 0,
+ ATA_UDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
+ if (bootverbose)
+ printf("ata%d: %s: %s setting up UDMA2 mode on SiS chip\n",
+ scp->lun, (device == ATA_MASTER) ? "master" : "slave",
+ (error) ? "failed" : "success");
+ if (!error) {
+ scp->mode[(device == ATA_MASTER) ? 0 : 1] = ATA_MODE_UDMA2;
+ return 0;
+ }
+ pci_write_config(scp->dev, 0x40 + (devno << 1), word4x, 2);
+ }
+ if (wdmamode >=2 && apiomode >= 4) {
+ int16_t word4x = pci_read_config(scp->dev, 0x40 + (devno << 1), 2);
+
+ pci_write_config(scp->dev, 0x40 + (devno << 1), 0x0301, 2);
+ error = ata_command(scp, device, ATA_C_SETFEATURES, 0, 0, 0,
+ ATA_WDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
+ if (bootverbose)
+ printf("ata%d: %s: %s setting up WDMA2 mode on SiS chip\n",
+ scp->lun, (device == ATA_MASTER) ? "master" : "slave",
+ (error) ? "failed" : "success");
+ if (!error) {
+ scp->mode[(device == ATA_MASTER) ? 0 : 1] = ATA_MODE_WDMA2;
+ return 0;
+ }
+ pci_write_config(scp->dev, 0x40 + (devno << 1), word4x, 2);
+ }
+ break;
+
case 0x4d33105a: /* Promise Ultra33 / FastTrak33 controllers */
case 0x4d38105a: /* Promise Ultra66 / FastTrak66 controllers */
/* the Promise can only do DMA on ATA disks not on ATAPI devices */
-Søren
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message