xref: /freebsd/sys/contrib/device-tree/Bindings/net/dsa/microchip,ksz.yaml (revision 8d13bc63c0e1d50bc9e47ac1f26329c999bfecf0)
15def4c47SEmmanuel Vadot# SPDX-License-Identifier: GPL-2.0-only
25def4c47SEmmanuel Vadot%YAML 1.2
35def4c47SEmmanuel Vadot---
45def4c47SEmmanuel Vadot$id: http://devicetree.org/schemas/net/dsa/microchip,ksz.yaml#
55def4c47SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
65def4c47SEmmanuel Vadot
75def4c47SEmmanuel Vadottitle: Microchip KSZ Series Ethernet switches
85def4c47SEmmanuel Vadot
95def4c47SEmmanuel Vadotmaintainers:
105def4c47SEmmanuel Vadot  - Marek Vasut <marex@denx.de>
115def4c47SEmmanuel Vadot  - Woojung Huh <Woojung.Huh@microchip.com>
125def4c47SEmmanuel Vadot
135def4c47SEmmanuel VadotallOf:
14d5b0e70fSEmmanuel Vadot  - $ref: /schemas/spi/spi-peripheral-props.yaml#
155def4c47SEmmanuel Vadot
165def4c47SEmmanuel Vadotproperties:
175def4c47SEmmanuel Vadot  # See Documentation/devicetree/bindings/net/dsa/dsa.yaml for a list of additional
185def4c47SEmmanuel Vadot  # required and optional properties.
195def4c47SEmmanuel Vadot  compatible:
205def4c47SEmmanuel Vadot    enum:
215def4c47SEmmanuel Vadot      - microchip,ksz8765
225def4c47SEmmanuel Vadot      - microchip,ksz8794
235def4c47SEmmanuel Vadot      - microchip,ksz8795
242eb4d8dcSEmmanuel Vadot      - microchip,ksz8863
252eb4d8dcSEmmanuel Vadot      - microchip,ksz8873
265def4c47SEmmanuel Vadot      - microchip,ksz9477
275def4c47SEmmanuel Vadot      - microchip,ksz9897
285def4c47SEmmanuel Vadot      - microchip,ksz9896
295def4c47SEmmanuel Vadot      - microchip,ksz9567
305def4c47SEmmanuel Vadot      - microchip,ksz8565
315def4c47SEmmanuel Vadot      - microchip,ksz9893
325def4c47SEmmanuel Vadot      - microchip,ksz9563
335def4c47SEmmanuel Vadot      - microchip,ksz8563
345def4c47SEmmanuel Vadot
355def4c47SEmmanuel Vadot  reset-gpios:
365def4c47SEmmanuel Vadot    description:
375def4c47SEmmanuel Vadot      Should be a gpio specifier for a reset line.
385def4c47SEmmanuel Vadot    maxItems: 1
395def4c47SEmmanuel Vadot
4084943d6fSEmmanuel Vadot  wakeup-source: true
4184943d6fSEmmanuel Vadot
425def4c47SEmmanuel Vadot  microchip,synclko-125:
435def4c47SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/flag
445def4c47SEmmanuel Vadot    description:
455def4c47SEmmanuel Vadot      Set if the output SYNCLKO frequency should be set to 125MHz instead of 25MHz.
465def4c47SEmmanuel Vadot
47c9ccf3a3SEmmanuel Vadot  microchip,synclko-disable:
48c9ccf3a3SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/flag
49c9ccf3a3SEmmanuel Vadot    description:
50c9ccf3a3SEmmanuel Vadot      Set if the output SYNCLKO clock should be disabled. Do not mix with
51c9ccf3a3SEmmanuel Vadot      microchip,synclko-125.
52c9ccf3a3SEmmanuel Vadot
5384943d6fSEmmanuel Vadot  microchip,io-drive-strength-microamp:
5484943d6fSEmmanuel Vadot    description:
5584943d6fSEmmanuel Vadot      IO Pad Drive Strength
5684943d6fSEmmanuel Vadot    enum: [8000, 16000]
5784943d6fSEmmanuel Vadot    default: 16000
5884943d6fSEmmanuel Vadot
5984943d6fSEmmanuel Vadot  microchip,hi-drive-strength-microamp:
6084943d6fSEmmanuel Vadot    description:
6184943d6fSEmmanuel Vadot      High Speed Drive Strength. Controls drive strength of GMII / RGMII /
6284943d6fSEmmanuel Vadot      MII / RMII (except TX_CLK/REFCLKI, COL and CRS) and CLKO_25_125 lines.
6384943d6fSEmmanuel Vadot    enum: [2000, 4000, 8000, 12000, 16000, 20000, 24000, 28000]
6484943d6fSEmmanuel Vadot    default: 24000
6584943d6fSEmmanuel Vadot
6684943d6fSEmmanuel Vadot  microchip,lo-drive-strength-microamp:
6784943d6fSEmmanuel Vadot    description:
6884943d6fSEmmanuel Vadot      Low Speed Drive Strength. Controls drive strength of TX_CLK / REFCLKI,
6984943d6fSEmmanuel Vadot      COL, CRS, LEDs, PME_N, NTRP_N, SDO and SDI/SDA/MDIO lines.
7084943d6fSEmmanuel Vadot    enum: [2000, 4000, 8000, 12000, 16000, 20000, 24000, 28000]
7184943d6fSEmmanuel Vadot    default: 8000
7284943d6fSEmmanuel Vadot
73aa1a8ff2SEmmanuel Vadot  interrupts:
74aa1a8ff2SEmmanuel Vadot    maxItems: 1
75aa1a8ff2SEmmanuel Vadot
765def4c47SEmmanuel Vadotrequired:
775def4c47SEmmanuel Vadot  - compatible
785def4c47SEmmanuel Vadot  - reg
795def4c47SEmmanuel Vadot
80*8d13bc63SEmmanuel Vadotif:
81*8d13bc63SEmmanuel Vadot  not:
82*8d13bc63SEmmanuel Vadot    properties:
83*8d13bc63SEmmanuel Vadot      compatible:
84*8d13bc63SEmmanuel Vadot        enum:
85*8d13bc63SEmmanuel Vadot          - microchip,ksz8863
86*8d13bc63SEmmanuel Vadot          - microchip,ksz8873
87*8d13bc63SEmmanuel Vadotthen:
88*8d13bc63SEmmanuel Vadot  $ref: dsa.yaml#/$defs/ethernet-ports
89*8d13bc63SEmmanuel Vadotelse:
90*8d13bc63SEmmanuel Vadot  patternProperties:
91*8d13bc63SEmmanuel Vadot    "^(ethernet-)?ports$":
92*8d13bc63SEmmanuel Vadot      patternProperties:
93*8d13bc63SEmmanuel Vadot        "^(ethernet-)?port@[0-2]$":
94*8d13bc63SEmmanuel Vadot          $ref: dsa-port.yaml#
95*8d13bc63SEmmanuel Vadot          unevaluatedProperties: false
96*8d13bc63SEmmanuel Vadot          properties:
97*8d13bc63SEmmanuel Vadot            microchip,rmii-clk-internal:
98*8d13bc63SEmmanuel Vadot              $ref: /schemas/types.yaml#/definitions/flag
99*8d13bc63SEmmanuel Vadot              description:
100*8d13bc63SEmmanuel Vadot                When ksz88x3 is acting as clock provier (via REFCLKO) it
101*8d13bc63SEmmanuel Vadot                can select between internal and external RMII reference
102*8d13bc63SEmmanuel Vadot                clock. Internal reference clock means that the clock for
103*8d13bc63SEmmanuel Vadot                the RMII of ksz88x3 is provided by the ksz88x3 internally
104*8d13bc63SEmmanuel Vadot                and the REFCLKI pin is unconnected. For the external
105*8d13bc63SEmmanuel Vadot                reference clock, the clock needs to be fed back to ksz88x3
106*8d13bc63SEmmanuel Vadot                via REFCLKI.
107*8d13bc63SEmmanuel Vadot                If microchip,rmii-clk-internal is set, ksz88x3 will provide
108*8d13bc63SEmmanuel Vadot                rmii reference clock internally, otherwise reference clock
109*8d13bc63SEmmanuel Vadot                should be provided externally.
110*8d13bc63SEmmanuel Vadot          dependencies:
111*8d13bc63SEmmanuel Vadot            microchip,rmii-clk-internal: [ethernet]
112*8d13bc63SEmmanuel Vadot
1135def4c47SEmmanuel VadotunevaluatedProperties: false
1145def4c47SEmmanuel Vadot
1155def4c47SEmmanuel Vadotexamples:
1165def4c47SEmmanuel Vadot  - |
1175def4c47SEmmanuel Vadot    #include <dt-bindings/gpio/gpio.h>
1185def4c47SEmmanuel Vadot
1195def4c47SEmmanuel Vadot    // Ethernet switch connected via SPI to the host, CPU port wired to eth0:
1205def4c47SEmmanuel Vadot    eth0 {
1215def4c47SEmmanuel Vadot        fixed-link {
1225def4c47SEmmanuel Vadot            speed = <1000>;
1235def4c47SEmmanuel Vadot            full-duplex;
1245def4c47SEmmanuel Vadot        };
1255def4c47SEmmanuel Vadot    };
1265def4c47SEmmanuel Vadot
127fac71e4eSEmmanuel Vadot    spi {
1285def4c47SEmmanuel Vadot        #address-cells = <1>;
1295def4c47SEmmanuel Vadot        #size-cells = <0>;
1305def4c47SEmmanuel Vadot
1315def4c47SEmmanuel Vadot        pinctrl-0 = <&pinctrl_spi_ksz>;
1325def4c47SEmmanuel Vadot        cs-gpios = <&pioC 25 0>;
1335def4c47SEmmanuel Vadot        id = <1>;
1345def4c47SEmmanuel Vadot
1355def4c47SEmmanuel Vadot        ksz9477: switch@0 {
1365def4c47SEmmanuel Vadot            compatible = "microchip,ksz9477";
1375def4c47SEmmanuel Vadot            reg = <0>;
1385def4c47SEmmanuel Vadot            reset-gpios = <&gpio5 0 GPIO_ACTIVE_LOW>;
1395def4c47SEmmanuel Vadot
1405def4c47SEmmanuel Vadot            spi-max-frequency = <44000000>;
1415def4c47SEmmanuel Vadot
1425def4c47SEmmanuel Vadot            ethernet-ports {
1435def4c47SEmmanuel Vadot                #address-cells = <1>;
1445def4c47SEmmanuel Vadot                #size-cells = <0>;
1455def4c47SEmmanuel Vadot                port@0 {
1465def4c47SEmmanuel Vadot                    reg = <0>;
1475def4c47SEmmanuel Vadot                    label = "lan1";
1485def4c47SEmmanuel Vadot                };
1495def4c47SEmmanuel Vadot                port@1 {
1505def4c47SEmmanuel Vadot                    reg = <1>;
1515def4c47SEmmanuel Vadot                    label = "lan2";
1525def4c47SEmmanuel Vadot                };
1535def4c47SEmmanuel Vadot                port@2 {
1545def4c47SEmmanuel Vadot                    reg = <2>;
1555def4c47SEmmanuel Vadot                    label = "lan3";
1565def4c47SEmmanuel Vadot                };
1575def4c47SEmmanuel Vadot                port@3 {
1585def4c47SEmmanuel Vadot                    reg = <3>;
1595def4c47SEmmanuel Vadot                    label = "lan4";
1605def4c47SEmmanuel Vadot                };
1615def4c47SEmmanuel Vadot                port@4 {
1625def4c47SEmmanuel Vadot                    reg = <4>;
1635def4c47SEmmanuel Vadot                    label = "lan5";
1645def4c47SEmmanuel Vadot                };
1655def4c47SEmmanuel Vadot                port@5 {
1665def4c47SEmmanuel Vadot                    reg = <5>;
1675def4c47SEmmanuel Vadot                    ethernet = <&eth0>;
1687ef62cebSEmmanuel Vadot                    phy-mode = "rgmii";
1697ef62cebSEmmanuel Vadot
1705def4c47SEmmanuel Vadot                    fixed-link {
1715def4c47SEmmanuel Vadot                        speed = <1000>;
1725def4c47SEmmanuel Vadot                        full-duplex;
1735def4c47SEmmanuel Vadot                    };
1745def4c47SEmmanuel Vadot                };
1755def4c47SEmmanuel Vadot            };
1765def4c47SEmmanuel Vadot        };
1775def4c47SEmmanuel Vadot
1785def4c47SEmmanuel Vadot        ksz8565: switch@1 {
1795def4c47SEmmanuel Vadot            compatible = "microchip,ksz8565";
1805def4c47SEmmanuel Vadot            reg = <1>;
1815def4c47SEmmanuel Vadot
1825def4c47SEmmanuel Vadot            spi-max-frequency = <44000000>;
1835def4c47SEmmanuel Vadot
1845def4c47SEmmanuel Vadot            ethernet-ports {
1855def4c47SEmmanuel Vadot                #address-cells = <1>;
1865def4c47SEmmanuel Vadot                #size-cells = <0>;
1875def4c47SEmmanuel Vadot                port@0 {
1885def4c47SEmmanuel Vadot                    reg = <0>;
1895def4c47SEmmanuel Vadot                    label = "lan1";
1905def4c47SEmmanuel Vadot                };
1915def4c47SEmmanuel Vadot                port@1 {
1925def4c47SEmmanuel Vadot                    reg = <1>;
1935def4c47SEmmanuel Vadot                    label = "lan2";
1945def4c47SEmmanuel Vadot                };
1955def4c47SEmmanuel Vadot                port@2 {
1965def4c47SEmmanuel Vadot                    reg = <2>;
1975def4c47SEmmanuel Vadot                    label = "lan3";
1985def4c47SEmmanuel Vadot                };
1995def4c47SEmmanuel Vadot                port@3 {
2005def4c47SEmmanuel Vadot                    reg = <3>;
2015def4c47SEmmanuel Vadot                    label = "lan4";
2025def4c47SEmmanuel Vadot                };
2035def4c47SEmmanuel Vadot                port@6 {
2045def4c47SEmmanuel Vadot                    reg = <6>;
2055def4c47SEmmanuel Vadot                    ethernet = <&eth0>;
2067ef62cebSEmmanuel Vadot                    phy-mode = "rgmii";
2077ef62cebSEmmanuel Vadot
2085def4c47SEmmanuel Vadot                    fixed-link {
2095def4c47SEmmanuel Vadot                        speed = <1000>;
2105def4c47SEmmanuel Vadot                        full-duplex;
2115def4c47SEmmanuel Vadot                    };
2125def4c47SEmmanuel Vadot                };
2135def4c47SEmmanuel Vadot            };
2145def4c47SEmmanuel Vadot        };
2155def4c47SEmmanuel Vadot    };
2165def4c47SEmmanuel Vadot...
217