Subject: kern/17757: Intel ICH4 support for pciide
To: None <gnats-bugs@gnats.netbsd.org>
From: None <andreas@planix.com>
List: netbsd-bugs
Date: 07/29/2002 10:45:14
>Number:         17757
>Category:       kern
>Synopsis:       Support the ICH4 IDE controller found in the i845 chipsets.
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Mon Jul 29 07:46:02 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Andreas Wrede <andreas@planix.com>
>Release:        NetBSD 1.6_BETA4
>Organization:
Planix, Inc.
>Environment:
	
	
System: NetBSD woffi.planix.com 1.6_BETA4 NetBSD 1.6_BETA4 (PLANIX) #4: Mon Jul 29 10:10:15 EDT 2002 root@woffi.planix.com:/usr/src/sys/arch/i386/compile/WOFFI i386
Architecture: i386
Machine: i386
>Description:
	The patch below adds support for the Intel 82801DB ICH4 IDE controller. 
>How-To-Repeat:
	Boot netbsd on a brand new i845G based motherboad. See the message
pciide0: bus-master DMA support present, but unused (no driver support).

>Fix:
	Note: This patch also fixes a typo in the text for the 82801CA controller.
    NB:  This patch needs the pcidevs patch submitted with kern/17743.

Index: pciide.c
===================================================================
RCS file: /cvsroot/syssrc/sys/dev/pci/pciide.c,v
retrieving revision 1.153.2.3
diff -c -r1.153.2.3 pciide.c
*** pciide.c	2002/06/10 17:08:01	1.153.2.3
--- pciide.c	2002/07/29 14:28:53
***************
*** 289,302 ****
  	},
  	{ PCI_PRODUCT_INTEL_82801CA_IDE_1,
  	  0,
! 	  "Intel 82201CA IDE Controller",
  	  piix_chip_map,
  	},
  	{ PCI_PRODUCT_INTEL_82801CA_IDE_2,
  	  0,
! 	  "Intel 82201CA IDE Controller",
  	  piix_chip_map,
  	},
  	{ 0,
  	  0,
  	  NULL,
--- 289,307 ----
  	},
  	{ PCI_PRODUCT_INTEL_82801CA_IDE_1,
  	  0,
! 	  "Intel 82801CA IDE Controller",
  	  piix_chip_map,
  	},
  	{ PCI_PRODUCT_INTEL_82801CA_IDE_2,
  	  0,
! 	  "Intel 82801CA IDE Controller",
  	  piix_chip_map,
  	},
+ 	{ PCI_PRODUCT_INTEL_82801DB_IDE,
+ 	  0,
+ 	  "Intel 82801DB IDE Controller (ICH4)",
+ 	  piix_chip_map,
+ 	},
  	{ 0,
  	  0,
  	  NULL,
***************
*** 1512,1517 ****
--- 1517,1523 ----
  		case PCI_PRODUCT_INTEL_82801BAM_IDE:
  		case PCI_PRODUCT_INTEL_82801CA_IDE_1:
  		case PCI_PRODUCT_INTEL_82801CA_IDE_2:
+ 		case PCI_PRODUCT_INTEL_82801DB_IDE:
  			sc->sc_wdcdev.cap |= WDC_CAPABILITY_UDMA;
  		}
  	}
***************
*** 1525,1530 ****
--- 1531,1537 ----
  	case PCI_PRODUCT_INTEL_82801BAM_IDE:
  	case PCI_PRODUCT_INTEL_82801CA_IDE_1:
  	case PCI_PRODUCT_INTEL_82801CA_IDE_2:
+ 	case PCI_PRODUCT_INTEL_82801DB_IDE:
  		sc->sc_wdcdev.UDMA_cap = 5;
  		break;
  	default:
***************
*** 1554,1560 ****
  		    sc->sc_pp->ide_product == PCI_PRODUCT_INTEL_82801BA_IDE ||
  		    sc->sc_pp->ide_product == PCI_PRODUCT_INTEL_82801BAM_IDE ||
  		    sc->sc_pp->ide_product == PCI_PRODUCT_INTEL_82801CA_IDE_1 ||
! 		    sc->sc_pp->ide_product == PCI_PRODUCT_INTEL_82801CA_IDE_2) {
  			WDCDEBUG_PRINT((", IDE_CONTROL 0x%x",
  			    pci_conf_read(sc->sc_pc, sc->sc_tag, PIIX_CONFIG)),
  			    DEBUG_PROBE);
--- 1561,1568 ----
  		    sc->sc_pp->ide_product == PCI_PRODUCT_INTEL_82801BA_IDE ||
  		    sc->sc_pp->ide_product == PCI_PRODUCT_INTEL_82801BAM_IDE ||
  		    sc->sc_pp->ide_product == PCI_PRODUCT_INTEL_82801CA_IDE_1 ||
! 		    sc->sc_pp->ide_product == PCI_PRODUCT_INTEL_82801CA_IDE_2 ||
! 		    sc->sc_pp->ide_product == PCI_PRODUCT_INTEL_82801DB_IDE) {
  			WDCDEBUG_PRINT((", IDE_CONTROL 0x%x",
  			    pci_conf_read(sc->sc_pc, sc->sc_tag, PIIX_CONFIG)),
  			    DEBUG_PROBE);
***************
*** 1608,1614 ****
  		    sc->sc_pp->ide_product == PCI_PRODUCT_INTEL_82801BA_IDE ||
  		    sc->sc_pp->ide_product == PCI_PRODUCT_INTEL_82801BAM_IDE ||
  		    sc->sc_pp->ide_product == PCI_PRODUCT_INTEL_82801CA_IDE_1 ||
! 		    sc->sc_pp->ide_product == PCI_PRODUCT_INTEL_82801CA_IDE_2) {
  			WDCDEBUG_PRINT((", IDE_CONTROL 0x%x",
  			    pci_conf_read(sc->sc_pc, sc->sc_tag, PIIX_CONFIG)),
  			    DEBUG_PROBE);
--- 1616,1623 ----
  		    sc->sc_pp->ide_product == PCI_PRODUCT_INTEL_82801BA_IDE ||
  		    sc->sc_pp->ide_product == PCI_PRODUCT_INTEL_82801BAM_IDE ||
  		    sc->sc_pp->ide_product == PCI_PRODUCT_INTEL_82801CA_IDE_1 ||
! 		    sc->sc_pp->ide_product == PCI_PRODUCT_INTEL_82801CA_IDE_2 ||
! 		    sc->sc_pp->ide_product == PCI_PRODUCT_INTEL_82801DB_IDE) {
  			WDCDEBUG_PRINT((", IDE_CONTROL 0x%x",
  			    pci_conf_read(sc->sc_pc, sc->sc_tag, PIIX_CONFIG)),
  			    DEBUG_PROBE);
***************
*** 1771,1783 ****
  		    sc->sc_pp->ide_product == PCI_PRODUCT_INTEL_82801BA_IDE ||
  		    sc->sc_pp->ide_product == PCI_PRODUCT_INTEL_82801BAM_IDE ||
  		    sc->sc_pp->ide_product == PCI_PRODUCT_INTEL_82801CA_IDE_1 ||
! 		    sc->sc_pp->ide_product == PCI_PRODUCT_INTEL_82801CA_IDE_2) {
  			ideconf |= PIIX_CONFIG_PINGPONG;
  		}
  		if (sc->sc_pp->ide_product == PCI_PRODUCT_INTEL_82801BA_IDE ||
  		    sc->sc_pp->ide_product == PCI_PRODUCT_INTEL_82801BAM_IDE ||
  		    sc->sc_pp->ide_product == PCI_PRODUCT_INTEL_82801CA_IDE_1 ||
! 		    sc->sc_pp->ide_product == PCI_PRODUCT_INTEL_82801CA_IDE_2) {
  			/* setup Ultra/100 */
  			if (drvp->UDMA_mode > 2 &&
  			    (ideconf & PIIX_CONFIG_CR(channel, drive)) == 0)
--- 1780,1794 ----
  		    sc->sc_pp->ide_product == PCI_PRODUCT_INTEL_82801BA_IDE ||
  		    sc->sc_pp->ide_product == PCI_PRODUCT_INTEL_82801BAM_IDE ||
  		    sc->sc_pp->ide_product == PCI_PRODUCT_INTEL_82801CA_IDE_1 ||
! 		    sc->sc_pp->ide_product == PCI_PRODUCT_INTEL_82801CA_IDE_2 ||
! 		    sc->sc_pp->ide_product == PCI_PRODUCT_INTEL_82801DB_IDE) {
  			ideconf |= PIIX_CONFIG_PINGPONG;
  		}
  		if (sc->sc_pp->ide_product == PCI_PRODUCT_INTEL_82801BA_IDE ||
  		    sc->sc_pp->ide_product == PCI_PRODUCT_INTEL_82801BAM_IDE ||
  		    sc->sc_pp->ide_product == PCI_PRODUCT_INTEL_82801CA_IDE_1 ||
! 		    sc->sc_pp->ide_product == PCI_PRODUCT_INTEL_82801CA_IDE_2 ||
! 		    sc->sc_pp->ide_product == PCI_PRODUCT_INTEL_82801DB_IDE) {
  			/* setup Ultra/100 */
  			if (drvp->UDMA_mode > 2 &&
  			    (ideconf & PIIX_CONFIG_CR(channel, drive)) == 0)
>Release-Note:
>Audit-Trail:
>Unformatted: