Enable IPQ5332 USB2
Subsystems (4)
PATCH v6 1/5 dt-bindings: phy: qcom,m31: Document qcom,m31 USB phy
In reply to Varadarajan NarayananDocument the M31 USB2 phy present in IPQ5332.
---
v6:
Add 'Co-developed-by: Sricharan'
Add 'const' to compatible, vdd-supply
Remove label and use usb2-phy for nodename in the example
v5:
Add '#phy-cells', to be able to use generic phy Remove 'Reviewed-by: Krzysztof Kozlowski' due to above change
v4:
Move M31 URL to description
Remove maxItems and relevant content from clock-names Change node name to generic name
'make dt_binding_check DT_SCHEMA_FILES=qcom' passed
v3:
Incorporate review comments. Will bring in ipq5018 compatible string while posting ipq5018 usb patchset.
v1:
Rename qcom,m31.yaml -> qcom,ipq5332-usb-hsphy.yaml Drop default binding "m31,usb-hsphy"
Add clock
Remove 'oneOf' from compatible
Remove 'qscratch' region from register space as it is not needed Remove reset-names
Fix the example definition
--- .../bindings/phy/qcom,ipq5332-usb-hsphy.yaml | 59 ++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 Documentation/devicetree/bindings/phy/qcom,ipq5332-usb-hsphy.yaml
Documentation/devicetree/bindings/phy/qcom,ipq5332-usb-hsphy.yaml new file +59 -0
@@ -0,0 +1,59 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/phy/qcom,ipq5332-usb-hsphy.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: M31 USB PHY + +maintainers: + - Sricharan Ramabadhran <[email protected]> + - Varadarajan Narayanan <[email protected]> + +description: + USB M31 PHY (https://www.m31tech.com) found in Qualcomm + IPQ5018, IPQ5332 SoCs. + +properties: + "#phy-cells": + const: 0 + + compatible: + items: + - const: qcom,ipq5332-usb-hsphy + + reg: + maxItems: 1 + + clocks: + maxItems: 1 + + clock-names: + items: + - const: cfg_ahb + + resets: + maxItems: 1 + + vdd-supply: + description: + Phandle to 5V regulator supply to PHY digital circuit. + +additionalProperties: false + +examples: + - | + #include <dt-bindings/clock/qcom,ipq5332-gcc.h> + usb2-phy@7b000 { + compatible = "qcom,ipq5332-usb-hsphy"; + reg = <0x0007b000 0x12c>; + + clocks = <&gcc GCC_USB0_PHY_CFG_AHB_CLK>; + clock-names = "cfg_ahb"; + + #phy-cells = <0>; + + resets = <&gcc GCC_QUSB2_0_PHY_BCR>; + + vdd-supply = <®ulator_fixed_5p0>; + };
Signature · 7 lines
2.7.4 -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
PATCH v6 2/5 phy: qcom-m31: Introduce qcom,m31 USB phy driver
In reply to Varadarajan NarayananAdd the M31 USB2 phy driver.
---
v6:
Kconfig:Add COMPILE_TEST and remove USB_GADGET from 'depends'
Change 'selects' USB_PHY -> GENERIC_PHY
Driver: Use correct headers
const int -> unsigned int for 'nregs' in private data Use generic names for clk, phy in m31 phy structure Init register details directly instead of using macro Use dev_err_probe in the error paths of driver probe
v5:
Kconfig and Makefile:- place snippet according to sorted order Use generic phy instead of usb-phy
Use ARRAY_SIZE for reg init instead of blank last entry Fix copyright year
v4:
Remove unused enum
Error handling for devm_clk_get
v1:
Combine driver, makefile and kconfig into 1 patch
Remove 'qscratch' region and its usage. The controller driver takes care of those settings
Use compatible/data to handle ipq5332 init
Drop the default case
Get resources by index instead of name as there is only one resource Add clock
Fix review comments in the driver
--- drivers/phy/qualcomm/Kconfig | 11 ++ drivers/phy/qualcomm/Makefile | 1 + drivers/phy/qualcomm/phy-qcom-m31.c | 248 ++++++++++++++++++++++++++++++++++++ 3 files changed, 260 insertions(+) create mode 100644 drivers/phy/qualcomm/phy-qcom-m31.c
drivers/phy/qualcomm/Kconfig +11 -0
@@ -143,6 +143,17 @@ config PHY_QCOM_EUSB2_REPEATER PMICs. The repeater is paired with a Synopsys eUSB2 Phy on Qualcomm SOCs. +config PHY_QCOM_M31_USB + tristate "Qualcomm M31 HS PHY driver support" + depends on USB && (ARCH_QCOM || COMPILE_TEST) + select GENERIC_PHY + help + Enable this to support M31 HS PHY transceivers on Qualcomm 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 PHY_QCOM_USB_HS tristate "Qualcomm USB HS PHY module" depends on USB_ULPI_BUS
drivers/phy/qualcomm/Makefile +1 -0
@@ -4,6 +4,7 @@ obj-$(CONFIG_PHY_QCOM_APQ8064_SATA) += phy-qcom-apq8064-sata.o obj-$(CONFIG_PHY_QCOM_EDP) += phy-qcom-edp.o obj-$(CONFIG_PHY_QCOM_IPQ4019_USB) += phy-qcom-ipq4019-usb.o obj-$(CONFIG_PHY_QCOM_IPQ806X_SATA) += phy-qcom-ipq806x-sata.o +obj-$(CONFIG_PHY_QCOM_M31_USB) += phy-qcom-m31.o obj-$(CONFIG_PHY_QCOM_PCIE2) += phy-qcom-pcie2.o obj-$(CONFIG_PHY_QCOM_QMP_COMBO) += phy-qcom-qmp-combo.o
drivers/phy/qualcomm/phy-qcom-m31.c new file +248 -0
248 lines not on this page · raw message
Signature · 7 lines
2.7.4 -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
PATCH v6 3/5 arm64: dts: qcom: ipq5332: Add USB related nodes
In reply to Varadarajan NarayananAdd USB phy and controller nodes.
---
v6:
Remove clock names
Move the nodes to address sorted location
v5:
Use generic phy instead of usb-phy
'make CHECK_DTBS=y DT_SCHEMA_FILES=qcom dtbs_check' passed 'DT_CHECKER_FLAGS='-v -m' DT_SCHEMA_FILES=qcom dt_binding_check' passed
v4:
Change node name
Remove blank line
'make CHECK_DTBS=y DT_SCHEMA_FILES=qcom qcom/ipq5332-rdp441.dtb' passed
v1:
Rename phy node
Change compatible from m31,ipq5332-usb-hsphy -> qcom,ipq5332-usb-hsphy Remove 'qscratch' from phy node
Fix alignment and upper-case hex no.s
Add clock definition for the phy
Remove snps,ref-clock-period-ns as it is not used. dwc3_ref_clk_period() in dwc3/core.c takes the frequency from ref clock and calculates fladj as appropriate.
--- arch/arm64/boot/dts/qcom/ipq5332.dtsi | 55 +++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+)
arch/arm64/boot/dts/qcom/ipq5332.dtsi +55 -0
@@ -145,6 +145,19 @@ #size-cells = <1>; ranges = <0 0 0 0xffffffff>; + usbphy0: phy@7b000 { + compatible = "qcom,ipq5332-usb-hsphy"; + reg = <0x0007b000 0x12c>; + + clocks = <&gcc GCC_USB0_PHY_CFG_AHB_CLK>; + + resets = <&gcc GCC_QUSB2_0_PHY_BCR>; + + #phy-cells = <0>; + + status = "disabled"; + }; + qfprom: efuse@a4000 { compatible = "qcom,ipq5332-qfprom", "qcom,qfprom"; reg = <0x000a4000 0x721>;
@@ -290,6 +303,48 @@ status = "disabled"; }; + usb: usb2@8a00000 { + compatible = "qcom,ipq5332-dwc3", "qcom,dwc3"; + reg = <0x08af8800 0x400>; + + interrupts = <GIC_SPI 62 IRQ_TYPE_LEVEL_HIGH>; + interrupt-names = "hs_phy_irq"; + + clocks = <&gcc GCC_USB0_MASTER_CLK>, + <&gcc GCC_SNOC_USB_CLK>, + <&gcc GCC_USB0_SLEEP_CLK>, + <&gcc GCC_USB0_MOCK_UTMI_CLK>; + clock-names = "core", + "iface", + "sleep", + "mock_utmi"; + + resets = <&gcc GCC_USB_BCR>; + + qcom,select-utmi-as-pipe-clk; + + #address-cells = <1>; + #size-cells = <1>; + ranges; + + status = "disabled"; + + usb2_0_dwc: usb@8a00000 { + compatible = "snps,dwc3"; + reg = <0x08a00000 0xe000>; + clocks = <&gcc GCC_USB0_MOCK_UTMI_CLK>; + clock-names = "ref"; + interrupts = <GIC_SPI 64 IRQ_TYPE_LEVEL_HIGH>; + phy-names = "usb2-phy"; + phys = <&usbphy0>; + tx-fifo-resize; + snps,is-utmi-l1-suspend; + snps,hird-threshold = /bits/ 8 <0x0>; + snps,dis_u2_susphy_quirk; + snps,dis_u3_susphy_quirk; + }; + }; + intc: interrupt-controller@b000000 { compatible = "qcom,msm-qgic2"; reg = <0x0b000000 0x1000>, /* GICD */
Signature · 7 lines
2.7.4 -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
v6 cover Enable IPQ5332 USB2
This patch series adds the relevant phy and controller configurations for enabling USB2 on IPQ5332
v6:
Binding and dts:-
Dropped the qcom,dwc3.yaml patch as it has been picked up for linux-next Add const to compatible, vdd-supply
Move nodes per register address
Driver:-
Add vdd-supply
Cleanup error paths in probe with dev_err_probe
v5:
Binding and dts:-
Fix email id
Removed 'Reviewed-by: Krzysztof Kozlowski <[email protected]>' as had to change bindings file to be able to use generic phy instead of usb-phy
Driver:-
Remove unused definition Use generic phy instead of usb-phy
v4:
Binding and dts:-
Change node name (bindings & dts)
Driver:-
Remove unused enum
static const for '.data' Error handling for devm_clk_get
v3:
Fix bindings file based on review comments
v1:
Cleanup DTS
Combine driver, kconfig and makefile patches Remove unused functions from M31 driver Drop the clock driver changes
Varadarajan Narayanan (5):
dt-bindings: phy: qcom,m31: Document qcom,m31 USB phy
phy: qcom-m31: Introduce qcom,m31 USB phy driver
arm64: dts: qcom: ipq5332: Add USB related nodes
arm64: dts: qcom: ipq5332: Enable USB
arm64: defconfig: Enable M31 USB phy driver
.../bindings/phy/qcom,ipq5332-usb-hsphy.yaml | 59 +++++ arch/arm64/boot/dts/qcom/ipq5332-rdp468.dts | 23 ++ arch/arm64/boot/dts/qcom/ipq5332.dtsi | 55 +++++ arch/arm64/configs/defconfig | 1 + drivers/phy/qualcomm/Kconfig | 11 + drivers/phy/qualcomm/Makefile | 1 + drivers/phy/qualcomm/phy-qcom-m31.c | 248 +++++++++++++++++++++ 7 files changed, 398 insertions(+) create mode 100644 Documentation/devicetree/bindings/phy/qcom,ipq5332-usb-hsphy.yaml create mode 100644 drivers/phy/qualcomm/phy-qcom-m31.c
Signature · 7 lines
2.7.4 -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
PATCH v6 4/5 arm64: dts: qcom: ipq5332: Enable USB
Enable USB2 in host mode.
---
v6:
Add vdd-supply and corresponding regulator
v1:
Enable usb-phy node
--- arch/arm64/boot/dts/qcom/ipq5332-rdp468.dts | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+)
arch/arm64/boot/dts/qcom/ipq5332-rdp468.dts +23 -0
@@ -12,6 +12,15 @@ / { model = "Qualcomm Technologies, Inc. IPQ5332 MI01.6"; compatible = "qcom,ipq5332-ap-mi01.6", "qcom,ipq5332"; + + regulator_fixed_5p0: s0500 { + compatible = "regulator-fixed"; + regulator-min-microvolt = <500000>; + regulator-max-microvolt = <500000>; + regulator-boot-on; + regulator-always-on; + regulator-name = "fixed_5p0"; + }; }; &blsp1_spi0 {
@@ -79,3 +88,17 @@ bias-pull-up; }; }; + +&usbphy0 { + vdd-supply = <®ulator_fixed_5p0>; + + status = "okay"; +}; + +&usb { + status = "okay"; +}; + +&usb2_0_dwc { + dr_mode = "host"; +};
Signature · 7 lines
2.7.4 -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
PATCH v6 5/5 arm64: defconfig: Enable M31 USB phy driver
In reply to Varadarajan NarayananEnable M31 USB phy driver present in IPQ5332.
---
v2:
Add full stop to commit log.
--- arch/arm64/configs/defconfig | 1 + 1 file changed, 1 insertion(+)
arch/arm64/configs/defconfig +1 -0
@@ -1389,6 +1389,7 @@ CONFIG_PHY_QCOM_USB_SNPS_FEMTO_V2=m CONFIG_PHY_QCOM_USB_HS_28NM=m CONFIG_PHY_QCOM_USB_SS=m CONFIG_PHY_QCOM_SGMII_ETH=m +CONFIG_PHY_QCOM_M31_USB=m CONFIG_PHY_R8A779F0_ETHERNET_SERDES=y CONFIG_PHY_RCAR_GEN3_PCIE=y CONFIG_PHY_RCAR_GEN3_USB2=y
Signature · 7 lines
2.7.4 -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Re: [PATCH v6 1/5] dt-bindings: phy: qcom,m31: Document qcom,m31 USB phy
In reply to Varadarajan NarayananQuoted 8 lines · Varadarajan Narayanan
Document the M31 USB2 phy present in IPQ5332.
Co-developed-by Sricharan Ramabadhran <[email protected]>Signed-off-by Sricharan Ramabadhran <[email protected]>Signed-off-by Varadarajan Narayanan <[email protected]>---
Documentation/devicetree/bindings/phy/qcom,ipq5332-usb-hsphy.yaml line 23
Quoted 7 lines
Documentation/devicetree/bindings/phy/qcom,ipq5332-usb-hsphy.yaml new file +7
-0+properties: + "#phy-cells": + const: 0 + + compatible: + items: + - const: qcom,ipq5332-usb-hsphy
Please keep compatible as first property.
Quoted 14 lines
Documentation/devicetree/bindings/phy/qcom,ipq5332-usb-hsphy.yaml new file +14
-0+ + reg: + maxItems: 1 + + clocks: + maxItems: 1 + + clock-names: + items: + - const: cfg_ahb + + resets: + maxItems: 1 +
Documentation/devicetree/bindings/phy/qcom,ipq5332-usb-hsphy.yaml line 47
Quoted 10 lines
Documentation/devicetree/bindings/phy/qcom,ipq5332-usb-hsphy.yaml new file +10
-0+ vdd-supply: + description: + Phandle to 5V regulator supply to PHY digital circuit. + +additionalProperties: false + +examples: + - | + #include <dt-bindings/clock/qcom,ipq5332-gcc.h> + usb2-phy@7b000 {
This was actually better before as usb-phy, I don't know why did you changed. Especially that you already changed once to usb-phy and this got review tag. It's fine. If there is going to be resubmit then fix these two issues.
Best regards,
Krzysztof
Re: [PATCH v6 1/5] dt-bindings: phy: qcom,m31: Document qcom,m31 USB phy
Quoted 40 lines · Krzysztof Kozlowski
Quoted 8 lines · Varadarajan Narayanan
Document the M31 USB2 phy present in IPQ5332.
Co-developed-by Sricharan Ramabadhran <[email protected]>Signed-off-by Sricharan Ramabadhran <[email protected]>Signed-off-by Varadarajan Narayanan <[email protected]>---
Documentation/devicetree/bindings/phy/qcom,ipq5332-usb-hsphy.yaml line 23
Quoted 7 lines
Documentation/devicetree/bindings/phy/qcom,ipq5332-usb-hsphy.yaml new file +7
-0+properties: + "#phy-cells": + const: 0 + + compatible: + items: + - const: qcom,ipq5332-usb-hsphyPlease keep compatible as first property.
Quoted 21 lines
Documentation/devicetree/bindings/phy/qcom,ipq5332-usb-hsphy.yaml new file +21
-0+ + reg: + maxItems: 1 + + clocks: + maxItems: 1 + + clock-names: + items: + - const: cfg_ahb + + resets: + maxItems: 1 + + vdd-supply: + description: + Phandle to 5V regulator supply to PHY digital circuit. + +additionalProperties: false + +examples:
Quoted 8 lines
Documentation/devicetree/bindings/phy/qcom,ipq5332-usb-hsphy.yaml line 47
Quoted 3 lines
Documentation/devicetree/bindings/phy/qcom,ipq5332-usb-hsphy.yaml new file +3
-0+ - | + #include <dt-bindings/clock/qcom,ipq5332-gcc.h> + usb2-phy@7b000 {This was actually better before as usb-phy, I don't know why did you changed. Especially that you already changed once to usb-phy and this got review tag. It's fine. If there is going to be resubmit then fix these two issues.
Based on Bjorn's and Rob's comments (https://lore.kernel.org/linux-arm-msm/[email protected]/)
I assumed they preferred usb2-phy and hence changed. Will revert
back to usb-phy if I post another version.
Quoted 1 line
Reviewed-by Krzysztof Kozlowski <[email protected]>
Thanks
Varada
Signature · 3 lines
linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy