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

1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
34 * USB Open Host Controller driver.
36 * OHCI spec: http://www.intel.com/design/usb/ohci11d.pdf
39 /* The low level controller code for OHCI has been split into
63 #include <dev/usb/usb.h>
64 #include <dev/usb/usbdi.h>
66 #include <dev/usb/usb_core.h>
67 #include <dev/usb/usb_busdma.h>
68 #include <dev/usb/usb_process.h>
69 #include <dev/usb/usb_util.h>
71 #include <dev/usb/usb_controller.h>
72 #include <dev/usb/usb_bus.h>
73 #include <dev/usb/usb_pci.h>
74 #include <dev/usb/controller/ohci.h>
75 #include <dev/usb/controller/ohcireg.h>
105 "-- setting to D0\n", pci_get_powerstate(self)); in ohci_pci_take_controller()
122 return ("AcerLabs M5237 (Aladdin-V) USB controller"); in ohci_pci_match()
125 return ("AMD-756 USB Controller"); in ohci_pci_match()
127 return ("AMD-766 USB Controller"); in ohci_pci_match()
129 return ("AMD FCH USB Controller"); in ohci_pci_match()
132 return "ATI SB400 USB Controller"; in ohci_pci_match()
134 return "ATI SB400 USB Controller"; in ohci_pci_match()
136 return ("AMD SB7x0/SB8x0/SB9x0 USB controller"); in ohci_pci_match()
138 return ("AMD SB7x0/SB8x0/SB9x0 USB controller"); in ohci_pci_match()
140 return ("AMD SB7x0/SB8x0/SB9x0 USB controller"); in ohci_pci_match()
143 return ("CMD Tech 670 (USB0670) USB controller"); in ohci_pci_match()
146 return ("CMD Tech 673 (USB0673) USB controller"); in ohci_pci_match()
149 return ("OPTi 82C861 (FireLink) USB controller"); in ohci_pci_match()
152 return ("NEC uPD 9210 USB controller"); in ohci_pci_match()
155 return ("nVidia nForce3 USB Controller"); in ohci_pci_match()
158 return ("nVidia nForce CK804 USB Controller"); in ohci_pci_match()
160 return ("nVidia nForce MCP55 USB Controller"); in ohci_pci_match()
162 return ("nVidia nForce MCP61 USB Controller"); in ohci_pci_match()
164 return ("nVidia nForce MCP79 USB Controller"); in ohci_pci_match()
166 return ("nVidia nForce MCP79 USB Controller"); in ohci_pci_match()
168 return ("nVidia nForce MCP79 USB Controller"); in ohci_pci_match()
171 return ("SiS 5571 USB controller"); in ohci_pci_match()
174 return ("Apple KeyLargo USB controller"); in ohci_pci_match()
176 return ("Apple KeyLargo/Intrepid USB controller"); in ohci_pci_match()
184 return ("OHCI (generic) USB controller"); in ohci_pci_match()
210 sc->sc_bus.parent = self; in ohci_pci_attach()
211 sc->sc_bus.devices = sc->sc_devices; in ohci_pci_attach()
212 sc->sc_bus.devices_max = OHCI_MAX_DEVICES; in ohci_pci_attach()
213 sc->sc_bus.dma_bits = 32; in ohci_pci_attach()
216 if (usb_bus_mem_alloc_all(&sc->sc_bus, USB_GET_DMA_TAG(self), in ohci_pci_attach()
220 sc->sc_dev = self; in ohci_pci_attach()
225 sc->sc_io_res = bus_alloc_resource_any(self, SYS_RES_MEMORY, &rid, in ohci_pci_attach()
227 if (!sc->sc_io_res) { in ohci_pci_attach()
231 sc->sc_io_tag = rman_get_bustag(sc->sc_io_res); in ohci_pci_attach()
232 sc->sc_io_hdl = rman_get_bushandle(sc->sc_io_res); in ohci_pci_attach()
233 sc->sc_io_size = rman_get_size(sc->sc_io_res); in ohci_pci_attach()
236 sc->sc_irq_res = bus_alloc_resource_any(self, SYS_RES_IRQ, &rid, in ohci_pci_attach()
238 if (sc->sc_irq_res == NULL) { in ohci_pci_attach()
242 sc->sc_bus.bdev = device_add_child(self, "usbus", DEVICE_UNIT_ANY); in ohci_pci_attach()
243 if (!sc->sc_bus.bdev) { in ohci_pci_attach()
244 device_printf(self, "Could not add USB device\n"); in ohci_pci_attach()
247 device_set_ivars(sc->sc_bus.bdev, &sc->sc_bus); in ohci_pci_attach()
253 device_set_desc(sc->sc_bus.bdev, ohci_pci_match(self)); in ohci_pci_attach()
256 sprintf(sc->sc_vendor, "AcerLabs"); in ohci_pci_attach()
259 sprintf(sc->sc_vendor, "AMD"); in ohci_pci_attach()
262 sprintf(sc->sc_vendor, "Apple"); in ohci_pci_attach()
265 sprintf(sc->sc_vendor, "ATI"); in ohci_pci_attach()
268 sprintf(sc->sc_vendor, "CMDTECH"); in ohci_pci_attach()
271 sprintf(sc->sc_vendor, "Hygon"); in ohci_pci_attach()
274 sprintf(sc->sc_vendor, "NEC"); in ohci_pci_attach()
278 sprintf(sc->sc_vendor, "nVidia"); in ohci_pci_attach()
281 sprintf(sc->sc_vendor, "OPTi"); in ohci_pci_attach()
284 sprintf(sc->sc_vendor, "SiS"); in ohci_pci_attach()
291 sprintf(sc->sc_vendor, "(0x%04x)", pci_get_vendor(self)); in ohci_pci_attach()
294 /* sc->sc_bus.usbrev; set by ohci_init() */ in ohci_pci_attach()
296 err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, in ohci_pci_attach()
297 NULL, (driver_intr_t *)ohci_interrupt, sc, &sc->sc_intr_hdl); in ohci_pci_attach()
300 sc->sc_intr_hdl = NULL; in ohci_pci_attach()
305 err = device_probe_and_attach(sc->sc_bus.bdev); in ohci_pci_attach()
308 device_printf(self, "USB init failed\n"); in ohci_pci_attach()
331 if (sc->sc_irq_res && sc->sc_intr_hdl) { in ohci_pci_detach()
337 int err = bus_teardown_intr(self, sc->sc_irq_res, sc->sc_intr_hdl); in ohci_pci_detach()
344 sc->sc_intr_hdl = NULL; in ohci_pci_detach()
346 if (sc->sc_irq_res) { in ohci_pci_detach()
347 bus_release_resource(self, SYS_RES_IRQ, 0, sc->sc_irq_res); in ohci_pci_detach()
348 sc->sc_irq_res = NULL; in ohci_pci_detach()
350 if (sc->sc_io_res) { in ohci_pci_detach()
352 sc->sc_io_res); in ohci_pci_detach()
353 sc->sc_io_res = NULL; in ohci_pci_detach()
355 usb_bus_mem_free_all(&sc->sc_bus, &ohci_iterate_hw_softc); in ohci_pci_detach()
380 MODULE_DEPEND(ohci, usb, 1, 1, 1);