Hello list
I have ported linux 2.6.12 usb driver to a SOC board consisting of a mips
processor. The SOC is mips  processor which has a in-core non-PCI usb 2.0
host controller which supports ehci/ohci. Because mips is big endian and the
usb host controller is little endian, a glue logic has been added in the usb
host controller which does endian conversion for data,descriptors and
register access. I have modified the driver to treat the usb host controller
as  a platform device.
The problem is that the full speed devices are not recognized correctly due
to device descriptors read errors. However at times, the usb device is
recognized correctly and vendor id and device id string shows up correctly.
The driver gets loaded and identifies correctly the no. of ports of usb host
controller as is shown below.
/bin # insmod usbcore.ko old_scheme_first=y
Using usbcore.ko
usbcore: registered new driver usbfs
usbcore: registered new driver hub
/bin # insmod ohci-hcd.ko
vox160-hcd vox160-hcd.0: ADI VOX160 OHCI
vox160-hcd vox160-hcd.0: new USB bus registered, assigned bus number 1
vox160-hcd vox160-hcd.0: irq 35, io mem 0x19240800
usb usb1: Product: ADI VOX160 OHCI
usb usb1: Manufacturer: Linux 2.6.12 ohci_hcd
usb usb1: SerialNumber: vox160 ohci
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected.

The output from dmesg is produced as well below.

