*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

18
ehci.c
View File

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