diff mbox series

[RFC] usb: dwc2: Run the core connect in dwc2_hcd_init()

Message ID 20200413143107.181669-1-marex@denx.de (mailing list archive)
State New, archived
Headers show
Series [RFC] usb: dwc2: Run the core connect in dwc2_hcd_init() | expand

Commit Message

Marek Vasut April 13, 2020, 2:31 p.m. UTC
On STM32MP1 without the STUSB1600 USB-C chip (i.e. with plain USB-OTG
micro-B plug with ID and VBUS detection), the USB OTG port only works
if a micro-B device (e.g. a USB stick) is plugged in first. Once this
is done, both micro-B device and host (e.g. a PC via a USB A-to-microB
cable) are correctly detected and recognized. If a USB host is plugged
in first (e.g. a PC), then the PC does not detect the STM32MP1 at all.

By running the core connect code in dwc2_hcd_init(), both device and
host are detected and the USB works as expected. However, it is not
clear whether this is the correct solution.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Amelie Delaunay <amelie.delaunay@st.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Cc: Minas Harutyunyan <hminas@synopsys.com>
To: linux-usb@vger.kernel.org
---
 drivers/usb/dwc2/hcd.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Minas Harutyunyan April 13, 2020, 2:45 p.m. UTC | #1
Hi,

On 4/13/2020 6:31 PM, Marek Vasut wrote:
> On STM32MP1 without the STUSB1600 USB-C chip (i.e. with plain USB-OTG

Could you please provide GSNPSID, GHWCFG1-4 register values for STM32MP1.

> micro-B plug with ID and VBUS detection), the USB OTG port only works
> if a micro-B device (e.g. a USB stick) is plugged in first. Once this
> is done, both micro-B device and host (e.g. a PC via a USB A-to-microB
> cable) are correctly detected and recognized. If a USB host is plugged
> in first (e.g. a PC), then the PC does not detect the STM32MP1 at all.
> 
> By running the core connect code in dwc2_hcd_init(), both device and
> host are detected and the USB works as expected. However, it is not
> clear whether this is the correct solution.
> 
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Amelie Delaunay <amelie.delaunay@st.com>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> Cc: Minas Harutyunyan <hminas@synopsys.com>
> To: linux-usb@vger.kernel.org
> ---
>   drivers/usb/dwc2/hcd.c | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c
> index b90f858af960..ead605efeb24 100644
> --- a/drivers/usb/dwc2/hcd.c
> +++ b/drivers/usb/dwc2/hcd.c
> @@ -5237,6 +5237,11 @@ int dwc2_hcd_init(struct dwc2_hsotg *hsotg)
>   
>   	dwc2_enable_global_interrupts(hsotg);
>   
> +	dwc2_hsotg_core_init_disconnected(hsotg, false);
> +	/* Enable ACG feature in device mode,if supported */
> +	dwc2_enable_acg(hsotg);
> +	dwc2_hsotg_core_connect(hsotg);
> +
>   	return 0;
>   
>   error4:
> 

Thanks,
Minas
Marek Vasut April 13, 2020, 2:54 p.m. UTC | #2
On 4/13/20 4:45 PM, Minas Harutyunyan wrote:
> Hi,

Hi,

