Module Name:    src
Committed By:   kiyohara
Date:           Thu Apr 29 06:41:28 UTC 2010

Modified Files:
        src/sys/dev/pci: fwohci_pci.c

Log Message:
Adds hw quirk for SUN firewire controllers.  From FreeBSD.
  Thanks for ceg...@.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/dev/pci/fwohci_pci.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/fwohci_pci.c
diff -u src/sys/dev/pci/fwohci_pci.c:1.38 src/sys/dev/pci/fwohci_pci.c:1.39
--- src/sys/dev/pci/fwohci_pci.c:1.38	Sat Apr 24 11:26:15 2010
+++ src/sys/dev/pci/fwohci_pci.c	Thu Apr 29 06:41:27 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: fwohci_pci.c,v 1.38 2010/04/24 11:26:15 kiyohara Exp $	*/
+/*	$NetBSD: fwohci_pci.c,v 1.39 2010/04/29 06:41:27 kiyohara Exp $	*/
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fwohci_pci.c,v 1.38 2010/04/24 11:26:15 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fwohci_pci.c,v 1.39 2010/04/29 06:41:27 kiyohara Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -99,7 +99,7 @@
 	char devinfo[256];
 	char const *intrstr;
 	pci_intr_handle_t ih;
-	u_int32_t csr;
+	uint32_t csr;
 
 	aprint_naive(": IEEE 1394 Controller\n");
 
@@ -125,8 +125,17 @@
 
 	/* Enable the device. */
 	csr = pci_conf_read(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG);
-	pci_conf_write(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG,
-	    csr | PCI_COMMAND_MASTER_ENABLE);
+	csr |= PCI_COMMAND_MASTER_ENABLE | PCI_COMMAND_MEM_ENABLE;
+	pci_conf_write(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG, csr);
+
+	/*
+	 * Some Sun FireWire controllers have their intpin register
+	 * bogusly set to 0, although it should be 3. Correct that.
+	 */
+	if ((PCI_VENDOR(pa->pa_id) == PCI_VENDOR_SUN) &&
+	    (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_SUN_FIREWIRE))
+		if (pa->pa_intrpin == 0)
+			pa->pa_intrpin = 3;
 
 	/* Map and establish the interrupt. */
 	if (pci_intr_map(pa, &ih)) {

Reply via email to