Skip to contentSkip to conversation

DWC3 USB support for Qualcomm platform

PATCH Superseded Ivan T. Ivanov 4 participants 12 messages Aug 14, 2013 – Aug 19, 2013

Subsystems (4)

v3 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

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

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          |  108 ++++++
 drivers/usb/dwc3/Kconfig                           |    8 +
 drivers/usb/dwc3/Makefile                          |    1 +
 drivers/usb/dwc3/dwc3-msm.c                        |  169 +++++++++
 drivers/usb/phy/Kconfig                            |   11 +
 drivers/usb/phy/Makefile                           |    2 +
 drivers/usb/phy/phy-msm-dwc3-hs.c                  |  336 +++++++++++++++++
 drivers/usb/phy/phy-msm-dwc3-ss.c                  |  383 ++++++++++++++++++++
 8 files changed, 1018 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 · 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
#1 lore raw

PATCH v3 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          |  108 ++++++++++++++++++++
 1 file changed, 108 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/usb/msm-ssusb.txt
Documentation/devicetree/bindings/usb/msm-ssusb.txt new file +108 -0
new file mode 100644
index 0000000..43c73d8
@@ -0,0 +1,108 @@
+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_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
+=======================
+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 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_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>;
+			usb-phy = <&dwc3_hsphy>, <&dwc3_ssphy>;
+			tx-fifo-resize;
+		};
+	};
Signature · 1 line
1.7.9.5
#2 lore raw

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

Quoted 11 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).

Documentation/devicetree/bindings/usb/msm-ssusb.txt +1 -0
 
+- clock-names :

...

Quoted 1 line
Documentation/devicetree/bindings/usb/msm-ssusb.txt +1 -0
+	"sleep_a_clk" : Sleep clock, used when USB3 core goes into low

...

Quoted 1 line
Documentation/devicetree/bindings/usb/msm-ssusb.txt +1 -0
+	"ref_clk" : Reference clock - used in host mode.

...

Quoted 1 line
Documentation/devicetree/bindings/usb/msm-ssusb.txt +1 -0
+	"core_clk" : Master/Core clock, have to be >= 125 MHz for SS

...

Quoted 2 lines
Documentation/devicetree/bindings/usb/msm-ssusb.txt +2 -0
+	"iface_clk" : System bus AXI clock
+	"sleep_clk" : Sleep clock, used when USB3 core goes into low

...

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

Quoted 1 line
Documentation/devicetree/bindings/usb/msm-ssusb.txt +1 -0
+	"utmi_clk" : Generated by HS-PHY. Used to clock the low power

I think it makes sense to remove "_clk" from all those names, unless the HW documentation really talks about a clock named e.g. iface_clk yet some other clock names in the documentation don't have the "_clk" suffix, e.g. the "xo I didn't quote.

Quoted 2 lines

+Sub nodes:
+==========

That section title is the same style as all the other section title, so it's no obvious that this is a sub-node for the controller wrapper. Instead, I would suggest something more like:

Required child nodes:

Quoted 1 line

+- Sub node for "DWC3 USB3 controller".

Then you can drop that since it's obvious.

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

Quoted 2 lines
Documentation/devicetree/bindings/usb/msm-ssusb.txt +2 -0
+  This sub node is required property for device node. The properties
+  of this subnode are specified in dwc3.txt.

That doesn't really say much. How about.

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

#3 lore raw

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

Hi,

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

Documentation/devicetree/bindings/usb/msm-ssusb.txt +1 -0
 
+- clock-names :

...

Quoted 1 line
Documentation/devicetree/bindings/usb/msm-ssusb.txt +1 -0
+	"sleep_a_clk" : Sleep clock, used when USB3 core goes into low

...

Quoted 1 line
Documentation/devicetree/bindings/usb/msm-ssusb.txt +1 -0
+	"ref_clk" : Reference clock - used in host mode.

...

Quoted 1 line
Documentation/devicetree/bindings/usb/msm-ssusb.txt +1 -0
+	"core_clk" : Master/Core clock, have to be >= 125 MHz for SS

...

Quoted 2 lines
Documentation/devicetree/bindings/usb/msm-ssusb.txt +2 -0
+	"iface_clk" : System bus AXI clock
+	"sleep_clk" : Sleep clock, used when USB3 core goes into low

...

Quoted 8 lines

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

Quoted 1 line
Documentation/devicetree/bindings/usb/msm-ssusb.txt +1 -0
+	"utmi_clk" : Generated by HS-PHY. Used to clock the low power

I think it makes sense to remove "_clk" from all those names, unless the HW documentation really talks about a clock named e.g. iface_clk yet some other clock names in the documentation don't have the "_clk" suffix, e.g. the "xo I didn't quote.

From limited information that I have, I could not say how clock inputs

are named from the controller perspective, but I agree that "_clk" suffix looks redundant.

Side question: if for example label in controller says "UTMI", should I also use capital letters for the resource or this could be "utmi"?

Quoted 17 lines
Quoted 3 lines

+Sub nodes:
+==========

That section title is the same style as all the other section title, so it's no obvious that this is a sub-node for the controller wrapper. Instead, I would suggest something more like:

Required child nodes:

Quoted 1 line

+- Sub node for "DWC3 USB3 controller".

Then you can drop that since it's obvious.

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

Quoted 2 lines
Documentation/devicetree/bindings/usb/msm-ssusb.txt +2 -0
+  This sub node is required property for device node. The properties
+  of this subnode are specified in dwc3.txt.
Quoted 6 lines

That doesn't really say much. How about.

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

Thanks, I will use your suggestion.

Regards,
Ivan

#4 lore raw

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

Quoted 33 lines · Ivan T. Ivanov

Hi,

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

Documentation/devicetree/bindings/usb/msm-ssusb.txt +1 -0
 
+- clock-names :

...

Quoted 1 line
Documentation/devicetree/bindings/usb/msm-ssusb.txt +1 -0
+	"sleep_a_clk" : Sleep clock, used when USB3 core goes into low

...

Quoted 1 line
Documentation/devicetree/bindings/usb/msm-ssusb.txt +1 -0
+	"ref_clk" : Reference clock - used in host mode.

...

Quoted 1 line
Documentation/devicetree/bindings/usb/msm-ssusb.txt +1 -0
+	"core_clk" : Master/Core clock, have to be >= 125 MHz for SS

...

Quoted 2 lines
Documentation/devicetree/bindings/usb/msm-ssusb.txt +2 -0
+	"iface_clk" : System bus AXI clock
+	"sleep_clk" : Sleep clock, used when USB3 core goes into low

...

Quoted 6 lines

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

Quoted 1 line
Documentation/devicetree/bindings/usb/msm-ssusb.txt +1 -0
+	"utmi_clk" : Generated by HS-PHY. Used to clock the low power

I think it makes sense to remove "_clk" from all those names, unless the HW documentation really talks about a clock named e.g. iface_clk yet some other clock names in the documentation don't have the "_clk" suffix, e.g. the "xo I didn't quote.

Quoted 6 lines

From limited information that I have, I could not say how clock inputs are named from the controller perspective, but I agree that "_clk" suffix looks redundant.

Side question: if for example label in controller says "UTMI", should I also use capital letters for the resource or this could be "utmi"?

All the clock-names entries I've seen so far have been lower-case, but I suppose there's no hard-and-fast rule that they couldn't be upper-/mixed-case if that best matched the HW documentation.

#5 lore raw

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

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

Hi,

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

Documentation/devicetree/bindings/usb/msm-ssusb.txt +1 -0
+- clock-names :

...

Quoted 1 line
Documentation/devicetree/bindings/usb/msm-ssusb.txt +1 -0
+	"sleep_a_clk" : Sleep clock, used when USB3 core goes into low

