Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Feb 2000 02:40:01 +0900 (JST)
From:      sakichan@lares.dti.ne.jp
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   kern/16912: ATA66 support for Intel ICH
Message-ID:  <200002221739.CAA21478@shrike.dti.ad.jp>

next in thread | raw e-mail | index | archive | help

>Number:         16912
>Category:       kern
>Synopsis:       add UDMA4 mode for Intel ICH
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Feb 22 09:40:01 PST 2000
>Closed-Date:
>Last-Modified:
>Originator:     SAKIYAMA Nobuo
>Release:        FreeBSD 4.0-current i386
>Organization:
none
>Environment:

	i386 systems on i810/820/840 chipsets platform,
	with Ultra ATA66 hard disks.

>Description:

	IDE controller in Intel 82801AA (ICH) can handle
	ATA66 mode, but the current ATA driver does not
	try to ATA66. 

>How-To-Repeat:

	Every boot on i386 systems on i810/820/840 chipsets platform,
	with Ultra ATA66 hard disks connected to the IDE interface
	on the motherboard wired to ICH by the ATA66 cable.

>Fix:
	
	Patch below fix the problem. PCI Config register 0x54
	is "IDE I/O Configuration Register". Bit 0-3 is the base
	clock flag of each drive for UDMA timings. '1' means 66MHz,
	and '0' means 33MHz. bit 4-7 is set/reset for each drive 
	by BIOS in the startup, which reports whether the ATA cable
	is the 80-pin or the 40-pin.

--- src/sys/dev/ata/ata-dma.c-orig	Sat Feb 19 05:57:29 2000
+++ src/sys/dev/ata/ata-dma.c	Tue Feb 22 02:46:56 2000
@@ -96,9 +96,33 @@
 
     switch (scp->chiptype) {
 
+    case 0x24118086:    /* Intel ICH */
+	if (udmamode >= 4) {
+	    int32_t mask48, new48, new54;
+
+	    new54 = pci_read_config(parent, 0x54, 2);
+	    if (new54 & ( 1<< (devno+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, "ICH setting up UDMA4 mode on %s chip\n",
+			       (error) ? "failed" : "success");
+		if (!error) {
+		    mask48 = (1 << devno) + (3 << (16 + (devno << 2)));
+		    new48 = (1 << devno) + (2 << (16 + (devno << 2)));
+		    pci_write_config(parent, 0x48,
+				     (pci_read_config(parent, 0x48, 4) &
+				     ~mask48) | new48, 4);
+		    pci_write_config(parent, 0x54, new54 | (1 << devno), 2);
+		    scp->mode[ATA_DEV(device)] = ATA_UDMA4;
+		    return;
+		}
+	    }
+	}           
+	/* FALLTHROUGH */
+
     case 0x71118086:	/* Intel PIIX4 */
     case 0x71998086:	/* Intel PIIX4e */
-    case 0x24118086:	/* Intel ICH */
     case 0x24218086:	/* Intel ICH0 */
 	if (udmamode >= 2) {
 	    int32_t mask48, new48;


>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200002221739.CAA21478>