[U-Boot] [PATCH] usb: musb-new: Add CONFIG_USB_MUSB_INIT_TIMEOUT

Marek Vasut marex at denx.de
Fri Dec 7 13:06:38 UTC 2018


On 12/07/2018 01:59 PM, Alex Kiernan wrote:
> On Fri, Dec 7, 2018 at 12:30 PM Marek Vasut <marex at denx.de> wrote:
>>
>> On 12/07/2018 01:29 PM, Alex Kiernan wrote:
>>> On Fri, Dec 7, 2018 at 11:54 AM Marek Vasut <marex at denx.de> wrote:
>>>>
>>>> On 12/07/2018 09:56 AM, Alex Kiernan wrote:
>>>> [...]
>>>>> +++ b/drivers/usb/musb-new/musb_uboot.c
>>>>> @@ -214,7 +214,7 @@ int musb_lowlevel_init(struct musb_host_data *host)
>>>>>  {
>>>>>       void *mbase;
>>>>>       /* USB spec says it may take up to 1 second for a device to connect */
>>>>> -     unsigned long timeout = get_timer(0) + 1000;
>>>>> +     unsigned long timeout = get_timer(0) + CONFIG_USB_MUSB_INIT_TIMEOUT;
>>>>
>>>> Isn't this the same as usb_pgood_delay ?
>>>>
>>>
>>> Looks like it; I'll spin a v2 which uses that.
>>
>> I wonder if this code is needed at all, shouldn't the USB core deal with
>> this delay ?
>>
> 
> Oh I see... certainly I can't just take that delay out, that just ends up at:
> 
> USB0:   scanning bus 0 for devices... USB device descriptor short read
> (expected 8, got 0)
> failed, error -5
> 
> Certainly without that delay, there's clearly delays in the rest of
> the USB core, so I expect you're right, I just don't know where to put
> the poll for MUSB_DEVCTL_HM.

Can you research it a bit ? What does the _HM bit do ?

-- 
Best regards,
Marek Vasut


More information about the U-Boot mailing list