aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2010-02-14 19:05:35 -0500
committerKevin O'Connor <kevin@koconnor.net>2010-02-14 19:05:35 -0500
commitba94a68d273fa82015fb56d4c9410047cf59c21b (patch)
tree42d25e00e93d4a32f8f633aa32e0d061b39e873b
parent49a0aa61a581991526926a875c30870bfd7ec6e9 (diff)
downloadseabios-ba94a68d273fa82015fb56d4c9410047cf59c21b.tar.gz
Don't leave USB UHCI ports disabled for extended time during reset.
Disabling the port will cause device to go into suspend - so don't do that during the reset sequence.
-rw-r--r--src/usb-uhci.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/usb-uhci.c b/src/usb-uhci.c
index b7ff3946..c3ff744b 100644
--- a/src/usb-uhci.c
+++ b/src/usb-uhci.c
@@ -94,6 +94,7 @@ start_uhci(struct usb_s *cntl)
static int
check_ports(struct usb_s *cntl)
{
+ // XXX - if just powered up, need to wait for USB_TIME_SIGATT?
u16 port1 = inw(cntl->uhci.iobase + USBPORTSC1);
u16 port2 = inw(cntl->uhci.iobase + USBPORTSC2);
@@ -101,29 +102,34 @@ check_ports(struct usb_s *cntl)
// No devices
return 0;
+ // XXX - if just powered up, need to wait for USB_TIME_ATTDB?
+
// reset ports
if (port1 & USBPORTSC_CCS)
outw(USBPORTSC_PR, cntl->uhci.iobase + USBPORTSC1);
if (port2 & USBPORTSC_CCS)
outw(USBPORTSC_PR, cntl->uhci.iobase + USBPORTSC2);
msleep(USB_TIME_DRSTR);
- outw(0, cntl->uhci.iobase + USBPORTSC1);
- outw(0, cntl->uhci.iobase + USBPORTSC2);
- msleep(USB_TIME_RSTRCY);
// Configure ports
int totalcount = 0;
+ outw(0, cntl->uhci.iobase + USBPORTSC1);
+ udelay(6); // 64 high-speed bit times
port1 = inw(cntl->uhci.iobase + USBPORTSC1);
if (port1 & USBPORTSC_CCS) {
outw(USBPORTSC_PE, cntl->uhci.iobase + USBPORTSC1);
+ msleep(USB_TIME_RSTRCY);
int count = configure_usb_device(cntl, !!(port1 & USBPORTSC_LSDA));
if (! count)
outw(0, cntl->uhci.iobase + USBPORTSC1);
totalcount += count;
}
+ outw(0, cntl->uhci.iobase + USBPORTSC2);
+ udelay(6);
port2 = inw(cntl->uhci.iobase + USBPORTSC2);
if (port2 & USBPORTSC_CCS) {
outw(USBPORTSC_PE, cntl->uhci.iobase + USBPORTSC2);
+ msleep(USB_TIME_RSTRCY);
int count = configure_usb_device(cntl, !!(port2 & USBPORTSC_LSDA));
if (! count)
outw(0, cntl->uhci.iobase + USBPORTSC2);