Skip to content

usb: dwc2: Add USB DRD support on CV1800 Series SoC

Inochi Amaoto linux-usb lkml 2 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 0 repliesNew
  2. v14 patches 6 repliesSuperseded

Changes in v2 from the cover letter

- https://lore.kernel.org/linux-usb/[email protected]
1. the DTS patch is dropped and will be sent separately.
patch 2:
1. fix wrong is_host check in dwc2_drd_init()
2. remove unnecessary role check before setting phy mode in dwc2_drd_role_sw_set()

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3usb: dwc2: gadget: honor pullup requests in core_connectdrivers/usb/dwc2/gadget.c+2 -10 replies
2/3usb: dwc2: drd: Sync the generic PHY mode with role requestsdrivers/usb/dwc2/core.h drivers/usb/dwc2/drd.c drivers/usb/dwc2/platform.c+41 -110 replies
3/3usb: dwc2: Add USB DRD support on CV1800 series SoCdrivers/usb/dwc2/core.h drivers/usb/dwc2/drd.c drivers/usb/dwc2/params.c+25 -80 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/3] usb: dwc2: Add USB DRD support on CV1800 Series SoC

The current DRD implementation of DRD will cause a interrupt flow on CV1800 Series SoC. It has two reasons:
1. The DRD does not sync the phy mode when change the controller mode, it is a violation of the DRD as it does not rely on a OTG phy.
2. The CV1800 is entered with a Session End Detected interrupt, but the DRD code has no change on it, so the controller will enter the interrupt storm.

This patch add fixes for these two problem, and I have tested this on a Huashan PI board (it has a CV1812H SoC).

Note: This patches set does not resolve all the problems, as
usb_add_hcd() will override the role set by dwc2, but I am not sure whether it should change skip_phy_initialization of hcd. So I kept it as it is and users still needs to set the role in the userspace as "role-switch-default-mode" in devicetree takes no effect.

Changed from v1:
- https://lore.kernel.org/linux-usb/[email protected]
1. the DTS patch is dropped and will be sent separately.
patch 2:
1. fix wrong is_host check in dwc2_drd_init()
2. remove unnecessary role check before setting phy mode in dwc2_drd_role_sw_set()

Inochi Amaoto (3):
usb: dwc2: gadget: honor pullup requests in core_connect
usb: dwc2: drd: Sync the generic PHY mode with role requests
usb: dwc2: Add USB DRD support on CV1800 series SoC

 drivers/usb/dwc2/core.h     |  5 ++-
 drivers/usb/dwc2/drd.c      | 75 ++++++++++++++++++++++++++++---------
 drivers/usb/dwc2/gadget.c   |  3 +-
 drivers/usb/dwc2/params.c   |  1 +
 drivers/usb/dwc2/platform.c |  4 +-
 5 files changed, 68 insertions(+), 20 deletions(-)

--
2.56.0