lp/drivers/usb: Add quirk for QEMU XHCI root hub

The QEMU XHCI driver does not implement the Port Change Detect bit
in the USBSTS register.  As a result no devices are attached without
looking at each port individually.

Detect this as a quirk based on the QEMU XHCI controller PCI ID,
and apply it to the root hub quirk list so it can get used by the
generic hub driver to skip this check.

With this change an attached USB mass storage device is detected and
able to boot when supplied to qemu:

  -drive if=none,id=usbmsc,format=raw,file=/tmp/disk.img
  -device qemu-xhci,id-xhci
  -device usb-storage,bus=xhci.0,drive=usbmsc

Change-Id: I6689cb1dbb24c93d45f5c5ef040b713925d07588
Signed-off-by: Duncan Laurie <dlaurie@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/39839
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Duncan Laurie
2020-03-18 12:19:14 -07:00
committed by Patrick Georgi
parent 2d7173d462
commit 7724f1142e
4 changed files with 34 additions and 2 deletions

View File

@ -218,9 +218,11 @@ generic_hub_poll(usbdev_t *const dev)
if (!hub)
return;
if (hub->ops->hub_status_changed &&
hub->ops->hub_status_changed(dev) != 1)
if (!(dev->quirks & USB_QUIRK_HUB_NO_USBSTS_PCD) &&
hub->ops->hub_status_changed &&
hub->ops->hub_status_changed(dev) != 1) {
return;
}
int port;
for (port = 1; port <= hub->num_ports; ++port) {