arm64: meson: Add support for USB on Amlogic G12A
Subsystems (6)
v4 cover arm64: meson: Add support for USB on Amlogic G12A
This patchset adds support for USB on Amlogic G12A SoCs.
This patchset is composed with :
- bindings of the PHYs
- bindings of the USB Control Glue
- PHY Drivers
- USB Control Glue driver
Device Tree nodes will be added in a separate patchset.
The Amlogic G12A USB Complex is composed of :
- 2 USB Controllers :
* DWC3 for USB2 and USB3 Host functionality
* DWC2 for USB2 Peripheral functionality
- 2 USB2 OTG PHYs, only a single one will be routed to either DWC2 to DWC3
- 1 USB3 PHY shared with PCIE funcionnality
- A Glue to control PHY routing, setup and OTG detection
The Glue configures the UTMI 8bit interfaces for the USB2 PHYs, including routing of the OTG PHY between the DWC3 and DWC2 controllers, and setups the on-chip OTG mode selection for this PHY.
This drivers supports the on-probe setup of the OTG mode, and manually via the USB Role interface. The IRQ mode change detect is yet to be added in a future patchset, mainly due to lack of hardware to validate on.
Changes since v3 at [2]:
- Documented and replaced magic values in USB2 PHY driver
Changes since v2 at [1]:
- Collected review tags
- Removed syscon.h in usb2 phy driver
- Added comment on the USB3/PCIe switch
- Renamed dwc3_meson_g12a_usb_init_mode in glue driver
- Changed indentation in dwc3_meson_g12a_role_set
- Switched to of_get_compatible_child in glue code
- Added devm_add_action_or_reset() to disable clock in case of probe failure
- Checks priv->vbus before enabling regulator
- Switched phy_init/phy_power_on
- Removed priv->phys[i] NULL checks in suspend code
- Removed clk_disable_unprepare/clk_put in remove code
Changes since v1 at [0]:
- USB2 PHY Bindings: collected tags and updated commit log
- USB3/PCIE PHY Bindings: collected tag and updated reset list
- DWC2 Compatible: collected tags
- DWC3 Glue Bindings:
- removed clock-names and reset-names for single entries
- removed ports graph for PHYs and replaced by phys list with phy-names
- added dr_mode and optional vbus-supply
- fixed example
- USB2 PHY Driver: removed USB_SUPPORT and otg.h include
- USB3/PCIE PHY Driver: removed USB_SUPPORT, fixed comment and unused reg variable
- USB Glue Driver:
- Moved debugfs I/F to USB_ROLE_SWITCH framework
- Integrated USB Glue Control Registers offset
- Removed of graph parsing to use devm_phy_optional_get()
- Fixed PHY mode handling and OTG switching
- Simplified PHY calls by removing the NULL test
- Added optional vbus regulator handling
[1] https://lkml.kernel.org/r/[email protected]
[2] https://lkml.kernel.org/r/[email protected]
[3] https://lkml.kernel.org/r/[email protected]
Neil Armstrong (8):
dt-bindings: phy: Add Amlogic G12A USB2 PHY Bindings
dt-bindings: phy: Add Amlogic G12A USB3+PCIE Combo PHY Bindings
dt-bindings: usb: dwc2: Add Amlogic G12A DWC2 Compatible
dt-bindings: usb: dwc3: Add Amlogic G12A DWC3 Glue Bindings
phy: amlogic: add Amlogic G12A USB2 PHY Driver
phy: amlogic: Add Amlogic G12A USB3 + PCIE Combo PHY Driver
usb: dwc2: Add Amlogic G12A DWC2 Params
usb: dwc3: Add Amlogic G12A DWC3 glue
.../bindings/phy/meson-g12a-usb2-phy.txt | 22 + .../bindings/phy/meson-g12a-usb3-pcie-phy.txt | 22 + .../devicetree/bindings/usb/amlogic,dwc3.txt | 88 +++ .../devicetree/bindings/usb/dwc2.txt | 1 + drivers/phy/amlogic/Kconfig | 22 + drivers/phy/amlogic/Makefile | 2 + drivers/phy/amlogic/phy-meson-g12a-usb2.c | 341 ++++++++++ .../phy/amlogic/phy-meson-g12a-usb3-pcie.c | 413 ++++++++++++ drivers/usb/dwc2/params.c | 12 + drivers/usb/dwc3/Kconfig | 10 + drivers/usb/dwc3/Makefile | 1 + drivers/usb/dwc3/dwc3-meson-g12a.c | 602 ++++++++++++++++++ 12 files changed, 1536 insertions(+) create mode 100644 Documentation/devicetree/bindings/phy/meson-g12a-usb2-phy.txt create mode 100644 Documentation/devicetree/bindings/phy/meson-g12a-usb3-pcie-phy.txt create mode 100644 drivers/phy/amlogic/phy-meson-g12a-usb2.c create mode 100644 drivers/phy/amlogic/phy-meson-g12a-usb3-pcie.c create mode 100644 drivers/usb/dwc3/dwc3-meson-g12a.c
Signature · 1 line
2.20.1
PATCH v4 1/8 dt-bindings: phy: Add Amlogic G12A USB2 PHY Bindings
Add the Amlogic G12A Family USB2 OTG PHY Bindings
The PHY can work in host or peripheral modes depending on it's position. Configuration of the mode is part of the USBCTRL registers which are outside of the PHY registers.
--- .../bindings/phy/meson-g12a-usb2-phy.txt | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Documentation/devicetree/bindings/phy/meson-g12a-usb2-phy.txt
Documentation/devicetree/bindings/phy/meson-g12a-usb2-phy.txt new file +22 -0
@@ -0,0 +1,22 @@ +* Amlogic G12A USB2 PHY binding + +Required properties: +- compatible: Should be "amlogic,meson-g12a-usb2-phy" +- reg: The base address and length of the registers +- #phys-cells: must be 0 (see phy-bindings.txt in this directory) +- clocks: a phandle to the clock of this PHY +- clock-names: must be "xtal" +- resets: a phandle to the reset line of this PHY +- reset-names: must be "phy" +- phy-supply: see phy-bindings.txt in this directory + +Example: + usb2_phy0: phy@36000 { + compatible = "amlogic,g12a-usb2-phy"; + reg = <0x0 0x36000 0x0 0x2000>; + clocks = <&xtal>; + clock-names = "xtal"; + resets = <&reset RESET_USB_PHY21>; + reset-names = "phy"; + #phy-cells = <0>; + };
Signature · 1 line
2.20.1
PATCH v4 2/8 dt-bindings: phy: Add Amlogic G12A USB3+PCIE Combo PHY Bindings
In reply to Neil ArmstrongAdd the Amlogic G12A Family USB3 + PCIE Combo PHY Bindings.
This PHY can provide exclusively USB3 or PCIE support on shared I/Os.
--- .../bindings/phy/meson-g12a-usb3-pcie-phy.txt | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Documentation/devicetree/bindings/phy/meson-g12a-usb3-pcie-phy.txt
Documentation/devicetree/bindings/phy/meson-g12a-usb3-pcie-phy.txt new file +22 -0
@@ -0,0 +1,22 @@ +* Amlogic G12A USB3 + PCIE Combo PHY binding + +Required properties: +- compatible: Should be "amlogic,meson-g12a-usb3-pcie-phy" +- #phys-cells: must be 1. The cell number is used to select the phy mode + as defined in <dt-bindings/phy/phy.h> between PHY_TYPE_USB3 and PHY_TYPE_PCIE +- reg: The base address and length of the registers +- clocks: a phandle to the 100MHz reference clock of this PHY +- clock-names: must be "ref_clk" +- resets: phandle to the reset lines for the PHY control +- reset-names: must be "phy" + +Example: + usb3_pcie_phy: phy@46000 { + compatible = "amlogic,g12a-usb3-pcie-phy"; + reg = <0x0 0x46000 0x0 0x2000>; + clocks = <&clkc CLKID_PCIE_PLL>; + clock-names = "ref_clk"; + resets = <&reset RESET_PCIE_PHY>; + reset-names = "phy"; + #phy-cells = <1>; + };
Signature · 1 line
2.20.1
PATCH v4 3/8 dt-bindings: usb: dwc2: Add Amlogic G12A DWC2 Compatible
In reply to Neil ArmstrongAdds the specific compatible string for the DWC2 IP found in the Amlogic G12A SoC Family.
--- Documentation/devicetree/bindings/usb/dwc2.txt | 1 + 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/usb/dwc2.txt +1 -0
@@ -14,6 +14,7 @@ Required properties: - "amlogic,meson8-usb": The DWC2 USB controller instance in Amlogic Meson8 SoCs; - "amlogic,meson8b-usb": The DWC2 USB controller instance in Amlogic Meson8b SoCs; - "amlogic,meson-gxbb-usb": The DWC2 USB controller instance in Amlogic S905 SoCs; + - "amlogic,meson-g12a-usb": The DWC2 USB controller instance in Amlogic G12A SoCs; - "amcc,dwc-otg": The DWC2 USB controller instance in AMCC Canyonlands 460EX SoCs; - snps,dwc2: A generic DWC2 USB controller with default parameters. - "st,stm32f4x9-fsotg": The DWC2 USB FS/HS controller instance in STM32F4x9 SoCs
Signature · 1 line
2.20.1
PATCH v4 4/8 dt-bindings: usb: dwc3: Add Amlogic G12A DWC3 Glue Bindings
In reply to Neil ArmstrongAdds the bindings for the Amlogic G12A USB Glue HW.
The Amlogic G12A SoC Family embeds 2 USB Controllers :
- a DWC3 IP configured as Host for USB2 and USB3
- a DWC2 IP configured as Peripheral USB2 Only
A glue connects these both controllers to 2 USB2 PHYs,
and optionnally to an USB3+PCIE Combo PHY shared with the PCIE controller.
The Glue configures the UTMI 8bit interfaces for the USB2 PHYs, including routing of the OTG PHY between the DWC3 and DWC2 controllers, and setups the on-chip OTG mode selection for this PHY.
The PHYs phandles are passed to the Glue node since the Glue controls the interface with the PHY, not the DWC3 controller.
--- .../devicetree/bindings/usb/amlogic,dwc3.txt | 88 +++++++++++++++++++ 1 file changed, 88 insertions(+)
Documentation/devicetree/bindings/usb/amlogic,dwc3.txt +88 -0
@@ -40,3 +40,91 @@ Example device nodes: phy-names = "usb2-phy", "usb3-phy"; }; }; + +Amlogic Meson G12A DWC3 USB SoC Controller Glue + +The Amlogic G12A embeds a DWC3 USB IP Core configured for USB2 and USB3 +in host-only mode, and a DWC2 IP Core configured for USB2 peripheral mode +only. + +A glue connects the DWC3 core to USB2 PHYs and optionnaly to an USB3 PHY. + +One of the USB2 PHY can be re-routed in peripheral mode to a DWC2 USB IP. + +The DWC3 Glue controls the PHY routing and power, an interrupt line is +connected to the Glue to serve as OTG ID change detection. + +Required properties: +- compatible: Should be "amlogic,meson-g12a-usb-ctrl" +- clocks: a handle for the "USB" clock +- resets: a handle for the shared "USB" reset line +- reg: The base address and length of the registers +- interrupts: the interrupt specifier for the OTG detection +- phys: handle to used PHYs on the system + - a <0> phandle can be used if a PHY is not used +- phy-names: names of the used PHYs on the system : + - "usb2-phy0" for USB2 PHY0 if USBHOST_A port is used + - "usb2-phy1" for USB2 PHY1 if USBOTG_B port is used + - "usb3-phy0" for USB3 PHY if USB3_0 is used +- dr_mode: should be "host", "peripheral", or "otg" depending on + the usage and configuration of the OTG Capable port. + - "host" and "peripheral" means a fixed Host or Device only connection + - "otg" means the port can be used as both Host or Device and + be switched automatically using the OTG ID pin. + +Optional properties: +- vbus-supply: should be a phandle to the regulator controlling the VBUS + power supply when used in OTG switchable mode + +Required child nodes: + +A child node must exist to represent the core DWC3 IP block. The name of +the node is not important. The content of the node is defined in dwc3.txt. + +A child node must exist to represent the core DWC2 IP block. The name of +the node is not important. The content of the node is defined in dwc2.txt. + +PHY documentation is provided in the following places: +- Documentation/devicetree/bindings/phy/meson-g12a-usb2-phy.txt +- Documentation/devicetree/bindings/phy/meson-g12a-usb3-pcie-phy.txt + +Example device nodes: + usb: usb@ffe09000 { + compatible = "amlogic,meson-g12a-usb-ctrl"; + reg = <0x0 0xffe09000 0x0 0xa0>; + interrupts = <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>; + #address-cells = <2>; + #size-cells = <2>; + ranges; + + clocks = <&clkc CLKID_USB>; + resets = <&reset RESET_USB>; + + dr_mode = "otg"; + + phys = <&usb2_phy0>, <&usb2_phy1>, + <&usb3_pcie_phy PHY_TYPE_USB3>; + phy-names = "usb2-phy0", "usb2-phy1", "usb3-phy0"; + + dwc2: usb@ff400000 { + compatible = "amlogic,meson-g12a-usb", "snps,dwc2"; + reg = <0x0 0xff400000 0x0 0x40000>; + interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&clkc CLKID_USB1_DDR_BRIDGE>; + clock-names = "ddr"; + phys = <&usb2_phy1>; + dr_mode = "peripheral"; + g-rx-fifo-size = <192>; + g-np-tx-fifo-size = <128>; + g-tx-fifo-size = <128 128 16 16 16>; + }; + + dwc3: usb@ff500000 { + compatible = "snps,dwc3"; + reg = <0x0 0xff500000 0x0 0x100000>; + interrupts = <GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH>; + dr_mode = "host"; + snps,dis_u2_susphy_quirk; + snps,quirk-frame-length-adjustment; + }; + };
Signature · 1 line
2.20.1
PATCH v4 5/8 phy: amlogic: add Amlogic G12A USB2 PHY Driver
In reply to Neil ArmstrongThis adds support for the USB2 PHY found in the Amlogic G12A SoC Family.
It supports Host and/or Peripheral mode, depending on it's position. The first PHY is only used as Host, but the second supports Dual modes defined by the USB Control Glue HW in front of the USB Controllers.
--- drivers/phy/amlogic/Kconfig | 11 + drivers/phy/amlogic/Makefile | 1 + drivers/phy/amlogic/phy-meson-g12a-usb2.c | 341 ++++++++++++++++++++++ 3 files changed, 353 insertions(+) create mode 100644 drivers/phy/amlogic/phy-meson-g12a-usb2.c
drivers/phy/amlogic/Kconfig +11 -0
@@ -36,3 +36,14 @@ config PHY_MESON_GXL_USB3 Enable this to support the Meson USB3 PHY and OTG detection IP block found in Meson GXL and GXM SoCs. If unsure, say N. + +config PHY_MESON_G12A_USB2 + tristate "Meson G12A USB2 PHY driver" + default ARCH_MESON + depends on OF && (ARCH_MESON || COMPILE_TEST) + select GENERIC_PHY + select REGMAP_MMIO + help + Enable this to support the Meson USB2 PHYs found in Meson + G12A SoCs. + If unsure, say N.
drivers/phy/amlogic/Makefile +1 -0
@@ -1,3 +1,4 @@ obj-$(CONFIG_PHY_MESON8B_USB2) += phy-meson8b-usb2.o obj-$(CONFIG_PHY_MESON_GXL_USB2) += phy-meson-gxl-usb2.o +obj-$(CONFIG_PHY_MESON_G12A_USB2) += phy-meson-g12a-usb2.o obj-$(CONFIG_PHY_MESON_GXL_USB3) += phy-meson-gxl-usb3.o
drivers/phy/amlogic/phy-meson-g12a-usb2.c new file +341 -0
341 lines not on this page · raw message
PATCH v4 6/8 phy: amlogic: Add Amlogic G12A USB3 + PCIE Combo PHY Driver
In reply to Neil ArmstrongThis adds support for the shared USB3 + PCIE PHY found in the Amlogic G12A SoC Family.
It supports USB3 Host mode or PCIE 2.0 mode, depending on the layout of the board.
Selection is done by the #phy-cells, making the mode static and exclusive.
--- drivers/phy/amlogic/Kconfig | 11 + drivers/phy/amlogic/Makefile | 1 + .../phy/amlogic/phy-meson-g12a-usb3-pcie.c | 413 ++++++++++++++++++ 3 files changed, 425 insertions(+) create mode 100644 drivers/phy/amlogic/phy-meson-g12a-usb3-pcie.c
drivers/phy/amlogic/Kconfig +11 -0
@@ -47,3 +47,14 @@ config PHY_MESON_G12A_USB2 Enable this to support the Meson USB2 PHYs found in Meson G12A SoCs. If unsure, say N. + +config PHY_MESON_G12A_USB3_PCIE + tristate "Meson G12A USB3+PCIE Combo PHY driver" + default ARCH_MESON + depends on OF && (ARCH_MESON || COMPILE_TEST) + select GENERIC_PHY + select REGMAP_MMIO + help + Enable this to support the Meson USB3 + PCIE Combo PHY found + in Meson G12A SoCs. + If unsure, say N.
drivers/phy/amlogic/Makefile +1 -0
@@ -2,3 +2,4 @@ obj-$(CONFIG_PHY_MESON8B_USB2) += phy-meson8b-usb2.o obj-$(CONFIG_PHY_MESON_GXL_USB2) += phy-meson-gxl-usb2.o obj-$(CONFIG_PHY_MESON_G12A_USB2) += phy-meson-g12a-usb2.o obj-$(CONFIG_PHY_MESON_GXL_USB3) += phy-meson-gxl-usb3.o +obj-$(CONFIG_PHY_MESON_G12A_USB3_PCIE) += phy-meson-g12a-usb3-pcie.o
drivers/phy/amlogic/phy-meson-g12a-usb3-pcie.c new file +413 -0
413 lines not on this page · raw message
PATCH v4 7/8 usb: dwc2: Add Amlogic G12A DWC2 Params
In reply to Neil ArmstrongThis patchs sets the params for the DWC2 Controller found in the Amlogic G12A SoC family.
It mainly sets the settings reported incorrect by the driver, leaving the remaining detected automatically by the driver and provided by the DT node.
--- drivers/usb/dwc2/params.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
drivers/usb/dwc2/params.c +12 -0
@@ -121,6 +121,16 @@ static void dwc2_set_amlogic_params(struct dwc2_hsotg *hsotg) p->power_down =DWC2_POWER_DOWN_PARAM_NONE ; } +static void dwc2_set_amlogic_g12a_params (struct dwc2_hsotg *hsotg) +{ +struct dwc2_core_params *p = &hsotg->params; + + p->lpm = false; + p->lpm_clock_gating = false; + p->besl = false; + p->hird_threshold_en = false; +} +static void dwc2_set_amcc_params (struct dwc2_hsotg *hsotg) {struct dwc2_core_params *p = &hsotg->params;
@@ -167,6 +177,8 @@ const struct of_device_id dwc2_of_match_table[] = { .data = dwc2_set_amlogic_params }, { .compatible = "amlogic,meson-gxbb-usb", .data = dwc2_set_amlogic_params }, + { .compatible = "amlogic,meson-g12a-usb", + .data = dwc2_set_amlogic_g12a_params }, { .compatible = "amcc,dwc-otg", .data = dwc2_set_amcc_params }, { .compatible = "st,stm32f4x9-fsotg", .data = dwc2_set_stm32f4x9_fsotg_params },
PATCH v4 8/8 usb: dwc3: Add Amlogic G12A DWC3 glue
In reply to Neil ArmstrongAdds support for Amlogic G12A USB Control Glue HW.
The Amlogic G12A SoC Family embeds 2 USB Controllers :
- a DWC3 IP configured as Host for USB2 and USB3
- a DWC2 IP configured as Peripheral USB2 Only
A glue connects these both controllers to 2 USB2 PHYs, and optionnally to an USB3+PCIE Combo PHY shared with the PCIE controller.
The Glue configures the UTMI 8bit interfaces for the USB2 PHYs, including routing of the OTG PHY between the DWC3 and DWC2 controllers, and setups the on-chip OTG mode selection for this PHY.
This drivers supports the on-probe setup of the OTG mode, and manually via a debugfs interface. The IRQ mode change detect is yet to be added in a future patchset, mainly due to lack of hardware to validate on.
--- drivers/usb/dwc3/Kconfig | 10 + drivers/usb/dwc3/Makefile | 1 + drivers/usb/dwc3/dwc3-meson-g12a.c | 602 +++++++++++++++++++++++++++++ 3 files changed, 613 insertions(+) create mode 100644 drivers/usb/dwc3/dwc3-meson-g12a.c
drivers/usb/dwc3/Kconfig +10 -0
@@ -95,6 +95,16 @@ config USB_DWC3_KEYSTONE Support of USB2/3 functionality in TI Keystone2 and AM654 platforms. Say 'Y' or 'M' here if you have one such device +config USB_DWC3_MESON_G12A + tristate "Amlogic Meson G12A Platforms" + depends on OF && COMMON_CLK + depends on ARCH_MESON || COMPILE_TEST + default USB_DWC3 + select USB_ROLE_SWITCH + help + Support USB2/3 functionality in Amlogic G12A platforms. + Say 'Y' or 'M' if you have one such device. + config USB_DWC3_OF_SIMPLE tristate "Generic OF Simple Glue Layer" depends on OF && COMMON_CLK
drivers/usb/dwc3/Makefile +1 -0
@@ -47,6 +47,7 @@ obj-$(CONFIG_USB_DWC3_EXYNOS) += dwc3-exynos.o obj-$(CONFIG_USB_DWC3_PCI) += dwc3-pci.o obj-$(CONFIG_USB_DWC3_HAPS) += dwc3-haps.o obj-$(CONFIG_USB_DWC3_KEYSTONE) += dwc3-keystone.o +obj-$(CONFIG_USB_DWC3_MESON_G12A) += dwc3-meson-g12a.o obj-$(CONFIG_USB_DWC3_OF_SIMPLE) += dwc3-of-simple.o obj-$(CONFIG_USB_DWC3_ST) += dwc3-st.o obj-$(CONFIG_USB_DWC3_QCOM) += dwc3-qcom.o
drivers/usb/dwc3/dwc3-meson-g12a.c new file +602 -0
602 lines not on this page · raw message
Re: [PATCH v4 8/8] usb: dwc3: Add Amlogic G12A DWC3 glue
Hi Neil,
Quoted 14 lines · Neil Armstrong
Adds support for Amlogic G12A USB Control Glue HW.
The Amlogic G12A SoC Family embeds 2 USB Controllers :
- a DWC3 IP configured as Host for USB2 and USB3
- a DWC2 IP configured as Peripheral USB2 OnlyA glue connects these both controllers to 2 USB2 PHYs, and optionnally to an USB3+PCIE Combo PHY shared with the PCIE controller.
The Glue configures the UTMI 8bit interfaces for the USB2 PHYs, including routing of the OTG PHY between the DWC3 and DWC2 controllers, and setups the on-chip OTG mode selection for this PHY.
Quoted 5 lines
This drivers supports the on-probe setup of the OTG mode, and manually via a debugfs interface. The IRQ mode change detect is yet to be added in a future patchset, mainly due to lack of hardware to validate on.
Signed-off-by Neil Armstrong <[email protected]>
with the small issue fixed (see below) you can add my:
my opinion is that the whole driver is looking great now! I hope that it will be queued for v5.2 soon because there's no NACK from the USB / dwc3 maintainers yet.
[...]
drivers/usb/dwc3/dwc3-meson-g12a.c line 458
Quoted 4 lines
drivers/usb/dwc3/dwc3-meson-g12a.c new file +4
-0+ ret =of_platform_populate (np,NULL ,NULL , dev); +if (ret) { +clk_disable_unprepare (priv->clk); +clk_put (priv->clk);
clk_disable_unprepare is called automatically since there's now an devm_add_action_or_reset for that a few lines aboveclk_put is also unnecessary because priv->clk is obtained with devm_clk_get()
Regards
Martin
Re: [PATCH v4 8/8] usb: dwc3: Add Amlogic G12A DWC3 glue
Hi,
Quoted 21 lines · Martin Blumenstingl
Hi Neil,
Quoted 18 lines · Neil Armstrong
Adds support for Amlogic G12A USB Control Glue HW.
The Amlogic G12A SoC Family embeds 2 USB Controllers :
- a DWC3 IP configured as Host for USB2 and USB3
- a DWC2 IP configured as Peripheral USB2 OnlyA glue connects these both controllers to 2 USB2 PHYs, and optionnally to an USB3+PCIE Combo PHY shared with the PCIE controller.
The Glue configures the UTMI 8bit interfaces for the USB2 PHYs, including routing of the OTG PHY between the DWC3 and DWC2 controllers, and setups the on-chip OTG mode selection for this PHY.
This drivers supports the on-probe setup of the OTG mode, and manually via a debugfs interface. The IRQ mode change detect is yet to be added in a future patchset, mainly due to lack of hardware to validate on.
Quoted 7 lines
Quoted 1 line
Signed-off-by Neil Armstrong <[email protected]>with the small issue fixed (see below) you can add my:
Reviewed-by Martin Blumenstingl <[email protected]>my opinion is that the whole driver is looking great now! I hope that it will be queued for v5.2 soon because there's no NACK from the USB / dwc3 maintainers yet.
Thanks ! I will add this tag for v5 with these fixes
Quoted 9 lines
[...]
drivers/usb/dwc3/dwc3-meson-g12a.c line 458
Quoted 4 lines
drivers/usb/dwc3/dwc3-meson-g12a.c new file +4
-0+ ret =of_platform_populate (np,NULL ,NULL , dev); +if (ret) { +clk_disable_unprepare (priv->clk); +clk_put (priv->clk);
clk_disable_unprepareis called automatically since there's now andevm_add_action_or_resetfor that a few lines aboveclk_putis also unnecessary becausepriv->clkis obtained withdevm_clk_get()
Chunfeng Yun also reported thos on v3...
I will fix on v4 next week to give a little more time
Quoted 5 lines
Regards
Martin
Neil