summaryrefslogtreecommitdiff
path: root/sys/dev/usb/uhci.c
diff options
context:
space:
mode:
authorChristopher Pascoe <pascoe@cvs.openbsd.org>2007-03-22 05:47:17 +0000
committerChristopher Pascoe <pascoe@cvs.openbsd.org>2007-03-22 05:47:17 +0000
commit55c7994211c29cfec508c44539391d806e41e8ee (patch)
treecc64c68e522d47837b06e7cd01d8142589c4313f /sys/dev/usb/uhci.c
parent24e49178717ca01e2548985701c1ba971751050f (diff)
Reapplication of rev 1.49.
Save SOF (frame timing adjustment) before the very first host controller reset, rather than at suspend/resume, otherwise any BIOS inserted value is lost immediately. ok dlg@
Diffstat (limited to 'sys/dev/usb/uhci.c')
-rw-r--r--sys/dev/usb/uhci.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/dev/usb/uhci.c b/sys/dev/usb/uhci.c
index 50ec3b3e891..5865d7d69e8 100644
--- a/sys/dev/usb/uhci.c
+++ b/sys/dev/usb/uhci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uhci.c,v 1.50 2007/03/18 20:14:51 mglocker Exp $ */
+/* $OpenBSD: uhci.c,v 1.51 2007/03/22 05:47:16 pascoe Exp $ */
/* $NetBSD: uhci.c,v 1.172 2003/02/23 04:19:26 simonb Exp $ */
/* $FreeBSD: src/sys/dev/usb/uhci.c,v 1.33 1999/11/17 22:33:41 n_hibma Exp $ */
@@ -409,10 +409,16 @@ uhci_init(uhci_softc_t *sc)
uhci_dumpregs(sc);
#endif
+ /* Save SOF over HC reset. */
+ sc->sc_saved_sof = UREAD1(sc, UHCI_SOF);
+
UWRITE2(sc, UHCI_INTR, 0); /* disable interrupts */
uhci_globalreset(sc); /* reset the controller */
uhci_reset(sc);
+ /* Restore saved SOF. */
+ UWRITE1(sc, UHCI_SOF, sc->sc_saved_sof);
+
/* Allocate and initialize real frame array. */
err = usb_allocmem(&sc->sc_bus,
UHCI_FRAMELIST_COUNT * sizeof(uhci_physaddr_t),
@@ -720,7 +726,6 @@ uhci_power(int why, void *v)
/* save some state if BIOS doesn't */
sc->sc_saved_frnum = UREAD2(sc, UHCI_FRNUM);
- sc->sc_saved_sof = UREAD1(sc, UHCI_SOF);
UWRITE2(sc, UHCI_INTR, 0); /* disable intrs */