sata on -stable

Soren Schmidt sos at spider.deepcore.dk
Wed Dec 3 03:30:24 PST 2003


It seems Duncan Barclay wrote:

I had a spare minute earlier today, this should do the trick (and is
part of a larger patch due soon), please test and let me know...

Index: ata-dma.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/ata/ata-dma.c,v
retrieving revision 1.35.2.35
diff -u -r1.35.2.35 ata-dma.c
--- ata-dma.c	26 Oct 2003 18:34:23 -0000	1.35.2.35
+++ ata-dma.c	3 Dec 2003 10:28:07 -0000
@@ -506,6 +506,22 @@
 	}
 	break;
 
+    case 0x31491106:	/* VIA 8237 SATA part */
+	if (udmamode) {
+	    error = ata_command(atadev, ATA_C_SETFEATURES, 0,
+				ATA_UDMA + udmamode, 
+				ATA_C_F_SETXFER, ATA_WAIT_READY);
+	    if (bootverbose)
+		ata_prtdev(atadev, "%s setting UDMA%d on VIA chip\n",
+			   (error) ? "failed" : "success", udmamode);
+	    if (!error) {
+		ata_dmacreate(atadev, apiomode, ATA_UDMA + udmamode);
+		return;
+	    }
+	}
+	/* we could set PIO mode timings, but we assume the BIOS did that */
+	break;
+	
     case 0x01bc10de:	/* nVIDIA nForce */
     case 0x74411022:	/* AMD 768 */
     case 0x74111022:	/* AMD 766 */
@@ -522,7 +538,8 @@
 	    char *chip = "VIA";
 
 	    if (ata_find_dev(parent, 0x31471106, 0) ||		/* 8233a */
-		ata_find_dev(parent, 0x31771106, 0)) {		/* 8235 */
+		ata_find_dev(parent, 0x31771106, 0) ||		/* 8235 */
+		ata_find_dev(parent, 0x31491106, 0)) {		/* 8237 */
 		udmamode = imin(udmamode, 6);
 		reg_val = via_modes[3];
 	    }
Index: ata-pci.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/ata/ata-pci.c,v
retrieving revision 1.32.2.17
diff -u -r1.32.2.17 ata-pci.c
--- ata-pci.c	22 Oct 2003 14:43:52 -0000	1.32.2.17
+++ ata-pci.c	3 Dec 2003 10:28:07 -0000
@@ -189,7 +189,12 @@
 	    return "VIA 8233 ATA133 controller";
 	if (ata_find_dev(dev, 0x31771106, 0))
 	    return "VIA 8235 ATA133 controller";
+	if (ata_find_dev(dev, 0x31491106, 0))
+	    return "VIA 8237 ATA133 controller";
 	return "VIA Apollo ATA controller";
+
+    case 0x31491106:
+	return "VIA 8237 SATA150 controller";
 
     case 0x55131039:
 	if (ata_find_dev(dev, 0x06301039, 0x30) ||

-Søren
                       .. but it works under windows!!


More information about the freebsd-hackers mailing list