All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] T1024RDB: USB: Add a 10808 us delay in usb_scan_port
@ 2019-12-16  3:12 Yinbo Zhu
  2019-12-16  3:17 ` Bin Meng
  0 siblings, 1 reply; 5+ messages in thread
From: Yinbo Zhu @ 2019-12-16  3:12 UTC (permalink / raw)
  To: u-boot

T1024RDB usb controller doesn't detect usb device at first usb start
Add a delay that is greater than 10808 us can fix that issue, which
delay if is less than 10808 us, issue is probabilistic occurrence

=> usb start
starting USB...
USB0:   USB EHCI 1.00
USB1:   USB EHCI 1.00
scanning bus 0 for devices... 1 USB Device(s) found
scanning bus 1 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
=> usb stop
stopping USB..
=> usb start
starting USB...
USB0:   USB EHCI 1.00
USB1:   USB EHCI 1.00
scanning bus 0 for devices... 2 USB Device(s) found
scanning bus 1 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found
=>

Signed-off-by: Yinbo Zhu <yinbo.zhu@nxp.com>
---
 common/usb_hub.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/common/usb_hub.c b/common/usb_hub.c
index 33aaeb8e44..6dd06696b2 100644
--- a/common/usb_hub.c
+++ b/common/usb_hub.c
@@ -486,6 +486,9 @@ static int usb_scan_port(struct usb_device_scan *usb_scan)
 		return 0;
 	}
 
+#ifdef CONFIG_TARGET_T1024RDB
+	udelay(10808);
+#endif
 	if (portchange & USB_PORT_STAT_C_RESET) {
 		debug("port %d reset change\n", i + 1);
 		usb_clear_port_feature(dev, i + 1, USB_PORT_FEAT_C_RESET);
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v1] T1024RDB: USB: Add a 10808 us delay in usb_scan_port
  2019-12-16  3:12 [PATCH v1] T1024RDB: USB: Add a 10808 us delay in usb_scan_port Yinbo Zhu
@ 2019-12-16  3:17 ` Bin Meng
  2019-12-16  8:33   ` Marek Vasut
  0 siblings, 1 reply; 5+ messages in thread
From: Bin Meng @ 2019-12-16  3:17 UTC (permalink / raw)
  To: u-boot

+Marek,

On Mon, Dec 16, 2019 at 11:13 AM Yinbo Zhu <yinbo.zhu@nxp.com> wrote:
>
> T1024RDB usb controller doesn't detect usb device at first usb start
> Add a delay that is greater than 10808 us can fix that issue, which
> delay if is less than 10808 us, issue is probabilistic occurrence
>
> => usb start
> starting USB...
> USB0:   USB EHCI 1.00
> USB1:   USB EHCI 1.00
> scanning bus 0 for devices... 1 USB Device(s) found
> scanning bus 1 for devices... 1 USB Device(s) found
>        scanning usb for storage devices... 0 Storage Device(s) found
> => usb stop
> stopping USB..
> => usb start
> starting USB...
> USB0:   USB EHCI 1.00
> USB1:   USB EHCI 1.00
> scanning bus 0 for devices... 2 USB Device(s) found
> scanning bus 1 for devices... 1 USB Device(s) found
>        scanning usb for storage devices... 1 Storage Device(s) found
> =>
>
> Signed-off-by: Yinbo Zhu <yinbo.zhu@nxp.com>
> ---
>  common/usb_hub.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/common/usb_hub.c b/common/usb_hub.c
> index 33aaeb8e44..6dd06696b2 100644
> --- a/common/usb_hub.c
> +++ b/common/usb_hub.c
> @@ -486,6 +486,9 @@ static int usb_scan_port(struct usb_device_scan *usb_scan)
>                 return 0;
>         }
>
> +#ifdef CONFIG_TARGET_T1024RDB
> +       udelay(10808);
> +#endif

This looks like a workaround. Is this a silicon errata?

>         if (portchange & USB_PORT_STAT_C_RESET) {
>                 debug("port %d reset change\n", i + 1);
>                 usb_clear_port_feature(dev, i + 1, USB_PORT_FEAT_C_RESET);
> --

Regards,
Bin

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v1] T1024RDB: USB: Add a 10808 us delay in usb_scan_port
  2019-12-16  3:17 ` Bin Meng
