Skip to contentSkip to conversation

DWC3 USB support for Qualcomm platform

PATCH Superseded Ivan T. Ivanov 6 participants 23 messages Aug 20, 2013 – Oct 1, 2013 1 message not in the archive

Subsystems (4)

v4 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

v4 cover DWC3 USB support for Qualcomm platform

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

Hi,

Here is fourth version of MSM USB3 drivers patches.

Changes since v3:
* Remove "_clk" suffix from clock names
* Clarify required child node for qcom,dwc3
* Fix comments in functions headers
* Use dbg instead err in drivers probe functions.

Changes since v2:
* Several improvements in devicetree bindings description
* Disable regulators in glue layer if there is error during ioremap.

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

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

Generated on top of Felipe 'testing' branch.

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          |  104 ++++++
 drivers/usb/dwc3/Kconfig                           |    8 +
 drivers/usb/dwc3/Makefile                          |    1 +
 drivers/usb/dwc3/dwc3-msm.c                        |  167 +++++++++
 drivers/usb/phy/Kconfig                            |   11 +
 drivers/usb/phy/Makefile                           |    2 +
 drivers/usb/phy/phy-msm-dwc3-hs.c                  |  327 +++++++++++++++++
 drivers/usb/phy/phy-msm-dwc3-ss.c                  |  374 ++++++++++++++++++++
 8 files changed, 994 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

PATCH v4 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 from Synopsys (SNPS) and HS, SS PHY's control 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          |  104 ++++++++++++++++++++
 1 file changed, 104 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/usb/msm-ssusb.txt
Documentation/devicetree/bindings/usb/msm-ssusb.txt new file +104 -0
new file mode 100644
index 0000000..cacbd3b
@@ -0,0 +1,104 @@
+MSM SuperSpeed DWC3 USB SoC controller
+
+
+DWC3 Highspeed USB PHY
+======================
+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" : 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
+=======================
+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" : 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 wrapper
+=======================
+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" : Master/Core clock, have to be >= 125 MHz for SS
+	operation and >= 60MHz for HS operation
+	"iface" : System bus AXI clock
+	"sleep" : Sleep clock, used when USB3 core goes into low
+	power mode (U3).
+	"utmi" : 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.
+Required child node:
+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.
+
+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";
+
+		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";
+
+		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", "iface", "sleep", "utmi";
+
+		gdsc-supply = <&supply>;
+
+		ranges;
+		dwc3@f9200000 {
+			compatible = "snps,dwc3";
+			reg = <0xf9200000 0xcd00>;
+			interrupts = <0 131 0>;
+			usb-phy = <&dwc3_hsphy>, <&dwc3_ssphy>;
+			tx-fifo-resize;
+		};
+	};
Signature · 1 line
1.7.9.5
#2 lore raw

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

Hi,

Quoted 9 lines · Ivan T. Ivanov

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

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

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

Any acks for the DT part ? This patch has been pending forever.

Quoted 118 lines
---
 .../devicetree/bindings/usb/msm-ssusb.txt          |  104 ++++++++++++++++++++
 1 file changed, 104 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/usb/msm-ssusb.txt
Documentation/devicetree/bindings/usb/msm-ssusb.txt new file +104 -0
new file mode 100644
index 0000000..cacbd3b
@@ -0,0 +1,104 @@
+MSM SuperSpeed DWC3 USB SoC controller
+
+
+DWC3 Highspeed USB PHY
+======================
+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" : 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
+=======================
+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" : 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 wrapper
+=======================
+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" : Master/Core clock, have to be >= 125 MHz for SS
+	operation and >= 60MHz for HS operation
+	"iface" : System bus AXI clock
+	"sleep" : Sleep clock, used when USB3 core goes into low
+	power mode (U3).
+	"utmi" : 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.
+Required child node:
+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.
+
+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";
+
+		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";
+
+		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", "iface", "sleep", "utmi";
+
+		gdsc-supply = <&supply>;
+
+		ranges;
+		dwc3@f9200000 {
+			compatible = "snps,dwc3";
+			reg = <0xf9200000 0xcd00>;
+			interrupts = <0 131 0>;
+			usb-phy = <&dwc3_hsphy>, <&dwc3_ssphy>;
+			tx-fifo-resize;
+		};
+	};
Signature · 1 line
1.7.9.5
Signature · 1 line
balbi
#3 lore raw

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

Quoted 8 lines · Felipe Balbi

Hi,

Quoted 5 lines · Ivan T. Ivanov

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

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

Quoted 6 lines
Quoted 4 lines

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

Any acks for the DT part ? This patch has been pending forever.

Apologies for the delay. I have a couple of comments that would be nice to fix up now.

Quoted 6 lines
Quoted 6 lines
---
 .../devicetree/bindings/usb/msm-ssusb.txt          |  104 ++++++++++++++++++++
 1 file changed, 104 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/usb/msm-ssusb.txt
Quoted 13 lines

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

Quoted 13 lines
Documentation/devicetree/bindings/usb/msm-ssusb.txt new file +7 -0
new file mode 100644
index 0000000..cacbd3b
@@ -0,0 +1,104 @@
+MSM SuperSpeed DWC3 USB SoC controller
+
+
+DWC3 Highspeed USB PHY
+======================
+Required properities :
+- compatible : sould be "qcom,dwc3-hsphy";

s/sould/should/

In general, compatible properties are "should contain" rather than "should be", as we might have backwards compatible hardware in future.

Quoted 2 lines

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

Quoted 2 lines
Documentation/devicetree/bindings/usb/msm-ssusb.txt new file +2 -0
+- reg : offset and length of the register set in the memory map
+- clocks : phandles to clock instances of the device tree nodes

Clocks are referred to be phandle + clock-specifier pairs rather than phandles, it would be nice to fix the terminology here

Quoted 4 lines

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

Quoted 4 lines
Documentation/devicetree/bindings/usb/msm-ssusb.txt new file +4 -0
+- clock-names :
+	"xo" : External reference clock 19 MHz
+	"sleep_a" : Sleep clock, used when USB3 core goes into low
+	power mode (U3).

I think it would be nicer to say:
- clocks : A list of phandle + clock-specifier pairs for the clocks listed in clock-names
- clock-names: Should contain the following:
"xo" - External reference clock (19MHz)
"sleep_a" - Sleep clock used when USB3 core goes into low
power mode (U3).

I'm not sure we need to describe the frequency of the xo clock -- either it's a requriement of the IP and thus doesn't need to be a part of the binding, or it's configurable by the driver and thus doesn't need to be documented.

Quoted 6 lines

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

Quoted 6 lines
Documentation/devicetree/bindings/usb/msm-ssusb.txt new file +6 -0
+<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

Any reason for the HSPHY/HS-PHY difference?

I'd list these separately with their full names:

- v1p8-supply: phandle to the regulator for the 1.8v supply to HSPHY.
- v3p3-supply: phandle to the regulator for the 3.3v supply to HSPHY.
- vbus-supply: phandle to the regulator for the vbus supply for host mode.
- vddcx-supply: phandle to the regulator for the vdd supply for HSPHY digital circuit operation.

Quoted 6 lines
Quoted 6 lines
Documentation/devicetree/bindings/usb/msm-ssusb.txt new file +6 -0
+
+DWC3 Superspeed USB PHY
+=======================
+Required properities :
+- compatible : sould be "qcom,dwc3-ssphy";
+- reg : offset and length of the register set in the memory map
Quoted 8 lines

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

Quoted 8 lines
Documentation/devicetree/bindings/usb/msm-ssusb.txt new file +8 -0
+- clocks : phandles to clock instances of the device tree nodes
+- clock-names :
+	"xo" : External reference clock 19 MHz
+	"ref" : 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

The commments on compatible, clocks, clock-names and the regulators apply here.

Quoted 12 lines
Quoted 12 lines
Documentation/devicetree/bindings/usb/msm-ssusb.txt new file +12 -0
+
+DWC3 controller wrapper
+=======================
+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" : Master/Core clock, have to be >= 125 MHz for SS
+	operation and >= 60MHz for HS operation
Quoted 8 lines

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

Quoted 8 lines
Documentation/devicetree/bindings/usb/msm-ssusb.txt new file +8 -0
+	"iface" : System bus AXI clock
+	"sleep" : Sleep clock, used when USB3 core goes into low
+	power mode (U3).
+	"utmi" : 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.

The commments on compatible, clocks, and clock-names apply here too. I see the regulator is defined individually :)

I'm fine with the binding itself, I'd just like the documentation fixed up.

Cheers,
Mark.

Quoted 57 lines
Quoted 54 lines
Documentation/devicetree/bindings/usb/msm-ssusb.txt new file +51 -0
+Required child node:
+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.
+
+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";
+
+		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";
+
+		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", "iface", "sleep", "utmi";
+
+		gdsc-supply = <&supply>;
+
+		ranges;
+		dwc3@f9200000 {
+			compatible = "snps,dwc3";
+			reg = <0xf9200000 0xcd00>;
+			interrupts = <0 131 0>;
+			usb-phy = <&dwc3_hsphy>, <&dwc3_ssphy>;
+			tx-fifo-resize;
+		};
+	};
Signature · 1 line
1.7.9.5
Signature · 1 line
balbi
#4 lore raw

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

Hi, I am sorry for delay answer.

Quoted 41 lines · Mark Rutland
Quoted 8 lines · Felipe Balbi

Hi,

Quoted 5 lines · Ivan T. Ivanov

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

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

Quoted 6 lines
Quoted 4 lines

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

Any acks for the DT part ? This patch has been pending forever.

Apologies for the delay. I have a couple of comments that would be nice to fix up now.

Quoted 6 lines
Quoted 6 lines
---
 .../devicetree/bindings/usb/msm-ssusb.txt          |  104 ++++++++++++++++++++
 1 file changed, 104 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/usb/msm-ssusb.txt
Quoted 13 lines

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

Quoted 13 lines
Documentation/devicetree/bindings/usb/msm-ssusb.txt new file +7 -0
new file mode 100644
index 0000000..cacbd3b
@@ -0,0 +1,104 @@
+MSM SuperSpeed DWC3 USB SoC controller
+
+
+DWC3 Highspeed USB PHY
+======================
+Required properities :
+- compatible : sould be "qcom,dwc3-hsphy";

