[U-Boot] [patch 0/3] Improve stability USB memory sticks for the common OHCI USB layer.

Stelian Pop stelian at popies.net
Sat Sep 20 22:14:41 CEST 2008


Le samedi 20 septembre 2008 à 11:38 +0200, Remy Bohmer a écrit :
> Hello Stelian,
> 
> >> Thanks, and I expect to hear some more positive news ;-)))
> > I'm afraid I have more bad news.
> 
> Grmbl, Now my weekend is ruined ;-))))

Sorry for that :)

[...]

> Okay, let's summarize this:
> With and without patches it does not work on AT91CAP9 and AT91SAM9263...
> (Without my patches you get a less detailed error message...)

Right. However the two board fail with slight different errors iirc.

> There can be several reasons for this:
> * The USB code never worked on AT91CAP9 and AT91SAM9263 with mainline,
> so it could be possible that there is some initialisation missing for
> CAP9 and SAM9263, possible for more CPU's also that did not work
> before with GCC 3.x.

Sure. However, I've double checked the Linux initialisation code for the
usb host on the AT91 boards and the U-Boot counterparts and there are
only a few differences (some VBus GPIOs to set on the AT91SAM9263, an
additionnal clock for AT91SAM9261), and I cannot find anything which
could go wrong here.
 
> Does not mean the patches are bad, but does mean that it could be
> possible/likely that these patches do not fix all problems for all
> boards and all sticks.

Sure.

[...]

> I want to invest some time in it to debug these issues also, but then
> I will need your help, because I do not have a SAM9263, CAP9 board so
> I cannot reproduce your problems here.

I do have a SAM9263 in front of me waiting for your experimental
patches :-)

And I can do some extra tests on other Atmel boards, but this will have
to wait a week or so because I won't have access to them before then.

> I have several ideas where to look, and can create some experimental
> patches, but before I do that and bother you unnecessary, I would like
> to get some more information from you about which USB sticks you are
> using.

I tested with 2 different USB sticks, a very old 256 MB one and a more
recent 1 GB. They behave exactly the same.

> Can you please provide me the output of: (even if the command fails)
> * usb info
> * usb storage
> * usb tree
> * and if possible a 'lsusb -v' output from linux of your USB sticks

See below.

> Also, it would be very helpful if you would test your sticks on a
> SAM9261, because that SoC _must_ work. (I tested on AT91SAM9261-EK,
> and custom board)
> Then we can relate the problem to a specific USB stick, or to a certain SoC.

Hmm, I can do that, but not before September 29.

Stelian.

U-Boot> usb start
(Re)start USB...
USB:   scanning bus for devices... 
      USB device not responding, giving up (status=20)
2 USB Device(s) found
       scanning bus for storage devices... 0 Storage Device(s) found
U-Boot> usb info
1: Hub,  USB Revision 1.10
 -  OHCI Root Hub 
 - Class: Hub
 - PacketSize: 8  Configurations: 1
 - Vendor: 0x0000  Product 0x0000 Version 0.0
   Configuration: 1
   - Interfaces: 1 Self Powered 0mA
     Interface: 0
     - Alternate Setting 0, Endpoints: 1
     - Class Hub
     - Endpoint 1 In Interrupt MaxPacket 2 Interval 255ms

   Configuration: 0
   - Interfaces: 0 Bus Powered 0mA

U-Boot> usb storage
No storage devices, perhaps not 'usb start'ed..?
U-Boot> usb re  tree

Device Tree:
  1  Hub (12MBit/s, 0mA)
  |   OHCI Root Hub 
  |
  |+-0  See Interface (12MBit/s, 0mA)
     
U-Boot> boot
[...]
at91_ohci at91_ohci: AT91 OHCI
at91_ohci at91_ohci: new USB bus registered, assigned bus number 1
at91_ohci at91_ohci: irq 29, io mem 0x00a00000
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
Initializing USB Mass Storage driver...
usb 1-1: new full speed USB device using at91_ohci and address 2
usb 1-1: configuration #1 chosen from 1 choice
scsi0 : SCSI emulation for USB Mass Storage devices
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
[...]
scsi 0:0:0:0: Direct-Access     USB 2.0  Mobile Disk N4S  1.00 PQ: 0 ANSI: 2
sd 0:0:0:0: [sda] 507904 512-byte hardware sectors (260 MB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Assuming drive cache: write through
sd 0:0:0:0: [sda] 507904 512-byte hardware sectors (260 MB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Assuming drive cache: write through
 sda: sda1
sd 0:0:0:0: [sda] Attached SCSI removable disk
[...]
at91sam9263ek login: root
root at at91sam9263ek:~$ lsusb -v

Bus 001 Device 002: ID 126f:1325 TwinMOS Mobile Disk
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x126f TwinMOS
  idProduct          0x1325 Mobile Disk
  bcdDevice            1.00
  iManufacturer          16 TTI-WDE     
  iProduct               32 USB 2.0 Mobile Disk    
  iSerial                48 FF04112100886
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           39
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration         64 iCfg
    bmAttributes         0x80
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass         8 Mass Storage
      bInterfaceSubClass      6 SCSI
      bInterfaceProtocol     80 Bulk (Zip)
      iInterface             96 BULK
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval             255
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval             255
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0002  1x 2 bytes
        bInterval               1
Device Qualifier (for other device speed):
  bLength                10
  bDescriptorType         6
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  bNumConfigurations      1

Bus 001 Device 001: ID 0000:0000  
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            9 Hub
  bDeviceSubClass         0 Unused
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x0000 
  idProduct          0x0000 
  bcdDevice            2.06
  iManufacturer           3 Linux 2.6.22 ohci_hcd
  iProduct                2 AT91 OHCI
  iSerial                 1 at91
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           25
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower                0mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         9 Hub
      bInterfaceSubClass      0 Unused
      bInterfaceProtocol      0 
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0002  1x 2 bytes
        bInterval             255
Hub Descriptor:
  bLength               9
  bDescriptorType      41
  nNbrPorts             2
  wHubCharacteristic 0x0012
    No power switching (usb 1.0)
    No overcurrent protection
  bPwrOn2PwrGood        2 * 2 milli seconds
  bHubContrCurrent      0 milli Ampere
  DeviceRemovable    0x00
  PortPwrCtrlMask    0x00 
 Hub Port Status:
   Port 1: 0000.0103 power enable connect
   Port 2: 0000.0100 power
root at at91sam9263ek:~$ 

-- 
Stelian Pop <stelian at popies.net>



More information about the U-Boot mailing list