Subject: Re: kern/3753: cyclades driver is broken
To: Chris G. Demetriou <cgd@pa.dec.com>
From: Jarkko Torppa <torppa@cute.fi>
List: netbsd-bugs
Date: 06/16/1997 23:17:03
> That patch will cause the driver to work _only_ on the 32BIT_1M cards,
> i.e. it _won't_ work on the ones which can map their memory higher
> than 1MB.
> 
> I _think_ the right solution is to or in that bit depending on the PCI
> device ID; could you verify that?
> 

I only have this one card I can test with, so I actually can't verify that 
this works with both types but it at least works with my card.

This is agains currents cy_pci.c

--- /cute/torppa/cy-net/cy.orig/pci/cy_pci.c    Mon Jun 16 19:30:20 1997
+++ cy_pci.c    Mon Jun 16 23:00:42 1997
@@ -48,13 +48,19 @@
        bus_size_t              *iosizep, *memsizep;
 {
        int ioh_valid, memh_valid;
+       pcireg_t pciregs;
 
        ioh_valid = (pci_mapreg_map(pap, 0x14,
-           PCI_MAPREG_TYPE_IO, 0,
-           iotp, iohp, NULL, iosizep) == 0);
-       memh_valid = (pci_mapreg_map(pap, 0x18,
-           PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_32BIT, 0,
-           memtp, memhp, NULL, memsizep) == 0);
+                                   PCI_MAPREG_TYPE_IO, 0,
+                                   iotp, iohp, NULL, iosizep) == 0);
+
+       pciregs = PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_32BIT;
+
+       if(PCI_PRODUCT(pap->pa_id) == PCI_PRODUCT_CYCLADES_CYCLOMY_1)
+         pciregs |= PCI_MAPREG_MEM_TYPE_32BIT_1M;
+
+       memh_valid = (pci_mapreg_map(pap, 0x18,pciregs,0,memtp, memhp, NULL,
+                                    memsizep) == 0);
 
        if (ioh_valid && memh_valid)
                return (1);
@@ -169,7 +175,7 @@
        sc->sc_ih = pci_intr_establish(pap->pa_pc, intrhandle, IPL_TTY,
            cy_intr, sc);
        if (sc->sc_ih == NULL) {
-               printf(": couldn't establish interrupt", sc->sc_dev.dv_xname);
+               printf("%s: couldn't establish interrupt", sc->sc_dev.dv_xname);
                if (intrstr != NULL)
                        printf(" at %s", intrstr);
                printf("\n");

-- 
 Jarkko.Torppa@cute.fi     +358-9-34871220         Cute Communications Oy