kern/59624: [PATCH] HightPoint HPT371 support for FreeBSD 4.9
Oliver Fromme
olli at secnetix.de
Sun Nov 23 13:50:25 PST 2003
>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 at 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: <unknown card> (vendor=0x1103, dev=0x0007) at 11.0 irq 10
And with the below patch:
atapci0: <HighPoint HPT371 ATA133 controller> 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:
More information about the freebsd-bugs
mailing list