[PATCH v1] T1024RDB: USB: Add a 10808 us delay in usb_scan_port

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);

+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

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 ?

-----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

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.
participants (3)
-
Bin Meng
-
Marek Vasut
-
Yinbo Zhu