[U-Boot] 'usb start' works very unstable

Sergei Trofimovich
2010-08-07T13:39:57Z

> > It's a tip of 'u-boot-marvell/testing' branch.
>
> Did you try current mainline instead? It is usually not recommended
> to use any of the custodian trees and especially their testing
> branches unless you know _exactly_ what these contain and what you are
> looking after.

I was not sure sheevaplug support was merged. Pesky page [0] suggested it
and I thought i's called 'mainline'.

Ok, trying 'u-boot/master' v2010.06-267-gb1f95b4 with latest commit

> commit b1f95b4438a6d44e12f04e7f51412f7a711ef87b
> Author: Wolfgang Denk <wd@denx.de>
> Date: Sat Aug 7 00:32:50 2010 +0200
>
> Replace CHANGELOG files by auto-generated "snapshot.commit"

Marvell>> version

U-Boot 2010.06-00267-gb1f95b4 (Aug 07 2010 - 15:30:45)
Marvell-Sheevaplug

> > [ 23.015860] scsi0 : usb-storage 1-1:1.0
> > [ 26.054268] scsi 0:0:0:0: Direct-Access StoreJet Transcend PQ: 0 ANSI: 2 CCS
> > [ 28.774083] sd 0:0:0:0: [sda] 488397168 512-byte logical blocks: (250 GB/232 GiB)
> ...
>
> > Device 0: Vendor: StoreJet Rev: Prod: Transcend
> > Type: Hard Disk
> > Capacity: 28759.9 MB = 28.0 GB (488397168 x 512)
> >
> > Heh, capacity is reported incorrectly, but it works am I'm able
> > to load kernel from there.
> The reason for this is that the multiplication 488397168 x 512 will
> overflow a 32 bit integer as used in "disk/part.c"; this shouldbe
> fixed...

This issue is still here:

Marvell>> usb start
(Re)start USB...
USB: Register 10011 NbrPorts 1
USB EHCI 1.00
scanning bus for devices... 2 USB Device(s) found
scanning bus for storage devices... 1 Storage Device(s) found
Marvell>> usb storage
Device 0: Vendor: StoreJet Rev: Prod: Transcend
Type: Hard Disk
Capacity: 28759.9 MB = 28.0 GB (488397168 x 512)

Latest change in 'disk/part.c' is:
> commit 4b142febff71eabdb7ddbb125c7b583b24ddc434
> Author: Heiko Schocher <hs@denx.de>
> Date: Thu Dec 3 11:21:21 2009 +0100

Which looks older, than u-boot-marvell branch.

> > All these things are almost 100% reproducible.
> >
> > Vendor-shipped (Marvell's) u-boot has exactly the same disease:
> > ** MARVELL BOARD: SHEEVA PLUG LE
> > U-Boot 1.1.4 (Mar 19 2009 - 16:06:59) Marvell version: 3.4.16
>
> This can be anything - issues with the USB driver, missing or
> incorrect initializatioon of the SoC, or even hardware issues.
>
> Can you try to debug it?

And I can't reproduce it anymore with 'u-boot/master'.
Rebooted 3 times and I have stable detection \o/.

I can still reproduce another (hardware?) failure in a dirty way:
1. Boot Linux kernel
2. run hdparm on the root partition (not the beast idea, as we will see):
sh-4.0# hdparm /dev/sda
/dev/sda:
HDIO_DRIVE_CMD(identify) failed: Invalid exchange
readonly = 0 (off)
readahead = 256 (on)
geometry = 30401/255/63, sectors = 488397168, start = 0
system losts USB, root, and ability to run binaries
3. attach with JTAG:
$sudo openocd -f /usr/share/openocd/scripts/board/sheevaplug.cfg
Open On-Chip Debugger 0.5.0-dev-00466-g28ddefd (2010-08-06-22:54)
...
> reset
4. get in u-boot prompt and run 'usb start'
Marvell>> usb start
(Re)start USB...
USB: Register 10011 NbrPorts 1
USB EHCI 1.00
scanning bus for devices... 2 USB Device(s) found
scanning bus for storage devices... 0 Storage Device(s) found
Marvell>> usb info
1: Hub, USB Revision 2.0
- u-boot EHCI Host Controller
- Class: Hub
- PacketSize: 64 Configurations: 1
- Vendor: 0x0000 Product 0x0000 Version 1.0
Configuration: 1
- Interfaces: 1 Self Powered 0mA
Interface: 0
- Alternate Setting 0, Endpoints: 1
- Class Hub
- Endpoint 1 In Interrupt MaxPacket 8 Interval 255ms

Configuration: 0
- Interfaces: 0 Bus Powered 0mA

5. try to boot nand linux kernel to see if is able to find usb root and start:
[ 1.392621] Waiting for root device /dev/sda3...
[ 1.508952] usb 1-1: device descriptor read/64, error -32
[ 1.738954] usb 1-1: device descriptor read/64, error -32
[ 1.968955] usb 1-1: new high speed USB device using orion-ehci and address 3
[ 2.098954] usb 1-1: device descriptor read/64, error -32
[ 2.328956] usb 1-1: device descriptor read/64, error -32
[ 2.558956] usb 1-1: new high speed USB device using orion-ehci and address 4
[ 2.610990] usb 1-1: device descriptor read/8, error -71
[ 2.750990] usb 1-1: device descriptor read/8, error -71
[ 2.978955] usb 1-1: new high speed USB device using orion-ehci and address 5
[ 3.030990] usb 1-1: device descriptor read/8, error -71
[ 3.170990] usb 1-1: device descriptor read/8, error -71
[ 3.278964] hub 1-0:1.0: unable to enumerate USB device on port 1
<hung forever>
<trying more JTAG reset/kernel boot loops ... and it does not help, kernel does not see root>

*shrug* Seems, we have lost it.

Power off/power on restores USB operation. Kernel boots and usb survives several reboots.

feature request: would be nice to see some errors in 'usb start' output when the hardware
is in such bad state.

Thanks!

[0] http://www.plugcomputer.org/plugwiki/index.php/Das_U-boot_plug_support

--

Sergei
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
Url : http://lists.denx.de/pipermail/u-boot/attachments/20100807/3a053ea7/attachment.pgp