...

Quoted 1 line
Documentation/devicetree/bindings/usb/msm-ssusb.txt +1 -0
+	"ref_clk" : Reference clock - used in host mode.

...

Quoted 1 line
Documentation/devicetree/bindings/usb/msm-ssusb.txt +1 -0
+	"core_clk" : Master/Core clock, have to be >= 125 MHz for SS

...

Quoted 2 lines
Documentation/devicetree/bindings/usb/msm-ssusb.txt +2 -0
+	"iface_clk" : System bus AXI clock
+	"sleep_clk" : Sleep clock, used when USB3 core goes into low

...

Quoted 8 lines
Quoted 5 lines

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

Quoted 1 line
Documentation/devicetree/bindings/usb/msm-ssusb.txt +1 -0
+	"utmi_clk" : Generated by HS-PHY. Used to clock the low power

I think it makes sense to remove "_clk" from all those names, unless the HW documentation really talks about a clock named e.g. iface_clk yet some other clock names in the documentation don't have the "_clk" suffix, e.g. the "xo I didn't quote.

From limited information that I have, I could not say how clock inputs are named from the controller perspective, but I agree that "_clk" suffix looks redundant.

In downstream trees we've tried to standardize the names on core_clk, iface_clk, bus_clk, etc. Historically the hardware designers have used the names from the clock controller instead of coming up with standard names of their own when they put the clock inputs in their data sheets (if they do at all).

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

PATCH v3 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 |  336 ++++++++++++++++++++++++++++++++
 drivers/usb/phy/phy-msm-dwc3-ss.c |  383 +++++++++++++++++++++++++++++++++++++
 4 files changed, 732 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 +336 -0

336 lines not on this page · raw message

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

383 lines not on this page · raw message

Signature · 1 line
1.7.9.5
#7 lore raw

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

Quoted 9 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 5 lines
drivers/usb/phy/phy-msm-dwc3-hs.c new file +0 -0
new file mode 100644
index 0000000..465a8f5

[..]

Quoted 11 lines
drivers/usb/phy/phy-msm-dwc3-hs.c new file +11 -0
+
+struct msm_dwc3_hs_phy {
+	struct usb_phy		phy;
+	void __iomem		*base;
+	struct device		*dev;
+
+	struct clk		*xo_clk;
+	struct clk		*sleep_a_clk;
+
+	struct regulator	*v3p3;
+	struct regulator	*v1p8;

drivers/usb/phy/phy-msm-dwc3-hs.c line 73

Quoted 10 lines
drivers/usb/phy/phy-msm-dwc3-hs.c new file +10 -0
+	struct regulator	*vddcx;
+	struct regulator	*vbus;
+};
+
+#define	phy_to_dwc3_phy(x)	container_of((x), struct msm_dwc3_hs_phy, phy)
+
+
+/**
+ *
+ * Write register with debug info.

what debug info?

Quoted 7 lines

+ *
+ * @base - DWC3 base virtual address.
+ * @offset - register offset.
+ * @val - value to write.
+ *
+ */
+static inline void msm_dwc3_hs_write(void *base, u32 offset, u32 val)

You've dropped __iomem here; have you run through sparse?