> On 4/13/2020 6:31 PM, Marek Vasut wrote:
>> On STM32MP1 without the STUSB1600 USB-C chip (i.e. with plain USB-OTG
> 
> Could you please provide GSNPSID, GHWCFG1-4 register values for STM32MP1.

GSNPSID = 0x4f54330a
GHWCFG1 = 0x00000000
GHWCFG2 = 0x228fe150
GHWCFG3 = 0x03b892e8
GHWCFG4 = 0xe3f00030
Minas Harutyunyan April 13, 2020, 3:27 p.m. UTC | #3
Hi,

On 4/13/2020 6:54 PM, Marek Vasut wrote:
> On 4/13/20 4:45 PM, Minas Harutyunyan wrote:
>> Hi,
> 
> Hi,
> 
>> On 4/13/2020 6:31 PM, Marek Vasut wrote:
>>> On STM32MP1 without the STUSB1600 USB-C chip (i.e. with plain USB-OTG
>>
>> Could you please provide GSNPSID, GHWCFG1-4 register values for STM32MP1.
> 
> GSNPSID = 0x4f54330a
> GHWCFG1 = 0x00000000
> GHWCFG2 = 0x228fe150
> GHWCFG3 = 0x03b892e8
> GHWCFG4 = 0xe3f00030
> 
STM32MP1 core doesn't support ACG feature: GHWCFG4_ACG_SUPPORTED = 0. 
So, in your patch for STM32MP1 at least these lines are no meaning:

+	/* Enable ACG feature in device mode,if supported */
+	dwc2_enable_acg(hsotg);

Looks like you just copied this chirp from dwc2_conn_id_status_change() 
function.

dwc2_hsotg_core_init_disconnected() function is device mode function, 
not sure that it's safe to call it for host mode in dwc2_hcd_init().

Thanks,
Minas
Marek Vasut April 13, 2020, 5 p.m. UTC | #4
On 4/13/20 5:27 PM, Minas Harutyunyan wrote:
> Hi,

Hi,

> On 4/13/2020 6:54 PM, Marek Vasut wrote:
>> On 4/13/20 4:45 PM, Minas Harutyunyan wrote:
>>> Hi,
>>
>> Hi,
>>
>>> On 4/13/2020 6:31 PM, Marek Vasut wrote:
>>>> On STM32MP1 without the STUSB1600 USB-C chip (i.e. with plain USB-OTG
>>>
>>> Could you please provide GSNPSID, GHWCFG1-4 register values for STM32MP1.
>>
>> GSNPSID = 0x4f54330a
>> GHWCFG1 = 0x00000000
>> GHWCFG2 = 0x228fe150
>> GHWCFG3 = 0x03b892e8
>> GHWCFG4 = 0xe3f00030
>>
> STM32MP1 core doesn't support ACG feature: GHWCFG4_ACG_SUPPORTED = 0. 
> So, in your patch for STM32MP1 at least these lines are no meaning:
> 
> +	/* Enable ACG feature in device mode,if supported */
> +	dwc2_enable_acg(hsotg);

The comment says it enables the ACG only if it's supported.

> Looks like you just copied this chirp from dwc2_conn_id_status_change() 
> function.

Yes, that's correct, verbatim.

> dwc2_hsotg_core_init_disconnected() function is device mode function, 
> not sure that it's safe to call it for host mode in dwc2_hcd_init().

OK well, if I don't use this patch and I plug in a USB cable from the
host PC, then the STM32MP1 isn't detected by the host PC. Do you have
any idea what the correct fix would be then ?
Minas Harutyunyan April 14, 2020, 7:14 a.m. UTC | #5
Hi,

On 4/13/2020 9:00 PM, Marek Vasut wrote:
> On 4/13/20 5:27 PM, Minas Harutyunyan wrote:
>> Hi,
> 
> Hi,
> 
>> On 4/13/2020 6:54 PM, Marek Vasut wrote:
>>> On 4/13/20 4:45 PM, Minas Harutyunyan wrote:
>>>> Hi,
>>>
>>> Hi,
>>>
>>>> On 4/13/2020 6:31 PM, Marek Vasut wrote:
>>>>> On STM32MP1 without the STUSB1600 USB-C chip (i.e. with plain USB-OTG
>>>>
>>>> Could you please provide GSNPSID, GHWCFG1-4 register values for STM32MP1.
>>>
>>> GSNPSID = 0x4f54330a
>>> GHWCFG1 = 0x00000000
>>> GHWCFG2 = 0x228fe150
>>> GHWCFG3 = 0x03b892e8
>>> GHWCFG4 = 0xe3f00030
>>>
>> STM32MP1 core doesn't support ACG feature: GHWCFG4_ACG_SUPPORTED = 0.
>> So, in your patch for STM32MP1 at least these lines are no meaning:
>>
>> +	/* Enable ACG feature in device mode,if supported */
>> +	dwc2_enable_acg(hsotg);
> 
> The comment says it enables the ACG only if it's supported.
> 
>> Looks like you just copied this chirp from dwc2_conn_id_status_change()
>> function.
> 
> Yes, that's correct, verbatim.
> 
>> dwc2_hsotg_core_init_disconnected() function is device mode function,
>> not sure that it's safe to call it for host mode in dwc2_hcd_init().
> 
> OK well, if I don't use this patch and I plug in a USB cable from the
> host PC, then the STM32MP1 isn't detected by the host PC. Do you have
> any idea what the correct fix would be then ?
> 

Please provide without your patch:
1. debugfs: params and hw_params
2. debug log
3. regdump before and after connecting device to host where issue seen.

Thanks,
Minas
Marek Vasut April 14, 2020, 12:18 p.m. UTC | #6
On 4/14/20 9:14 AM, Minas Harutyunyan wrote:
> Hi,
> 
> On 4/13/2020 9:00 PM, Marek Vasut wrote:
>> On 4/13/20 5:27 PM, Minas Harutyunyan wrote:
>>> Hi,
>>
>> Hi,
>>
>>> On 4/13/2020 6:54 PM, Marek Vasut wrote:
>>>> On 4/13/20 4:45 PM, Minas Harutyunyan wrote:
>>>>> Hi,
>>>>
>>>> Hi,
>>>>
>>>>> On 4/13/2020 6:31 PM, Marek Vasut wrote:
>>>>>> On STM32MP1 without the STUSB1600 USB-C chip (i.e. with plain USB-OTG
>>>>>
>>>>> Could you please provide GSNPSID, GHWCFG1-4 register values for STM32MP1.
>>>>
>>>> GSNPSID = 0x4f54330a
>>>> GHWCFG1 = 0x00000000
>>>> GHWCFG2 = 0x228fe150
>>>> GHWCFG3 = 0x03b892e8
>>>> GHWCFG4 = 0xe3f00030
>>>>
>>> STM32MP1 core doesn't support ACG feature: GHWCFG4_ACG_SUPPORTED = 0.
>>> So, in your patch for STM32MP1 at least these lines are no meaning:
>>>
>>> +	/* Enable ACG feature in device mode,if supported */
>>> +	dwc2_enable_acg(hsotg);
>>
>> The comment says it enables the ACG only if it's supported.
>>
>>> Looks like you just copied this chirp from dwc2_conn_id_status_change()
>>> function.
>>
>> Yes, that's correct, verbatim.
>>
>>> dwc2_hsotg_core_init_disconnected() function is device mode function,
>>> not sure that it's safe to call it for host mode in dwc2_hcd_init().
>>
>> OK well, if I don't use this patch and I plug in a USB cable from the
>> host PC, then the STM32MP1 isn't detected by the host PC. Do you have
>> any idea what the correct fix would be then ?
>>
> 
> Please provide without your patch:
> 1. debugfs: params and hw_params

# cat /sys/kernel/debug/usb/49000000.usb-otg/hw_params
op_mode                       : 0
arch                          : 2
dma_desc_enable               : 1
enable_dynamic_fifo           : 1
en_multiple_tx_fifo           : 1
rx_fifo_size                  : 1024
host_nperio_tx_fifo_size      : 1024
dev_nperio_tx_fifo_size       : 1024
host_perio_tx_fifo_size       : 1024
nperio_tx_q_depth             : 4
host_perio_tx_q_depth         : 4
dev_token_q_depth             : 8
max_transfer_size             : 524287
max_packet_count              : 1023
host_channels                 : 16
hs_phy_type                   : 1
fs_phy_type                   : 1
i2c_enable                    : 0
num_dev_ep                    : 8
num_dev_perio_in_ep           : 0
total_fifo_size               : 952
power_optimized               : 1
utmi_phy_data_width           : 0
snpsid                        : 0x4f54330a
dev_ep_dirs                   : 0x0

# cat /sys/kernel/debug/usb/49000000.usb-otg/params
otg_cap                       : 2
dma_desc_enable               : 0
dma_desc_fs_enable            : 0
speed                         : 0
enable_dynamic_fifo           : 1
en_multiple_tx_fifo           : 1
host_rx_fifo_size             : 440
host_nperio_tx_fifo_size      : 256
host_perio_tx_fifo_size       : 256
max_transfer_size             : 524287
max_packet_count              : 1023
host_channels                 : 16
phy_type                      : 1
phy_utmi_width                : 8
phy_ulpi_ddr                  : 0
phy_ulpi_ext_vbus             : 0
i2c_enable                    : 0
ipg_isoc_en                   : 0
ulpi_fs_ls                    : 0
host_support_fs_ls_low_power  : 0
host_ls_low_power_phy_clk     : 0
ts_dline                      : 0
reload_ctl                    : 1
ahbcfg                        : 0x2
uframe_sched                  : 1
external_id_pin_ctl           : 0
power_down                    : 0
lpm                           : 1
lpm_clock_gating              : 1
besl                          : 1
hird_threshold_en             : 1
hird_threshold                : 4
service_interval              : 0
host_dma                      : 1
g_dma                         : 1
g_dma_desc                    : 1
g_rx_fifo_size                : 256
g_np_tx_fifo_size             : 32
g_tx_fifo_size[0]             : 0
g_tx_fifo_size[1]             : 128
g_tx_fifo_size[2]             : 128
g_tx_fifo_size[3]             : 64
g_tx_fifo_size[4]             : 64
g_tx_fifo_size[5]             : 64
g_tx_fifo_size[6]             : 64
g_tx_fifo_size[7]             : 32
g_tx_fifo_size[8]             : 32
g_tx_fifo_size[9]             : 0
g_tx_fifo_size[10]            : 0
g_tx_fifo_size[11]            : 0
g_tx_fifo_size[12]            : 0
g_tx_fifo_size[13]            : 0
g_tx_fifo_size[14]            : 0
g_tx_fifo_size[15]            : 0

> 2. debug log

What kind of debug log ?

> 3. regdump before and after connecting device to host where issue seen.

Before:
# cat /sys/kernel/debug/usb/49000000.usb-otg/regdump
[  279.158994] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.165324] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.173123] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.180893] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.188640] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.196381] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.204120] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.211944] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.219671] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.227429] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.235172] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.242976] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.250717] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.258493] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.266266] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.273985] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.281769] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.289546] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.297319] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.305032] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.312816] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.320575] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.328357] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.336102] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.343840] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.351622] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.359414] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.367148] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.374886] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.382669] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.390457] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.398194] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.405934] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.413716] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.421494] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.429243] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.437004] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.444746] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.452550] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.460302] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.468055] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.475795] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.483596] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.491344] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.499104] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.506886] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.514608] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.522392] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.530153] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.537934] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.545656] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.553441] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.561208] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.568987] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.576731] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.584470] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.592259] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.600036] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.607782] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.615523] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.623304] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.631082] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.638831] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.646592] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.654334] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.662145] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.669884] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.677643] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.685383] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.693195] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.700928] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.708692] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.716473] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.724195] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.731979] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.739739] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.747519] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.755241] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.763034] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.770783] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.778567] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.786311] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.794050] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.801838] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.809613] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.817358] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.825097] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.832879] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.840657] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.848405] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.856175] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.863907] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.871711] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.879457] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.887217] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.894959] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.902768] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.910507] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.918266] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.926008] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.933810] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.941550] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.949316] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.957105] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.964818] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.972602] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.980365] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.988145] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  279.995867] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  280.003657] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  280.011407] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  280.019192] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  280.026937] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  280.034675] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  280.042458] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  280.050240] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  280.057995] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  280.065727] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  280.073512] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
GOTGCTL = 0x00010000
GOTGINT = 0x00000000
GAHBCFG = 0x00000023
GUSBCFG = 0x00001400
GRSTCTL = 0x80000000
GINTSTS = 0x04000020
GINTMSK = 0xd8000806
GRXSTSR = 0x00000000
GRXFSIZ = 0x00000400
GNPTXFSIZ = 0x04000400
GNPTXSTS = 0x00080400
GI2CCTL = 0x00000000
GPVNDCTL = 0x00000000
GGPIO = 0x00600000
GUID = 0x00004000
GSNPSID = 0x4f54330a
GHWCFG1 = 0x00000000
GHWCFG2 = 0x228fe150
GHWCFG3 = 0x03b892e8
GHWCFG4 = 0xe3f00030
GLPMCFG = 0x00000000
GPWRDN = 0x00200010
GDFIFOCFG = 0x03b80400
ADPCTL = 0x00000000
HPTXFSIZ = 0x00000000
DPTXFSIZN(1) = 0x04000800
DPTXFSIZN(2) = 0x04000c00
DPTXFSIZN(3) = 0x04001000
DPTXFSIZN(4) = 0x04001400
DPTXFSIZN(5) = 0x04001800
DPTXFSIZN(6) = 0x04001c00
DPTXFSIZN(7) = 0x04002000
DPTXFSIZN(8) = 0x04002400
DPTXFSIZN(9) = 0x04000800
DPTXFSIZN(10) = 0x04000c00
DPTXFSIZN(11) = 0x04001000
DPTXFSIZN(12) = 0x04001400
DPTXFSIZN(13) = 0x04001800
DPTXFSIZN(14) = 0x04001c00
DPTXFSIZN(15) = 0x04002000
DCFG = 0x08100000
DCTL = 0x00000002
DSTS = 0x00000002
DIEPMSK = 0x00000000
DOEPMSK = 0x00000000
DAINT = 0x00000000
DAINTMSK = 0x00000000
DTKNQR1 = 0x00000000
DTKNQR2 = 0x00000000
DTKNQR3 = 0x0c100020
DTKNQR4 = 0x00000000
DVBUSDIS = 0x000017d7
DVBUSPULSE = 0x000005b8
DIEPCTL(0) = 0x00008000
DIEPCTL(1) = 0x00000000
DIEPCTL(2) = 0x00000000
DIEPCTL(3) = 0x00000000
DIEPCTL(4) = 0x00000000
DIEPCTL(5) = 0x00000000
DIEPCTL(6) = 0x00000000
DIEPCTL(7) = 0x00000000
DIEPCTL(8) = 0x00000000
DIEPCTL(9) = 0x00000000
DIEPCTL(10) = 0x00000000
DIEPCTL(11) = 0x00000000
DIEPCTL(12) = 0x00000000
DIEPCTL(13) = 0x00000000
DIEPCTL(14) = 0x00000000
DIEPCTL(15) = 0x00000000
DOEPCTL(0) = 0x00008000
DOEPCTL(1) = 0x00000000
DOEPCTL(2) = 0x00000000
DOEPCTL(3) = 0x00000000
DOEPCTL(4) = 0x00000000
DOEPCTL(5) = 0x00000000
DOEPCTL(6) = 0x00000000
DOEPCTL(7) = 0x00000000
DOEPCTL(8) = 0x00000000
DOEPCTL(9) = 0x00000000
DOEPCTL(10) = 0x00000000
DOEPCTL(11) = 0x00000000
DOEPCTL(12) = 0x00000000
DOEPCTL(13) = 0x00000000
DOEPCTL(14) = 0x00000000
DOEPCTL(15) = 0x00000000
DIEPINT(0) = 0x00000080
DIEPINT(1) = 0x00000080
DIEPINT(2) = 0x00000080
DIEPINT(3) = 0x00000080
DIEPINT(4) = 0x00000080
DIEPINT(5) = 0x00000080
DIEPINT(6) = 0x00000080
DIEPINT(7) = 0x00000080
DIEPINT(8) = 0x00000080
DIEPINT(9) = 0x00000080
DIEPINT(10) = 0x00000080
DIEPINT(11) = 0x00000080
DIEPINT(12) = 0x00000080
DIEPINT(13) = 0x00000080
DIEPINT(14) = 0x00000080
DIEPINT(15) = 0x00000080
DOEPINT(0) = 0x00000000
DOEPINT(1) = 0x00000000
DOEPINT(2) = 0x00000000
DOEPINT(3) = 0x00000000
DOEPINT(4) = 0x00000000
DOEPINT(5) = 0x00000000
DOEPINT(6) = 0x00000000
DOEPINT(7) = 0x00000000
DOEPINT(8) = 0x00000000
DOEPINT(9) = 0x00000000
DOEPINT(10) = 0x00000000
DOEPINT(11) = 0x00000000
DOEPINT(12) = 0x00000000
DOEPINT(13) = 0x00000000
DOEPINT(14) = 0x00000000
DOEPINT(15) = 0x00000000
DIEPTSIZ(0) = 0x00000000
DIEPTSIZ(1) = 0x00000000
DIEPTSIZ(2) = 0x00000000
DIEPTSIZ(3) = 0x00000000
DIEPTSIZ(4) = 0x00000000
DIEPTSIZ(5) = 0x00000000
DIEPTSIZ(6) = 0x00000000
DIEPTSIZ(7) = 0x00000000
DIEPTSIZ(8) = 0x00000000
DIEPTSIZ(9) = 0x00000000
DIEPTSIZ(10) = 0x00000000
DIEPTSIZ(11) = 0x00000000
DIEPTSIZ(12) = 0x00000000
DIEPTSIZ(13) = 0x00000000
DIEPTSIZ(14) = 0x00000000
DIEPTSIZ(15) = 0x00000000
DOEPTSIZ(0) = 0x00000000
DOEPTSIZ(1) = 0x00000000
DOEPTSIZ(2) = 0x00000000
DOEPTSIZ(3) = 0x00000000
DOEPTSIZ(4) = 0x00000000
DOEPTSIZ(5) = 0x00000000
DOEPTSIZ(6) = 0x00000000
DOEPTSIZ(7) = 0x00000000
DOEPTSIZ(8) = 0x00000000
DOEPTSIZ(9) = 0x00000000
DOEPTSIZ(10) = 0x00000000
DOEPTSIZ(11) = 0x00000000
DOEPTSIZ(12) = 0x00000000
DOEPTSIZ(13) = 0x00000000
DOEPTSIZ(14) = 0x00000000
DOEPTSIZ(15) = 0x00000000
DIEPDMA(0) = 0x79daaf9c
DIEPDMA(1) = 0xc8ad1317
DIEPDMA(2) = 0xf56293e7
DIEPDMA(3) = 0x7e374f85
DIEPDMA(4) = 0xbe22b68d
DIEPDMA(5) = 0xa60f065a
DIEPDMA(6) = 0xbafafaf5
DIEPDMA(7) = 0x892900fb
DIEPDMA(8) = 0xa2c3caca
DIEPDMA(9) = 0x58d5ed04
DIEPDMA(10) = 0x58d5ed04
DIEPDMA(11) = 0x58d5ed04
DIEPDMA(12) = 0x58d5ed04
DIEPDMA(13) = 0x58d5ed04
DIEPDMA(14) = 0x58d5ed04
DIEPDMA(15) = 0x58d5ed04
DOEPDMA(0) = 0xa167db6c
DOEPDMA(1) = 0x681b357d
DOEPDMA(2) = 0x503148e2
DOEPDMA(3) = 0x9476575a
DOEPDMA(4) = 0xb098e0de
DOEPDMA(5) = 0xb8bc774f
DOEPDMA(6) = 0x58d5ed04
DOEPDMA(7) = 0x8fbaf0d9
DOEPDMA(8) = 0xe7b6af62
DOEPDMA(9) = 0x22f87fc6
DOEPDMA(10) = 0x22f87fc6
DOEPDMA(11) = 0x22f87fc6
DOEPDMA(12) = 0x22f87fc6
DOEPDMA(13) = 0x22f87fc6
DOEPDMA(14) = 0x22f87fc6
DOEPDMA(15) = 0x22f87fc6
DTXFSTS(0) = 0x00000400
DTXFSTS(1) = 0x00000400
DTXFSTS(2) = 0x00000400
DTXFSTS(3) = 0x00000400
DTXFSTS(4) = 0x00000400
DTXFSTS(5) = 0x00000400
DTXFSTS(6) = 0x00000400
DTXFSTS(7) = 0x00000400
DTXFSTS(8) = 0x00000400
DTXFSTS(9) = 0x00000400
DTXFSTS(10) = 0x00000400
DTXFSTS(11) = 0x00000400
DTXFSTS(12) = 0x00000400
DTXFSTS(13) = 0x00000400
DTXFSTS(14) = 0x00000400
DTXFSTS(15) = 0x00000400
PCGCTL = 0x00000000
HCFG = 0x00100000
HFIR = 0x000017d7
HFNUM = 0x00000000
HPTXSTS = 0x00080400
HAINT = 0x00000000
HAINTMSK = 0x00000000
HFLBADDR = 0x00000000
HPRT0 = 0x00000000
HCCHAR(0) = 0x00000000
HCCHAR(1) = 0x00000000
HCCHAR(2) = 0x00000000
HCCHAR(3) = 0x00000000
HCCHAR(4) = 0x00000000
HCCHAR(5) = 0x00000000
HCCHAR(6) = 0x00000000
HCCHAR(7) = 0x00000000
HCCHAR(8) = 0x00000000
HCCHAR(9) = 0x00000000
HCCHAR(10) = 0x00000000
HCCHAR(11) = 0x00000000
HCCHAR(12) = 0x00000000
HCCHAR(13) = 0x00000000
HCCHAR(14) = 0x00000000
HCCHAR(15) = 0x00000000
HCSPLT(0) = 0x00000000
HCSPLT(1) = 0x00000000
HCSPLT(2) = 0x00000000
HCSPLT(3) = 0x00000000
HCSPLT(4) = 0x00000000
HCSPLT(5) = 0x00000000
HCSPLT(6) = 0x00000000
HCSPLT(7) = 0x00000000
HCSPLT(8) = 0x00000000
HCSPLT(9) = 0x00000000
HCSPLT(10) = 0x00000000
HCSPLT(11) = 0x00000000
HCSPLT(12) = 0x00000000
HCSPLT(13) = 0x00000000
HCSPLT(14) = 0x00000000
HCSPLT(15) = 0x00000000
HCINT(0) = 0x00000000
HCINT(1) = 0x00000000
HCINT(2) = 0x00000000
HCINT(3) = 0x00000000
HCINT(4) = 0x00000000
HCINT(5) = 0x00000000
HCINT(6) = 0x00000000
HCINT(7) = 0x00000000
HCINT(8) = 0x00000000
HCINT(9) = 0x00000000
HCINT(10) = 0x00000000
HCINT(11) = 0x00000000
HCINT(12) = 0x00000000
HCINT(13) = 0x00000000
HCINT(14) = 0x00000000
HCINT(15) = 0x00000000
HCINTMSK(0) = 0x00000000
HCINTMSK(1) = 0x00000000
HCINTMSK(2) = 0x00000000
HCINTMSK(3) = 0x00000000
HCINTMSK(4) = 0x00000000
HCINTMSK(5) = 0x00000000
HCINTMSK(6) = 0x00000000
HCINTMSK(7) = 0x00000000
HCINTMSK(8) = 0x00000000
HCINTMSK(9) = 0x00000000
HCINTMSK(10) = 0x00000000
HCINTMSK(11) = 0x00000000
HCINTMSK(12) = 0x00000000
HCINTMSK(13) = 0x00000000
HCINTMSK(14) = 0x00000000
HCINTMSK(15) = 0x00000000
HCTSIZ(0) = 0x00000000
HCTSIZ(1) = 0x00000000
HCTSIZ(2) = 0x00000000
HCTSIZ(3) = 0x00000000
HCTSIZ(4) = 0x00000000
HCTSIZ(5) = 0x00000000
HCTSIZ(6) = 0x00000000
HCTSIZ(7) = 0x00000000
HCTSIZ(8) = 0x00000000
HCTSIZ(9) = 0x00000000
HCTSIZ(10) = 0x00000000
HCTSIZ(11) = 0x00000000
HCTSIZ(12) = 0x00000000
HCTSIZ(13) = 0x00000000
HCTSIZ(14) = 0x00000000
HCTSIZ(15) = 0x00000000
HCDMA(0) = 0xa167db6c
HCDMA(1) = 0x681b357d
HCDMA(2) = 0x503148e2
HCDMA(3) = 0x9476575a
HCDMA(4) = 0xb098e0de
HCDMA(5) = 0xb8bc774f
HCDMA(6) = 0x58d5ed04
HCDMA(7) = 0x8fbaf0d9
HCDMA(8) = 0xe7b6af62
HCDMA(9) = 0x22f87fc6
HCDMA(10) = 0x22f87fc6
HCDMA(11) = 0x22f87fc6
HCDMA(12) = 0x22f87fc6
HCDMA(13) = 0x22f87fc6
HCDMA(14) = 0x22f87fc6
HCDMA(15) = 0x22f87fc6
HCDMAB(0) = 0x22f87fc6
HCDMAB(1) = 0x22f87fc6
HCDMAB(2) = 0x22f87fc6
HCDMAB(3) = 0x22f87fc6
HCDMAB(4) = 0x22f87fc6
HCDMAB(5) = 0x22f87fc6
HCDMAB(6) = 0x22f87fc6
HCDMAB(7) = 0x22f87fc6
HCDMAB(8) = 0x22f87fc6
HCDMAB(9) = 0x22f87fc6
HCDMAB(10) = 0x22f87fc6
HCDMAB(11) = 0x22f87fc6
HCDMAB(12) = 0x22f87fc6
HCDMAB(13) = 0x22f87fc6
HCDMAB(14) = 0x22f87fc6
HCDMAB(15) = 0x22f87fc6

After:
# cat /sys/kernel/debug/usb/49000000.usb-otg/regdump
[  296.213397] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.219841] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.227521] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.235242] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.243052] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.250800] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.258577] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.266340] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.274070] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.281869] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.289618] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.297394] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.305120] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.312909] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.320697] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.328439] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.336215] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.343938] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.351725] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.359503] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.367261] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.374993] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.382798] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.390545] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.398321] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.406046] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.413833] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.421619] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.429362] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.437137] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.444863] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.452651] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.460430] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.468186] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.475920] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.483721] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.491473] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.499249] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.507001] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.514739] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.522551] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.530293] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.538068] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.545794] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.553582] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.561369] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.569117] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.576888] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.584614] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.592403] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.600180] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.607931] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.615672] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.623481] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.631230] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.639010] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.646754] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.654494] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.662296] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.670055] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.677826] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.685554] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.693342] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.701119] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.708871] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.716659] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.724377] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.732166] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.739943] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.747697] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.755436] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.763237] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.770997] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.778769] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.786522] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.794261] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.802062] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.809815] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.817601] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.825319] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.833108] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.840885] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.848635] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.856411] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.864139] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.871933] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.879709] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.887466] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.895195] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.902999] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.910749] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.918535] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.926278] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.934016] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.941818] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.949568] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.957344] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.965069] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.972874] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.980633] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.988388] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  296.996161] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  297.003886] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  297.011676] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  297.019463] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  297.027206] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  297.034944] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  297.042747] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  297.050499] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  297.058276] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  297.066003] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  297.073800] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  297.081572] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  297.089324] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  297.097099] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  297.104826] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  297.112615] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  297.120403] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
[  297.128145] dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently
in Device mode
GOTGCTL = 0x000d0000
GOTGINT = 0x00000000
GAHBCFG = 0x00000023
GUSBCFG = 0x00001400
GRSTCTL = 0x80000000
GINTSTS = 0x04000020
GINTMSK = 0xd8000806
GRXSTSR = 0x00000000
GRXFSIZ = 0x00000400
GNPTXFSIZ = 0x04000400
GNPTXSTS = 0x00080400
GI2CCTL = 0x00000000
GPVNDCTL = 0x00000000
GGPIO = 0x00600000
GUID = 0x00004000
GSNPSID = 0x4f54330a
GHWCFG1 = 0x00000000
GHWCFG2 = 0x228fe150
GHWCFG3 = 0x03b892e8
GHWCFG4 = 0xe3f00030
GLPMCFG = 0x00000000
GPWRDN = 0x00600010
GDFIFOCFG = 0x03b80400
ADPCTL = 0x00000000
HPTXFSIZ = 0x00000000
DPTXFSIZN(1) = 0x04000800
DPTXFSIZN(2) = 0x04000c00
DPTXFSIZN(3) = 0x04001000
DPTXFSIZN(4) = 0x04001400
DPTXFSIZN(5) = 0x04001800
DPTXFSIZN(6) = 0x04001c00
DPTXFSIZN(7) = 0x04002000
DPTXFSIZN(8) = 0x04002400
DPTXFSIZN(9) = 0x04000800
DPTXFSIZN(10) = 0x04000c00
DPTXFSIZN(11) = 0x04001000
DPTXFSIZN(12) = 0x04001400
DPTXFSIZN(13) = 0x04001800
DPTXFSIZN(14) = 0x04001c00
DPTXFSIZN(15) = 0x04002000
DCFG = 0x08100000
DCTL = 0x00000002
DSTS = 0x00000002
DIEPMSK = 0x00000000
DOEPMSK = 0x00000000
DAINT = 0x00000000
DAINTMSK = 0x00000000
DTKNQR1 = 0x00000000
DTKNQR2 = 0x00000000
DTKNQR3 = 0x0c100020
DTKNQR4 = 0x00000000
DVBUSDIS = 0x000017d7
DVBUSPULSE = 0x000005b8
DIEPCTL(0) = 0x00008000
DIEPCTL(1) = 0x00000000
DIEPCTL(2) = 0x00000000
DIEPCTL(3) = 0x00000000
DIEPCTL(4) = 0x00000000
DIEPCTL(5) = 0x00000000
DIEPCTL(6) = 0x00000000
DIEPCTL(7) = 0x00000000
DIEPCTL(8) = 0x00000000
DIEPCTL(9) = 0x00000000
DIEPCTL(10) = 0x00000000
DIEPCTL(11) = 0x00000000
DIEPCTL(12) = 0x00000000
DIEPCTL(13) = 0x00000000
DIEPCTL(14) = 0x00000000
DIEPCTL(15) = 0x00000000
DOEPCTL(0) = 0x00008000
DOEPCTL(1) = 0x00000000
DOEPCTL(2) = 0x00000000
DOEPCTL(3) = 0x00000000
DOEPCTL(4) = 0x00000000
DOEPCTL(5) = 0x00000000
DOEPCTL(6) = 0x00000000
DOEPCTL(7) = 0x00000000
DOEPCTL(8) = 0x00000000
DOEPCTL(9) = 0x00000000
DOEPCTL(10) = 0x00000000
DOEPCTL(11) = 0x00000000
DOEPCTL(12) = 0x00000000
DOEPCTL(13) = 0x00000000
DOEPCTL(14) = 0x00000000
DOEPCTL(15) = 0x00000000
DIEPINT(0) = 0x00000080
DIEPINT(1) = 0x00000080
DIEPINT(2) = 0x00000080
DIEPINT(3) = 0x00000080
DIEPINT(4) = 0x00000080
DIEPINT(5) = 0x00000080
DIEPINT(6) = 0x00000080
DIEPINT(7) = 0x00000080
DIEPINT(8) = 0x00000080
DIEPINT(9) = 0x00000080
DIEPINT(10) = 0x00000080
DIEPINT(11) = 0x00000080
DIEPINT(12) = 0x00000080
DIEPINT(13) = 0x00000080
DIEPINT(14) = 0x00000080
DIEPINT(15) = 0x00000080
DOEPINT(0) = 0x00000000
DOEPINT(1) = 0x00000000
DOEPINT(2) = 0x00000000
DOEPINT(3) = 0x00000000
DOEPINT(4) = 0x00000000
DOEPINT(5) = 0x00000000
DOEPINT(6) = 0x00000000
DOEPINT(7) = 0x00000000
DOEPINT(8) = 0x00000000
DOEPINT(9) = 0x00000000
DOEPINT(10) = 0x00000000
DOEPINT(11) = 0x00000000
DOEPINT(12) = 0x00000000
DOEPINT(13) = 0x00000000
DOEPINT(14) = 0x00000000
DOEPINT(15) = 0x00000000
DIEPTSIZ(0) = 0x00000000
DIEPTSIZ(1) = 0x00000000
DIEPTSIZ(2) = 0x00000000
DIEPTSIZ(3) = 0x00000000
DIEPTSIZ(4) = 0x00000000
DIEPTSIZ(5) = 0x00000000
DIEPTSIZ(6) = 0x00000000
DIEPTSIZ(7) = 0x00000000
DIEPTSIZ(8) = 0x00000000
DIEPTSIZ(9) = 0x00000000
DIEPTSIZ(10) = 0x00000000
DIEPTSIZ(11) = 0x00000000
DIEPTSIZ(12) = 0x00000000
DIEPTSIZ(13) = 0x00000000
DIEPTSIZ(14) = 0x00000000
DIEPTSIZ(15) = 0x00000000
DOEPTSIZ(0) = 0x00000000
DOEPTSIZ(1) = 0x00000000
DOEPTSIZ(2) = 0x00000000
DOEPTSIZ(3) = 0x00000000
DOEPTSIZ(4) = 0x00000000
DOEPTSIZ(5) = 0x00000000
DOEPTSIZ(6) = 0x00000000
DOEPTSIZ(7) = 0x00000000
DOEPTSIZ(8) = 0x00000000
DOEPTSIZ(9) = 0x00000000
DOEPTSIZ(10) = 0x00000000
DOEPTSIZ(11) = 0x00000000
DOEPTSIZ(12) = 0x00000000
DOEPTSIZ(13) = 0x00000000
DOEPTSIZ(14) = 0x00000000
DOEPTSIZ(15) = 0x00000000
DIEPDMA(0) = 0x79daaf9c
DIEPDMA(1) = 0xc8ad1317
DIEPDMA(2) = 0xf56293e7
DIEPDMA(3) = 0x7e374f85
DIEPDMA(4) = 0xbe22b68d
DIEPDMA(5) = 0xa60f065a
DIEPDMA(6) = 0xbafafaf5
DIEPDMA(7) = 0x892900fb
DIEPDMA(8) = 0xa2c3caca
DIEPDMA(9) = 0x58d5ed04
DIEPDMA(10) = 0x58d5ed04
DIEPDMA(11) = 0x58d5ed04
DIEPDMA(12) = 0x58d5ed04
DIEPDMA(13) = 0x58d5ed04
DIEPDMA(14) = 0x58d5ed04
DIEPDMA(15) = 0x58d5ed04
DOEPDMA(0) = 0xa167db6c
DOEPDMA(1) = 0x681b357d
DOEPDMA(2) = 0x503148e2
DOEPDMA(3) = 0x9476575a
DOEPDMA(4) = 0xb098e0de
DOEPDMA(5) = 0xb8bc774f
DOEPDMA(6) = 0x58d5ed04
DOEPDMA(7) = 0x8fbaf0d9
DOEPDMA(8) = 0xe7b6af62
DOEPDMA(9) = 0x22f87fc6
DOEPDMA(10) = 0x22f87fc6
DOEPDMA(11) = 0x22f87fc6
DOEPDMA(12) = 0x22f87fc6
DOEPDMA(13) = 0x22f87fc6
DOEPDMA(14) = 0x22f87fc6
DOEPDMA(15) = 0x22f87fc6
DTXFSTS(0) = 0x00000400
DTXFSTS(1) = 0x00000400
DTXFSTS(2) = 0x00000400
DTXFSTS(3) = 0x00000400
DTXFSTS(4) = 0x00000400
DTXFSTS(5) = 0x00000400
DTXFSTS(6) = 0x00000400
DTXFSTS(7) = 0x00000400
DTXFSTS(8) = 0x00000400
DTXFSTS(9) = 0x00000400
DTXFSTS(10) = 0x00000400
DTXFSTS(11) = 0x00000400
DTXFSTS(12) = 0x00000400
DTXFSTS(13) = 0x00000400
DTXFSTS(14) = 0x00000400
DTXFSTS(15) = 0x00000400
PCGCTL = 0x00000000
HCFG = 0x00100000
HFIR = 0x000017d7
HFNUM = 0x00000000
HPTXSTS = 0x00080400
HAINT = 0x00000000
HAINTMSK = 0x00000000
HFLBADDR = 0x00000000
HPRT0 = 0x00000000
HCCHAR(0) = 0x00000000
HCCHAR(1) = 0x00000000
HCCHAR(2) = 0x00000000
HCCHAR(3) = 0x00000000
HCCHAR(4) = 0x00000000
HCCHAR(5) = 0x00000000
HCCHAR(6) = 0x00000000
HCCHAR(7) = 0x00000000
HCCHAR(8) = 0x00000000
HCCHAR(9) = 0x00000000
HCCHAR(10) = 0x00000000
HCCHAR(11) = 0x00000000
HCCHAR(12) = 0x00000000
HCCHAR(13) = 0x00000000
HCCHAR(14) = 0x00000000
HCCHAR(15) = 0x00000000
HCSPLT(0) = 0x00000000
HCSPLT(1) = 0x00000000
HCSPLT(2) = 0x00000000
HCSPLT(3) = 0x00000000
HCSPLT(4) = 0x00000000
HCSPLT(5) = 0x00000000
HCSPLT(6) = 0x00000000
HCSPLT(7) = 0x00000000
HCSPLT(8) = 0x00000000
HCSPLT(9) = 0x00000000
HCSPLT(10) = 0x00000000
HCSPLT(11) = 0x00000000
HCSPLT(12) = 0x00000000
HCSPLT(13) = 0x00000000
HCSPLT(14) = 0x00000000
HCSPLT(15) = 0x00000000
HCINT(0) = 0x00000000
HCINT(1) = 0x00000000
HCINT(2) = 0x00000000
HCINT(3) = 0x00000000
HCINT(4) = 0x00000000
HCINT(5) = 0x00000000
HCINT(6) = 0x00000000
HCINT(7) = 0x00000000
HCINT(8) = 0x00000000
HCINT(9) = 0x00000000
HCINT(10) = 0x00000000
HCINT(11) = 0x00000000
HCINT(12) = 0x00000000
HCINT(13) = 0x00000000
HCINT(14) = 0x00000000
HCINT(15) = 0x00000000
HCINTMSK(0) = 0x00000000
HCINTMSK(1) = 0x00000000
HCINTMSK(2) = 0x00000000
HCINTMSK(3) = 0x00000000
HCINTMSK(4) = 0x00000000
HCINTMSK(5) = 0x00000000
HCINTMSK(6) = 0x00000000
HCINTMSK(7) = 0x00000000
HCINTMSK(8) = 0x00000000
HCINTMSK(9) = 0x00000000
HCINTMSK(10) = 0x00000000
HCINTMSK(11) = 0x00000000
HCINTMSK(12) = 0x00000000
HCINTMSK(13) = 0x00000000
HCINTMSK(14) = 0x00000000
HCINTMSK(15) = 0x00000000
HCTSIZ(0) = 0x00000000
HCTSIZ(1) = 0x00000000
HCTSIZ(2) = 0x00000000
HCTSIZ(3) = 0x00000000
HCTSIZ(4) = 0x00000000
HCTSIZ(5) = 0x00000000
HCTSIZ(6) = 0x00000000
HCTSIZ(7) = 0x00000000
HCTSIZ(8) = 0x00000000
HCTSIZ(9) = 0x00000000
HCTSIZ(10) = 0x00000000
HCTSIZ(11) = 0x00000000
HCTSIZ(12) = 0x00000000
HCTSIZ(13) = 0x00000000
HCTSIZ(14) = 0x00000000
HCTSIZ(15) = 0x00000000
HCDMA(0) = 0xa167db6c
HCDMA(1) = 0x681b357d
HCDMA(2) = 0x503148e2
HCDMA(3) = 0x9476575a
HCDMA(4) = 0xb098e0de
HCDMA(5) = 0xb8bc774f
HCDMA(6) = 0x58d5ed04
HCDMA(7) = 0x8fbaf0d9
HCDMA(8) = 0xe7b6af62
HCDMA(9) = 0x22f87fc6
HCDMA(10) = 0x22f87fc6
HCDMA(11) = 0x22f87fc6
HCDMA(12) = 0x22f87fc6
HCDMA(13) = 0x22f87fc6
HCDMA(14) = 0x22f87fc6
HCDMA(15) = 0x22f87fc6
HCDMAB(0) = 0x22f87fc6
HCDMAB(1) = 0x22f87fc6
HCDMAB(2) = 0x22f87fc6
HCDMAB(3) = 0x22f87fc6
HCDMAB(4) = 0x22f87fc6
HCDMAB(5) = 0x22f87fc6
HCDMAB(6) = 0x22f87fc6
HCDMAB(7) = 0x22f87fc6
HCDMAB(8) = 0x22f87fc6
HCDMAB(9) = 0x22f87fc6
HCDMAB(10) = 0x22f87fc6
HCDMAB(11) = 0x22f87fc6
HCDMAB(12) = 0x22f87fc6
HCDMAB(13) = 0x22f87fc6
HCDMAB(14) = 0x22f87fc6
HCDMAB(15) = 0x22f87fc6
Minas Harutyunyan April 15, 2020, 8:37 a.m. UTC | #7
Hi,

On 4/14/2020 4:18 PM, Marek Vasut wrote:
> On 4/14/20 9:14 AM, Minas Harutyunyan wrote:

> 
>> 2. debug log
> 
> What kind of debug log ?
> 
Drivers debug log starting from dwc2 loading and connector connecting to 
device, where issue seen.

Thanks,
Minas
Marek Vasut April 15, 2020, 2:55 p.m. UTC | #8
On 4/15/20 10:37 AM, Minas Harutyunyan wrote:
> Hi,
> 
> On 4/14/2020 4:18 PM, Marek Vasut wrote:
>> On 4/14/20 9:14 AM, Minas Harutyunyan wrote:
> 
>>
>>> 2. debug log
>>
>> What kind of debug log ?
>>
> Drivers debug log starting from dwc2 loading and connector connecting to 
> device, where issue seen.

