mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-04-01 03:51:31 +00:00
EHCI: fix port reset reporting
Commit b416191a14
(Fix EHCI port reset.) didn't
move the code that checked for successful clearing of the port reset bit from
ehci_submit_root(), relying on wait_ms() call instead. The mentioned code also
erroneously reported port reset state when the reset was already completed.
Signed-off-by: Sergei Shtylyov <sshtylyov@mvista.com>
This commit is contained in:
parent
e06a055bcd
commit
c8b2d1dc0f
1 changed files with 17 additions and 15 deletions
|
@ -630,19 +630,8 @@ ehci_submit_root(struct usb_device *dev, unsigned long pipe, void *buffer,
|
||||||
tmpbuf[0] |= USB_PORT_STAT_SUSPEND;
|
tmpbuf[0] |= USB_PORT_STAT_SUSPEND;
|
||||||
if (reg & EHCI_PS_OCA)
|
if (reg & EHCI_PS_OCA)
|
||||||
tmpbuf[0] |= USB_PORT_STAT_OVERCURRENT;
|
tmpbuf[0] |= USB_PORT_STAT_OVERCURRENT;
|
||||||
if (reg & EHCI_PS_PR &&
|
if (reg & EHCI_PS_PR)
|
||||||
(portreset & (1 << le16_to_cpu(req->index)))) {
|
tmpbuf[0] |= USB_PORT_STAT_RESET;
|
||||||
int ret;
|
|
||||||
/* force reset to complete */
|
|
||||||
reg = reg & ~(EHCI_PS_PR | EHCI_PS_CLEAR);
|
|
||||||
ehci_writel(status_reg, reg);
|
|
||||||
ret = handshake(status_reg, EHCI_PS_PR, 0, 2 * 1000);
|
|
||||||
if (!ret)
|
|
||||||
tmpbuf[0] |= USB_PORT_STAT_RESET;
|
|
||||||
else
|
|
||||||
printf("port(%d) reset error\n",
|
|
||||||
le16_to_cpu(req->index) - 1);
|
|
||||||
}
|
|
||||||
if (reg & EHCI_PS_PP)
|
if (reg & EHCI_PS_PP)
|
||||||
tmpbuf[1] |= USB_PORT_STAT_POWER >> 8;
|
tmpbuf[1] |= USB_PORT_STAT_POWER >> 8;
|
||||||
|
|
||||||
|
@ -699,6 +688,8 @@ ehci_submit_root(struct usb_device *dev, unsigned long pipe, void *buffer,
|
||||||
ehci_writel(status_reg, reg);
|
ehci_writel(status_reg, reg);
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
|
int ret;
|
||||||
|
|
||||||
reg |= EHCI_PS_PR;
|
reg |= EHCI_PS_PR;
|
||||||
reg &= ~EHCI_PS_PE;
|
reg &= ~EHCI_PS_PE;
|
||||||
ehci_writel(status_reg, reg);
|
ehci_writel(status_reg, reg);
|
||||||
|
@ -710,8 +701,19 @@ ehci_submit_root(struct usb_device *dev, unsigned long pipe, void *buffer,
|
||||||
wait_ms(50);
|
wait_ms(50);
|
||||||
/* terminate the reset */
|
/* terminate the reset */
|
||||||
ehci_writel(status_reg, reg & ~EHCI_PS_PR);
|
ehci_writel(status_reg, reg & ~EHCI_PS_PR);
|
||||||
wait_ms(2);
|
/*
|
||||||
portreset |= 1 << le16_to_cpu(req->index);
|
* A host controller must terminate the reset
|
||||||
|
* and stabilize the state of the port within
|
||||||
|
* 2 milliseconds
|
||||||
|
*/
|
||||||
|
ret = handshake(status_reg, EHCI_PS_PR, 0,
|
||||||
|
2 * 1000);
|
||||||
|
if (!ret)
|
||||||
|
portreset |=
|
||||||
|
1 << le16_to_cpu(req->index);
|
||||||
|
else
|
||||||
|
printf("port(%d) reset error\n",
|
||||||
|
le16_to_cpu(req->index) - 1);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Add table
Reference in a new issue