Lines Matching +full:usb +full:- +full:controller

1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
34 * USB Enhanced Host Controller Driver, a.k.a. USB 2.0 controller.
37 * http://developer.intel.com/technology/usb/download/ehci-r10.pdf
38 * and the USB 2.0 spec at
39 * http://www.usb.org/developers/docs/usb_20.zip
42 /* The low level controller code for EHCI has been split into
66 #include <dev/usb/usb.h>
67 #include <dev/usb/usbdi.h>
69 #include <dev/usb/usb_core.h>
70 #include <dev/usb/usb_busdma.h>
71 #include <dev/usb/usb_process.h>
72 #include <dev/usb/usb_util.h>
74 #include <dev/usb/usb_controller.h>
75 #include <dev/usb/usb_bus.h>
76 #include <dev/usb/usb_pci.h>
77 #include <dev/usb/controller/ehci.h>
78 #include <dev/usb/controller/ehcireg.h>
110 return "ALi M5239 USB 2.0 controller"; in ehci_pci_match()
113 return "AMD 8111 USB 2.0 controller"; in ehci_pci_match()
116 return ("AMD CS5536 (Geode) USB 2.0 controller"); in ehci_pci_match()
118 return ("AMD FCH USB 2.0 controller"); in ehci_pci_match()
120 return ("AMD FCH USB 2.0 controller"); in ehci_pci_match()
123 return "ATI SB200 USB 2.0 controller"; in ehci_pci_match()
125 return "ATI SB400 USB 2.0 controller"; in ehci_pci_match()
127 return ("AMD SB7x0/SB8x0/SB9x0 USB 2.0 controller"); in ehci_pci_match()
130 return ("Intel BayTrail USB 2.0 controller"); in ehci_pci_match()
132 return ("Intel Cougar Point USB 2.0 controller"); in ehci_pci_match()
134 return ("Intel Cougar Point USB 2.0 controller"); in ehci_pci_match()
136 return ("Intel Patsburg USB 2.0 controller"); in ehci_pci_match()
138 return ("Intel Patsburg USB 2.0 controller"); in ehci_pci_match()
140 return ("Intel Panther Point USB 2.0 controller"); in ehci_pci_match()
142 return ("Intel Panther Point USB 2.0 controller"); in ehci_pci_match()
144 return ("Intel Avoton USB 2.0 controller"); in ehci_pci_match()
146 return "Intel 6300ESB USB 2.0 controller"; in ehci_pci_match()
148 return "Intel 82801DB/L/M (ICH4) USB 2.0 controller"; in ehci_pci_match()
150 return "Intel 82801EB/R (ICH5) USB 2.0 controller"; in ehci_pci_match()
152 return "Intel 82801FB (ICH6) USB 2.0 controller"; in ehci_pci_match()
154 return ("Intel 63XXESB USB 2.0 controller"); in ehci_pci_match()
156 return "Intel 82801GB/R (ICH7) USB 2.0 controller"; in ehci_pci_match()
158 return "Intel 82801H (ICH8) USB 2.0 controller USB2-A"; in ehci_pci_match()
160 return "Intel 82801H (ICH8) USB 2.0 controller USB2-B"; in ehci_pci_match()
162 return "Intel 82801I (ICH9) USB 2.0 controller"; in ehci_pci_match()
164 return "Intel 82801I (ICH9) USB 2.0 controller"; in ehci_pci_match()
166 return "Intel 82801JI (ICH10) USB 2.0 controller USB-A"; in ehci_pci_match()
168 return "Intel 82801JI (ICH10) USB 2.0 controller USB-B"; in ehci_pci_match()
170 return "Intel 82801JD (ICH10) USB 2.0 controller USB-A"; in ehci_pci_match()
172 return "Intel 82801JD (ICH10) USB 2.0 controller USB-B"; in ehci_pci_match()
174 return ("Intel PCH USB 2.0 controller USB-A"); in ehci_pci_match()
176 return ("Intel PCH USB 2.0 controller USB-B"); in ehci_pci_match()
178 return ("Intel Lynx Point USB 2.0 controller USB-A"); in ehci_pci_match()
180 return ("Intel Lynx Point USB 2.0 controller USB-B"); in ehci_pci_match()
182 return ("Intel Wildcat Point USB 2.0 controller USB-A"); in ehci_pci_match()
184 return ("Intel Wildcat Point USB 2.0 controller USB-B"); in ehci_pci_match()
186 return ("Intel Wellsburg USB 2.0 controller"); in ehci_pci_match()
188 return ("Intel Wellsburg USB 2.0 controller"); in ehci_pci_match()
190 return ("Intel Lynx Point-LP USB 2.0 controller"); in ehci_pci_match()
192 return ("Intel Wildcat Point-LP USB 2.0 controller"); in ehci_pci_match()
195 return ("NEC uPD 72010x USB 2.0 controller"); in ehci_pci_match()
198 return "NVIDIA nForce2 USB 2.0 controller"; in ehci_pci_match()
200 return "NVIDIA nForce2 Ultra 400 USB 2.0 controller"; in ehci_pci_match()
202 return "NVIDIA nForce3 USB 2.0 controller"; in ehci_pci_match()
204 return "NVIDIA nForce3 250 USB 2.0 controller"; in ehci_pci_match()
206 return "NVIDIA nForce CK804 USB 2.0 controller"; in ehci_pci_match()
208 return "NVIDIA nForce MCP55 USB 2.0 controller"; in ehci_pci_match()
210 return "NVIDIA nForce MCP61 USB 2.0 controller"; in ehci_pci_match()
212 return "NVIDIA nForce MCP79 USB 2.0 controller"; in ehci_pci_match()
214 return "NVIDIA nForce MCP79 USB 2.0 controller"; in ehci_pci_match()
216 return "NVIDIA nForce MCP79 USB 2.0 controller"; in ehci_pci_match()
219 return "Philips ISP156x USB 2.0 controller"; in ehci_pci_match()
222 return "SiS 968 USB 2.0 controller"; in ehci_pci_match()
225 return ("VIA VT6202 USB 2.0 controller"); in ehci_pci_match()
228 return ("VMware USB 2.0 controller"); in ehci_pci_match()
231 return ("Zhaoxin ZX-100/ZX-200/ZX-E USB 2.0 controller"); in ehci_pci_match()
240 return ("EHCI (generic) USB 2.0 controller"); in ehci_pci_match()
299 device_printf(self, "VIA-quirk applied\n"); in ehci_pci_via_quirk()
311 sc->sc_bus.parent = self; in ehci_pci_attach()
312 sc->sc_bus.devices = sc->sc_devices; in ehci_pci_attach()
313 sc->sc_bus.devices_max = EHCI_MAX_DEVICES; in ehci_pci_attach()
314 sc->sc_bus.dma_bits = 32; in ehci_pci_attach()
317 if (usb_bus_mem_alloc_all(&sc->sc_bus, in ehci_pci_attach()
329 * NOTE: some EHCI USB controllers have the wrong USB in ehci_pci_attach()
334 device_printf(self, "pre-2.0 USB revision (ignored)\n"); in ehci_pci_attach()
340 device_printf(self, "USB revision is unknown. Assuming v2.0.\n"); in ehci_pci_attach()
345 sc->sc_io_res = bus_alloc_resource_any(self, SYS_RES_MEMORY, &rid, in ehci_pci_attach()
347 if (!sc->sc_io_res) { in ehci_pci_attach()
351 sc->sc_io_tag = rman_get_bustag(sc->sc_io_res); in ehci_pci_attach()
352 sc->sc_io_hdl = rman_get_bushandle(sc->sc_io_res); in ehci_pci_attach()
353 sc->sc_io_size = rman_get_size(sc->sc_io_res); in ehci_pci_attach()
356 sc->sc_irq_res = bus_alloc_resource_any(self, SYS_RES_IRQ, &rid, in ehci_pci_attach()
358 if (sc->sc_irq_res == NULL) { in ehci_pci_attach()
362 sc->sc_bus.bdev = device_add_child(self, "usbus", DEVICE_UNIT_ANY); in ehci_pci_attach()
363 if (!sc->sc_bus.bdev) { in ehci_pci_attach()
364 device_printf(self, "Could not add USB device\n"); in ehci_pci_attach()
367 device_set_ivars(sc->sc_bus.bdev, &sc->sc_bus); in ehci_pci_attach()
373 device_set_desc(sc->sc_bus.bdev, ehci_pci_match(self)); in ehci_pci_attach()
376 sprintf(sc->sc_vendor, "AcerLabs"); in ehci_pci_attach()
379 sprintf(sc->sc_vendor, "AMD"); in ehci_pci_attach()
382 sprintf(sc->sc_vendor, "Apple"); in ehci_pci_attach()
385 sprintf(sc->sc_vendor, "ATI"); in ehci_pci_attach()
388 sprintf(sc->sc_vendor, "CMDTECH"); in ehci_pci_attach()
391 sprintf(sc->sc_vendor, "Hygon"); in ehci_pci_attach()
394 sprintf(sc->sc_vendor, "Intel"); in ehci_pci_attach()
397 sprintf(sc->sc_vendor, "NEC"); in ehci_pci_attach()
400 sprintf(sc->sc_vendor, "OPTi"); in ehci_pci_attach()
403 sprintf(sc->sc_vendor, "Philips"); in ehci_pci_attach()
406 sprintf(sc->sc_vendor, "SiS"); in ehci_pci_attach()
410 sprintf(sc->sc_vendor, "nVidia"); in ehci_pci_attach()
413 sprintf(sc->sc_vendor, "VIA"); in ehci_pci_attach()
416 sprintf(sc->sc_vendor, "VMware"); in ehci_pci_attach()
419 sprintf(sc->sc_vendor, "Zhaoxin"); in ehci_pci_attach()
425 sprintf(sc->sc_vendor, "(0x%04x)", pci_get_vendor(self)); in ehci_pci_attach()
428 err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, in ehci_pci_attach()
429 NULL, (driver_intr_t *)ehci_interrupt, sc, &sc->sc_intr_hdl); in ehci_pci_attach()
432 sc->sc_intr_hdl = NULL; in ehci_pci_attach()
466 sc->sc_flags |= EHCI_SCFLG_LOSTINTRBUG; in ehci_pci_attach()
479 sc->sc_flags |= EHCI_SCFLG_IAADBUG; in ehci_pci_attach()
490 err = device_probe_and_attach(sc->sc_bus.bdev); in ehci_pci_attach()
493 device_printf(self, "USB init failed err=%d\n", err); in ehci_pci_attach()
516 if (sc->sc_irq_res && sc->sc_intr_hdl) { in ehci_pci_detach()
522 int err = bus_teardown_intr(self, sc->sc_irq_res, sc->sc_intr_hdl); in ehci_pci_detach()
528 sc->sc_intr_hdl = NULL; in ehci_pci_detach()
530 if (sc->sc_irq_res) { in ehci_pci_detach()
531 bus_release_resource(self, SYS_RES_IRQ, 0, sc->sc_irq_res); in ehci_pci_detach()
532 sc->sc_irq_res = NULL; in ehci_pci_detach()
534 if (sc->sc_io_res) { in ehci_pci_detach()
536 sc->sc_io_res); in ehci_pci_detach()
537 sc->sc_io_res = NULL; in ehci_pci_detach()
539 usb_bus_mem_free_all(&sc->sc_bus, &ehci_iterate_hw_softc); in ehci_pci_detach()
556 /* Synchronise with the BIOS if it owns the controller. */ in ehci_pci_take_controller()
568 device_printf(sc->sc_bus.bdev, "waiting for BIOS " in ehci_pci_take_controller()
579 if (--to == 0) { in ehci_pci_take_controller()
580 device_printf(sc->sc_bus.bdev, in ehci_pci_take_controller()
610 MODULE_DEPEND(ehci, usb, 1, 1, 1);