summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorChristopher Pascoe <pascoe@cvs.openbsd.org>2007-03-18 05:55:25 +0000
committerChristopher Pascoe <pascoe@cvs.openbsd.org>2007-03-18 05:55:25 +0000
commitdda08a757bf5626de461e2fdf58d05bae67b4272 (patch)
tree9f5bbe3b3b8342e7770847e0cef0db098753675b /sys/dev
parenta0e3bea96b703f118dbed4d6044c111ca5e95e9e (diff)
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')
-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 00e34cfc7c8..e83cecaadb1 100644
--- a/sys/dev/usb/uhci.c
+++ b/sys/dev/usb/uhci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uhci.c,v 1.48 2006/06/23 06:27:11 miod Exp $ */
+/* $OpenBSD: uhci.c,v 1.49 2007/03/18 05:55:24 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 */