Hi, we're using WinCE BSP 6.14, and using the HSUSB0 port on OMAP3530, TPS65930 as PHY.
the following is the process the BSP do when resume from suspend(sleep):
1)turn on the OTG PHY power in TPS65930
2)start the OTG controller clock on OMAP3530
3)if disconnected and A device is present, enable the interrupt and set the POWER_SOFTCONN bit in the POWER register.
4) in the ThreadRun function, we run to "if (m_pOTG->dwPwrMgmt == MODE_SYSTEM_RESUME)", call SoftResetMUSBController, and:
if (m_pTransceiver->IsBDeviceConnected() ||
((devCtl & DEVCTL_VBUS) == DEVCTL_VBUSVALID))
{
SessionRequest(TRUE, TRUE);
m_timeout = DO_USBCLK_TIMEOUT;
}
I think we should use "&&" instead of "||", because when when an A Device is connected,((devCtl & DEVCTL_VBUS) == DEVCTL_VBUSVALID) would be TRUE,.What will happen if we call "SessionRequest(TRUE, TRUE)" when an A Device is connected?
in our custom board, we can't connet to PC again when resume back, I guess SessionRequest(TRUE, TRUE) driver the VBUS to 5v, so even if we unplug the cable, TPS65930 can't detect the disconnection, the VBUS is kept driving by the TPS65930, so plug the cable again, nothing changed on VBUS.
In step 4), if a B Device is present( host mode ), it goes as follows:
m_bRequestSession = TRUE;
m_dwStatus |= STATUS_DISCONN_REQUEST;
And then call SoftResetMUSBController,
but m_bRequestSession, m_dwStatus will be reset in the SoftResetMUSBController. ... finally in the timeout handler, it will suspend the controller, no session is requested.