How do I enable the one you need ?
Minas Harutyunyan April 15, 2020, 3:10 p.m. UTC | #9
Hi,

On 4/15/2020 6:55 PM, Marek Vasut wrote:
> On 4/15/20 10:37 AM, Minas Harutyunyan wrote:
>> Hi,
>>
>> On 4/14/2020 4:18 PM, Marek Vasut wrote:
>>> On 4/14/20 9:14 AM, Minas Harutyunyan wrote:
>>
>>>
>>>> 2. debug log
>>>
>>> What kind of debug log ?
>>>
>> Drivers debug log starting from dwc2 loading and connector connecting to
>> device, where issue seen.
> 
> How do I enable the one you need ?
> 
To enable debug prints from dwc2 use 'make menuconfig':

  Symbol: USB_DWC2_DEBUG [=y]
   Type  : bool
   Prompt: Enable Debugging Messages
   Location:
	-> Device Drivers
		-> USB support (USB_SUPPORT [=y])
    (2)     -> DesignWare USB2 DRD Core Support (USB_DWC2 [=m])
   Defined at drivers/usb/dwc2/Kconfig:66
   Depends on: USB_SUPPORT [=y] && USB_DWC2 [=m]

To get log use 'dmesg' command.

Thanks,
Minas
Marek Vasut April 16, 2020, 9:46 a.m. UTC | #10
On 4/15/20 5:10 PM, Minas Harutyunyan wrote:
> Hi,

Hi,

> On 4/15/2020 6:55 PM, Marek Vasut wrote:
>> On 4/15/20 10:37 AM, Minas Harutyunyan wrote:
>>> Hi,
>>>
>>> On 4/14/2020 4:18 PM, Marek Vasut wrote:
>>>> On 4/14/20 9:14 AM, Minas Harutyunyan wrote:
>>>
>>>>
>>>>> 2. debug log
>>>>
>>>> What kind of debug log ?
>>>>
>>> Drivers debug log starting from dwc2 loading and connector connecting to
>>> device, where issue seen.
>>
>> How do I enable the one you need ?
>>
> To enable debug prints from dwc2 use 'make menuconfig':
> 
>   Symbol: USB_DWC2_DEBUG [=y]

Oh, this one, OK. There you go.

Note that there is no further output when I plug in the USB microB cable
from a PC.

 dwc2 49000000.usb-otg: supply vusb_d not found, using dummy regulator
 dwc2 49000000.usb-otg: supply vusb_a not found, using dummy regulator
 dwc2 49000000.usb-otg: EPs: 9, dedicated fifos, 952 entries in SPRAM
 dwc2 49000000.usb-otg: bound driver zero
 dwc2 49000000.usb-otg: DCFG=0x08100000, DCTL=0x00000002, DIEPMSK=00000000
 dwc2 49000000.usb-otg: GAHBCFG=0x00000000, GHWCFG1=0x00000000
 dwc2 49000000.usb-otg: GRXFSIZ=0x00000400, GNPTXFSIZ=0x04000400
 dwc2 49000000.usb-otg: DPTx[1] FSize=1024, StAddr=0x00000800
 dwc2 49000000.usb-otg: DPTx[2] FSize=1024, StAddr=0x00000c00
 dwc2 49000000.usb-otg: DPTx[3] FSize=1024, StAddr=0x00001000
 dwc2 49000000.usb-otg: DPTx[4] FSize=1024, StAddr=0x00001400
 dwc2 49000000.usb-otg: DPTx[5] FSize=1024, StAddr=0x00001800
 dwc2 49000000.usb-otg: DPTx[6] FSize=1024, StAddr=0x00001c00
 dwc2 49000000.usb-otg: DPTx[7] FSize=1024, StAddr=0x00002000
 dwc2 49000000.usb-otg: DPTx[8] FSize=1024, StAddr=0x00002400
 dwc2 49000000.usb-otg: ep0-in: EPCTL=0x00008800, SIZ=0x00000000,
DMA=0x79daaf9c
 dwc2 49000000.usb-otg: ep0-out: EPCTL=0x00008000, SIZ=0x00000000,
DMA=0xa167db6c
 dwc2 49000000.usb-otg: ep1-in: EPCTL=0x00001000, SIZ=0x00000000,
DMA=0x88ad1397
 dwc2 49000000.usb-otg: ep1-out: EPCTL=0x00000000, SIZ=0x00000000,
DMA=0x6c5b357c
 dwc2 49000000.usb-otg: ep2-in: EPCTL=0x00001800, SIZ=0x00000000,
DMA=0xb4639367
 dwc2 49000000.usb-otg: ep2-out: EPCTL=0x00000000, SIZ=0x00000000,
DMA=0x503148e2
 dwc2 49000000.usb-otg: ep3-in: EPCTL=0x00002000, SIZ=0x00000000,
DMA=0x7e275f85
 dwc2 49000000.usb-otg: ep3-out: EPCTL=0x00000000, SIZ=0x00000000,
DMA=0x9474575a
 dwc2 49000000.usb-otg: ep4-in: EPCTL=0x00002800, SIZ=0x00000000,
DMA=0xbe22b68d
 dwc2 49000000.usb-otg: ep4-out: EPCTL=0x00000000, SIZ=0x00000000,
DMA=0xb89ae0de
 dwc2 49000000.usb-otg: ep5-in: EPCTL=0x00003000, SIZ=0x00000000,
DMA=0xa607065a
 dwc2 49000000.usb-otg: ep5-out: EPCTL=0x00000000, SIZ=0x00000000,
DMA=0xa8bc774f
 dwc2 49000000.usb-otg: ep6-in: EPCTL=0x00003800, SIZ=0x00000000,
DMA=0xbabafaf5
 dwc2 49000000.usb-otg: ep6-out: EPCTL=0x00000000, SIZ=0x00000000,
DMA=0x58ddeb04
 dwc2 49000000.usb-otg: ep7-in: EPCTL=0x00004000, SIZ=0x00000000,
DMA=0x8b6b00f3
 dwc2 49000000.usb-otg: ep7-out: EPCTL=0x00000000, SIZ=0x00000000,
DMA=0x87baf0d9
 dwc2 49000000.usb-otg: ep8-in: EPCTL=0x00004800, SIZ=0x00000000,
DMA=0xa2c3caca
 dwc2 49000000.usb-otg: ep8-out: EPCTL=0x00000000, SIZ=0x00000000,
DMA=0x67b6afe2
 dwc2 49000000.usb-otg: DVBUSDIS=0x000017d7, DVBUSPULSE=000005b8
 dwc2 49000000.usb-otg: DWC OTG Controller
 dwc2 49000000.usb-otg: new USB bus registered, assigned bus number 1
 dwc2 49000000.usb-otg: irq 45, io mem 0x49000000
 dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently in Device mode
Minas Harutyunyan April 16, 2020, 1:37 p.m. UTC | #11
Hi,

On 4/16/2020 1:46 PM, Marek Vasut wrote:
> On 4/15/20 5:10 PM, Minas Harutyunyan wrote:
>> Hi,
> 
> Hi,
> 
>> On 4/15/2020 6:55 PM, Marek Vasut wrote:
>>> On 4/15/20 10:37 AM, Minas Harutyunyan wrote:
>>>> Hi,
>>>>
>>>> On 4/14/2020 4:18 PM, Marek Vasut wrote:
>>>>> On 4/14/20 9:14 AM, Minas Harutyunyan wrote:
>>>>
>>>>>
>>>>>> 2. debug log
>>>>>
>>>>> What kind of debug log ?
>>>>>
>>>> Drivers debug log starting from dwc2 loading and connector connecting to
>>>> device, where issue seen.
>>>
>>> How do I enable the one you need ?
>>>
>> To enable debug prints from dwc2 use 'make menuconfig':
>>
>>    Symbol: USB_DWC2_DEBUG [=y]
> 
> Oh, this one, OK. There you go.
> 
> Note that there is no further output when I plug in the USB microB cable
> from a PC.
> 
1. Are you sure that you provided full debug log for dwc2? Actually 
first debug prints of dwc2 should be:

[72891.088917] dwc2 dwc2.1.auto: mapped PA ef100000 to VA 00000000ca45f000
[72891.088924] dwc2 dwc2.1.auto: registering common handler for irq16
[72891.088963] dwc2 dwc2.1.auto: Core Release: 4.00a (snpsid=4f54400a)
[72891.088974] dwc2 dwc2.1.auto: Forcing mode to host
[72891.100285] dwc2 dwc2.1.auto: Forcing mode to device
[72891.112307] dwc2 dwc2.1.auto: Clearing force mode bits
[72891.215275] dwc2 dwc2.1.auto: NonPeriodic TXFIFO size: 1024
[72891.215278] dwc2 dwc2.1.auto: RXFIFO size: 2048
...

2. Does your driver built for 'dual role device' or 'device only'?

3. First observation from register dumps: core in SOFT disconnect state, 
which can be reason of observed issue. Could you please update your 
patch and add only core_connect function call:

+	dwc2_hsotg_core_connect(hsotg);
+
  	return 0;

  error4:

Or instead of patch, if you have any utility in system which will allow 
from command line clear soft disconnect bit from DCTL register? Offset 
of DCTL register is 0x804. SoftDiscon bit number is 1. Clear this bit 
and then plug cable.

Unfortunately, currently I'm working from home and can't remotely 
connect/disconnect cable in lab to try to reproduce observed by you issue.

Thanks,
Minas
Marek Vasut April 16, 2020, 2:31 p.m. UTC | #12
On 4/16/20 3:37 PM, Minas Harutyunyan wrote:
> Hi,

Hi,

[...]

>>>>>>> 2. debug log
>>>>>>
>>>>>> What kind of debug log ?
>>>>>>
>>>>> Drivers debug log starting from dwc2 loading and connector connecting to
>>>>> device, where issue seen.
>>>>
>>>> How do I enable the one you need ?
>>>>
>>> To enable debug prints from dwc2 use 'make menuconfig':
>>>
>>>    Symbol: USB_DWC2_DEBUG [=y]
>>
>> Oh, this one, OK. There you go.
>>
>> Note that there is no further output when I plug in the USB microB cable
>> from a PC.
>>
> 1. Are you sure that you provided full debug log for dwc2? Actually 
> first debug prints of dwc2 should be:
> 
> [72891.088917] dwc2 dwc2.1.auto: mapped PA ef100000 to VA 00000000ca45f000
> [72891.088924] dwc2 dwc2.1.auto: registering common handler for irq16
> [72891.088963] dwc2 dwc2.1.auto: Core Release: 4.00a (snpsid=4f54400a)
> [72891.088974] dwc2 dwc2.1.auto: Forcing mode to host
> [72891.100285] dwc2 dwc2.1.auto: Forcing mode to device
> [72891.112307] dwc2 dwc2.1.auto: Clearing force mode bits
> [72891.215275] dwc2 dwc2.1.auto: NonPeriodic TXFIFO size: 1024
> [72891.215278] dwc2 dwc2.1.auto: RXFIFO size: 2048
> ...

So what you really want from me is to boot the kernel with loglevel >= 7
, right ? See at the end.

> 2. Does your driver built for 'dual role device' or 'device only'?

Dual-role

> 3. First observation from register dumps: core in SOFT disconnect state, 
> which can be reason of observed issue. Could you please update your 
> patch and add only core_connect function call:
> 
> +	dwc2_hsotg_core_connect(hsotg);

Does not help.

>   	return 0;
> 
>   error4:
> 
> Or instead of patch, if you have any utility in system which will allow 
> from command line clear soft disconnect bit from DCTL register? Offset 
> of DCTL register is 0x804. SoftDiscon bit number is 1. Clear this bit 
> and then plug cable.

Clearing that bit with devmem allows the host PC to detect some
high-speed device got connected, but that's it, it does not detect it as
a gadget and no communication really happens.

> Unfortunately, currently I'm working from home and can't remotely 
> connect/disconnect cable in lab to try to reproduce observed by you issue.

Maybe you should consider using something like this in the lab:
https://www.ti.com/product/TS3USB30

[...]

 dwc2 49000000.usb-otg: mapped PA 49000000 to VA 473352f1
 dwc2 49000000.usb-otg: mapped PA 49000000 to VA 923761cb
 dwc2 49000000.usb-otg: supply vusb_d not found, using dummy regulator
 dwc2 49000000.usb-otg: supply vusb_a not found, using dummy regulator
 dwc2 49000000.usb-otg: registering common handler for irq48
 dwc2 49000000.usb-otg: dwc2_core_reset()
 dwc2 49000000.usb-otg: Core Release: 3.30a (snpsid=4f54330a)
 dwc2 49000000.usb-otg: Forcing mode to host
 dwc2 49000000.usb-otg: Waiting for host mode
 dwc2 49000000.usb-otg: Host mode set
 dwc2 49000000.usb-otg: Forcing mode to device
 dwc2 49000000.usb-otg: Waiting for device mode
 dwc2 49000000.usb-otg: Device mode set
 dwc2 49000000.usb-otg: Clearing force mode bits
 dwc2 49000000.usb-otg: NonPeriodic TXFIFO size: 32
 dwc2 49000000.usb-otg: RXFIFO size: 256
 dwc2 49000000.usb-otg: EPs: 9, dedicated fifos, 952 entries in SPRAM
 dwc2 49000000.usb-otg: bound driver zero
 dwc2 49000000.usb-otg: dwc2_hsotg_pullup: is_on: 1 op_state: 0
 dwc2 49000000.usb-otg: DCFG=0x08100000, DCTL=0x00000002, DIEPMSK=00000000
 dwc2 49000000.usb-otg: GAHBCFG=0x00000000, GHWCFG1=0x00000000
 dwc2 49000000.usb-otg: GRXFSIZ=0x00000400, GNPTXFSIZ=0x04000400
 dwc2 49000000.usb-otg: DPTx[1] FSize=1024, StAddr=0x00000800
 dwc2 49000000.usb-otg: DPTx[2] FSize=1024, StAddr=0x00000c00
 dwc2 49000000.usb-otg: DPTx[3] FSize=1024, StAddr=0x00001000
 dwc2 49000000.usb-otg: DPTx[4] FSize=1024, StAddr=0x00001400
 dwc2 49000000.usb-otg: DPTx[5] FSize=1024, StAddr=0x00001800
 dwc2 49000000.usb-otg: DPTx[6] FSize=1024, StAddr=0x00001c00
 dwc2 49000000.usb-otg: DPTx[7] FSize=1024, StAddr=0x00002000
 dwc2 49000000.usb-otg: DPTx[8] FSize=1024, StAddr=0x00002400
 dwc2 49000000.usb-otg: ep0-in: EPCTL=0x00008800, SIZ=0x00000000,
DMA=0x79daaf9d
 dwc2 49000000.usb-otg: ep0-out: EPCTL=0x00008000, SIZ=0x00000000,
DMA=0xa167db6c
 dwc2 49000000.usb-otg: ep1-in: EPCTL=0x00001000, SIZ=0x00000000,
DMA=0xccad1197
 dwc2 49000000.usb-otg: ep1-out: EPCTL=0x00000000, SIZ=0x00000000,
DMA=0x6c5b347c
 dwc2 49000000.usb-otg: ep2-in: EPCTL=0x00001800, SIZ=0x00000000,
