From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Thu, 18 Jul 2013 06:30:18 +0200 Subject: [U-Boot] [PATCH v3 6/7] USB: usb-hub: Add a weak function for resetting devices In-Reply-To: <1374092167-27645-7-git-send-email-dmurphy@ti.com> References: <1374092167-27645-1-git-send-email-dmurphy@ti.com> <1374092167-27645-7-git-send-email-dmurphy@ti.com> Message-ID: <201307180630.18420.marex@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 > --- > v3 - Modified location of the weak function - > http://patchwork.ozlabs.org/patch/258229/ > > common/usb_hub.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/common/usb_hub.c b/common/usb_hub.c > index 774ba63..c655b75 100644 > --- a/common/usb_hub.c > +++ b/common/usb_hub.c > @@ -62,6 +62,10 @@ > static struct usb_hub_device hub_dev[USB_MAX_HUB]; > static int usb_hub_index; > > +__weak void usb_hub_reset_devices(int port) > +{ > + return; > +} > > static int usb_get_hub_descriptor(struct usb_device *dev, void *data, int > size) { > @@ -444,6 +448,14 @@ static int usb_hub_configure(struct usb_device *dev) > "" : "no "); > usb_hub_power_on(hub); > > + /* > + * Reset any devices that may be in a bad state when applying > + * the power. This is a __weak function. Resettig of the devices > + * should occur in the board file of the device. > + */ > + for (i = 0; i < dev->maxchild; i++) > + usb_hub_reset_devices(i + 1); > + > for (i = 0; i < dev->maxchild; i++) { > ALLOC_CACHE_ALIGN_BUFFER(struct usb_port_status, portsts, 1); > unsigned short portstatus, portchange; We hae like 10 reset hooks in the usb code, this means something just isn't right. The device doesn't enumerate, right ? Have you tried waiting a little after releasing the reset and before starting the EHCI ? Best regards, Marek Vasut