This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

EHCI USB with SMSC3320 on HSUSB1

Other Parts Discussed in Thread: DM3730, DA8XX

Having some trouble getting USB working, and I hope someone can help out.

We're running the SMSC3320 ULPI transceiver on HSUSB1 (DM3730, custom board based on EVM reference design).  I have EHCI support enabled in the kernel and the port settings in place (see below).  During the kernel boot, everything appears to start up correctly, and the device is found.  All the signals coming out the transceiver appear valid.  However, when, I plug in a USB device, it is unable to communicate with the device, giving the error "usb 1-1: device descriptor read/64, error -71" (Protocol Error).  This occurs with both self-powered hubs and USB flash drives.

I also notice that during the boot process, the soft phy reset is timing out.  I tried communication with a few other ULPI PHY-side registers, and they are all timing out.  That may be a contributing factor, or just a red herring.

Board Config:
static struct ehci_hcd_omap_platform_data ehci_pdata __initdata = {

    .port_mode[0] = EHCI_HCD_OMAP_MODE_PHY,
    .port_mode[1] = EHCI_HCD_OMAP_MODE_UNKNOWN,
    .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN,

    .phy_reset  = true,
    /* PHY reset GPIO will be runtime programmed based on EVM version */
    .reset_gpio_port[0]  = 25,
    .reset_gpio_port[1]  = -EINVAL,
    .reset_gpio_port[2]  = -EINVAL
};

Kernel Config Settings:
#
# Miscellaneous USB options
#
CONFIG_USB_DEVICEFS=y
CONFIG_USB_DEVICE_CLASS=y
# CONFIG_USB_DYNAMIC_MINORS is not set
CONFIG_USB_SUSPEND=y
CONFIG_USB_OTG=y
# CONFIG_USB_OTG_WHITELIST is not set
# CONFIG_USB_OTG_BLACKLIST_HUB is not set
# CONFIG_USB_MON is not set
# CONFIG_USB_WUSB is not set
# CONFIG_USB_WUSB_CBAF is not set

#
# USB Host Controller Drivers
#
# CONFIG_USB_C67X00_HCD is not set
CONFIG_USB_EHCI_HCD=y
# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
CONFIG_USB_EHCI_TT_NEWSCHED=y
# CONFIG_USB_OXU210HP_HCD is not set
# CONFIG_USB_ISP116X_HCD is not set
# CONFIG_USB_ISP1760_HCD is not set
# CONFIG_USB_ISP1362_HCD is not set
# CONFIG_USB_OHCI_HCD is not set
# CONFIG_USB_SL811_HCD is not set
# CONFIG_USB_R8A66597_HCD is not set
# CONFIG_USB_HWA_HCD is not set
CONFIG_USB_MUSB_HDRC=y

#
# Platform Glue Layer
#
# CONFIG_USB_MUSB_TUSB6010_GLUE is not set
CONFIG_USB_MUSB_OMAP2PLUS_GLUE=y
# CONFIG_USB_MUSB_AM35X_GLUE is not set
# CONFIG_USB_MUSB_DAVINCI is not set
# CONFIG_USB_MUSB_DA8XX is not set
# CONFIG_USB_MUSB_TUSB6010 is not set
CONFIG_USB_MUSB_OMAP2PLUS=y
# CONFIG_USB_MUSB_AM35X is not set
# CONFIG_USB_MUSB_TI81XX is not set
# CONFIG_USB_MUSB_BLACKFIN is not set
# CONFIG_USB_MUSB_UX500 is not set
# CONFIG_USB_MUSB_HOST is not set
# CONFIG_USB_MUSB_PERIPHERAL is not set
CONFIG_USB_MUSB_OTG=y
CONFIG_USB_GADGET_MUSB_HDRC=y
CONFIG_USB_MUSB_HDRC_HCD=y
# CONFIG_MUSB_PIO_ONLY is not set
CONFIG_USB_INVENTRA_DMA_HW=y
# CONFIG_USB_TI_CPPI_DMA_HW is not set
# CONFIG_USB_TI_CPPI41_DMA_HW is not set
CONFIG_USB_INVENTRA_DMA=y
CONFIG_MUSB_USE_SYSTEM_DMA_WORKAROUND=y
# CONFIG_USB_TI_CPPI_DMA is not set
# CONFIG_USB_TI_CPPI41_DMA is not set
# CONFIG_USB_TUSB_OMAP_DMA is not set
CONFIG_USB_MUSB_DEBUG=y

#
# USB Device Class drivers
#
# CONFIG_USB_ACM is not set
# CONFIG_USB_PRINTER is not set
# CONFIG_USB_WDM is not set
# CONFIG_USB_TMC is not set

#
# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
#

