Skip to contentSkip to conversation

DWC3 USB support for Qualcomm platform

PATCH Superseded Ivan T. Ivanov 3 participants 11 messages Aug 21, 2013 – Oct 7, 2013

Subsystems (4)

v5 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

v5 cover DWC3 USB support for Qualcomm platform

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

Hi,

Here is fifth version of MSM USB3 drivers patches.

Changes since v4:
* Substitute references to "wc3" with just "dw" in USB PHY drivers and file names. This is to indicate that the PHY's are DesignWare, but not necessarily related to DWC3 IP core.

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 DW PHY's
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-dw-hs.c                    |  327 +++++++++++++++++
 drivers/usb/phy/phy-msm-dw-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-dw-hs.c
 create mode 100644 drivers/usb/phy/phy-msm-dw-ss.c
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH v5 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..f57ba8d
@@ -0,0 +1,104 @@
+MSM SuperSpeed DWC3 USB SoC controller
+
+
+MSM DW Highspeed USB PHY
+========================
+Required properities :
+- compatible : sould be "qcom,dw-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
+
+MSM DW Superspeed USB PHY
+=========================
+Required properities :
+- compatible : sould be "qcom,dw-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
+
+MSM 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:
+
+	dw_hsphy: phy@f92f8800 {
+		compatible = "qcom,dw-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>;
+	};
+
+	dw_ssphy: phy@f92f8830 {
+		compatible = "qcom,dw-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 = <&dw_hsphy>, <&dw_ssphy>;
+			tx-fifo-resize;
+		};
+	};
Signature · 1 line
1.7.9.5
#2 lore raw

Re: [PATCH v5 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).

and here's a new version from same patch

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..f57ba8d
@@ -0,0 +1,104 @@
+MSM SuperSpeed DWC3 USB SoC controller
+
+
+MSM DW Highspeed USB PHY
+========================
+Required properities :
+- compatible : sould be "qcom,dw-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
+
+MSM DW Superspeed USB PHY
+=========================
+Required properities :
+- compatible : sould be "qcom,dw-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
+
+MSM 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:
+
+	dw_hsphy: phy@f92f8800 {
+		compatible = "qcom,dw-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>;
+	};
+
+	dw_ssphy: phy@f92f8830 {
+		compatible = "qcom,dw-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 = <&dw_hsphy>, <&dw_ssphy>;
+			tx-fifo-resize;
+		};
+	};
Signature · 1 line
1.7.9.5
Signature · 1 line
balbi
#3 lore raw

Re: [PATCH v5 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).

and here's a new version from same patch

The binding looks pretty simple, so I don't think it's too contentious.

Quoted 8 lines
Quoted 8 lines
Documentation/devicetree/bindings/usb/msm-ssusb.txt +2 -0
 
+MSM DWC3 controller wrapper
 
+Optional properties : +- gdsc-supply : phandle to the globally

distributed switch controller + regulator node to the USB controller.

If that's a regulator node, why not use xxx-supply properties to interface with it?

Aside from that, the binding,

--
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

#4 lore raw

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

Hi,

Quoted 21 lines · Stephen Warren
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).

and here's a new version from same patch

The binding looks pretty simple, so I don't think it's too contentious.

Quoted 2 lines
Quoted 2 lines
Documentation/devicetree/bindings/usb/msm-ssusb.txt +0 -0
Quoted 8 lines
Quoted 5 lines
Quoted 5 lines
Documentation/devicetree/bindings/usb/msm-ssusb.txt +2 -0
+MSM DWC3 controller wrapper
 
+Optional properties : +- gdsc-supply : phandle to the globally

distributed switch controller + regulator node to the USB controller.

If that's a regulator node, why not use xxx-supply properties to interface with it?

That was the intention. What about:

Optional "supply-name" :
"gdsc" - supply from globally distributed switch controller

Quoted 3 lines

Aside from that, the binding,

Thank you.

Regards,
Ivan

#5 lore raw

Re: [PATCH v5 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).

and here's a new version from same patch

The only difference is that references to "dwc3" are replaced with just "dw" in USB PHY drivers and file names. This is to indicate that the PHY's are DesignWare, but not necessarily related to DWC3 IP core. If you prefer I could keep old abbreviation.

Thanks,
Ivan

#6 lore raw

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

In reply to Ivan T. Ivanov
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).

these patches were sent *ages* and nobody from DT mailing list has reviewed. Unless someone steps up now, I'll be queueing these patches next week.

Signature · 1 line
balbi
#7 lore raw

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

Hi Felipe,

Quoted 6 lines · Felipe Balbi
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 9 lines
Quoted 4 lines

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

these patches were sent *ages* and nobody from DT mailing list has reviewed. Unless someone steps up now, I'll be queueing these patches next week.

Please take v6 of the patch set, which I have just posted. They contain several fixes and I have also added ACK from Stephen Warren for DT part.

Thanks,
Ivan

#8 lore raw

PATCH v5 2/3 usb: phy: Add Qualcomm SS-USB and HS-USB drivers for DW PHY's

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-dw-hs.c |  327 ++++++++++++++++++++++++++++++++++
 drivers/usb/phy/phy-msm-dw-ss.c |  374 +++++++++++++++++++++++++++++++++++++++
 4 files changed, 714 insertions(+)
 create mode 100644 drivers/usb/phy/phy-msm-dw-hs.c
 create mode 100644 drivers/usb/phy/phy-msm-dw-ss.c
drivers/usb/phy/Kconfig +11 -0
index d5589f9..bbb2d0e 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_DW_PHYS
+	tristate "Qualcomm USB controller DW PHY's wrappers support"
+	depends on (USB || USB_GADGET) && ARCH_MSM
+	select USB_PHY
+	help
+	  Enable this to support the DW 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..4813eb5 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_DW_PHYS)		+= phy-msm-dw-hs.o
+obj-$(CONFIG_USB_MSM_DW_PHYS)		+= phy-msm-dw-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-dw-hs.c new file +327 -0

327 lines not on this page · raw message

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

374 lines not on this page · raw message

Signature · 6 lines
1.7.9.5

--
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
#9 lore raw

Re: [PATCH v5 2/3] usb: phy: Add Qualcomm SS-USB and HS-USB drivers for DW PHY's

Hi,

Quoted 8 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.

I can take this one if DT folks agree with bindings proposed on previous patch.

Signature · 1 line
balbi
#10 lore raw

PATCH v5 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