130638230SJohan Hovold# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
230638230SJohan Hovold%YAML 1.2
330638230SJohan Hovold---
430638230SJohan Hovold$id: http://devicetree.org/schemas/phy/qcom,sc8280xp-qmp-pcie-phy.yaml#
530638230SJohan Hovold$schema: http://devicetree.org/meta-schemas/core.yaml#
630638230SJohan Hovold
730638230SJohan Hovoldtitle: Qualcomm QMP PHY controller (PCIe, SC8280XP)
830638230SJohan Hovold
930638230SJohan Hovoldmaintainers:
1030638230SJohan Hovold  - Vinod Koul <vkoul@kernel.org>
1130638230SJohan Hovold
1230638230SJohan Hovolddescription:
1330638230SJohan Hovold  The QMP PHY controller supports physical layer functionality for a number of
1430638230SJohan Hovold  controllers on Qualcomm chipsets, such as, PCIe, UFS, and USB.
1530638230SJohan Hovold
1630638230SJohan Hovoldproperties:
1730638230SJohan Hovold  compatible:
1830638230SJohan Hovold    enum:
19*fd2d4e4cSMrinmay Sarkar      - qcom,sa8775p-qmp-gen4x2-pcie-phy
20*fd2d4e4cSMrinmay Sarkar      - qcom,sa8775p-qmp-gen4x4-pcie-phy
2130638230SJohan Hovold      - qcom,sc8280xp-qmp-gen3x1-pcie-phy
2230638230SJohan Hovold      - qcom,sc8280xp-qmp-gen3x2-pcie-phy
2330638230SJohan Hovold      - qcom,sc8280xp-qmp-gen3x4-pcie-phy
240d678713SRohit Agarwal      - qcom,sdx65-qmp-gen4x2-pcie-phy
2543a6a29bSDmitry Baryshkov      - qcom,sm8350-qmp-gen3x1-pcie-phy
26496d068eSAbel Vesa      - qcom,sm8550-qmp-gen3x2-pcie-phy
27496d068eSAbel Vesa      - qcom,sm8550-qmp-gen4x2-pcie-phy
2830638230SJohan Hovold
2930638230SJohan Hovold  reg:
3030638230SJohan Hovold    minItems: 1
3130638230SJohan Hovold    maxItems: 2
3230638230SJohan Hovold
3330638230SJohan Hovold  clocks:
3443a6a29bSDmitry Baryshkov    minItems: 5
35*fd2d4e4cSMrinmay Sarkar    maxItems: 7
3630638230SJohan Hovold
3730638230SJohan Hovold  clock-names:
3843a6a29bSDmitry Baryshkov    minItems: 5
3930638230SJohan Hovold    items:
4030638230SJohan Hovold      - const: aux
4130638230SJohan Hovold      - const: cfg_ahb
4230638230SJohan Hovold      - const: ref
4330638230SJohan Hovold      - const: rchng
4430638230SJohan Hovold      - const: pipe
4530638230SJohan Hovold      - const: pipediv2
46*fd2d4e4cSMrinmay Sarkar      - const: phy_aux
4730638230SJohan Hovold
4830638230SJohan Hovold  power-domains:
4930638230SJohan Hovold    maxItems: 1
5030638230SJohan Hovold
5130638230SJohan Hovold  resets:
52496d068eSAbel Vesa    minItems: 1
53496d068eSAbel Vesa    maxItems: 2
5430638230SJohan Hovold
5530638230SJohan Hovold  reset-names:
56496d068eSAbel Vesa    minItems: 1
5730638230SJohan Hovold    items:
5830638230SJohan Hovold      - const: phy
59496d068eSAbel Vesa      - const: phy_nocsr
6030638230SJohan Hovold
6130638230SJohan Hovold  vdda-phy-supply: true
6230638230SJohan Hovold
6330638230SJohan Hovold  vdda-pll-supply: true
6430638230SJohan Hovold
65496d068eSAbel Vesa  vdda-qref-supply: true
66496d068eSAbel Vesa
6730638230SJohan Hovold  qcom,4ln-config-sel:
6830638230SJohan Hovold    description: PCIe 4-lane configuration
6930638230SJohan Hovold    $ref: /schemas/types.yaml#/definitions/phandle-array
7030638230SJohan Hovold    items:
7130638230SJohan Hovold      - items:
7230638230SJohan Hovold          - description: phandle of TCSR syscon
7330638230SJohan Hovold          - description: offset of PCIe 4-lane configuration register
7430638230SJohan Hovold          - description: offset of configuration bit for this PHY
7530638230SJohan Hovold
7630638230SJohan Hovold  "#clock-cells":
7730638230SJohan Hovold    const: 0
7830638230SJohan Hovold
7930638230SJohan Hovold  clock-output-names:
8030638230SJohan Hovold    maxItems: 1
8130638230SJohan Hovold
8230638230SJohan Hovold  "#phy-cells":
8330638230SJohan Hovold    const: 0
8430638230SJohan Hovold
8530638230SJohan Hovoldrequired:
8630638230SJohan Hovold  - compatible
8730638230SJohan Hovold  - reg
8830638230SJohan Hovold  - clocks
8930638230SJohan Hovold  - clock-names
9030638230SJohan Hovold  - power-domains
9130638230SJohan Hovold  - resets
9230638230SJohan Hovold  - reset-names
9330638230SJohan Hovold  - vdda-phy-supply
9430638230SJohan Hovold  - vdda-pll-supply
9530638230SJohan Hovold  - "#clock-cells"
9630638230SJohan Hovold  - clock-output-names
9730638230SJohan Hovold  - "#phy-cells"
9830638230SJohan Hovold
9930638230SJohan HovoldadditionalProperties: false
10030638230SJohan Hovold
10130638230SJohan HovoldallOf:
10230638230SJohan Hovold  - if:
10330638230SJohan Hovold      properties:
10430638230SJohan Hovold        compatible:
10530638230SJohan Hovold          contains:
10630638230SJohan Hovold            enum:
10730638230SJohan Hovold              - qcom,sc8280xp-qmp-gen3x4-pcie-phy
10830638230SJohan Hovold    then:
10930638230SJohan Hovold      properties:
11030638230SJohan Hovold        reg:
11130638230SJohan Hovold          items:
11230638230SJohan Hovold            - description: port a
11330638230SJohan Hovold            - description: port b
11430638230SJohan Hovold      required:
11530638230SJohan Hovold        - qcom,4ln-config-sel
11630638230SJohan Hovold    else:
11730638230SJohan Hovold      properties:
11830638230SJohan Hovold        reg:
11930638230SJohan Hovold          maxItems: 1
12030638230SJohan Hovold
12143a6a29bSDmitry Baryshkov  - if:
12243a6a29bSDmitry Baryshkov      properties:
12343a6a29bSDmitry Baryshkov        compatible:
12443a6a29bSDmitry Baryshkov          contains:
12543a6a29bSDmitry Baryshkov            enum:
12643a6a29bSDmitry Baryshkov              - qcom,sm8350-qmp-gen3x1-pcie-phy
127496d068eSAbel Vesa              - qcom,sm8550-qmp-gen3x2-pcie-phy
128496d068eSAbel Vesa              - qcom,sm8550-qmp-gen4x2-pcie-phy
12943a6a29bSDmitry Baryshkov    then:
13043a6a29bSDmitry Baryshkov      properties:
13143a6a29bSDmitry Baryshkov        clocks:
13243a6a29bSDmitry Baryshkov          maxItems: 5
13343a6a29bSDmitry Baryshkov        clock-names:
13443a6a29bSDmitry Baryshkov          maxItems: 5
13543a6a29bSDmitry Baryshkov    else:
13643a6a29bSDmitry Baryshkov      properties:
13743a6a29bSDmitry Baryshkov        clocks:
13843a6a29bSDmitry Baryshkov          minItems: 6
13943a6a29bSDmitry Baryshkov        clock-names:
14043a6a29bSDmitry Baryshkov          minItems: 6
14143a6a29bSDmitry Baryshkov
142496d068eSAbel Vesa  - if:
143496d068eSAbel Vesa      properties:
144496d068eSAbel Vesa        compatible:
145496d068eSAbel Vesa          contains:
146496d068eSAbel Vesa            enum:
147*fd2d4e4cSMrinmay Sarkar              - qcom,sa8775p-qmp-gen4x2-pcie-phy
148*fd2d4e4cSMrinmay Sarkar              - qcom,sa8775p-qmp-gen4x4-pcie-phy
149*fd2d4e4cSMrinmay Sarkar    then:
150*fd2d4e4cSMrinmay Sarkar      properties:
151*fd2d4e4cSMrinmay Sarkar        clocks:
152*fd2d4e4cSMrinmay Sarkar          minItems: 7
153*fd2d4e4cSMrinmay Sarkar        clock-names:
154*fd2d4e4cSMrinmay Sarkar          minItems: 7
155*fd2d4e4cSMrinmay Sarkar
156*fd2d4e4cSMrinmay Sarkar  - if:
157*fd2d4e4cSMrinmay Sarkar      properties:
158*fd2d4e4cSMrinmay Sarkar        compatible:
159*fd2d4e4cSMrinmay Sarkar          contains:
160*fd2d4e4cSMrinmay Sarkar            enum:
161496d068eSAbel Vesa              - qcom,sm8550-qmp-gen4x2-pcie-phy
162496d068eSAbel Vesa    then:
163496d068eSAbel Vesa      properties:
164496d068eSAbel Vesa        resets:
165496d068eSAbel Vesa          minItems: 2
166496d068eSAbel Vesa        reset-names:
167496d068eSAbel Vesa          minItems: 2
168496d068eSAbel Vesa    else:
169496d068eSAbel Vesa      properties:
170496d068eSAbel Vesa        resets:
171496d068eSAbel Vesa          maxItems: 1
172496d068eSAbel Vesa        reset-names:
173496d068eSAbel Vesa          maxItems: 1
174496d068eSAbel Vesa
17530638230SJohan Hovoldexamples:
17630638230SJohan Hovold  - |
17730638230SJohan Hovold    #include <dt-bindings/clock/qcom,gcc-sc8280xp.h>
17830638230SJohan Hovold
17930638230SJohan Hovold    pcie2b_phy: phy@1c18000 {
18030638230SJohan Hovold      compatible = "qcom,sc8280xp-qmp-gen3x2-pcie-phy";
18130638230SJohan Hovold      reg = <0x01c18000 0x2000>;
18230638230SJohan Hovold
18330638230SJohan Hovold      clocks = <&gcc GCC_PCIE_2B_AUX_CLK>,
18430638230SJohan Hovold               <&gcc GCC_PCIE_2B_CFG_AHB_CLK>,
18530638230SJohan Hovold               <&gcc GCC_PCIE_2A2B_CLKREF_CLK>,
18630638230SJohan Hovold               <&gcc GCC_PCIE2B_PHY_RCHNG_CLK>,
18730638230SJohan Hovold               <&gcc GCC_PCIE_2B_PIPE_CLK>,
18830638230SJohan Hovold               <&gcc GCC_PCIE_2B_PIPEDIV2_CLK>;
18930638230SJohan Hovold      clock-names = "aux", "cfg_ahb", "ref", "rchng",
19030638230SJohan Hovold                    "pipe", "pipediv2";
19130638230SJohan Hovold
19230638230SJohan Hovold      power-domains = <&gcc PCIE_2B_GDSC>;
19330638230SJohan Hovold
19430638230SJohan Hovold      resets = <&gcc GCC_PCIE_2B_PHY_BCR>;
19530638230SJohan Hovold      reset-names = "phy";
19630638230SJohan Hovold
19730638230SJohan Hovold      vdda-phy-supply = <&vreg_l6d>;
19830638230SJohan Hovold      vdda-pll-supply = <&vreg_l4d>;
19930638230SJohan Hovold
20030638230SJohan Hovold      #clock-cells = <0>;
20130638230SJohan Hovold      clock-output-names = "pcie_2b_pipe_clk";
20230638230SJohan Hovold
20330638230SJohan Hovold      #phy-cells = <0>;
20430638230SJohan Hovold    };
20530638230SJohan Hovold
20630638230SJohan Hovold    pcie2a_phy: phy@1c24000 {
20730638230SJohan Hovold      compatible = "qcom,sc8280xp-qmp-gen3x4-pcie-phy";
20830638230SJohan Hovold      reg = <0x01c24000 0x2000>, <0x01c26000 0x2000>;
20930638230SJohan Hovold
21030638230SJohan Hovold      clocks = <&gcc GCC_PCIE_2A_AUX_CLK>,
21130638230SJohan Hovold               <&gcc GCC_PCIE_2A_CFG_AHB_CLK>,
21230638230SJohan Hovold               <&gcc GCC_PCIE_2A2B_CLKREF_CLK>,
21330638230SJohan Hovold               <&gcc GCC_PCIE2A_PHY_RCHNG_CLK>,
21430638230SJohan Hovold               <&gcc GCC_PCIE_2A_PIPE_CLK>,
21530638230SJohan Hovold               <&gcc GCC_PCIE_2A_PIPEDIV2_CLK>;
21630638230SJohan Hovold      clock-names = "aux", "cfg_ahb", "ref", "rchng",
21730638230SJohan Hovold                    "pipe", "pipediv2";
21830638230SJohan Hovold
21930638230SJohan Hovold      power-domains = <&gcc PCIE_2A_GDSC>;
22030638230SJohan Hovold
22130638230SJohan Hovold      resets = <&gcc GCC_PCIE_2A_PHY_BCR>;
22230638230SJohan Hovold      reset-names = "phy";
22330638230SJohan Hovold
22430638230SJohan Hovold      vdda-phy-supply = <&vreg_l6d>;
22530638230SJohan Hovold      vdda-pll-supply = <&vreg_l4d>;
22630638230SJohan Hovold
22730638230SJohan Hovold      qcom,4ln-config-sel = <&tcsr 0xa044 0>;
22830638230SJohan Hovold
22930638230SJohan Hovold      #clock-cells = <0>;
23030638230SJohan Hovold      clock-output-names = "pcie_2a_pipe_clk";
23130638230SJohan Hovold
23230638230SJohan Hovold      #phy-cells = <0>;
23330638230SJohan Hovold    };
234