Hi experts,
We are now using the LogcPD OMAP35x_SOM-LV_DevKit. On this board the USB PHY is the tps65950. We have a problem as stated below.
Basically the problem is that we can not programmatically power on and off the VBUS of the MUSB port (once it is powered on, can not be powered off).
1) We have done the reset for the MUSB controller which is a must, so that it can correctly detect the ID state:
- Use the I2C interface of the tps65950 to reset the PHY
- Use the I2C interface to enable the ULPI ID pull-up The code used is as this:
omapUsbUlpiRegWrite(USB_ULPI_FUNCTION_CTL + USB_ULPI_SET_ADJ,
ULPI_FUNC_CTRL_RESET);
omapUsbUlpiRegWrite(USB_ULPI_OTG_CTL + USB_ULPI_SET_ADJ,
ULPI_OTG_CTL_ID_PULL_UP);
2) We got a problem of powering off VBUS. We want to have control of the VBUS to manually power it on or off, even there is a B-device connected (and I think this is why OTG provides SRP for, to allow B-device to ask the A-device to power on VBUS).
We've tried the following ways:
2.1) Clear the DEVCTL register SESSION bit (while an external device is connected). But once we do so, the MUSB controller becomes not working, the DEVCTL register can not report correct states; Even we set the SESSION bit back,the DEVCTL register keeps the value 0x99, which is not the state (should be A-device in host mode, but it indicates B-device in Device mode).
2.2) Use the I2C interface to access the ULPI registers directly, to clear the DRVVBUS bit of the OTG_CONTROL register. However, even the I2C access returns, if we read back the VBUS state, it still indicate that the VBUS is in its VBUSValid state (either using I2C access or using the DEVCTL VBUS field). This indicates we can not control the VBUS through the ULPI DRVVBUS bit.
2.3) I also tried to use the DISCHARG_VBUS bit of the ULPI OTG_CONTROL register, but I still get back it as VBUSValid.
So my question seems to be:
How can I correctly power on and off the VBUS while still keeping the ID pin state detection correct?
Thanks,
Cory