dwc2 gadget issues

Francesco Lavra francescolavra.fl at gmail.com
Tue Feb 28 03:43:58 PST 2017


Hi Vardan,

On 02/28/2017 09:41 AM, Vardan Mikayelyan wrote:
> On 2/27/2017 11:55 PM, Francesco Lavra wrote:
>> Hi,
>>
>> On 02/23/2017 08:27 PM, Heiko Stuebner wrote:
>>> 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.
>>
>> Thanks for your inputs.
>>
>> I was actually using the mainline kernel (4.8.1), in which the dwc2
>> driver wasn't working, that's why I went to your tree to pick up any
>> fixes or new features that might have been done. I also went to the
>> linux-usb tree for the same reason.
>>
>> Anyway, today I tried with the latest mainline release 4.10.0, and also
>> with linux-next. Unfortunately, still no luck: I can load a gadget
>> driver, which gets correctly bound to the OTG controller, but then
>> nothing happens if a USB host is connected to the OTG port.
>> I'm pasting below the dmesg contents (obtained with 4.10.0, with verbose
>> debugging enabled for the dwc2 driver) when a gadget driver is loaded,
>> in case you might spot something suspicious:
>>
>> [ 1147.035367] dwc2 ff580000.usb: bound driver g_audio
>> [ 1147.041203] dwc2 ff580000.usb: dwc2_hsotg_pullup: is_on: 1 op_state: 3
>> [ 1147.041250] dwc2 ff580000.usb: dwc2_core_reset()
>> [ 1147.041345] dwc2 ff580000.usb: FIFOs reset, timeout at 100
>> [ 1147.041405] dwc2 ff580000.usb: EP0: DIEPCTL0=0x00008000,
>> DOEPCTL0=0x00008000
>> [ 1147.041447] dwc2 ff580000.usb: gsintmsk now 0xd08c3cc4
>> [ 1147.041554] dwc2 ff580000.usb: DCTL=0x00000002
>> [ 1147.041631] dwc2 ff580000.usb: dwc2_hsotg_enqueue_setup: queueing
>> setup request
>> [ 1147.041692] dwc2 ff580000.usb: ep0: req ee241680: 8 at ee241198, noi=0,
>> zero=0, snok=0
>> [ 1147.041757] dwc2 ff580000.usb: dwc2_hsotg_start_req:
>> DxEPCTL=0x80008000, ep 0, dir out
>> [ 1147.041799] dwc2 ff580000.usb: ureq->length:8 ureq->actual:0
>> [ 1147.041896] dwc2 ff580000.usb: dwc2_hsotg_start_req: 1 at 8/8,
>> 0x00080008 => 0x00000b10
>> [ 1147.041975] dwc2 ff580000.usb: dwc2_hsotg_start_req: 2e243000 pad =>
>> 0x00000b14
>> [ 1147.042014] dwc2 ff580000.usb: ep0 state:0
>> [ 1147.042055] dwc2 ff580000.usb: dwc2_hsotg_start_req: DxEPCTL=0x80008000
>> [ 1147.042097] dwc2 ff580000.usb: dwc2_hsotg_start_req: DXEPCTL=0x80008000
>> [ 1147.042169] dwc2 ff580000.usb: EP0: DIEPCTL0=0x00008000,
>> DOEPCTL0=0x80008000
>>
>> Thanks,
>> Francesco
>> --
>
> Hi Francesco,
>
> Could you please provide full log (with debugs enabled) from DWC2 driver
> loading to issue point? Two logs are not giving us the full picture.

The full log from the DWC2 driver is below:

[    1.498030] dwc2 ff580000.usb: ff580000.usb supply vusb_d not found, 
using dummy regulator
[    1.507431] dwc2 ff580000.usb: ff580000.usb supply vusb_a not found, 
using dummy regulator
[    1.880012] dwc2 ff580000.usb: dwc2_check_param_tx_fifo_sizes: 
Invalid parameter g-tx-fifo-size, setting to default average
[    1.892596] dwc2 ff580000.usb: EPs: 10, dedicated fifos, 972 entries 
in SPRAM
[    1.901018] dwc2 ff580000.usb: DCFG=0x08100000, DCTL=0x00000002, 
DIEPMSK=00000000
[    1.909432] dwc2 ff580000.usb: GAHBCFG=0x00000000, GHWCFG1=0x00006664
[    1.916698] dwc2 ff580000.usb: GRXFSIZ=0x00000400, GNPTXFSIZ=0x00100400
[    1.924161] dwc2 ff580000.usb: DPTx[1] FSize=256, StAddr=0x00000410
[    1.931224] dwc2 ff580000.usb: DPTx[2] FSize=256, StAddr=0x00000900
[    1.938261] dwc2 ff580000.usb: DPTx[3] FSize=256, StAddr=0x00000a00
[    1.945318] dwc2 ff580000.usb: DPTx[4] FSize=256, StAddr=0x00000b00
[    1.952375] dwc2 ff580000.usb: DPTx[5] FSize=256, StAddr=0x00000c00
[    1.959410] dwc2 ff580000.usb: DPTx[6] FSize=256, StAddr=0x00000d00
[    1.966456] dwc2 ff580000.usb: DPTx[7] FSize=0, StAddr=0x00000e00
[    1.973317] dwc2 ff580000.usb: DPTx[8] FSize=0, StAddr=0x00000f00
[    1.980180] dwc2 ff580000.usb: DPTx[9] FSize=256, StAddr=0x00000410
[    1.987216] dwc2 ff580000.usb: ep0-in: EPCTL=0x00008800, 
SIZ=0x00000000, DMA=0x379a4f2d
[    1.996232] dwc2 ff580000.usb: ep0-out: EPCTL=0x00008000, 
SIZ=0x00000000, DMA=0xe3103c4f
[    2.005352] dwc2 ff580000.usb: ep1-in: EPCTL=0x00001000, 
SIZ=0x00000000, DMA=0x5cf9a35d
[    2.014369] dwc2 ff580000.usb: ep1-out: EPCTL=0x00000000, 
SIZ=0x00000000, DMA=0x8b00a168
[    2.023482] dwc2 ff580000.usb: ep2-in: EPCTL=0x00000000, 
SIZ=0x00000000, DMA=0xfef360cf
[    2.032497] dwc2 ff580000.usb: ep2-out: EPCTL=0x00000000, 
SIZ=0x00000000, DMA=0x9f637bc4
[    2.041609] dwc2 ff580000.usb: ep3-in: EPCTL=0x00002000, 
SIZ=0x00000000, DMA=0xf03470c5
[    2.050625] dwc2 ff580000.usb: ep3-out: EPCTL=0x00000000, 
SIZ=0x00000000, DMA=0x8b00a168
[    2.059715] dwc2 ff580000.usb: ep4-in: EPCTL=0x00000000, 
SIZ=0x00000000, DMA=0xfef360cf
[    2.068731] dwc2 ff580000.usb: ep4-out: EPCTL=0x00000000, 
SIZ=0x00000000, DMA=0xb6c8c271
[    2.077843] dwc2 ff580000.usb: ep5-in: EPCTL=0x00003000, 
SIZ=0x00000000, DMA=0x84245611
[    2.086858] dwc2 ff580000.usb: ep5-out: EPCTL=0x00000000, 
SIZ=0x00000000, DMA=0x8b00a168
[    2.095970] dwc2 ff580000.usb: ep6-in: EPCTL=0x00000000, 
SIZ=0x00000000, DMA=0xfef360cf
[    2.104986] dwc2 ff580000.usb: ep6-out: EPCTL=0x00000000, 
SIZ=0x00000000, DMA=0x0a6c1c90
[    2.114102] dwc2 ff580000.usb: ep7-in: EPCTL=0x00004000, 
SIZ=0x00000000, DMA=0xaccb75ec
[    2.123111] dwc2 ff580000.usb: ep7-out: EPCTL=0x00000000, 
SIZ=0x00000000, DMA=0x8b00a168
[    2.132222] dwc2 ff580000.usb: ep8-in: EPCTL=0x00004800, 
SIZ=0x00000000, DMA=0x4625773c
[    2.141254] dwc2 ff580000.usb: ep8-out: EPCTL=0x00000000, 
SIZ=0x00000000, DMA=0x437c9154
[    2.150371] dwc2 ff580000.usb: ep9-in: EPCTL=0x00005000, 
SIZ=0x00000000, DMA=0x9cb1c89c
[    2.159365] dwc2 ff580000.usb: ep9-out: EPCTL=0x00000000, 
SIZ=0x00000000, DMA=0x6ec79617
[    2.168476] dwc2 ff580000.usb: DVBUSDIS=0x00000b8f, DVBUSPULSE=000002c6
[    2.175996] usb 1-1: new high-speed USB device number 2 using dwc2
[    2.176105] dwc2 ff580000.usb: DWC OTG Controller
[    2.176147] dwc2 ff580000.usb: new USB bus registered, assigned bus 
number 2
[    2.176195] dwc2 ff580000.usb: irq 41, io mem 0xff580000
[    2.176450] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002
[    2.176462] usb usb2: New USB device strings: Mfr=3, Product=2, 
SerialNumber=1
[    2.176470] usb usb2: Product: DWC OTG Controller
[    2.176478] usb usb2: Manufacturer: Linux 4.10.0+ dwc2_hsotg
[    2.176485] usb usb2: SerialNumber: ff580000.usb
[ 1147.035367] dwc2 ff580000.usb: bound driver g_audio
[ 1147.041203] dwc2 ff580000.usb: dwc2_hsotg_pullup: is_on: 1 op_state: 3
[ 1147.041250] dwc2 ff580000.usb: dwc2_core_reset()
[ 1147.041345] dwc2 ff580000.usb: FIFOs reset, timeout at 100
[ 1147.041405] dwc2 ff580000.usb: EP0: DIEPCTL0=0x00008000, 
DOEPCTL0=0x00008000
[ 1147.041447] dwc2 ff580000.usb: gsintmsk now 0xd08c3cc4
[ 1147.041554] dwc2 ff580000.usb: DCTL=0x00000002
[ 1147.041631] dwc2 ff580000.usb: dwc2_hsotg_enqueue_setup: queueing 
setup request
[ 1147.041692] dwc2 ff580000.usb: ep0: req ee241680: 8 at ee241198, noi=0, 
zero=0, snok=0
[ 1147.041757] dwc2 ff580000.usb: dwc2_hsotg_start_req: 
DxEPCTL=0x80008000, ep 0, dir out
[ 1147.041799] dwc2 ff580000.usb: ureq->length:8 ureq->actual:0
[ 1147.041896] dwc2 ff580000.usb: dwc2_hsotg_start_req: 1 at 8/8, 
0x00080008 => 0x00000b10
[ 1147.041975] dwc2 ff580000.usb: dwc2_hsotg_start_req: 2e243000 pad => 
0x00000b14
[ 1147.042014] dwc2 ff580000.usb: ep0 state:0
[ 1147.042055] dwc2 ff580000.usb: dwc2_hsotg_start_req: DxEPCTL=0x80008000
[ 1147.042097] dwc2 ff580000.usb: dwc2_hsotg_start_req: DXEPCTL=0x80008000
[ 1147.042169] dwc2 ff580000.usb: EP0: DIEPCTL0=0x00008000, 
DOEPCTL0=0x80008000

Thanks,
Francesco

> Thanks,
> Vardan.
>



More information about the linux-arm-kernel mailing list