DMA=0xf57293e7
 dwc2 49000000.usb-otg: ep2-out: EPCTL=0x00000000, SIZ=0x00000000,
DMA=0x503148ea
 dwc2 49000000.usb-otg: ep3-in: EPCTL=0x00002000, SIZ=0x00000000,
DMA=0x3c274fc5
 dwc2 49000000.usb-otg: ep3-out: EPCTL=0x00000000, SIZ=0x00000000,
DMA=0x9436577a
 dwc2 49000000.usb-otg: ep4-in: EPCTL=0x00002800, SIZ=0x00000000,
DMA=0xbe22b68d
 dwc2 49000000.usb-otg: ep4-out: EPCTL=0x00000000, SIZ=0x00000000,
DMA=0xb09ae0de
 dwc2 49000000.usb-otg: ep5-in: EPCTL=0x00003000, SIZ=0x00000000,
DMA=0xa607065a
 dwc2 49000000.usb-otg: ep5-out: EPCTL=0x00000000, SIZ=0x00000000,
DMA=0xa8b8774f
 dwc2 49000000.usb-otg: ep6-in: EPCTL=0x00003800, SIZ=0x00000000,
DMA=0xbabafad5
 dwc2 49000000.usb-otg: ep6-out: EPCTL=0x00000000, SIZ=0x00000000,
DMA=0x58d5e904
 dwc2 49000000.usb-otg: ep7-in: EPCTL=0x00004000, SIZ=0x00000000,
DMA=0x0b6900f3
 dwc2 49000000.usb-otg: ep7-out: EPCTL=0x00000000, SIZ=0x00000000,
DMA=0x8fbae0d9
 dwc2 49000000.usb-otg: ep8-in: EPCTL=0x00004800, SIZ=0x00000000,
DMA=0xa2c39aca
 dwc2 49000000.usb-otg: ep8-out: EPCTL=0x00000000, SIZ=0x00000000,
DMA=0xe7b6ab62
 dwc2 49000000.usb-otg: DVBUSDIS=0x000017d7, DVBUSPULSE=000005b8
 dwc2 49000000.usb-otg: DWC OTG HCD INIT
 dwc2 49000000.usb-otg: hcfg=00100000
 dwc2 49000000.usb-otg: dwc2_core_init(370c19f5)
 dwc2 49000000.usb-otg: HS UTMI+ PHY selected
 dwc2 49000000.usb-otg: dwc2_core_reset()
 dwc2 49000000.usb-otg: Internal DMA Mode
 dwc2 49000000.usb-otg: Device Mode
 dwc2 49000000.usb-otg: DWC OTG Controller
 dwc2 49000000.usb-otg: new USB bus registered, assigned bus number 1
 dwc2 49000000.usb-otg: irq 48, io mem 0x49000000
 dwc2 49000000.usb-otg: DWC OTG HCD START
 dwc2 49000000.usb-otg: DWC OTG HCD EP RESET: bEndpointAddress=0x81
 dwc2 49000000.usb-otg: GetHubDescriptor
 dwc2 49000000.usb-otg: GetHubStatus
 dwc2 49000000.usb-otg: SetPortFeature
 dwc2 49000000.usb-otg:
 dwc2 49000000.usb-otg:
