xref: /freebsd-src/sys/contrib/device-tree/Bindings/net/dsa/qca8k.yaml (revision cb7aa33ac6cd46a5434798e50363136e64f3ae98)
18cc087a1SEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
28cc087a1SEmmanuel Vadot%YAML 1.2
38cc087a1SEmmanuel Vadot---
48cc087a1SEmmanuel Vadot$id: http://devicetree.org/schemas/net/dsa/qca8k.yaml#
58cc087a1SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
68cc087a1SEmmanuel Vadot
78cc087a1SEmmanuel Vadottitle: Qualcomm Atheros QCA83xx switch family
88cc087a1SEmmanuel Vadot
98cc087a1SEmmanuel Vadotmaintainers:
108cc087a1SEmmanuel Vadot  - John Crispin <john@phrozen.org>
118cc087a1SEmmanuel Vadot
128cc087a1SEmmanuel Vadotdescription:
138cc087a1SEmmanuel Vadot  If the QCA8K switch is connect to an SoC's external mdio-bus, each subnode
148cc087a1SEmmanuel Vadot  describing a port needs to have a valid phandle referencing the internal PHY
158cc087a1SEmmanuel Vadot  it is connected to. This is because there is no N:N mapping of port and PHY
168cc087a1SEmmanuel Vadot  ID. To declare the internal mdio-bus configuration, declare an MDIO node in
178cc087a1SEmmanuel Vadot  the switch node and declare the phandle for the port, referencing the internal
188cc087a1SEmmanuel Vadot  PHY it is connected to. In this config, an internal mdio-bus is registered and
198cc087a1SEmmanuel Vadot  the MDIO master is used for communication. Mixed external and internal
208cc087a1SEmmanuel Vadot  mdio-bus configurations are not supported by the hardware.
218cc087a1SEmmanuel Vadot
228cc087a1SEmmanuel Vadotproperties:
238cc087a1SEmmanuel Vadot  compatible:
248cc087a1SEmmanuel Vadot    oneOf:
258cc087a1SEmmanuel Vadot      - enum:
268cc087a1SEmmanuel Vadot          - qca,qca8327
278cc087a1SEmmanuel Vadot          - qca,qca8328
288cc087a1SEmmanuel Vadot          - qca,qca8334
298cc087a1SEmmanuel Vadot          - qca,qca8337
308cc087a1SEmmanuel Vadot    description: |
318cc087a1SEmmanuel Vadot      qca,qca8328: referenced as AR8328(N)-AK1(A/B) QFN 176 pin package
328cc087a1SEmmanuel Vadot      qca,qca8327: referenced as AR8327(N)-AL1A DR-QFN 148 pin package
338cc087a1SEmmanuel Vadot      qca,qca8334: referenced as QCA8334-AL3C QFN 88 pin package
348cc087a1SEmmanuel Vadot      qca,qca8337: referenced as QCA8337N-AL3(B/C) DR-QFN 148 pin package
358cc087a1SEmmanuel Vadot
368cc087a1SEmmanuel Vadot  reg:
378cc087a1SEmmanuel Vadot    maxItems: 1
388cc087a1SEmmanuel Vadot
398cc087a1SEmmanuel Vadot  reset-gpios:
408cc087a1SEmmanuel Vadot    description:
418cc087a1SEmmanuel Vadot      GPIO to be used to reset the whole device
428cc087a1SEmmanuel Vadot    maxItems: 1
438cc087a1SEmmanuel Vadot
448cc087a1SEmmanuel Vadot  qca,ignore-power-on-sel:
458cc087a1SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/flag
468cc087a1SEmmanuel Vadot    description:
478cc087a1SEmmanuel Vadot      Ignore power-on pin strapping to configure LED open-drain or EEPROM
488cc087a1SEmmanuel Vadot      presence. This is needed for devices with incorrect configuration or when
498cc087a1SEmmanuel Vadot      the OEM has decided not to use pin strapping and falls back to SW regs.
508cc087a1SEmmanuel Vadot
518cc087a1SEmmanuel Vadot  qca,led-open-drain:
528cc087a1SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/flag
538cc087a1SEmmanuel Vadot    description:
548cc087a1SEmmanuel Vadot      Set LEDs to open-drain mode. This requires the qca,ignore-power-on-sel to
558cc087a1SEmmanuel Vadot      be set, otherwise the driver will fail at probe. This is required if the
568cc087a1SEmmanuel Vadot      OEM does not use pin strapping to set this mode and prefers to set it
578cc087a1SEmmanuel Vadot      using SW regs. The pin strappings related to LED open-drain mode are
588cc087a1SEmmanuel Vadot      B68 on the QCA832x and B49 on the QCA833x.
598cc087a1SEmmanuel Vadot
608cc087a1SEmmanuel Vadot  mdio:
61e67e8565SEmmanuel Vadot    $ref: /schemas/net/mdio.yaml#
62e67e8565SEmmanuel Vadot    unevaluatedProperties: false
638cc087a1SEmmanuel Vadot    description: Qca8k switch have an internal mdio to access switch port.
648cc087a1SEmmanuel Vadot                 If this is not present, the legacy mapping is used and the
658cc087a1SEmmanuel Vadot                 internal mdio access is used.
668cc087a1SEmmanuel Vadot                 With the legacy mapping the reg corresponding to the internal
678cc087a1SEmmanuel Vadot                 mdio is the switch reg with an offset of -1.
688cc087a1SEmmanuel Vadot
69*cb7aa33aSEmmanuel Vadot$ref: "dsa.yaml#"
70*cb7aa33aSEmmanuel Vadot
718cc087a1SEmmanuel VadotpatternProperties:
728cc087a1SEmmanuel Vadot  "^(ethernet-)?ports$":
738cc087a1SEmmanuel Vadot    type: object
748cc087a1SEmmanuel Vadot    patternProperties:
758cc087a1SEmmanuel Vadot      "^(ethernet-)?port@[0-6]$":
768cc087a1SEmmanuel Vadot        type: object
778cc087a1SEmmanuel Vadot        description: Ethernet switch ports
788cc087a1SEmmanuel Vadot
79e67e8565SEmmanuel Vadot        $ref: dsa-port.yaml#
80e67e8565SEmmanuel Vadot
818cc087a1SEmmanuel Vadot        properties:
828cc087a1SEmmanuel Vadot          qca,sgmii-rxclk-falling-edge:
838cc087a1SEmmanuel Vadot            $ref: /schemas/types.yaml#/definitions/flag
848cc087a1SEmmanuel Vadot            description:
858cc087a1SEmmanuel Vadot              Set the receive clock phase to falling edge. Mostly commonly used on
868cc087a1SEmmanuel Vadot              the QCA8327 with CPU port 0 set to SGMII.
878cc087a1SEmmanuel Vadot
888cc087a1SEmmanuel Vadot          qca,sgmii-txclk-falling-edge:
898cc087a1SEmmanuel Vadot            $ref: /schemas/types.yaml#/definitions/flag
908cc087a1SEmmanuel Vadot            description:
918cc087a1SEmmanuel Vadot              Set the transmit clock phase to falling edge.
928cc087a1SEmmanuel Vadot
938cc087a1SEmmanuel Vadot          qca,sgmii-enable-pll:
948cc087a1SEmmanuel Vadot            $ref: /schemas/types.yaml#/definitions/flag
958cc087a1SEmmanuel Vadot            description:
968cc087a1SEmmanuel Vadot              For SGMII CPU port, explicitly enable PLL, TX and RX chain along with
978cc087a1SEmmanuel Vadot              Signal Detection. On the QCA8327 this should not be enabled, otherwise
988cc087a1SEmmanuel Vadot              the SGMII port will not initialize. When used on the QCA8337, revision 3
998cc087a1SEmmanuel Vadot              or greater, a warning will be displayed. When the CPU port is set to
1008cc087a1SEmmanuel Vadot              SGMII on the QCA8337, it is advised to set this unless a communication
1018cc087a1SEmmanuel Vadot              issue is observed.
1028cc087a1SEmmanuel Vadot
103e67e8565SEmmanuel Vadot        unevaluatedProperties: false
1048cc087a1SEmmanuel Vadot
1058cc087a1SEmmanuel VadotoneOf:
1068cc087a1SEmmanuel Vadot  - required:
1078cc087a1SEmmanuel Vadot      - ports
1088cc087a1SEmmanuel Vadot  - required:
1098cc087a1SEmmanuel Vadot      - ethernet-ports
1108cc087a1SEmmanuel Vadot
1118cc087a1SEmmanuel Vadotrequired:
1128cc087a1SEmmanuel Vadot  - compatible
1138cc087a1SEmmanuel Vadot  - reg
1148cc087a1SEmmanuel Vadot
115*cb7aa33aSEmmanuel VadotunevaluatedProperties: false
1168cc087a1SEmmanuel Vadot
1178cc087a1SEmmanuel Vadotexamples:
1188cc087a1SEmmanuel Vadot  - |
1198cc087a1SEmmanuel Vadot    #include <dt-bindings/gpio/gpio.h>
1208cc087a1SEmmanuel Vadot
1218cc087a1SEmmanuel Vadot    mdio {
1228cc087a1SEmmanuel Vadot        #address-cells = <1>;
1238cc087a1SEmmanuel Vadot        #size-cells = <0>;
1248cc087a1SEmmanuel Vadot
1258cc087a1SEmmanuel Vadot        external_phy_port1: ethernet-phy@0 {
1268cc087a1SEmmanuel Vadot            reg = <0>;
1278cc087a1SEmmanuel Vadot        };
1288cc087a1SEmmanuel Vadot
1298cc087a1SEmmanuel Vadot        external_phy_port2: ethernet-phy@1 {
1308cc087a1SEmmanuel Vadot            reg = <1>;
1318cc087a1SEmmanuel Vadot        };
1328cc087a1SEmmanuel Vadot
1338cc087a1SEmmanuel Vadot        external_phy_port3: ethernet-phy@2 {
1348cc087a1SEmmanuel Vadot            reg = <2>;
1358cc087a1SEmmanuel Vadot        };
1368cc087a1SEmmanuel Vadot
1378cc087a1SEmmanuel Vadot        external_phy_port4: ethernet-phy@3 {
1388cc087a1SEmmanuel Vadot            reg = <3>;
1398cc087a1SEmmanuel Vadot        };
1408cc087a1SEmmanuel Vadot
1418cc087a1SEmmanuel Vadot        external_phy_port5: ethernet-phy@4 {
1428cc087a1SEmmanuel Vadot            reg = <4>;
1438cc087a1SEmmanuel Vadot        };
1448cc087a1SEmmanuel Vadot
1458cc087a1SEmmanuel Vadot        switch@10 {
1468cc087a1SEmmanuel Vadot            compatible = "qca,qca8337";
1478cc087a1SEmmanuel Vadot            reset-gpios = <&gpio 42 GPIO_ACTIVE_LOW>;
1488cc087a1SEmmanuel Vadot            reg = <0x10>;
1498cc087a1SEmmanuel Vadot
1508cc087a1SEmmanuel Vadot            ports {
1518cc087a1SEmmanuel Vadot                #address-cells = <1>;
1528cc087a1SEmmanuel Vadot                #size-cells = <0>;
1538cc087a1SEmmanuel Vadot
1548cc087a1SEmmanuel Vadot                port@0 {
1558cc087a1SEmmanuel Vadot                    reg = <0>;
1568cc087a1SEmmanuel Vadot                    ethernet = <&gmac1>;
1578cc087a1SEmmanuel Vadot                    phy-mode = "rgmii";
1588cc087a1SEmmanuel Vadot
1598cc087a1SEmmanuel Vadot                    fixed-link {
1608cc087a1SEmmanuel Vadot                        speed = <1000>;
1618cc087a1SEmmanuel Vadot                        full-duplex;
1628cc087a1SEmmanuel Vadot                    };
1638cc087a1SEmmanuel Vadot                };
1648cc087a1SEmmanuel Vadot
1658cc087a1SEmmanuel Vadot                port@1 {
1668cc087a1SEmmanuel Vadot                    reg = <1>;
1678cc087a1SEmmanuel Vadot                    label = "lan1";
1688cc087a1SEmmanuel Vadot                    phy-handle = <&external_phy_port1>;
1698cc087a1SEmmanuel Vadot                };
1708cc087a1SEmmanuel Vadot
1718cc087a1SEmmanuel Vadot                port@2 {
1728cc087a1SEmmanuel Vadot                    reg = <2>;
1738cc087a1SEmmanuel Vadot                    label = "lan2";
1748cc087a1SEmmanuel Vadot                    phy-handle = <&external_phy_port2>;
1758cc087a1SEmmanuel Vadot                };
1768cc087a1SEmmanuel Vadot
1778cc087a1SEmmanuel Vadot                port@3 {
1788cc087a1SEmmanuel Vadot                    reg = <3>;
1798cc087a1SEmmanuel Vadot                    label = "lan3";
1808cc087a1SEmmanuel Vadot                    phy-handle = <&external_phy_port3>;
1818cc087a1SEmmanuel Vadot                };
1828cc087a1SEmmanuel Vadot
1838cc087a1SEmmanuel Vadot                port@4 {
1848cc087a1SEmmanuel Vadot                    reg = <4>;
1858cc087a1SEmmanuel Vadot                    label = "lan4";
1868cc087a1SEmmanuel Vadot                    phy-handle = <&external_phy_port4>;
1878cc087a1SEmmanuel Vadot                };
1888cc087a1SEmmanuel Vadot
1898cc087a1SEmmanuel Vadot                port@5 {
1908cc087a1SEmmanuel Vadot                    reg = <5>;
1918cc087a1SEmmanuel Vadot                    label = "wan";
1928cc087a1SEmmanuel Vadot                    phy-handle = <&external_phy_port5>;
1938cc087a1SEmmanuel Vadot                };
1948cc087a1SEmmanuel Vadot            };
1958cc087a1SEmmanuel Vadot        };
1968cc087a1SEmmanuel Vadot    };
1978cc087a1SEmmanuel Vadot  - |
1988cc087a1SEmmanuel Vadot    #include <dt-bindings/gpio/gpio.h>
1998cc087a1SEmmanuel Vadot
2008cc087a1SEmmanuel Vadot    mdio {
2018cc087a1SEmmanuel Vadot        #address-cells = <1>;
2028cc087a1SEmmanuel Vadot        #size-cells = <0>;
2038cc087a1SEmmanuel Vadot
2048cc087a1SEmmanuel Vadot        switch@10 {
2058cc087a1SEmmanuel Vadot            compatible = "qca,qca8337";
2068cc087a1SEmmanuel Vadot            reset-gpios = <&gpio 42 GPIO_ACTIVE_LOW>;
2078cc087a1SEmmanuel Vadot            reg = <0x10>;
2088cc087a1SEmmanuel Vadot
2098cc087a1SEmmanuel Vadot            ports {
2108cc087a1SEmmanuel Vadot                #address-cells = <1>;
2118cc087a1SEmmanuel Vadot                #size-cells = <0>;
2128cc087a1SEmmanuel Vadot
2138cc087a1SEmmanuel Vadot                port@0 {
2148cc087a1SEmmanuel Vadot                    reg = <0>;
2158cc087a1SEmmanuel Vadot                    ethernet = <&gmac1>;
2168cc087a1SEmmanuel Vadot                    phy-mode = "rgmii";
2178cc087a1SEmmanuel Vadot
2188cc087a1SEmmanuel Vadot                    fixed-link {
2198cc087a1SEmmanuel Vadot                        speed = <1000>;
2208cc087a1SEmmanuel Vadot                        full-duplex;
2218cc087a1SEmmanuel Vadot                    };
2228cc087a1SEmmanuel Vadot                };
2238cc087a1SEmmanuel Vadot
2248cc087a1SEmmanuel Vadot                port@1 {
2258cc087a1SEmmanuel Vadot                    reg = <1>;
2268cc087a1SEmmanuel Vadot                    label = "lan1";
2278cc087a1SEmmanuel Vadot                    phy-mode = "internal";
2288cc087a1SEmmanuel Vadot                    phy-handle = <&internal_phy_port1>;
2298cc087a1SEmmanuel Vadot                };
2308cc087a1SEmmanuel Vadot
2318cc087a1SEmmanuel Vadot                port@2 {
2328cc087a1SEmmanuel Vadot                    reg = <2>;
2338cc087a1SEmmanuel Vadot                    label = "lan2";
2348cc087a1SEmmanuel Vadot                    phy-mode = "internal";
2358cc087a1SEmmanuel Vadot                    phy-handle = <&internal_phy_port2>;
2368cc087a1SEmmanuel Vadot                };
2378cc087a1SEmmanuel Vadot
2388cc087a1SEmmanuel Vadot                port@3 {
2398cc087a1SEmmanuel Vadot                    reg = <3>;
2408cc087a1SEmmanuel Vadot                    label = "lan3";
2418cc087a1SEmmanuel Vadot                    phy-mode = "internal";
2428cc087a1SEmmanuel Vadot                    phy-handle = <&internal_phy_port3>;
2438cc087a1SEmmanuel Vadot                };
2448cc087a1SEmmanuel Vadot
2458cc087a1SEmmanuel Vadot                port@4 {
2468cc087a1SEmmanuel Vadot                    reg = <4>;
2478cc087a1SEmmanuel Vadot                    label = "lan4";
2488cc087a1SEmmanuel Vadot                    phy-mode = "internal";
2498cc087a1SEmmanuel Vadot                    phy-handle = <&internal_phy_port4>;
2508cc087a1SEmmanuel Vadot                };
2518cc087a1SEmmanuel Vadot
2528cc087a1SEmmanuel Vadot                port@5 {
2538cc087a1SEmmanuel Vadot                    reg = <5>;
2548cc087a1SEmmanuel Vadot                    label = "wan";
2558cc087a1SEmmanuel Vadot                    phy-mode = "internal";
2568cc087a1SEmmanuel Vadot                    phy-handle = <&internal_phy_port5>;
2578cc087a1SEmmanuel Vadot                };
2588cc087a1SEmmanuel Vadot
2598cc087a1SEmmanuel Vadot                port@6 {
2608cc087a1SEmmanuel Vadot                    reg = <0>;
2618cc087a1SEmmanuel Vadot                    ethernet = <&gmac1>;
2628cc087a1SEmmanuel Vadot                    phy-mode = "sgmii";
2638cc087a1SEmmanuel Vadot
2648cc087a1SEmmanuel Vadot                    qca,sgmii-rxclk-falling-edge;
2658cc087a1SEmmanuel Vadot
2668cc087a1SEmmanuel Vadot                    fixed-link {
2678cc087a1SEmmanuel Vadot                        speed = <1000>;
2688cc087a1SEmmanuel Vadot                        full-duplex;
2698cc087a1SEmmanuel Vadot                    };
2708cc087a1SEmmanuel Vadot                };
2718cc087a1SEmmanuel Vadot            };
2728cc087a1SEmmanuel Vadot
2738cc087a1SEmmanuel Vadot            mdio {
2748cc087a1SEmmanuel Vadot                #address-cells = <1>;
2758cc087a1SEmmanuel Vadot                #size-cells = <0>;
2768cc087a1SEmmanuel Vadot
2778cc087a1SEmmanuel Vadot                internal_phy_port1: ethernet-phy@0 {
2788cc087a1SEmmanuel Vadot                    reg = <0>;
2798cc087a1SEmmanuel Vadot                };
2808cc087a1SEmmanuel Vadot
2818cc087a1SEmmanuel Vadot                internal_phy_port2: ethernet-phy@1 {
2828cc087a1SEmmanuel Vadot                    reg = <1>;
2838cc087a1SEmmanuel Vadot                };
2848cc087a1SEmmanuel Vadot
2858cc087a1SEmmanuel Vadot                internal_phy_port3: ethernet-phy@2 {
2868cc087a1SEmmanuel Vadot                    reg = <2>;
2878cc087a1SEmmanuel Vadot                };
2888cc087a1SEmmanuel Vadot
2898cc087a1SEmmanuel Vadot                internal_phy_port4: ethernet-phy@3 {
2908cc087a1SEmmanuel Vadot                    reg = <3>;
2918cc087a1SEmmanuel Vadot                };
2928cc087a1SEmmanuel Vadot
2938cc087a1SEmmanuel Vadot                internal_phy_port5: ethernet-phy@4 {
2948cc087a1SEmmanuel Vadot                    reg = <4>;
2958cc087a1SEmmanuel Vadot                };
2968cc087a1SEmmanuel Vadot            };
2978cc087a1SEmmanuel Vadot        };
2988cc087a1SEmmanuel Vadot    };
299