mbox series

[v5,00/16] Add Rockchip RK3399 USB3.0 Host support

Message ID 20200513071344.5430-1-frank.wang@rock-chips.com
Headers show
Series Add Rockchip RK3399 USB3.0 Host support | expand

Message

Frank Wang May 13, 2020, 7:13 a.m. UTC
This series add quirks for DWC3 and add Rockchip RK3399 USB3.0 host support.

The function has been tested pass on rk3399-evb and roc-rk3399-pc board.

For V5 update:
 - Fix dwc3-generic driver followed Marek's comments for [PATCH v4 12/16].
 - Add 'Reviewed-by' and 'Tested-by' tag for [PATCH v4 07/16] and [PATCH v4 08/16].

For V4 update:
 - Collect Jagan's all fixed patches [1].
 - Amend specific u-boot changes from dts to dtsi for [PATCH v3 6/7].

For V3 update:
 - Fix compile error for [PATCH v2 1/9].
 - Use Jagan's Type-C driver instead of [PATCH v2 5/9].
 - Cleanup dts changes for [PATCH v2 7/9].
 - Cleanup config changes for [PATCH v2 8/9] and [PATCH v2 9/9].

For V2 update:
 - Amend type-c driver followed Jagan's comments for [PATCH 5/8].
 - Fix dts commit for [PATCH 7/8].
 - Split RK3399 default config for [PATCH 8/8].
 - Add 'Reviewed-by' tag for [PATCH 1/8], [PATCH 2/8] and [PATCH 3/8].

[1] https://patchwork.ozlabs.org/project/uboot/cover/20200506075025.1677-1-jagan at amarulasolutions.com

BR,
Frank

Frank Wang (7):
  usb: dwc3: add dis_enblslpm_quirk
  usb: dwc3: add dis_u2_freeclk_exists_quirk
  usb: dwc3: amend UTMI/UTMIW phy interface setup
  usb: dwc3: add make compatible for rockchip platform
  driver: usb: drop legacy rockchip xhci driver
  ARM: dts: rk3399-evb: usb3.0 host support
  configs: evb-rk3399: update support usb3.0 host

Jagan Teki (9):
  clk: rk3399: Enable/Disable the USB2PHY clk
  clk: rk3399: Set empty for TCPHY assigned-clocks
  clk: rk3399: Enable/Disable TCPHY clocks
  phy: rockchip: Add Rockchip USB2PHY driver
  arm64: dts: rk3399: Move u2phy into root port
  phy: rockchip: Add Rockchip USB TypeC PHY driver
  usb: dwc3: Add disable u2mac linestate check quirk
  usb: dwc3: Enable AutoRetry feature in the controller
  roc-rk3399-pc: Enable USB3.0 Host

 arch/arm/dts/rk3399-evb-u-boot.dtsi           |  13 +
 arch/arm/dts/rk3399.dtsi                      | 108 +--
 configs/evb-rk3399_defconfig                  |   6 +
 configs/roc-pc-mezzanine-rk3399_defconfig     |   5 +
 configs/roc-pc-rk3399_defconfig               |   6 +
 drivers/Makefile                              |   1 +
 drivers/clk/rockchip/clk_rk3399.c             |  38 +
 drivers/phy/Kconfig                           |   1 +
 drivers/phy/rockchip/Kconfig                  |  21 +
 drivers/phy/rockchip/Makefile                 |   7 +
 drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 312 +++++++
 drivers/phy/rockchip/phy-rockchip-typec.c     | 796 ++++++++++++++++++
 drivers/usb/common/common.c                   |  25 +
 drivers/usb/dwc3/core.c                       | 106 ++-
 drivers/usb/dwc3/core.h                       |  19 +
 drivers/usb/dwc3/dwc3-generic.c               |  33 +-
 drivers/usb/host/Kconfig                      |   9 -
 drivers/usb/host/Makefile                     |   1 -
 drivers/usb/host/xhci-rockchip.c              | 196 -----
 include/dwc3-uboot.h                          |   3 +
 include/linux/usb/phy.h                       |  18 +
 21 files changed, 1427 insertions(+), 297 deletions(-)
 create mode 100644 drivers/phy/rockchip/Kconfig
 create mode 100644 drivers/phy/rockchip/Makefile
 create mode 100644 drivers/phy/rockchip/phy-rockchip-inno-usb2.c
 create mode 100644 drivers/phy/rockchip/phy-rockchip-typec.c
 delete mode 100644 drivers/usb/host/xhci-rockchip.c

Comments

Marcin Juszkiewicz May 25, 2020, 9:06 a.m. UTC | #1
W dniu 13.05.2020 o 09:13, frank.wang at rock-chips.com (Frank Wang) pisze:
> This series add quirks for DWC3 and add Rockchip RK3399 USB3.0 host support.
> 
> The function has been tested pass on rk3399-evb and roc-rk3399-pc board.
> 
> For V5 update:
>  - Fix dwc3-generic driver followed Marek's comments for [PATCH v4 12/16].
>  - Add 'Reviewed-by' and 'Tested-by' tag for [PATCH v4 07/16] and [PATCH v4 08/16].

I imported patchset and started it on RockPro64. Enabled same config
options as on evb-rk3399. DeviceTree entries were already setup.

Pendrive in USB3 (type A) port gets recognized as SuperSpeed one (was
HighSpeed before). Type C port is not working - nevermind is it empty,
with usb-c pendrive plugged or with usb-c to usb-a/c/hdmi dongle with
usb-a pendrive.

=> usb start 
starting USB...
Bus usb at fe380000: USB EHCI 1.00
Bus usb at fe3c0000: USB EHCI 1.00
Bus dwc3: usb maximum-speed not found
Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.10
scanning bus usb at fe380000 for devices... 1 USB Device(s) found
scanning bus usb at fe3c0000 for devices... 1 USB Device(s) found
scanning bus dwc3 for devices... cannot reset port 1!?
2 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found

=> usb tree
USB device tree:
  1  Hub (480 Mb/s, 0mA)
     u-boot EHCI Host Controller 
   
  1  Hub (480 Mb/s, 0mA)
     u-boot EHCI Host Controller 
   
  1  Hub (5 Gb/s, 0mA)
  |  U-Boot XHCI Host Controller 
  |
  +-2  Mass Storage (5 Gb/s, 76mA)
       ADATA ADATA USB Flash Drive 1520405012240002
Jagan Teki May 25, 2020, 9:24 a.m. UTC | #2
On Mon, May 25, 2020 at 2:36 PM Marcin Juszkiewicz
<marcin at juszkiewicz.com.pl> wrote:
>
> W dniu 13.05.2020 o 09:13, frank.wang at rock-chips.com (Frank Wang) pisze:
> > This series add quirks for DWC3 and add Rockchip RK3399 USB3.0 host support.
> >
> > The function has been tested pass on rk3399-evb and roc-rk3399-pc board.
> >
> > For V5 update:
> >  - Fix dwc3-generic driver followed Marek's comments for [PATCH v4 12/16].
> >  - Add 'Reviewed-by' and 'Tested-by' tag for [PATCH v4 07/16] and [PATCH v4 08/16].
>
> I imported patchset and started it on RockPro64. Enabled same config
> options as on evb-rk3399. DeviceTree entries were already setup.
>
> Pendrive in USB3 (type A) port gets recognized as SuperSpeed one (was
> HighSpeed before). Type C port is not working - nevermind is it empty,
> with usb-c pendrive plugged or with usb-c to usb-a/c/hdmi dongle with
> usb-a pendrive.

Does that mean usb-c pendrive is also detected?

