phy: qualcomm: add qcom dwc3 phy
PATCH 1/2 phy: qualcomm: add qcom dwc3 phy
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.
--- drivers/phy/qualcomm/Kconfig | 12 + drivers/phy/qualcomm/Makefile | 1 + drivers/phy/qualcomm/phy-qcom-dwc3.c | 578 +++++++++++++++++++++++++++ 3 files changed, 591 insertions(+) create mode 100644 drivers/phy/qualcomm/phy-qcom-dwc3.c
drivers/phy/qualcomm/Kconfig +12 -0
@@ -91,3 +91,15 @@ config PHY_QCOM_USB_HSIC select GENERIC_PHY help Support for the USB HSIC ULPI compliant PHY on QCOM chipsets. + +config PHY_QCOM_DWC3 + tristate "QCOM DWC3 USB PHY support" + depends on ARCH_QCOM + depends on HAS_IOMEM + depends on OF + select GENERIC_PHY + help + This option enables support for the Synopsis PHYs present inside the + Qualcomm USB3.0 DWC3 controller. This driver supports both HS and SS + PHY controllers. +
drivers/phy/qualcomm/Makefile +1 -0
@@ -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_DWC3) += phy-qcom-dwc3.o
drivers/phy/qualcomm/phy-qcom-dwc3.c new file +578 -0
578 lines not on this page · raw message
Signature · 1 line
2.25.1
PATCH 2/2 devicetree: bindings: phy: Document dwc3 qcom phy
Document dwc3 qcom phy hs and ss phy bindings needed to correctly inizialize and use usb on ipq806x SoC
--- .../bindings/phy/qcom,dwc3-hs-usb-phy.yaml | 65 +++++++++++++++++++ .../bindings/phy/qcom,dwc3-ss-usb-phy.yaml | 65 +++++++++++++++++++ 2 files changed, 130 insertions(+) create mode 100644 Documentation/devicetree/bindings/phy/qcom,dwc3-hs-usb-phy.yaml create mode 100644 Documentation/devicetree/bindings/phy/qcom,dwc3-ss-usb-phy.yaml
Documentation/devicetree/bindings/phy/qcom,dwc3-hs-usb-phy.yaml new file +65 -0
@@ -0,0 +1,65 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/phy/qcom,dwc3-hs-usb-phy.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm DWC3 HS PHY CONTROLLER + +maintainers: + - Ansuel Smith <[email protected]> + +description: + DWC3 PHY nodes are defined to describe on-chip Synopsis Physical layer + controllers. Each DWC3 PHY controller should have its own node. + +properties: + compatible: + const: qcom,dwc3-hs-usb-phy + + "#phy-cells": + const: 0 + + regmap: + maxItems: 1 + description: phandle to usb3 dts definition + + clocks: + minItems: 1 + maxItems: 2 + + clock-names: + minItems: 1 + maxItems: 2 + description: | + - "ref" Is required + - "xo" Optional external reference clock + items: + - const: ref + - const: xo + +required: + - compatible + - "#phy-cells" + - regmap + - clocks + - clock-names + +examples: + - | + #include <dt-bindings/clock/qcom,gcc-ipq806x.h> + + hs_phy_0: hs_phy_0 { + compatible = "qcom,dwc3-hs-usb-phy"; + regmap = <&usb3_0>; + clocks = <&gcc USB30_0_UTMI_CLK>; + clock-names = "ref"; + #phy-cells = <0>; + }; + + usb3_0: usb3@110f8800 { + compatible = "qcom,dwc3", "syscon"; + reg = <0x110f8800 0x8000>; + + /* ... */ + };
Documentation/devicetree/bindings/phy/qcom,dwc3-ss-usb-phy.yaml new file +65 -0
65 lines not on this page · raw message
Signature · 1 line
2.25.1
Rob Herring
maintainerRe: [PATCH 2/2] devicetree: bindings: phy: Document dwc3 qcom phy
Quoted 61 lines · Ansuel Smith
Document dwc3 qcom phy hs and ss phy bindings needed to correctly inizialize and use usb on ipq806x SoC
Signed-off-by Ansuel Smith <[email protected]>--- .../bindings/phy/qcom,dwc3-hs-usb-phy.yaml | 65 +++++++++++++++++++ .../bindings/phy/qcom,dwc3-ss-usb-phy.yaml | 65 +++++++++++++++++++ 2 files changed, 130 insertions(+) create mode 100644 Documentation/devicetree/bindings/phy/qcom,dwc3-hs-usb-phy.yaml create mode 100644 Documentation/devicetree/bindings/phy/qcom,dwc3-ss-usb-phy.yamlDocumentation/devicetree/bindings/phy/qcom,dwc3-hs-usb-phy.yaml new file +44
-0@@ -0,0 +1,65 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/phy/qcom,dwc3-hs-usb-phy.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm DWC3 HS PHY CONTROLLER + +maintainers: + - Ansuel Smith <[email protected]> + +description: + DWC3 PHY nodes are defined to describe on-chip Synopsis Physical layer + controllers. Each DWC3 PHY controller should have its own node. + +properties: + compatible: + const: qcom,dwc3-hs-usb-phy + + "#phy-cells": + const: 0 + + regmap: + maxItems: 1 + description: phandle to usb3 dts definition + + clocks: + minItems: 1 + maxItems: 2 + + clock-names: + minItems: 1 + maxItems: 2 + description: | + - "ref" Is required + - "xo" Optional external reference clock + items: + - const: ref + - const: xo + +required: + - compatible + - "#phy-cells" + - regmap
Documentation/devicetree/bindings/phy/qcom,dwc3-hs-usb-phy.yaml line 54
Quoted 10 lines
Documentation/devicetree/bindings/phy/qcom,dwc3-hs-usb-phy.yaml new file +10
-0+ - clocks + - clock-names + +examples: + - | + #include <dt-bindings/clock/qcom,gcc-ipq806x.h> + + hs_phy_0: hs_phy_0 { + compatible = "qcom,dwc3-hs-usb-phy"; + regmap = <&usb3_0>;
If the registers for the phy are part of 'qcom,dwc3' then make this node a child of it.
Documentation/devicetree/bindings/phy/qcom,dwc3-hs-usb-phy.yaml line 64
Quoted 10 lines
Documentation/devicetree/bindings/phy/qcom,dwc3-hs-usb-phy.yaml new file +10
-0+ clocks = <&gcc USB30_0_UTMI_CLK>; + clock-names = "ref"; + #phy-cells = <0>; + }; + + usb3_0: usb3@110f8800 { + compatible = "qcom,dwc3", "syscon"; + reg = <0x110f8800 0x8000>; + + /* ... */
Incomplete examples should or will fail validation.
Quoted 1 line
Documentation/devicetree/bindings/phy/qcom,dwc3-hs-usb-phy.yaml new file +1
-0+ };
R: [PATCH 2/2] devicetree: bindings: phy: Document dwc3 qcom phy
Quoted 75 lines · Ansuel Smith
Quoted 6 lines
Document dwc3 qcom phy hs and ss phy bindings needed to correctly inizialize and use usb on ipq806x SoC
Signed-off-by Ansuel Smith <[email protected]>--- .../bindings/phy/qcom,dwc3-hs-usb-phy.yaml | 65+++++++++++++++++++
Quoted 1 line
.../bindings/phy/qcom,dwc3-ss-usb-phy.yaml | 65+++++++++++++++++++
Quoted 2 lines
2 files changed, 130 insertions(+) create mode 100644
Documentation/devicetree/bindings/phy/qcom,dwc3-hs-usb-phy.yamlQuoted 1 line
create mode 100644
Documentation/devicetree/bindings/phy/qcom,dwc3-ss-usb-phy.yamlReview
Quoted 2 lines
(quoted diff) +0
-0
phy.yamlb/Documentation/devicetree/bindings/phy/qcom,dwc3-hs-usb-phy.yamlDocumentation/devicetree/bindings/phy/qcom,dwc3-hs-usb-
Quoted 4 lines
new file mode 100644
index 000000000000..0bb59e3c2ab8Documentation/devicetree/bindings/phy/qcom,dwc3-hs-usb- new file +0
-0
phy.yamlQuoted 4 lines
Documentation/devicetree/bindings/phy/qcom,dwc3-hs-usb- new file +3
-0@@ -0,0 +1,65 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +---Documentation/devicetree/bindings/phy/qcom,dwc3-hs-usb- line 13
Quoted 10 lines
Documentation/devicetree/bindings/phy/qcom,dwc3-hs-usb- new file +10
-0+$id: http://devicetree.org/schemas/phy/qcom,dwc3-hs-usb-phy.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm DWC3 HS PHY CONTROLLER + +maintainers: + - Ansuel Smith <[email protected]> + +description: + DWC3 PHY nodes are defined to describe on-chip Synopsis Physicallayer
Quoted 36 lines
Documentation/devicetree/bindings/phy/qcom,dwc3-hs-usb- new file +36
-0+ controllers. Each DWC3 PHY controller should have its own node. + +properties: + compatible: + const: qcom,dwc3-hs-usb-phy + + "#phy-cells": + const: 0 + + regmap: + maxItems: 1 + description: phandle to usb3 dts definition + + clocks: + minItems: 1 + maxItems: 2 + + clock-names: + minItems: 1 + maxItems: 2 + description: | + - "ref" Is required + - "xo" Optional external reference clock + items: + - const: ref + - const: xo + +required: + - compatible + - "#phy-cells" + - regmap + - clocks + - clock-names + +examples: + - |
Quoted 9 lines
Documentation/devicetree/bindings/phy/qcom,dwc3-hs-usb- line 54
Quoted 5 lines
Documentation/devicetree/bindings/phy/qcom,dwc3-hs-usb- new file +5
-0+ #include <dt-bindings/clock/qcom,gcc-ipq806x.h> + + hs_phy_0: hs_phy_0 { + compatible = "qcom,dwc3-hs-usb-phy"; + regmap = <&usb3_0>;If the registers for the phy are part of 'qcom,dwc3' then make this node a child of it.
Making this node a child of qcom,dwc3 cause malfunction of the driver.
Quoted 14 lines
Documentation/devicetree/bindings/phy/qcom,dwc3-hs-usb- line 64
Quoted 10 lines
Documentation/devicetree/bindings/phy/qcom,dwc3-hs-usb- new file +10
-0+ clocks = <&gcc USB30_0_UTMI_CLK>; + clock-names = "ref"; + #phy-cells = <0>; + }; + + usb3_0: usb3@110f8800 { + compatible = "qcom,dwc3", "syscon"; + reg = <0x110f8800 0x8000>; + + /* ... */Incomplete examples should or will fail validation.
Quoted 1 line
Documentation/devicetree/bindings/phy/qcom,dwc3-hs-usb- new file +1
-0+ };
Rob Herring
maintainerRe: [PATCH 2/2] devicetree: bindings: phy: Document dwc3 qcom phy
Quoted 86 lines · On Wed, Apr 15, 2020 at 7:26 AM <[email protected]> wrote:
Quoted 76 lines · Ansuel Smith
Quoted 6 lines
Document dwc3 qcom phy hs and ss phy bindings needed to correctly inizialize and use usb on ipq806x SoC
Signed-off-by Ansuel Smith <[email protected]>--- .../bindings/phy/qcom,dwc3-hs-usb-phy.yaml | 65+++++++++++++++++++
Quoted 1 line
.../bindings/phy/qcom,dwc3-ss-usb-phy.yaml | 65+++++++++++++++++++
Quoted 2 lines
2 files changed, 130 insertions(+) create mode 100644
Documentation/devicetree/bindings/phy/qcom,dwc3-hs-usb-phy.yamlQuoted 1 line
create mode 100644
Documentation/devicetree/bindings/phy/qcom,dwc3-ss-usb-phy.yamlReview
Quoted 2 lines
(quoted diff) +0
-0
phy.yamlb/Documentation/devicetree/bindings/phy/qcom,dwc3-hs-usb-phy.yamlDocumentation/devicetree/bindings/phy/qcom,dwc3-hs-usb-
Quoted 4 lines
new file mode 100644
index 000000000000..0bb59e3c2ab8Documentation/devicetree/bindings/phy/qcom,dwc3-hs-usb- new file +0
-0
phy.yamlQuoted 4 lines
Documentation/devicetree/bindings/phy/qcom,dwc3-hs-usb- new file +3
-0@@ -0,0 +1,65 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +---Documentation/devicetree/bindings/phy/qcom,dwc3-hs-usb- line 13
Quoted 10 lines
Documentation/devicetree/bindings/phy/qcom,dwc3-hs-usb- new file +10
-0+$id: http://devicetree.org/schemas/phy/qcom,dwc3-hs-usb-phy.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm DWC3 HS PHY CONTROLLER + +maintainers: + - Ansuel Smith <[email protected]> + +description: + DWC3 PHY nodes are defined to describe on-chip Synopsis Physicallayer
Quoted 36 lines
Documentation/devicetree/bindings/phy/qcom,dwc3-hs-usb- new file +36
-0+ controllers. Each DWC3 PHY controller should have its own node. + +properties: + compatible: + const: qcom,dwc3-hs-usb-phy + + "#phy-cells": + const: 0 + + regmap: + maxItems: 1 + description: phandle to usb3 dts definition + + clocks: + minItems: 1 + maxItems: 2 + + clock-names: + minItems: 1 + maxItems: 2 + description: | + - "ref" Is required + - "xo" Optional external reference clock + items: + - const: ref + - const: xo + +required: + - compatible + - "#phy-cells" + - regmap + - clocks + - clock-names + +examples: + - |Quoted 9 lines
Documentation/devicetree/bindings/phy/qcom,dwc3-hs-usb- line 54
Quoted 5 lines
Documentation/devicetree/bindings/phy/qcom,dwc3-hs-usb- new file +5
-0+ #include <dt-bindings/clock/qcom,gcc-ipq806x.h> + + hs_phy_0: hs_phy_0 { + compatible = "qcom,dwc3-hs-usb-phy"; + regmap = <&usb3_0>;If the registers for the phy are part of 'qcom,dwc3' then make this node a child of it.
Quoted 1 line
Making this node a child of qcom,dwc3 cause malfunction of the driver.
Fix the driver then.
Rob
R: [PATCH 2/2] devicetree: bindings: phy: Document dwc3 qcom phy
Quoted 90 lines · On Wed, Apr 15, 2020 at 7:26 AM <[email protected]> wrote:
Quoted 10 lines
Quoted 10 lines · Ansuel Smith
Quoted 6 lines
Document dwc3 qcom phy hs and ss phy bindings needed to correctly inizialize and use usb on ipq806x SoC
Signed-off-by Ansuel Smith <[email protected]>--- .../bindings/phy/qcom,dwc3-hs-usb-phy.yaml | 65+++++++++++++++++++
Quoted 1 line
.../bindings/phy/qcom,dwc3-ss-usb-phy.yaml | 65Quoted 8 lines
Quoted 8 lines
+++++++++++++++++++
Quoted 2 lines
2 files changed, 130 insertions(+) create mode 100644
Documentation/devicetree/bindings/phy/qcom,dwc3-hs-usb-phy.yamlQuoted 1 line
create mode 100644
Documentation/devicetree/bindings/phy/qcom,dwc3-ss-usb-phy.yamlReview
Quoted 2 lines
(quoted diff) +0
-0usb-
Quoted 1 line
Quoted 1 line
phy.yamlb/Documentation/devicetree/bindings/phy/qcom,dwc3-hs-usb-
Quoted 11 lines
Quoted 11 lines
phy.yamlDocumentation/devicetree/bindings/phy/qcom,dwc3-hs-usb-
Quoted 4 lines
new file mode 100644
index 000000000000..0bb59e3c2ab8Documentation/devicetree/bindings/phy/qcom,dwc3-hs-usb- new file +0
-0
phy.yamlDocumentation/devicetree/bindings/phy/qcom,dwc3-hs-usb- line 4
Quoted 5 lines
Documentation/devicetree/bindings/phy/qcom,dwc3-hs-usb- new file +4
-0@@ -0,0 +1,65 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/phy/qcom,dwc3-hs-usb-phy.yaml#
Quoted 56 lines
Quoted 55 lines
Documentation/devicetree/bindings/phy/qcom,dwc3-hs-usb- line 13
Quoted 9 lines
Documentation/devicetree/bindings/phy/qcom,dwc3-hs-usb- new file +9
-0+$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm DWC3 HS PHY CONTROLLER + +maintainers: + - Ansuel Smith <[email protected]> + +description: + DWC3 PHY nodes are defined to describe on-chip Synopsis Physicallayer
Quoted 31 lines
Documentation/devicetree/bindings/phy/qcom,dwc3-hs-usb- new file +31
-0+ controllers. Each DWC3 PHY controller should have its own node. + +properties: + compatible: + const: qcom,dwc3-hs-usb-phy + + "#phy-cells": + const: 0 + + regmap: + maxItems: 1 + description: phandle to usb3 dts definition + + clocks: + minItems: 1 + maxItems: 2 + + clock-names: + minItems: 1 + maxItems: 2 + description: | + - "ref" Is required + - "xo" Optional external reference clock + items: + - const: ref + - const: xo + +required: + - compatible + - "#phy-cells" + - regmapDocumentation/devicetree/bindings/phy/qcom,dwc3-hs-usb- line 54
Quoted 10 lines
Documentation/devicetree/bindings/phy/qcom,dwc3-hs-usb- new file +10
-0+ - clocks + - clock-names + +examples: + - | + #include <dt-bindings/clock/qcom,gcc-ipq806x.h> + + hs_phy_0: hs_phy_0 { + compatible = "qcom,dwc3-hs-usb-phy"; + regmap = <&usb3_0>;If the registers for the phy are part of 'qcom,dwc3' then make this node a child of it.
Quoted 5 lines
Quoted 1 line
Making this node a child of qcom,dwc3 cause malfunction of the driver.
Fix the driver then.
Rob
Sorry if i bother you but I checked every other usb driver that also needs phy node. I use regmap phandle here just for the fact that it's the same reg of dwc3. Others use directly the same reg and are outside their dwc3 usb node. I think I will follow this path and respin this. I really hope you are good with this.
Hi,
Quoted 18 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.
Signed-off-by Andy Gross <[email protected]>Signed-off-by Ansuel Smith <[email protected]>--- drivers/phy/qualcomm/Kconfig | 12 + drivers/phy/qualcomm/Makefile | 1 + drivers/phy/qualcomm/phy-qcom-dwc3.c | 578 +++++++++++++++++++++++++++ 3 files changed, 591 insertions(+) create mode 100644 drivers/phy/qualcomm/phy-qcom-dwc3.cdrivers/phy/qualcomm/Kconfig +0
-0
drivers/phy/qualcomm/Kconfig config PHY_QCOM_USB_HSIC · line 95
Quoted 5 lines
drivers/phy/qualcomm/Kconfig +2
-0@@ -91,3 +91,15 @@ config PHY_QCOM_USB_HSIC select GENERIC_PHY help Support for the USB HSIC ULPI compliant PHY on QCOM chipsets. + +config PHY_QCOM_DWC3
Please rename to PHY_QCOM_IPQ806X_USB
drivers/phy/qualcomm/Kconfig config PHY_QCOM_USB_HSIC · line 104
Quoted 9 lines
drivers/phy/qualcomm/Kconfig +9
-0+ tristate "QCOM DWC3 USB PHY support" + depends on ARCH_QCOM + depends on HAS_IOMEM + depends on OF + select GENERIC_PHY + help + This option enables support for the Synopsis PHYs present inside the + Qualcomm USB3.0 DWC3 controller. This driver supports both HS and SS + PHY controllers.
Please mention that driver supports only IPQ806x, as it can't be used for all QCOM phy and dwc3 controllers wrappers.
drivers/phy/qualcomm/phy-qcom-dwc3.c
Quoted 15 lines
drivers/phy/qualcomm/Kconfig +1
-0+drivers/phy/qualcomm/Makefile +1
-0@@ -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_DWC3) += phy-qcom-dwc3.odrivers/phy/qualcomm/phy-qcom-dwc3.c new file +0
-0
Rename to phy-qcom-ip806x-usb.c
Please also add qcom_ipq806x_usb as prefix in the function names and structures etc.
Quoted 2 lines
drivers/phy/qualcomm/phy-qcom-dwc3.c new file +0
-0@@ -0,0 +1,578 @@
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project