[U-Boot] Failing USB devices

Andrew Murray amurray at embedded-bits.co.uk
Fri Aug 23 02:00:02 CEST 2013


Hello,

I'm unable to use some mass storage devices with the current git version
(6612ab33956ae09c5ba2fde9c1540b519625ba37) of UBoot on a TI Davinci custom
board. I have 7 pen drives, and 2 of them fail.

I-O DATA USB Flash Disk (0x04bb/0x0c43)

...
2 USB Device(s) found
scan end
       scanning usb for storage devices... i=0
i=1


USB Mass Storage device detected
Transport: Bulk/Bulk/Bulk
Endpoints In 1 Out 2 Int 0
usb_control_msg: request: 0xFE, requesttype: 0xA1, value 0x0 index 0x0
length 0x1
Get Max LUN -> len = 1, result = 0
 address 2
COMMAND phase
DATA phase
STATUS phase
!CSWSIGNATURE
BBB_reset
usb_control_msg: request: 0xFF, requesttype: 0x21, value 0x0 index 0x0
length 0x0
RESET:stall
inquiry returns -1
COMMAND phase
DATA phase
STATUS phase
!CSWSIGNATURE
BBB_reset
usb_control_msg: request: 0xFF, requesttype: 0x21, value 0x0 index 0x0
length 0x0
RESET:stall
inquiry returns -1
COMMAND phase
DATA phase
STATUS phase
!CSWSIGNATURE
BBB_reset
usb_control_msg: request: 0xFF, requesttype: 0x21, value 0x0 index 0x0
length 0x0
RESET:stall
inquiry returns -1
COMMAND phase
DATA phase
STATUS phase
!CSWSIGNATURE
BBB_reset
usb_control_msg: request: 0xFF, requesttype: 0x21, value 0x0 index 0x0
length 0x0
RESET:stall
inquiry returns -1
COMMAND phase
DATA phase
STATUS phase
!CSWSIGNATURE
BBB_reset
usb_control_msg: request: 0xFF, requesttype: 0x21, value 0x0 index 0x0
length 0x0
RESET:stall
inquiry returns -1
error in inquiry
i=2
0 Storage Device(s) found

In this case putting a delay of 1000ms in usb_stor_BBB_transport between
the COMMAND and DATA phase, (in place of the conditional 5ms USB_READY
delay), overcomes this issue. It seems this 1000ms delay is only required
for the first COMMAND, subsequent COMMAND phases seem happy with the 5ms
delay.

Lexar JumpDrive 32GB (0x0424/0x2507):


DM36x EVM # usb start
(Re)start USB...
USB0:   scanning bus 0 for devices... New Device 0
usb_control_msg: request: 0x6, requesttype: 0x80, value 0x100 index 0x0
length 0x40
set address 1
usb_control_msg: request: 0x5, requesttype: 0x0, value 0x1 index 0x0 length
0x0
usb_control_msg: request: 0x6, requesttype: 0x80, value 0x100 index 0x0
length 0x12
usb_control_msg: request: 0x6, requesttype: 0x80, value 0x200 index 0x0
length 0x9
usb_control_msg: request: 0x6, requesttype: 0x80, value 0x200 index 0x0
length 0x29
get_conf_no 0 Result 41, wLength 41
if 0, ep 0
if 0, ep 1
##EP epmaxpacketin[1] = 1
set configuration 1
usb_control_msg: request: 0x9, requesttype: 0x0, value 0x1 index 0x0 length
0x0
new device strings: Mfr=0, Product=0, SerialNumber=0
Manufacturer
Product
SerialNumber
USB hub found
usb_control_msg: request: 0x6, requesttype: 0xA0, value 0x2900 index 0x0
length 0x4
usb_control_msg: request: 0x6, requesttype: 0xA0, value 0x2900 index 0x0
length 0x9
7 ports detected
ganged power switching
part of a compound device
global over-current protection
power on to power good time: 100ms
hub controller current requirement: 1mA
port 1 is not removable
port 2 is not removable
port 3 is not removable
port 4 is removable
port 5 is removable
port 6 is removable
port 7 is removable
usb_control_msg: request: 0x0, requesttype: 0xA0, value 0x0 index 0x0
length 0x4
get_hub_status returned status 0, change 0
local power source is good
no over-current condition exists
enabling power on all ports
usb_control_msg: request: 0x1, requesttype: 0x23, value 0x8 index 0x1
length 0x0
port 1 returns 0
usb_control_msg: request: 0x1, requesttype: 0x23, value 0x8 index 0x2
length 0x0
port 2 returns 0
usb_control_msg: request: 0x1, requesttype: 0x23, value 0x8 index 0x3
length 0x0
port 3 returns 0
usb_control_msg: request: 0x1, requesttype: 0x23, value 0x8 index 0x4
length 0x0
port 4 returns 0
usb_control_msg: request: 0x1, requesttype: 0x23, value 0x8 index 0x5
length 0x0
port 5 returns 0
usb_control_msg: request: 0x1, requesttype: 0x23, value 0x8 index 0x6
length 0x0
port 6 returns 0
usb_control_msg: request: 0x1, requesttype: 0x23, value 0x8 index 0x7
length 0x0
port 7 returns 0
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x1
length 0x4
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x2
length 0x4
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x3
length 0x4
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x4
length 0x4
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x5
length 0x4
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x6
length 0x4
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x7
length 0x4
usb_control_msg: request: 0x3, requesttype: 0x23, value 0x8 index 0x1
length 0x0
port 1 returns 0
usb_control_msg: request: 0x3, requesttype: 0x23, value 0x8 index 0x2
length 0x0
port 2 returns 0
usb_control_msg: request: 0x3, requesttype: 0x23, value 0x8 index 0x3
length 0x0
port 3 returns 0
usb_control_msg: request: 0x3, requesttype: 0x23, value 0x8 index 0x4
length 0x0
port 4 returns 0
usb_control_msg: request: 0x3, requesttype: 0x23, value 0x8 index 0x5
length 0x0
port 5 returns 0
usb_control_msg: request: 0x3, requesttype: 0x23, value 0x8 index 0x6
length 0x0
port 6 returns 0
usb_control_msg: request: 0x3, requesttype: 0x23, value 0x8 index 0x7
length 0x0
port 7 returns 0
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x1
length 0x4
Port 1 Status 100 Change 0
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x2
length 0x4
Port 2 Status 100 Change 0
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x3
length 0x4
Port 3 Status 100 Change 0
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x4
length 0x4
Port 4 Status 100 Change 0
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x5
length 0x4
Port 5 Status 100 Change 0
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x6
length 0x4
Port 6 Status 100 Change 0
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x7
length 0x4
Port 7 Status 100 Change 0
1 USB Device(s) found
scan end
       scanning usb for storage devices... i=0
i=1
0 Storage Device(s) found

In this case setting CONFIG_USB_HUB_MIN_POWER_ON_DELAY to 3000 overcomes
this issue.

I have other USB drives with similar issues.

It seems there is no correct value for CONFIG_USB_HUB_MIN_POWER_ON_DELAY -
setting this to a large value supports more drives, but at the expense of
boot time. Is this a suggested way to determine when the endpoint is ready
rather than waiting an arbitrary amount of time? Is this possible?

Likewise for the delay between the COMMAND and DATA phase. Has this issue
been seen before? Is there any reason why a large delay would be required
between the very first COMMAND and DATA phase vs subsequent phases - and if
so is there value in changing UBoot to support this?

Andrew Murray


More information about the U-Boot mailing list