@ 2019-12-16  8:33   ` Marek Vasut
  2019-12-18  3:27     ` [EXT] " Yinbo Zhu
  0 siblings, 1 reply; 5+ messages in thread
From: Marek Vasut @ 2019-12-16  8:33 UTC (permalink / raw)
  To: u-boot

On 12/16/19 4:17 AM, Bin Meng wrote:
> +Marek,
> 
> On Mon, Dec 16, 2019 at 11:13 AM Yinbo Zhu <yinbo.zhu@nxp.com> wrote:
>>
>> T1024RDB usb controller doesn't detect usb device at first usb start
>> Add a delay that is greater than 10808 us can fix that issue, which
>> delay if is less than 10808 us, issue is probabilistic occurrence
>>
>> => usb start
>> starting USB...
>> USB0:   USB EHCI 1.00
>> USB1:   USB EHCI 1.00
>> scanning bus 0 for devices... 1 USB Device(s) found
>> scanning bus 1 for devices... 1 USB Device(s) found
>>        scanning usb for storage devices... 0 Storage Device(s) found
>> => usb stop
>> stopping USB..
>> => usb start
>> starting USB...
>> USB0:   USB EHCI 1.00
>> USB1:   USB EHCI 1.00
>> scanning bus 0 for devices... 2 USB Device(s) found
>> scanning bus 1 for devices... 1 USB Device(s) found
>>        scanning usb for storage devices... 1 Storage Device(s) found
>> =>
>>
>> Signed-off-by: Yinbo Zhu <yinbo.zhu@nxp.com>
>> ---
>>  common/usb_hub.c | 3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/common/usb_hub.c b/common/usb_hub.c
>> index 33aaeb8e44..6dd06696b2 100644
>> --- a/common/usb_hub.c
>> +++ b/common/usb_hub.c
>> @@ -486,6 +486,9 @@ static int usb_scan_port(struct usb_device_scan *usb_scan)
>>                 return 0;
>>         }
>>
>> +#ifdef CONFIG_TARGET_T1024RDB
>> +       udelay(10808);
>> +#endif
> 
> This looks like a workaround. Is this a silicon errata?

Does setting usb_pgood_delay to e.g. 2000 help ?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [EXT] Re: [PATCH v1] T1024RDB: USB: Add a 10808 us delay in usb_scan_port
  2019-12-16  8:33   ` Marek Vasut
@ 2019-12-18  3:27     ` Yinbo Zhu
  2019-12-18  4:50       ` Marek Vasut
  0 siblings, 1 reply; 5+ messages in thread
From: Yinbo Zhu @ 2019-12-18  3:27 UTC (permalink / raw)
  To: u-boot



-----Original Message-----
From: Marek Vasut <marex@denx.de> 
Sent: 2019年12月16日 16:33
To: Bin Meng <bmeng.cn@gmail.com>; Yinbo Zhu <yinbo.zhu@nxp.com>
Cc: U-Boot Mailing List <u-boot@lists.denx.de>; Peter Chen <peter.chen@nxp.com>; Xiaobo Xie <xiaobo.xie@nxp.com>; Joe Hershberger <joe.hershberger@ni.com>; Jiafei Pan <jiafei.pan@nxp.com>; Ran Wang <ran.wang_1@nxp.com>; Jun Li <jun.li@nxp.com>
Subject: [EXT] Re: [PATCH v1] T1024RDB: USB: Add a 10808 us delay in usb_scan_port

Caution: EXT Email

On 12/16/19 4:17 AM, Bin Meng wrote:
> +Marek,
>
> On Mon, Dec 16, 2019 at 11:13 AM Yinbo Zhu <yinbo.zhu@nxp.com> wrote:
>>
>> T1024RDB usb controller doesn't detect usb device at first usb start 
>> Add a delay that is greater than 10808 us can fix that issue, which 
>> delay if is less than 10808 us, issue is probabilistic occurrence
>>
>> => usb start
>> starting USB...
>> USB0:   USB EHCI 1.00
>> USB1:   USB EHCI 1.00
>> scanning bus 0 for devices... 1 USB Device(s) found scanning bus 1 
>> for devices... 1 USB Device(s) found
>>        scanning usb for storage devices... 0 Storage Device(s) found 
>> => usb stop stopping USB..
>> => usb start
>> starting USB...
>> USB0:   USB EHCI 1.00
>> USB1:   USB EHCI 1.00
>> scanning bus 0 for devices... 2 USB Device(s) found scanning bus 1 
>> for devices... 1 USB Device(s) found
>>        scanning usb for storage devices... 1 Storage Device(s) found 
>> =>
>>
>> Signed-off-by: Yinbo Zhu <yinbo.zhu@nxp.com>
>> ---
>>  common/usb_hub.c | 3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/common/usb_hub.c b/common/usb_hub.c index 
>> 33aaeb8e44..6dd06696b2 100644
>> --- a/common/usb_hub.c
>> +++ b/common/usb_hub.c
>> @@ -486,6 +486,9 @@ static int usb_scan_port(struct usb_device_scan *usb_scan)
>>                 return 0;
>>         }
>>
>> +#ifdef CONFIG_TARGET_T1024RDB
>> +       udelay(10808);
>> +#endif
>
> This looks like a workaround. Is this a silicon errata?

 > Does setting usb_pgood_delay to e.g. 2000 help ?

Hi Marek Casut,

Thanks your feedback, I test it 2000, usb start can list device, in fact, 120 is enough,
In addition, if it is some usb storage issue, I think add it into bootargs it is reasonable, but I test some usb storage,
It is all encounter issue, so I think add it that delay into usb driver code.
=> setenv usb_pgood_delay 120 
=> usb start
starting USB...
USB0:   USB EHCI 1.00
USB1:   USB EHCI 1.00
scanning bus 0 for devices... 2 USB Device(s) found
scanning bus 1 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found
=>

Thanks,
Yinbo

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [EXT] Re: [PATCH v1] T1024RDB: USB: Add a 10808 us delay in usb_scan_port
  2019-12-18  3:27     ` [EXT] " Yinbo Zhu
