1 From 9e76817056937645205f23ee91e762d5cff5e848 Mon Sep 17 00:00:00 2001
2 From: Luo Jie <quic_luoj@quicinc.com>
3 Date: Mon, 29 Jan 2024 17:57:20 +0800
4 Subject: [PATCH 01/50] dt-bindings: net: Document Qualcomm QCA8084 PHY package
6 QCA8084 is quad PHY chip, which integrates 4 PHYs, 2 PCS
7 interfaces (PCS0 and PCS1) and clock controller, which can
8 also be integrated to the switch chip named as QCA8386.
10 1. MDIO address of 4 PHYs, 2 PCS and 1 XPCS (PCS1 includes
11 PCS and XPCS, PCS0 includes PCS) can be configured.
12 2. The package mode of PHY is optionally configured for the
13 interface mode of two PCSes working correctly.
14 3. The package level clock and reset need to be initialized.
15 4. The clock and reset per PHY device need to be initialized
16 so that the PHY register can be accessed.
18 Change-Id: Idb2338d2673152cbd3c57e95968faa59e9d4a80f
19 Signed-off-by: Luo Jie <quic_luoj@quicinc.com>
21 .../devicetree/bindings/net/qcom,qca8084.yaml | 198 ++++++++++++++++++
22 include/dt-bindings/net/qcom,qca808x.h | 14 ++
23 2 files changed, 212 insertions(+)
24 create mode 100644 Documentation/devicetree/bindings/net/qcom,qca8084.yaml
25 create mode 100644 include/dt-bindings/net/qcom,qca808x.h
27 diff --git a/Documentation/devicetree/bindings/net/qcom,qca8084.yaml b/Documentation/devicetree/bindings/net/qcom,qca8084.yaml
29 index 000000000000..efa1fa4ebfdc
31 +++ b/Documentation/devicetree/bindings/net/qcom,qca8084.yaml
33 +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
36 +$id: http://devicetree.org/schemas/net/qcom,qca8084.yaml#
37 +$schema: http://devicetree.org/meta-schemas/core.yaml#
39 +title: Qualcomm QCA8084 Ethernet Quad PHY
42 + - Luo Jie <quic_luoj@quicinc.com>
45 + Qualcomm QCA8084 is a four-port Ethernet transceiver, the
46 + Ethernet port supports link speed 10/100/1000/2500 Mbps.
47 + There are two PCSes (PCS0 and PCS1) integrated in the PHY
48 + package, PCS1 includes XPCS and PCS to support the interface
49 + mode 10G-QXGMII and SGMII, PCS0 includes a PCS to support the
50 + interface mode SGMII only. There is also a clock controller
51 + integrated in the PHY package. This four-port Ethernet
52 + transceiver can also be integrated to the switch chip named
53 + as QCA8386. The PHY package mode needs to be configured as the
54 + correct value to apply the interface mode of two PCSes as
57 + QCA8084 expects an input reference clock 50 MHZ as the clock
58 + source of the integrated clock controller, the integrated
59 + clock controller supplies the clocks and resets to the
60 + integrated PHY, PCS and PHY package.
63 + +--| |--+-------------------+--| |--+
64 + | PCS1 |<------------+---->| PCS0 |
65 + +-------+ | +-------+
67 + Ref 50M clk +--------+ | |
68 + ------------>| | clk & rst | |
69 + GPIO Reset |QCA8K_CC+------------+ |
70 + ------------>| | | |
73 + +--------+--------+--------+--------+
74 + | PHY0 | PHY1 | PHY2 | PHY3 |
75 + +--------+--------+--------+--------+
77 +$ref: ethernet-phy-package.yaml#
81 + const: qcom,qca8084-package
84 + description: PHY package level initial common clocks, which are
85 + needed to be enabled after GPIO reset on the PHY package, these
86 + clocks are supplied from the PHY integrated clock controller
89 + - description: APB bridge clock
90 + - description: AHB clock
91 + - description: Security control clock
92 + - description: TLMM clock
93 + - description: TLMM AHB clock
94 + - description: CNOC AHB clock
95 + - description: MDIO AHB clock
101 + - const: sec_ctrl_ahb
108 + description: PHY package level initial common reset, which are
109 + needed to be deasserted after GPIO reset on the PHY package,
110 + this reset is provided by the PHY integrated clock controller
111 + to do PHY DSP reset.
116 + The package mode of PHY supports to be configured as 3 modes
117 + to apply the combinations of interface mode of two PCSes
118 + correctly. This value should use one of the values defined in
119 + dt-bindings/net/qcom,qca808x.h. The package mode 10G-QXGMII of
120 + Quad PHY is used by default.
122 + package mode PCS1 PCS0
123 + phy mode (0) 10G-QXGMII for not used
126 + switch mode (1) SGMII for SGMII for
127 + switch MAC0 switch MAC5 (optional)
129 + switch bypass MAC5 (2) SGMII for SGMII for
131 + $ref: /schemas/types.yaml#/definitions/uint32
135 + qcom,phy-addr-fixup:
136 + description: MDIO address for PHY0-PHY3, PCS0 and PCS1 including
137 + PCS and XPCS, which can be optionally customized by programming
138 + the security control register of PHY package. The hardware default
139 + MDIO address of PHY0-PHY3, PCS0 and PCS1 including PCS and XPCS is
141 + $ref: /schemas/types.yaml#/definitions/uint32-array
146 + ^ethernet-phy(@[a-f0-9]+)?$:
147 + $ref: ethernet-phy.yaml#
151 + const: ethernet-phy-id004d.d180
159 + unevaluatedProperties: false
167 +unevaluatedProperties: false
171 + #include <dt-bindings/clock/qcom,qca8k-nsscc.h>
172 + #include <dt-bindings/net/qcom,qca808x.h>
173 + #include <dt-bindings/reset/qcom,qca8k-nsscc.h>
176 + #address-cells = <1>;
179 + ethernet-phy-package@1 {
180 + #address-cells = <1>;
182 + compatible = "qcom,qca8084-package";
184 + clocks = <&qca8k_nsscc NSS_CC_APB_BRIDGE_CLK>,
185 + <&qca8k_nsscc NSS_CC_AHB_CLK>,
186 + <&qca8k_nsscc NSS_CC_SEC_CTRL_AHB_CLK>,
187 + <&qca8k_nsscc NSS_CC_TLMM_CLK>,
188 + <&qca8k_nsscc NSS_CC_TLMM_AHB_CLK>,
189 + <&qca8k_nsscc NSS_CC_CNOC_AHB_CLK>,
190 + <&qca8k_nsscc NSS_CC_MDIO_AHB_CLK>;
191 + clock-names = "apb_bridge",
198 + resets = <&qca8k_nsscc NSS_CC_GEPHY_FULL_ARES>;
199 + qcom,package-mode = <QCA808X_PCS1_SGMII_MAC_PCS0_SGMII_MAC>;
200 + qcom,phy-addr-fixup = <1 2 3 4 5 6 7>;
203 + compatible = "ethernet-phy-id004d.d180";
205 + clocks = <&qca8k_nsscc NSS_CC_GEPHY0_SYS_CLK>;
206 + resets = <&qca8k_nsscc NSS_CC_GEPHY0_SYS_ARES>;
210 + compatible = "ethernet-phy-id004d.d180";
212 + clocks = <&qca8k_nsscc NSS_CC_GEPHY1_SYS_CLK>;
213 + resets = <&qca8k_nsscc NSS_CC_GEPHY1_SYS_ARES>;
217 + compatible = "ethernet-phy-id004d.d180";
219 + clocks = <&qca8k_nsscc NSS_CC_GEPHY2_SYS_CLK>;
220 + resets = <&qca8k_nsscc NSS_CC_GEPHY2_SYS_ARES>;
224 + compatible = "ethernet-phy-id004d.d180";
226 + clocks = <&qca8k_nsscc NSS_CC_GEPHY3_SYS_CLK>;
227 + resets = <&qca8k_nsscc NSS_CC_GEPHY3_SYS_ARES>;
231 diff --git a/include/dt-bindings/net/qcom,qca808x.h b/include/dt-bindings/net/qcom,qca808x.h
233 index 000000000000..c3a2830445ea
235 +++ b/include/dt-bindings/net/qcom,qca808x.h
237 +/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
239 + * Device Tree constants for the Qualcomm QCA808X PHYs
242 +#ifndef _DT_BINDINGS_QCOM_QCA808X_H
243 +#define _DT_BINDINGS_QCOM_QCA808X_H
245 +/* PHY package modes of QCA8084 to apply the interface modes of two PCSes. */
246 +#define QCA808X_PCS1_10G_QXGMII_PCS0_UNUNSED 0
247 +#define QCA808X_PCS1_SGMII_MAC_PCS0_SGMII_MAC 1
248 +#define QCA808X_PCS1_SGMII_MAC_PCS0_SGMII_PHY 2