ohci.c (198500) | ohci.c (198501) |
---|---|
1/*- 2 * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. 3 * Copyright (c) 1998 The NetBSD Foundation, Inc. All rights reserved. 4 * Copyright (c) 1998 Lennart Augustsson. All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 12 unchanged lines hidden (view full) --- 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 */ 27 28#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. 3 * Copyright (c) 1998 The NetBSD Foundation, Inc. All rights reserved. 4 * Copyright (c) 1998 Lennart Augustsson. All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 12 unchanged lines hidden (view full) --- 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 */ 27 28#include <sys/cdefs.h> |
29__FBSDID("$FreeBSD: head/sys/dev/usb/controller/ohci.c 198500 2009-10-26 20:23:15Z thompsa $"); | 29__FBSDID("$FreeBSD: head/sys/dev/usb/controller/ohci.c 198501 2009-10-26 21:47:16Z thompsa $"); |
30 31/* 32 * USB Open Host Controller driver. 33 * 34 * OHCI spec: http://www.compaq.com/productinfo/development/openhci.html 35 * USB spec: http://www.usb.org/developers/docs/usbspec.zip 36 */ 37 --- 132 unchanged lines hidden (view full) --- 170 uint32_t i; 171 uint32_t ctl; 172 uint32_t ival; 173 uint32_t hcr; 174 uint32_t fm; 175 uint32_t per; 176 uint32_t desca; 177 | 30 31/* 32 * USB Open Host Controller driver. 33 * 34 * OHCI spec: http://www.compaq.com/productinfo/development/openhci.html 35 * USB spec: http://www.usb.org/developers/docs/usbspec.zip 36 */ 37 --- 132 unchanged lines hidden (view full) --- 170 uint32_t i; 171 uint32_t ctl; 172 uint32_t ival; 173 uint32_t hcr; 174 uint32_t fm; 175 uint32_t per; 176 uint32_t desca; 177 |
178 /* Determine in what context we are running. */ 179 ctl = OREAD4(sc, OHCI_CONTROL); 180 if (ctl & OHCI_IR) { 181 /* SMM active, request change */ 182 DPRINTF("SMM active, request owner change\n"); 183 OWRITE4(sc, OHCI_COMMAND_STATUS, OHCI_OCR); 184 for (i = 0; (i < 100) && (ctl & OHCI_IR); i++) { 185 usb_pause_mtx(NULL, hz / 1000); 186 ctl = OREAD4(sc, OHCI_CONTROL); 187 } 188 if (ctl & OHCI_IR) { 189 device_printf(sc->sc_bus.bdev, 190 "SMM does not respond, resetting\n"); 191 OWRITE4(sc, OHCI_CONTROL, OHCI_HCFS_RESET); 192 goto reset; 193 } 194 } else { 195 DPRINTF("cold started\n"); 196reset: 197 /* controller was cold started */ 198 usb_pause_mtx(NULL, 199 USB_MS_TO_TICKS(USB_BUS_RESET_DELAY)); 200 } 201 |
|
178 /* 179 * This reset should not be necessary according to the OHCI spec, but 180 * without it some controllers do not start. 181 */ 182 DPRINTF("%s: resetting\n", device_get_nameunit(sc->sc_bus.bdev)); 183 OWRITE4(sc, OHCI_CONTROL, OHCI_HCFS_RESET); 184 185 usb_pause_mtx(NULL, --- 2552 unchanged lines hidden --- | 202 /* 203 * This reset should not be necessary according to the OHCI spec, but 204 * without it some controllers do not start. 205 */ 206 DPRINTF("%s: resetting\n", device_get_nameunit(sc->sc_bus.bdev)); 207 OWRITE4(sc, OHCI_CONTROL, OHCI_HCFS_RESET); 208 209 usb_pause_mtx(NULL, --- 2552 unchanged lines hidden --- |