// Check if need companion controllers for full/low speed devices static void ehci_note_port(struct usb_ehci_s *cntl) { if (--cntl->checkports) // Ports still being detected. return; if (! cntl->legacycount) // No full/low speed devices found. return; // Start companion controllers. int i; for (i=0; i<ARRAY_SIZE(cntl->companion); i++) { struct pci_device *pci = cntl->companion[i]; if (!pci) break; // ohci/uhci_setup call pci_config_X - don't run from irq handler. wait_preempt(); if (pci_classprog(pci) == PCI_CLASS_SERIAL_USB_UHCI) uhci_setup(pci, cntl->usb.busid + i); else if (pci_classprog(pci) == PCI_CLASS_SERIAL_USB_OHCI) ohci_setup(pci, cntl->usb.busid + i); } }
void __usb_setup(void *data) { dprintf(3, "init usb\n"); xhci_setup(); ehci_setup(); uhci_setup(); ohci_setup(); }
void usb_setup(void) { ASSERT32FLAT(); if (! CONFIG_USB) return; dprintf(3, "init usb\n"); usb_time_sigatt = romfile_loadint("etc/usb-time-sigatt", USB_TIME_SIGATT); xhci_setup(); ehci_setup(); uhci_setup(); ohci_setup(); }