imx8mm USB Mass Storage fails through a HUB

Tim Harvey tharvey at gateworks.com
Fri Feb 10 18:15:01 CET 2023


On Fri, Feb 10, 2023 at 5:26 AM Marcel Ziswiler
<marcel.ziswiler at toradex.com> wrote:
>
> Hi Tim
>
> On Thu, 2023-02-09 at 11:58 -0800, Tim Harvey wrote:
> > Greetings,
> >
> > I'm finding that USB Mass Storage devices appear to fail detection on
> > imx8mm when hanging off a USB hub whereas other devices such as USB
> > ethernet work fine.
> >
> > u-boot=> usb start && usb tree
> > starting USB...
> > Bus usb at 32e40000: Bus usb at 32e50000: USB EHCI 1.00
> > scanning bus usb at 32e40000 for devices... 1 USB Device(s) found
> > scanning bus usb at 32e50000 for devices... cannot reset port 3!?
> > 3 USB Device(s) found
> >        scanning usb for storage devices... 0 Storage Device(s) found
> > USB device tree:
> >   1  Hub (480 Mb/s, 0mA)
> >      u-boot EHCI Host Controller
> >
> >   1  Hub (480 Mb/s, 0mA)
> >   |  u-boot EHCI Host Controller
> >   |
> >   +-2  Hub (480 Mb/s, 0mA)
> >     |  Microchip Tech USB2744
> >     |
> >     +-3  Vendor specific (480 Mb/s, 0mA)
> >          Microchip Tech Hub Controller
> >
> > Depending on the board and port sometimes I see the 'cannot reset
> > port' issue calling out the port of the hub and sometimes I see a
> > 'EHCI timed out on TD - token=0x80008c80 unable to get device
> > descriptor (error=-1)' error.
> >
> > I have several imx8m{m,n,p}-venice boards with onboard hubs I noticed
> > this with but you can re-create this on an imx8mm-evk if you attach a
> > HUB with a USB Mass Storage Device to the front-panel USB Type-C
> > connector after manually enabling VBUS (due to the lack of a PTN5110
> > driver that would handle source/sink detection on that port):
> > i2c dev 1 && i2c mw 0x50 0x23 0x77 1 # COMMAND: SRC_VBUS_HIGH
> > usb start && usb tree
> >
> > So far I've tried without success:
> > - setenv usb_pgood_delay 5000
> > - CONFIG_USB_ONBOARD_HUB=y
> >
> > Any ideas on this?
>
> Strange, I do not recall any such generic issue on our Verdin iMX8M Mini. This is with today's latest master
> built for verdin-imx8mm:
>
> Verdin iMX8MM # usb start && usb tree
> starting USB...
> Bus usb at 32e40000: Bus usb at 32e50000: USB EHCI 1.00
> scanning bus usb at 32e40000 for devices... 1 USB Device(s) found
> scanning bus usb at 32e50000 for devices... 5 USB Device(s) found
>        scanning usb for storage devices... 1 Storage Device(s) found
> USB device tree:
>   1  Hub (480 Mb/s, 0mA)
>      u-boot EHCI Host Controller
>
>   1  Hub (480 Mb/s, 0mA)
>   |  u-boot EHCI Host Controller
>   |
>   +-2  Hub (480 Mb/s, 0mA)
>     |  Microchip Tech USB2744
>     |
>     +-3  Vendor specific (480 Mb/s, 0mA)
>     |    Microchip Tech Hub Controller
>     |
>     +-4  Human Interface (12 Mb/s, 98mA)
>     |    Logitech USB Receiver
>     |
>     +-5  Mass Storage (480 Mb/s, 100mA)
>          General  UDisk            ?
>
> The second USB port has a on-carrier USB hub both on Dahlia as well as the Verdin Development board.
>
> Sorry, that I do not have any good suggestion other than maybe comparing with our configuration/design.
>

Marcel,

Thanks for trying this on a board with on-board hub. Strange that you
don't see the same issue. Do you by chance have an imx8mm-evk that you
can re-create my test with?

I have tried multiple USB Mass Storage devices to answer Markek's
question and assigning the power-domain per Fabio's suggestion doesn't
make a difference.

