xref: /freebsd/sys/contrib/device-tree/Bindings/net/dsa/micrel,ks8995.yaml (revision 833e5d42ab135b0238e61c5b3c19b8619677cbfa)
1*833e5d42SEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2*833e5d42SEmmanuel Vadot%YAML 1.2
3*833e5d42SEmmanuel Vadot---
4*833e5d42SEmmanuel Vadot$id: http://devicetree.org/schemas/net/dsa/micrel,ks8995.yaml#
5*833e5d42SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6*833e5d42SEmmanuel Vadot
7*833e5d42SEmmanuel Vadottitle: Micrel KS8995 Family DSA Switches
8*833e5d42SEmmanuel Vadot
9*833e5d42SEmmanuel Vadotmaintainers:
10*833e5d42SEmmanuel Vadot  - Linus Walleij <linus.walleij@linaro.org>
11*833e5d42SEmmanuel Vadot
12*833e5d42SEmmanuel Vadotdescription:
13*833e5d42SEmmanuel Vadot  The Micrel KS8995 DSA Switches are 100 Mbit switches that were produced in
14*833e5d42SEmmanuel Vadot  the early-to-mid 2000s. The chip features a CPU port and four outgoing ports,
15*833e5d42SEmmanuel Vadot  each with an internal PHY. The chip itself is managed over SPI, but all the
16*833e5d42SEmmanuel Vadot  PHYs need to be accessed from an external MDIO channel.
17*833e5d42SEmmanuel Vadot
18*833e5d42SEmmanuel Vadot  Further, a fifth PHY is available and can be used separately from the switch
19*833e5d42SEmmanuel Vadot  fabric, connected to an external MII interface name MII-P5. This is
20*833e5d42SEmmanuel Vadot  unrelated from the CPU-facing port 5 which is used for DSA MII traffic.
21*833e5d42SEmmanuel Vadot
22*833e5d42SEmmanuel Vadotproperties:
23*833e5d42SEmmanuel Vadot  compatible:
24*833e5d42SEmmanuel Vadot    enum:
25*833e5d42SEmmanuel Vadot      - micrel,ks8995
26*833e5d42SEmmanuel Vadot      - micrel,ksz8795
27*833e5d42SEmmanuel Vadot      - micrel,ksz8864
28*833e5d42SEmmanuel Vadot
29*833e5d42SEmmanuel Vadot  reg:
30*833e5d42SEmmanuel Vadot    maxItems: 1
31*833e5d42SEmmanuel Vadot
32*833e5d42SEmmanuel Vadot  reset-gpios:
33*833e5d42SEmmanuel Vadot    description: GPIO to be used to reset the whole device
34*833e5d42SEmmanuel Vadot    maxItems: 1
35*833e5d42SEmmanuel Vadot
36*833e5d42SEmmanuel VadotallOf:
37*833e5d42SEmmanuel Vadot  - $ref: dsa.yaml#/$defs/ethernet-ports
38*833e5d42SEmmanuel Vadot  - $ref: /schemas/spi/spi-peripheral-props.yaml#
39*833e5d42SEmmanuel Vadot
40*833e5d42SEmmanuel Vadotrequired:
41*833e5d42SEmmanuel Vadot  - compatible
42*833e5d42SEmmanuel Vadot  - reg
43*833e5d42SEmmanuel Vadot
44*833e5d42SEmmanuel VadotunevaluatedProperties: false
45*833e5d42SEmmanuel Vadot
46*833e5d42SEmmanuel Vadotexamples:
47*833e5d42SEmmanuel Vadot  - |
48*833e5d42SEmmanuel Vadot    #include <dt-bindings/gpio/gpio.h>
49*833e5d42SEmmanuel Vadot
50*833e5d42SEmmanuel Vadot    spi {
51*833e5d42SEmmanuel Vadot      #address-cells = <1>;
52*833e5d42SEmmanuel Vadot      #size-cells = <0>;
53*833e5d42SEmmanuel Vadot
54*833e5d42SEmmanuel Vadot      ethernet-switch@0 {
55*833e5d42SEmmanuel Vadot        compatible = "micrel,ks8995";
56*833e5d42SEmmanuel Vadot        reg = <0>;
57*833e5d42SEmmanuel Vadot        spi-max-frequency = <25000000>;
58*833e5d42SEmmanuel Vadot
59*833e5d42SEmmanuel Vadot        ethernet-ports {
60*833e5d42SEmmanuel Vadot          #address-cells = <1>;
61*833e5d42SEmmanuel Vadot          #size-cells = <0>;
62*833e5d42SEmmanuel Vadot
63*833e5d42SEmmanuel Vadot          ethernet-port@0 {
64*833e5d42SEmmanuel Vadot            reg = <0>;
65*833e5d42SEmmanuel Vadot            label = "lan1";
66*833e5d42SEmmanuel Vadot          };
67*833e5d42SEmmanuel Vadot          ethernet-port@1 {
68*833e5d42SEmmanuel Vadot            reg = <1>;
69*833e5d42SEmmanuel Vadot            label = "lan2";
70*833e5d42SEmmanuel Vadot          };
71*833e5d42SEmmanuel Vadot          ethernet-port@2 {
72*833e5d42SEmmanuel Vadot            reg = <2>;
73*833e5d42SEmmanuel Vadot            label = "lan3";
74*833e5d42SEmmanuel Vadot          };
75*833e5d42SEmmanuel Vadot          ethernet-port@3 {
76*833e5d42SEmmanuel Vadot            reg = <3>;
77*833e5d42SEmmanuel Vadot            label = "lan4";
78*833e5d42SEmmanuel Vadot          };
79*833e5d42SEmmanuel Vadot          ethernet-port@4 {
80*833e5d42SEmmanuel Vadot            reg = <4>;
81*833e5d42SEmmanuel Vadot            ethernet = <&mac2>;
82*833e5d42SEmmanuel Vadot            phy-mode = "mii";
83*833e5d42SEmmanuel Vadot            fixed-link {
84*833e5d42SEmmanuel Vadot              speed = <100>;
85*833e5d42SEmmanuel Vadot              full-duplex;
86*833e5d42SEmmanuel Vadot            };
87*833e5d42SEmmanuel Vadot          };
88*833e5d42SEmmanuel Vadot        };
89*833e5d42SEmmanuel Vadot      };
90*833e5d42SEmmanuel Vadot    };
91*833e5d42SEmmanuel Vadot
92*833e5d42SEmmanuel Vadot    soc {
93*833e5d42SEmmanuel Vadot      #address-cells = <1>;
94*833e5d42SEmmanuel Vadot      #size-cells = <1>;
95*833e5d42SEmmanuel Vadot
96*833e5d42SEmmanuel Vadot      /* The WAN port connected on MII-P5 */
97*833e5d42SEmmanuel Vadot      ethernet-port@1000 {
98*833e5d42SEmmanuel Vadot        reg = <0x00001000 0x1000>;
99*833e5d42SEmmanuel Vadot        label = "wan";
100*833e5d42SEmmanuel Vadot        phy-mode = "mii";
101*833e5d42SEmmanuel Vadot        phy-handle = <&phy5>;
102*833e5d42SEmmanuel Vadot      };
103*833e5d42SEmmanuel Vadot
104*833e5d42SEmmanuel Vadot      mac2: ethernet-port@2000 {
105*833e5d42SEmmanuel Vadot        reg = <0x00002000 0x1000>;
106*833e5d42SEmmanuel Vadot        phy-mode = "mii";
107*833e5d42SEmmanuel Vadot        fixed-link {
108*833e5d42SEmmanuel Vadot          speed = <100>;
109*833e5d42SEmmanuel Vadot          full-duplex;
110*833e5d42SEmmanuel Vadot        };
111*833e5d42SEmmanuel Vadot      };
112*833e5d42SEmmanuel Vadot    };
113*833e5d42SEmmanuel Vadot
114*833e5d42SEmmanuel Vadot    mdio {
115*833e5d42SEmmanuel Vadot      #address-cells = <1>;
116*833e5d42SEmmanuel Vadot      #size-cells = <0>;
117*833e5d42SEmmanuel Vadot
118*833e5d42SEmmanuel Vadot      /* LAN PHYs 1-4 accessible over external MDIO */
119*833e5d42SEmmanuel Vadot      phy1: ethernet-phy@1 {
120*833e5d42SEmmanuel Vadot        reg = <1>;
121*833e5d42SEmmanuel Vadot      };
122*833e5d42SEmmanuel Vadot      phy2: ethernet-phy@2 {
123*833e5d42SEmmanuel Vadot        reg = <2>;
124*833e5d42SEmmanuel Vadot      };
125*833e5d42SEmmanuel Vadot      phy3: ethernet-phy@3 {
126*833e5d42SEmmanuel Vadot        reg = <3>;
127*833e5d42SEmmanuel Vadot      };
128*833e5d42SEmmanuel Vadot      phy4: ethernet-phy@4 {
129*833e5d42SEmmanuel Vadot        reg = <4>;
130*833e5d42SEmmanuel Vadot      };
131*833e5d42SEmmanuel Vadot      /* WAN PHY accessible over external MDIO */
132*833e5d42SEmmanuel Vadot      phy5: ethernet-phy@5 {
133*833e5d42SEmmanuel Vadot        reg = <5>;
134*833e5d42SEmmanuel Vadot      };
135*833e5d42SEmmanuel Vadot    };
136