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.

Set USB Transceiver Register using ULPI when resume

Other Parts Discussed in Thread: OMAP3530, SYSCONFIG

Dear Experts,

Chip: OMAP3530, OS:WinCE6.14

I want to control smsc usb3220 ULPI register: "DrvVbus"

I can enable "DrvVbus" during HcdPdd_Init by UlpiWriteReg((DWORD)pPddObject->ioPortBase, 2, 0xa, 0x66); ( have correctly action )

However, if I go into suspend and resume, I need to set "DrvVbus" again.

Thus I  call UlpiReadReg/UlpiWriteReg during HcdPdd_PowerUp, but there is something wrong.

 

anyone can tell me when/where I can use UlpiReadReg/UlpiWriteReg to read/write ULPI register during resume ??

 

Below are my codes and error msgs:

=========================

my codes in HcdPdd_PowerUp:

if(UlpiReadReg((DWORD)pPddObject->ioPortBase, 2, 0x0, &ReadData)) RETAILMSG(1,(TEXT("Ulpi PHY Vendor ID Lo: %x\r\n"), ReadData));

else RETAILMSG(1,(TEXT("Read Ulpi PHY Vendor ID Lo Failed\r\n")));

if(UlpiReadReg((DWORD)pPddObject->ioPortBase, 2, 0x1, &ReadData)) RETAILMSG(1,(TEXT("Ulpi PHY Vendor ID Lo: %x\r\n"), ReadData));

else RETAILMSG(1,(TEXT("Read Ulpi PHY Vendor ID Hi Failed\r\n")));

if(UlpiReadReg((DWORD)pPddObject->ioPortBase, 2, 0xa, &ReadData)) RETAILMSG(1,(TEXT("Ulpi PHY OTG Control: %x\r\n"), ReadData));

else RETAILMSG(1,(TEXT("Read Ulpi PHY OTG Control Hi Failed\r\n")));

UlpiWriteReg((DWORD)pPddObject->ioPortBase, 2, 0xa, 0x66);

if(UlpiReadReg((DWORD)pPddObject->ioPortBase, 2, 0xa, &ReadData)) RETAILMSG(1,(TEXT("Ulpi PHY OTG Control: %x\r\n"), ReadData));

else RETAILMSG(1,(TEXT("Read Ulpi PHY OTG Control Hi Failed\r\n")));

=========================

error msgs:

Read Ulpi PHY Vendor ID Lo Failed

Read Ulpi PHY Vendor ID Hi Failed

Read Ulpi PHY OTG Control Hi Failed

ERROR: Power Handler function yield to low priority thread.

Read Ulpi PHY OTG Control Hi Failed

=========================

 

  • HcdPdd_PowerUp is the first function in the EHCI driver that is called when resuming from suspend. In this function, EHCI clocks are net yet enabled, which will likely explain why your ULPI accesses fail. I suggest you push your ULPI writes to the IOCTL_POWER_SET function, after the following code block:

                        switch (ReqDx)
                            {
                            case D0:
                          DeviceIoControl(pPddObject->hRootBus, IOCTL_BUS_REQUEST_CLOCK, &dwClock, sizeof(dwClock), NULL, 0, NULL, NULL);
                                SetDevicePowerState(pPddObject->hParentBusHandle, D0, NULL);
                                DelayMilliSeconds(200, FALSE);
                                RegVal = pUHHRegs->SYSCONFIG & ~(UHH_SYSCONFIG_MIDLEMODE(0x03) | UHH_SYSCONFIG_SIDLEMODE(0x03));
                                pUHHRegs->SYSCONFIG = RegVal | UHH_SYSCONFIG_MIDLEMODE(MIDLE_SMART) | UHH_SYSCONFIG_SIDLEMODE(SIDLE_SMART);
                                HcdMdd_PowerUp(pPddObject->lpvEHCDMddObject);
                                g_fOmapEhciSuspended = FALSE;
                                pPddObject->dwActualPowerState = ReqDx;
                                #if DUMP_REGS
                                    dumpRegs(pPddObject);
                                #endif

                                < put your code here >