AnsweredAssumed Answered

USB LS device not working through FS hub on i.MX6

Question asked by Andrey Volkov on Sep 26, 2018
Latest reply on Sep 28, 2018 by igorpadykov

The question is how to configure i.MX6 USB Host controller to work with Low-speed devices attached through Full-speed hub.

 

We have a bare-metal software running on i.MX6 Solo (not Linux-based). And it runs on different target platforms (SabreSD, Hummingboard and several other). Some of them have USB hub attached to USB_H1 port. For example, Hummingboard Pro has CY7C65632, and we also have another board with USB2514 - all these are HS hubs, and they run fine.

 

Now we have a customer, their board has old FS hub (TI TUSB2046) on USB_H1 port, and we have problems with it. Our software enumerates the hub, it can enumerate FS devices connected to the hub, but cannot enumerate (and work with) LS devices connected through this FS hub. Our (very typical) LS devices are USB mice.

 

We did some tests and here's what is working:

USB OTG port -> LS/FS/HS device connected directly
USB OTG port -> random external USB HS hub -> LS/FS/HS device
USB H1 port -> embedded USB HS hub (CY7C65632/USB2514) -> LS/FS/HS device
USB H1 port -> USB FS hub (TUSB2046) -> FS device

And this combination doesn't work:

USB H1 port -> USB FS hub (TUSB2046) -> LS device

In our software we see an error during enumeration - LS device doesn't reply to our SETUP request, where HS device does on the same port.

 

I have also tested the same case booting Linux on this board with supported 4.1.15 kernel. It behaves the same way - FS device is enumerated successfully, and LS device is not - it doesn't accept address (Linux tries to assign address as the first step).

 

Here is the debugging output showing Async Queue Head after the successful FS device query (we get short descriptor) and after unsuccessful LS query:

 

FS device:

QueueHead[0] 0x10200080
    queueHeadLinkPointer: 0x10200082, T=0, Typ=QH
 endpointCharacteristics: 0x0840c000, RL=0, C=1, maxPacketLen=64, H=1, dtc=1, I=0
 endpointCharacteristics: EPS=12M, EndPt=0, address=0
    endpointCapabilities: 0x40820000, Mult=1, Port=1, Hub=2, C-mask=0x00, S-mask=0x00
              currentQtd: 0x10200200
                OVERLAY:
                 nextQtd: 0xdead0001, T=1
        alternateNextQtd: 0x00000001, T=1, nakCnt=0
                qtdToken: 0x00008c00, dt=0, bytesTT=0, ioc=1, c_page=0, CERR=3, PID=OUT
                  Status: 0x00,         
            qtdBuffer[0]: 0x00000000, pointer[0] = 0x00000***, current offset = 0
            qtdBuffer[1]: 0x00000001, pointer[1] = 0x00000***, C-prog-mask = 0x01
            qtdBuffer[2]: 0x00000019, pointer[2] = 0x00000***, S-bytes = 0x00, FrameTag = 0x19
            qtdBuffer[3]: 0x00000000, pointer[3] = 0x00000***
            qtdBuffer[4]: 0x00000000, pointer[4] = 0x00000***

LS device:

 

QueueHead[0] 0x10200080
    queueHeadLinkPointer: 0x10200082, T=0, Typ=QH
 endpointCharacteristics: 0x0808d000, RL=0, C=1, maxPacketLen=8, H=1, dtc=1, I=0
 endpointCharacteristics: EPS=1.5M, EndPt=0, address=0
    endpointCapabilities: 0x40820000, Mult=1, Port=1, Hub=2, C-mask=0x00, S-mask=0x00
              currentQtd: 0x10200100
                OVERLAY:
                 nextQtd: 0x10200180, T=0
        alternateNextQtd: 0x00000001, T=1, nakCnt=0
                qtdToken: 0x00080248, dt=0, bytesTT=8, ioc=0, c_page=0, CERR=0, PID=SETUP
                  Status: 0x48,  Halted   XactErr    
            qtdBuffer[0]: 0x100d87ac, pointer[0] = 0x100d8***, current offset = 1964
            qtdBuffer[1]: 0x00000001, pointer[1] = 0x00000***, C-prog-mask = 0x01
            qtdBuffer[2]: 0x00000006, pointer[2] = 0x00000***, S-bytes = 0x00, FrameTag = 0x06
            qtdBuffer[3]: 0x00000000, pointer[3] = 0x00000***
            qtdBuffer[4]: 0x00000000, pointer[4] = 0x00000***

Here we see successful status (0) and PID=OUT (last) in the FS case, and Halted/XactErr, CERR=0 status on the first PID (SETUP) for LS device.

 

The settings for the QH and for LS/FS transaction actually raise questions.

 

1) There are Port/Hub settings, which are set to Hub=2 (Hub address) and Port=1 (Port address). See chapter 65.4.2.6 in the reference manual for their meaning. When they are set this way for HS hub, they work.
But they are addressing transaction translator (TT) of a HS hub, and they actually do not make sense for FS hub, because it doesn't have a TT.
There is no clear explanation in the reference manual how to setup the QH in our case, (some usual info is in chapter 65.4.4.1.4 in the RM for Solo/DualLite), and I tried different ideas in this respect.
First, shown here - to use the same setting like in HS case - doesn't work.
Next, to use Hub=0/Port=0 - rely on some 'magic' in i.MX6 EHCI controller - doesn't work.
Next, to use Hub=0/Port=1 - manual says (65.4.4) that the EHCI has Embedded Transaction Translator, and this setting should refer to TT#1 of the root Hub/EHCI port (0). This also doesn't work.

 

Question: How should QH be setup for LS through FS hub case?

 

2) When working with LS device through FS hub - is there going to be split transaction when doing SETUP? Or is it going to switch to another data/signaling speed?
In this case, should we alter the PTS field in USB_nPORTSC1 register?
Should we somehow tune other USB host/USB PHY parameters for this case? Maybe, USB_nTXFILLTUNING or some USB PHY setting?

 

The PHY settings are as follows:

USBPHYx_PWD    0
USBPHYx_TX     10060607
USBPHYx_RX     0
USBPHYx_CTRL   2020c042
USBPHYx_STATUS 0
USBPHYx_DEBUG  7f180000
USB_ANALOG_USB2_VBUS_DETECT 100004
USB_ANALOG_USB2_CHRG_DETECT 100000
USB_ANALOG_USB2_VBUS_DETECT_STAT e
USB_ANALOG_USB2_CHRG_DETECT_STAT 0
USB_ANALOG_USB2_MISC 6b000002

As you can see by  USBPHYx_CTRL valuse, we have ENUTMILEVEL3 and ENUTMILEVEL2 set, enabling UTMI+ levels 2 and 3. And UTMI+ level 3 is exactly what is needed to 'support external FS Hub with LS device connected' (this phrase is from the reference manual).

 

In 'UTMI + White Paper' that can be googled, we can see that UTMI+ Level3 PHY should in our case:

  • Switch to an LS data rate within a transaction.
  • Support LS preamble PID (PRE-PID)

But the reference manual doesn't give any clear directions what to do next to enable this.

 

Question: What setup do we need for USB host/USB PHY in LS through FS hub case?

 


Summary:
i.MX6 Reference Manual says that USB LS device should work when connected through FS hub to USB_H1 port, but it doesn't work. It seems not to work in 4.1.15 Linux kernel.
Was it tested by anyone?
What software setup is required to make it work?

 

Best regards,

Andrey

Outcomes