> Date: Tue, 31 May 2016 18:43:16 +0200
> From: Martin Pieuchot <[email protected]>
>
> I finally got my hands on a DELL Optiplex 3020. The BIOS on this
> machines uses the xHCI controller to handle the keyboard and mouse.
>
> Turns out that I badly copy/pasted the ehci(4) code to take over the
> HC from the BIOS. With the diff below I can now route all my ports
> to xhci(4) and the machine no longer hang at boot.
>
> ok?
ok kettenis@
> Index: xhci_pci.c
> ===================================================================
> RCS file: /cvs/src/sys/dev/pci/xhci_pci.c,v
> retrieving revision 1.7
> diff -u -p -r1.7 xhci_pci.c
> --- xhci_pci.c 2 Nov 2015 14:53:10 -0000 1.7
> +++ xhci_pci.c 31 May 2016 16:36:14 -0000
> @@ -258,8 +258,9 @@ xhci_pci_takecontroller(struct xhci_pci_
> eec = -1;
>
> /* Synchronise with the BIOS if it owns the controller. */
> - for (xecp = XHCI_HCC_XECP(cparams) << 2; xecp != 0;
> - xecp = XHCI_XECP_NEXT(eec) << 2) {
> + for (xecp = XHCI_HCC_XECP(cparams) << 2;
> + xecp != 0 && XHCI_XECP_NEXT(eec);
> + xecp += XHCI_XECP_NEXT(eec) << 2) {
> eec = XREAD4(&psc->sc, xecp);
> if (XHCI_XECP_ID(eec) != XHCI_ID_USB_LEGACY)
> continue;
>
>