Skip to contentSkip to conversation

DWC3 USB support for Qualcomm platform

RFC PATCH Superseded Ivan T. Ivanov 4 participants 12 messages Aug 9, 2013 – Aug 14, 2013 1 message not in the archive

Subsystems (4)

v2 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

v2 cover DWC3 USB support for Qualcomm platform

From: "Ivan T. Ivanov" <[email protected]>

Hi,

These patches add basic support for USB3.0 controllers found on MSM platforms. USB3.0 core is based on Synopsys DesignWare SuperSpeed IP.

Changes since first version:
* Split devicetree bindings description file to separate patch
* Address comments for device bindings description
* Fix typo in 'gdsc' requlator name.

With fake regulators and clocks support drivers could be successfully loaded, but nothing more, of course.

Generated on top of Felipe 'testing' branch.

Regards,
Ivan

Ivan T. Ivanov (3):
usb: dwc3: msm: Add device tree binding information
usb: phy: Add Qualcomm SS-USB and HS-USB drivers for DWC3 core
usb: dwc3: Add Qualcomm DWC3 glue layer driver

 .../devicetree/bindings/usb/msm-ssusb.txt          |  101 +++++
 drivers/usb/dwc3/Kconfig                           |    8 +
 drivers/usb/dwc3/Makefile                          |    1 +
 drivers/usb/dwc3/dwc3-msm.c                        |  174 +++++++++
 drivers/usb/phy/Kconfig                            |   11 +
 drivers/usb/phy/Makefile                           |    2 +
 drivers/usb/phy/phy-msm-dwc3-hs.c                  |  340 +++++++++++++++++
 drivers/usb/phy/phy-msm-dwc3-ss.c                  |  387 ++++++++++++++++++++
 8 files changed, 1024 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/usb/msm-ssusb.txt
 create mode 100644 drivers/usb/dwc3/dwc3-msm.c
 create mode 100644 drivers/usb/phy/phy-msm-dwc3-hs.c
 create mode 100644 drivers/usb/phy/phy-msm-dwc3-ss.c
Signature · 1 line
1.7.9.5
#1 lore raw

RFC PATCH v2 1/3 usb: dwc3: msm: Add device tree binding information

From: "Ivan T. Ivanov" <[email protected]>

MSM USB3.0 core wrapper consist of USB3.0 IP (SNPS) and HS, SS PHY's controll and configuration registers.

It could operate in device mode (SS, HS, FS) and host mode (SS, HS, FS, LS).

---
 .../devicetree/bindings/usb/msm-ssusb.txt          |  101 ++++++++++++++++++++
 1 file changed, 101 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/usb/msm-ssusb.txt
