diff-tree ec82ef79b429e94308346beb549d4dd96dfac35e (from 3a5e21881a194f4d4e053be8410d82a2458e8544) Author: Rodolfo Giometti Date: Tue Apr 11 14:35:25 2006 +0200 Timeout on wait for reset complite added. diff --git a/cpu/mips/au1x00_usb_ohci.c b/cpu/mips/au1x00_usb_ohci.c index dbf72dc..92121a5 100644 --- a/cpu/mips/au1x00_usb_ohci.c +++ b/cpu/mips/au1x00_usb_ohci.c @@ -1572,6 +1572,7 @@ int usb_lowlevel_init(void) u32 pin_func; u32 sys_freqctrl, sys_clksrc; u32 prid = read_c0_prid(); + int count = 3000; dbg("in usb_lowlevel_init\n"); @@ -1641,8 +1642,13 @@ int usb_lowlevel_init(void) /* wait for reset complete (read register twice; see au1500 errata) */ while (au_readl(USB_HOST_CONFIG), - !(au_readl(USB_HOST_CONFIG) & USBH_ENABLE_RD)) + !(au_readl(USB_HOST_CONFIG) & USBH_ENABLE_RD)) { udelay(1000); + if (--count == 0) { + err("unable to reset USB host!!"); + return -1; + } + } dbg("OHCI clock running\n");