dwc2 gadget issues (was: RK3288 USB OTG controller in peripheral mode)

Heiko Stuebner heiko at sntech.de
Thu Feb 23 11:27:07 PST 2017


Hi Francesco,

Am Donnerstag, 23. Februar 2017, 19:11:37 CET schrieb Francesco Lavra:
> I'm having trouble getting the RK3288 OTG controller (the one at
> ff580000) to work in peripheral mode. I'm using a Firefly Reload board,
> and I know the hardware is fine because I can successfully use the port
> in device mode with U-Boot's mass storage gadget driver.
> Under Linux, the OTG port works fine when used in host mode, but fails
> to work in device mode: nothing happens when the a USB host is plugged
> into the OTG port, not even a single interrupt is generated by the
> controller. I'm using the latest device tree definitions from
> git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip.git.

you shouldn't use my tree as base for any real work :-) . Best to use the 
regular mainline kernel or alternatively try linux-next to get all recent usb 
changes schedules for the next release.


> Tried with different gadget drivers (g_audio, g_ether, g_mass_storage),
> but it makes no difference.
> Tried also forcing peripheral mode in the device tree, with dr_mode =
> "peripheral", to no avail.
> 
> Are there any known problems with the RK3288 OTG controller?

In general the controller is a dwc2 and there was quite some activity on the 
driver recently. So maybe really try linux-next first and see if any of the 
changes included there improve the situation.

I've included some usb lists + people, maybe they know if anything recent may 
have changed things.


> Here is the relevant log when the dwc2 driver is loaded at boot:
> 
> [    1.376935] ff580000.usb supply vusb_d not found, using dummy regulator
> [    1.383683] ff580000.usb supply vusb_a not found, using dummy regulator
> [    1.390627] dwc2 ff580000.usb: dwc2_core_reset() HANG! Soft Reset
> GRSTCTL=80000001
> [    1.509048] dwc2 ff580000.usb: dwc2_wait_for_mode: Couldn't set
> device mode
> [    1.750626] dwc2 ff580000.usb: dwc2_check_param_tx_fifo_sizes:
> Invalid parameter g-tx-fifo-size, setting to default average
> [    1.761828] dwc2 ff580000.usb: dwc2_check_param_tx_fifo_sizes:
> Invalid parameter g_tx_fifo_size[1]=104
> [    1.771192] dwc2 ff580000.usb: dwc2_check_param_tx_fifo_sizes:
> Invalid parameter g_tx_fifo_size[2]=104
> [    1.780529] dwc2 ff580000.usb: dwc2_check_param_tx_fifo_sizes:
> Invalid parameter g_tx_fifo_size[3]=104
> [    1.789888] dwc2 ff580000.usb: dwc2_check_param_tx_fifo_sizes:
> Invalid parameter g_tx_fifo_size[4]=104
> [    1.799245] dwc2 ff580000.usb: dwc2_check_param_tx_fifo_sizes:
> Invalid parameter g_tx_fifo_size[5]=104
> [    1.808614] dwc2 ff580000.usb: dwc2_check_param_tx_fifo_sizes:
> Invalid parameter g_tx_fifo_size[6]=104
> [    1.817993] usb 1-1: new high-speed USB device number 2 using dwc2
> [    1.824390] dwc2 ff580000.usb: EPs: 10, dedicated fifos, 972 entries
> in SPRAM
> [    1.832098] dwc2 ff580000.usb: DWC OTG Controller
> [    1.836924] dwc2 ff580000.usb: new USB bus registered, assigned bus
> number 2
> [    1.844125] dwc2 ff580000.usb: irq 41, io mem 0xff580000
> [    1.849747] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002
> [    1.856598] usb usb2: New USB device strings: Mfr=3, Product=2,
> SerialNumber=1
> [    1.863875] usb usb2: Product: DWC OTG Controller
> [    1.868601] usb usb2: Manufacturer: Linux 4.8.1+ dwc2_hsotg
> [    1.874215] usb usb2: SerialNumber: ff580000.usb
> 
> and this is what I get when I load a gadget driver (in this case, g_audio):
> 
> [   19.848590] dwc2 ff580000.usb: bound driver g_audio
> [   19.853816] dwc2 ff580000.usb: dwc2_hsotg_enqueue_setup: failed queue
> (-11)


Heiko



More information about the Linux-rockchip mailing list