Documentation/devicetree/bindings/usb/msm-ssusb.txt new file +101 -0
new file mode 100644
index 0000000..7a97163
@@ -0,0 +1,101 @@
+MSM SuperSpeed DWC3 USB SoC controller
+
+Required properities :
+- compatible : sould be "qcom,dwc3-hsphy";
+- reg : offset and length of the register set in the memory map
+- clocks : phandles to clock instances of the device tree nodes
+- clock-names :
+	"xo" : External reference clock 19 MHz
+	"sleep_a_clk" : Sleep clock, used when USB3 core goes into low
+	power mode (U3).
+<supply-name>-supply : phandle to the regulator device tree node
+Required "supply-name" are:
+	"v1p8" : 1.8v supply for HSPHY
+	"v3p3" : 3.3v supply for HSPHY
+	"vbus" : vbus supply for host mode
+	"vddcx" : vdd supply for HS-PHY digital circuit operation
+
+Required properities :
+- compatible : sould be "qcom,dwc3-ssphy";
+- reg : offset and length of the register set in the memory map
+- clocks : phandles to clock instances of the device tree nodes
+- clock-names :
+	"xo" : External reference clock 19 MHz
+	"ref_clk" : Reference clock - used in host mode.
+<supply-name>-supply : phandle to the regulator device tree node
+Required "supply-name" are:
+	"v1p8" : 1.8v supply for SS-PHY
+	"vddcx" : vdd supply for SS-PHY digital circuit operation
+
+Required properties :
+- compatible : should be "qcom,dwc3"
+- reg : offset and length of the register set in the memory map
+	offset and length of the TCSR register for routing USB
+	signals to either picoPHY0 or picoPHY1.
+- clocks : phandles to clock instances of the device tree nodes
+- clock-names :
+	"core_clk" : Master/Core clock, have to be >= 125 MHz for SS
+	operation and >= 60MHz for HS operation
+	"iface_clk" : System bus AXI clock
+	"sleep_clk" : Sleep clock, used when USB3 core goes into low
+	power mode (U3).
+	"utmi_clk" : Generated by HS-PHY. Used to clock the low power
+	parts of thr HS Link layer.
+
+Optional properties :
+- gdsc-supply : phandle to the globally distributed switch controller
+  regulator node to the USB controller.
+
+Sub nodes:
+- Sub node for "DWC3 USB3 controller".
+  This sub node is required property for device node. The properties
+  of this subnode are specified in dwc3.txt.
+
+Example device nodes:
+
+	dwc3_hsphy: phy@f92f8800 {
+		compatible = "qcom,dwc3-hsphy";
+		reg = <0xf92f8800 0x30>;
+
+		clocks = <&cxo>, <&usb2a_phy_sleep_cxc>;
+		clock-names = "xo", "sleep_a_clk";
+
+		vbus-supply = <&supply>;
+		vddcx-supply = <&supply>;
+		v1p8-supply = <&supply>;
+		v3p3-supply = <&supply>;
+	};
+
+	dwc3_ssphy: phy@f92f8830 {
+		compatible = "qcom,dwc3-ssphy";
+		reg = <0xf92f8830 0x30>;
+
+		clocks = <&cxo>, <&usb30_mock_utmi_cxc>;
+		clock-names = "xo", "ref_clk";
+
+		vddcx-supply = <&supply>;
+		v1p8-supply = <&supply>;
+	};
+
+	usb@fd4ab000 {
+		compatible = "qcom,dwc3";
+		#address-cells = <1>;
+		#size-cells = <1>;
+		reg = <0xfd4ab000 0x4>;
+
+		clocks = <&usb30_master_cxc>, <&sys_noc_usb3_axi_cxc>,
+				<&usb30_sleep_cxc>, <&usb30_mock_utmi_cxc>;
+		clock-names = "core_clk", "iface_clk", "sleep_clk", "utmi_clk";
+
+		gdsc-supply = <&supply>;
+		ranges;
+
+		dwc3@f9200000 {
+			compatible = "snps,dwc3";
+			reg = <0xf9200000 0xcd00>;
+			interrupts = <0 131 0>;
+			interrupt-names = "irq";
+			usb-phy = <&dwc3_hsphy>, <&dwc3_ssphy>;
+			tx-fifo-resize;
+		};
+	};
Signature · 1 line
1.7.9.5

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw

Re: [RFC PATCH v2 1/3] usb: dwc3: msm: Add device tree binding information

Quoted 8 lines · Kumar Gala
Quoted 3 lines · Ivan T. Ivanov

From: "Ivan T. Ivanov" <[email protected]>

MSM USB3.0 core wrapper consist of USB3.0 IP (SNPS)

probably good to spell out Synopsys rather than SNPS

Synopsys (the company) has always used snps in their bindings though.

Quoted 6 lines
Quoted 6 lines
Documentation/devicetree/bindings/usb/msm-ssusb.txt new file +6 -0
+Required properities :
+- compatible : sould be "qcom,dwc3-hsphy";
+- reg : offset and length of the register set in the memory map
+- clocks : phandles to clock instances of the device tree nodes
+- clock-names :
+	"xo" : External reference clock 19 MHz
Quoted 8 lines

Documentation/devicetree/bindings/usb/msm-ssusb.txt line 16

Quoted 8 lines
Documentation/devicetree/bindings/usb/msm-ssusb.txt new file +8 -0
+	"sleep_a_clk" : Sleep clock, used when USB3 core goes into low
+	power mode (U3).
+<supply-name>-supply : phandle to the regulator device tree node
+Required "supply-name" are:
+	"v1p8" : 1.8v supply for HSPHY
+	"v3p3" : 3.3v supply for HSPHY
+	"vbus" : vbus supply for host mode
+	"vddcx" : vdd supply for HS-PHY digital circuit operation