#
# also be needed; see USB_STORAGE Help for more info
#
CONFIG_USB_STORAGE=y
CONFIG_USB_STORAGE_DEBUG=y
# CONFIG_USB_STORAGE_DATAFAB is not set
# CONFIG_USB_STORAGE_FREECOM is not set
# CONFIG_USB_STORAGE_ISD200 is not set
# CONFIG_USB_STORAGE_USBAT is not set
# CONFIG_USB_STORAGE_SDDR09 is not set
# CONFIG_USB_STORAGE_SDDR55 is not set
# CONFIG_USB_STORAGE_JUMPSHOT is not set
# CONFIG_USB_STORAGE_ALAUDA is not set
# CONFIG_USB_STORAGE_ONETOUCH is not set
# CONFIG_USB_STORAGE_KARMA is not set
# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
# CONFIG_USB_UAS is not set
CONFIG_USB_LIBUSUAL=y

#
# USB Imaging devices
#
# CONFIG_USB_MDC800 is not set
# CONFIG_USB_MICROTEK is not set

#
# USB port drivers
#
# CONFIG_USB_SERIAL is not set

#
# USB Miscellaneous drivers
#
# CONFIG_USB_EMI62 is not set
# CONFIG_USB_EMI26 is not set
# CONFIG_USB_ADUTUX is not set
# CONFIG_USB_SEVSEG is not set
# CONFIG_USB_RIO500 is not set
# CONFIG_USB_LEGOTOWER is not set
# CONFIG_USB_LCD is not set
# CONFIG_USB_LED is not set
# CONFIG_USB_CYPRESS_CY7C63 is not set
# CONFIG_USB_CYTHERM is not set
# CONFIG_USB_IDMOUSE is not set
# CONFIG_USB_FTDI_ELAN is not set
# CONFIG_USB_APPLEDISPLAY is not set
# CONFIG_USB_SISUSBVGA is not set
# CONFIG_USB_LD is not set
# CONFIG_USB_TRANCEVIBRATOR is not set
# CONFIG_USB_IOWARRIOR is not set
CONFIG_USB_TEST=y
# CONFIG_USB_ISIGHTFW is not set
# CONFIG_USB_YUREX is not set
CONFIG_USB_GADGET=y
# CONFIG_USB_GADGET_DEBUG is not set
# CONFIG_USB_GADGET_DEBUG_FILES is not set
# CONFIG_USB_GADGET_DEBUG_FS is not set
CONFIG_USB_GADGET_VBUS_DRAW=2
CONFIG_USB_GADGET_SELECTED=y
# CONFIG_USB_GADGET_OMAP is not set
# CONFIG_USB_GADGET_R8A66597 is not set
# CONFIG_USB_GADGET_M66592 is not set
# CONFIG_USB_GADGET_DUMMY_HCD is not set
CONFIG_USB_GADGET_DUALSPEED=y
# CONFIG_USB_ZERO is not set
# CONFIG_USB_AUDIO is not set
CONFIG_USB_ETH=y
CONFIG_USB_ETH_RNDIS=y
# CONFIG_USB_ETH_EEM is not set
# CONFIG_USB_GADGETFS is not set
# CONFIG_USB_FUNCTIONFS is not set
# CONFIG_USB_FILE_STORAGE is not set
# CONFIG_USB_MASS_STORAGE is not set
# CONFIG_USB_G_SERIAL is not set
# CONFIG_USB_MIDI_GADGET is not set
# CONFIG_USB_G_PRINTER is not set
# CONFIG_USB_CDC_COMPOSITE is not set
# CONFIG_USB_G_MULTI is not set
# CONFIG_USB_G_HID is not set
# CONFIG_USB_G_DBGP is not set
# CONFIG_USB_G_WEBCAM is not set

#
# OTG and related infrastructure
#
CONFIG_USB_OTG_UTILS=y
# CONFIG_USB_GPIO_VBUS is not set
# CONFIG_ISP1301_OMAP is not set
# CONFIG_USB_ULPI is not set
CONFIG_TWL4030_USB=y
# CONFIG_NOP_USB_XCEIV is not set

Boot messages:
[    3.305877] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver       
[    4.321289] ehci-omap ehci-omap.0: phy reset operation timed out            
[    5.336334] ehci-omap ehci-omap.0: OMAP-EHCI Host Controller                 
[    5.344177] ehci-omap ehci-omap.0: new USB bus registered, assigned bus number 1                                                                             
[    5.352294] ehci-omap ehci-omap.0: irq 77, io mem 0x48064800                 
[    5.368225] ehci-omap ehci-omap.0: USB 2.0 started, EHCI 1.00                
[    5.374877] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002    
[    5.382049] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1                                                                               
[    5.389648] usb usb1: Product: OMAP-EHCI Host Controller                     
[    5.395233] usb usb1: Manufacturer: Linux 2.6.37 ehci_hcd                    
[    5.400909] usb usb1: SerialNumber: ehci-omap.0                              
[    5.408447] hub 1-0:1.0: USB hub found                                       
[    5.412414] hub 1-0:1.0: 3 ports detected                                    
[    5.446350] ehci-omap ehci-omap.0: setup completed successfully              
[    5.453155] Initializing USB Mass Storage driver...                          
[    5.458892] usbcore: registered new interface driver usb-storage             
[    5.465209] USB Mass Storage support registered.                             
[    5.470764] usbcore: registered new interface driver libusual

