From owner-freebsd-bugs@FreeBSD.ORG Sun Nov 23 13:50:25 2003 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B680D16A4CE for ; Sun, 23 Nov 2003 13:50:25 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8542543FAF for ; Sun, 23 Nov 2003 13:50:20 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id hANLoKFY080405 for ; Sun, 23 Nov 2003 13:50:20 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id hANLoKRE080404; Sun, 23 Nov 2003 13:50:20 -0800 (PST) (envelope-from gnats) Resent-Date: Sun, 23 Nov 2003 13:50:20 -0800 (PST) Resent-Message-Id: <200311232150.hANLoKRE080404@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Oliver Fromme Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DA28216A4CF for ; Sun, 23 Nov 2003 13:41:38 -0800 (PST) Received: from lurza.secnetix.de (lurza.secnetix.de [195.143.231.20]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7BB3143FBF for ; Sun, 23 Nov 2003 13:41:37 -0800 (PST) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (jsbapq@localhost [127.0.0.1]) by lurza.secnetix.de (8.12.9p2/8.12.9) with ESMTP id hANLfZb0083429; Sun, 23 Nov 2003 22:41:35 +0100 (CET) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.12.9p2/8.12.9/Submit) id hANLfZtC083428; Sun, 23 Nov 2003 22:41:35 +0100 (CET) (envelope-from olli) Message-Id: <200311232141.hANLfZtC083428@lurza.secnetix.de> Date: Sun, 23 Nov 2003 22:41:35 +0100 (CET) From: Oliver Fromme To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 cc: Oliver Fromme Subject: kern/59624: [PATCH] HightPoint HPT371 support for FreeBSD 4.9 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Oliver Fromme List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Nov 2003 21:50:25 -0000 >Number: 59624 >Category: kern >Synopsis: [PATCH] HightPoint HPT371 support for FreeBSD 4.9 >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: Sun Nov 23 13:50:19 PST 2003 >Closed-Date: >Last-Modified: >Originator: Oliver Fromme >Release: FreeBSD 4.9-RELEASE i386 >Organization: secnetix GmbH & Co. KG, Munich, Germany, www.secnetix.de >Environment: System: FreeBSD dorifer.fromme.com 4.9-RELEASE FreeBSD 4.9-RELEASE #2: Sun Nov 23 19:54:31 CET 2003 olli@dorifer.fromme.com:/usr/src/sys/compile/DORIFER i386 >Description: Support for the HighPoint HPT371 EIDE controller has been committed to 5-current on 2003-06-19, but so far it has not been MFCed to -stable (because of a very different driver structure, I guess). However, since the HPT371 is sufficiently similar to the HPT372, adding support is not very difficult (see the patch below). >How-To-Repeat: Boot a FreeBSD 4.9 machine with a HighPoint HPT371 EIDE controller: pci0: (vendor=0x1103, dev=0x0007) at 11.0 irq 10 And with the below patch: atapci0: port 0xb000-0xb0ff,0xac00-0xac03,0xa800-0xa807,0xa400-0xa403,0xa000-0xa007 irq 10 at device 11.0 on pci0 >Fix: --- src/sys/dev/ata/ata-dma.c.orig Sun Oct 26 20:27:16 2003 +++ src/sys/dev/ata/ata-dma.c Sun Nov 23 19:53:32 2003 @@ -1187,10 +1187,12 @@ case 0x00041103: /* HighPoint HPT366/368/370/372 controllers */ case 0x00051103: /* HighPoint HPT372 controllers */ + case 0x00071103: /* HighPoint HPT371 controllers */ case 0x00081103: /* HighPoint HPT374 controllers */ if (!ATAPI_DEVICE(atadev) && udmamode >= 6 && hpt_cable80(atadev) && ((chiptype == 0x00041103 && chiprev >= 0x05) || (chiptype == 0x00051103 && chiprev >= 0x01) || + (chiptype == 0x00071103 && chiprev >= 0x01) || (chiptype == 0x00081103 && chiprev >= 0x07))) { error = ata_command(atadev, ATA_C_SETFEATURES, 0, ATA_UDMA6, ATA_C_F_SETXFER, ATA_WAIT_READY); @@ -1206,6 +1208,7 @@ if (!ATAPI_DEVICE(atadev) && udmamode >= 5 && hpt_cable80(atadev) && ((chiptype == 0x00041103 && chiprev >= 0x03) || (chiptype == 0x00051103 && chiprev >= 0x01) || + (chiptype == 0x00071103 && chiprev >= 0x01) || (chiptype == 0x00081103 && chiprev >= 0x07))) { error = ata_command(atadev, ATA_C_SETFEATURES, 0, ATA_UDMA5, ATA_C_F_SETXFER, ATA_WAIT_READY); @@ -1532,8 +1535,9 @@ } } else if ((chiptype == 0x00041103 && chiprev >= 0x05) || - (chiptype == 0x00051103 && chiprev >= 0x01)) { - switch (mode) { /* HPT372 */ + (chiptype == 0x00051103 && chiprev >= 0x01) || + (chiptype == 0x00071103 && chiprev >= 0x01)) { + switch (mode) { /* HPT372, HPT371 */ case ATA_PIO0: timing = 0x0d029d5e; break; case ATA_PIO1: timing = 0x0d029d26; break; case ATA_PIO2: timing = 0x0c829ca6; break; --- src/sys/dev/ata/ata-pci.c.orig Wed Oct 22 16:43:52 2003 +++ src/sys/dev/ata/ata-pci.c Sun Nov 23 19:51:04 2003 @@ -315,6 +315,13 @@ } return NULL; + case 0x00071103: + switch (pci_get_revid(dev)) { + case 0x01: + return "HighPoint HPT371 ATA133 controller"; + } + return NULL; + case 0x00081103: switch (pci_get_revid(dev)) { case 0x07: @@ -447,6 +454,7 @@ /* FALLTHROUGH */ case 0x00051103: /* HighPoint HPT372 */ + case 0x00071103: /* HighPoint HPT371 */ case 0x00081103: /* HighPoint HPT374 */ /* turn off interrupt prediction */ pci_write_config(dev, 0x51, (pci_read_config(dev, 0x51, 1) & ~0x03), 1); @@ -567,6 +575,7 @@ switch (ch->chiptype) { case 0x00041103: /* HighPoint HPT366/368/370/372 */ case 0x00051103: /* HighPoint HPT372 */ + case 0x00071103: /* HighPoint HPT371 */ case 0x00081103: /* HighPoint HPT374 */ if (((dmastat = ata_dmastatus(ch)) & (ATA_BMSTAT_ACTIVE | ATA_BMSTAT_INTERRUPT)) != ATA_BMSTAT_INTERRUPT) --- src/share/man/man4/ata.4.orig Wed Oct 16 15:40:51 2002 +++ src/share/man/man4/ata.4 Sun Nov 23 22:22:16 2003 @@ -101,6 +101,8 @@ Ultra DMA 66 (UDMA4), 66 MB/sec .It HighPoint HPT370 Ultra DMA 100 (UDMA5), 100 MB/sec +.It HighPoint HPT371 +Ultra DMA 133 (UDMA6), 133 MB/sec .It HighPoint HPT372 Ultra DMA 133 (UDMA6), 133 MB/sec .It HighPoint HPT374 >Release-Note: >Audit-Trail: >Unformatted: