Subject: Re: DELL PERC 4/Di
To: Martti Kuparinen <martti.kuparinen@iki.fi>
From: Mark Davies <mark@mcs.vuw.ac.nz>
List: current-users
Date: 10/01/2003 21:12:02
	From:  Martti Kuparinen <martti.kuparinen@iki.fi>
	Date:  Tue, 30 Sep 2003 18:40:12 +0300

> Matt Thomas wrote:
> 
> >> I have tried "AT_QUARTZ" and "AT_QUARTZ | AT_SIG" but the both fail.
> 
> >> +       { PCI_VENDOR_DELL,  PCI_PRODUCT_DELL_PERC_4DI, AT_SIG },
> > 
> > This would need AT_QUARTZ too.
> 
> I should have said: I tried "AT_QUARTZ", "AT_QUARTZ | AT_SIG" and
> "AT_SIG" but they all failed.

Below are the patches I've been using for our Dell PERC 4Di for the last few 
months quite happily.  The patches came, indirectly, from Andrew Doran who I 
believe was going to do some more work to them before committing but perhaps 
these should be committed in the meantime.

The previous current-users thread can be seen at:
http://mail-index.netbsd.org/current-users/2003/06/09/0071.html

Index: pcidevs
===================================================================
RCS file: /src/cvs/netbsd/src/sys/dev/pci/pcidevs,v
retrieving revision 1.578
diff -u -r1.578 pcidevs
--- pcidevs	21 Sep 2003 14:23:21 -0000	1.578
+++ pcidevs	22 Sep 2003 07:43:54 -0000
@@ -1244,6 +1244,8 @@
 product DELL PERC_3SI_2		0x0004	PERC 3/Si
 product DELL PERC_3DI_2		0x0008	PERC 3/Di
 product DELL PERC_3DI_3		0x000a	PERC 3/Di
+product DELL PERC_4DI		0x000e	PERC 4/Di i960
+product DELL PERC_4DI_2		0x000f	PERC 4/Di Verde
 product DELL PERC_3SI		0x0003	PERC 3/Si
 product DELL PERC_3DI_2_SUB	0x00cf	PERC 3/Di
 product DELL PERC_3SI_2_SUB	0x00d0	PERC 3/Si

Index: amr.c
===================================================================
RCS file: /src/cvs/netbsd/src/sys/dev/pci/amr.c,v
retrieving revision 1.11
diff -u -r1.11 amr.c
--- amr.c	15 May 2003 18:04:08 -0000	1.11
+++ amr.c	10 Jun 2003 02:28:24 -0000
@@ -132,6 +132,8 @@
 	{ PCI_VENDOR_AMI,   PCI_PRODUCT_AMI_MEGARAID,  0 },
 	{ PCI_VENDOR_AMI,   PCI_PRODUCT_AMI_MEGARAID2, 0 },
 	{ PCI_VENDOR_AMI,   PCI_PRODUCT_AMI_MEGARAID3, AT_QUARTZ },
+	{ PCI_VENDOR_DELL,  PCI_PRODUCT_DELL_PERC_4DI, AT_QUARTZ },
+	{ PCI_VENDOR_DELL,  PCI_PRODUCT_DELL_PERC_4DI_2, AT_QUARTZ },
 	{ PCI_VENDOR_INTEL, PCI_PRODUCT_AMI_MEGARAID3, AT_QUARTZ | AT_SIG }
 };
 
@@ -474,7 +476,7 @@
 	}
 
 	SIMPLEQ_INIT(&amr->amr_ccb_queue);
-	kthread_create(amr_thread_create, amr);
+	/*kthread_create(amr_thread_create, amr);*/
 }
 
 /*
@@ -1170,7 +1172,7 @@
 		return (EAGAIN);
 
 	v = amr_inl(amr, AMR_QREG_IDB);
-	if ((v & (AMR_QIDB_SUBMIT | AMR_QIDB_ACK)) != 0) {
+	if ((v & AMR_QIDB_SUBMIT) != 0) {
 		amr->amr_mbox->mb_cmd.mb_busy = 0;
 		bus_dmamap_sync(amr->amr_dmat, amr->amr_dmamap, 0,
 		    sizeof(struct amr_mailbox), BUS_DMASYNC_PREWRITE);
@@ -1186,7 +1188,8 @@
 
 	ac->ac_start_time = (time_t)mono_time.tv_sec;
 	ac->ac_flags |= AC_ACTIVE;
-	amr_outl(amr, AMR_QREG_IDB, amr->amr_mbox_paddr | AMR_QIDB_SUBMIT);
+	amr_outl(amr, AMR_QREG_IDB,
+	    (amr->amr_mbox_paddr + 16) | AMR_QIDB_SUBMIT);
 	return (0);
 }
 
@@ -1259,7 +1262,7 @@
 	 * should.  Who is right?
 	 */
 	while ((amr_inl(amr, AMR_QREG_IDB) & AMR_QIDB_ACK) != 0)
-		;
+		DELAY(10);
 
 	return (0);
 }


cheers
mark