Error messages:
[   91.079315] usb 1-1: new high speed USB device using ehci-omap and address 2                                                                
[   91.219940] usb 1-1: device descriptor read/64, error -71                    
[   91.469970] usb 1-1: device descriptor read/64, error -71                    
[   91.704315] usb 1-1: new high speed USB device using ehci-omap and address 3
[   91.844940] usb 1-1: device descriptor read/64, error -71                    
[   92.094940] usb 1-1: device descriptor read/64, error -71                    
[   92.329315] usb 1-1: new high speed USB device using ehci-omap and address 4
[   92.758972] usb 1-1: device not accepting address 4, error -71               
[   92.884002] usb 1-1: new high speed USB device using ehci-omap and address 5
[   93.313659] usb 1-1: device not accepting address 5, error -71               
[   93.319824] ehci-omap ehci-omap.0: port 1 cannot be enabled

Thank you,
Glenn Wainwright
Senior Software Engineer, Verathon Medical

  • Found that doing any ULPI registry changes prior to usb_add_hcd isn't going to work out too well.  Putting the soft_phy_reset call after that works just fine without any timeout.  Now that I can successfully do ULPI registry communication, I can dump out the current state of those registers (see below).

    The state of 0x4 (Function Control) tells me that what I was seeing earlier on the scope was correct.  SOMEONE in the kernel is setting this port to FS instead of HS.  I can't find who, but someone is doing it - I'm seeing a transmission during boot to write 0x45 to 0x4 where it should be 0x40.  I'm going to try changing this register after the fact to put it back into HS mode, but it would be better if I could fix whoever is setting it incorrectly in the first place.  Any idea where that might be in the kernel?  Am I barking up the wrong tree?

     Reg 0x1 = 0x4    

     Reg 0x2 = 0x7    

     Reg 0x3 = 0x0    

     Reg 0x4 = 0x45  

     Reg 0x5 = 0x45  

     Reg 0x6 = 0x45  

     Reg 0x7 = 0x8    

     Reg 0x8 = 0x8    

     Reg 0x9 = 0x8    

     Reg 0xa = 0x66  

     Reg 0xb = 0x66  

     Reg 0xc = 0x66  

     Reg 0xd = 0x1f  

     Reg 0xe = 0x1f  

     Reg 0xf = 0x1f   

     Reg 0x10 = 0x1f

     Reg 0x11 = 0x1f

     Reg 0x12 = 0x1f

     Reg 0x13 = 0x4  

     Reg 0x14 = 0xc  

     Reg 0x15 = 0x0  

     Reg 0x16 = 0x0  

     Reg 0x17 = 0x0  

     Reg 0x18 = 0x0  

     Reg 0x19 = 0x0  

     Reg 0x1a = 0x0  

     Reg 0x1b = 0x0  

     Reg 0x1c = 0x0  

     Reg 0x1d = 0x0  

     Reg 0x1e = 0x0  

     Reg 0x1f = 0x0   

     Reg 0x20 = 0x0  

     Reg 0x21 = 0x0  

     Reg 0x22 = 0x0  

     Reg 0x23 = 0x0  

     Reg 0x24 = 0x0  

     Reg 0x25 = 0x0  

     Reg 0x26 = 0x0  

     Reg 0x27 = 0x0  

     Reg 0x28 = 0x0  

     Reg 0x29 = 0x0  

     Reg 0x2a = 0x0  

     Reg 0x2b = 0x0  

     Reg 0x2c = 0x0  

     Reg 0x2d = 0x0  

     Reg 0x2e = 0x0

  • No such luck.  I can set Function Control to HS after usb_add_hcd, but it does not seem to affect the outcome - I still get read errors for both USB hubs and flash storage.

  • Attacking from the other end, I've traced the EPROTO error down to a repeated XActErr on the descriptor request.  I'm having difficulty reading through the EHCI Queue code to trace it down any further than that.  What could be the potential causes of a repeated transaction error like that?

  • Found the issue!  The ESD protection circuit that we had put in place on the board had entirely too much capacitance.  Removing that part causes everything to work beautifully.