1 From d291fbb8245d5ba04979fed85575860a5cea7196 Mon Sep 17 00:00:00 2001
2 From: Matthew Hagan <mnhagan88@gmail.com>
3 Date: Thu, 14 Oct 2021 00:39:21 +0200
4 Subject: dt-bindings: net: dsa: qca8k: convert to YAML schema
6 Convert the qca8k bindings to YAML format.
8 Signed-off-by: Matthew Hagan <mnhagan88@gmail.com>
9 Co-developed-by: Ansuel Smith <ansuelsmth@gmail.com>
10 Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
11 Signed-off-by: David S. Miller <davem@davemloft.net>
13 .../devicetree/bindings/net/dsa/qca8k.txt | 245 --------------
14 .../devicetree/bindings/net/dsa/qca8k.yaml | 362 +++++++++++++++++++++
15 2 files changed, 362 insertions(+), 245 deletions(-)
16 delete mode 100644 Documentation/devicetree/bindings/net/dsa/qca8k.txt
17 create mode 100644 Documentation/devicetree/bindings/net/dsa/qca8k.yaml
19 --- a/Documentation/devicetree/bindings/net/dsa/qca8k.txt
22 -* Qualcomm Atheros QCA8xxx switch family
26 -- compatible: should be one of:
27 - "qca,qca8328": referenced as AR8328(N)-AK1(A/B) QFN 176 pin package
28 - "qca,qca8327": referenced as AR8327(N)-AL1A DR-QFN 148 pin package
29 - "qca,qca8334": referenced as QCA8334-AL3C QFN 88 pin package
30 - "qca,qca8337": referenced as QCA8337N-AL3(B/C) DR-QFN 148 pin package
32 -- #size-cells: must be 0
33 -- #address-cells: must be 1
37 -- reset-gpios: GPIO to be used to reset the whole device
38 -- qca,ignore-power-on-sel: Ignore power on pin strapping to configure led open
39 - drain or eeprom presence. This is needed for broken
40 - devices that have wrong configuration or when the oem
41 - decided to not use pin strapping and fallback to sw
43 -- qca,led-open-drain: Set leds to open-drain mode. This requires the
44 - qca,ignore-power-on-sel to be set or the driver will fail
45 - to probe. This is needed if the oem doesn't use pin
46 - strapping to set this mode and prefers to set it using sw
47 - regs. The pin strapping related to led open drain mode is
48 - the pin B68 for QCA832x and B49 for QCA833x
52 -The integrated switch subnode should be specified according to the binding
53 -described in dsa/dsa.txt. If the QCA8K switch is connect to a SoC's external
54 -mdio-bus each subnode describing a port needs to have a valid phandle
55 -referencing the internal PHY it is connected to. This is because there's no
56 -N:N mapping of port and PHY id.
57 -To declare the internal mdio-bus configuration, declare a mdio node in the
58 -switch node and declare the phandle for the port referencing the internal
59 -PHY is connected to. In this config a internal mdio-bus is registered and
60 -the mdio MASTER is used as communication.
62 -Don't use mixed external and internal mdio-bus configurations, as this is
63 -not supported by the hardware.
65 -This switch support 2 CPU port. Normally and advised configuration is with
66 -CPU port set to port 0. It is also possible to set the CPU port to port 6
67 -if the device requires it. The driver will configure the switch to the defined
68 -port. With both CPU port declared the first CPU port is selected as primary
69 -and the secondary CPU ignored.
71 -A CPU port node has the following optional node:
73 -- fixed-link : Fixed-link subnode describing a link to a non-MDIO
75 - Documentation/devicetree/bindings/net/fixed-link.txt
77 -- qca,sgmii-rxclk-falling-edge: Set the receive clock phase to falling edge.
78 - Mostly used in qca8327 with CPU port 0 set to
80 -- qca,sgmii-txclk-falling-edge: Set the transmit clock phase to falling edge.
81 -- qca,sgmii-enable-pll : For SGMII CPU port, explicitly enable PLL, TX and RX
82 - chain along with Signal Detection.
83 - This should NOT be enabled for qca8327. If enabled with
84 - qca8327 the sgmii port won't correctly init and an err
86 - This can be required for qca8337 switch with revision 2.
87 - A warning is displayed when used with revision greater
89 - With CPU port set to sgmii and qca8337 it is advised
90 - to set this unless a communication problem is observed.
92 -For QCA8K the 'fixed-link' sub-node supports only the following properties:
94 -- 'speed' (integer, mandatory), to indicate the link speed. Accepted
95 - values are 10, 100 and 1000
96 -- 'full-duplex' (boolean, optional), to indicate that full duplex is
97 - used. When absent, half duplex is assumed.
101 -for the external mdio-bus configuration:
125 - compatible = "qca,qca8337";
126 - #address-cells = <1>;
129 - reset-gpios = <&gpio 42 GPIO_ACTIVE_LOW>;
133 - #address-cells = <1>;
138 - ethernet = <&gmac1>;
139 - phy-mode = "rgmii";
149 - phy-handle = <&phy_port1>;
155 - phy-handle = <&phy_port2>;
161 - phy-handle = <&phy_port3>;
167 - phy-handle = <&phy_port4>;
173 - phy-handle = <&phy_port5>;
179 -for the internal master mdio-bus configuration:
183 - compatible = "qca,qca8337";
184 - #address-cells = <1>;
187 - reset-gpios = <&gpio 42 GPIO_ACTIVE_LOW>;
191 - #address-cells = <1>;
197 - ethernet = <&gmac1>;
198 - phy-mode = "rgmii";
208 - phy-mode = "internal";
209 - phy-handle = <&phy_port1>;
215 - phy-mode = "internal";
216 - phy-handle = <&phy_port2>;
222 - phy-mode = "internal";
223 - phy-handle = <&phy_port3>;
229 - phy-mode = "internal";
230 - phy-handle = <&phy_port4>;
236 - phy-mode = "internal";
237 - phy-handle = <&phy_port5>;
242 - #address-cells = <1>;
268 +++ b/Documentation/devicetree/bindings/net/dsa/qca8k.yaml
270 +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
273 +$id: http://devicetree.org/schemas/net/dsa/qca8k.yaml#
274 +$schema: http://devicetree.org/meta-schemas/core.yaml#
276 +title: Qualcomm Atheros QCA83xx switch family
279 + - John Crispin <john@phrozen.org>
282 + If the QCA8K switch is connect to an SoC's external mdio-bus, each subnode
283 + describing a port needs to have a valid phandle referencing the internal PHY
284 + it is connected to. This is because there is no N:N mapping of port and PHY
285 + ID. To declare the internal mdio-bus configuration, declare an MDIO node in
286 + the switch node and declare the phandle for the port, referencing the internal
287 + PHY it is connected to. In this config, an internal mdio-bus is registered and
288 + the MDIO master is used for communication. Mixed external and internal
289 + mdio-bus configurations are not supported by the hardware.
300 + qca,qca8328: referenced as AR8328(N)-AK1(A/B) QFN 176 pin package
301 + qca,qca8327: referenced as AR8327(N)-AL1A DR-QFN 148 pin package
302 + qca,qca8334: referenced as QCA8334-AL3C QFN 88 pin package
303 + qca,qca8337: referenced as QCA8337N-AL3(B/C) DR-QFN 148 pin package
310 + GPIO to be used to reset the whole device
313 + qca,ignore-power-on-sel:
314 + $ref: /schemas/types.yaml#/definitions/flag
316 + Ignore power-on pin strapping to configure LED open-drain or EEPROM
317 + presence. This is needed for devices with incorrect configuration or when
318 + the OEM has decided not to use pin strapping and falls back to SW regs.
320 + qca,led-open-drain:
321 + $ref: /schemas/types.yaml#/definitions/flag
323 + Set LEDs to open-drain mode. This requires the qca,ignore-power-on-sel to
324 + be set, otherwise the driver will fail at probe. This is required if the
325 + OEM does not use pin strapping to set this mode and prefers to set it
326 + using SW regs. The pin strappings related to LED open-drain mode are
327 + B68 on the QCA832x and B49 on the QCA833x.
331 + description: Qca8k switch have an internal mdio to access switch port.
332 + If this is not present, the legacy mapping is used and the
333 + internal mdio access is used.
334 + With the legacy mapping the reg corresponding to the internal
335 + mdio is the switch reg with an offset of -1.
344 + "^(ethernet-)?phy@[0-4]$":
348 + - $ref: "http://devicetree.org/schemas/net/mdio.yaml#"
358 + "^(ethernet-)?ports$":
367 + "^(ethernet-)?port@[0-6]$":
369 + description: Ethernet switch ports
373 + description: Port number
377 + Describes the label associated with this port, which will become
379 + $ref: /schemas/types.yaml#/definitions/string
383 + Should be a list of phandles to other switch's DSA port. This
384 + port is used as the outgoing port towards the phandle ports. The
385 + full routing information must be given, not just the one hop
386 + routes to neighbouring switches
387 + $ref: /schemas/types.yaml#/definitions/phandle-array
391 + Should be a phandle to a valid Ethernet device node. This host
392 + device is what the switch port is connected to
393 + $ref: /schemas/types.yaml#/definitions/phandle
405 + qca,sgmii-rxclk-falling-edge:
406 + $ref: /schemas/types.yaml#/definitions/flag
408 + Set the receive clock phase to falling edge. Mostly commonly used on
409 + the QCA8327 with CPU port 0 set to SGMII.
411 + qca,sgmii-txclk-falling-edge:
412 + $ref: /schemas/types.yaml#/definitions/flag
414 + Set the transmit clock phase to falling edge.
416 + qca,sgmii-enable-pll:
417 + $ref: /schemas/types.yaml#/definitions/flag
419 + For SGMII CPU port, explicitly enable PLL, TX and RX chain along with
420 + Signal Detection. On the QCA8327 this should not be enabled, otherwise
421 + the SGMII port will not initialize. When used on the QCA8337, revision 3
422 + or greater, a warning will be displayed. When the CPU port is set to
423 + SGMII on the QCA8337, it is advised to set this unless a communication
429 + additionalProperties: false
441 +additionalProperties: true
445 + #include <dt-bindings/gpio/gpio.h>
448 + #address-cells = <1>;
451 + external_phy_port1: ethernet-phy@0 {
455 + external_phy_port2: ethernet-phy@1 {
459 + external_phy_port3: ethernet-phy@2 {
463 + external_phy_port4: ethernet-phy@3 {
467 + external_phy_port5: ethernet-phy@4 {
472 + compatible = "qca,qca8337";
473 + #address-cells = <1>;
475 + reset-gpios = <&gpio 42 GPIO_ACTIVE_LOW>;
479 + #address-cells = <1>;
485 + ethernet = <&gmac1>;
486 + phy-mode = "rgmii";
497 + phy-handle = <&external_phy_port1>;
503 + phy-handle = <&external_phy_port2>;
509 + phy-handle = <&external_phy_port3>;
515 + phy-handle = <&external_phy_port4>;
521 + phy-handle = <&external_phy_port5>;
527 + #include <dt-bindings/gpio/gpio.h>
530 + #address-cells = <1>;
534 + compatible = "qca,qca8337";
535 + #address-cells = <1>;
537 + reset-gpios = <&gpio 42 GPIO_ACTIVE_LOW>;
541 + #address-cells = <1>;
547 + ethernet = <&gmac1>;
548 + phy-mode = "rgmii";
559 + phy-mode = "internal";
560 + phy-handle = <&internal_phy_port1>;
566 + phy-mode = "internal";
567 + phy-handle = <&internal_phy_port2>;
573 + phy-mode = "internal";
574 + phy-handle = <&internal_phy_port3>;
580 + phy-mode = "internal";
581 + phy-handle = <&internal_phy_port4>;
587 + phy-mode = "internal";
588 + phy-handle = <&internal_phy_port5>;
594 + ethernet = <&gmac1>;
595 + phy-mode = "sgmii";
597 + qca,sgmii-rxclk-falling-edge;
607 + #address-cells = <1>;
610 + internal_phy_port1: ethernet-phy@0 {
614 + internal_phy_port2: ethernet-phy@1 {
618 + internal_phy_port3: ethernet-phy@2 {
622 + internal_phy_port4: ethernet-phy@3 {
626 + internal_phy_port5: ethernet-phy@4 {