summaryrefslogtreecommitdiff
path: root/sys/dev/usb/ohci.c
diff options
context:
space:
mode:
authorChristopher Pascoe <pascoe@cvs.openbsd.org>2007-03-18 06:08:25 +0000
committerChristopher Pascoe <pascoe@cvs.openbsd.org>2007-03-18 06:08:25 +0000
commit112100be1d15b3241b1e8acf05932b12c18880e6 (patch)
tree4ed2b7de8afa2f4ef56b68241325f6763653e45a /sys/dev/usb/ohci.c
parenta4aa20bbe39a4ed79d63cfde14fc8c13f34abe59 (diff)
Perform legacy emulation handover for USB1 companion controllers immediately
but defer the remainder of their initialisation until after the other devices on their PCI bus have attached. This ensures that any USB2 controller has also completed its initialisation before we start to initialise the USB1 parts. This minimises the chance that a nasty SMM implementation will trash the USB1 controller's config when it performs legacy emulation handover of the USB2 part.
Diffstat (limited to 'sys/dev/usb/ohci.c')
-rw-r--r--sys/dev/usb/ohci.c28
1 files changed, 7 insertions, 21 deletions
diff --git a/sys/dev/usb/ohci.c b/sys/dev/usb/ohci.c
index e5f1f55e477..4e3c6bc2a2f 100644
--- a/sys/dev/usb/ohci.c
+++ b/sys/dev/usb/ohci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ohci.c,v 1.73 2006/06/23 06:27:11 miod Exp $ */
+/* $OpenBSD: ohci.c,v 1.74 2007/03/18 06:08:24 pascoe Exp $ */
/* $NetBSD: ohci.c,v 1.139 2003/02/22 05:24:16 tsutsui Exp $ */
/* $FreeBSD: src/sys/dev/usb/ohci.c,v 1.22 1999/11/17 22:33:40 n_hibma Exp $ */
@@ -616,7 +616,7 @@ ohci_init(ohci_softc_t *sc)
ohci_soft_ed_t *sed, *psed;
usbd_status err;
int i;
- u_int32_t s, ctl, rwc, ival, hcr, fm, per, rev, desca, descb;
+ u_int32_t ctl, rwc, ival, hcr, fm, per, rev, desca, descb;
DPRINTF(("ohci_init: start\n"));
printf(",");
@@ -718,26 +718,12 @@ ohci_init(ohci_softc_t *sc)
desca = OREAD4(sc, OHCI_RH_DESCRIPTOR_A);
descb = OREAD4(sc, OHCI_RH_DESCRIPTOR_B);
- /* Determine in what context we are running. */
+ /* SMM handover performed by the PCI code didn't work? */
if (ctl & OHCI_IR) {
- /* SMM active, request change */
- DPRINTF(("ohci_init: SMM active, request owner change\n"));
- if ((sc->sc_intre & (OHCI_OC | OHCI_MIE)) ==
- (OHCI_OC | OHCI_MIE))
- OWRITE4(sc, OHCI_INTERRUPT_ENABLE, OHCI_MIE);
- s = OREAD4(sc, OHCI_COMMAND_STATUS);
- OWRITE4(sc, OHCI_COMMAND_STATUS, s | OHCI_OCR);
- for (i = 0; i < 100 && (ctl & OHCI_IR); i++) {
- usb_delay_ms(&sc->sc_bus, 1);
- ctl = OREAD4(sc, OHCI_CONTROL);
- }
- OWRITE4(sc, OHCI_INTERRUPT_DISABLE, OHCI_MIE);
- if (ctl & OHCI_IR) {
- printf("%s: SMM does not respond, resetting\n",
- USBDEVNAME(sc->sc_bus.bdev));
- OWRITE4(sc, OHCI_CONTROL, OHCI_HCFS_RESET | rwc);
- goto reset;
- }
+ printf("%s: SMM does not respond, resetting\n",
+ USBDEVNAME(sc->sc_bus.bdev));
+ OWRITE4(sc, OHCI_CONTROL, OHCI_HCFS_RESET | rwc);
+ goto reset;
#if 0
/* Don't bother trying to reuse the BIOS init, we'll reset it anyway. */
} else if ((ctl & OHCI_HCFS_MASK) != OHCI_HCFS_RESET) {