All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roger Quadros <rogerq@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 6/7] USB: usb-hub: Add a weak function for resetting devices
Date: Thu, 25 Jul 2013 12:22:02 +0300	[thread overview]
Message-ID: <51F0EE3A.4030901@ti.com> (raw)
In-Reply-To: <201307250732.58307.marex@denx.de>

Hi Marek,

On 07/25/2013 08:32 AM, Marek Vasut wrote:
> Dear Dan Murphy,
> 
>> Marek
>>
>> On 07/17/2013 11:30 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 <dmurphy@ti.com>
>>>> ---
>>>> 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
>>
>> Sorry for the delay in the response I have been looking heavily into this.
>>
>> I see we have many reset hooks but they all seem to mean something for
>> different components.
>>
>> The one I am introducing is for the device itself and made it weak as there
>> are devices that work properly like the 3503.
>>
>> What I am finding is that I have to apply port power and then hit the
>> device's reset line to get the device to enumerate. Or I can hold the 9730
>> device in reset throughout the full USB init sequence and upon releasing
>> it after port power the device is detected.
>>
>> There is no opportunity to release the reset while the USB detection state
>> machine is running
>>
>> I have contacted the vendor to see if there are any known anomalies with
>> this part if there is then I can document this in the commit.
> 
> Sigh, ok, that's unfortunate. I keep wondering how come it works in Linux. But 
> anyway, if the manufacturer won't come up with anything, we will apply this 
> stuff.
> 

On Linux, we don't toggle Port power of the root hub once it has been enabled (i.e. EHCI started)
and RESET line to 9730 is released.

Dan, mentioned to me that on u-boot we toggle the Port power of the root hub each
time a USB session is started. This seems to be causing problems with the 9730 as it
seems to need an explicit reset after the Port power bit is toggled, in order to be detected.

cheers,
-roger

  reply	other threads:[~2013-07-25  9:22 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-17 20:16 [U-Boot] OMAP5 uEVM USB eHCI patch set Dan Murphy
2013-07-17 20:16 ` [U-Boot] [PATCH v3 1/7] omap5: uevm: Change the board name to correct name Dan Murphy
2013-07-18  4:20   ` Marek Vasut
2013-07-17 20:16 ` [U-Boot] [PATCH v3 2/7] ARM: OMAP5: USB: Add OMAP5 common USB EHCI information Dan Murphy
2013-07-18  7:10   ` Roger Quadros
2013-07-18 17:48     ` Dan Murphy
2013-07-19  9:30       ` Roger Quadros
2013-07-22 15:14         ` Tom Rini
2013-07-17 20:16 ` [U-Boot] [PATCH v3 3/7] ARM: OMAP: USB: Fix linker error when ULPI is not defined Dan Murphy
2013-07-18  4:23   ` Marek Vasut
2013-07-17 20:16 ` [U-Boot] [PATCH v3 4/7] ARM: OMAP5-uevm: Add USB ehci support for the uEVM Dan Murphy
2013-07-22 15:16   ` Tom Rini
2013-07-17 20:16 ` [U-Boot] [PATCH v3 5/7] ARM: OMAP5-uevm: Add USB MAC ethernet address Dan Murphy
2013-07-18  4:28   ` Marek Vasut
2013-07-18 15:40     ` Dan Murphy
2013-07-18 15:47       ` Marek Vasut
2013-07-17 20:16 ` [U-Boot] [PATCH v3 6/7] USB: usb-hub: Add a weak function for resetting devices Dan Murphy
2013-07-18  4:30   ` Marek Vasut
2013-07-24 19:55     ` Dan Murphy
2013-07-25  5:32       ` Marek Vasut
2013-07-25  9:22         ` Roger Quadros [this message]
2013-07-17 20:16 ` [U-Boot] [PATCH v3 7/7] ARM: OMAP5-uevm: Add usb device reset API Dan Murphy
2013-07-18  4:30   ` Marek Vasut
2013-07-31 19:43     ` Dan Murphy
2013-07-31 20:18       ` Marek Vasut

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51F0EE3A.4030901@ti.com \
    --to=rogerq@ti.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.