I believe these regulators belong to the PHY, not DWC3. Please write a PHY driver.

Quoted 11 lines

Documentation/devicetree/bindings/usb/msm-ssusb.txt line 28

Quoted 11 lines
Documentation/devicetree/bindings/usb/msm-ssusb.txt new file +11 -0
+Required properities :
+- compatible : sould be "qcom,dwc3-ssphy";
+- reg : offset and length of the register set in the memory map
+- clocks : phandles to clock instances of the device tree nodes
+- clock-names :
+	"xo" : External reference clock 19 MHz
+	"ref_clk" : Reference clock - used in host mode.
+<supply-name>-supply : phandle to the regulator device tree node
+Required "supply-name" are:
+	"v1p8" : 1.8v supply for SS-PHY
+	"vddcx" : vdd supply for SS-PHY digital circuit operation

likewise, these regulators should be moved to the PHY driver.

Quoted 18 lines
Quoted 18 lines
Documentation/devicetree/bindings/usb/msm-ssusb.txt new file +18 -0
+Required properties :
+- compatible : should be "qcom,dwc3"
+- reg : offset and length of the register set in the memory map
+	offset and length of the TCSR register for routing USB
+	signals to either picoPHY0 or picoPHY1.
+- clocks : phandles to clock instances of the device tree nodes
+- clock-names :
+	"core_clk" : Master/Core clock, have to be >= 125 MHz for SS
+	operation and >= 60MHz for HS operation
+	"iface_clk" : System bus AXI clock
+	"sleep_clk" : Sleep clock, used when USB3 core goes into low
+	power mode (U3).
+	"utmi_clk" : Generated by HS-PHY. Used to clock the low power
+	parts of thr HS Link layer.
+
+Optional properties :
+- gdsc-supply : phandle to the globally distributed switch controller
+  regulator node to the USB controller.
Quoted 8 lines

Documentation/devicetree/bindings/usb/msm-ssusb.txt line 52

Quoted 5 lines
Documentation/devicetree/bindings/usb/msm-ssusb.txt new file +5 -0
+
+Sub nodes:
+- Sub node for "DWC3 USB3 controller".
+  This sub node is required property for device node. The properties
+  of this subnode are specified in dwc3.txt.

Is tx-fifo-resize required for qcom,dwc3? if so we should call that out in the binding.

AFAICT that's only needed for OMAP5 ES1.0. Unless Qualcomm also screwed up default TX FIFO sizes :-p

Signature · 1 line
balbi
#4 lore raw

Re: [RFC PATCH v2 1/3] usb: dwc3: msm: Add device tree binding information

Quoted 11 lines · Felipe Balbi
Quoted 8 lines · Kumar Gala
Quoted 3 lines · Ivan T. Ivanov

From: "Ivan T. Ivanov" <[email protected]>

MSM USB3.0 core wrapper consist of USB3.0 IP (SNPS)

probably good to spell out Synopsys rather than SNPS

Synopsys (the company) has always used snps in their bindings though.

I just meant in the commit message as SNPS wasn't obvious to me and I think when someone comes back and looks the commit message doing "Synopsys (SNPS)" is a little more readable.

- k

--
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation

#5 lore raw

Re: [RFC PATCH v2 1/3] usb: dwc3: msm: Add device tree binding information

In reply to Felipe Balbi

Hi,

Quoted 21 lines · Felipe Balbi
Quoted 8 lines · Kumar Gala
Quoted 3 lines · Ivan T. Ivanov

From: "Ivan T. Ivanov" <[email protected]>

MSM USB3.0 core wrapper consist of USB3.0 IP (SNPS)

probably good to spell out Synopsys rather than SNPS

Synopsys (the company) has always used snps in their bindings though.

Quoted 9 lines
Quoted 9 lines
Documentation/devicetree/bindings/usb/msm-ssusb.txt new file +9 -0
+Required properities :
+- compatible : sould be "qcom,dwc3-hsphy";
+- reg : offset and length of the register set in the memory map
+- clocks : phandles to clock instances of the device tree nodes
+- clock-names :
+	"xo" : External reference clock 19 MHz
+	"sleep_a_clk" : Sleep clock, used when USB3 core goes into low
+	power mode (U3).
+<supply-name>-supply : phandle to the regulator device tree node
Quoted 9 lines
Quoted 5 lines

