Debian Codegraph @

Documentation/devicetree/bindings/net/dsa/lantiq,gswip.yaml

raw
1 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2 %YAML 1.2
3 ---
4 $id: http://devicetree.org/schemas/net/dsa/lantiq,gswip.yaml#
5 $schema: http://devicetree.org/meta-schemas/core.yaml#
6
7 title: Lantiq GSWIP and MaxLinear GSW1xx Ethernet switches
8
9 description:
10 Lantiq GSWIP and MaxLinear GSW1xx switches share the same hardware IP.
11 Lantiq switches are embedded in SoCs and accessed via memory-mapped I/O,
12 while MaxLinear switches are standalone ICs connected via MDIO.
13
14 $ref: dsa.yaml#
15
16 maintainers:
17 - Hauke Mehrtens <[email protected]>
18
19 properties:
20 compatible:
21 enum:
22 - intel,gsw150
23 - lantiq,peb7084
24 - lantiq,xrx200-gswip
25 - lantiq,xrx300-gswip
26 - lantiq,xrx330-gswip
27 - maxlinear,gsw120
28 - maxlinear,gsw125
29 - maxlinear,gsw140
30 - maxlinear,gsw141
31 - maxlinear,gsw145
32
33 reg:
34 minItems: 1
35 maxItems: 3
36
37 reg-names:
38 items:
39 - const: switch
40 - const: mdio
41 - const: mii
42
43 mdio:
44 $ref: /schemas/net/mdio.yaml#
45 unevaluatedProperties: false
46
47 properties:
48 compatible:
49 const: lantiq,xrx200-mdio
50
51 gphy-fw:
52 type: object
53 properties:
54 '#address-cells':
55 const: 1
56
57 '#size-cells':
58 const: 0
59
60 compatible:
61 items:
62 - enum:
63 - lantiq,xrx200-gphy-fw
64 - lantiq,xrx300-gphy-fw
65 - lantiq,xrx330-gphy-fw
66 - const: lantiq,gphy-fw
67
68 lantiq,rcu:
69 $ref: /schemas/types.yaml#/definitions/phandle
70 description: phandle to the RCU syscon
71
72 patternProperties:
73 "^gphy@[0-9a-f]{1,2}$":
74 type: object
75
76 additionalProperties: false
77
78 properties:
79 reg:
80 minimum: 0
81 maximum: 255
82 description:
83 Offset of the GPHY firmware register in the RCU register range
84
85 resets:
86 items:
87 - description: GPHY reset line
88
89 reset-names:
90 items:
91 - const: gphy
92
93 required:
94 - reg
95
96 required:
97 - compatible
98 - lantiq,rcu
99
100 additionalProperties: false
101
102 patternProperties:
103 "^(ethernet-)?ports$":
104 type: object
105 patternProperties:
106 "^(ethernet-)?port@[0-6]$":
107 $ref: dsa-port.yaml#
108 allOf:
109 - $ref: /schemas/phy/phy-common-props.yaml#
110 unevaluatedProperties: false
111
112 properties:
113 maxlinear,slew-rate-txc:
114 $ref: /schemas/types.yaml#/definitions/uint32
115 enum: [0, 1]
116 description: |
117 RMII/RGMII TX Clock Slew Rate:
118
119 0: Normal
120 1: Slow
121
122 If not present, the configuration made by the switch bootloader is
123 preserved.
124 maxlinear,slew-rate-txd:
125 $ref: /schemas/types.yaml#/definitions/uint32
126 enum: [0, 1]
127 description: |
128 RMII/RGMII TX Non-Clock PAD Slew Rate:
129
130 0: Normal
131 1: Slow
132
133 If not present, the configuration made by the switch bootloader is
134 preserved.
135 maxlinear,rmii-refclk-out:
136 type: boolean
137 description:
138 Configure the RMII reference clock to be a clock output
139 rather than an input. Only applicable for RMII mode.
140 tx-internal-delay-ps:
141 enum: [0, 500, 1000, 1500, 2000, 2500, 3000, 3500]
142 description:
143 RGMII TX Clock Delay defined in pico seconds.
144 The delay lines adjust the MII clock vs. data timing.
145 If this property is not present the delay is determined by
146 the interface mode.
147 rx-internal-delay-ps:
148 enum: [0, 500, 1000, 1500, 2000, 2500, 3000, 3500]
149 description:
150 RGMII RX Clock Delay defined in pico seconds.
151 The delay lines adjust the MII clock vs. data timing.
152 If this property is not present the delay is determined by
153 the interface mode.
154
155 required:
156 - compatible
157 - reg
158
159 allOf:
160 - if:
161 properties:
162 compatible:
163 contains:
164 enum:
165 - lantiq,xrx200-gswip
166 - lantiq,xrx300-gswip
167 - lantiq,xrx330-gswip
168 then:
169 properties:
170 reg:
171 minItems: 3
172 maxItems: 3
173 mdio:
174 required:
175 - compatible
176 else:
177 properties:
178 reg:
179 maxItems: 1
180 reg-names: false
181 gphy-fw: false
182
183 unevaluatedProperties: false
184
185 examples:
186 - |
187 switch@e108000 {
188 compatible = "lantiq,xrx200-gswip";
189 reg = <0xe108000 0x3100>, /* switch */
190 <0xe10b100 0xd8>, /* mdio */
191 <0xe10b1d8 0x130>; /* mii */
192 dsa,member = <0 0>;
193
194 ports {
195 #address-cells = <1>;
196 #size-cells = <0>;
197
198 port@0 {
199 reg = <0>;
200 label = "lan3";
201 phy-mode = "rgmii-id";
202 phy-handle = <&phy0>;
203 tx-internal-delay-ps = <2000>;
204 rx-internal-delay-ps = <2000>;
205 };
206
207 port@1 {
208 reg = <1>;
209 label = "lan4";
210 phy-mode = "rgmii";
211 phy-handle = <&phy1>;
212 };
213
214 port@2 {
215 reg = <2>;
216 label = "lan2";
217 phy-mode = "internal";
218 phy-handle = <&phy11>;
219 };
220
221 port@4 {
222 reg = <4>;
223 label = "lan1";
224 phy-mode = "internal";
225 phy-handle = <&phy13>;
226 };
227
228 port@5 {
229 reg = <5>;
230 label = "wan";
231 phy-mode = "rgmii";
232 phy-handle = <&phy5>;
233 };
234
235 port@6 {
236 reg = <0x6>;
237 phy-mode = "internal";
238 ethernet = <&eth0>;
239
240 fixed-link {
241 speed = <1000>;
242 full-duplex;
243 };
244 };
245 };
246
247 mdio {
248 #address-cells = <1>;
249 #size-cells = <0>;
250 compatible = "lantiq,xrx200-mdio";
251
252 phy0: ethernet-phy@0 {
253 reg = <0x0>;
254 };
255 phy1: ethernet-phy@1 {
256 reg = <0x1>;
257 };
258 phy5: ethernet-phy@5 {
259 reg = <0x5>;
260 };
261 phy11: ethernet-phy@11 {
262 reg = <0x11>;
263 };
264 phy13: ethernet-phy@13 {
265 reg = <0x13>;
266 };
267 };
268
269 gphy-fw {
270 #address-cells = <1>;
271 #size-cells = <0>;
272 compatible = "lantiq,xrx200-gphy-fw", "lantiq,gphy-fw";
273 lantiq,rcu = <&rcu0>;
274
275 gphy@20 {
276 reg = <0x20>;
277
278 resets = <&reset0 31 30>;
279 reset-names = "gphy";
280 };
281
282 gphy@68 {
283 reg = <0x68>;
284
285 resets = <&reset0 29 28>;
286 reset-names = "gphy";
287 };
288 };
289 };
290
291 - |
292 #include <dt-bindings/leds/common.h>
293 #include <dt-bindings/phy/phy.h>
294
295 mdio {
296 #address-cells = <1>;
297 #size-cells = <0>;
298
299 switch@1f {
300 compatible = "maxlinear,gsw125";
301 reg = <0x1f>;
302
303 ports {
304 #address-cells = <1>;
305 #size-cells = <0>;
306
307 port@0 {
308 reg = <0>;
309 label = "lan0";
310 phy-handle = <&switchphy0>;
311 phy-mode = "internal";
312 };
313
314 port@1 {
315 reg = <1>;
316 label = "lan1";
317 phy-handle = <&switchphy1>;
318 phy-mode = "internal";
319 };
320
321 port@4 {
322 reg = <4>;
323 label = "wan";
324 phy-mode = "1000base-x";
325 managed = "in-band-status";
326 tx-polarity = <PHY_POL_INVERT>;
327 };
328
329 port@5 {
330 reg = <5>;
331 phy-mode = "rgmii-id";
332 tx-internal-delay-ps = <2000>;
333 rx-internal-delay-ps = <2000>;
334 ethernet = <&eth0>;
335
336 fixed-link {
337 speed = <1000>;
338 full-duplex;
339 };
340 };
341 };
342
343 mdio {
344 #address-cells = <1>;
345 #size-cells = <0>;
346
347 switchphy0: ethernet-phy@0 {
348 reg = <0>;
349
350 leds {
351 #address-cells = <1>;
352 #size-cells = <0>;
353
354 led@0 {
355 reg = <0>;
356 color = <LED_COLOR_ID_GREEN>;
357 function = LED_FUNCTION_LAN;
358 };
359 };
360 };
361
362 switchphy1: ethernet-phy@1 {
363 reg = <1>;
364
365 leds {
366 #address-cells = <1>;
367 #size-cells = <0>;
368
369 led@0 {
370 reg = <0>;
371 color = <LED_COLOR_ID_GREEN>;
372 function = LED_FUNCTION_LAN;
373 };
374 };
375 };
376 };
377 };
378 };