summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorn_hibma <n_hibma@FreeBSD.org>1999-05-01 23:30:09 +0000
committern_hibma <n_hibma@FreeBSD.org>1999-05-01 23:30:09 +0000
commit8f05b071c5794e9396e7ea9b2ea7aaa4e8672de0 (patch)
treea24325aa09bfa8a625a812253936a0f3770d321f
parent4081c85fd14958f27dbb6b2dff1d1664679ab06a (diff)
downloadFreeBSD-src-8f05b071c5794e9396e7ea9b2ea7aaa4e8672de0.zip
FreeBSD-src-8f05b071c5794e9396e7ea9b2ea7aaa4e8672de0.tar.gz
Move the disabling of interrupts right before the allocation of the
resource. Avoids useless interrupts occurring between the allocation of the interrupt resource and the final initialisation of the kernel. Cause of these interrupts is unknown (a resuming device?).
-rw-r--r--sys/dev/usb/uhci.c2
-rw-r--r--sys/dev/usb/uhci_pci.c17
-rw-r--r--sys/pci/uhci_pci.c17
3 files changed, 34 insertions, 2 deletions
diff --git a/sys/dev/usb/uhci.c b/sys/dev/usb/uhci.c
index 713eb52..e2dabc5 100644
--- a/sys/dev/usb/uhci.c
+++ b/sys/dev/usb/uhci.c
@@ -319,7 +319,9 @@ uhci_init(sc)
}
uhci_run(sc, 0); /* stop the controller */
+#if defined(__NetBSD__)
UWRITE2(sc, UHCI_INTR, 0); /* disable interrupts */
+#endif
uhci_busreset(sc);
diff --git a/sys/dev/usb/uhci_pci.c b/sys/dev/usb/uhci_pci.c
index 4bddf8b..c00a6bf 100644
--- a/sys/dev/usb/uhci_pci.c
+++ b/sys/dev/usb/uhci_pci.c
@@ -1,4 +1,4 @@
-/* FreeBSD $Id: uhci_pci.c,v 1.5 1999/04/11 14:24:20 n_hibma Exp $ */
+/* FreeBSD $Id: uhci_pci.c,v 1.6 1999/04/16 21:22:53 peter Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -37,6 +37,16 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+/* Universal Host Controller Interface
+ *
+ * UHCI spec: http://www.intel.com/
+ */
+
+/* The low level controller code for UHCI has been split into
+ * PCI probes and UHCI specific code. This was done to facilitate the
+ * sharing of code between *BSD's
+ */
+
#include "opt_bus.h"
#include <sys/param.h>
@@ -47,6 +57,9 @@
#include <sys/device.h>
#include <sys/proc.h>
#include <sys/queue.h>
+#if defined(__FreeBSD__)
+#include <machine/bus_pio.h>
+#endif
#include <machine/bus.h>
#include <sys/rman.h>
#include <machine/resource.h>
@@ -135,6 +148,8 @@ uhci_pci_attach(device_t dev)
sc->iot = rman_get_bustag(res);
sc->ioh = rman_get_bushandle(res);
+ bus_space_write_2(sc->iot, sc->ioh, UHCI_INTR, 0); /* disable interrupts */
+
rid = 0;
res = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1,
RF_SHAREABLE | RF_ACTIVE);
diff --git a/sys/pci/uhci_pci.c b/sys/pci/uhci_pci.c
index 4bddf8b..c00a6bf 100644
--- a/sys/pci/uhci_pci.c
+++ b/sys/pci/uhci_pci.c
@@ -1,4 +1,4 @@
-/* FreeBSD $Id: uhci_pci.c,v 1.5 1999/04/11 14:24:20 n_hibma Exp $ */
+/* FreeBSD $Id: uhci_pci.c,v 1.6 1999/04/16 21:22:53 peter Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -37,6 +37,16 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+/* Universal Host Controller Interface
+ *
+ * UHCI spec: http://www.intel.com/
+ */
+
+/* The low level controller code for UHCI has been split into
+ * PCI probes and UHCI specific code. This was done to facilitate the
+ * sharing of code between *BSD's
+ */
+
#include "opt_bus.h"
#include <sys/param.h>
@@ -47,6 +57,9 @@
#include <sys/device.h>
#include <sys/proc.h>
#include <sys/queue.h>
+#if defined(__FreeBSD__)
+#include <machine/bus_pio.h>
+#endif
#include <machine/bus.h>
#include <sys/rman.h>
#include <machine/resource.h>
@@ -135,6 +148,8 @@ uhci_pci_attach(device_t dev)
sc->iot = rman_get_bustag(res);
sc->ioh = rman_get_bushandle(res);
+ bus_space_write_2(sc->iot, sc->ioh, UHCI_INTR, 0); /* disable interrupts */
+
rid = 0;
res = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1,
RF_SHAREABLE | RF_ACTIVE);
OpenPOWER on IntegriCloud