@ 2019-12-18  4:50       ` Marek Vasut
  0 siblings, 0 replies; 5+ messages in thread
From: Marek Vasut @ 2019-12-18  4:50 UTC (permalink / raw)
  To: u-boot

On 12/18/19 4:27 AM, Yinbo Zhu wrote:

Hi,

[...]

>>> diff --git a/common/usb_hub.c b/common/usb_hub.c index 
>>> 33aaeb8e44..6dd06696b2 100644
>>> --- a/common/usb_hub.c
>>> +++ b/common/usb_hub.c
>>> @@ -486,6 +486,9 @@ static int usb_scan_port(struct usb_device_scan *usb_scan)
>>>                 return 0;
>>>         }
>>>
>>> +#ifdef CONFIG_TARGET_T1024RDB
>>> +       udelay(10808);
>>> +#endif
>>
>> This looks like a workaround. Is this a silicon errata?
> 
>  > Does setting usb_pgood_delay to e.g. 2000 help ?
> 
> Hi Marek Casut,
> 
> Thanks your feedback, I test it 2000, usb start can list device, in fact, 120 is enough,
> In addition, if it is some usb storage issue, I think add it into bootargs it is reasonable, but I test some usb storage,
> It is all encounter issue, so I think add it that delay into usb driver code.
> => setenv usb_pgood_delay 120 
> => usb start
> starting USB...
> USB0:   USB EHCI 1.00
> USB1:   USB EHCI 1.00
> scanning bus 0 for devices... 2 USB Device(s) found
> scanning bus 1 for devices... 1 USB Device(s) found
>        scanning usb for storage devices... 1 Storage Device(s) found
> =>

So does setting the usb_pgood_delay resolve the issue ? The variable
increases the time between turning on Vbus and starting scanning the
bus, it's a common issue on various boards and this is the way to solve it.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-12-18  4:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-16  3:12 [PATCH v1] T1024RDB: USB: Add a 10808 us delay in usb_scan_port Yinbo Zhu
2019-12-16  3:17 ` Bin Meng
2019-12-16  8:33   ` Marek Vasut
2019-12-18  3:27     ` [EXT] " Yinbo Zhu
2019-12-18  4:50       ` Marek Vasut

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.