s/sould/should/

Quoted 2 lines

In general, compatible properties are "should contain" rather than "should be", as we might have backwards compatible hardware in future.

Ok.

Quoted 6 lines
Quoted 3 lines

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

Quoted 3 lines
Documentation/devicetree/bindings/usb/msm-ssusb.txt new file +2 -0
+- reg : offset and length of the register set in the memory map
+- clocks : phandles to clock instances of the device tree nodes

Clocks are referred to be phandle + clock-specifier pairs rather than phandles, it would be nice to fix the terminology here

Ok.

Quoted 14 lines
Quoted 5 lines

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

Quoted 5 lines
Documentation/devicetree/bindings/usb/msm-ssusb.txt new file +4 -0
+- clock-names :
+	"xo" : External reference clock 19 MHz
+	"sleep_a" : Sleep clock, used when USB3 core goes into low
+	power mode (U3).

I think it would be nicer to say:
- clocks : A list of phandle + clock-specifier pairs for the clocks listed in clock-names
- clock-names: Should contain the following:
"xo" - External reference clock (19MHz)
"sleep_a" - Sleep clock used when USB3 core goes into low
power mode (U3).

Quoted 4 lines

I'm not sure we need to describe the frequency of the xo clock -- either it's a requriement of the IP and thus doesn't need to be a part of the binding, or it's configurable by the driver and thus doesn't need to be documented.

Ok. will remove explicit numbers here.

Quoted 9 lines
Quoted 7 lines

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

Quoted 7 lines
Documentation/devicetree/bindings/usb/msm-ssusb.txt new file +6 -0
+<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

Any reason for the HSPHY/HS-PHY difference?

No, just lack of attention from my side.

Quoted 10 lines

I'd list these separately with their full names:

- v1p8-supply: phandle to the regulator for the 1.8v supply to HSPHY.
- v3p3-supply: phandle to the regulator for the 3.3v supply to HSPHY.
- vbus-supply: phandle to the regulator for the vbus supply for host mode.
- vddcx-supply: phandle to the regulator for the vdd supply for HSPHY digital circuit operation.

ok.

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Documentation/devicetree/bindings/usb/msm-ssusb.txt new file +9 -0
+
+DWC3 Superspeed USB PHY
+=======================
+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
Quoted 8 lines
Quoted 5 lines

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

Quoted 5 lines
Documentation/devicetree/bindings/usb/msm-ssusb.txt new file +5 -0
+	"ref" : 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

The commments on compatible, clocks, clock-names and the regulators apply here.

ok

Quoted 25 lines
Quoted 13 lines
Quoted 13 lines
Documentation/devicetree/bindings/usb/msm-ssusb.txt new file +12 -0
+
+DWC3 controller wrapper
+=======================
+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" : Master/Core clock, have to be >= 125 MHz for SS
+	operation and >= 60MHz for HS operation
Quoted 8 lines

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

Quoted 8 lines
Documentation/devicetree/bindings/usb/msm-ssusb.txt new file +8 -0
+	"iface" : System bus AXI clock
+	"sleep" : Sleep clock, used when USB3 core goes into low
+	power mode (U3).
+	"utmi" : 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.

The commments on compatible, clocks, and clock-names apply here too. I see the regulator is defined individually :)

Quoted 3 lines

I'm fine with the binding itself, I'd just like the documentation fixed up.

Thanks,
Ivan

Quoted 62 lines

Cheers,
Mark.

Quoted 46 lines
Quoted 46 lines
Documentation/devicetree/bindings/usb/msm-ssusb.txt new file +46 -0
+Required child node:
+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.
+
+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";
+
+		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";
+
+		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", "iface", "sleep", "utmi";
+
+		gdsc-supply = <&supply>;
+
+		ranges;
+		dwc3@f9200000 {
+			compatible = "snps,dwc3";
+			reg = <0xf9200000 0xcd00>;
Quoted 11 lines
Quoted 8 lines
Documentation/devicetree/bindings/usb/msm-ssusb.txt new file +5 -0
+			interrupts = <0 131 0>;
+			usb-phy = <&dwc3_hsphy>, <&dwc3_ssphy>;
+			tx-fifo-resize;
+		};
+	};
Signature · 1 line
1.7.9.5
Signature · 1 line
balbi
Quoted 4 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#5 lore raw

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

In reply to Felipe Balbi

Hi,

Quoted 8 lines · Felipe Balbi

Hi,

Quoted 5 lines · Ivan T. Ivanov

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

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

Quoted 6 lines
Quoted 4 lines

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

Any acks for the DT part ? This patch has been pending forever.

Thanks you for you patience Felipe. There are also several small fixups in the driver code that I will like to address. Will send updated version with all pending comments shortly.

Regards,
Ivan

#6 lore raw

PATCH v4 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 |  327 ++++++++++++++++++++++++++++++++
 drivers/usb/phy/phy-msm-dwc3-ss.c |  374 +++++++++++++++++++++++++++++++++++++
 4 files changed, 714 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 d5589f9..c525835 100644
@@ -214,6 +214,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 2135e85..8f2dd94 100644
@@ -26,6 +26,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 +327 -0

327 lines not on this page · raw message

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

374 lines not on this page · raw message

Signature · 1 line
1.7.9.5
#7 lore raw

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

Hi,

Quoted 7 lines · 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.

Quoted 6 lines
---
 drivers/usb/phy/Kconfig           |   11 ++
 drivers/usb/phy/Makefile          |    2 +
 drivers/usb/phy/phy-msm-dwc3-hs.c |  327 ++++++++++++++++++++++++++++++++
 drivers/usb/phy/phy-msm-dwc3-ss.c |  374 +++++++++++++++++++++++++++++++++++++

please rename these PHY drivers, they have nothing to do with DWC3. PHYs don't care about the USB controller.

Signature · 1 line
balbi
#8 lore raw

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

Hi,

Quoted 17 lines · Felipe Balbi

Hi,

Quoted 7 lines · 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.

Quoted 6 lines
---
 drivers/usb/phy/Kconfig           |   11 ++
 drivers/usb/phy/Makefile          |    2 +
 drivers/usb/phy/phy-msm-dwc3-hs.c |  327 ++++++++++++++++++++++++++++++++
 drivers/usb/phy/phy-msm-dwc3-ss.c |  374 +++++++++++++++++++++++++++++++++++++
Quoted 2 lines

please rename these PHY drivers, they have nothing to do with DWC3. PHYs don't care about the USB controller.

I think they are SNPS DesignWare PHY's, additionally wrapped with Qualcomm logic. I could substitute "dwc3" with just "dw", which will be more correct.

Regards,
Ivan

#9 lore raw

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

Hi,

Quoted 15 lines · Ivan T. Ivanov
Quoted 15 lines · Ivan T. Ivanov
Quoted 13 lines

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 |  327 ++++++++++++++++++++++++++++++++
 drivers/usb/phy/phy-msm-dwc3-ss.c |  374 +++++++++++++++++++++++++++++++++++++
Quoted 6 lines
Quoted 2 lines

please rename these PHY drivers, they have nothing to do with DWC3. PHYs don't care about the USB controller.

I think they are SNPS DesignWare PHY's, additionally wrapped with Qualcomm logic. I could substitute "dwc3" with just "dw", which will be more correct.

alright, thank you. Let's add Paul to the loop since he might have very good insight in the synopsys PHYs.

mental note: if any other platform shows up with Synopsys PHY, ask them to use this driver instead :-)

Signature · 1 line
balbi
#10 lore raw

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

Hi,

Quoted 25 lines · Felipe Balbi

Hi,

Quoted 15 lines · Ivan T. Ivanov
Quoted 15 lines · Ivan T. Ivanov
Quoted 13 lines

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 |  327 ++++++++++++++++++++++++++++++++
 drivers/usb/phy/phy-msm-dwc3-ss.c |  374 +++++++++++++++++++++++++++++++++++++
Quoted 6 lines
Quoted 2 lines

please rename these PHY drivers, they have nothing to do with DWC3. PHYs don't care about the USB controller.

I think they are SNPS DesignWare PHY's, additionally wrapped with Qualcomm logic. I could substitute "dwc3" with just "dw", which will be more correct.

Quoted 5 lines

alright, thank you. Let's add Paul to the loop since he might have very good insight in the synopsys PHYs.

mental note: if any other platform shows up with Synopsys PHY, ask them to use this driver instead :-)

I really doubt that this will bi possible. Control of the PHY's is not directly trough ULPI, UTMI or PIPE3 interfaces, but trough QSCRATCH registers, which of course is highly Qualcomm specific.

Regards,
Ivan

#11 lore raw

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

Quoted 31 lines · Ivan T. Ivanov

Hi,

Quoted 28 lines · Felipe Balbi

Hi,

Quoted 15 lines · Ivan T. Ivanov
Quoted 15 lines · Ivan T. Ivanov
Quoted 13 lines

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 |  327 ++++++++++++++++++++++++++++++++
 drivers/usb/phy/phy-msm-dwc3-ss.c |  374 +++++++++++++++++++++++++++++++++++++
Quoted 6 lines
Quoted 2 lines

please rename these PHY drivers, they have nothing to do with DWC3. PHYs don't care about the USB controller.

I think they are SNPS DesignWare PHY's, additionally wrapped with Qualcomm logic. I could substitute "dwc3" with just "dw", which will be more correct.

alright, thank you. Let's add Paul to the loop since he might have very good insight in the synopsys PHYs.

Quoted 6 lines
Quoted 2 lines

mental note: if any other platform shows up with Synopsys PHY, ask them to use this driver instead :-)

I really doubt that this will bi possible. Control of the PHY's is not directly trough ULPI, UTMI or PIPE3 interfaces, but trough QSCRATCH registers, which of course is highly Qualcomm specific.

isn't it a memory mapped IP ? doesn't synopsys provide their own set of registers ?

Signature · 1 line
balbi
#12 lore raw

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

Hi,

Quoted 35 lines · Felipe Balbi
Quoted 34 lines · Ivan T. Ivanov

Hi,

Quoted 30 lines · Felipe Balbi

Hi,

Quoted 15 lines · Ivan T. Ivanov
Quoted 15 lines · Ivan T. Ivanov
Quoted 13 lines

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 |  327 ++++++++++++++++++++++++++++++++
 drivers/usb/phy/phy-msm-dwc3-ss.c |  374 +++++++++++++++++++++++++++++++++++++
Quoted 6 lines
Quoted 2 lines

please rename these PHY drivers, they have nothing to do with DWC3. PHYs don't care about the USB controller.

I think they are SNPS DesignWare PHY's, additionally wrapped with Qualcomm logic. I could substitute "dwc3" with just "dw", which will be more correct.

alright, thank you. Let's add Paul to the loop since he might have very good insight in the synopsys PHYs.

mental note: if any other platform shows up with Synopsys PHY, ask them to use this driver instead :-)

Quoted 8 lines
Quoted 3 lines

I really doubt that this will bi possible. Control of the PHY's is not directly trough ULPI, UTMI or PIPE3 interfaces, but trough QSCRATCH registers, which of course is highly Qualcomm specific.

isn't it a memory mapped IP ? doesn't synopsys provide their own set of registers ?

From what I see it is not directly mapped. How QSCRATCH write and

reads transactions are translated to DW IP is unclear to me.

Ivan

#13 lore raw

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

Quoted 43 lines · Ivan T. Ivanov

Hi,

Quoted 39 lines · Felipe Balbi
Quoted 37 lines · Ivan T. Ivanov

Hi,

Quoted 25 lines · Felipe Balbi

Hi,

Quoted 15 lines · Ivan T. Ivanov
Quoted 15 lines · Ivan T. Ivanov
Quoted 13 lines

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 |  327 ++++++++++++++++++++++++++++++++
drivers/usb/phy/phy-msm-dwc3-ss.c |  374 +++++++++++++++++++++++++++++++++++++
Quoted 6 lines
Quoted 2 lines

please rename these PHY drivers, they have nothing to do with DWC3. PHYs don't care about the USB controller.

I think they are SNPS DesignWare PHY's, additionally wrapped with Qualcomm logic. I could substitute "dwc3" with just "dw", which will be more correct.

Quoted 5 lines

alright, thank you. Let's add Paul to the loop since he might have very good insight in the synopsys PHYs.

mental note: if any other platform shows up with Synopsys PHY, ask them to use this driver instead :-)

I really doubt that this will bi possible. Control of the PHY's is not directly trough ULPI, UTMI or PIPE3 interfaces, but trough QSCRATCH registers, which of course is highly Qualcomm specific.

Quoted 5 lines
Quoted 2 lines

isn't it a memory mapped IP ? doesn't synopsys provide their own set of registers ?

From what I see it is not directly mapped. How QSCRATCH write and reads transactions are translated to DW IP is unclear to me.

I think the question is how does SW access them?

- k

Signature · 2 lines
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
#14 lore raw

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

Quoted 45 lines · Kumar Gala
Quoted 43 lines · Ivan T. Ivanov

Hi,

Quoted 39 lines · Felipe Balbi
Quoted 37 lines · Ivan T. Ivanov

Hi,

Quoted 25 lines · Felipe Balbi

Hi,

Quoted 15 lines · Ivan T. Ivanov
Quoted 15 lines · Ivan T. Ivanov
Quoted 13 lines

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 |  327 ++++++++++++++++++++++++++++++++
drivers/usb/phy/phy-msm-dwc3-ss.c |  374 +++++++++++++++++++++++++++++++++++++
Quoted 6 lines
Quoted 2 lines

please rename these PHY drivers, they have nothing to do with DWC3. PHYs don't care about the USB controller.

I think they are SNPS DesignWare PHY's, additionally wrapped with Qualcomm logic. I could substitute "dwc3" with just "dw", which will be more correct.

Quoted 5 lines

alright, thank you. Let's add Paul to the loop since he might have very good insight in the synopsys PHYs.

mental note: if any other platform shows up with Synopsys PHY, ask them to use this driver instead :-)

I really doubt that this will bi possible. Control of the PHY's is not directly trough ULPI, UTMI or PIPE3 interfaces, but trough QSCRATCH registers, which of course is highly Qualcomm specific.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

isn't it a memory mapped IP ? doesn't synopsys provide their own set of registers ?

From what I see it is not directly mapped. How QSCRATCH write and reads transactions are translated to DW IP is unclear to me.

I think the question is how does SW access them?

I afraid the answer may be: "it depends on the SOC". In my past I had to initialize a (SATA) PHY by implementing a software JTAG state machine, as the PHY's registers were not memory mapped *at all*. And the IP itself came from Synopsys, Cadence or yet another EDA company...

Paweł

#15 lore raw

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

Quoted 53 lines · Pawel Moll
Quoted 52 lines · Kumar Gala
Quoted 48 lines · Ivan T. Ivanov

Hi,

Quoted 35 lines · Felipe Balbi
Quoted 34 lines · Ivan T. Ivanov

Hi,

Quoted 30 lines · Felipe Balbi

Hi,

Quoted 15 lines · Ivan T. Ivanov
Quoted 15 lines · Ivan T. Ivanov
Quoted 13 lines

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 |  327 ++++++++++++++++++++++++++++++++
drivers/usb/phy/phy-msm-dwc3-ss.c |  374 +++++++++++++++++++++++++++++++++++++
Quoted 6 lines
Quoted 2 lines

please rename these PHY drivers, they have nothing to do with DWC3. PHYs don't care about the USB controller.

I think they are SNPS DesignWare PHY's, additionally wrapped with Qualcomm logic. I could substitute "dwc3" with just "dw", which will be more correct.

alright, thank you. Let's add Paul to the loop since he might have very good insight in the synopsys PHYs.

mental note: if any other platform shows up with Synopsys PHY, ask them to use this driver instead :-)

Quoted 6 lines
Quoted 3 lines

I really doubt that this will bi possible. Control of the PHY's is not directly trough ULPI, UTMI or PIPE3 interfaces, but trough QSCRATCH registers, which of course is highly Qualcomm specific.

isn't it a memory mapped IP ? doesn't synopsys provide their own set of registers ?

From what I see it is not directly mapped. How QSCRATCH write and reads transactions are translated to DW IP is unclear to me.

Quoted 6 lines
Quoted 1 line

I think the question is how does SW access them?

I afraid the answer may be: "it depends on the SOC". In my past I had to initialize a (SATA) PHY by implementing a software JTAG state machine, as the PHY's registers were not memory mapped *at all*. And the IP itself came from Synopsys, Cadence or yet another EDA company...

Having said all that... If the PHY's spec at least defined layout of the registers in question and driver was using regmap API to talk to the device (initially regmap-mmio), it has some chances to become universal. The SOCs designed like "my" one would have to provide a custom regmap implementation.

Paweł

#16 lore raw

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

Quoted 61 lines · Pawel Moll
Quoted 53 lines · Pawel Moll
Quoted 52 lines · Kumar Gala
Quoted 48 lines · Ivan T. Ivanov

Hi,

Quoted 35 lines · Felipe Balbi
Quoted 34 lines · Ivan T. Ivanov

Hi,

Quoted 30 lines · Felipe Balbi

Hi,

Quoted 15 lines · Ivan T. Ivanov
Quoted 15 lines · Ivan T. Ivanov
Quoted 13 lines

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 |  327 ++++++++++++++++++++++++++++++++
drivers/usb/phy/phy-msm-dwc3-ss.c |  374 +++++++++++++++++++++++++++++++++++++
Quoted 6 lines
Quoted 2 lines

please rename these PHY drivers, they have nothing to do with DWC3. PHYs don't care about the USB controller.

I think they are SNPS DesignWare PHY's, additionally wrapped with Qualcomm logic. I could substitute "dwc3" with just "dw", which will be more correct.

alright, thank you. Let's add Paul to the loop since he might have very good insight in the synopsys PHYs.

mental note: if any other platform shows up with Synopsys PHY, ask them to use this driver instead :-)

Quoted 6 lines
Quoted 3 lines

I really doubt that this will bi possible. Control of the PHY's is not directly trough ULPI, UTMI or PIPE3 interfaces, but trough QSCRATCH registers, which of course is highly Qualcomm specific.

isn't it a memory mapped IP ? doesn't synopsys provide their own set of registers ?

From what I see it is not directly mapped. How QSCRATCH write and reads transactions are translated to DW IP is unclear to me.

Quoted 6 lines
Quoted 1 line

I think the question is how does SW access them?

I afraid the answer may be: "it depends on the SOC". In my past I had to initialize a (SATA) PHY by implementing a software JTAG state machine, as the PHY's registers were not memory mapped *at all*. And the IP itself came from Synopsys, Cadence or yet another EDA company...

Quoted 5 lines

Having said all that... If the PHY's spec at least defined layout of the registers in question and driver was using regmap API to talk to the device (initially regmap-mmio), it has some chances to become universal. The SOCs designed like "my" one would have to provide a custom regmap implementation.

Sound reasonable. Unfortunately I don't have PHY's IP spec.

Regards,
Ivan

Quoted 3 lines

Paweł

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

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

#18 lore raw

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

Quoted 71 lines · Kumar Gala
Quoted 68 lines · Ivan T. Ivanov
Quoted 66 lines · Pawel Moll
Quoted 53 lines · Pawel Moll
Quoted 52 lines · Kumar Gala
Quoted 48 lines · Ivan T. Ivanov

Hi,

Quoted 35 lines · Felipe Balbi
Quoted 34 lines · Ivan T. Ivanov

Hi,

Quoted 30 lines · Felipe Balbi

Hi,

Quoted 15 lines · Ivan T. Ivanov
Quoted 15 lines · Ivan T. Ivanov
Quoted 13 lines

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 |  327 ++++++++++++++++++++++++++++++++
drivers/usb/phy/phy-msm-dwc3-ss.c |  374 +++++++++++++++++++++++++++++++++++++
Quoted 6 lines
Quoted 2 lines

please rename these PHY drivers, they have nothing to do with DWC3. PHYs don't care about the USB controller.

I think they are SNPS DesignWare PHY's, additionally wrapped with Qualcomm logic. I could substitute "dwc3" with just "dw", which will be more correct.

alright, thank you. Let's add Paul to the loop since he might have very good insight in the synopsys PHYs.

mental note: if any other platform shows up with Synopsys PHY, ask them to use this driver instead :-)

Quoted 6 lines
Quoted 3 lines

I really doubt that this will bi possible. Control of the PHY's is not directly trough ULPI, UTMI or PIPE3 interfaces, but trough QSCRATCH registers, which of course is highly Qualcomm specific.

isn't it a memory mapped IP ? doesn't synopsys provide their own set of registers ?

From what I see it is not directly mapped. How QSCRATCH write and reads transactions are translated to DW IP is unclear to me.

Quoted 6 lines
Quoted 1 line

I think the question is how does SW access them?

I afraid the answer may be: "it depends on the SOC". In my past I had to initialize a (SATA) PHY by implementing a software JTAG state machine, as the PHY's registers were not memory mapped *at all*. And the IP itself came from Synopsys, Cadence or yet another EDA company...

Having said all that... If the PHY's spec at least defined layout of the registers in question and driver was using regmap API to talk to the device (initially regmap-mmio), it has some chances to become universal. The SOCs designed like "my" one would have to provide a custom regmap implementation.

Quoted 5 lines
Quoted 1 line

Sound reasonable. Unfortunately I don't have PHY's IP spec.

Looking into this it appears that the register wrapper around the IP is most likely highly specific to qualcomm as I'm not seeing a register interface around the DWC HS PHY.

Then it's set, we'll go with this driver :-)

Signature · 1 line
balbi
#19 lore raw

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

Quoted 72 lines · Felipe Balbi
Quoted 71 lines · Kumar Gala
Quoted 68 lines · Ivan T. Ivanov
Quoted 66 lines · Pawel Moll
Quoted 53 lines · Pawel Moll
Quoted 52 lines · Kumar Gala
Quoted 48 lines · Ivan T. Ivanov

Hi,

Quoted 35 lines · Felipe Balbi
Quoted 34 lines · Ivan T. Ivanov

Hi,

Quoted 30 lines · Felipe Balbi

Hi,

Quoted 15 lines · Ivan T. Ivanov
Quoted 15 lines · Ivan T. Ivanov
Quoted 13 lines

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.

Signed-off-by: Ivan T. Ivanov <[email protected]>
---
drivers/usb/phy/Kconfig | 11 ++
drivers/usb/phy/Makefile | 2 +
drivers/usb/phy/phy-msm-dwc3-hs.c | 327 ++++++++++++++++++++++++++++++++
drivers/usb/phy/phy-msm-dwc3-ss.c | 374 +++++++++++++++++++++++++++++++++++++

Quoted 6 lines
Quoted 2 lines

please rename these PHY drivers, they have nothing to do with DWC3. PHYs don't care about the USB controller.

I think they are SNPS DesignWare PHY's, additionally wrapped with Qualcomm logic. I could substitute "dwc3" with just "dw", which will be more correct.

alright, thank you. Let's add Paul to the loop since he might have very good insight in the synopsys PHYs.

mental note: if any other platform shows up with Synopsys PHY, ask them to use this driver instead :-)

Quoted 6 lines
Quoted 3 lines

I really doubt that this will bi possible. Control of the PHY's is not directly trough ULPI, UTMI or PIPE3 interfaces, but trough QSCRATCH registers, which of course is highly Qualcomm specific.

isn't it a memory mapped IP ? doesn't synopsys provide their own set of registers ?

From what I see it is not directly mapped. How QSCRATCH write and reads transactions are translated to DW IP is unclear to me.

Quoted 6 lines
Quoted 1 line

I think the question is how does SW access them?

I afraid the answer may be: "it depends on the SOC". In my past I had to initialize a (SATA) PHY by implementing a software JTAG state machine, as the PHY's registers were not memory mapped *at all*. And the IP itself came from Synopsys, Cadence or yet another EDA company...

Having said all that... If the PHY's spec at least defined layout of the registers in question and driver was using regmap API to talk to the device (initially regmap-mmio), it has some chances to become universal. The SOCs designed like "my" one would have to provide a custom regmap implementation.

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

Sound reasonable. Unfortunately I don't have PHY's IP spec.

Looking into this it appears that the register wrapper around the IP is most likely highly specific to qualcomm as I'm not seeing a register interface around the DWC HS PHY.

Then it's set, we'll go with this driver :-)

Does this mean that driver could be merged?

Regards,
Ivan

#20 lore raw

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

In reply to Kumar Gala
Quoted 45 lines · Kumar Gala
Quoted 43 lines · Ivan T. Ivanov

Hi,

Quoted 39 lines · Felipe Balbi
Quoted 37 lines · Ivan T. Ivanov

Hi,

Quoted 25 lines · Felipe Balbi

Hi,

Quoted 15 lines · Ivan T. Ivanov
Quoted 15 lines · Ivan T. Ivanov
Quoted 13 lines

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 |  327 ++++++++++++++++++++++++++++++++
drivers/usb/phy/phy-msm-dwc3-ss.c |  374 +++++++++++++++++++++++++++++++++++++
Quoted 6 lines
Quoted 2 lines

