Skip to content

usb: dwc3: meson: add OTG support for GXL/GXM

Neil Armstrong linux-amlogic linux-arm-kernel linux-devicetree linux-usb lkml 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest8 patches 3 repliesIn review
  2. v214 patches 11 repliesSuperseded
  3. v113 patches 17 repliesSuperseded

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8usb: dwc3: meson-g12a: refactor usb initdrivers/usb/dwc3/dwc3-meson-g12a.c+37 -151 reply
2/8usb: dwc3: meson-g12a: support the GXL/GXM DWC3 host phy disconnectdrivers/usb/dwc3/dwc3-meson-g12a.c+34 -01 reply
3/8usb: dwc3: meson-g12a: add support for GXL and GXM SoCsdrivers/usb/dwc3/dwc3-meson-g12a.c+101 -11 reply
4/8arm64: dts: amlogic: use the new USB control driver for GXL and GXMarch/arm64/boot/dts/amlogic/meson-gx-libretech-pc.dtsi arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi arch/arm64/boot/dts/amlogic/meson-gxl-s805x-libretech-ac.dts +13 more+68 -310 replies
5/8phy: amlogic: meson-gxl-usb3: remove code for non-existing PHYDocumentation/devicetree/bindings/phy/meson-gxl-usb3-phy.txt drivers/phy/amlogic/Kconfig drivers/phy/amlogic/Makefile +1 more+0 -3270 replies
6/8usb: dwc3: of-simple: remove Amlogic GXL and AXG compatiblesdrivers/usb/dwc3/dwc3-of-simple.c+6 -240 replies
7/8doc: dt: bindings: usb: dwc3: remove amlogic compatible entriesDocumentation/devicetree/bindings/usb/dwc3.txt+0 -20 replies
8/8dt-bindings: usb: dwc3: remove old DWC3 wrapperDocumentation/devicetree/bindings/usb/amlogic,dwc3.txt+0 -420 replies

Reviews trailers per patch

5 of 8 patches have a Reviewed-by or Acked-by.

PatchRob HerringMartin Blumenstingl
1/8R-b
2/8R-b
3/8R-b
4/8
5/8
6/8
7/8A-b
8/8A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/8] usb: dwc3: meson: add OTG support for GXL/GXM

The USB support was initialy done with a set of PHYs and dwc3-of-simple because the architecture of the USB complex was not understood correctly at the time (and proper documentation was missing...).

But with the G12A family, the USB complex was correctly understood and implemented correctly.
But seems the G12A architecture was derived for the GXL USB architecture, with minor differences and looks we can share most of the USB DWC3 glue driver.

This patchset refactors and adds callbacks to handle the architecture difference while keeping the main code shared.

The main difference is that on GXL/GXM the USB2 PHY control registers are mixed with the PHY registers (we already handle correctly), and the GLUE registers are allmost (99%) the same as G12A.

But, the GXL/GXM HW is buggy, here are the quirks :
- for the DWC2 controller to reset correctly, the GLUE mux must be switched to peripheral when the PHYs are powered up.
- when manually switching from Host to Device when the USB port is not populated (should not happen with proper Micro-USB/USB-C OTG switch), it makes the DWC3 to crash. The only way to avoid that is to use the Host Disconnect bit to disconnect the DWC3 controller from the port, but we can't recover the Host functionnality unless resetting the DWC3 controller. This bit is set when only manual switch is done, and a warning is printed on manual switching.

The patches 1-3 should be applied first, then either waiting the next release or if the usb maintainer can provide us a stable tag, we can use it to merge the DT and bindings.

Changes since v2 at [2]:
- Removed first 6 applied patches
- rebased on usb/testing/next
- Fixed dwc3_meson_g12a_usb2_init in patch 1
- Fixed leftover usage of dwc3_meson_g12a_usb_init in patch 1
- Moved post_init callback before child node probe to avoid bad dwc3 init

Changes since v1 at [1]:
- Fixed DT bindings to take in account usb2-phy2 on GXM
- Added comment in patch2
- Fixed patch 5 and moved fix out
- Collected tags
- Lower DT patch changes, switch p20x-q20x port B as OTG by default

[1] http://lkml.kernel.org/r/[email protected]
[2] http://lkml.kernel.org/r/[email protected]

Martin Blumenstingl (4):
arm64: dts: amlogic: use the new USB control driver for GXL and GXM
phy: amlogic: meson-gxl-usb3: remove code for non-existing PHY
usb: dwc3: of-simple: remove Amlogic GXL and AXG compatibles
dt-bindings: usb: dwc3: remove old DWC3 wrapper

Neil Armstrong (4):
usb: dwc3: meson-g12a: refactor usb init
usb: dwc3: meson-g12a: support the GXL/GXM DWC3 host phy disconnect
usb: dwc3: meson-g12a: add support for GXL and GXM SoCs
doc: dt: bindings: usb: dwc3: remove amlogic compatible entries

 .../bindings/phy/meson-gxl-usb3-phy.txt       |  31 --
 .../devicetree/bindings/usb/amlogic,dwc3.txt  |  42 ---
 .../devicetree/bindings/usb/dwc3.txt          |   2 -
 .../dts/amlogic/meson-gx-libretech-pc.dtsi    |   3 +-
 .../boot/dts/amlogic/meson-gx-p23x-q20x.dtsi  |   3 +-
 .../amlogic/meson-gxl-s805x-libretech-ac.dts  |   3 +-
 .../boot/dts/amlogic/meson-gxl-s805x-p241.dts |   3 +-
 .../amlogic/meson-gxl-s905d-phicomm-n1.dts    |   4 +
 .../boot/dts/amlogic/meson-gxl-s905w-p281.dts |   4 +
 .../dts/amlogic/meson-gxl-s905w-tx3-mini.dts  |   4 +
 .../amlogic/meson-gxl-s905x-khadas-vim.dts    |   4 +
 .../amlogic/meson-gxl-s905x-libretech-cc.dts  |   3 +-
 .../amlogic/meson-gxl-s905x-nexbox-a95x.dts   |   3 +-
 .../dts/amlogic/meson-gxl-s905x-p212.dtsi     |   3 +-
 arch/arm64/boot/dts/amlogic/meson-gxl.dtsi    |  45 +--
 .../dts/amlogic/meson-gxm-khadas-vim2.dts     |   3 +-
 .../boot/dts/amlogic/meson-gxm-nexbox-a1.dts  |   3 +-
 .../boot/dts/amlogic/meson-gxm-vega-s96.dts   |   4 +
 arch/arm64/boot/dts/amlogic/meson-gxm.dtsi    |   7 +-
 drivers/phy/amlogic/Kconfig                   |  12 -
 drivers/phy/amlogic/Makefile                  |   1 -
 drivers/phy/amlogic/phy-meson-gxl-usb3.c      | 283 ------------------
 drivers/usb/dwc3/dwc3-meson-g12a.c            | 188 +++++++++++-
 drivers/usb/dwc3/dwc3-of-simple.c             |  30 +-
 24 files changed, 246 insertions(+), 442 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/phy/meson-gxl-usb3-phy.txt
 delete mode 100644 Documentation/devicetree/bindings/usb/amlogic,dwc3.txt
 delete mode 100644 drivers/phy/amlogic/phy-meson-gxl-usb3.c
Signature · 7 lines
2.22.0


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel