Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 14 Dec 2003 11:49:54 +0900 (JST)
From:      Yousuke HARADA <harada@lab.ss.titech.ac.jp>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   kern/60218: [PATCH] HPT302 ATA133 Support for 4.9-STABLE
Message-ID:  <200312140249.hBE2nsTe038632@ariel.local>
Resent-Message-ID: <200312140300.hBE30QP4073984@freefall.freebsd.org>

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

>Number:         60218
>Category:       kern
>Synopsis:       [PATCH] HPT302 ATA133 Support for 4.9-STABLE
>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:   Sat Dec 13 19:00:26 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     Yousuke HARADA
>Release:        FreeBSD 4.9-STABLE i386
>Organization:
Tokyo Institute of Technology
>Environment:
System: FreeBSD armada 4.9-STABLE FreeBSD 4.9-STABLE #2: Tue Dec 2 23:49:24 JST 2003 harada@armada:/usr/obj/usr/src/sys/ARMADA i386


>Description:
4.9-STABLE on Sat Dec 13 20:33:17 JST 2003 does not support HighPoint
HPT302 ATA133 Controller.
5.2-CURRENT support HPT302, but 4.9-STABLE not.

I wrote a simple patch to support HPT302. HPT302 is resembling HPT372.

>How-To-Repeat:
boot 4.9-STABLE with HighPoint Rocket133SB(HPT302) displays:

pci0: <unknown card> (vendor=0x1103, dev=0x0006) at 10.0 irq 11

>Fix:
After applying patch below, boot time displays:

atapci1: <HighPoint HPT302 ATA133 controller> port 0xc800-0xc8ff,0xc400-0xc403,0
xc000-0xc007,0xbc00-0xbc03,0xb800-0xb807 irq 11 at device 10.0 on pci0
ata2: at 0xb800 on atapci1
ata3: at 0xc000 on atapci1
 and
ad6: 78533MB <HDS722580VLAT20> [159560/16/63] at ata3-master UDMA100

And HDD seems to works fine.
Using custom kern.flp and mfsroot.flp applied the patch, I cound install
4.9-RELEASE.

diff -ur src/sys/dev/ata.org/ata-dma.c src/sys/dev/ata/ata-dma.c
--- src/sys/dev/ata.org/ata-dma.c	Thu Dec  4 19:47:41 2003
+++ src/sys/dev/ata/ata-dma.c	Sat Dec 13 20:26:09 2003
@@ -1222,10 +1222,12 @@
     
     case 0x00041103:	/* HighPoint HPT366/368/370/372 controllers */
     case 0x00051103:	/* HighPoint HPT372 controllers */
+    case 0x00061103:	/* HighPoint HPT302 controllers */
     case 0x00081103:	/* HighPoint HPT374 controllers */
 	if (!ATAPI_DEVICE(atadev) && udmamode >= 6 && hpt_cable80(atadev) &&
 	    ((chiptype == 0x00041103 && chiprev >= 0x05) ||
 	     (chiptype == 0x00051103 && chiprev >= 0x01) ||
+	     (chiptype == 0x00061103 && chiprev >= 0x01) ||
 	     (chiptype == 0x00081103 && chiprev >= 0x07))) {
 	    error = ata_command(atadev, ATA_C_SETFEATURES, 0,
 				ATA_UDMA6, ATA_C_F_SETXFER, ATA_WAIT_READY);
@@ -1241,6 +1243,7 @@
 	if (!ATAPI_DEVICE(atadev) && udmamode >= 5 && hpt_cable80(atadev) &&
 	    ((chiptype == 0x00041103 && chiprev >= 0x03) ||
 	     (chiptype == 0x00051103 && chiprev >= 0x01) ||
+	     (chiptype == 0x00061103 && chiprev >= 0x01) ||
 	     (chiptype == 0x00081103 && chiprev >= 0x07))) {
 	    error = ata_command(atadev, ATA_C_SETFEATURES, 0,
 				ATA_UDMA5, ATA_C_F_SETXFER, ATA_WAIT_READY);
@@ -1567,7 +1570,8 @@
 	}
     }
     else if ((chiptype == 0x00041103 && chiprev >= 0x05) ||
-	     (chiptype == 0x00051103 && chiprev >= 0x01)) {
+	     (chiptype == 0x00051103 && chiprev >= 0x01) ||
+	     (chiptype == 0x00061103 && chiprev >= 0x01)) {
 	switch (mode) {						/* HPT372 */
 	case ATA_PIO0:	timing = 0x0d029d5e; break;
 	case ATA_PIO1:	timing = 0x0d029d26; break;
diff -ur src/sys/dev/ata.org/ata-pci.c src/sys/dev/ata/ata-pci.c
--- src/sys/dev/ata.org/ata-pci.c	Thu Dec  4 19:47:42 2003
+++ src/sys/dev/ata/ata-pci.c	Sat Dec 13 20:26:09 2003
@@ -335,6 +335,13 @@
 	}
 	return NULL;
 
+    case 0x00061103:
+	switch (pci_get_revid(dev)) {
+	case 0x01:
+	    return "HighPoint HPT302 ATA133 controller";
+	}
+	return NULL;
+
     case 0x00081103:
 	switch (pci_get_revid(dev)) {
 	case 0x07:
@@ -467,6 +474,7 @@
 	/* FALLTHROUGH */
 
     case 0x00051103:	/* HighPoint HPT372 */
+    case 0x00061103:	/* HighPoint HPT302 */
     case 0x00081103:	/* HighPoint HPT374 */
 	/* turn off interrupt prediction */
 	pci_write_config(dev, 0x51, (pci_read_config(dev, 0x51, 1) & ~0x03), 1);
>Release-Note:
>Audit-Trail:
>Unformatted:



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