From: Marek Vasut Date: Wed, 7 Dec 2011 19:33:16 +0100 Subject: [U-Boot] [PATCH 7/9] USB: EHCI: Allow EHCI post-powerup configuration in board files In-Reply-To: <1323282798-31358-1-git-send-email-marek.vasut@gmail.com> References: <1323282798-31358-1-git-send-email-marek.vasut@gmail.com> Message-ID: <1323282798-31358-8-git-send-email-marek.vasut@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de This patch allows USB to work on some hosts, which need additional frobing after the host was powered up via regular USB powerup sequence. Signed-off-by: Marek Vasut Cc: Stefano Babic Cc: Remy Bohmer Cc: Wolfgang Grandegger Cc: Jason Liu --- drivers/usb/host/ehci-hcd.c | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c index b4c9db8..8bb3ff1 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c @@ -205,6 +205,14 @@ static inline void ehci_invalidate_dcache(struct QH *qh) } #endif /* CONFIG_EHCI_DCACHE */ +void __ehci_powerup_fixup(uint32_t *status_reg, uint32_t *reg) +{ + mdelay(50); +} + +void ehci_powerup_fixup(uint32_t *status_reg, uint32_t *reg) + __attribute__((weak, alias("__ehci_powerup_fixup"))); + static int handshake(uint32_t *ptr, uint32_t mask, uint32_t done, int usec) { uint32_t result; @@ -713,8 +721,8 @@ ehci_submit_root(struct usb_device *dev, unsigned long pipe, void *buffer, * usb 2.0 specification say 50 ms resets on * root */ - wait_ms(50); - /* terminate the reset */ + ehci_powerup_fixup(status_reg, ®); + ehci_writel(status_reg, reg & ~EHCI_PS_PR); /* * A host controller must terminate the reset -- 1.7.7.1