/bin # dmesg
usbcore: registered new driver usbfs
usbcore: registered new driver hub
2004 Nov 08 USB 1.1 'Open' Host Controller (OHCI) Driver (VOX160
OHCI)<7>block sizes: ed 64 td 64
In ohci_hcd_vox160_drv_probe<7>
initializing VOX160 OHCI USB Controller
drivers/usb/host/ohci-vox160.c: Probing USB OHCI
drivers/usb/host/ohci-vox160.c: starting VOX160 OHCI USB Controller
drivers/usb/host/ohci-vox160.c: Clock to USB host has been enabled
vox160-hcd vox160-hcd.0: ADI VOX160 OHCI
vox160-hcd vox160-hcd.0: new USB bus registered, assigned bus number 1
vox160-hcd vox160-hcd.0: irq 35, io mem 0x19240800
vox160-hcd vox160-hcd.0: ohci_vox160_start, ohci:81224124<7>vox160-hcd
vox160-hcd.0: resetting from state 'reset', control = 0x0
vox160-hcd vox160-hcd.0: OHCI controller state
vox160-hcd vox160-hcd.0: OHCI 1.0, NO legacy support registers
vox160-hcd vox160-hcd.0: control 0x083 HCFS=operational CBSR=3
vox160-hcd vox160-hcd.0: cmdstatus 0x00000 SOC=0
vox160-hcd vox160-hcd.0: intrstatus 0x00000044 RHSC SF
vox160-hcd vox160-hcd.0: intrenable 0x8000001a MIE UE RD WDH
vox160-hcd vox160-hcd.0: fminterval a7782edf
vox160-hcd vox160-hcd.0: hcca frame #0006
vox160-hcd vox160-hcd.0: roothub.a 02001201 POTPGT=2 NOCP NPS NDP=1
vox160-hcd vox160-hcd.0: roothub.b 00000000 PPCM=0000 DR=0000
vox160-hcd vox160-hcd.0: roothub.status 00008000 DRWE
vox160-hcd vox160-hcd.0: roothub.portstatus [0] 0x00000100 PPS
usb usb1: default language 0x0409
usb usb1: new device strings: Mfr=3, Product=2, SerialNumber=1
usb usb1: Product: ADI VOX160 OHCI
usb usb1: Manufacturer: Linux 2.6.12 ohci_hcd
usb usb1: SerialNumber: vox160 ohci
usb usb1: adding 1-0:1.0 (config #1, interface 0)
hub 1-0:1.0: usb_probe_interface
hub 1-0:1.0: usb_probe_interface - got id
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
hub 1-0:1.0: standalone hub
hub 1-0:1.0: no power switching (usb 1.0)
hub 1-0:1.0: no over-current protection
hub 1-0:1.0: power on to power good time: 4ms
hub 1-0:1.0: local power source is good
vox160-hcd vox160-hcd.0: created debug files
hub 1-0:1.0: state 5 ports 1 chg 0000 evt 0000

Now,when a full speed usb device like keyboard is inserted, I get following
messages on the console.

/bin # usb 1-1: new full speed USB device using vox160-hcd and address 2
usb 1-1: device descriptor read/8, error -71
usb 1-1: device descriptor read/8, error -71
usb 1-1: new full speed USB device using vox160-hcd and address 3
usb 1-1: device descriptor read/8, error -71
usb 1-1: device descriptor read/8, error -71
usb 1-1: new full speed USB device using vox160-hcd and address 4
usb 1-1: device descriptor read/64, error -145
usb 1-1: device descriptor read/64, error -145
sb 1-1: new full speed USB device using vox160-hcd and address 5
usb 1-1: device descriptor read/64, error -145
usb 1-1: device descriptor read/64, error -145

The dmesg output after inserting the device is produced below.
/bin # dmesg -c
hub 1-0:1.0: state 5 ports 1 chg 0000 evt 0002
vox160-hcd vox160-hcd.0: GetStatus roothub.portstatus [0] = 0x00010101 CSC
PPS CCS
hub 1-0:1.0: port 1, status 0101, change 0001, 12 Mb/s
hub 1-0:1.0: debounce: port 1: total 100ms stable 100ms status 0x101
vox160-hcd vox160-hcd.0: GetStatus roothub.portstatus [0] = 0x00100103 PRSC
PPS
PES CCS
usb 1-1: new full speed USB device using vox160-hcd and address 2
usb 1-1: device descriptor read/8, error -71
usb 1-1: device descriptor read/8, error -71
vox160-hcd vox160-hcd.0: GetStatus roothub.portstatus [0] = 0x00100103 PRSC
PPS
PES CCS
usb 1-1: new full speed USB device using vox160-hcd and address 3
usb 1-1: device descriptor read/8, error -71
usb 1-1: device descriptor read/8, error -71
vox160-hcd vox160-hcd.0: GetStatus roothub.portstatus [0] = 0x00100103 PRSC
PPS
PES CCS
usb 1-1: new full speed USB device using vox160-hcd and address 4
vox160-hcd vox160-hcd.0: urb 8168f920 path 1 ep0in 5fd60000 cc 5 --> status
-145
vox160-hcd vox160-hcd.0: urb 8168f920 path 1 ep0in 5fd60000 cc 5 --> status
-145
vox160-hcd vox160-hcd.0: GetStatus roothub.portstatus [0] = 0x00100103 PRSC
PPS
PES CCS
usb 1-1: device descriptor read/64, error -145
vox160-hcd vox160-hcd.0: urb 8168f920 path 1 ep0in 5fd60000 cc 5 --> status
-145
vox160-hcd vox160-hcd.0: urb 8168f920 path 1 ep0in 5fd60000 cc 5 --> status
-145
vox160-hcd vox160-hcd.0: GetStatus roothub.portstatus [0] = 0x00100103 PRSC
PPS
PES CCS
usb 1-1: device descriptor read/64, error -145
vox160-hcd vox160-hcd.0: GetStatus roothub.portstatus [0] = 0x00100103 PRSC
PPS
PES CCS
usb 1-1: new full speed USB device using vox160-hcd and address 5
vox160-hcd vox160-hcd.0: urb 8168f920 path 1 ep0in 5fd60000 cc 5 --> status
-145
vox160-hcd vox160-hcd.0: urb 8168f920 path 1 ep0in 5fd60000 cc 5 --> status
-145
vox160-hcd vox160-hcd.0: GetStatus roothub.portstatus [0] = 0x00100103 PRSC
PPS
PES CCS
usb 1-1: device descriptor read/64, error -145
vox160-hcd vox160-hcd.0: urb 8168f920 path 1 ep0in 5fd60000 cc 5 --> status
-145
vox160-hcd vox160-hcd.0: urb 8168f920 path 1 ep0in 5fd60000 cc 5 --> status
-145
vox160-hcd vox160-hcd.0: GetStatus roothub.portstatus [0] = 0x00100103 PRSC
PPS
PES CCS
usb 1-1: device descriptor read/64, error -145
hub 1-0:1.0: state 5 ports 1 chg 0000 evt 0002

The lsusb and /proc/interrupts output as it appears after inserting the
device is also attached for reference.

/bin # cat /proc/interrupts
           CPU0
  6:      14330       ADI fusiv  serial
  9:      74481       ADI fusiv  timer
 13:          0       ADI fusiv  eth1
 14:          1       ADI fusiv  eth0
 31:       3057       ADI fusiv  bmap
 35:         52       ADI fusiv  ohci_hcd:usb1


/bin # lsusb -v

Bus 001 Device 001: ID 0000:0000 Virtual Hub
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB              10.01
  bDeviceClass            9 Hub
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0         8
  idVendor           0x0000 Virtual
  idProduct          0x0000 Hub
  bcdDevice            6.02
  iManufacturer           3 Linux 2.6.12 ohci_hcd
  iProduct                2 ADI VOX160 OHCI
  iSerial                 1 vox160 ohci
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           25
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0xc0
      Self Powered
    MaxPower                0mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         9 Hub
      bInterfaceSubClass      0
      bInterfaceProtocol      0
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               none
        wMaxPacketSize          2
        bInterval             255
  Language IDs: (length=4)
     0409 English(US)
/bin #

Has anybody faced similar issues with non-pci implementation ?
Is it a known issue in 2.6.12 series usb driver ?
Are there any patch that needs to be applied to 2.6.12 driver ?
What may go wrong in recognizing the usb device ?

Any help would be greatly appreciated ? 

Thanks.

Regards
Vivek

<<attachment: winmail.dat>>

Reply via email to