************************************************************
 dwc2 49000000.usb-otg: HCD State:
 dwc2 49000000.usb-otg:   Num channels: 16
 dwc2 49000000.usb-otg:   Channel 0:
 dwc2 49000000.usb-otg:     dev_addr: 0, ep_num: 0, ep_is_in: 0
 dwc2 49000000.usb-otg:     speed: 0
 dwc2 49000000.usb-otg:     ep_type: 0
 dwc2 49000000.usb-otg:     max_packet: 0
 dwc2 49000000.usb-otg:     data_pid_start: 0
 dwc2 49000000.usb-otg:     multi_count: 0
 dwc2 49000000.usb-otg:     xfer_started: 0
 dwc2 49000000.usb-otg:     xfer_buf: beb5cc16
 dwc2 49000000.usb-otg:     xfer_dma: 00000000
 dwc2 49000000.usb-otg:     xfer_len: 0
 dwc2 49000000.usb-otg:     xfer_count: 0
 dwc2 49000000.usb-otg:     halt_on_queue: 0
 dwc2 49000000.usb-otg:     halt_pending: 0
 dwc2 49000000.usb-otg:     halt_status: 0
 dwc2 49000000.usb-otg:     do_split: 0
 dwc2 49000000.usb-otg:     complete_split: 0
 dwc2 49000000.usb-otg:     hub_addr: 0
 dwc2 49000000.usb-otg:     hub_port: 0
 dwc2 49000000.usb-otg:     xact_pos: 0
 dwc2 49000000.usb-otg:     requests: 0
 dwc2 49000000.usb-otg:     qh: beb5cc16
 dwc2 49000000.usb-otg:   Channel 1:
 dwc2 49000000.usb-otg:     dev_addr: 0, ep_num: 0, ep_is_in: 0
 dwc2 49000000.usb-otg:     speed: 0
 dwc2 49000000.usb-otg:     ep_type: 0
 dwc2 49000000.usb-otg:     max_packet: 0
 dwc2 49000000.usb-otg:     data_pid_start: 0
 dwc2 49000000.usb-otg:     multi_count: 0
 dwc2 49000000.usb-otg:     xfer_started: 0
 dwc2 49000000.usb-otg:     xfer_buf: beb5cc16
 dwc2 49000000.usb-otg:     xfer_dma: 00000000
 dwc2 49000000.usb-otg:     xfer_len: 0
 dwc2 49000000.usb-otg:     xfer_count: 0
 dwc2 49000000.usb-otg:     halt_on_queue: 0
 dwc2 49000000.usb-otg:     halt_pending: 0
 dwc2 49000000.usb-otg:     halt_status: 0
 dwc2 49000000.usb-otg:     do_split: 0
 dwc2 49000000.usb-otg:     complete_split: 0
 dwc2 49000000.usb-otg:     hub_addr: 0
 dwc2 49000000.usb-otg:     hub_port: 0
 dwc2 49000000.usb-otg:     xact_pos: 0
 dwc2 49000000.usb-otg:     requests: 0
 dwc2 49000000.usb-otg:     qh: beb5cc16
 dwc2 49000000.usb-otg:   Channel 2:
 dwc2 49000000.usb-otg:     dev_addr: 0, ep_num: 0, ep_is_in: 0
 dwc2 49000000.usb-otg:     speed: 0
 dwc2 49000000.usb-otg:     ep_type: 0
 dwc2 49000000.usb-otg:     max_packet: 0
 dwc2 49000000.usb-otg:     data_pid_start: 0
 dwc2 49000000.usb-otg:     multi_count: 0
 dwc2 49000000.usb-otg:     xfer_started: 0
 dwc2 49000000.usb-otg:     xfer_buf: beb5cc16
 dwc2 49000000.usb-otg:     xfer_dma: 00000000
 dwc2 49000000.usb-otg:     xfer_len: 0
 dwc2 49000000.usb-otg:     xfer_count: 0
 dwc2 49000000.usb-otg:     halt_on_queue: 0
 dwc2 49000000.usb-otg:     halt_pending: 0
 dwc2 49000000.usb-otg:     halt_status: 0
 dwc2 49000000.usb-otg:     do_split: 0
 dwc2 49000000.usb-otg:     complete_split: 0
 dwc2 49000000.usb-otg:     hub_addr: 0
 dwc2 49000000.usb-otg:     hub_port: 0
 dwc2 49000000.usb-otg:     xact_pos: 0
 dwc2 49000000.usb-otg:     requests: 0
 dwc2 49000000.usb-otg:     qh: beb5cc16
 dwc2 49000000.usb-otg:   Channel 3:
 dwc2 49000000.usb-otg:     dev_addr: 0, ep_num: 0, ep_is_in: 0
 dwc2 49000000.usb-otg:     speed: 0
 dwc2 49000000.usb-otg:     ep_type: 0
 dwc2 49000000.usb-otg:     max_packet: 0
 dwc2 49000000.usb-otg:     data_pid_start: 0
 dwc2 49000000.usb-otg:     multi_count: 0
 dwc2 49000000.usb-otg:     xfer_started: 0
 dwc2 49000000.usb-otg:     xfer_buf: beb5cc16
 dwc2 49000000.usb-otg:     xfer_dma: 00000000
 dwc2 49000000.usb-otg:     xfer_len: 0
 dwc2 49000000.usb-otg:     xfer_count: 0
 dwc2 49000000.usb-otg:     halt_on_queue: 0
 dwc2 49000000.usb-otg:     halt_pending: 0
 dwc2 49000000.usb-otg:     halt_status: 0
 dwc2 49000000.usb-otg:     do_split: 0
 dwc2 49000000.usb-otg:     complete_split: 0
 dwc2 49000000.usb-otg:     hub_addr: 0
 dwc2 49000000.usb-otg:     hub_port: 0
 dwc2 49000000.usb-otg:     xact_pos: 0
 dwc2 49000000.usb-otg:     requests: 0
 dwc2 49000000.usb-otg:     qh: beb5cc16
 dwc2 49000000.usb-otg:   Channel 4:
 dwc2 49000000.usb-otg:     dev_addr: 0, ep_num: 0, ep_is_in: 0
 dwc2 49000000.usb-otg:     speed: 0
 dwc2 49000000.usb-otg:     ep_type: 0
 dwc2 49000000.usb-otg:     max_packet: 0
 dwc2 49000000.usb-otg:     data_pid_start: 0
 dwc2 49000000.usb-otg:     multi_count: 0
 dwc2 49000000.usb-otg:     xfer_started: 0
 dwc2 49000000.usb-otg:     xfer_buf: beb5cc16
 dwc2 49000000.usb-otg:     xfer_dma: 00000000
 dwc2 49000000.usb-otg:     xfer_len: 0
 dwc2 49000000.usb-otg:     xfer_count: 0
 dwc2 49000000.usb-otg:     halt_on_queue: 0
 dwc2 49000000.usb-otg:     halt_pending: 0
 dwc2 49000000.usb-otg:     halt_status: 0
 dwc2 49000000.usb-otg:     do_split: 0
 dwc2 49000000.usb-otg:     complete_split: 0
 dwc2 49000000.usb-otg:     hub_addr: 0
 dwc2 49000000.usb-otg:     hub_port: 0
 dwc2 49000000.usb-otg:     xact_pos: 0
 dwc2 49000000.usb-otg:     requests: 0
 dwc2 49000000.usb-otg:     qh: beb5cc16
 dwc2 49000000.usb-otg:   Channel 5:
 dwc2 49000000.usb-otg:     dev_addr: 0, ep_num: 0, ep_is_in: 0
 dwc2 49000000.usb-otg:     speed: 0
 dwc2 49000000.usb-otg:     ep_type: 0
 dwc2 49000000.usb-otg:     max_packet: 0
 dwc2 49000000.usb-otg:     data_pid_start: 0
 dwc2 49000000.usb-otg:     multi_count: 0
 dwc2 49000000.usb-otg:     xfer_started: 0
 dwc2 49000000.usb-otg:     xfer_buf: beb5cc16
 dwc2 49000000.usb-otg:     xfer_dma: 00000000
 dwc2 49000000.usb-otg:     xfer_len: 0
 dwc2 49000000.usb-otg:     xfer_count: 0
 dwc2 49000000.usb-otg:     halt_on_queue: 0
 dwc2 49000000.usb-otg:     halt_pending: 0
 dwc2 49000000.usb-otg:     halt_status: 0
 dwc2 49000000.usb-otg:     do_split: 0
 dwc2 49000000.usb-otg:     complete_split: 0
 dwc2 49000000.usb-otg:     hub_addr: 0
 dwc2 49000000.usb-otg:     hub_port: 0
 dwc2 49000000.usb-otg:     xact_pos: 0
 dwc2 49000000.usb-otg:     requests: 0
 dwc2 49000000.usb-otg:     qh: beb5cc16
 dwc2 49000000.usb-otg:   Channel 6:
 dwc2 49000000.usb-otg:     dev_addr: 0, ep_num: 0, ep_is_in: 0
 dwc2 49000000.usb-otg:     speed: 0
 dwc2 49000000.usb-otg:     ep_type: 0
 dwc2 49000000.usb-otg:     max_packet: 0
 dwc2 49000000.usb-otg:     data_pid_start: 0
 dwc2 49000000.usb-otg:     multi_count: 0
 dwc2 49000000.usb-otg:     xfer_started: 0
 dwc2 49000000.usb-otg:     xfer_buf: beb5cc16
 dwc2 49000000.usb-otg:     xfer_dma: 00000000
 dwc2 49000000.usb-otg:     xfer_len: 0
 dwc2 49000000.usb-otg:     xfer_count: 0
 dwc2 49000000.usb-otg:     halt_on_queue: 0
 dwc2 49000000.usb-otg:     halt_pending: 0
 dwc2 49000000.usb-otg:     halt_status: 0
 dwc2 49000000.usb-otg:     do_split: 0
 dwc2 49000000.usb-otg:     complete_split: 0
 dwc2 49000000.usb-otg:     hub_addr: 0
 dwc2 49000000.usb-otg:     hub_port: 0
 dwc2 49000000.usb-otg:     xact_pos: 0
 dwc2 49000000.usb-otg:     requests: 0
 dwc2 49000000.usb-otg:     qh: beb5cc16
 dwc2 49000000.usb-otg:   Channel 7:
 dwc2 49000000.usb-otg:     dev_addr: 0, ep_num: 0, ep_is_in: 0
 dwc2 49000000.usb-otg:     speed: 0
 dwc2 49000000.usb-otg:     ep_type: 0
 dwc2 49000000.usb-otg:     max_packet: 0
 dwc2 49000000.usb-otg:     data_pid_start: 0
 dwc2 49000000.usb-otg:     multi_count: 0
 dwc2 49000000.usb-otg:     xfer_started: 0
 dwc2 49000000.usb-otg:     xfer_buf: beb5cc16
 dwc2 49000000.usb-otg:     xfer_dma: 00000000
 dwc2 49000000.usb-otg:     xfer_len: 0
 dwc2 49000000.usb-otg:     xfer_count: 0
 dwc2 49000000.usb-otg:     halt_on_queue: 0
 dwc2 49000000.usb-otg:     halt_pending: 0
 dwc2 49000000.usb-otg:     halt_status: 0
 dwc2 49000000.usb-otg:     do_split: 0
 dwc2 49000000.usb-otg:     complete_split: 0
 dwc2 49000000.usb-otg:     hub_addr: 0
 dwc2 49000000.usb-otg:     hub_port: 0
 dwc2 49000000.usb-otg:     xact_pos: 0
 dwc2 49000000.usb-otg:     requests: 0
 dwc2 49000000.usb-otg:     qh: beb5cc16
 dwc2 49000000.usb-otg:   Channel 8:
 dwc2 49000000.usb-otg:     dev_addr: 0, ep_num: 0, ep_is_in: 0
 dwc2 49000000.usb-otg:     speed: 0
 dwc2 49000000.usb-otg:     ep_type: 0
 dwc2 49000000.usb-otg:     max_packet: 0
 dwc2 49000000.usb-otg:     data_pid_start: 0
 dwc2 49000000.usb-otg:     multi_count: 0
 dwc2 49000000.usb-otg:     xfer_started: 0
 dwc2 49000000.usb-otg:     xfer_buf: beb5cc16
 dwc2 49000000.usb-otg:     xfer_dma: 00000000
 dwc2 49000000.usb-otg:     xfer_len: 0
 dwc2 49000000.usb-otg:     xfer_count: 0
 dwc2 49000000.usb-otg:     halt_on_queue: 0
 dwc2 49000000.usb-otg:     halt_pending: 0
 dwc2 49000000.usb-otg:     halt_status: 0
 dwc2 49000000.usb-otg:     do_split: 0
 dwc2 49000000.usb-otg:     complete_split: 0
 dwc2 49000000.usb-otg:     hub_addr: 0
 dwc2 49000000.usb-otg:     hub_port: 0
 dwc2 49000000.usb-otg:     xact_pos: 0
 dwc2 49000000.usb-otg:     requests: 0
 dwc2 49000000.usb-otg:     qh: beb5cc16
 dwc2 49000000.usb-otg:   Channel 9:
 dwc2 49000000.usb-otg:     dev_addr: 0, ep_num: 0, ep_is_in: 0
 dwc2 49000000.usb-otg:     speed: 0
 dwc2 49000000.usb-otg:     ep_type: 0
 dwc2 49000000.usb-otg:     max_packet: 0
 dwc2 49000000.usb-otg:     data_pid_start: 0
 dwc2 49000000.usb-otg:     multi_count: 0
 dwc2 49000000.usb-otg:     xfer_started: 0
 dwc2 49000000.usb-otg:     xfer_buf: beb5cc16
 dwc2 49000000.usb-otg:     xfer_dma: 00000000
 dwc2 49000000.usb-otg:     xfer_len: 0
 dwc2 49000000.usb-otg:     xfer_count: 0
 dwc2 49000000.usb-otg:     halt_on_queue: 0
 dwc2 49000000.usb-otg:     halt_pending: 0
 dwc2 49000000.usb-otg:     halt_status: 0
 dwc2 49000000.usb-otg:     do_split: 0
 dwc2 49000000.usb-otg:     complete_split: 0
 dwc2 49000000.usb-otg:     hub_addr: 0
 dwc2 49000000.usb-otg:     hub_port: 0
 dwc2 49000000.usb-otg:     xact_pos: 0
 dwc2 49000000.usb-otg:     requests: 0
 dwc2 49000000.usb-otg:     qh: beb5cc16
 dwc2 49000000.usb-otg:   Channel 10:
 dwc2 49000000.usb-otg:     dev_addr: 0, ep_num: 0, ep_is_in: 0
 dwc2 49000000.usb-otg:     speed: 0
 dwc2 49000000.usb-otg:     ep_type: 0
 dwc2 49000000.usb-otg:     max_packet: 0
 dwc2 49000000.usb-otg:     data_pid_start: 0
 dwc2 49000000.usb-otg:     multi_count: 0
 dwc2 49000000.usb-otg:     xfer_started: 0
 dwc2 49000000.usb-otg:     xfer_buf: beb5cc16
 dwc2 49000000.usb-otg:     xfer_dma: 00000000
 dwc2 49000000.usb-otg:     xfer_len: 0
 dwc2 49000000.usb-otg:     xfer_count: 0
 dwc2 49000000.usb-otg:     halt_on_queue: 0
 dwc2 49000000.usb-otg:     halt_pending: 0
 dwc2 49000000.usb-otg:     halt_status: 0
 dwc2 49000000.usb-otg:     do_split: 0
 dwc2 49000000.usb-otg:     complete_split: 0
 dwc2 49000000.usb-otg:     hub_addr: 0
 dwc2 49000000.usb-otg:     hub_port: 0
 dwc2 49000000.usb-otg:     xact_pos: 0
 dwc2 49000000.usb-otg:     requests: 0
 dwc2 49000000.usb-otg:     qh: beb5cc16
 dwc2 49000000.usb-otg:   Channel 11:
 dwc2 49000000.usb-otg:     dev_addr: 0, ep_num: 0, ep_is_in: 0
 dwc2 49000000.usb-otg:     speed: 0
 dwc2 49000000.usb-otg:     ep_type: 0
 dwc2 49000000.usb-otg:     max_packet: 0
 dwc2 49000000.usb-otg:     data_pid_start: 0
 dwc2 49000000.usb-otg:     multi_count: 0
 dwc2 49000000.usb-otg:     xfer_started: 0
 dwc2 49000000.usb-otg:     xfer_buf: beb5cc16
 dwc2 49000000.usb-otg:     xfer_dma: 00000000
 dwc2 49000000.usb-otg:     xfer_len: 0
 dwc2 49000000.usb-otg:     xfer_count: 0
 dwc2 49000000.usb-otg:     halt_on_queue: 0
 dwc2 49000000.usb-otg:     halt_pending: 0
 dwc2 49000000.usb-otg:     halt_status: 0
 dwc2 49000000.usb-otg:     do_split: 0
 dwc2 49000000.usb-otg:     complete_split: 0
 dwc2 49000000.usb-otg:     hub_addr: 0
 dwc2 49000000.usb-otg:     hub_port: 0
 dwc2 49000000.usb-otg:     xact_pos: 0
 dwc2 49000000.usb-otg:     requests: 0
 dwc2 49000000.usb-otg:     qh: beb5cc16
 dwc2 49000000.usb-otg:   Channel 12:
 dwc2 49000000.usb-otg:     dev_addr: 0, ep_num: 0, ep_is_in: 0
 dwc2 49000000.usb-otg:     speed: 0
 dwc2 49000000.usb-otg:     ep_type: 0
 dwc2 49000000.usb-otg:     max_packet: 0
 dwc2 49000000.usb-otg:     data_pid_start: 0
 dwc2 49000000.usb-otg:     multi_count: 0
 dwc2 49000000.usb-otg:     xfer_started: 0
 dwc2 49000000.usb-otg:     xfer_buf: beb5cc16
 dwc2 49000000.usb-otg:     xfer_dma: 00000000
 dwc2 49000000.usb-otg:     xfer_len: 0
 dwc2 49000000.usb-otg:     xfer_count: 0
 dwc2 49000000.usb-otg:     halt_on_queue: 0
 dwc2 49000000.usb-otg:     halt_pending: 0
 dwc2 49000000.usb-otg:     halt_status: 0
 dwc2 49000000.usb-otg:     do_split: 0
 dwc2 49000000.usb-otg:     complete_split: 0
 dwc2 49000000.usb-otg:     hub_addr: 0
 dwc2 49000000.usb-otg:     hub_port: 0
 dwc2 49000000.usb-otg:     xact_pos: 0
 dwc2 49000000.usb-otg:     requests: 0
 dwc2 49000000.usb-otg:     qh: beb5cc16
 dwc2 49000000.usb-otg:   Channel 13:
 dwc2 49000000.usb-otg:     dev_addr: 0, ep_num: 0, ep_is_in: 0
 dwc2 49000000.usb-otg:     speed: 0
 dwc2 49000000.usb-otg:     ep_type: 0
 dwc2 49000000.usb-otg:     max_packet: 0
 dwc2 49000000.usb-otg:     data_pid_start: 0
 dwc2 49000000.usb-otg:     multi_count: 0
 dwc2 49000000.usb-otg:     xfer_started: 0
 dwc2 49000000.usb-otg:     xfer_buf: beb5cc16
 dwc2 49000000.usb-otg:     xfer_dma: 00000000
 dwc2 49000000.usb-otg:     xfer_len: 0
 dwc2 49000000.usb-otg:     xfer_count: 0
 dwc2 49000000.usb-otg:     halt_on_queue: 0
 dwc2 49000000.usb-otg:     halt_pending: 0
 dwc2 49000000.usb-otg:     halt_status: 0
 dwc2 49000000.usb-otg:     do_split: 0
 dwc2 49000000.usb-otg:     complete_split: 0
 dwc2 49000000.usb-otg:     hub_addr: 0
 dwc2 49000000.usb-otg:     hub_port: 0
 dwc2 49000000.usb-otg:     xact_pos: 0
 dwc2 49000000.usb-otg:     requests: 0
 dwc2 49000000.usb-otg:     qh: beb5cc16
 dwc2 49000000.usb-otg:   Channel 14:
 dwc2 49000000.usb-otg:     dev_addr: 0, ep_num: 0, ep_is_in: 0
 dwc2 49000000.usb-otg:     speed: 0
 dwc2 49000000.usb-otg:     ep_type: 0
 dwc2 49000000.usb-otg:     max_packet: 0
 dwc2 49000000.usb-otg:     data_pid_start: 0
 dwc2 49000000.usb-otg:     multi_count: 0
 dwc2 49000000.usb-otg:     xfer_started: 0
 dwc2 49000000.usb-otg:     xfer_buf: beb5cc16
 dwc2 49000000.usb-otg:     xfer_dma: 00000000
 dwc2 49000000.usb-otg:     xfer_len: 0
 dwc2 49000000.usb-otg:     xfer_count: 0
 dwc2 49000000.usb-otg:     halt_on_queue: 0
 dwc2 49000000.usb-otg:     halt_pending: 0
 dwc2 49000000.usb-otg:     halt_status: 0
 dwc2 49000000.usb-otg:     do_split: 0
 dwc2 49000000.usb-otg:     complete_split: 0
 dwc2 49000000.usb-otg:     hub_addr: 0
 dwc2 49000000.usb-otg:     hub_port: 0
 dwc2 49000000.usb-otg:     xact_pos: 0
 dwc2 49000000.usb-otg:     requests: 0
 dwc2 49000000.usb-otg:     qh: beb5cc16
 dwc2 49000000.usb-otg:   Channel 15:
 dwc2 49000000.usb-otg:     dev_addr: 0, ep_num: 0, ep_is_in: 0
 dwc2 49000000.usb-otg:     speed: 0
 dwc2 49000000.usb-otg:     ep_type: 0
 dwc2 49000000.usb-otg:     max_packet: 0
 dwc2 49000000.usb-otg:     data_pid_start: 0
 dwc2 49000000.usb-otg:     multi_count: 0
 dwc2 49000000.usb-otg:     xfer_started: 0
 dwc2 49000000.usb-otg:     xfer_buf: beb5cc16
 dwc2 49000000.usb-otg:     xfer_dma: 00000000
 dwc2 49000000.usb-otg:     xfer_len: 0
 dwc2 49000000.usb-otg:     xfer_count: 0
 dwc2 49000000.usb-otg:     halt_on_queue: 0
 dwc2 49000000.usb-otg:     halt_pending: 0
 dwc2 49000000.usb-otg:     halt_status: 0
 dwc2 49000000.usb-otg:     do_split: 0
 dwc2 49000000.usb-otg:     complete_split: 0
 dwc2 49000000.usb-otg:     hub_addr: 0
 dwc2 49000000.usb-otg:     hub_port: 0
 dwc2 49000000.usb-otg:     xact_pos: 0
 dwc2 49000000.usb-otg:     requests: 0
 dwc2 49000000.usb-otg:     qh: beb5cc16
 dwc2 49000000.usb-otg:   non_periodic_channels: 0
 dwc2 49000000.usb-otg:   periodic_channels: 0
 dwc2 49000000.usb-otg:   periodic_usecs: 0
 dwc2 49000000.usb-otg:   NP Tx Req Queue Space Avail: 8
 dwc2 49000000.usb-otg:   NP Tx FIFO Space Avail: 1024
 dwc2 49000000.usb-otg:   P Tx Req Queue Space Avail: 8
 dwc2 49000000.usb-otg:   P Tx FIFO Space Avail: 1024
 dwc2 49000000.usb-otg: Core Global Registers
 dwc2 49000000.usb-otg: GOTGCTL  @0xF0960000 : 0x00010000
 dwc2 49000000.usb-otg: GOTGINT  @0xF0960004 : 0x00000000
 dwc2 49000000.usb-otg: GAHBCFG  @0xF0960008 : 0x00000022
 dwc2 49000000.usb-otg: GUSBCFG  @0xF096000C : 0x00001400
 dwc2 49000000.usb-otg: GRSTCTL  @0xF0960010 : 0x80000000
 dwc2 49000000.usb-otg: GINTSTS  @0xF0960014 : 0x04000022
 dwc2 49000000.usb-otg: GINTMSK  @0xF0960018 : 0xD8000806
 dwc2 49000000.usb-otg: GRXSTSR  @0xF096001C : 0x00000000
 dwc2 49000000.usb-otg: GRXFSIZ  @0xF0960024 : 0x00000400
 dwc2 49000000.usb-otg: GNPTXFSIZ        @0xF0960028 : 0x04000400
 dwc2 49000000.usb-otg: GNPTXSTS         @0xF096002C : 0x00080400
 dwc2 49000000.usb-otg: GI2CCTL  @0xF0960030 : 0x00000000
 dwc2 49000000.usb-otg: GPVNDCTL         @0xF0960034 : 0x00000000
 dwc2 49000000.usb-otg: GGPIO    @0xF0960038 : 0x00600000
 dwc2 49000000.usb-otg: GUID     @0xF096003C : 0x00004000
 dwc2 49000000.usb-otg: GSNPSID  @0xF0960040 : 0x4F54330A
 dwc2 49000000.usb-otg: GHWCFG1  @0xF0960044 : 0x00000000
 dwc2 49000000.usb-otg: GHWCFG2  @0xF0960048 : 0x228FE150
 dwc2 49000000.usb-otg: GHWCFG3  @0xF096004C : 0x03B892E8
 dwc2 49000000.usb-otg: GHWCFG4  @0xF0960050 : 0xE3F00030
 dwc2 49000000.usb-otg: GLPMCFG  @0xF0960054 : 0x00000000
 dwc2 49000000.usb-otg: GPWRDN   @0xF0960058 : 0x00200010
 dwc2 49000000.usb-otg: GDFIFOCFG        @0xF096005C : 0x03B80400
 dwc2 49000000.usb-otg: HPTXFSIZ         @0xF0960100 : 0x00000000
 dwc2 49000000.usb-otg: PCGCTL   @0xF0960E00 : 0x00000000
 dwc2 49000000.usb-otg: Host Global Registers
 dwc2 49000000.usb-otg: HCFG     @0xF0960400 : 0x00100000
 dwc2 49000000.usb-otg: HFIR     @0xF0960404 : 0x000017D7
 dwc2 49000000.usb-otg: HFNUM    @0xF0960408 : 0x00000000
 dwc2 49000000.usb-otg: HPTXSTS  @0xF0960410 : 0x00080400
 dwc2 49000000.usb-otg: HAINT    @0xF0960414 : 0x00000000
 dwc2 49000000.usb-otg: HAINTMSK         @0xF0960418 : 0x00000000
 dwc2 49000000.usb-otg: HPRT0    @0xF0960440 : 0x00000000
 dwc2 49000000.usb-otg: Host Channel 0 Specific Registers
 dwc2 49000000.usb-otg: HCCHAR   @0xF0960500 : 0x00000000
 dwc2 49000000.usb-otg: HCSPLT   @0xF0960504 : 0x00000000
 dwc2 49000000.usb-otg: HCINT    @0xF0960508 : 0x00000000
 dwc2 49000000.usb-otg: HCINTMSK         @0xF096050C : 0x00000000
 dwc2 49000000.usb-otg: HCTSIZ   @0xF0960510 : 0x00000000
 dwc2 49000000.usb-otg: HCDMA    @0xF0960514 : 0xA167DB6C
 dwc2 49000000.usb-otg: Host Channel 1 Specific Registers
 dwc2 49000000.usb-otg: HCCHAR   @0xF0960520 : 0x00000000
 dwc2 49000000.usb-otg: HCSPLT   @0xF0960524 : 0x00000000
 dwc2 49000000.usb-otg: HCINT    @0xF0960528 : 0x00000000
 dwc2 49000000.usb-otg: HCINTMSK         @0xF096052C : 0x00000000
 dwc2 49000000.usb-otg: HCTSIZ   @0xF0960530 : 0x00000000
 dwc2 49000000.usb-otg: HCDMA    @0xF0960534 : 0x6C5B347C
 dwc2 49000000.usb-otg: Host Channel 2 Specific Registers
 dwc2 49000000.usb-otg: HCCHAR   @0xF0960540 : 0x00000000
 dwc2 49000000.usb-otg: HCSPLT   @0xF0960544 : 0x00000000
 dwc2 49000000.usb-otg: HCINT    @0xF0960548 : 0x00000000
 dwc2 49000000.usb-otg: HCINTMSK         @0xF096054C : 0x00000000
 dwc2 49000000.usb-otg: HCTSIZ   @0xF0960550 : 0x00000000
 dwc2 49000000.usb-otg: HCDMA    @0xF0960554 : 0x503148EA
 dwc2 49000000.usb-otg: Host Channel 3 Specific Registers
 dwc2 49000000.usb-otg: HCCHAR   @0xF0960560 : 0x00000000
 dwc2 49000000.usb-otg: HCSPLT   @0xF0960564 : 0x00000000
 dwc2 49000000.usb-otg: HCINT    @0xF0960568 : 0x00000000
 dwc2 49000000.usb-otg: HCINTMSK         @0xF096056C : 0x00000000
 dwc2 49000000.usb-otg: HCTSIZ   @0xF0960570 : 0x00000000
 dwc2 49000000.usb-otg: HCDMA    @0xF0960574 : 0x9436577A
 dwc2 49000000.usb-otg: Host Channel 4 Specific Registers
 dwc2 49000000.usb-otg: HCCHAR   @0xF0960580 : 0x00000000
 dwc2 49000000.usb-otg: HCSPLT   @0xF0960584 : 0x00000000
 dwc2 49000000.usb-otg: HCINT    @0xF0960588 : 0x00000000
 dwc2 49000000.usb-otg: HCINTMSK         @0xF096058C : 0x00000000
 dwc2 49000000.usb-otg: HCTSIZ   @0xF0960590 : 0x00000000
 dwc2 49000000.usb-otg: HCDMA    @0xF0960594 : 0xB09AE0DE
 dwc2 49000000.usb-otg: Host Channel 5 Specific Registers
 dwc2 49000000.usb-otg: HCCHAR   @0xF09605A0 : 0x00000000
 dwc2 49000000.usb-otg: HCSPLT   @0xF09605A4 : 0x00000000
 dwc2 49000000.usb-otg: HCINT    @0xF09605A8 : 0x00000000
 dwc2 49000000.usb-otg: HCINTMSK         @0xF09605AC : 0x00000000
 dwc2 49000000.usb-otg: HCTSIZ   @0xF09605B0 : 0x00000000
 dwc2 49000000.usb-otg: HCDMA    @0xF09605B4 : 0xA8B8774F
 dwc2 49000000.usb-otg: Host Channel 6 Specific Registers
 dwc2 49000000.usb-otg: HCCHAR   @0xF09605C0 : 0x00000000
 dwc2 49000000.usb-otg: HCSPLT   @0xF09605C4 : 0x00000000
 dwc2 49000000.usb-otg: HCINT    @0xF09605C8 : 0x00000000
 dwc2 49000000.usb-otg: HCINTMSK         @0xF09605CC : 0x00000000
 dwc2 49000000.usb-otg: HCTSIZ   @0xF09605D0 : 0x00000000
 dwc2 49000000.usb-otg: HCDMA    @0xF09605D4 : 0x58D5E904
 dwc2 49000000.usb-otg: Host Channel 7 Specific Registers
 dwc2 49000000.usb-otg: HCCHAR   @0xF09605E0 : 0x00000000
 dwc2 49000000.usb-otg: HCSPLT   @0xF09605E4 : 0x00000000
 dwc2 49000000.usb-otg: HCINT    @0xF09605E8 : 0x00000000
 dwc2 49000000.usb-otg: HCINTMSK         @0xF09605EC : 0x00000000
 dwc2 49000000.usb-otg: HCTSIZ   @0xF09605F0 : 0x00000000
 dwc2 49000000.usb-otg: HCDMA    @0xF09605F4 : 0x8FBAE0D9
 dwc2 49000000.usb-otg: Host Channel 8 Specific Registers
 dwc2 49000000.usb-otg: HCCHAR   @0xF0960600 : 0x00000000
 dwc2 49000000.usb-otg: HCSPLT   @0xF0960604 : 0x00000000
 dwc2 49000000.usb-otg: HCINT    @0xF0960608 : 0x00000000
 dwc2 49000000.usb-otg: HCINTMSK         @0xF096060C : 0x00000000
 dwc2 49000000.usb-otg: HCTSIZ   @0xF0960610 : 0x00000000
 dwc2 49000000.usb-otg: HCDMA    @0xF0960614 : 0xE7B6AB62
 dwc2 49000000.usb-otg: Host Channel 9 Specific Registers
 dwc2 49000000.usb-otg: HCCHAR   @0xF0960620 : 0x00000000
 dwc2 49000000.usb-otg: HCSPLT   @0xF0960624 : 0x00000000
 dwc2 49000000.usb-otg: HCINT    @0xF0960628 : 0x00000000
 dwc2 49000000.usb-otg: HCINTMSK         @0xF096062C : 0x00000000
 dwc2 49000000.usb-otg: HCTSIZ   @0xF0960630 : 0x00000000
 dwc2 49000000.usb-otg: HCDMA    @0xF0960634 : 0x22F87FC6
 dwc2 49000000.usb-otg: Host Channel 10 Specific Registers
 dwc2 49000000.usb-otg: HCCHAR   @0xF0960640 : 0x00000000
 dwc2 49000000.usb-otg: HCSPLT   @0xF0960644 : 0x00000000
 dwc2 49000000.usb-otg: HCINT    @0xF0960648 : 0x00000000
 dwc2 49000000.usb-otg: HCINTMSK         @0xF096064C : 0x00000000
 dwc2 49000000.usb-otg: HCTSIZ   @0xF0960650 : 0x00000000
 dwc2 49000000.usb-otg: HCDMA    @0xF0960654 : 0x22F87FC6
 dwc2 49000000.usb-otg: Host Channel 11 Specific Registers
 dwc2 49000000.usb-otg: HCCHAR   @0xF0960660 : 0x00000000
 dwc2 49000000.usb-otg: HCSPLT   @0xF0960664 : 0x00000000
 dwc2 49000000.usb-otg: HCINT    @0xF0960668 : 0x00000000
 dwc2 49000000.usb-otg: HCINTMSK         @0xF096066C : 0x00000000
 dwc2 49000000.usb-otg: HCTSIZ   @0xF0960670 : 0x00000000
 dwc2 49000000.usb-otg: HCDMA    @0xF0960674 : 0x22F87FC6
 dwc2 49000000.usb-otg: Host Channel 12 Specific Registers
 dwc2 49000000.usb-otg: HCCHAR   @0xF0960680 : 0x00000000
 dwc2 49000000.usb-otg: HCSPLT   @0xF0960684 : 0x00000000
 dwc2 49000000.usb-otg: HCINT    @0xF0960688 : 0x00000000
 dwc2 49000000.usb-otg: HCINTMSK         @0xF096068C : 0x00000000
 dwc2 49000000.usb-otg: HCTSIZ   @0xF0960690 : 0x00000000
 dwc2 49000000.usb-otg: HCDMA    @0xF0960694 : 0x22F87FC6
 dwc2 49000000.usb-otg: Host Channel 13 Specific Registers
 dwc2 49000000.usb-otg: HCCHAR   @0xF09606A0 : 0x00000000
 dwc2 49000000.usb-otg: HCSPLT   @0xF09606A4 : 0x00000000
 dwc2 49000000.usb-otg: HCINT    @0xF09606A8 : 0x00000000
 dwc2 49000000.usb-otg: HCINTMSK         @0xF09606AC : 0x00000000
 dwc2 49000000.usb-otg: HCTSIZ   @0xF09606B0 : 0x00000000
 dwc2 49000000.usb-otg: HCDMA    @0xF09606B4 : 0x22F87FC6
 dwc2 49000000.usb-otg: Host Channel 14 Specific Registers
 dwc2 49000000.usb-otg: HCCHAR   @0xF09606C0 : 0x00000000
 dwc2 49000000.usb-otg: HCSPLT   @0xF09606C4 : 0x00000000
 dwc2 49000000.usb-otg: HCINT    @0xF09606C8 : 0x00000000
 dwc2 49000000.usb-otg: HCINTMSK         @0xF09606CC : 0x00000000
 dwc2 49000000.usb-otg: HCTSIZ   @0xF09606D0 : 0x00000000
 dwc2 49000000.usb-otg: HCDMA    @0xF09606D4 : 0x22F87FC6
 dwc2 49000000.usb-otg: Host Channel 15 Specific Registers
 dwc2 49000000.usb-otg: HCCHAR   @0xF09606E0 : 0x00000000
 dwc2 49000000.usb-otg: HCSPLT   @0xF09606E4 : 0x00000000
 dwc2 49000000.usb-otg: HCINT    @0xF09606E8 : 0x00000000
 dwc2 49000000.usb-otg: HCINTMSK         @0xF09606EC : 0x00000000
 dwc2 49000000.usb-otg: HCTSIZ   @0xF09606F0 : 0x00000000
 dwc2 49000000.usb-otg: HCDMA    @0xF09606F4 : 0x22F87FC6
 dwc2 49000000.usb-otg:
************************************************************
 dwc2 49000000.usb-otg:
 dwc2 49000000.usb-otg: gintsts=04000022  gintmsk=d8000806
 dwc2 49000000.usb-otg: GetPortStatus wIndex=0x0001 flags=0x00000000
 dwc2 49000000.usb-otg: Mode Mismatch Interrupt: currently in Device mode
 dwc2 49000000.usb-otg: dwc2_hsotg_irq: 04000020 00000000 (d8000806) retry 8
Minas Harutyunyan April 17, 2020, 9 a.m. UTC | #13
Hi,


On 4/16/2020 6:31 PM, Marek Vasut wrote:
> On 4/16/20 3:37 PM, Minas Harutyunyan wrote:

>> Or instead of patch, if you have any utility in system which will allow
>> from command line clear soft disconnect bit from DCTL register? Offset
>> of DCTL register is 0x804. SoftDiscon bit number is 1. Clear this bit
>> and then plug cable.
> 
> Clearing that bit with devmem allows the host PC to detect some
> high-speed device got connected, but that's it, it does not detect it as
> a gadget and no communication really happens.
> 

Please provide part of debug log on above mentioned scenario.

>> Unfortunately, currently I'm working from home and can't remotely
>> connect/disconnect cable in lab to try to reproduce observed by you issue.
> 
> Maybe you should consider using something like this in the lab:
> https://urldefense.com/v3/__https://www.ti.com/product/TS3USB30__;!!A4F2R9G_pg!O9sBVS3qah9rW57ccw0cT_8vz5fw0Ku3K_ZtNLuL2LNez4_AGF6wP2ZoKY2NF7yZ2vEfjmdg$
> 
Thanks for advise. I'll buy and setup multiplexer later, because 
currently I'm on quarantine and can't visit office.
> [...]
> 
>   dwc2 49000000.usb-otg: mapped PA 49000000 to VA 473352f1
>   dwc2 49000000.usb-otg: mapped PA 49000000 to VA 923761cb
>   dwc2 49000000.usb-otg: supply vusb_d not found, using dummy regulator
>   dwc2 49000000.usb-otg: supply vusb_a not found, using dummy regulator
>   dwc2 49000000.usb-otg: registering common handler for irq48
>   dwc2 49000000.usb-otg: dwc2_core_reset()
>   dwc2 49000000.usb-otg: Core Release: 3.30a (snpsid=4f54330a)
>   dwc2 49000000.usb-otg: Forcing mode to host
>   dwc2 49000000.usb-otg: Waiting for host mode
>   dwc2 49000000.usb-otg: Host mode set
>   dwc2 49000000.usb-otg: Forcing mode to device
>   dwc2 49000000.usb-otg: Waiting for device mode
>   dwc2 49000000.usb-otg: Device mode set
>   dwc2 49000000.usb-otg: Clearing force mode bits
>   dwc2 49000000.usb-otg: NonPeriodic TXFIFO size: 32
>   dwc2 49000000.usb-otg: RXFIFO size: 256
>   dwc2 49000000.usb-otg: EPs: 9, dedicated fifos, 952 entries in SPRAM

>   dwc2 49000000.usb-otg: bound driver zero
>   dwc2 49000000.usb-otg: dwc2_hsotg_pullup: is_on: 1 op_state: 0

>   dwc2 49000000.usb-otg: DCFG=0x08100000, DCTL=0x00000002, DIEPMSK=00000000
>   dwc2 49000000.usb-otg: GAHBCFG=0x00000000, GHWCFG1=0x00000000
>   dwc2 49000000.usb-otg: GRXFSIZ=0x00000400, GNPTXFSIZ=0x04000400
>   dwc2 49000000.usb-otg: DPTx[1] FSize=1024, StAddr=0x00000800
>   dwc2 49000000.usb-otg: DPTx[2] FSize=1024, StAddr=0x00000c00

Do you use zero gadget? Pay attention that bounding function driver and 
pullup set to 1 much earlier than core/dwc2 finished initialization.
Can you modprobe zero gadget after dwc2 fully initialized?

Thanks,
Minas
Marek Vasut April 20, 2020, 12:09 p.m. UTC | #14
On 4/17/20 11:00 AM, Minas Harutyunyan wrote:
> Hi,

Hi,

> On 4/16/2020 6:31 PM, Marek Vasut wrote:
>> On 4/16/20 3:37 PM, Minas Harutyunyan wrote:
> 
>>> Or instead of patch, if you have any utility in system which will allow
>>> from command line clear soft disconnect bit from DCTL register? Offset
>>> of DCTL register is 0x804. SoftDiscon bit number is 1. Clear this bit
>>> and then plug cable.
>>
>> Clearing that bit with devmem allows the host PC to detect some
>> high-speed device got connected, but that's it, it does not detect it as
>> a gadget and no communication really happens.
>>
> 
> Please provide part of debug log on above mentioned scenario.

~ # devmem 0x49000804
0x00000002

~ # devmem 0x49000804 w 0
[   38.420954] dwc2 49000000.usb-otg: gintsts=04008c20  gintmsk=d8000806
[   38.425950] dwc2 49000000.usb-otg: USB SUSPEND
[   38.430395] dwc2 49000000.usb-otg: dwc2_handle_usb_suspend_intr:
DSTS=0x400003
[   38.437630] dwc2 49000000.usb-otg: DSTS.Suspend Status=1 HWCFG4.Power
Optimize=1 HWCFG4.Hibernation=0
[   38.446866] dwc2 49000000.usb-otg: ignore suspend request before
enumeration
[   38.453934] dwc2 49000000.usb-otg: dwc2_hsotg_irq: 04008420 00000000
(d8000806) retry 8