Documentation/devicetree/bindings/usb/msm-ssusb.txt line 16

Quoted 5 lines
Documentation/devicetree/bindings/usb/msm-ssusb.txt new file +5 -0
+Required "supply-name" are:
+	"v1p8" : 1.8v supply for HSPHY
+	"v3p3" : 3.3v supply for HSPHY
+	"vbus" : vbus supply for host mode
+	"vddcx" : vdd supply for HS-PHY digital circuit operation

I believe these regulators belong to the PHY, not DWC3. Please write a PHY driver.

There is already usb phy drivers for these??

[PATCH v2 2/3] usb: phy: Add Qualcomm SS-USB and HS-USB drivers for DWC3 core

Quoted 41 lines
Quoted 11 lines

Documentation/devicetree/bindings/usb/msm-ssusb.txt line 28

Quoted 11 lines
Documentation/devicetree/bindings/usb/msm-ssusb.txt new file +11 -0
+Required properities :
+- compatible : sould be "qcom,dwc3-ssphy";
+- reg : offset and length of the register set in the memory map
+- clocks : phandles to clock instances of the device tree nodes
+- clock-names :
+	"xo" : External reference clock 19 MHz
+	"ref_clk" : Reference clock - used in host mode.
+<supply-name>-supply : phandle to the regulator device tree node
+Required "supply-name" are:
+	"v1p8" : 1.8v supply for SS-PHY
+	"vddcx" : vdd supply for SS-PHY digital circuit operation

likewise, these regulators should be moved to the PHY driver.

Quoted 18 lines
Quoted 18 lines
Documentation/devicetree/bindings/usb/msm-ssusb.txt new file +18 -0
+Required properties :
+- compatible : should be "qcom,dwc3"
+- reg : offset and length of the register set in the memory map
+	offset and length of the TCSR register for routing USB
+	signals to either picoPHY0 or picoPHY1.
+- clocks : phandles to clock instances of the device tree nodes
+- clock-names :
+	"core_clk" : Master/Core clock, have to be >= 125 MHz for SS
+	operation and >= 60MHz for HS operation
+	"iface_clk" : System bus AXI clock
+	"sleep_clk" : Sleep clock, used when USB3 core goes into low
+	power mode (U3).
+	"utmi_clk" : Generated by HS-PHY. Used to clock the low power
+	parts of thr HS Link layer.
+
+Optional properties :
+- gdsc-supply : phandle to the globally distributed switch controller
+  regulator node to the USB controller.
Quoted 8 lines

Documentation/devicetree/bindings/usb/msm-ssusb.txt line 52

Quoted 5 lines
Documentation/devicetree/bindings/usb/msm-ssusb.txt new file +5 -0
+
+Sub nodes:
+- Sub node for "DWC3 USB3 controller".
+  This sub node is required property for device node. The properties
+  of this subnode are specified in dwc3.txt.

Is tx-fifo-resize required for qcom,dwc3? if so we should call that out in the binding.

Quoted 2 lines

AFAICT that's only needed for OMAP5 ES1.0. Unless Qualcomm also screwed up default TX FIFO sizes :-p

Or it is intentional? :-) Look at [1] dwc3@f9200000

Ivan

[1] https://www.codeaurora.org/cgit/quic/la/kernel/msm/tree/arch/arm/boot/dts/apq8084.dtsi?h=msm-3.4

Quoted 1 line
#6 lore raw

Re: [RFC PATCH v2 1/3] usb: dwc3: msm: Add device tree binding information

In reply to a message not in the archive

Hi,

Quoted 7 lines · Kumar Gala
Quoted 3 lines · Ivan T. Ivanov

From: "Ivan T. Ivanov" <[email protected]>

MSM USB3.0 core wrapper consist of USB3.0 IP (SNPS)

probably good to spell out Synopsys rather than SNPS

I could make it look like this? Synopsys (SNPS)

Quoted 23 lines
Quoted 18 lines

and HS, SS PHY's controll and configuration registers.

It could operate in device mode (SS, HS, FS) and host mode (SS, HS, FS, LS).

---
.../devicetree/bindings/usb/msm-ssusb.txt | 101 ++++++++++++++++++++

1 file changed, 101 insertions(+)

create mode 100644 Documentation/devicetree/bindings/usb/msm-ssusb.txt

Documentation/devicetree/bindings/usb/msm-ssusb.txt new file +0 -0
new file mode 100644
index 0000000..7a97163

Documentation/devicetree/bindings/usb/msm-ssusb.txt line 2

Quoted 2 lines
Documentation/devicetree/bindings/usb/msm-ssusb.txt new file +2 -0
@@ -0,0 +1,101 @@
+MSM SuperSpeed DWC3 USB SoC controller
+

We should have a heading here like:

Quoted 1 line

DWC3 Highspeed USB PHY

Ok, I will add these headings.

Quoted 51 lines
Quoted 6 lines
Documentation/devicetree/bindings/usb/msm-ssusb.txt new file +5 -0
+Required properities :
+- compatible : sould be "qcom,dwc3-hsphy";
+- reg : offset and length of the register set in the memory map
+- clocks : phandles to clock instances of the device tree nodes
+- clock-names :

Documentation/devicetree/bindings/usb/msm-ssusb.txt line 17

Quoted 10 lines
Documentation/devicetree/bindings/usb/msm-ssusb.txt new file +10 -0
+	"xo" : External reference clock 19 MHz
+	"sleep_a_clk" : Sleep clock, used when USB3 core goes into low
+	power mode (U3).
+<supply-name>-supply : phandle to the regulator device tree node
+Required "supply-name" are:
+	"v1p8" : 1.8v supply for HSPHY
+	"v3p3" : 3.3v supply for HSPHY
+	"vbus" : vbus supply for host mode
+	"vddcx" : vdd supply for HS-PHY digital circuit operation
+

DWC3 Superspeed USB PHY

Documentation/devicetree/bindings/usb/msm-ssusb.txt line 29

Quoted 12 lines
Documentation/devicetree/bindings/usb/msm-ssusb.txt new file +12 -0
+Required properities :
+- compatible : sould be "qcom,dwc3-ssphy";
+- reg : offset and length of the register set in the memory map
+- clocks : phandles to clock instances of the device tree nodes
+- clock-names :
+	"xo" : External reference clock 19 MHz
+	"ref_clk" : Reference clock - used in host mode.
+<supply-name>-supply : phandle to the regulator device tree node
+Required "supply-name" are:
+	"v1p8" : 1.8v supply for SS-PHY
+	"vddcx" : vdd supply for SS-PHY digital circuit operation
+

DWC3 controller

Quoted 17 lines
Documentation/devicetree/bindings/usb/msm-ssusb.txt new file +17 -0
+Required properties :
+- compatible : should be "qcom,dwc3"
+- reg : offset and length of the register set in the memory map
+	offset and length of the TCSR register for routing USB
+	signals to either picoPHY0 or picoPHY1.
+- clocks : phandles to clock instances of the device tree nodes
+- clock-names :
+	"core_clk" : Master/Core clock, have to be >= 125 MHz for SS
+	operation and >= 60MHz for HS operation
+	"iface_clk" : System bus AXI clock
+	"sleep_clk" : Sleep clock, used when USB3 core goes into low
+	power mode (U3).
+	"utmi_clk" : Generated by HS-PHY. Used to clock the low power
+	parts of thr HS Link layer.
+
+Optional properties :
+- gdsc-supply : phandle to the globally distributed switch controller
Quoted 8 lines

Documentation/devicetree/bindings/usb/msm-ssusb.txt line 52

Quoted 6 lines
Documentation/devicetree/bindings/usb/msm-ssusb.txt new file +6 -0
+  regulator node to the USB controller.
+
+Sub nodes:
+- Sub node for "DWC3 USB3 controller".
+  This sub node is required property for device node. The properties
+  of this subnode are specified in dwc3.txt.

Is tx-fifo-resize required for qcom,dwc3? if so we should call that out in the binding.

It looks like this is used in apq8084.dtsi (codeaurora repo)