Jagan.
Marcin Juszkiewicz May 25, 2020, 9:27 a.m. UTC | #3
W dniu 25.05.2020 o?11:24, Jagan Teki pisze:
> On Mon, May 25, 2020 at 2:36 PM Marcin Juszkiewicz
> <marcin at juszkiewicz.com.pl> wrote:
>>
>> W dniu 13.05.2020 o 09:13, frank.wang at rock-chips.com (Frank Wang) pisze:
>>> This series add quirks for DWC3 and add Rockchip RK3399 USB3.0 host support.
>>>
>>> The function has been tested pass on rk3399-evb and roc-rk3399-pc board.
>>>
>>> For V5 update:
>>>  - Fix dwc3-generic driver followed Marek's comments for [PATCH v4 12/16].
>>>  - Add 'Reviewed-by' and 'Tested-by' tag for [PATCH v4 07/16] and [PATCH v4 08/16].
>>
>> I imported patchset and started it on RockPro64. Enabled same config
>> options as on evb-rk3399. DeviceTree entries were already setup.
>>
>> Pendrive in USB3 (type A) port gets recognized as SuperSpeed one (was
>> HighSpeed before). Type C port is not working - nevermind is it empty,
>> with usb-c pendrive plugged or with usb-c to usb-a/c/hdmi dongle with
>> usb-a pendrive.
> 
> Does that mean usb-c pendrive is also detected?

No - "scanning bus dwc3 for devices... cannot reset port 1!?" every time
and devices plugged into usb-c are ignored.
Jagan Teki May 25, 2020, 9:32 a.m. UTC | #4
On Mon, May 25, 2020 at 2:57 PM Marcin Juszkiewicz
<marcin at juszkiewicz.com.pl> wrote:
>
> W dniu 25.05.2020 o 11:24, Jagan Teki pisze:
> > On Mon, May 25, 2020 at 2:36 PM Marcin Juszkiewicz
> > <marcin at juszkiewicz.com.pl> wrote:
> >>
> >> W dniu 13.05.2020 o 09:13, frank.wang at rock-chips.com (Frank Wang) pisze:
> >>> This series add quirks for DWC3 and add Rockchip RK3399 USB3.0 host support.
> >>>
> >>> The function has been tested pass on rk3399-evb and roc-rk3399-pc board.
> >>>
> >>> For V5 update:
> >>>  - Fix dwc3-generic driver followed Marek's comments for [PATCH v4 12/16].
> >>>  - Add 'Reviewed-by' and 'Tested-by' tag for [PATCH v4 07/16] and [PATCH v4 08/16].
> >>
> >> I imported patchset and started it on RockPro64. Enabled same config
> >> options as on evb-rk3399. DeviceTree entries were already setup.
> >>
> >> Pendrive in USB3 (type A) port gets recognized as SuperSpeed one (was
> >> HighSpeed before). Type C port is not working - nevermind is it empty,
> >> with usb-c pendrive plugged or with usb-c to usb-a/c/hdmi dongle with
> >> usb-a pendrive.
> >
> > Does that mean usb-c pendrive is also detected?
>
> No - "scanning bus dwc3 for devices... cannot reset port 1!?" every time
> and devices plugged into usb-c are ignored.

Can you check 'usb reset' after 'usb start'
Marcin Juszkiewicz May 25, 2020, 9:36 a.m. UTC | #5
W dniu 25.05.2020 o?11:32, Jagan Teki pisze:
> On Mon, May 25, 2020 at 2:57 PM Marcin Juszkiewicz

>> No - "scanning bus dwc3 for devices... cannot reset port 1!?" every time
>> and devices plugged into usb-c are ignored.
> 
> Can you check 'usb reset' after 'usb start'

Same situation after each 'usb reset' command.
Jagan Teki May 26, 2020, 4:17 a.m. UTC | #6
On Mon, May 25, 2020 at 3:06 PM Marcin Juszkiewicz
<marcin at juszkiewicz.com.pl> wrote:
>
> W dniu 25.05.2020 o 11:32, Jagan Teki pisze:
> > On Mon, May 25, 2020 at 2:57 PM Marcin Juszkiewicz
>
> >> No - "scanning bus dwc3 for devices... cannot reset port 1!?" every time
> >> and devices plugged into usb-c are ignored.
> >
> > Can you check 'usb reset' after 'usb start'
>
> Same situation after each 'usb reset' command.

Can you check v6, I have marked you CC. I've a Sandisk Type C disk
which got worked with rock-rk3399-pc.

Jagan.