From rene@tunix.nl  Fri Jun 25 10:52:32 2004
Return-Path: <rene@tunix.nl>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 38BB816A574
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 25 Jun 2004 10:52:31 +0000 (GMT)
Received: from bastix.tunix.nl (bastix.tunix.nl [193.79.201.39])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 918C943D1F
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 25 Jun 2004 10:52:29 +0000 (GMT)
	(envelope-from rene@tunix.nl)
Received: (from root@localhost) by bastix.tunix.nl (8.9.3c/8.6.12) id MAA99805 for <FreeBSD-gnats-submit@freebsd.org>; Fri, 25 Jun 2004 12:52:15 +0200 (CEST)
Received: by bastix.tunix.nl (TUNIX txp2/smap)
	for <FreeBSD-gnats-submit@freebsd.org> id sma098796; Fri, 25 Jun 04 12:50:34 +0200
Received: from upsilix.tunix.nl (upsilix.tunix.nl [172.16.2.22])
	by fix.tunix.nl (8.10.2+Sun/8.10.2) with ESMTP id i5PAoYo29276
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 25 Jun 2004 12:50:34 +0200 (MEST)
Received: from upsilix.tunix.nl (localhost.tunix.nl [127.0.0.1])
	by upsilix.tunix.nl (8.12.8p2/8.12.6) with ESMTP id i5PAoYD2063364
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 25 Jun 2004 12:50:34 +0200 (CEST)
	(envelope-from rene@upsilix.tunix.nl)
Received: (from rene@localhost)
	by upsilix.tunix.nl (8.12.8p2/8.12.6/Submit) id i5PAoYAg063363;
	Fri, 25 Jun 2004 12:50:34 +0200 (CEST)
	(envelope-from rene)
Message-Id: <200406251050.i5PAoYAg063363@upsilix.tunix.nl>
Date: Fri, 25 Jun 2004 12:50:34 +0200 (CEST)
From: Rene de Vries <rene@tunix.nl>
Reply-To: Rene de Vries <rene@tunix.nl>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: support for intel ICH5 SATA/IDE controller
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         68316
>Category:       kern
>Synopsis:       [patch] add support for intel ICH5 SATA/IDE controller
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    sos
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jun 25 11:00:34 GMT 2004
>Closed-Date:    Mon Sep 06 11:37:17 GMT 2004
>Last-Modified:  Mon Sep 06 11:37:17 GMT 2004
>Originator:     Rene de Vries
>Release:        FreeBSD 4.8 i386
>Organization:
Tunix Internet Security & Training
>Environment:
System: FreeBSD upsilix.tunix.nl 4.8 FreeBSD 4.8-RELEASE-p16 #7: Wed Mar 3 15:00:31 CET 2004 rene@upsilix.tunix.nl:/usr/obj/usr/src/sys/UPSILIX i386

>Description:
	The Intel SE7210TP1 motherboard contains a new controller,
	pci id's were added.
	Futhermore, disable cable check for SATA disks; assume
	SATA is always UDMA100.

Index: sys/dev/ata/ata-dma.c
===================================================================
RCS file: sys/dev/ata/ata-dma.c,v
retrieving revision 1.1.1.5
retrieving revision 1.2
diff -u -r1.1.1.5 -r1.2
--- sys/dev/ata/ata-dma.c	2002/10/15 10:21:38	1.1.1.5
+++ sys/dev/ata/ata-dma.c	2004/06/07 09:42:27	1.2
@@ -104,13 +104,21 @@
     ch->alignment = 0x1;
 
 #if 1
+    if ((ch->chiptype != 0x24188086) && (ch->chiptype != 0x25a38086)) {
+	    /* Only for non-SATA */
     if (udmamode > 2 && !ch->device[ATA_DEV(device)].param->hwres_cblid) {
 	ata_prtdev(atadev,"DMA limited to UDMA33, non-ATA66 cable or device\n");
 	udmamode = 2;
     }
+    }
 #endif
     switch (ch->chiptype) {
 
+    case 0x24db8086:	/* Intel ICH5 */
+    case 0x25a28086:
+    case 0x24188086:	/* Intel ICH5 SATA */ 
+    case 0x25a38086:
+    case 0x24ca8086:	/* Intel ICH4 mobile */
     case 0x24cb8086:	/* Intel ICH4 */
     case 0x248a8086:	/* Intel ICH3 mobile */ 
     case 0x248b8086:	/* Intel ICH3 */
Index: sys/dev/ata/ata-pci.c
===================================================================
RCS file: /usr/local/cvs/cvsroot/fw/os/freebsd/sys/dev/ata/ata-pci.c,v
retrieving revision 1.1.1.3
retrieving revision 1.2
diff -u -r1.1.1.3 -r1.2
--- sys/dev/ata/ata-pci.c	2002/10/15 10:21:38	1.1.1.3
+++ sys/dev/ata/ata-pci.c	2004/06/07 09:42:27	1.2
@@ -146,9 +146,18 @@
     case 0x248b8086:
 	return "Intel ICH3 ATA100 controller";
 
+    case 0x24ca8086:
     case 0x24cb8086:
 	return "Intel ICH4 ATA100 controller";
 
+    case 0x25a38086:
+    case 0x24d18086:
+	return "Intel ICH5 SATA150 controller";
+
+    case 0x25a28086:
+    case 0x24db8086:
+	return "Intel ICH5 ATA100 controller";
+
     case 0x522910b9:
 	if (pci_get_revid(dev) >= 0xc4)
 	    return "AcerLabs Aladdin ATA100 controller";
@@ -593,6 +602,17 @@
 	if (!(ATA_INB(ch->r_bmio, ATA_BMDEVSPEC_1) & 0x20))
 	    return 1;
 	break;
+
+    case 0x25a38086:
+    case 0x24d18086:   /* Intel ICH5 SATA150 */
+	dmastat = ATA_INB(ch->r_bmio, ATA_BMSTAT_PORT);
+	if ((dmastat & (ATA_BMSTAT_ACTIVE | ATA_BMSTAT_INTERRUPT)) !=
+			ATA_BMSTAT_INTERRUPT)
+		return 1;
+	ATA_OUTB(ch->r_bmio, ATA_BMSTAT_PORT, dmastat &
+		~(ATA_BMSTAT_DMA_SIMPLEX | ATA_BMSTAT_ERROR));
+	DELAY(1);
+	return 0;
     }
 
     if (ch->flags & ATA_DMA_ACTIVE) {
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->sos 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Thu Aug 26 20:37:45 GMT 2004 
Responsible-Changed-Why:  
Over to ata maintainer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=68316 
State-Changed-From-To: open->closed 
State-Changed-By: sos 
State-Changed-When: Mon Sep 6 11:35:13 GMT 2004 
State-Changed-Why:  
Support for the ich5 has been committed to releng_4 some time ago. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=68316 
>Unformatted:
