Subject: Re: pciide question: wd0 as wd2 (Promise Ultra100)
To: Teemu Rinta-aho <teemu@rinta-aho.org>
From: Alexander Yurchenko <grange@rt.mipt.ru>
List: tech-kern
Date: 12/15/2002 20:43:17
On Sun, Dec 15, 2002 at 07:16:50PM +0200, Teemu Rinta-aho wrote:
[skipped]
> eap0: interrupting at irq 10
[skipped]
> pciide1: using irq 10 for native-PCI interrupt

So your promise chip shares the same irq line with audio card. Try this
patch:

Index: pciide.c
===================================================================
RCS file: /cvsroot/syssrc/sys/dev/pci/pciide.c,v
retrieving revision 1.175
diff -u -r1.175 pciide.c
--- pciide.c	2002/11/20 19:20:24	1.175
+++ pciide.c	2002/12/15 17:45:08
@@ -4158,6 +4158,15 @@
 		/* If a compat channel skip. */
 		if (cp->compat)
 			continue;
+
+		if (PDC_IS_268(sc)) {
+			bus_space_write_1(sc->sc_dma_iot, sc->sc_dma_ioh,
+			    PDC268_INDEX(i), 0x0b);
+			if ((bus_space_read_1(sc->sc_dma_iot, sc->sc_dma_ioh,
+			    PDC268_DATA(i)) & 0x20) == 0)
+				continue;
+		}
+
 		/*
 		 * The Ultra/100 seems to assert PDC2xx_SCR_INT * spuriously,
 		 * however it asserts INT in IDEDMA_CTL even for non-DMA ops.
Index: pciide_pdc202xx_reg.h
===================================================================
RCS file: /cvsroot/syssrc/sys/dev/pci/pciide_pdc202xx_reg.h,v
retrieving revision 1.8
diff -u -r1.8 pciide_pdc202xx_reg.h
--- pciide_pdc202xx_reg.h	2002/07/26 14:11:35	1.8
+++ pciide_pdc202xx_reg.h	2002/12/15 17:45:08
@@ -117,3 +117,9 @@
     {0x3, 0x2, 0x1, 0x2, 0x1, 0x1};
 static const int8_t pdc2xx_udma_mc[] __attribute__((__unused__)) =
     {0x3, 0x2, 0x1, 0x2, 0x1, 0x1};
+
+/*
+ * Registers definitions for Promise PDC20268 and above
+ */
+#define PDC268_INDEX(chan)	(0x01 + IDEDMA_SCH_OFFSET * (chan))
+#define PDC268_DATA(chan)	(0x03 + IDEDMA_SCH_OFFSET * (chan))

It's against netbsd-current. I don't know if it compiles since I've got no
netbsd system. And as ususal, no warranties ;-)

-- 
   Alexander Yurchenko (aka grange)