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.

CPEN on USB3320 driving USB power

Other Parts Discussed in Thread: OMAP3530

Hi,

We have a custom board with one of two processors: 3530 or 3730.  The earlier ones were made with 3530, and the latest ones - with 3730.  With both solutions we have the USB3320 chip managing the EHCI USB port. In the latest release we’ve added chips switching (on/off) the power signal to the USB port, so it’s not always connected there.  We control it using CPEN pin from the USB3320 chip.

With this solution we use Windows CE 6.0, and customized EVM-based TI BSP. 

Now, to supply +5V to the USB we need to have 3.2V on the CPEN pin, and… for 3530 processor – we have 3.2V, but for 3730 we have 0 there (or some mV values). Both boards are the same, so everything points to the software… but I cannot find any places that can be different here…

There is a registry file under the following folder:

C:\WINCE600\PLATFORM\EVM_OMAP3530\SRC\DRIVERS\USBHS

But we don’t use a GPIO pin (Port2PwrGpio) from these settings over there, because we use the CPEN pin from the USB chip for that.  By default EVM uses GPIO_22 for this purpose.

Is there a way to set this CPEN pin high from some registry settings or a driver code? I couldn’t find it anywhere. Do we have a code for the USB3320 driver in the BSP?

Is it possible that the default value for this pin driven from the processor to the USB chip is different between 3530 and 3730?

Thanks a lot!!

Best Regards,

Zack 

  • There should not be any difference in 3530 and 3730 in this regard - have you tried this on the EVM? I think in both cases CPEN should be 0 (since that is the default power on value in USB3320 spec). 

    In order to set it, you can write 1 to DrvVbus or DrvBusExternal bits in OTG_CONTROL register in USB3320 - there are ULPI read/write functions available to facilitate writing over ULPI interface. Give it a shot and see if it works

     

    thanks

    Atul

  • Atul,

     

    Thank you very much for your response!

     

    I don't have the same OS image on the EVM board.  I tried it on two boards:

    1. with 3530 processor, WinCE 6 and Bsquare 6.15 BSP

    2. with 3730 processor, WinCE 7 OS and TI BSP.

     

    What is supprising - for both of them I had 3.3V on the CPEN pin (pin 17).  I cannot explain that.

     

    Anyway, I've changed two places in the system.c file (folder: C:\WINCE600\PLATFORM\COMMON\SRC\SOC\COMMON_TI_V1\COMMON_TI\USB\EHCIPDD):

     

    1.    The following function:

     

    static VOID PortPowerControl(SEHCDPdd * pPddObject, DWORD dwPortNumber, BOOL bPowerOn)

    {

          BYTE nData;

          pPddObject;

          UlpiReadReg(0x4806280A + (dwPortNumber-1)*0x100, dwPortNumber, 0x0A, (BYTE*)&nData);

     

    if (bPowerOn)

    {

                nData|= 32;

    }

    Else

    {

                nData&= ~32;

          }

          UlpiWriteReg(0x4806280A + (dwPortNumber-1)*0x100, dwPortNumber, 0x0A, nData);

    }

     

    2.    Added:

         

          UlpiReadReg(0x4806280A + 0x100, 2, 0x0A, (BYTE*)&nData);;

          nData|= 32;

          UlpiWriteReg(0x4806280A + 0x100, 2, 0x0A, nData);

     

       To the function HcdPdd_IOControl, case IOCTL_POWER_SET, at the end of case D0.

     

    And still there was no voltage on the CPEN.

    I tried also a different implementation of the UlpiReadReg from the post:

    http://e2e.ti.com/support/embedded/f/353/p/100203/363005.aspx

    But it didn’t help…

    Probably I call UlpiReadReg and UlpiWriteReg with wrong arguments.  I found the address 0x4806280A (+ i * 0x100, where I = 0 to 2) in the OMAP TRM, and 0x0A in the USB3320 spec.

    Should I use different values there?

    Or maybe I need to add execution of this function somewhere else?

    Please, let me know.

    Thank you!

     

    Best regards,

    Zack

     

  • First argument that you are passing is incorrect -  you are using TLL mode addresses. It should be 0x48064800 (EHCI_BASE, regardless of port)

    Also, make sure port number you are passing corresponds to  your schematic.

    I would suggest reading a valid vendor id first (from reg address 0 & 1) before attempting to write anything

     

     

    Atul

  • Atul,

     

    Thank you for your help!

    It turned out to be very simple.  I ended up with the following solution:

    I’ve put the following line:

     

                UlpiWriteReg((DWORD)pPddObject->ioPortBase, 2, 0xb, 96);

     

    In two places:

    1. In function “HcdPdd_Init”, after “InitializeEHCI” call,
    2. In function “HcdPdd_IOControl”, at the end of “case D0:” (before break).

    And since I am writing to the 0xb register, I don’t have to read its previous value (not set bits are ignored).

     

    Thank you for your help again!

     

    Best regards,

    Zack