*Added EHCI retry code, which should fix a few more USB devices that weren't working before.

GCLoader:
*Fixed a DSI crash when using the progressive mode.


git-svn-id: svn://localhost/Users/andi/Downloads/code/trunk@5 be6c1b03-d731-4111-a574-e37d80d43941
This commit is contained in:
crediar@rypp.net 2012-06-24 15:32:22 +00:00
parent 7476b06865
commit 9689929b4a
1 changed files with 19 additions and 5 deletions

24
ehci.c
View File

@ -180,7 +180,7 @@ static int handshake (void __iomem *ptr,
usec--;
} while (usec > 0);
ehci_dbg("\nEHCI:handshake timeout!!\n\n");
ehci_dbg("EHCI:handshake timeout!!\n");
dump_qh(ehci->async);
dump_qh(ehci->asyncqh);
//BUG();
@ -664,12 +664,26 @@ int ehci_reset_port(int port)
struct ehci_device *dev = &ehci->devices[port];
u32 status = ehci_readl(status_reg);
int retval = 0;
dev->id = 0;
dev->id = 0;
if ((PORT_OWNER&status) || !(PORT_CONNECT&status))
{
ehci_writel( PORT_OWNER, status_reg);
//ehci_dbg ( "port %d had no usb2 device connected at startup %X \n", port,ehci_readl(status_reg));
return -ENODEV;// no USB2 device connected
int retries = 10;
while (!(PORT_CONNECT&status) && retries > 0)
{
msleep(1000); // sleep 1 second
status = ehci_readl(status_reg);
ehci_dbg ( "EHCI:port %d status at retry %d %X \n", port,retries,status);
retries--;
}
if( retries <= 0 )
{
ehci_writel( PORT_OWNER, status_reg);
ehci_dbg ( "EHCI:port %d had no usb2 device connected at startup %X \n", port,ehci_readl(status_reg) );
return -ENODEV;// no USB2 device connected
}
}
ehci_dbg ( "EHCI:port %d has usb2 device connected! reset it...\n", port);