Add QMP V3 USB3 PHY support for SC7180
Subsystems (5)
v2 cover Add QMP V3 USB3 PHY support for SC7180
Add QMP V3 USB3 PHY entries for SC7180 in phy driver and device tree bindings.
changes in v2:
*Remove global phy reset in QMP phy.
*Convert QMP phy bindings to yaml.
Sandeep Maheswaram (3):
phy: qcom-qmp: Add QMP V3 USB3 PHY support for SC7180
arm64: dts: qcom: sc7180: Remove global phy reset in QMP phy
dt-bindings: phy: qcom,qmp: Convert QMP phy bindings to yaml
.../devicetree/bindings/phy/qcom,qmp-phy.yaml | 201 ++++++++++++++++++ .../devicetree/bindings/phy/qcom-qmp-phy.txt | 227 --------------------- arch/arm64/boot/dts/qcom/sc7180.dtsi | 5 +- drivers/phy/qualcomm/phy-qcom-qmp.c | 38 ++++ 4 files changed, 241 insertions(+), 230 deletions(-) create mode 100644 Documentation/devicetree/bindings/phy/qcom,qmp-phy.yaml delete mode 100644 Documentation/devicetree/bindings/phy/qcom-qmp-phy.txt
Signature · 2 lines
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
PATCH v2 1/3 phy: qcom-qmp: Add QMP V3 USB3 PHY support for SC7180
Adding QMP v3 USB3 phy support for SC7180.
--- drivers/phy/qualcomm/phy-qcom-qmp.c | 38 +++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+)
drivers/phy/qualcomm/phy-qcom-qmp.c +38 -0
@@ -1139,6 +1139,10 @@ static const char * const msm8996_usb3phy_reset_l[] = { "phy", "common", }; +static const char *const sc7180_usb3phy_reset_l[] = { +"phy" , +}; +/* list of regulators */ static const char *const qmp_phy_vreg_l[] = {"vdda-phy" ,"vdda-pll" ,
@@ -1265,6 +1269,37 @@ static const struct qmp_phy_cfg qmp_v3_usb3phy_cfg = { .is_dual_lane_phy = true, }; +static const struct qmp_phy_cfg sc7180_usb3phy_cfg = { + .type =PHY_TYPE_USB3 , + .nlanes =1 , + + .serdes_tbl = qmp_v3_usb3_serdes_tbl, + .serdes_tbl_num =ARRAY_SIZE (qmp_v3_usb3_serdes_tbl), + .tx_tbl = qmp_v3_usb3_tx_tbl, + .tx_tbl_num =ARRAY_SIZE (qmp_v3_usb3_tx_tbl), + .rx_tbl = qmp_v3_usb3_rx_tbl, + .rx_tbl_num =ARRAY_SIZE (qmp_v3_usb3_rx_tbl), + .pcs_tbl = qmp_v3_usb3_pcs_tbl, + .pcs_tbl_num =ARRAY_SIZE (qmp_v3_usb3_pcs_tbl), + .clk_list = qmp_v3_phy_clk_l, + .num_clks =ARRAY_SIZE (qmp_v3_phy_clk_l), + .reset_list = sc7180_usb3phy_reset_l, + .num_resets =ARRAY_SIZE (sc7180_usb3phy_reset_l), + .vreg_list = qmp_phy_vreg_l, + .num_vregs =ARRAY_SIZE (qmp_phy_vreg_l), + .regs = qmp_v3_usb3phy_regs_layout, + + .start_ctrl =SERDES_START |PCS_START , + .pwrdn_ctrl =SW_PWRDN , + + .has_pwrdn_delay = true, + .pwrdn_delay_min =POWER_DOWN_DELAY_US_MIN , + .pwrdn_delay_max =POWER_DOWN_DELAY_US_MAX , + + .has_phy_dp_com_ctrl = true, + .is_dual_lane_phy = true, +}; +static const struct qmp_phy_cfg qmp_v3_usb3_uniphy_cfg = { .type =PHY_TYPE_USB3 , .nlanes =1 ,
@@ -2103,6 +2138,9 @@ static const struct of_device_id qcom_qmp_phy_of_match_table[] = { .compatible = "qcom,ipq8074-qmp-pcie-phy", .data = &ipq8074_pciephy_cfg, }, { + .compatible = "qcom,sc7180-qmp-usb3-phy", + .data = &sc7180_usb3phy_cfg, + }, { .compatible = "qcom,sdm845-qmp-usb3-phy", .data = &qmp_v3_usb3phy_cfg, }, {
Signature · 2 lines
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
PATCH v2 2/3 arm64: dts: qcom: sc7180: Remove global phy reset in QMP phy
In reply to Sandeep MaheswaramRemove global phy reset and do only usb phy reset in QMP phy.
--- arch/arm64/boot/dts/qcom/sc7180.dtsi | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
arch/arm64/boot/dts/qcom/sc7180.dtsi +2 -3
@@ -1072,9 +1072,8 @@ <&gcc GCC_USB3_PRIM_PHY_COM_AUX_CLK>; clock-names = "aux", "cfg_ahb", "ref", "com_aux"; - resets = <&gcc GCC_USB3_DP_PHY_PRIM_BCR>, - <&gcc GCC_USB3_PHY_PRIM_BCR>; - reset-names = "phy", "common"; + resets = <&gcc GCC_USB3_PHY_PRIM_BCR>; + reset-names = "phy"; usb_1_ssphy: phy@88e9200 { reg = <0 0x088e9200 0 0x128>,
Signature · 2 lines
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
Re: [PATCH v2 2/3] arm64: dts: qcom: sc7180: Remove global phy reset in QMP phy
Quoting Sandeep Maheswaram (2020-01-08 04:29:40)
Quoted 1 line
Remove global phy reset and do only usb phy reset in QMP phy.
Yes that's what this patch does, but you left out the important part:
Why?
Quoted 11 lines
Signed-off-by Sandeep Maheswaram <[email protected]>--- arch/arm64/boot/dts/qcom/sc7180.dtsi | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)arch/arm64/boot/dts/qcom/sc7180.dtsi +0
-0
arch/arm64/boot/dts/qcom/sc7180.dtsi line 1077
Quoted 9 lines
arch/arm64/boot/dts/qcom/sc7180.dtsi +2
-3@@ -1072,9 +1072,8 @@ <&gcc GCC_USB3_PRIM_PHY_COM_AUX_CLK>; clock-names = "aux", "cfg_ahb", "ref", "com_aux"; - resets = <&gcc GCC_USB3_DP_PHY_PRIM_BCR>, - <&gcc GCC_USB3_PHY_PRIM_BCR>; - reset-names = "phy", "common"; + resets = <&gcc GCC_USB3_PHY_PRIM_BCR>; + reset-names = "phy";
We shouldn't need to modify the DT node for this. The reset still goes to this hardware block, so DT should reflect that. Instead, the driver shouldn't drive this reset on this SoC.
Quoted 2 lines
arch/arm64/boot/dts/qcom/sc7180.dtsi +0
-0usb_1_ssphy: phy@88e9200 { reg = <0 0x088e9200 0 0x128>,
PATCH v2 3/3 dt-bindings: phy: qcom,qmp: Convert QMP phy bindings to yaml
In reply to Sandeep MaheswaramConvert QMP phy bindings to DT schema format using json-schema.
--- .../devicetree/bindings/phy/qcom,qmp-phy.yaml | 201 ++++++++++++++++++ .../devicetree/bindings/phy/qcom-qmp-phy.txt | 227 --------------------- 2 files changed, 201 insertions(+), 227 deletions(-) create mode 100644 Documentation/devicetree/bindings/phy/qcom,qmp-phy.yaml delete mode 100644 Documentation/devicetree/bindings/phy/qcom-qmp-phy.txt
Documentation/devicetree/bindings/phy/qcom,qmp-phy.yaml new file +201 -0
@@ -0,0 +1,201 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) + +%YAML 1.2 +--- +$id: "http://devicetree.org/schemas/phy/qcom,qmp-phy.yaml#" +$schema: "http://devicetree.org/meta-schemas/core.yaml#" + +title: Qualcomm QMP PHY controller + +maintainers: + - Manu Gautam <[email protected]> + +description: + QMP phy controller supports physical layer functionality for a number of + controllers on Qualcomm chipsets, such as, PCIe, UFS, and USB. + +properties: + compatible: + enum: + - qcom,ipq8074-qmp-pcie-phy + - qcom,ipq8074-qmp-pcie-phy + - qcom,msm8996-qmp-pcie-phy + - qcom,msm8996-qmp-usb3-phy + - qcom,msm8998-qmp-usb3-phy + - qcom,msm8998-qmp-ufs-phy + - qcom,msm8998-qmp-pcie-phy + - qcom,sc7180-qmp-usb3-phy + - qcom,sdm845-qmp-usb3-phy + - qcom,sdm845-qmp-usb3-uni-phy + - qcom,sdm845-qmp-ufs-phy + - qcom,sm8150-qmp-ufs-phy + + reg: + minItems: 1 + items: + - description: Address and length of PHY's common serdes block. + - description: Address and length of the DP_COM control block. + + reg-names: + items: + - const: reg-base + - const: dp_com + + "#clock-cells": + enum: [ 1, 2 ] + + "#address-cells": + enum: [ 1, 2 ] + + "#size-cells": + enum: [ 1, 2 ] + + clocks: + anyOf: + - items: + - description: Phy aux clock. + - description: Phy config clock. + - description: 19.2 MHz ref clk. + - description: Phy common block aux clock. + - items: + - description: Phy aux clock. + - description: Phy config clock. + - description: 19.2 MHz ref clk. + - items: + - description: 19.2 MHz ref clk. + - description: Phy reference aux clock. + - items: + - description: Phy reference aux clock. + + clock-names: + anyOf: + - items: + - const: aux + - const: cfg_ahb + - const: ref + - const: com_aux + - items: + - const: aux + - const: cfg_ahb + - const: ref + - items: + - const: ref + - const: ref_aux + - items: + - const: ref_aux + + resets: + anyOf: + - items: + - description: reset of phy block. + - description: phy common block reset. + - description: ahb cfg block reset. + - items: + - description: reset of phy block. + - description: phy common block reset. + - items: + - description: ahb cfg block reset. + - description: PHY reset in the UFS controller. + - items: + - description: reset of phy block. + - items: + - description: PHY reset in the UFS controller. + + reset-names: + anyOf: + - items: + - const: phy + - const: common + - const: cfg + - items: + - const: phy + - const: common + - items: + - const: ahb + - const: ufsphy + - items: + - const: phy + - items: + - const: ufsphy + + vdda-phy-supply: + description: + Phandle to a regulator supply to PHY core block. + + vdda-pll-supply: + description: + Phandle to 1.8V regulator supply to PHY refclk pll block. + + vddp-ref-clk-supply: + description: + Phandle to a regulator supply to any specific refclk + pll block. + +required: + - compatible + - reg + - "#clock-cells" + - "#address-cells" + - "#size-cells" + - clocks + - clock-names + - resets + - reset-names + - vdda-phy-supply + - vdda-pll-supply + +if: + properties: + compatible: + contains: + anyOf: + - items: + - const: qcom,sdm845-qmp-usb3-phy + - items: + - const: qcom,sc7180-qmp-usb3-phy +then: + required: + - reg-names + +#Required nodes: +#Each device node of QMP phy is required to have as many child nodes as +#the number of lanes the PHY has. + +examples: + - | + #include <dt-bindings/clock/qcom,gcc-sc7180.h> + usb_1_qmpphy: phy-wrapper@88e9000 { + compatible = "qcom,sc7180-qmp-usb3-phy"; + reg = <0 0x088e9000 0 0x18c>, + <0 0x088e8000 0 0x38>; + reg-names = "reg-base", "dp_com"; + #clock-cells = <1>; + #address-cells = <2>; + #size-cells = <2>; + + clocks = <&gcc GCC_USB3_PRIM_PHY_AUX_CLK>, + <&gcc GCC_USB_PHY_CFG_AHB2PHY_CLK>, + <&gcc GCC_USB3_PRIM_CLKREF_CLK>, + <&gcc GCC_USB3_PRIM_PHY_COM_AUX_CLK>; + clock-names = "aux", "cfg_ahb", "ref", "com_aux"; + + resets = <&gcc GCC_USB3_PHY_PRIM_BCR>; + reset-names = "phy"; + + vdda-phy-supply = <&vreg_l3c_1p2>; + vdda-pll-supply = <&vreg_l4a_0p8>; + + usb_1_ssphy: phy@88e9200 { + reg = <0 0x088e9200 0 0x128>, + <0 0x088e9400 0 0x200>, + <0 0x088e9c00 0 0x218>, + <0 0x088e9600 0 0x128>, + <0 0x088e9800 0 0x200>, + <0 0x088e9a00 0 0x18>; + #clock-cells = <0>; + #phy-cells = <0>; + clocks = <&gcc GCC_USB3_PRIM_PHY_PIPE_CLK>; + clock-names = "pipe0"; + clock-output-names = "usb3_phy_pipe_clk_src"; + }; + };
Documentation/devicetree/bindings/phy/qcom-qmp-phy.txt deleted +0 -227
227 lines not on this page · raw message
Signature · 2 lines
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
Rob Herring
maintainerRe: [PATCH v2 3/3] dt-bindings: phy: qcom,qmp: Convert QMP phy bindings to yaml
Quoted 60 lines · Sandeep Maheswaram
Convert QMP phy bindings to DT schema format using json-schema.
Signed-off-by Sandeep Maheswaram <[email protected]>--- .../devicetree/bindings/phy/qcom,qmp-phy.yaml | 201 ++++++++++++++++++ .../devicetree/bindings/phy/qcom-qmp-phy.txt | 227 --------------------- 2 files changed, 201 insertions(+), 227 deletions(-) create mode 100644 Documentation/devicetree/bindings/phy/qcom,qmp-phy.yaml delete mode 100644 Documentation/devicetree/bindings/phy/qcom-qmp-phy.txtDocumentation/devicetree/bindings/phy/qcom,qmp-phy.yaml new file +44
-0@@ -0,0 +1,201 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) + +%YAML 1.2 +--- +$id: "http://devicetree.org/schemas/phy/qcom,qmp-phy.yaml#" +$schema: "http://devicetree.org/meta-schemas/core.yaml#" + +title: Qualcomm QMP PHY controller + +maintainers: + - Manu Gautam <[email protected]> + +description: + QMP phy controller supports physical layer functionality for a number of + controllers on Qualcomm chipsets, such as, PCIe, UFS, and USB. + +properties: + compatible: + enum: + - qcom,ipq8074-qmp-pcie-phy + - qcom,ipq8074-qmp-pcie-phy + - qcom,msm8996-qmp-pcie-phy + - qcom,msm8996-qmp-usb3-phy + - qcom,msm8998-qmp-usb3-phy + - qcom,msm8998-qmp-ufs-phy + - qcom,msm8998-qmp-pcie-phy + - qcom,sc7180-qmp-usb3-phy + - qcom,sdm845-qmp-usb3-phy + - qcom,sdm845-qmp-usb3-uni-phy + - qcom,sdm845-qmp-ufs-phy + - qcom,sm8150-qmp-ufs-phy + + reg: + minItems: 1 + items: + - description: Address and length of PHY's common serdes block. + - description: Address and length of the DP_COM control block. + + reg-names: + items: + - const: reg-base + - const: dp_com + + "#clock-cells":
Documentation/devicetree/bindings/phy/qcom,qmp-phy.yaml line 54
Quoted 10 lines
Documentation/devicetree/bindings/phy/qcom,qmp-phy.yaml new file +10
-0+ enum: [ 1, 2 ] + + "#address-cells": + enum: [ 1, 2 ] + + "#size-cells": + enum: [ 1, 2 ] + + clocks: + anyOf:
Should be oneOf rather than anyOf. Did oneOf not work?
Documentation/devicetree/bindings/phy/qcom,qmp-phy.yaml line 59
Quoted 5 lines
Documentation/devicetree/bindings/phy/qcom,qmp-phy.yaml new file +5
-0+ - items: + - description: Phy aux clock. + - description: Phy config clock. + - description: 19.2 MHz ref clk. + - description: Phy common block aux clock.
These should be indented 2 more spaces.
Documentation/devicetree/bindings/phy/qcom,qmp-phy.yaml line 58
Quoted 4 lines
Documentation/devicetree/bindings/phy/qcom,qmp-phy.yaml new file +4
-0+ - items: + - description: Phy aux clock. + - description: Phy config clock. + - description: 19.2 MHz ref clk.
This can be dropped if you add 'minItems: 3' to the 1st case.
Then really, you should have an if/then to define which compatibles require 4 items.
Documentation/devicetree/bindings/phy/qcom,qmp-phy.yaml line 71
Quoted 8 lines
Documentation/devicetree/bindings/phy/qcom,qmp-phy.yaml new file +8
-0+ - items: + - description: 19.2 MHz ref clk. + - description: Phy reference aux clock. + - items: + - description: Phy reference aux clock. + + clock-names: + anyOf:
oneOf
Documentation/devicetree/bindings/phy/qcom,qmp-phy.yaml line 76
Quoted 5 lines
Documentation/devicetree/bindings/phy/qcom,qmp-phy.yaml new file +5
-0+ - items: + - const: aux + - const: cfg_ahb + - const: ref + - const: com_aux
Indent 2 more...
Documentation/devicetree/bindings/phy/qcom,qmp-phy.yaml line 88
Quoted 12 lines
Documentation/devicetree/bindings/phy/qcom,qmp-phy.yaml new file +12
-0+ - items: + - const: aux + - const: cfg_ahb + - const: ref + - items: + - const: ref + - const: ref_aux + - items: + - const: ref_aux + + resets: + anyOf:
oneOf
Quoted 34 lines
Documentation/devicetree/bindings/phy/qcom,qmp-phy.yaml new file +34
-0+ - items: + - description: reset of phy block. + - description: phy common block reset. + - description: ahb cfg block reset. + - items: + - description: reset of phy block. + - description: phy common block reset. + - items: + - description: ahb cfg block reset. + - description: PHY reset in the UFS controller. + - items: + - description: reset of phy block. + - items: + - description: PHY reset in the UFS controller. + + reset-names: + anyOf: + - items: + - const: phy + - const: common + - const: cfg + - items: + - const: phy + - const: common + - items: + - const: ahb + - const: ufsphy + - items: + - const: phy + - items: + - const: ufsphy + + vdda-phy-supply: + description:
Documentation/devicetree/bindings/phy/qcom,qmp-phy.yaml line 132
Quoted 10 lines
Documentation/devicetree/bindings/phy/qcom,qmp-phy.yaml new file +10
-0+ Phandle to a regulator supply to PHY core block. + + vdda-pll-supply: + description: + Phandle to 1.8V regulator supply to PHY refclk pll block. + + vddp-ref-clk-supply: + description: + Phandle to a regulator supply to any specific refclk + pll block.
You need patternProperties with the child nodes defined.
Documentation/devicetree/bindings/phy/qcom,qmp-phy.yaml line 145
Quoted 13 lines
Documentation/devicetree/bindings/phy/qcom,qmp-phy.yaml new file +13
-0+ +required: + - compatible + - reg + - "#clock-cells" + - "#address-cells" + - "#size-cells" + - clocks + - clock-names + - resets + - reset-names + - vdda-phy-supply + - vdda-pll-supply
Need a 'additionalProperties: false' here.
Quoted 56 lines
Documentation/devicetree/bindings/phy/qcom,qmp-phy.yaml new file +56
-0+ +if: + properties: + compatible: + contains: + anyOf: + - items: + - const: qcom,sdm845-qmp-usb3-phy + - items: + - const: qcom,sc7180-qmp-usb3-phy +then: + required: + - reg-names + +#Required nodes: +#Each device node of QMP phy is required to have as many child nodes as +#the number of lanes the PHY has. + +examples: + - | + #include <dt-bindings/clock/qcom,gcc-sc7180.h> + usb_1_qmpphy: phy-wrapper@88e9000 { + compatible = "qcom,sc7180-qmp-usb3-phy"; + reg = <0 0x088e9000 0 0x18c>, + <0 0x088e8000 0 0x38>; + reg-names = "reg-base", "dp_com"; + #clock-cells = <1>; + #address-cells = <2>; + #size-cells = <2>; + + clocks = <&gcc GCC_USB3_PRIM_PHY_AUX_CLK>, + <&gcc GCC_USB_PHY_CFG_AHB2PHY_CLK>, + <&gcc GCC_USB3_PRIM_CLKREF_CLK>, + <&gcc GCC_USB3_PRIM_PHY_COM_AUX_CLK>; + clock-names = "aux", "cfg_ahb", "ref", "com_aux"; + + resets = <&gcc GCC_USB3_PHY_PRIM_BCR>; + reset-names = "phy"; + + vdda-phy-supply = <&vreg_l3c_1p2>; + vdda-pll-supply = <&vreg_l4a_0p8>; + + usb_1_ssphy: phy@88e9200 { + reg = <0 0x088e9200 0 0x128>, + <0 0x088e9400 0 0x200>, + <0 0x088e9c00 0 0x218>, + <0 0x088e9600 0 0x128>, + <0 0x088e9800 0 0x200>, + <0 0x088e9a00 0 0x18>; + #clock-cells = <0>; + #phy-cells = <0>; + clocks = <&gcc GCC_USB3_PRIM_PHY_PIPE_CLK>; + clock-names = "pipe0"; + clock-output-names = "usb3_phy_pipe_clk_src"; + }; + };
Hi Sandeep,
this series has outstanding comments, do you plan to respin it soon?
Thanks
Matthias
Quoted 24 lines · Sandeep Maheswaram
Add QMP V3 USB3 PHY entries for SC7180 in phy driver and device tree bindings.
changes in v2:
*Remove global phy reset in QMP phy.
*Convert QMP phy bindings to yaml.Sandeep Maheswaram (3):
phy: qcom-qmp: Add QMP V3 USB3 PHY support for SC7180
arm64: dts: qcom: sc7180: Remove global phy reset in QMP phy
dt-bindings: phy: qcom,qmp: Convert QMP phy bindings to yaml.../devicetree/bindings/phy/qcom,qmp-phy.yaml | 201 ++++++++++++++++++ .../devicetree/bindings/phy/qcom-qmp-phy.txt | 227 --------------------- arch/arm64/boot/dts/qcom/sc7180.dtsi | 5 +- drivers/phy/qualcomm/phy-qcom-qmp.c | 38 ++++ 4 files changed, 241 insertions(+), 230 deletions(-) create mode 100644 Documentation/devicetree/bindings/phy/qcom,qmp-phy.yaml delete mode 100644 Documentation/devicetree/bindings/phy/qcom-qmp-phy.txtSignature · 2 lines
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation