Subject: Re: Problems with Promise IDE controllers (and a solution!)
To: None <port-alpha@netbsd.org>
From: Joel Votaw <jovotaw@cs.nmsu.edu>
List: port-alpha
Date: 10/11/2000 13:38:38
I dug around on the mailing list archives for port-netbsd and dug up the
following patch.  If you're having problems with Promise IDE controllers
on recent kernels on Alphas, this should work.  (I have not yet tried it
myself, but will when I get home tonight.)

The URL that I found this at was
http://mail-index.netbsd.org/port-alpha/1999/08/20/0001.html

Note that this is a very ugly work-around, so you may have different but
still fatal problems with it.

Thanks to everyone who pointed me in the right direction,

	-Joel




--- pciide.c.orig	Sun Aug  8 22:03:57 1999
+++ pciide.c	Fri Aug 20 10:15:47 1999
@@ -2414,12 +2414,30 @@
 	int channel;
 	pcireg_t interface, st, mode;
 	bus_size_t cmdsize, ctlsize;
-
+	
+	bus_addr_t addr, forceaddr = 0x8000;
+	int        i;
+	
 	st = pci_conf_read(sc->sc_pc, sc->sc_tag, PDC246_STATE);
 	WDCDEBUG_PRINT(("pdc20246_setup_chip: controller state 0x%x\n", st),
 	    DEBUG_PROBE);
 	if (pciide_chipen(sc, pa) == 0)
 		return;
+
+	/* XXX Force IO addresses if BIOS doesn't set them up for me */
+	for (i = 0x10; i <= 0x20; i += 4) {
+		addr = pci_conf_read (sc->sc_pc, sc->sc_tag, i);
+		printf ("%s: Changing IO from 0x%lx to 0x%lx\n",
+			sc->sc_wdcdev.sc_dev.dv_xname,
+			addr & PCI_MAPREG_IO_ADDR_MASK,
+			/* addr & 0xffff & PCI_MAPREG_IO_ADDR_MASK */
+			forceaddr);
+			
+		pci_conf_write (sc->sc_pc, sc->sc_tag,
+				i, /* addr & 0xffff & PCI_MAPREG_IO_ADDR_MASK */
+				forceaddr | PCI_MAPREG_TYPE_IO);
+		forceaddr += 16;
+	}
 
 	/* turn off  RAID mode */
 	st &= ~PDC246_STATE_IDERAID;