xref: /freebsd-src/sys/contrib/device-tree/Bindings/net/dsa/qca8k.yaml (revision 84943d6f38e936ac3b7a3947ca26eeb27a39f938)
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.
21fac71e4eSEmmanuel Vadot  Each phy has at most 3 LEDs connected and can be declared
22fac71e4eSEmmanuel Vadot  using the standard LEDs structure.
238cc087a1SEmmanuel Vadot
248cc087a1SEmmanuel Vadotproperties:
258cc087a1SEmmanuel Vadot  compatible:
268cc087a1SEmmanuel Vadot    oneOf:
278cc087a1SEmmanuel Vadot      - enum:
288cc087a1SEmmanuel Vadot          - qca,qca8327
298cc087a1SEmmanuel Vadot          - qca,qca8328
308cc087a1SEmmanuel Vadot          - qca,qca8334
318cc087a1SEmmanuel Vadot          - qca,qca8337
328cc087a1SEmmanuel Vadot    description: |
338cc087a1SEmmanuel Vadot      qca,qca8328: referenced as AR8328(N)-AK1(A/B) QFN 176 pin package
348cc087a1SEmmanuel Vadot      qca,qca8327: referenced as AR8327(N)-AL1A DR-QFN 148 pin package
358cc087a1SEmmanuel Vadot      qca,qca8334: referenced as QCA8334-AL3C QFN 88 pin package
368cc087a1SEmmanuel Vadot      qca,qca8337: referenced as QCA8337N-AL3(B/C) DR-QFN 148 pin package
378cc087a1SEmmanuel Vadot
388cc087a1SEmmanuel Vadot  reg:
398cc087a1SEmmanuel Vadot    maxItems: 1
408cc087a1SEmmanuel Vadot
418cc087a1SEmmanuel Vadot  reset-gpios:
428cc087a1SEmmanuel Vadot    description:
438cc087a1SEmmanuel Vadot      GPIO to be used to reset the whole device
448cc087a1SEmmanuel Vadot    maxItems: 1
458cc087a1SEmmanuel Vadot
468cc087a1SEmmanuel Vadot  qca,ignore-power-on-sel:
478cc087a1SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/flag
488cc087a1SEmmanuel Vadot    description:
498cc087a1SEmmanuel Vadot      Ignore power-on pin strapping to configure LED open-drain or EEPROM
508cc087a1SEmmanuel Vadot      presence. This is needed for devices with incorrect configuration or when
518cc087a1SEmmanuel Vadot      the OEM has decided not to use pin strapping and falls back to SW regs.
528cc087a1SEmmanuel Vadot
538cc087a1SEmmanuel Vadot  qca,led-open-drain:
548cc087a1SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/flag
558cc087a1SEmmanuel Vadot    description:
568cc087a1SEmmanuel Vadot      Set LEDs to open-drain mode. This requires the qca,ignore-power-on-sel to
578cc087a1SEmmanuel Vadot      be set, otherwise the driver will fail at probe. This is required if the
588cc087a1SEmmanuel Vadot      OEM does not use pin strapping to set this mode and prefers to set it
598cc087a1SEmmanuel Vadot      using SW regs. The pin strappings related to LED open-drain mode are
608cc087a1SEmmanuel Vadot      B68 on the QCA832x and B49 on the QCA833x.
618cc087a1SEmmanuel Vadot
628cc087a1SEmmanuel Vadot  mdio:
63e67e8565SEmmanuel Vadot    $ref: /schemas/net/mdio.yaml#
64e67e8565SEmmanuel Vadot    unevaluatedProperties: false
658cc087a1SEmmanuel Vadot    description: Qca8k switch have an internal mdio to access switch port.
668cc087a1SEmmanuel Vadot                 If this is not present, the legacy mapping is used and the
678cc087a1SEmmanuel Vadot                 internal mdio access is used.
688cc087a1SEmmanuel Vadot                 With the legacy mapping the reg corresponding to the internal
698cc087a1SEmmanuel Vadot                 mdio is the switch reg with an offset of -1.
708cc087a1SEmmanuel Vadot
71fac71e4eSEmmanuel Vadot$ref: dsa.yaml#
72cb7aa33aSEmmanuel Vadot
738cc087a1SEmmanuel VadotpatternProperties:
748cc087a1SEmmanuel Vadot  "^(ethernet-)?ports$":
758cc087a1SEmmanuel Vadot    type: object
76*84943d6fSEmmanuel Vadot    additionalProperties: true
778cc087a1SEmmanuel Vadot    patternProperties:
788cc087a1SEmmanuel Vadot      "^(ethernet-)?port@[0-6]$":
798cc087a1SEmmanuel Vadot        type: object
808cc087a1SEmmanuel Vadot        description: Ethernet switch ports
818cc087a1SEmmanuel Vadot
82e67e8565SEmmanuel Vadot        $ref: dsa-port.yaml#
83e67e8565SEmmanuel Vadot
848cc087a1SEmmanuel Vadot        properties:
858cc087a1SEmmanuel Vadot          qca,sgmii-rxclk-falling-edge:
868cc087a1SEmmanuel Vadot            $ref: /schemas/types.yaml#/definitions/flag
878cc087a1SEmmanuel Vadot            description:
888cc087a1SEmmanuel Vadot              Set the receive clock phase to falling edge. Mostly commonly used on
898cc087a1SEmmanuel Vadot              the QCA8327 with CPU port 0 set to SGMII.
908cc087a1SEmmanuel Vadot
918cc087a1SEmmanuel Vadot          qca,sgmii-txclk-falling-edge:
928cc087a1SEmmanuel Vadot            $ref: /schemas/types.yaml#/definitions/flag
938cc087a1SEmmanuel Vadot            description:
948cc087a1SEmmanuel Vadot              Set the transmit clock phase to falling edge.
958cc087a1SEmmanuel Vadot
968cc087a1SEmmanuel Vadot          qca,sgmii-enable-pll:
978cc087a1SEmmanuel Vadot            $ref: /schemas/types.yaml#/definitions/flag
988cc087a1SEmmanuel Vadot            description:
998cc087a1SEmmanuel Vadot              For SGMII CPU port, explicitly enable PLL, TX and RX chain along with
1008cc087a1SEmmanuel Vadot              Signal Detection. On the QCA8327 this should not be enabled, otherwise
1018cc087a1SEmmanuel Vadot              the SGMII port will not initialize. When used on the QCA8337, revision 3
1028cc087a1SEmmanuel Vadot              or greater, a warning will be displayed. When the CPU port is set to
1038cc087a1SEmmanuel Vadot              SGMII on the QCA8337, it is advised to set this unless a communication
1048cc087a1SEmmanuel Vadot              issue is observed.
1058cc087a1SEmmanuel Vadot
106e67e8565SEmmanuel Vadot        unevaluatedProperties: false
1078cc087a1SEmmanuel Vadot
1088cc087a1SEmmanuel VadotoneOf:
1098cc087a1SEmmanuel Vadot  - required:
1108cc087a1SEmmanuel Vadot      - ports
1118cc087a1SEmmanuel Vadot  - required:
1128cc087a1SEmmanuel Vadot      - ethernet-ports
1138cc087a1SEmmanuel Vadot
1148cc087a1SEmmanuel Vadotrequired:
1158cc087a1SEmmanuel Vadot  - compatible
1168cc087a1SEmmanuel Vadot  - reg
1178cc087a1SEmmanuel Vadot
118cb7aa33aSEmmanuel VadotunevaluatedProperties: false
1198cc087a1SEmmanuel Vadot
1208cc087a1SEmmanuel Vadotexamples:
1218cc087a1SEmmanuel Vadot  - |
1228cc087a1SEmmanuel Vadot    #include <dt-bindings/gpio/gpio.h>
123fac71e4eSEmmanuel Vadot    #include <dt-bindings/leds/common.h>
1248cc087a1SEmmanuel Vadot
1258cc087a1SEmmanuel Vadot    mdio {
1268cc087a1SEmmanuel Vadot        #address-cells = <1>;
1278cc087a1SEmmanuel Vadot        #size-cells = <0>;
1288cc087a1SEmmanuel Vadot
1298cc087a1SEmmanuel Vadot        external_phy_port1: ethernet-phy@0 {
1308cc087a1SEmmanuel Vadot            reg = <0>;
1318cc087a1SEmmanuel Vadot        };
1328cc087a1SEmmanuel Vadot
1338cc087a1SEmmanuel Vadot        external_phy_port2: ethernet-phy@1 {
1348cc087a1SEmmanuel Vadot            reg = <1>;
1358cc087a1SEmmanuel Vadot        };
1368cc087a1SEmmanuel Vadot
1378cc087a1SEmmanuel Vadot        external_phy_port3: ethernet-phy@2 {
1388cc087a1SEmmanuel Vadot            reg = <2>;
1398cc087a1SEmmanuel Vadot        };
1408cc087a1SEmmanuel Vadot
1418cc087a1SEmmanuel Vadot        external_phy_port4: ethernet-phy@3 {
1428cc087a1SEmmanuel Vadot            reg = <3>;
1438cc087a1SEmmanuel Vadot        };
1448cc087a1SEmmanuel Vadot
1458cc087a1SEmmanuel Vadot        external_phy_port5: ethernet-phy@4 {
1468cc087a1SEmmanuel Vadot            reg = <4>;
1478cc087a1SEmmanuel Vadot        };
1488cc087a1SEmmanuel Vadot
1498cc087a1SEmmanuel Vadot        switch@10 {
1508cc087a1SEmmanuel Vadot            compatible = "qca,qca8337";
1518cc087a1SEmmanuel Vadot            reset-gpios = <&gpio 42 GPIO_ACTIVE_LOW>;
1528cc087a1SEmmanuel Vadot            reg = <0x10>;
1538cc087a1SEmmanuel Vadot
1548cc087a1SEmmanuel Vadot            ports {
1558cc087a1SEmmanuel Vadot                #address-cells = <1>;
1568cc087a1SEmmanuel Vadot                #size-cells = <0>;
1578cc087a1SEmmanuel Vadot
1588cc087a1SEmmanuel Vadot                port@0 {
1598cc087a1SEmmanuel Vadot                    reg = <0>;
1608cc087a1SEmmanuel Vadot                    ethernet = <&gmac1>;
1618cc087a1SEmmanuel Vadot                    phy-mode = "rgmii";
1628cc087a1SEmmanuel Vadot
1638cc087a1SEmmanuel Vadot                    fixed-link {
1648cc087a1SEmmanuel Vadot                        speed = <1000>;
1658cc087a1SEmmanuel Vadot                        full-duplex;
1668cc087a1SEmmanuel Vadot                    };
1678cc087a1SEmmanuel Vadot                };
1688cc087a1SEmmanuel Vadot
1698cc087a1SEmmanuel Vadot                port@1 {
1708cc087a1SEmmanuel Vadot                    reg = <1>;
1718cc087a1SEmmanuel Vadot                    label = "lan1";
1728cc087a1SEmmanuel Vadot                    phy-handle = <&external_phy_port1>;
1738cc087a1SEmmanuel Vadot                };
1748cc087a1SEmmanuel Vadot
1758cc087a1SEmmanuel Vadot                port@2 {
1768cc087a1SEmmanuel Vadot                    reg = <2>;
1778cc087a1SEmmanuel Vadot                    label = "lan2";
1788cc087a1SEmmanuel Vadot                    phy-handle = <&external_phy_port2>;
1798cc087a1SEmmanuel Vadot                };
1808cc087a1SEmmanuel Vadot
1818cc087a1SEmmanuel Vadot                port@3 {
1828cc087a1SEmmanuel Vadot                    reg = <3>;
1838cc087a1SEmmanuel Vadot                    label = "lan3";
1848cc087a1SEmmanuel Vadot                    phy-handle = <&external_phy_port3>;
1858cc087a1SEmmanuel Vadot                };
1868cc087a1SEmmanuel Vadot
1878cc087a1SEmmanuel Vadot                port@4 {
1888cc087a1SEmmanuel Vadot                    reg = <4>;
1898cc087a1SEmmanuel Vadot                    label = "lan4";
1908cc087a1SEmmanuel Vadot                    phy-handle = <&external_phy_port4>;
1918cc087a1SEmmanuel Vadot                };
1928cc087a1SEmmanuel Vadot
1938cc087a1SEmmanuel Vadot                port@5 {
1948cc087a1SEmmanuel Vadot                    reg = <5>;
1958cc087a1SEmmanuel Vadot                    label = "wan";
1968cc087a1SEmmanuel Vadot                    phy-handle = <&external_phy_port5>;
1978cc087a1SEmmanuel Vadot                };
1988cc087a1SEmmanuel Vadot            };
1998cc087a1SEmmanuel Vadot        };
2008cc087a1SEmmanuel Vadot    };
2018cc087a1SEmmanuel Vadot  - |
2028cc087a1SEmmanuel Vadot    #include <dt-bindings/gpio/gpio.h>
2038cc087a1SEmmanuel Vadot
2048cc087a1SEmmanuel Vadot    mdio {
2058cc087a1SEmmanuel Vadot        #address-cells = <1>;
2068cc087a1SEmmanuel Vadot        #size-cells = <0>;
2078cc087a1SEmmanuel Vadot
2088cc087a1SEmmanuel Vadot        switch@10 {
2098cc087a1SEmmanuel Vadot            compatible = "qca,qca8337";
2108cc087a1SEmmanuel Vadot            reset-gpios = <&gpio 42 GPIO_ACTIVE_LOW>;
2118cc087a1SEmmanuel Vadot            reg = <0x10>;
2128cc087a1SEmmanuel Vadot
2138cc087a1SEmmanuel Vadot            ports {
2148cc087a1SEmmanuel Vadot                #address-cells = <1>;
2158cc087a1SEmmanuel Vadot                #size-cells = <0>;
2168cc087a1SEmmanuel Vadot
2178cc087a1SEmmanuel Vadot                port@0 {
2188cc087a1SEmmanuel Vadot                    reg = <0>;
2198cc087a1SEmmanuel Vadot                    ethernet = <&gmac1>;
2208cc087a1SEmmanuel Vadot                    phy-mode = "rgmii";
2218cc087a1SEmmanuel Vadot
2228cc087a1SEmmanuel Vadot                    fixed-link {
2238cc087a1SEmmanuel Vadot                        speed = <1000>;
2248cc087a1SEmmanuel Vadot                        full-duplex;
2258cc087a1SEmmanuel Vadot                    };
2268cc087a1SEmmanuel Vadot                };
2278cc087a1SEmmanuel Vadot
2288cc087a1SEmmanuel Vadot                port@1 {
2298cc087a1SEmmanuel Vadot                    reg = <1>;
2308cc087a1SEmmanuel Vadot                    label = "lan1";
2318cc087a1SEmmanuel Vadot                    phy-mode = "internal";
2328cc087a1SEmmanuel Vadot                    phy-handle = <&internal_phy_port1>;
233fac71e4eSEmmanuel Vadot
234fac71e4eSEmmanuel Vadot                    leds {
235fac71e4eSEmmanuel Vadot                        #address-cells = <1>;
236fac71e4eSEmmanuel Vadot                        #size-cells = <0>;
237fac71e4eSEmmanuel Vadot
238fac71e4eSEmmanuel Vadot                        led@0 {
239fac71e4eSEmmanuel Vadot                            reg = <0>;
240fac71e4eSEmmanuel Vadot                            color = <LED_COLOR_ID_WHITE>;
241fac71e4eSEmmanuel Vadot                            function = LED_FUNCTION_LAN;
242fac71e4eSEmmanuel Vadot                            default-state = "keep";
243fac71e4eSEmmanuel Vadot                        };
244fac71e4eSEmmanuel Vadot
245fac71e4eSEmmanuel Vadot                        led@1 {
246fac71e4eSEmmanuel Vadot                            reg = <1>;
247fac71e4eSEmmanuel Vadot                            color = <LED_COLOR_ID_AMBER>;
248fac71e4eSEmmanuel Vadot                            function = LED_FUNCTION_LAN;
249fac71e4eSEmmanuel Vadot                            default-state = "keep";
250fac71e4eSEmmanuel Vadot                        };
251fac71e4eSEmmanuel Vadot                    };
2528cc087a1SEmmanuel Vadot                };
2538cc087a1SEmmanuel Vadot
2548cc087a1SEmmanuel Vadot                port@2 {
2558cc087a1SEmmanuel Vadot                    reg = <2>;
2568cc087a1SEmmanuel Vadot                    label = "lan2";
2578cc087a1SEmmanuel Vadot                    phy-mode = "internal";
2588cc087a1SEmmanuel Vadot                    phy-handle = <&internal_phy_port2>;
2598cc087a1SEmmanuel Vadot                };
2608cc087a1SEmmanuel Vadot
2618cc087a1SEmmanuel Vadot                port@3 {
2628cc087a1SEmmanuel Vadot                    reg = <3>;
2638cc087a1SEmmanuel Vadot                    label = "lan3";
2648cc087a1SEmmanuel Vadot                    phy-mode = "internal";
2658cc087a1SEmmanuel Vadot                    phy-handle = <&internal_phy_port3>;
2668cc087a1SEmmanuel Vadot                };
2678cc087a1SEmmanuel Vadot
2688cc087a1SEmmanuel Vadot                port@4 {
2698cc087a1SEmmanuel Vadot                    reg = <4>;
2708cc087a1SEmmanuel Vadot                    label = "lan4";
2718cc087a1SEmmanuel Vadot                    phy-mode = "internal";
2728cc087a1SEmmanuel Vadot                    phy-handle = <&internal_phy_port4>;
2738cc087a1SEmmanuel Vadot                };
2748cc087a1SEmmanuel Vadot
2758cc087a1SEmmanuel Vadot                port@5 {
2768cc087a1SEmmanuel Vadot                    reg = <5>;
2778cc087a1SEmmanuel Vadot                    label = "wan";
2788cc087a1SEmmanuel Vadot                    phy-mode = "internal";
2798cc087a1SEmmanuel Vadot                    phy-handle = <&internal_phy_port5>;
2808cc087a1SEmmanuel Vadot                };
2818cc087a1SEmmanuel Vadot
2828cc087a1SEmmanuel Vadot                port@6 {
2838cc087a1SEmmanuel Vadot                    reg = <0>;
2848cc087a1SEmmanuel Vadot                    ethernet = <&gmac1>;
2858cc087a1SEmmanuel Vadot                    phy-mode = "sgmii";
2868cc087a1SEmmanuel Vadot
2878cc087a1SEmmanuel Vadot                    qca,sgmii-rxclk-falling-edge;
2888cc087a1SEmmanuel Vadot
2898cc087a1SEmmanuel Vadot                    fixed-link {
2908cc087a1SEmmanuel Vadot                        speed = <1000>;
2918cc087a1SEmmanuel Vadot                        full-duplex;
2928cc087a1SEmmanuel Vadot                    };
2938cc087a1SEmmanuel Vadot                };
2948cc087a1SEmmanuel Vadot            };
2958cc087a1SEmmanuel Vadot
2968cc087a1SEmmanuel Vadot            mdio {
2978cc087a1SEmmanuel Vadot                #address-cells = <1>;
2988cc087a1SEmmanuel Vadot                #size-cells = <0>;
2998cc087a1SEmmanuel Vadot
3008cc087a1SEmmanuel Vadot                internal_phy_port1: ethernet-phy@0 {
3018cc087a1SEmmanuel Vadot                    reg = <0>;
3028cc087a1SEmmanuel Vadot                };
3038cc087a1SEmmanuel Vadot
3048cc087a1SEmmanuel Vadot                internal_phy_port2: ethernet-phy@1 {
3058cc087a1SEmmanuel Vadot                    reg = <1>;
3068cc087a1SEmmanuel Vadot                };
3078cc087a1SEmmanuel Vadot
3088cc087a1SEmmanuel Vadot                internal_phy_port3: ethernet-phy@2 {
3098cc087a1SEmmanuel Vadot                    reg = <2>;
3108cc087a1SEmmanuel Vadot                };
3118cc087a1SEmmanuel Vadot
3128cc087a1SEmmanuel Vadot                internal_phy_port4: ethernet-phy@3 {
3138cc087a1SEmmanuel Vadot                    reg = <3>;
3148cc087a1SEmmanuel Vadot                };
3158cc087a1SEmmanuel Vadot
3168cc087a1SEmmanuel Vadot                internal_phy_port5: ethernet-phy@4 {
3178cc087a1SEmmanuel Vadot                    reg = <4>;
3188cc087a1SEmmanuel Vadot                };
3198cc087a1SEmmanuel Vadot            };
3208cc087a1SEmmanuel Vadot        };
3218cc087a1SEmmanuel Vadot    };
322