Skip to contentSkip to conversation

phy: qualcomm: add qcom ipq806x dwc usb phy driver

PATCH Applied Ansuel Smith 2 participants 5 messages Jul 17, 2020 – Jul 20, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v10 1/2 phy: qualcomm: add qcom ipq806x dwc usb phy driver

This has lost in the original push for the dwc3 qcom driver. This is needed for ipq806x SoC as without this the usb ports doesn't work at all.

---
v10:
* Use of_device_get_match_data and remove useless match v9:
* Use device_property_read_u32 and skip compatible check v8:
* Drop useless init
* Drop invalid copyright
v7:
* Add TestedBy tag
v6:
* Use GENMASK instead of hex value
v4:
* Add qcom to specific bindings
v3:
* Use reg instead of regmap phandle
v2:
* Renamed config from PHY_QCOM_DWC3 to PHY_QCOM_IPQ806X_USB
* Rename inline function to generic name to reduce length
* Fix check reported by checkpatch --strict
* Rename compatible to qcom,ipq806x-usb-phy-(hs/ss)

 drivers/phy/qualcomm/Kconfig                |  11 +
 drivers/phy/qualcomm/Makefile               |   1 +
 drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c | 571 ++++++++++++++++++++
 3 files changed, 583 insertions(+)
 create mode 100644 drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c
drivers/phy/qualcomm/Kconfig +11 -0
index e46824da29f6..c14dabd7f992 100644
@@ -91,3 +91,14 @@ config PHY_QCOM_USB_HSIC
 	select GENERIC_PHY
 	help
 	  Support for the USB HSIC ULPI compliant PHY on QCOM chipsets.
+
+config PHY_QCOM_IPQ806X_USB
+	tristate "Qualcomm IPQ806x DWC3 USB PHY driver"
+	depends on HAS_IOMEM
+	depends on OF && (ARCH_QCOM || COMPILE_TEST)
+	select GENERIC_PHY
+	help
+	  This option enables support for the Synopsis PHYs present inside the
+	  Qualcomm USB3.0 DWC3 controller on ipq806x SoC. This driver supports
+	  both HS and SS PHY controllers.
+
drivers/phy/qualcomm/Makefile +1 -0
index 283251d6a5d9..8629299c1495 100644
@@ -10,3 +10,4 @@ obj-$(CONFIG_PHY_QCOM_UFS_14NM)		+= phy-qcom-ufs-qmp-14nm.o
 obj-$(CONFIG_PHY_QCOM_UFS_20NM)		+= phy-qcom-ufs-qmp-20nm.o
 obj-$(CONFIG_PHY_QCOM_USB_HS) 		+= phy-qcom-usb-hs.o
 obj-$(CONFIG_PHY_QCOM_USB_HSIC) 	+= phy-qcom-usb-hsic.o
+obj-$(CONFIG_PHY_QCOM_IPQ806X_USB)		+= phy-qcom-ipq806x-usb.o
drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c new file +571 -0

571 lines not on this page · raw message

Signature · 1 line
2.27.0
#1 lore raw

PATCH v10 2/2 devicetree: bindings: phy: Document ipq806x dwc3 qcom phy

Document dwc3 qcom phy hs and ss phy bindings needed to correctly inizialize and use usb on ipq806x SoC.

---
v7:
* Drop useless AllOf
v6:
* Add maximum value
v5:
* Fix dt_binding_check error
v4:
* Add qcom to specific bindings
v3:
* Use explicit reg instead of regmap

 .../bindings/phy/qcom,ipq806x-usb-phy-hs.yaml | 55 ++++++++++++++
 .../bindings/phy/qcom,ipq806x-usb-phy-ss.yaml | 73 +++++++++++++++++++
 2 files changed, 128 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/phy/qcom,ipq806x-usb-phy-hs.yaml
 create mode 100644 Documentation/devicetree/bindings/phy/qcom,ipq806x-usb-phy-ss.yaml
Documentation/devicetree/bindings/phy/qcom,ipq806x-usb-phy-hs.yaml new file +55 -0
new file mode 100644
index 000000000000..23887ebe08fd
@@ -0,0 +1,55 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/phy/qcom,ipq806x-usb-phy-hs.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm ipq806x usb DWC3 HS PHY CONTROLLER
+
+maintainers:
+  - Ansuel Smith <[email protected]>
+
+description:
+  DWC3 PHY nodes are defined to describe on-chip Synopsis Physical layer
+  controllers used in ipq806x. Each DWC3 PHY controller should have its
+  own node.
+
+properties:
+  compatible:
+    const: qcom,ipq806x-usb-phy-hs
+
+  "#phy-cells":
+    const: 0
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    minItems: 1
+    maxItems: 2
+
+  clock-names:
+    minItems: 1
+    maxItems: 2
+    items:
+      - const: ref
+      - const: xo
+
+required:
+  - compatible
+  - "#phy-cells"
+  - reg
+  - clocks
+  - clock-names
+
+examples:
+  - |
+    #include <dt-bindings/clock/qcom,gcc-ipq806x.h>
+
+    hs_phy_0: phy@110f8800 {
+      compatible = "qcom,ipq806x-usb-phy-hs";
+      reg = <0x110f8800 0x30>;
+      clocks = <&gcc USB30_0_UTMI_CLK>;
+      clock-names = "ref";
+      #phy-cells = <0>;
+    };
Documentation/devicetree/bindings/phy/qcom,ipq806x-usb-phy-ss.yaml new file +73 -0