please rename these PHY drivers, they have nothing to do with DWC3. PHYs don't care about the USB controller.

I think they are SNPS DesignWare PHY's, additionally wrapped with Qualcomm logic. I could substitute "dwc3" with just "dw", which will be more correct.

Quoted 5 lines

alright, thank you. Let's add Paul to the loop since he might have very good insight in the synopsys PHYs.

mental note: if any other platform shows up with Synopsys PHY, ask them to use this driver instead :-)

I really doubt that this will bi possible. Control of the PHY's is not directly trough ULPI, UTMI or PIPE3 interfaces, but trough QSCRATCH registers, which of course is highly Qualcomm specific.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

isn't it a memory mapped IP ? doesn't synopsys provide their own set of registers ?

From what I see it is not directly mapped. How QSCRATCH write and reads transactions are translated to DW IP is unclear to me.

I think the question is how does SW access them?

"USB QSCRATCH Hardware registers" don't ask me what is this :-) or like Pawel says: "it depends on the SOC" .

Ivan

Quoted 3 lines

- k

#21 lore raw

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

Quoted 33 lines

From: Ivan T. Ivanov [mailto:[email protected]]
Sent: Tuesday, August 20, 2013 8:26 AM

Quoted 29 lines · Kumar Gala
Quoted 27 lines · Ivan T. Ivanov

Hi,

Quoted 22 lines · Felipe Balbi
Quoted 12 lines · Ivan T. Ivanov
Quoted 10 lines · Felipe Balbi
Quoted 4 lines · Ivan T. Ivanov

I think they are SNPS DesignWare PHY's, additionally wrapped with Qualcomm logic. I could substitute "dwc3" with just "dw", which will be more correct.

alright, thank you. Let's add Paul to the loop since he might have very good insight in the synopsys PHYs.

Quoted 6 lines
Quoted 2 lines

mental note: if any other platform shows up with Synopsys PHY, ask them to use this driver instead :-)

I really doubt that this will bi possible. Control of the PHY's is not directly trough ULPI, UTMI or PIPE3 interfaces, but trough QSCRATCH registers, which of course is highly Qualcomm specific.

isn't it a memory mapped IP ? doesn't synopsys provide their own set of registers ?

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

From what I see it is not directly mapped. How QSCRATCH write and reads transactions are translated to DW IP is unclear to me.

I think the question is how does SW access them?

"USB QSCRATCH Hardware registers" don't ask me what is this :-) or like Pawel says: "it depends on the SOC" .

To answer the question "doesn't synopsys provide their own set of registers", we provide registers in our USB cores to access the PHYs through I2C, ULPI/UTMI, or PIPE3 interfaces. But if someone wants to use our PHY with some other controller that doesn't provide that, then they may need to implement their own register set, as Qualcomm has apparently done.

Signature · 1 line
Paul
#22 lore raw

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

Hi,

Quoted 42 lines · Paul Zimmerman
Quoted 33 lines

From: Ivan T. Ivanov [mailto:[email protected]]
Sent: Tuesday, August 20, 2013 8:26 AM

Quoted 29 lines · Kumar Gala
Quoted 27 lines · Ivan T. Ivanov

Hi,

Quoted 22 lines · Felipe Balbi
Quoted 12 lines · Ivan T. Ivanov
Quoted 10 lines · Felipe Balbi
Quoted 4 lines · Ivan T. Ivanov

I think they are SNPS DesignWare PHY's, additionally wrapped with Qualcomm logic. I could substitute "dwc3" with just "dw", which will be more correct.

alright, thank you. Let's add Paul to the loop since he might have very good insight in the synopsys PHYs.

Quoted 6 lines
Quoted 2 lines

mental note: if any other platform shows up with Synopsys PHY, ask them to use this driver instead :-)

I really doubt that this will bi possible. Control of the PHY's is not directly trough ULPI, UTMI or PIPE3 interfaces, but trough QSCRATCH registers, which of course is highly Qualcomm specific.

isn't it a memory mapped IP ? doesn't synopsys provide their own set of registers ?

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

From what I see it is not directly mapped. How QSCRATCH write and reads transactions are translated to DW IP is unclear to me.

I think the question is how does SW access them?

"USB QSCRATCH Hardware registers" don't ask me what is this :-) or like Pawel says: "it depends on the SOC" .

Quoted 6 lines

To answer the question "doesn't synopsys provide their own set of registers", we provide registers in our USB cores to access the PHYs through I2C, ULPI/UTMI, or PIPE3 interfaces. But if someone wants to use our PHY with some other controller that doesn't provide that, then they may need to implement their own register set, as Qualcomm has apparently done.

thanks for clarifying. that pretty much hinders writing any sort of generic drivers for Synopsys' PHYs though :-s

But I guess that's alright.

Signature · 1 line
balbi
#23 lore raw

PATCH v4 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 |  167 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 176 insertions(+)
 create mode 100644 drivers/usb/dwc3/dwc3-msm.c
drivers/usb/dwc3/Kconfig +8 -0
index f969ea2..d845966 100644
@@ -71,6 +71,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 +167 -0

167 lines not on this page · raw message

Signature · 1 line
1.7.9.5