From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Murphy Date: Wed, 10 Jul 2013 18:16:01 -0500 Subject: [U-Boot] [[PATCH v2 5/6] USB: ehci: Add a weak function for resetting devices In-Reply-To: <201307110020.06325.marex@denx.de> References: <1373486709-13015-1-git-send-email-dmurphy@ti.com> <1373486709-13015-6-git-send-email-dmurphy@ti.com> <201307110020.06325.marex@denx.de> Message-ID: <51DDEB31.40806@ti.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 07/10/2013 05:20 PM, Marek Vasut wrote: > Dear Dan Murphy, > >> Add a __weak function that can be overridden to reset devices >> attached to an ehci devices after the FEAT_POWER has been submitted >> >> Signed-off-by: Dan Murphy >> --- >> drivers/usb/host/ehci-hcd.c | 7 +++++++ >> 1 file changed, 7 insertions(+) >> >> diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c >> index 706cf0c..fdd3994 100644 >> --- a/drivers/usb/host/ehci-hcd.c >> +++ b/drivers/usb/host/ehci-hcd.c >> @@ -616,6 +616,11 @@ __weak uint32_t *ehci_get_portsc_register(struct >> ehci_hcor *hcor, int port) return (uint32_t *)&hcor->or_portsc[port]; >> } >> >> +__weak void ehci_reset_attached_devices(int port) >> +{ >> + return; >> +} >> + > Can the reset not happen elsewhere? I have tried to move this around and keep this out of this file completely but nothing else seems to work. For port 2 where the USB3530 is we don't have the issue the 3530 enumerates properly. I did not see any information in the data sheet eluding to a timing issue. > >> int >> ehci_submit_root(struct usb_device *dev, unsigned long pipe, void *buffer, >> int length, struct devrequest *req) >> @@ -777,6 +782,7 @@ ehci_submit_root(struct usb_device *dev, unsigned long >> pipe, void *buffer, reg |= EHCI_PS_PP; >> ehci_writel(status_reg, reg); >> } >> + ehci_reset_attached_devices(port); >> break; >> case USB_PORT_FEAT_RESET: >> if ((reg & (EHCI_PS_PE | EHCI_PS_CS)) == EHCI_PS_CS && >> @@ -794,6 +800,7 @@ ehci_submit_root(struct usb_device *dev, unsigned long >> pipe, void *buffer, reg |= EHCI_PS_PR; >> reg &= ~EHCI_PS_PE; >> ehci_writel(status_reg, reg); >> + > NAK DOH! > >> /* >> * caller must wait, then call GetPortStatus >> * usb 2.0 specification say 50 ms resets on > Best regards, > Marek Vasut -- ------------------ Dan Murphy