73 lines not on this page · raw message

Signature · 1 line
2.27.0
maintainer Applied
#2 lore raw
In reply to Ansuel Smith
Quoted 3 lines · Ansuel Smith

This has lost in the original push for the dwc3 qcom driver. This is needed for ipq806x SoC as without this the usb ports doesn't work at all.

Applied both, thanks

My script found below errors with W=1, can you please send fixes for these

drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c:140: warning: Function parameter or member 'phy_dwc3' not described in 'usb_phy_write_readback' drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c:140: warning: Function parameter or member 'offset' not described in 'usb_phy_write_readback' drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c:140: warning: Function parameter or member 'mask' not described in 'usb_phy_write_readback' drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c:140: warning: Function parameter or member 'val' not described in 'usb_phy_write_readback' drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c:182: warning: Function parameter or member 'phy_dwc3' not described in 'usb_ss_write_phycreg' drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c:182: warning: Function parameter or member 'addr' not described in 'usb_ss_write_phycreg' drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c:182: warning: Function parameter or member 'val' not described in 'usb_ss_write_phycreg' drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c:219: warning: Function parameter or member 'phy_dwc3' not described in 'usb_ss_read_phycreg' drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c:219: warning: Function parameter or member 'addr' not described in 'usb_ss_read_phycreg' drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c:219: warning: Function parameter or member 'val' not described in 'usb_ss_read_phycreg'

Signature · 1 line
~Vinod
#3 lore raw

R: [PATCH v10 1/2] phy: qualcomm: add qcom ipq806x dwc usb phy driver

Quoted 16 lines

-----Messaggio originale-----
Da: Vinod Koul <[email protected]>
Inviato: lunedì 20 luglio 2020 08:26
A: Ansuel Smith <[email protected]>
Cc: Andy Gross <[email protected]>; Jonathan McDowell <[email protected]>; Andy Gross <[email protected]>; Bjorn Andersson <[email protected]>; Kishon Vijay Abraham I <[email protected]>; Rob Herring <[email protected]>; Mark Rutland <[email protected]>; [email protected]; linux- [email protected]; [email protected]
Oggetto: Re: [PATCH v10 1/2] phy: qualcomm: add qcom ipq806x dwc usb phy driver

On 17-07-20, 15:16, Ansuel Smith wrote:

Quoted 9 lines
Quoted 3 lines

This has lost in the original push for the dwc3 qcom driver. This is needed for ipq806x SoC as without this the usb ports doesn't work at all.

Applied both, thanks

My script found below errors with W=1, can you please send fixes for these

Since you applied them should I send a new patch or a v11 of this patchset?

Quoted 24 lines

drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c:140: warning: Function parameter or member 'phy_dwc3' not described in 'usb_phy_write_readback' drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c:140: warning: Function parameter or member 'offset' not described in 'usb_phy_write_readback' drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c:140: warning: Function parameter or member 'mask' not described in 'usb_phy_write_readback' drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c:140: warning: Function parameter or member 'val' not described in 'usb_phy_write_readback' drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c:182: warning: Function parameter or member 'phy_dwc3' not described in 'usb_ss_write_phycreg' drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c:182: warning: Function parameter or member 'addr' not described in 'usb_ss_write_phycreg' drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c:182: warning: Function parameter or member 'val' not described in 'usb_ss_write_phycreg' drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c:219: warning: Function parameter or member 'phy_dwc3' not described in 'usb_ss_read_phycreg' drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c:219: warning: Function parameter or member 'addr' not described in 'usb_ss_read_phycreg' drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c:219: warning: Function parameter or member 'val' not described in 'usb_ss_read_phycreg'

--
~Vinod

maintainer
#4 lore raw

Re: R: [PATCH v10 1/2] phy: qualcomm: add qcom ipq806x dwc usb phy driver

Quoted 20 lines · On 20-07-20, 14:25, [email protected] wrote:
Quoted 20 lines

-----Messaggio originale-----
Da: Vinod Koul <[email protected]>
Inviato: lunedì 20 luglio 2020 08:26
A: Ansuel Smith <[email protected]>
Cc: Andy Gross <[email protected]>; Jonathan McDowell <[email protected]>; Andy Gross <[email protected]>; Bjorn Andersson <[email protected]>; Kishon Vijay Abraham I <[email protected]>; Rob Herring <[email protected]>; Mark Rutland <[email protected]>; [email protected]; linux- [email protected]; [email protected]
Oggetto: Re: [PATCH v10 1/2] phy: qualcomm: add qcom ipq806x dwc usb phy driver

Quoted 3 lines · Ansuel Smith

This has lost in the original push for the dwc3 qcom driver. This is needed for ipq806x SoC as without this the usb ports doesn't work at all.

Quoted 8 lines
Quoted 5 lines

Applied both, thanks

My script found below errors with W=1, can you please send fixes for these

Since you applied them should I send a new patch or a v11 of this patchset?

new patches... Updates on top of phy-next please

Signature · 1 line
~Vinod