Quoted 40 lines
Quoted 40 lines
Documentation/devicetree/bindings/usb/msm-ssusb.txt new file +39 -0
+
+Example device nodes:
+
+	dwc3_hsphy: phy@f92f8800 {
+		compatible = "qcom,dwc3-hsphy";
+		reg = <0xf92f8800 0x30>;
+
+		clocks = <&cxo>, <&usb2a_phy_sleep_cxc>;
+		clock-names = "xo", "sleep_a_clk";
+
+		vbus-supply = <&supply>;
+		vddcx-supply = <&supply>;
+		v1p8-supply = <&supply>;
+		v3p3-supply = <&supply>;
+	};
+
+	dwc3_ssphy: phy@f92f8830 {
+		compatible = "qcom,dwc3-ssphy";
+		reg = <0xf92f8830 0x30>;
+
+		clocks = <&cxo>, <&usb30_mock_utmi_cxc>;
+		clock-names = "xo", "ref_clk";
+
+		vddcx-supply = <&supply>;
+		v1p8-supply = <&supply>;
+	};
+
+	usb@fd4ab000 {
+		compatible = "qcom,dwc3";
+		#address-cells = <1>;
+		#size-cells = <1>;
+		reg = <0xfd4ab000 0x4>;
+
+		clocks = <&usb30_master_cxc>, <&sys_noc_usb3_axi_cxc>,
+				<&usb30_sleep_cxc>, <&usb30_mock_utmi_cxc>;
+		clock-names = "core_clk", "iface_clk", "sleep_clk", "utmi_clk";
+
+		gdsc-supply = <&supply>;
+		ranges;
Quoted 8 lines

Documentation/devicetree/bindings/usb/msm-ssusb.txt line 97

Quoted 6 lines
Documentation/devicetree/bindings/usb/msm-ssusb.txt new file +6 -0
+
+		dwc3@f9200000 {
+			compatible = "snps,dwc3";
+			reg = <0xf9200000 0xcd00>;
+			interrupts = <0 131 0>;
+			interrupt-names = "irq";

I'd drop interrupt-names since its not terribly meaningful w/a single IRQ

Ok.

Thanks,
Ivan

Quoted 10 lines
Quoted 8 lines
Documentation/devicetree/bindings/usb/msm-ssusb.txt new file +4 -0
+			usb-phy = <&dwc3_hsphy>, <&dwc3_ssphy>;
+			tx-fifo-resize;
+		};
+	};
Signature · 1 line
1.7.9.5
#7 lore raw

Re: [RFC PATCH v2 1/3] usb: dwc3: msm: Add device tree binding information

In reply to Ivan T. Ivanov
Quoted 4 lines · Ivan T. Ivanov

From: "Ivan T. Ivanov" <[email protected]>

MSM USB3.0 core wrapper consist of USB3.0 IP (SNPS) and HS, SS PHY's controll and configuration registers.

s/controll/control/

Quoted 9 lines

It could operate in device mode (SS, HS, FS) and host mode (SS, HS, FS, LS).

Documentation/devicetree/bindings/usb/msm-ssusb.txt +4 -0
 
+MSM SuperSpeed DWC3 USB SoC controller
+
+Required properities :
+- compatible : sould be "qcom,dwc3-hsphy";

...

Quoted 2 lines

+Required properities :
+- compatible : sould be "qcom,dwc3-ssphy";

I would expect different compatible values to be documented in different files.

Documentation/devicetree/bindings/usb/msm-ssusb.txt line 47

Quoted 3 lines
Documentation/devicetree/bindings/usb/msm-ssusb.txt +3 -0
+Optional properties :
+- gdsc-supply : phandle to the globally distributed switch controller
+  regulator node to the USB controller.

Which of the 3 compatible values that were described above is that property optional for?

Documentation/devicetree/bindings/usb/msm-ssusb.txt line 52

Quoted 4 lines
Documentation/devicetree/bindings/usb/msm-ssusb.txt +4 -0
+Sub nodes:
+- Sub node for "DWC3 USB3 controller".
+  This sub node is required property for device node. The properties
+  of this subnode are specified in dwc3.txt.

Why not represent the PHY and USB controller as separate top-level nodes? They can point at each-other with phandles if they need to know each-others' identity.

#8 lore raw

Re: [RFC PATCH v2 1/3] usb: dwc3: msm: Add device tree binding information

Hi,

