xref: /freebsd/sys/contrib/device-tree/Bindings/net/dsa/microchip,lan937x.yaml (revision b97ee269eae3cbaf35c18f51a459aea581c2a7dc)
1*b97ee269SEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2*b97ee269SEmmanuel Vadot%YAML 1.2
3*b97ee269SEmmanuel Vadot---
4*b97ee269SEmmanuel Vadot$id: http://devicetree.org/schemas/net/dsa/microchip,lan937x.yaml#
5*b97ee269SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6*b97ee269SEmmanuel Vadot
7*b97ee269SEmmanuel Vadottitle: LAN937x Ethernet Switch Series Tree Bindings
8*b97ee269SEmmanuel Vadot
9*b97ee269SEmmanuel Vadotmaintainers:
10*b97ee269SEmmanuel Vadot  - UNGLinuxDriver@microchip.com
11*b97ee269SEmmanuel Vadot
12*b97ee269SEmmanuel VadotallOf:
13*b97ee269SEmmanuel Vadot  - $ref: dsa.yaml#
14*b97ee269SEmmanuel Vadot
15*b97ee269SEmmanuel Vadotproperties:
16*b97ee269SEmmanuel Vadot  compatible:
17*b97ee269SEmmanuel Vadot    enum:
18*b97ee269SEmmanuel Vadot      - microchip,lan9370
19*b97ee269SEmmanuel Vadot      - microchip,lan9371
20*b97ee269SEmmanuel Vadot      - microchip,lan9372
21*b97ee269SEmmanuel Vadot      - microchip,lan9373
22*b97ee269SEmmanuel Vadot      - microchip,lan9374
23*b97ee269SEmmanuel Vadot
24*b97ee269SEmmanuel Vadot  reg:
25*b97ee269SEmmanuel Vadot    maxItems: 1
26*b97ee269SEmmanuel Vadot
27*b97ee269SEmmanuel Vadot  spi-max-frequency:
28*b97ee269SEmmanuel Vadot    maximum: 50000000
29*b97ee269SEmmanuel Vadot
30*b97ee269SEmmanuel Vadot  reset-gpios:
31*b97ee269SEmmanuel Vadot    description: Optional gpio specifier for a reset line
32*b97ee269SEmmanuel Vadot    maxItems: 1
33*b97ee269SEmmanuel Vadot
34*b97ee269SEmmanuel Vadot  mdio:
35*b97ee269SEmmanuel Vadot    $ref: /schemas/net/mdio.yaml#
36*b97ee269SEmmanuel Vadot    unevaluatedProperties: false
37*b97ee269SEmmanuel Vadot
38*b97ee269SEmmanuel VadotpatternProperties:
39*b97ee269SEmmanuel Vadot  "^(ethernet-)?ports$":
40*b97ee269SEmmanuel Vadot    patternProperties:
41*b97ee269SEmmanuel Vadot      "^(ethernet-)?port@[0-9]+$":
42*b97ee269SEmmanuel Vadot        allOf:
43*b97ee269SEmmanuel Vadot          - if:
44*b97ee269SEmmanuel Vadot              properties:
45*b97ee269SEmmanuel Vadot                phy-mode:
46*b97ee269SEmmanuel Vadot                  contains:
47*b97ee269SEmmanuel Vadot                    enum:
48*b97ee269SEmmanuel Vadot                      - rgmii
49*b97ee269SEmmanuel Vadot                      - rgmii-id
50*b97ee269SEmmanuel Vadot                      - rgmii-txid
51*b97ee269SEmmanuel Vadot                      - rgmii-rxid
52*b97ee269SEmmanuel Vadot            then:
53*b97ee269SEmmanuel Vadot              properties:
54*b97ee269SEmmanuel Vadot                rx-internal-delay-ps:
55*b97ee269SEmmanuel Vadot                  enum: [0, 2000]
56*b97ee269SEmmanuel Vadot                  default: 0
57*b97ee269SEmmanuel Vadot                tx-internal-delay-ps:
58*b97ee269SEmmanuel Vadot                  enum: [0, 2000]
59*b97ee269SEmmanuel Vadot                  default: 0
60*b97ee269SEmmanuel Vadot
61*b97ee269SEmmanuel Vadotrequired:
62*b97ee269SEmmanuel Vadot  - compatible
63*b97ee269SEmmanuel Vadot  - reg
64*b97ee269SEmmanuel Vadot
65*b97ee269SEmmanuel VadotunevaluatedProperties: false
66*b97ee269SEmmanuel Vadot
67*b97ee269SEmmanuel Vadotexamples:
68*b97ee269SEmmanuel Vadot  - |
69*b97ee269SEmmanuel Vadot    #include <dt-bindings/gpio/gpio.h>
70*b97ee269SEmmanuel Vadot
71*b97ee269SEmmanuel Vadot    macb0 {
72*b97ee269SEmmanuel Vadot            #address-cells = <1>;
73*b97ee269SEmmanuel Vadot            #size-cells = <0>;
74*b97ee269SEmmanuel Vadot
75*b97ee269SEmmanuel Vadot            fixed-link {
76*b97ee269SEmmanuel Vadot                    speed = <1000>;
77*b97ee269SEmmanuel Vadot                    full-duplex;
78*b97ee269SEmmanuel Vadot            };
79*b97ee269SEmmanuel Vadot    };
80*b97ee269SEmmanuel Vadot
81*b97ee269SEmmanuel Vadot    spi {
82*b97ee269SEmmanuel Vadot            #address-cells = <1>;
83*b97ee269SEmmanuel Vadot            #size-cells = <0>;
84*b97ee269SEmmanuel Vadot
85*b97ee269SEmmanuel Vadot            lan9374: switch@0 {
86*b97ee269SEmmanuel Vadot                    compatible = "microchip,lan9374";
87*b97ee269SEmmanuel Vadot                    reg = <0>;
88*b97ee269SEmmanuel Vadot                    spi-max-frequency = <44000000>;
89*b97ee269SEmmanuel Vadot
90*b97ee269SEmmanuel Vadot                    ethernet-ports {
91*b97ee269SEmmanuel Vadot                            #address-cells = <1>;
92*b97ee269SEmmanuel Vadot                            #size-cells = <0>;
93*b97ee269SEmmanuel Vadot
94*b97ee269SEmmanuel Vadot                            port@0 {
95*b97ee269SEmmanuel Vadot                                    reg = <0>;
96*b97ee269SEmmanuel Vadot                                    label = "lan1";
97*b97ee269SEmmanuel Vadot                                    phy-mode = "internal";
98*b97ee269SEmmanuel Vadot                                    phy-handle = <&t1phy0>;
99*b97ee269SEmmanuel Vadot                            };
100*b97ee269SEmmanuel Vadot
101*b97ee269SEmmanuel Vadot                            port@1 {
102*b97ee269SEmmanuel Vadot                                    reg = <1>;
103*b97ee269SEmmanuel Vadot                                    label = "lan2";
104*b97ee269SEmmanuel Vadot                                    phy-mode = "internal";
105*b97ee269SEmmanuel Vadot                                    phy-handle = <&t1phy1>;
106*b97ee269SEmmanuel Vadot                            };
107*b97ee269SEmmanuel Vadot
108*b97ee269SEmmanuel Vadot                            port@2 {
109*b97ee269SEmmanuel Vadot                                    reg = <2>;
110*b97ee269SEmmanuel Vadot                                    label = "lan4";
111*b97ee269SEmmanuel Vadot                                    phy-mode = "internal";
112*b97ee269SEmmanuel Vadot                                    phy-handle = <&t1phy2>;
113*b97ee269SEmmanuel Vadot                            };
114*b97ee269SEmmanuel Vadot
115*b97ee269SEmmanuel Vadot                            port@3 {
116*b97ee269SEmmanuel Vadot                                    reg = <3>;
117*b97ee269SEmmanuel Vadot                                    label = "lan6";
118*b97ee269SEmmanuel Vadot                                    phy-mode = "internal";
119*b97ee269SEmmanuel Vadot                                    phy-handle = <&t1phy3>;
120*b97ee269SEmmanuel Vadot                            };
121*b97ee269SEmmanuel Vadot
122*b97ee269SEmmanuel Vadot                            port@4 {
123*b97ee269SEmmanuel Vadot                                    reg = <4>;
124*b97ee269SEmmanuel Vadot                                    phy-mode = "rgmii";
125*b97ee269SEmmanuel Vadot                                    tx-internal-delay-ps = <2000>;
126*b97ee269SEmmanuel Vadot                                    rx-internal-delay-ps = <2000>;
127*b97ee269SEmmanuel Vadot                                    ethernet = <&macb0>;
128*b97ee269SEmmanuel Vadot
129*b97ee269SEmmanuel Vadot                                    fixed-link {
130*b97ee269SEmmanuel Vadot                                            speed = <1000>;
131*b97ee269SEmmanuel Vadot                                            full-duplex;
132*b97ee269SEmmanuel Vadot                                    };
133*b97ee269SEmmanuel Vadot                            };
134*b97ee269SEmmanuel Vadot
135*b97ee269SEmmanuel Vadot                            port@5 {
136*b97ee269SEmmanuel Vadot                                    reg = <5>;
137*b97ee269SEmmanuel Vadot                                    label = "lan7";
138*b97ee269SEmmanuel Vadot                                    phy-mode = "rgmii";
139*b97ee269SEmmanuel Vadot                                    tx-internal-delay-ps = <2000>;
140*b97ee269SEmmanuel Vadot                                    rx-internal-delay-ps = <2000>;
141*b97ee269SEmmanuel Vadot
142*b97ee269SEmmanuel Vadot                                    fixed-link {
143*b97ee269SEmmanuel Vadot                                            speed = <1000>;
144*b97ee269SEmmanuel Vadot                                            full-duplex;
145*b97ee269SEmmanuel Vadot                                    };
146*b97ee269SEmmanuel Vadot                            };
147*b97ee269SEmmanuel Vadot
148*b97ee269SEmmanuel Vadot                            port@6 {
149*b97ee269SEmmanuel Vadot                                    reg = <6>;
150*b97ee269SEmmanuel Vadot                                    label = "lan5";
151*b97ee269SEmmanuel Vadot                                    phy-mode = "internal";
152*b97ee269SEmmanuel Vadot                                    phy-handle = <&t1phy6>;
153*b97ee269SEmmanuel Vadot                            };
154*b97ee269SEmmanuel Vadot
155*b97ee269SEmmanuel Vadot                            port@7 {
156*b97ee269SEmmanuel Vadot                                    reg = <7>;
157*b97ee269SEmmanuel Vadot                                    label = "lan3";
158*b97ee269SEmmanuel Vadot                                    phy-mode = "internal";
159*b97ee269SEmmanuel Vadot                                    phy-handle = <&t1phy7>;
160*b97ee269SEmmanuel Vadot                            };
161*b97ee269SEmmanuel Vadot                    };
162*b97ee269SEmmanuel Vadot
163*b97ee269SEmmanuel Vadot                    mdio {
164*b97ee269SEmmanuel Vadot                            #address-cells = <1>;
165*b97ee269SEmmanuel Vadot                            #size-cells = <0>;
166*b97ee269SEmmanuel Vadot
167*b97ee269SEmmanuel Vadot                            t1phy0: ethernet-phy@0{
168*b97ee269SEmmanuel Vadot                                    reg = <0x0>;
169*b97ee269SEmmanuel Vadot                            };
170*b97ee269SEmmanuel Vadot
171*b97ee269SEmmanuel Vadot                            t1phy1: ethernet-phy@1{
172*b97ee269SEmmanuel Vadot                                    reg = <0x1>;
173*b97ee269SEmmanuel Vadot                            };
174*b97ee269SEmmanuel Vadot
175*b97ee269SEmmanuel Vadot                            t1phy2: ethernet-phy@2{
176*b97ee269SEmmanuel Vadot                                    reg = <0x2>;
177*b97ee269SEmmanuel Vadot                            };
178*b97ee269SEmmanuel Vadot
179*b97ee269SEmmanuel Vadot                            t1phy3: ethernet-phy@3{
180*b97ee269SEmmanuel Vadot                                    reg = <0x3>;
181*b97ee269SEmmanuel Vadot                            };
182*b97ee269SEmmanuel Vadot
183*b97ee269SEmmanuel Vadot                            t1phy6: ethernet-phy@6{
184*b97ee269SEmmanuel Vadot                                    reg = <0x6>;
185*b97ee269SEmmanuel Vadot                            };
186*b97ee269SEmmanuel Vadot
187*b97ee269SEmmanuel Vadot                            t1phy7: ethernet-phy@7{
188*b97ee269SEmmanuel Vadot                                    reg = <0x7>;
189*b97ee269SEmmanuel Vadot                            };
190*b97ee269SEmmanuel Vadot                    };
191*b97ee269SEmmanuel Vadot            };
192*b97ee269SEmmanuel Vadot    };
193