Quoted 6 lines
drivers/usb/phy/phy-msm-dwc3-hs.c new file +6 -0
+{
+	iowrite32(val, base + offset);
+}
+
+/**
+ * Write register and read back masked value to confirm it is written

drivers/usb/phy/phy-msm-dwc3-hs.c line 96

Quoted 10 lines
drivers/usb/phy/phy-msm-dwc3-hs.c new file +10 -0
+ *
+ * @base - DWC3 base virtual address.
+ * @offset - register offset.
+ * @mask - register bitmask specifying what should be updated
+ * @val - value to write.
+ *
+ */
+static inline void msm_dwc3_hs_write_readback(void *base, u32 offset,
+					    const u32 mask, u32 val)
+{

Same comment here.

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

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

Hi,

Quoted 32 lines · Josh Cartwright
Quoted 9 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 5 lines
drivers/usb/phy/phy-msm-dwc3-hs.c new file +0 -0
new file mode 100644
index 0000000..465a8f5

[..]

Quoted 15 lines
drivers/usb/phy/phy-msm-dwc3-hs.c new file +15 -0
+
+struct msm_dwc3_hs_phy {
+	struct usb_phy		phy;
+	void __iomem		*base;
+	struct device		*dev;
+
+	struct clk		*xo_clk;
+	struct clk		*sleep_a_clk;
+
+	struct regulator	*v3p3;
+	struct regulator	*v1p8;
+	struct regulator	*vddcx;
+	struct regulator	*vbus;
+};
+
Quoted 8 lines

drivers/usb/phy/phy-msm-dwc3-hs.c line 73

Quoted 6 lines
drivers/usb/phy/phy-msm-dwc3-hs.c new file +6 -0
+#define	phy_to_dwc3_phy(x)	container_of((x), struct msm_dwc3_hs_phy, phy)
+
+
+/**
+ *
+ * Write register with debug info.

what debug info?

Will fix this. It was left from the earliest versions of the functions.

Quoted 10 lines
Quoted 8 lines

+ *
+ * @base - DWC3 base virtual address.
+ * @offset - register offset.
+ * @val - value to write.
+ *
+ */
+static inline void msm_dwc3_hs_write(void *base, u32 offset, u32 val)

You've dropped __iomem here; have you run through sparse?

Obviously not :-). Thanks for noticing this.

Quoted 11 lines
Quoted 11 lines
drivers/usb/phy/phy-msm-dwc3-hs.c new file +10 -0
+{
+	iowrite32(val, base + offset);
+}
+
+/**
+ * Write register and read back masked value to confirm it is written
+ *
+ * @base - DWC3 base virtual address.
+ * @offset - register offset.
+ * @mask - register bitmask specifying what should be updated
Quoted 8 lines

drivers/usb/phy/phy-msm-dwc3-hs.c line 96

Quoted 6 lines

+ * @val - value to write.
+ *
+ */

drivers/usb/phy/phy-msm-dwc3-hs.c new file +3 -0
+static inline void msm_dwc3_hs_write_readback(void *base, u32 offset,
+					    const u32 mask, u32 val)
+{

Same comment here.

Will be fixed in next version.

Thanks,
Ivan

#9 lore raw

PATCH v3 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 |  169 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 178 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 +169 -0

169 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
#10 lore raw

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

drivers/usb/dwc3/dwc3-msm.c line 149

Quoted 3 lines · Ivan T. Ivanov
drivers/usb/dwc3/dwc3-msm.c new file +3 -0
+}
+
+static const struct of_device_id of_dwc3_matach[] = {

match? Maybe you can make it all one line too { .compatible = "qcom,dwc3" }

Quoted 8 lines
drivers/usb/dwc3/dwc3-msm.c new file +7 -0
+	{
+		.compatible = "qcom,dwc3",
+	},
+	{ },
+};
+MODULE_DEVICE_TABLE(of, of_dwc3_matach);
+
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation
#11 lore raw

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

Quoted 7 lines · Stephen Boyd

drivers/usb/dwc3/dwc3-msm.c line 149

Quoted 3 lines · Ivan T. Ivanov
drivers/usb/dwc3/dwc3-msm.c new file +3 -0
+}
+
+static const struct of_device_id of_dwc3_matach[] = {

match? Maybe you can make it all one line too { .compatible = "qcom,dwc3" }

Thanks. Will do.

Ivan

Quoted 8 lines
Quoted 8 lines
drivers/usb/dwc3/dwc3-msm.c new file +7 -0
+	{
+		.compatible = "qcom,dwc3",
+	},
+	{ },
+};
+MODULE_DEVICE_TABLE(of, of_dwc3_matach);
+