Subject: Re: Is SIIG UltraATA 133 PCI controller supported?
To: Steven M. Bellovin <smb@research.att.com>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: netbsd-users
Date: 09/11/2002 23:18:07
--tKW2IUtsqtDRztdT
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Mon, Sep 09, 2002 at 09:58:25PM -0400, Steven M. Bellovin wrote:
> I finally got around to trying it.
> 
> The chip on the card is by ACHIP.  A 1.6b2 boot cd -- what I happened
> to have lying around -- says
> 
> 	Vendor 0x1191 product 0x0009 (SCSI mass storage rev 02)
> 	at pci2 dev 11 function 0 (not configured)
> 
> It's not really SCSI, it's just lying to the BIOS.
> 
> And I have no objection to running -current on the machine this
> card is destined for.

Well, I didn't find much about it. Linux 2.4.19 says it's a
ARTOP ATP865R but doesn't support it as far as I can tell (only 850, 860 and
860R). FreeBSD doesn't know it.
It's in the patches to the linux 2.4.20 kernels though. I've made a patch
to pciide.c based on this infos, it looks quite simple. Can you try it ?
You'll need the last pcidevs* (pcidevs 1.468 and the associated .h).

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
--

--tKW2IUtsqtDRztdT
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=diff

Index: pciide.c
===================================================================
RCS file: /cvsroot/syssrc/sys/dev/pci/pciide.c,v
retrieving revision 1.168
diff -u -r1.168 pciide.c
--- pciide.c	2002/08/25 17:26:58	1.168
+++ pciide.c	2002/09/11 21:15:49
@@ -551,6 +551,16 @@
 	  "Acard ATP860-A Ultra66 IDE Controller",
 	  acard_chip_map,
 	},
+	{ PCI_PRODUCT_ACARD_ATP865,
+	  IDE_PCI_CLASS_OVERRIDE,
+	  "Acard ATP865 Ultra133 IDE Controller",
+	  acard_chip_map,
+	},
+	{ PCI_PRODUCT_ACARD_ATP865A,
+	  IDE_PCI_CLASS_OVERRIDE,
+	  "Acard ATP865-A Ultra133 IDE Controller",
+	  acard_chip_map,
+	},
 	{ 0,
 	  0,
 	  NULL,
@@ -4343,6 +4353,12 @@
 
 #define	ACARD_IS_850(sc)						\
 	((sc)->sc_pp->ide_product == PCI_PRODUCT_ACARD_ATP850U)
+#define	ACARD_IS_860(sc)						\
+	((sc)->sc_pp->ide_product == PCI_PRODUCT_ACARD_ATP860 ||	\
+	 (sc)->sc_pp->ide_product == PCI_PRODUCT_ACARD_ATP860A)
+#define	ACARD_IS_865(sc)						\
+	((sc)->sc_pp->ide_product == PCI_PRODUCT_ACARD_ATP865 ||	\
+	 (sc)->sc_pp->ide_product == PCI_PRODUCT_ACARD_ATP865A)
 
 void
 acard_chip_map(sc, pa)
@@ -4382,7 +4398,23 @@
 	}
 	sc->sc_wdcdev.PIO_cap = 4;
 	sc->sc_wdcdev.DMA_cap = 2;
-	sc->sc_wdcdev.UDMA_cap = ACARD_IS_850(sc) ? 2 : 4;
+	switch((sc)->sc_pp->ide_product) {
+	default:
+		printf("%s: unknown acard chip\n",
+		    sc->sc_wdcdev.sc_dev.dv_xname);
+		/* FALLTHROUGH */
+	case PCI_PRODUCT_ACARD_ATP850U:
+		sc->sc_wdcdev.UDMA_cap = 2;
+		break;
+	case PCI_PRODUCT_ACARD_ATP860:
+	case PCI_PRODUCT_ACARD_ATP860A:
+		sc->sc_wdcdev.UDMA_cap = 4;
+		break;
+	case PCI_PRODUCT_ACARD_ATP865:
+	case PCI_PRODUCT_ACARD_ATP865A:
+		sc->sc_wdcdev.UDMA_cap = 6;
+		break;
+	}
 
 	sc->sc_wdcdev.set_modes = acard_setup_channel;
 	sc->sc_wdcdev.channels = sc->wdc_chanarray;
Index: pciide_acard_reg.h
===================================================================
RCS file: /cvsroot/syssrc/sys/dev/pci/pciide_acard_reg.h,v
retrieving revision 1.2
diff -u -r1.2 pciide_acard_reg.h
--- pciide_acard_reg.h	2001/10/21 18:49:19	1.2
+++ pciide_acard_reg.h	2002/09/11 21:15:49
@@ -55,7 +55,7 @@
 #define	ATP860_UDMA_MASK(channel)	(0xff << ((channel) * 8))
 
 static const u_int8_t acard_udma_conf[] __attribute__((__unused__)) =
-    {0x1, 0x2, 0x3, 0x4, 0x5};
+    {0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7};
 
 #define ATP8x0_CTRL		0x48
 #define  ATP8x0_CTRL_EN(chan)	(0x00020000 << (chan))

--tKW2IUtsqtDRztdT--