aboutsummaryrefslogtreecommitdiffstats
path: root/src/usb-ohci.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2009-10-24 11:06:08 -0400
committerKevin O'Connor <kevin@koconnor.net>2009-10-24 11:06:08 -0400
commit10ad799ff49508127e75f57c3927603441232ae3 (patch)
treea581669e7c2210c247f253c849e9a530fc38f719 /src/usb-ohci.c
parent89eb6241e51bc825cfbc1292802a960dcb48d778 (diff)
downloadseabios-10ad799ff49508127e75f57c3927603441232ae3.tar.gz
Replace irq_enable() regions with explicit calls to check for irqs.
Add new function yield() which will permit irqs to trigger. The yield() call enables irqs to occur in 32bit mode. Add [num]sleep calls that yield instead of just spinning. Rename existing int 1586 usleep call to biosusleep. Convert many calls to mdelay to msleep.
Diffstat (limited to 'src/usb-ohci.c')
-rw-r--r--src/usb-ohci.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/usb-ohci.c b/src/usb-ohci.c
index 71202f84..9e07c895 100644
--- a/src/usb-ohci.c
+++ b/src/usb-ohci.c
@@ -25,7 +25,7 @@ start_ohci(struct usb_s *cntl, struct ohci_hcca *hcca)
// Do reset
writel(&cntl->ohci.regs->control, OHCI_USB_RESET | oldrwc);
readl(&cntl->ohci.regs->control); // flush writes
- mdelay(50);
+ msleep(50);
// Do software init (min 10us, max 2ms)
u64 end = calc_future_tsc_usec(10);
@@ -81,7 +81,7 @@ check_ohci_ports(struct usb_s *cntl)
rha &= ~(RH_A_PSM | RH_A_OCPM);
writel(&cntl->ohci.regs->roothub_status, RH_HS_LPSC);
writel(&cntl->ohci.regs->roothub_b, RH_B_PPCM);
- mdelay((rha >> 24) * 2);
+ msleep((rha >> 24) * 2);
// Count and reset connected devices
int ports = rha & RH_A_NDP;
@@ -96,7 +96,7 @@ check_ohci_ports(struct usb_s *cntl)
// No devices connected
goto shutdown;
- mdelay(60); // XXX - should poll instead of using timer.
+ msleep(60); // XXX - should poll instead of using timer.
totalcount = 0;
for (i=0; i<ports; i++) {
@@ -229,7 +229,7 @@ ohci_control(u32 endp, int dir, const void *cmd, int cmdsize
int ret = wait_ed(ed);
ed->hwINFO = ED_SKIP;
- udelay(1); // XXX - in case controller still accessing tds
+ usleep(1); // XXX - in case controller still accessing tds
free(tds);
return ret;
}