Quoted 8 lines · Stephen Warren
Quoted 4 lines · Ivan T. Ivanov

From: "Ivan T. Ivanov" <[email protected]>

MSM USB3.0 core wrapper consist of USB3.0 IP (SNPS) and HS, SS PHY's controll and configuration registers.

s/controll/control/

Thanks.

Quoted 10 lines
Quoted 9 lines

It could operate in device mode (SS, HS, FS) and host mode (SS, HS, FS, LS).

Documentation/devicetree/bindings/usb/msm-ssusb.txt +4 -0
 
+MSM SuperSpeed DWC3 USB SoC controller
+
+Required properities :
+- compatible : sould be "qcom,dwc3-hsphy";

...

Quoted 5 lines
Quoted 2 lines

+Required properities :
+- compatible : sould be "qcom,dwc3-ssphy";

I would expect different compatible values to be documented in different files.

It is easy to see connection between them when they are in one file. Drivers are useless without each other.

Quoted 7 lines

Documentation/devicetree/bindings/usb/msm-ssusb.txt line 47

Quoted 4 lines
Documentation/devicetree/bindings/usb/msm-ssusb.txt +3 -0
+Optional properties :
+- gdsc-supply : phandle to the globally distributed switch controller
+  regulator node to the USB controller.

Which of the 3 compatible values that were described above is that property optional for?

"qcom,dwc3". I will make this more explicit.

Quoted 9 lines

Documentation/devicetree/bindings/usb/msm-ssusb.txt line 52

Quoted 5 lines
Documentation/devicetree/bindings/usb/msm-ssusb.txt +4 -0
+Sub nodes:
+- Sub node for "DWC3 USB3 controller".
+  This sub node is required property for device node. The properties
+  of this subnode are specified in dwc3.txt.

Why not represent the PHY and USB controller as separate top-level nodes? They can point at each-other with phandles if they need to know each-others' identity.

"qcom,dwc3" (glue layer) driver have to be loaded before "snps,dwc3", actual USB3 IP. "qcom,dwc3" provide required clocks and power supplies to the USB3 IP core.

Regards,
Ivan

#9 lore raw

RFC PATCH v2 2/3 usb: phy: Add Qualcomm SS-USB and HS-USB drivers for DWC3 core

In reply to Ivan T. Ivanov

From: "Ivan T. Ivanov" <[email protected]>

These drivers handles control and configuration of the HS and SS USB PHY transceivers. They are part of the driver which manage Synopsys DesignWare USB3 controller stack inside Qualcomm SoC's.

---
 drivers/usb/phy/Kconfig           |   11 ++
 drivers/usb/phy/Makefile          |    2 +
 drivers/usb/phy/phy-msm-dwc3-hs.c |  340 ++++++++++++++++++++++++++++++++
 drivers/usb/phy/phy-msm-dwc3-ss.c |  387 +++++++++++++++++++++++++++++++++++++
 4 files changed, 740 insertions(+)
 create mode 100644 drivers/usb/phy/phy-msm-dwc3-hs.c
 create mode 100644 drivers/usb/phy/phy-msm-dwc3-ss.c
drivers/usb/phy/Kconfig +11 -0
index 5443958..40e83b5 100644
@@ -202,6 +202,17 @@ config USB_RCAR_PHY
 	  To compile this driver as a module, choose M here: the
 	  module will be called phy-rcar-usb.
 
+config USB_MSM_DWC3_PHYS
+	tristate "Qualcomm DWC3 USB controller PHY's support"
+	depends on (USB || USB_GADGET) && ARCH_MSM
+	select USB_PHY
+	help
+	  Enable this to support the USB PHY transceivers on MSM chips with
+	  DWC3 USB core. It handles PHY initialization, clock management
+	  required after resetting the hardware and power management.
+	  This driver is required even for peripheral only or host only
+	  mode configurations.
+
 config USB_ULPI
 	bool "Generic ULPI Transceiver Driver"
 	depends on ARM
drivers/usb/phy/Makefile +2 -0
index 98730ca..ddaa11c 100644
@@ -24,6 +24,8 @@ obj-$(CONFIG_USB_EHCI_TEGRA)		+= phy-tegra-usb.o
 obj-$(CONFIG_USB_GPIO_VBUS)		+= phy-gpio-vbus-usb.o
 obj-$(CONFIG_USB_ISP1301)		+= phy-isp1301.o
 obj-$(CONFIG_USB_MSM_OTG)		+= phy-msm-usb.o
+obj-$(CONFIG_USB_MSM_DWC3_PHYS)		+= phy-msm-dwc3-hs.o
+obj-$(CONFIG_USB_MSM_DWC3_PHYS)		+= phy-msm-dwc3-ss.o
 obj-$(CONFIG_USB_MV_OTG)		+= phy-mv-usb.o
 obj-$(CONFIG_USB_MXS_PHY)		+= phy-mxs-usb.o
 obj-$(CONFIG_USB_RCAR_PHY)		+= phy-rcar-usb.o
drivers/usb/phy/phy-msm-dwc3-hs.c new file +340 -0

340 lines not on this page · raw message

drivers/usb/phy/phy-msm-dwc3-ss.c new file +387 -0

387 lines not on this page · raw message

Signature · 1 line
1.7.9.5
#10 lore raw

RFC PATCH v2 3/3 usb: dwc3: Add Qualcomm DWC3 glue layer driver

In reply to Ivan T. Ivanov

From: "Ivan T. Ivanov" <[email protected]>

DWC3 glue layer is hardware layer around Synopsys DesignWare USB3 core. Its purpose is to supply Synopsys IP with required clocks, voltages and interface it with the rest of the SoC.

---
 drivers/usb/dwc3/Kconfig    |    8 ++
 drivers/usb/dwc3/Makefile   |    1 +
 drivers/usb/dwc3/dwc3-msm.c |  174 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 183 insertions(+)
 create mode 100644 drivers/usb/dwc3/dwc3-msm.c
drivers/usb/dwc3/Kconfig +8 -0
index 3e225d5..e2032c4 100644
@@ -70,6 +70,14 @@ config USB_DWC3_PCI
 	  One such PCIe-based platform is Synopsys' PCIe HAPS model of
 	  this IP.
 
+config USB_DWC3_MSM
+	tristate "Qualcomm MSM/APQ Platforms"
+	default USB_DWC3
+	select USB_MSM_DWC3_PHYS
+	help
+	  Recent Qualcomm SoCs ship with one DesignWare Core USB3 IP inside,
+	  say 'Y' or 'M' if you have one such device.
+
 comment "Debugging features"
 
 config USB_DWC3_DEBUG
drivers/usb/dwc3/Makefile +1 -0
index dd17601..5226681 100644
@@ -32,3 +32,4 @@ endif
 obj-$(CONFIG_USB_DWC3_OMAP)		+= dwc3-omap.o
 obj-$(CONFIG_USB_DWC3_EXYNOS)		+= dwc3-exynos.o
 obj-$(CONFIG_USB_DWC3_PCI)		+= dwc3-pci.o
+obj-$(CONFIG_USB_DWC3_MSM)		+= dwc3-msm.o
drivers/usb/dwc3/dwc3-msm.c new file +174 -0

174 lines not on this page · raw message

Signature · 1 line
1.7.9.5
#11 lore raw

Re: [RFC PATCH v2 3/3] usb: dwc3: Add Qualcomm DWC3 glue layer driver

Quoted 7 lines · Ivan T. Ivanov

From: "Ivan T. Ivanov" <[email protected]>

DWC3 glue layer is hardware layer around Synopsys DesignWare USB3 core. Its purpose is to supply Synopsys IP with required clocks, voltages and interface it with the rest of the SoC.

same comments from previous version.

Signature · 1 line
balbi
#12 lore raw

Re: [RFC PATCH v2 3/3] usb: dwc3: Add Qualcomm DWC3 glue layer driver

Hi,

Quoted 11 lines · Felipe Balbi
Quoted 7 lines · Ivan T. Ivanov

From: "Ivan T. Ivanov" <[email protected]>

DWC3 glue layer is hardware layer around Synopsys DesignWare USB3 core. Its purpose is to supply Synopsys IP with required clocks, voltages and interface it with the rest of the SoC.

same comments from previous version.

Sorry, I have somehow missed Your email.
I will address them shortly.

Regard,
Ivan