diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2015-12-18 12:56:33 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2015-12-20 15:34:47 -0500 |
commit | 49fb0349b886c0d94ca9978356fc74f67682588f (patch) | |
tree | 94bcf9a70358bbbd28dfe0aed2144a091d8ce5fb /src/hw/usb-xhci.c | |
parent | c01b41c5c68c197fe0124078261b48942f2919bd (diff) | |
download | seabios-49fb0349b886c0d94ca9978356fc74f67682588f.tar.gz |
xhci: Improve port status change debugging
Report the port state on a port status change notification. Clear the
change bits so further change notifications are delivered.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/hw/usb-xhci.c')
-rw-r--r-- | src/hw/usb-xhci.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/hw/usb-xhci.c b/src/hw/usb-xhci.c index 654febaa..5f44239a 100644 --- a/src/hw/usb-xhci.c +++ b/src/hw/usb-xhci.c @@ -658,9 +658,15 @@ static void xhci_process_events(struct usb_xhci_s *xhci) } case ER_PORT_STATUS_CHANGE: { - u32 portid = (etrb->ptr_low >> 24) & 0xff; - dprintf(3, "%s: status change port #%d\n", - __func__, portid); + u32 port = ((etrb->ptr_low >> 24) & 0xff) - 1; + // Read status, and clear port status change bits + u32 portsc = readl(&xhci->pr[port].portsc); + u32 pclear = (((portsc & ~(XHCI_PORTSC_PED|XHCI_PORTSC_PR)) + & ~(XHCI_PORTSC_PLS_MASK<<XHCI_PORTSC_PLS_SHIFT)) + | (1<<XHCI_PORTSC_PLS_SHIFT)); + writel(&xhci->pr[port].portsc, pclear); + + xhci_print_port_state(3, __func__, port, portsc); break; } default: |