Do not explicitly set PCIM_CMD_SERRESPEN or PCIM_CMD_PERRESPEN. This was
[dragonfly.git] / sys / bus / firewire / fwohci_pci.c
index b9a591d..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.14 2004/07/18 12:29:19 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
@@ -167,11 +167,11 @@ fwohci_pci_probe( device_t dev )
                return 0;
        }
        if (id == (FW_VENDORID_SONY | FW_DEVICE_CXD1947)) {
-               device_set_desc(dev, "Sony CXD1947");
+               device_set_desc(dev, "Sony i.LINK (CXD1947)");
                return 0;
        }
        if (id == (FW_VENDORID_SONY | FW_DEVICE_CXD3222)) {
-               device_set_desc(dev, "Sony CXD3222");
+               device_set_desc(dev, "Sony i.LINK (CXD3222)");
                return 0;
        }
        if (id == (FW_VENDORID_VIA | FW_DEVICE_VT6306)) {
@@ -233,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);