Adding Lukasz to the thread as he reported similar USB Mass storage
issues (at least the 'EHCI timed out on TD' over the past years and
it's not clear if that ever got resolved).

Here are some results with debug enabled in common/usb_hub.c on a
imx8mm-venice-gw730x. I've disabled usbotg1 disabled and forced
dev->maxchild = 1 to minimize spam.

This is a SoM with an imx8mm with USB2 connected to a baseboard with a
USB3 hub (to support USB3 capable imx8mp SoM). The HUB P1 goes to a
front-panel jack with a USB power switch controlling VBUS such that
the P1 PRT_CTRL1 is the enable on the VBUS switch.

Here's with a USB ethernet device plugged in:
u-boot=> usb start && usb tree
starting USB...
Bus usb at 32e50000: USB EHCI 1.00
scanning bus usb at 32e50000 for devices... usb_hub_post_probe
1 ports detected
individual port power switching
standalone hub
global over-current protection
Single TT
TT requires at most 8 FS bit times (666 ns)
power on to power good time: 20ms
hub controller current requirement: 0mA
port 1 is removable
get_hub_status returned status 1, change 8101
local power source is lost (inactive)
no over-current condition exists
enabling power on all ports
port 1 returns 0
pgood_delay=20ms
devnum=1 poweron: query_delay=100 connect_timeout=1100
Port 1 Status 501 Change 1
devnum=1 port=1: USB dev found
portstatus 501, change 1, 480 Mb/s
usb_hub_port_reset: resetting 'usb_hub' port 1...
portstatus 503, change 10, 480 Mb/s
STAT_C_CONNECTION = 0 STAT_CONNECTION = 1  USB_PORT_STAT_ENABLE 1
usb_hub_post_probe
1 ports detected
individual port power switching
part of a compound device
individual port over-current protection
TT per port
TT requires at most 8 FS bit times (666 ns)
power on to power good time: 100ms
hub controller current requirement: 0mA
port 1 is removable
get_hub_status returned status 0, change 0
local power source is good
no over-current condition exists
enabling power on all ports
port 1 returns 0
pgood_delay=100ms
devnum=2 poweron: query_delay=100 connect_timeout=1100
Port 1 Status 101 Change 1
devnum=2 port=1: USB dev found
portstatus 101, change 1, 12 Mb/s
usb_hub_port_reset: resetting 'usb_hub' port 1...
portstatus 503, change 10, 480 Mb/s
STAT_C_CONNECTION = 0 STAT_CONNECTION = 1  USB_PORT_STAT_ENABLE 1
3 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
USB device tree:
  1  Hub (480 Mb/s, 0mA)
  |  u-boot EHCI Host Controller
  |
  +-2  Hub (480 Mb/s, 0mA)
    |  Microchip Tech USB2744
    |
    +-3  Vendor specific (480 Mb/s, 250mA)
         ASIX Elec. Corp. AX88x72A 000386

and with a USB Mass storage (flash based USB3 thumb drive stick)
device plugged in:
u-boot=> usb start && usb tree
starting USB...
Bus usb at 32e50000: USB EHCI 1.00
scanning bus usb at 32e50000 for devices... usb_hub_post_probe
1 ports detected
individual port power switching
standalone hub
global over-current protection
Single TT
TT requires at most 8 FS bit times (666 ns)
power on to power good time: 20ms
hub controller current requirement: 0mA
port 1 is removable
get_hub_status returned status 1, change 8101
local power source is lost (inactive)
no over-current condition exists
enabling power on all ports
port 1 returns 0
pgood_delay=20ms
devnum=1 poweron: query_delay=100 connect_timeout=1100
Port 1 Status 501 Change 1
devnum=1 port=1: USB dev found
portstatus 501, change 1, 480 Mb/s
usb_hub_port_reset: resetting 'usb_hub' port 1...
portstatus 503, change 10, 480 Mb/s
STAT_C_CONNECTION = 0 STAT_CONNECTION = 1  USB_PORT_STAT_ENABLE 1
usb_hub_post_probe
1 ports detected
individual port power switching
part of a compound device
individual port over-current protection
TT per port
TT requires at most 8 FS bit times (666 ns)
power on to power good time: 100ms
hub controller current requirement: 0mA
port 1 is removable
get_hub_status returned status 0, change 0
local power source is good
no over-current condition exists
enabling power on all ports
port 1 returns 0
pgood_delay=100ms
devnum=2 poweron: query_delay=100 connect_timeout=1100
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 100 Change 0
Port 1 Status 101 Change 1
devnum=2 port=1: USB dev found
portstatus 101, change 1, 12 Mb/s
usb_hub_port_reset: resetting 'usb_hub' port 1...
portstatus 100, change 11, 12 Mb/s
STAT_C_CONNECTION = 1 STAT_CONNECTION = 0  USB_PORT_STAT_ENABLE 0
portstatus 100, change 11, 12 Mb/s
STAT_C_CONNECTION = 1 STAT_CONNECTION = 0  USB_PORT_STAT_ENABLE 0
portstatus 100, change 11, 12 Mb/s
STAT_C_CONNECTION = 1 STAT_CONNECTION = 0  USB_PORT_STAT_ENABLE 0
portstatus 100, change 11, 12 Mb/s
STAT_C_CONNECTION = 1 STAT_CONNECTION = 0  USB_PORT_STAT_ENABLE 0
portstatus 101, change 11, 12 Mb/s
STAT_C_CONNECTION = 1 STAT_CONNECTION = 1  USB_PORT_STAT_ENABLE 0
Cannot enable port 1 after 5 retries, disabling port.
Maybe the USB cable is bad?
cannot reset port 1!?
2 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
USB device tree:
  1  Hub (480 Mb/s, 0mA)
  |  u-boot EHCI Host Controller
  |
  +-2  Hub (480 Mb/s, 0mA)
       Microchip Tech USB2744

So the USB Mass Storage failure takes a while for its port status to
change from 0 (no connection) to 1 (connection) and then the port
reset comes up in full speed vs high speed?

Best Regards,

Tim


More information about the U-Boot mailing list