Subject: Re: ncr driver working with Symbios 53C896?
To: Jeff Rizzo <riz@boogers.sf.ca.us>
From: Manuel Bouyer <bouyer@antioche.lip6.fr>
List: current-users
Date: 04/17/2000 09:32:50
--SUOF0GtieIMvvwua
Content-Type: text/plain; charset=us-ascii

On Thu, Apr 13, 2000 at 04:01:01PM -0700, Jeff Rizzo wrote:
> I've done a little more investigating, and found that I have the same
> problem with -current as detailed below.  I've checked the ncr(4) manpage,
> and it claims the 53C896 is supported...
> 
> Has anyone else seen this?  Any suggestions?  The board in question seems
> to work under Linux, so I don't think it's a hardware question.

Ok, in fact the 896 is a 64bit device so the PCI registers are not the same
(appart from that it should be backward-compatible with the 895).
Could you try the attached patch ? Should also work for 1.4.2.

--
Manuel Bouyer, LIP6, Universite Paris VI.           Manuel.Bouyer@lip6.fr
--

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

Index: ncr.c
===================================================================
RCS file: /cvsroot/syssrc/sys/dev/pci/ncr.c,v
retrieving revision 1.101
diff -u -r1.101 ncr.c
--- ncr.c	2000/04/08 13:49:43	1.101
+++ ncr.c	2000/04/17 07:29:16
@@ -3752,9 +3752,16 @@
 	ioh_valid = (pci_mapreg_map(pa, 0x10,
 	    PCI_MAPREG_TYPE_IO, 0,
 	    &iot, &ioh, &ioaddr, NULL) == 0);
-	memh_valid = (pci_mapreg_map(pa, 0x14,
-	    PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_32BIT, 0,
-	    &memt, &memh, &memaddr, NULL) == 0);
+	if (pa->pa_id == NCR_896_ID) {
+		printf("64bit PCI device\n");
+		memh_valid = (pci_mapreg_map(pa, 0x14,
+		    PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_64BIT, 0,
+		    &memt, &memh, &memaddr, NULL) == 0);
+	} else {
+		memh_valid = (pci_mapreg_map(pa, 0x14,
+		    PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_32BIT, 0,
+		    &memt, &memh, &memaddr, NULL) == 0);
+	}
 
 #if defined(NCR_IOMAPPED)
 	if (ioh_valid) {
@@ -4080,9 +4087,17 @@
 	*/
 	if ((np->features & FE_RAM) && sizeof(struct script) <= 4096) {
 #ifdef __NetBSD__
-		if (pci_mapreg_map(pa, 0x18,
-		    PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_32BIT, 0,
-		    &memt, &memh, &memaddr, NULL) == 0) {
+		int rammapped;
+		if (pa->pa_id == NCR_896_ID) {
+			rammapped = pci_mapreg_map(pa, 0x1c,
+			    PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_64BIT,
+			    0, &memt, &memh, &memaddr, NULL);
+		} else {
+			rammapped = pci_mapreg_map(pa, 0x18,
+			    PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_32BIT,
+			    0, &memt, &memh, &memaddr, NULL);
+		}
+		if (rammapped == 0) {
 			np->ram_tag = memt;
 			np->ram_handle = memh;
 			np->paddr2 = memaddr;

--SUOF0GtieIMvvwua--