Lines Matching +full:gemini +full:- +full:pci
1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
4 * Copyright (c) 2010-2022 Hans Petter Selasky
87 DRIVER_MODULE(xhci, pci, xhci_pci_driver, NULL, NULL);
167 return ("Intel Gemini Lake USB 3.0 controller"); in xhci_pci_match()
169 return ("Intel Ice Lake-LP USB 3.1 controller"); in xhci_pci_match()
171 return ("Intel Tiger Lake-H USB 3.2 controller"); in xhci_pci_match()
173 return ("Intel Alder Lake-P Thunderbolt 4 USB controller"); in xhci_pci_match()
189 return ("Intel Tiger Lake-LP Thunderbolt 4 USB controller"); in xhci_pci_match()
191 return ("Intel Tiger Lake-H Thunderbolt 4 USB controller"); in xhci_pci_match()
193 return ("Broadwell Integrated PCH-LP chipset USB 3.0 controller"); in xhci_pci_match()
195 return ("Intel Sunrise Point-LP USB 3.0 controller"); in xhci_pci_match()
197 return ("Intel Tiger Lake-LP USB 3.2 controller"); in xhci_pci_match()
214 return ("Zhaoxin ZX-100 USB 3.0 controller"); in xhci_pci_match()
216 return ("Zhaoxin ZX-200 USB 3.0 controller"); in xhci_pci_match()
218 return ("Zhaoxin ZX-E USB 3.0 controller"); in xhci_pci_match()
254 USB_BUS_UNLOCK(&sc->sc_bus); in xhci_interrupt_poll()
256 USB_BUS_LOCK(&sc->sc_bus); in xhci_interrupt_poll()
257 usb_callout_reset(&sc->sc_callout, 1, (void *)&xhci_interrupt_poll, sc); in xhci_interrupt_poll()
294 sc->sc_io_res = bus_alloc_resource_any(self, SYS_RES_MEMORY, &rid, in xhci_pci_attach()
296 if (!sc->sc_io_res) { in xhci_pci_attach()
300 sc->sc_io_tag = rman_get_bustag(sc->sc_io_res); in xhci_pci_attach()
301 sc->sc_io_hdl = rman_get_bushandle(sc->sc_io_res); in xhci_pci_attach()
302 sc->sc_io_size = rman_get_size(sc->sc_io_res); in xhci_pci_attach()
307 sc->sc_no_deconfigure = 1; in xhci_pci_attach()
311 /* Don't use 64-bit DMA on these controllers. */ in xhci_pci_attach()
328 sc->sc_port_route = &xhci_pci_port_route; in xhci_pci_attach()
329 sc->sc_imod_default = XHCI_IMOD_DEFAULT_LP; in xhci_pci_attach()
330 sc->sc_ctlstep = 1; in xhci_pci_attach()
339 sc->sc_io_res); in xhci_pci_attach()
345 usb_callout_init_mtx(&sc->sc_callout, &sc->sc_bus.bus_mtx, 0); in xhci_pci_attach()
350 sc->sc_msix_res = sc->sc_io_res; in xhci_pci_attach()
352 sc->sc_msix_res = bus_alloc_resource_any(self, in xhci_pci_attach()
354 if (sc->sc_msix_res == NULL) { in xhci_pci_attach()
357 "Unable to map MSI-X table\n"); in xhci_pci_attach()
360 if (sc->sc_msix_res != NULL) { in xhci_pci_attach()
364 device_printf(self, "MSI-X enabled\n"); in xhci_pci_attach()
367 if (sc->sc_msix_res != sc->sc_io_res) { in xhci_pci_attach()
370 msix_table, sc->sc_msix_res); in xhci_pci_attach()
372 sc->sc_msix_res = NULL; in xhci_pci_attach()
384 sc->sc_irq_res = bus_alloc_resource_any(self, SYS_RES_IRQ, &rid, in xhci_pci_attach()
386 if (sc->sc_irq_res == NULL) { in xhci_pci_attach()
389 /* goto error; FALLTHROUGH - use polling */ in xhci_pci_attach()
391 sc->sc_bus.bdev = device_add_child(self, "usbus", DEVICE_UNIT_ANY); in xhci_pci_attach()
392 if (sc->sc_bus.bdev == NULL) { in xhci_pci_attach()
396 device_set_ivars(sc->sc_bus.bdev, &sc->sc_bus); in xhci_pci_attach()
400 strlcpy(sc->sc_vendor, "AMD", sizeof(sc->sc_vendor)); in xhci_pci_attach()
403 strlcpy(sc->sc_vendor, "Intel", sizeof(sc->sc_vendor)); in xhci_pci_attach()
406 strlcpy(sc->sc_vendor, "VMware", sizeof(sc->sc_vendor)); in xhci_pci_attach()
409 strlcpy(sc->sc_vendor, "Zhaoxin", sizeof(sc->sc_vendor)); in xhci_pci_attach()
415 snprintf(sc->sc_vendor, sizeof(sc->sc_vendor), in xhci_pci_attach()
420 if (sc->sc_irq_res != NULL && xhci_use_polling() == 0) { in xhci_pci_attach()
421 err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, in xhci_pci_attach()
422 NULL, (driver_intr_t *)xhci_interrupt, sc, &sc->sc_intr_hdl); in xhci_pci_attach()
425 rman_get_rid(sc->sc_irq_res), sc->sc_irq_res); in xhci_pci_attach()
426 sc->sc_irq_res = NULL; in xhci_pci_attach()
429 sc->sc_intr_hdl = NULL; in xhci_pci_attach()
432 if (sc->sc_irq_res == NULL || sc->sc_intr_hdl == NULL) { in xhci_pci_attach()
435 USB_BUS_LOCK(&sc->sc_bus); in xhci_pci_attach()
437 USB_BUS_UNLOCK(&sc->sc_bus); in xhci_pci_attach()
450 err = device_probe_and_attach(sc->sc_bus.bdev); in xhci_pci_attach()
474 usb_callout_drain(&sc->sc_callout); in xhci_pci_detach()
480 if (sc->sc_irq_res && sc->sc_intr_hdl) { in xhci_pci_detach()
481 bus_teardown_intr(self, sc->sc_irq_res, sc->sc_intr_hdl); in xhci_pci_detach()
482 sc->sc_intr_hdl = NULL; in xhci_pci_detach()
484 if (sc->sc_irq_res) { in xhci_pci_detach()
486 rman_get_rid(sc->sc_irq_res), sc->sc_irq_res); in xhci_pci_detach()
487 sc->sc_irq_res = NULL; in xhci_pci_detach()
490 if (sc->sc_msix_res != NULL && sc->sc_msix_res != sc->sc_io_res) { in xhci_pci_detach()
492 rman_get_rid(sc->sc_msix_res), sc->sc_msix_res); in xhci_pci_detach()
493 sc->sc_msix_res = NULL; in xhci_pci_detach()
495 if (sc->sc_io_res) { in xhci_pci_detach()
497 sc->sc_io_res); in xhci_pci_detach()
498 sc->sc_io_res = NULL; in xhci_pci_detach()
518 eec = -1; in xhci_pci_take_controller()
531 device_printf(sc->sc_bus.bdev, "waiting for BIOS " in xhci_pci_take_controller()
542 if (--to == 0) { in xhci_pci_take_controller()
543 device_printf(sc->sc_bus.bdev, in xhci_pci_take_controller()