~ # devmem 0x49000804
0x00000000

cable is plugged in below

[   50.224271] dwc2 49000000.usb-otg: gintsts=44008420  gintmsk=d8000806
[   50.229268] dwc2 49000000.usb-otg: Session request interrupt - lx_state=0
[   50.236072] dwc2 49000000.usb-otg: dwc2_hsotg_irq: 04008420 00000000
(d8000806) retry 8
[   50.292232] dwc2 49000000.usb-otg: gintsts=04008c20  gintmsk=d8000806
[   50.297219] dwc2 49000000.usb-otg: USB SUSPEND
[   50.301666] dwc2 49000000.usb-otg: dwc2_handle_usb_suspend_intr:
DSTS=0x400003
[   50.308902] dwc2 49000000.usb-otg: DSTS.Suspend Status=1 HWCFG4.Power
Optimize=1 HWCFG4.Hibernation=0
[   50.318141] dwc2 49000000.usb-otg: ignore suspend request before
enumeration
[   50.325209] dwc2 49000000.usb-otg: dwc2_hsotg_irq: 04008420 00000000
(d8000806) retry 8


>>> Unfortunately, currently I'm working from home and can't remotely
>>> connect/disconnect cable in lab to try to reproduce observed by you issue.
>>
>> Maybe you should consider using something like this in the lab:
>> https://urldefense.com/v3/__https://www.ti.com/product/TS3USB30__;!!A4F2R9G_pg!O9sBVS3qah9rW57ccw0cT_8vz5fw0Ku3K_ZtNLuL2LNez4_AGF6wP2ZoKY2NF7yZ2vEfjmdg$
>>
> Thanks for advise. I'll buy and setup multiplexer later, because 
> currently I'm on quarantine and can't visit office.

Sure, hope it helps.

>> [...]
>>
>>   dwc2 49000000.usb-otg: mapped PA 49000000 to VA 473352f1
>>   dwc2 49000000.usb-otg: mapped PA 49000000 to VA 923761cb
>>   dwc2 49000000.usb-otg: supply vusb_d not found, using dummy regulator
>>   dwc2 49000000.usb-otg: supply vusb_a not found, using dummy regulator
>>   dwc2 49000000.usb-otg: registering common handler for irq48
>>   dwc2 49000000.usb-otg: dwc2_core_reset()
>>   dwc2 49000000.usb-otg: Core Release: 3.30a (snpsid=4f54330a)
>>   dwc2 49000000.usb-otg: Forcing mode to host
>>   dwc2 49000000.usb-otg: Waiting for host mode
>>   dwc2 49000000.usb-otg: Host mode set
>>   dwc2 49000000.usb-otg: Forcing mode to device
>>   dwc2 49000000.usb-otg: Waiting for device mode
>>   dwc2 49000000.usb-otg: Device mode set
>>   dwc2 49000000.usb-otg: Clearing force mode bits
>>   dwc2 49000000.usb-otg: NonPeriodic TXFIFO size: 32
>>   dwc2 49000000.usb-otg: RXFIFO size: 256
>>   dwc2 49000000.usb-otg: EPs: 9, dedicated fifos, 952 entries in SPRAM
> 
>>   dwc2 49000000.usb-otg: bound driver zero
>>   dwc2 49000000.usb-otg: dwc2_hsotg_pullup: is_on: 1 op_state: 0
> 
>>   dwc2 49000000.usb-otg: DCFG=0x08100000, DCTL=0x00000002, DIEPMSK=00000000
>>   dwc2 49000000.usb-otg: GAHBCFG=0x00000000, GHWCFG1=0x00000000
>>   dwc2 49000000.usb-otg: GRXFSIZ=0x00000400, GNPTXFSIZ=0x04000400
>>   dwc2 49000000.usb-otg: DPTx[1] FSize=1024, StAddr=0x00000800
>>   dwc2 49000000.usb-otg: DPTx[2] FSize=1024, StAddr=0x00000c00
> 
> Do you use zero gadget?

Yes

> Pay attention that bounding function driver and 
> pullup set to 1 much earlier than core/dwc2 finished initialization.
> Can you modprobe zero gadget after dwc2 fully initialized?

I have the zero gadget compiled into the kernel, I would expect that
should work too, right ?
Minas Harutyunyan April 22, 2020, 1:45 p.m. UTC | #15
Hi,

On 4/20/2020 4:09 PM, Marek Vasut wrote:
> On 4/17/20 11:00 AM, Minas Harutyunyan wrote:
>> Hi,
> 
> Hi,
> 
>> On 4/16/2020 6:31 PM, Marek Vasut wrote:
>>> On 4/16/20 3:37 PM, Minas Harutyunyan wrote:
>>
Looks like I found cause of issue. According to your logs GINTMSK set 
host masks, at least USB Reset not unmasked which required for device mode.
Why it happen. During dwc2 driver probe first initialized device part 
then host part. Because of your g_zero is builtin in Kernel it 
immediately bound to dwc2, as result called main device initialization 
dwc2_hsotg_core_init_disconnected() which at least set GINTMSK for 
device mode. After gadget side initialization done, dwc2 go to host 
initialization hcd_init() and reset GINTMSK to host masks. In this case 
connecting cable to host will ignore USBReset and stacked. Your initial 
patch including call to function dwc2_hsotg_core_init_disconnected(), 
which allow to restore device mode masks and on cable connect start 
working as device.
First to check my assumption, please build g_zero as module and modprobe 
it after dwc2 modprobe will be done. If the tests will pass then will 
think how resolve issue with builtin functions.

Thanks,
Minas
Marek Vasut April 22, 2020, 2:21 p.m. UTC | #16
On 4/22/20 3:45 PM, Minas Harutyunyan wrote:
> Hi,

Hi,

> On 4/20/2020 4:09 PM, Marek Vasut wrote:
>> On 4/17/20 11:00 AM, Minas Harutyunyan wrote:
>>> Hi,
>>
>> Hi,
>>
>>> On 4/16/2020 6:31 PM, Marek Vasut wrote:
>>>> On 4/16/20 3:37 PM, Minas Harutyunyan wrote:
>>>
> Looks like I found cause of issue. According to your logs GINTMSK set 
> host masks, at least USB Reset not unmasked which required for device mode.
> Why it happen. During dwc2 driver probe first initialized device part 
> then host part. Because of your g_zero is builtin in Kernel it 
> immediately bound to dwc2, as result called main device initialization 
> dwc2_hsotg_core_init_disconnected() which at least set GINTMSK for 
> device mode. After gadget side initialization done, dwc2 go to host 
> initialization hcd_init() and reset GINTMSK to host masks. In this case 
> connecting cable to host will ignore USBReset and stacked. Your initial 
> patch including call to function dwc2_hsotg_core_init_disconnected(), 
> which allow to restore device mode masks and on cable connect start 
> working as device.
> First to check my assumption, please build g_zero as module and modprobe 
> it after dwc2 modprobe will be done. If the tests will pass then will 
> think how resolve issue with builtin functions.

Using g_zero as a module seems to work too, so please proceed.
Marek Vasut May 14, 2020, 12:10 a.m. UTC | #17
On 4/22/20 4:21 PM, Marek Vasut wrote:
> On 4/22/20 3:45 PM, Minas Harutyunyan wrote:
>> Hi,
> 
> Hi,
> 
>> On 4/20/2020 4:09 PM, Marek Vasut wrote:
>>> On 4/17/20 11:00 AM, Minas Harutyunyan wrote:
>>>> Hi,
>>>
>>> Hi,
>>>
>>>> On 4/16/2020 6:31 PM, Marek Vasut wrote:
>>>>> On 4/16/20 3:37 PM, Minas Harutyunyan wrote:
>>>>
>> Looks like I found cause of issue. According to your logs GINTMSK set 
>> host masks, at least USB Reset not unmasked which required for device mode.
>> Why it happen. During dwc2 driver probe first initialized device part 
>> then host part. Because of your g_zero is builtin in Kernel it 
>> immediately bound to dwc2, as result called main device initialization 
>> dwc2_hsotg_core_init_disconnected() which at least set GINTMSK for 
>> device mode. After gadget side initialization done, dwc2 go to host 
>> initialization hcd_init() and reset GINTMSK to host masks. In this case 
>> connecting cable to host will ignore USBReset and stacked. Your initial 
>> patch including call to function dwc2_hsotg_core_init_disconnected(), 
>> which allow to restore device mode masks and on cable connect start 
>> working as device.
>> First to check my assumption, please build g_zero as module and modprobe 
>> it after dwc2 modprobe will be done. If the tests will pass then will 
>> think how resolve issue with builtin functions.
> 
> Using g_zero as a module seems to work too, so please proceed.

Any news on using g_zero as built-in ?
Minas Harutyunyan May 15, 2020, 7:41 a.m. UTC | #18
Hi Marek,

On 5/14/2020 4:10 AM, Marek Vasut wrote:
> On 4/22/20 4:21 PM, Marek Vasut wrote:
>> On 4/22/20 3:45 PM, Minas Harutyunyan wrote:
>>> Hi,
>>
>> Hi,
>>
>>> On 4/20/2020 4:09 PM, Marek Vasut wrote:
>>>> On 4/17/20 11:00 AM, Minas Harutyunyan wrote:
>>>>> Hi,
>>>>
>>>> Hi,
>>>>
>>>>> On 4/16/2020 6:31 PM, Marek Vasut wrote:
>>>>>> On 4/16/20 3:37 PM, Minas Harutyunyan wrote:
>>>>>
>>> Looks like I found cause of issue. According to your logs GINTMSK set
>>> host masks, at least USB Reset not unmasked which required for device mode.
>>> Why it happen. During dwc2 driver probe first initialized device part
>>> then host part. Because of your g_zero is builtin in Kernel it
>>> immediately bound to dwc2, as result called main device initialization
>>> dwc2_hsotg_core_init_disconnected() which at least set GINTMSK for
>>> device mode. After gadget side initialization done, dwc2 go to host
>>> initialization hcd_init() and reset GINTMSK to host masks. In this case
>>> connecting cable to host will ignore USBReset and stacked. Your initial
>>> patch including call to function dwc2_hsotg_core_init_disconnected(),
>>> which allow to restore device mode masks and on cable connect start
>>> working as device.
>>> First to check my assumption, please build g_zero as module and modprobe
>>> it after dwc2 modprobe will be done. If the tests will pass then will
>>> think how resolve issue with builtin functions.
>>
>> Using g_zero as a module seems to work too, so please proceed.
> 
> Any news on using g_zero as built-in ?
> 
Could you please test with this patch.

diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
index 12b98b466287..7faf5f8c056d 100644
--- a/drivers/usb/dwc2/gadget.c
+++ b/drivers/usb/dwc2/gadget.c
@@ -4920,12 +4920,6 @@ int dwc2_gadget_init(struct dwc2_hsotg *hsotg)
  					  epnum, 0);
  	}

-	ret = usb_add_gadget_udc(dev, &hsotg->gadget);
-	if (ret) {
-		dwc2_hsotg_ep_free_request(&hsotg->eps_out[0]->ep,
-					   hsotg->ctrl_req);
-		return ret;
-	}
  	dwc2_hsotg_dump(hsotg);

  	return 0;
diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c
index 8ea4a24637fa..603b85cd8ed3 100644
--- a/drivers/usb/dwc2/platform.c
+++ b/drivers/usb/dwc2/platform.c
@@ -537,6 +537,16 @@ static int dwc2_driver_probe(struct platform_device 
*dev)
  	if (hsotg->dr_mode == USB_DR_MODE_PERIPHERAL)
  		dwc2_lowlevel_hw_disable(hsotg);

+	/* Postponed adding a new gadget to the udc class driver list */
+	if (hsotg->gadget_enabled) {
+		retval = usb_add_gadget_udc(hsotg->dev, &hsotg->gadget);
+		if (retval) {
+			dwc2_hsotg_remove(hsotg);
+			goto error_init;
+		}
+
+	}
+
  	return 0;

  error_init:



Thanks,
Minas
Minas Harutyunyan May 27, 2020, 6:17 a.m. UTC | #19
Hi Marek,

On 5/15/2020 11:41 AM, Minas Harutyunyan wrote:
> Hi Marek,

Any update on on this patch testing?

Thanks,
Minas

>>
> Could you please test with this patch.
> 
> diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
> index 12b98b466287..7faf5f8c056d 100644
> --- a/drivers/usb/dwc2/gadget.c
> +++ b/drivers/usb/dwc2/gadget.c
> @@ -4920,12 +4920,6 @@ int dwc2_gadget_init(struct dwc2_hsotg *hsotg)
>    					  epnum, 0);
>    	}
> 
> -	ret = usb_add_gadget_udc(dev, &hsotg->gadget);
> -	if (ret) {
> -		dwc2_hsotg_ep_free_request(&hsotg->eps_out[0]->ep,
> -					   hsotg->ctrl_req);
> -		return ret;
> -	}
>    	dwc2_hsotg_dump(hsotg);
> 
>    	return 0;
> diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c
> index 8ea4a24637fa..603b85cd8ed3 100644
> --- a/drivers/usb/dwc2/platform.c
> +++ b/drivers/usb/dwc2/platform.c
> @@ -537,6 +537,16 @@ static int dwc2_driver_probe(struct platform_device
> *dev)
>    	if (hsotg->dr_mode == USB_DR_MODE_PERIPHERAL)
>    		dwc2_lowlevel_hw_disable(hsotg);
> 
> +	/* Postponed adding a new gadget to the udc class driver list */
> +	if (hsotg->gadget_enabled) {
> +		retval = usb_add_gadget_udc(hsotg->dev, &hsotg->gadget);
> +		if (retval) {
> +			dwc2_hsotg_remove(hsotg);
> +			goto error_init;
> +		}
> +
> +	}
> +
>    	return 0;
> 
>    error_init:
> 
> 
> 
> Thanks,
> Minas
>
Marek Vasut May 28, 2020, 10:35 p.m. UTC | #20
On 5/27/20 8:17 AM, Minas Harutyunyan wrote:
> Hi Marek,

Hi,

> On 5/15/2020 11:41 AM, Minas Harutyunyan wrote:
>> Hi Marek,
> 
> Any update on on this patch testing?
> 
> Thanks,
> Minas
> 
>>>
>> Could you please test with this patch.

Yes, that works, thanks.

This should likely get a Stable: tag when submitting.
diff mbox series

Patch

diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c
index b90f858af960..ead605efeb24 100644
--- a/drivers/usb/dwc2/hcd.c
+++ b/drivers/usb/dwc2/hcd.c
@@ -5237,6 +5237,11 @@  int dwc2_hcd_init(struct dwc2_hsotg *hsotg)
 
 	dwc2_enable_global_interrupts(hsotg);
 
+	dwc2_hsotg_core_init_disconnected(hsotg, false);
+	/* Enable ACG feature in device mode,if supported */
+	dwc2_enable_acg(hsotg);
+	dwc2_hsotg_core_connect(hsotg);
+
 	return 0;
 
 error4: