Do not explicitly set PCIM_CMD_SERRESPEN or PCIM_CMD_PERRESPEN. This was
[dragonfly.git] / sys / bus / firewire / fwohci_pci.c
index fed3028..61ee30c 100644 (file)
@@ -32,7 +32,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  * 
  * $FreeBSD: src/sys/dev/firewire/fwohci_pci.c,v 1.38 2004/01/23 17:37:09 simokawa Exp $
- * $DragonFly: src/sys/bus/firewire/fwohci_pci.c,v 1.6 2004/07/16 08:58:44 asmodai Exp $
+ * $DragonFly: src/sys/bus/firewire/fwohci_pci.c,v 1.16 2004/11/08 16:50:33 dillon Exp $
  */
 
 #define BOUNCE_BUFFER_TEST     0
@@ -97,6 +97,10 @@ fwohci_pci_probe( device_t dev )
        u_int32_t id;
 
        id = pci_get_devid(dev);
+       if (id == (FW_VENDORID_NATSEMI | FW_DEVICE_CS4210)) {
+               device_set_desc(dev, "National Semiconductor CS4210");
+               return 0;
+       }
        if (id == (FW_VENDORID_NEC | FW_DEVICE_UPD861)) {
                device_set_desc(dev, "NEC uPD72861");
                return 0;
@@ -113,6 +117,11 @@ fwohci_pci_probe( device_t dev )
                device_set_desc(dev, "NEC uPD72874");
                return 0;
        }
+       if (id == (FW_VENDORID_SIS | FW_DEVICE_7007)) {
+               /* It has no real identifier, using device id. */
+               device_set_desc(dev, "SiS 7007");
+               return 0;
+       }
        if (id == (FW_VENDORID_TI | FW_DEVICE_TITSB22)) {
                device_set_desc(dev, "Texas Instruments TSB12LV22");
                return 0;
@@ -133,8 +142,8 @@ fwohci_pci_probe( device_t dev )
                device_set_desc(dev, "Texas Instruments TSB43AB22/A");
                return 0;
        }
-       if (id == (FW_VENDORID_TI | FW_DEVICE_TITSB43AB21A)) {
-               device_set_desc(dev, "Texas Instruments TSB43AB21A");
+       if (id == (FW_VENDORID_TI | FW_DEVICE_TITSB43AB21)) {
+               device_set_desc(dev, "Texas Instruments TSB43AB21/A/AI/A-EP");
                return 0;
        }
        if (id == (FW_VENDORID_TI | FW_DEVICE_TITSB43AB23)) {
@@ -157,12 +166,16 @@ fwohci_pci_probe( device_t dev )
                device_set_desc(dev, "Texas Instruments PCI4451");
                return 0;
        }
-       if (id == (FW_VENDORID_SONY | FW_DEVICE_CX3022)) {
-               device_set_desc(dev, "Sony CX3022");
+       if (id == (FW_VENDORID_SONY | FW_DEVICE_CXD1947)) {
+               device_set_desc(dev, "Sony i.LINK (CXD1947)");
+               return 0;
+       }
+       if (id == (FW_VENDORID_SONY | FW_DEVICE_CXD3222)) {
+               device_set_desc(dev, "Sony i.LINK (CXD3222)");
                return 0;
        }
        if (id == (FW_VENDORID_VIA | FW_DEVICE_VT6306)) {
-               device_set_desc(dev, "VIA VT6306");
+               device_set_desc(dev, "VIA Fire II (VT6306)");
                return 0;
        }
        if (id == (FW_VENDORID_RICOH | FW_DEVICE_R5C551)) {
@@ -185,6 +198,14 @@ fwohci_pci_probe( device_t dev )
                device_set_desc(dev, "Lucent FW322/323");
                return 0;
        }
+       if (id == (FW_VENDORID_INTEL | FW_DEVICE_82372FB)) {
+               device_set_desc(dev, "Intel 82372FB");
+               return 0;
+       }
+       if (id == (FW_VENDORID_ADAPTEC | FW_DEVICE_AIC5800)) {
+               device_set_desc(dev, "Adaptec AHA-894x/AIC-5800");
+               return 0;
+       }
 #endif
        if (pci_get_class(dev) == PCIC_SERIALBUS
                        && pci_get_subclass(dev) == PCIS_SERIALBUS_FW
@@ -212,12 +233,23 @@ fwohci_pci_init(device_t self)
        int olatency, latency, ocache_line, cache_line;
        u_int16_t cmd;
 
+       /*
+        * Clear PCIM_CMD_MWRICEN as per FreeBSD/1.20, but note that the
+        * problem may have been related to SERR and PERR being
+        * unconditionally enabled in that rev.
+        *
+        * Do not change the SERRESPEN or PERRESPEN bits.  Use the BIOS
+        * values (probably off).  This crashes some machines in fwohci_init().
+        *
+        * The theory here is that the device may not be properly initializing
+        * its on-chip memory, leaving some of it in a parity errored state,
+        * and enabling parity check may result in the device blowing up.
+        * It's also possible that some hardware is just plain broken.  OpenBSD
+        * does not turn on SERRESPEN or PERRESPEN so we won't either.
+        */
        cmd = pci_read_config(self, PCIR_COMMAND, 2);
-       cmd |= PCIM_CMD_MEMEN | PCIM_CMD_BUSMASTEREN | PCIM_CMD_MWRICEN |
-               PCIM_CMD_SERRESPEN | PCIM_CMD_PERRESPEN;
-#if 1
+       cmd |= PCIM_CMD_MEMEN | PCIM_CMD_BUSMASTEREN;
        cmd &= ~PCIM_CMD_MWRICEN; 
-#endif
        pci_write_config(self, PCIR_COMMAND, cmd, 2);
 
        latency = olatency = pci_read_config(self, PCIR_LATTIMER, 1);