Subject: kern/34097: HPT368
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: None <jakllsch@kollasch.net>
List: netbsd-bugs
Date: 07/27/2006 02:40:00
>Number:         34097
>Category:       kern
>Synopsis:       HPT368 can be supported (trivial patch included)
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Thu Jul 27 02:40:00 +0000 2006
>Originator:     Jonathan A. Kollasch
>Release:        NetBSD 3.0
>Organization:
>Environment:
System: NetBSD kirkkit.kollasch.net 3.0 NetBSD 3.0 (KIRKKIT) #1: Sat Jul 1 19:22:44 CDT 2006 root@kirkkit.kollasch.net:/usr/src/sys/arch/i386/compile/KIRKKIT i386
Architecture: i386
Machine: i386
>Description:
HPT368 IDE controller is much like the 366.
>How-To-Repeat:
Try to use the HPT368.
>Fix:
--- /tmp/pciide_hpt_reg.h       2006-07-26 21:35:00.000000000 -0500
+++ pciide_hpt_reg.h    2006-07-13 20:07:12.000000000 -0500
@@ -44,6 +44,7 @@
  * same revision
  */
 #define HPT366_REV 0x01
+#define HPT368_REV 0x02
 #define HPT370_REV 0x03
 #define HPT370A_REV 0x04
 #define HPT372_REV 0x05



--- hptide.c.save	2006-01-16 14:30:19.000000000 -0600
+++ hptide.c	2006-07-13 18:53:18.000000000 -0500
@@ -141,6 +141,8 @@
 			aprint_normal("HPT370 IDE Controller\n");
 		else if (revision == HPT370A_REV)
 			aprint_normal("HPT370A IDE Controller\n");
+		else if (revision == HPT368_REV)
+			aprint_normal("HPT368 IDE Controller\n");
 		else if (revision == HPT366_REV)
 			aprint_normal("HPT366 IDE Controller\n");
 		else
@@ -162,7 +164,7 @@
 		interface = PCIIDE_INTERFACE_BUS_MASTER_DMA |
 		    PCIIDE_INTERFACE_PCI(0);
 		if ((sc->sc_pp->ide_product == PCI_PRODUCT_TRIONES_HPT366 &&
-		    (revision == HPT370_REV || revision == HPT370A_REV ||
+		    (revision == HPT368_REV || revision == HPT370_REV || revision == HPT370A_REV ||
 		     revision == HPT372_REV)) ||
 		    sc->sc_pp->ide_product == PCI_PRODUCT_TRIONES_HPT302 ||
 		    sc->sc_pp->ide_product == PCI_PRODUCT_TRIONES_HPT371 ||
@@ -186,7 +188,7 @@
 	sc->sc_wdcdev.sc_atac.atac_set_modes = hpt_setup_channel;
 	sc->sc_wdcdev.sc_atac.atac_channels = sc->wdc_chanarray;
 	if (sc->sc_pp->ide_product == PCI_PRODUCT_TRIONES_HPT366 &&
-	    revision == HPT366_REV) {
+	    (revision == HPT366_REV || revision == HPT368_REV)) {
 		sc->sc_wdcdev.sc_atac.atac_nchannels = 1;
 		sc->sc_wdcdev.sc_atac.atac_udma_cap = 4;
 	} else {
@@ -247,7 +249,7 @@
 		wdcattach(&cp->ata_channel);
 	}
 	if ((sc->sc_pp->ide_product == PCI_PRODUCT_TRIONES_HPT366 &&
-	    (revision == HPT370_REV || revision == HPT370A_REV ||
+	    (revision == HPT368_REV || revision == HPT370_REV || revision == HPT370A_REV ||
 	     revision == HPT372_REV)) ||
 	    sc->sc_pp->ide_product == PCI_PRODUCT_TRIONES_HPT302 ||
 	    sc->sc_pp->ide_product == PCI_PRODUCT_TRIONES_HPT371 ||
@@ -323,6 +325,7 @@
 			tim_dma = hpt370_dma;
 			tim_pio = hpt370_pio;
 			break;
+		case HPT368_REV:
 		case HPT366_REV:
 		default:
 			tim_udma = hpt366_udma;