Hi,
we are designing a custom board based on the BeagleBoneBlack (CPU is AM3358). The software used is the PSP for Android TI_Android_JB_4_2_2_DevKit_4_1_1, Kernel 3.2. Currently I encounter an USB issue that I do not fully understand. I can neither put the android to sleep nor do a software power down. Beyond that USB seems to work fine.
The USB design differs a bit from the BBB:
We use a TPS63000 to generate the +5V (USBx_VBUS), enabled by USBx_DRVVBUS.
USB1 is host only, USB0 is configured as USB OTG. One difference here is the usage of two physically separated ports for the OTG port: One USB-A slot for host mode and one USB-B slot for device mode.
The signals USB0_ID, USB0_VBUS, D_N and D_P are switched by a relay. USB0_ID is switched to GND if in host mode (default) and is switched to NC if in device mode. The relay is controlled by USB_Device_Vdd (5V applied by external host).
The DRVVBUS pins are muxed and the omap_musb_board_data looks like this:
static struct omap_musb_board_data musb_board_data = {
.interface_type = MUSB_INTERFACE_ULPI,
/*
* mode[0:3] = USB0PORT's mode
* mode[4:7] = USB1PORT's mode
*/
.mode = (MUSB_HOST << 4) | MUSB_OTG,
.power = 500,
.instances = 1,
};
Terminal when trying to sleep:
[ 793.648895] pm_op(): platform_pm_suspend+0x0/0x6c returns -16
[ 793.654968] PM: Device musb-hdrc.0 failed to suspend: error -16
Terminal on shutdown:
[ 1978.190185] musb-hdrc musb-hdrc.1: remove, state 1
[ 1978.195343] usb usb1: USB disconnect, device number 1
[ 1978.200622] usb 1-1: USB disconnect, device number 3
after that message, the system freezes and the LCD remains active.
I have traced down the problem to the USB-Controller and its role assumption for musb-hdrc.0:
On power on, without anything connected to usb, the state of /proc/driver/musb_hdrc.0 is as following:
Status: MHDRC, Mode=Peripheral (Power=e0, DevCtl=19)
OTG state: b_idle; active
I would have expected "Mode=Host" here. "Active" seems wrong, too. This would be an explanation for "error -16" I get when trying to sleep, but I don't know the origin for that mode.
If I plug a device into this port (touchscreen controller), the state of musb_hdrc.0 changes correctly:
Status: MHDRC, Mode=Host (Power=e0, DevCtl=5d)
OTG state: a_host; active
Shutdown works with that. Sleep is entered, system reacts to nothing but reset.
Removing the device again:
Status: MHDRC, Mode=Peripheral (Power=e0, DevCtl=19)
OTG state: b_idle; inactive
Shutdown works with that. Sleep is entered, system reacts to nothing but reset.
My questions:
- What can cause the usb controller/driver to assume that its in active peripheral mode?
- Why can't I wake my board from sleep? PWR_BTN, usb touchscreen and terminal didn't work.
I'm thankful for any help and will try to provide any information necessary that could help solving my problem.