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