blob: 21cc27e75f50a4a574d6ac483345731f91060040 [file] [log] [blame]
Tom Rini53633a82024-02-29 12:33:36 -05001# SPDX-License-Identifier: GPL-2.0
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/net/snps,dwmac.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Synopsys DesignWare MAC
8
9maintainers:
10 - Alexandre Torgue <alexandre.torgue@foss.st.com>
11 - Giuseppe Cavallaro <peppe.cavallaro@st.com>
12 - Jose Abreu <joabreu@synopsys.com>
13
14# Select every compatible, including the deprecated ones. This way, we
15# will be able to report a warning when we have that compatible, since
16# we will validate the node thanks to the select, but won't report it
17# as a valid value in the compatible property description
18select:
19 properties:
20 compatible:
21 contains:
22 enum:
23 - snps,dwmac
24 - snps,dwmac-3.40a
25 - snps,dwmac-3.50a
26 - snps,dwmac-3.610
27 - snps,dwmac-3.70a
28 - snps,dwmac-3.710
29 - snps,dwmac-4.00
30 - snps,dwmac-4.10a
31 - snps,dwmac-4.20a
32 - snps,dwmac-5.10a
33 - snps,dwmac-5.20
34 - snps,dwxgmac
35 - snps,dwxgmac-2.10
36
37 # Deprecated
38 - st,spear600-gmac
39
40 required:
41 - compatible
42
43properties:
44
45 # We need to include all the compatibles from schemas that will
46 # include that schemas, otherwise compatible won't validate for
47 # those.
48 compatible:
49 contains:
50 enum:
51 - allwinner,sun7i-a20-gmac
52 - allwinner,sun8i-a83t-emac
53 - allwinner,sun8i-h3-emac
54 - allwinner,sun8i-r40-gmac
55 - allwinner,sun8i-v3s-emac
56 - allwinner,sun50i-a64-emac
57 - amlogic,meson6-dwmac
58 - amlogic,meson8b-dwmac
59 - amlogic,meson8m2-dwmac
60 - amlogic,meson-gxbb-dwmac
61 - amlogic,meson-axg-dwmac
62 - ingenic,jz4775-mac
63 - ingenic,x1000-mac
64 - ingenic,x1600-mac
65 - ingenic,x1830-mac
66 - ingenic,x2000-mac
67 - loongson,ls2k-dwmac
68 - loongson,ls7a-dwmac
69 - qcom,qcs404-ethqos
70 - qcom,sa8775p-ethqos
71 - qcom,sc8280xp-ethqos
72 - qcom,sm8150-ethqos
73 - renesas,r9a06g032-gmac
74 - renesas,rzn1-gmac
75 - rockchip,px30-gmac
76 - rockchip,rk3128-gmac
77 - rockchip,rk3228-gmac
78 - rockchip,rk3288-gmac
79 - rockchip,rk3328-gmac
80 - rockchip,rk3366-gmac
81 - rockchip,rk3368-gmac
82 - rockchip,rk3588-gmac
83 - rockchip,rk3399-gmac
84 - rockchip,rv1108-gmac
85 - snps,dwmac
86 - snps,dwmac-3.40a
87 - snps,dwmac-3.50a
88 - snps,dwmac-3.610
89 - snps,dwmac-3.70a
90 - snps,dwmac-3.710
91 - snps,dwmac-4.00
92 - snps,dwmac-4.10a
93 - snps,dwmac-4.20a
94 - snps,dwmac-5.10a
95 - snps,dwmac-5.20
96 - snps,dwxgmac
97 - snps,dwxgmac-2.10
Tom Rini6bb92fc2024-05-20 09:54:58 -060098 - starfive,jh7100-dwmac
Tom Rini53633a82024-02-29 12:33:36 -050099 - starfive,jh7110-dwmac
100
101 reg:
102 minItems: 1
103 maxItems: 2
104
105 interrupts:
106 minItems: 1
107 items:
108 - description: Combined signal for various interrupt events
109 - description: The interrupt to manage the remote wake-up packet detection
110 - description: The interrupt that occurs when Rx exits the LPI state
Tom Rini6bb92fc2024-05-20 09:54:58 -0600111 - description: The interrupt that occurs when HW safety error triggered
Tom Rini53633a82024-02-29 12:33:36 -0500112
113 interrupt-names:
114 minItems: 1
115 items:
116 - const: macirq
Tom Rini6bb92fc2024-05-20 09:54:58 -0600117 - enum: [eth_wake_irq, eth_lpi, sfty]
118 - enum: [eth_wake_irq, eth_lpi, sfty]
119 - enum: [eth_wake_irq, eth_lpi, sfty]
Tom Rini53633a82024-02-29 12:33:36 -0500120
121 clocks:
122 minItems: 1
123 maxItems: 8
124 additionalItems: true
125 items:
126 - description: GMAC main clock
127 - description: Peripheral registers interface clock
128 - description:
129 PTP reference clock. This clock is used for programming the
130 Timestamp Addend Register. If not passed then the system
131 clock will be used and this is fine on some platforms.
132
133 clock-names:
134 minItems: 1
135 maxItems: 8
136 additionalItems: true
137 contains:
138 enum:
139 - stmmaceth
140 - pclk
141 - ptp_ref
142
143 resets:
144 minItems: 1
145 items:
146 - description: GMAC stmmaceth reset
147 - description: AHB reset
148
149 reset-names:
Tom Rini6bb92fc2024-05-20 09:54:58 -0600150 oneOf:
151 - items:
152 - enum: [stmmaceth, ahb]
153 - items:
154 - const: stmmaceth
155 - const: ahb
Tom Rini53633a82024-02-29 12:33:36 -0500156
157 power-domains:
158 maxItems: 1
159
160 mac-mode:
161 $ref: ethernet-controller.yaml#/properties/phy-connection-type
162 description:
163 The property is identical to 'phy-mode', and assumes that there is mode
164 converter in-between the MAC & PHY (e.g. GMII-to-RGMII). This converter
165 can be passive (no SW requirement), and requires that the MAC operate
166 in a different mode than the PHY in order to function.
167
168 snps,axi-config:
169 $ref: /schemas/types.yaml#/definitions/phandle
170 description:
171 AXI BUS Mode parameters. Phandle to a node that can contain the
172 following properties
173 * snps,lpi_en, enable Low Power Interface
174 * snps,xit_frm, unlock on WoL
175 * snps,wr_osr_lmt, max write outstanding req. limit
176 * snps,rd_osr_lmt, max read outstanding req. limit
177 * snps,kbbe, do not cross 1KiB boundary.
178 * snps,blen, this is a vector of supported burst length.
179 * snps,fb, fixed-burst
180 * snps,mb, mixed-burst
181 * snps,rb, rebuild INCRx Burst
182
183 snps,mtl-rx-config:
184 $ref: /schemas/types.yaml#/definitions/phandle
185 description:
186 Multiple RX Queues parameters. Phandle to a node that
187 implements the 'rx-queues-config' object described in
188 this binding.
189
190 rx-queues-config:
191 type: object
192 properties:
193 snps,rx-queues-to-use:
194 $ref: /schemas/types.yaml#/definitions/uint32
195 description: number of RX queues to be used in the driver
196 snps,rx-sched-sp:
197 type: boolean
198 description: Strict priority
199 snps,rx-sched-wsp:
200 type: boolean
201 description: Weighted Strict priority
202 allOf:
203 - if:
204 required:
205 - snps,rx-sched-sp
206 then:
207 properties:
208 snps,rx-sched-wsp: false
209 - if:
210 required:
211 - snps,rx-sched-wsp
212 then:
213 properties:
214 snps,rx-sched-sp: false
215 patternProperties:
216 "^queue[0-9]$":
217 description: Each subnode represents a queue.
218 type: object
219 properties:
220 snps,dcb-algorithm:
221 type: boolean
222 description: Queue to be enabled as DCB
223 snps,avb-algorithm:
224 type: boolean
225 description: Queue to be enabled as AVB
226 snps,map-to-dma-channel:
227 $ref: /schemas/types.yaml#/definitions/uint32
228 description: DMA channel id to map
229 snps,route-avcp:
230 type: boolean
231 description: AV Untagged Control packets
232 snps,route-ptp:
233 type: boolean
234 description: PTP Packets
235 snps,route-dcbcp:
236 type: boolean
237 description: DCB Control Packets
238 snps,route-up:
239 type: boolean
240 description: Untagged Packets
241 snps,route-multi-broad:
242 type: boolean
243 description: Multicast & Broadcast Packets
244 snps,priority:
Tom Rini762f85b2024-07-20 11:15:10 -0600245 $ref: /schemas/types.yaml#/definitions/uint32-array
246 maxItems: 1
Tom Rini53633a82024-02-29 12:33:36 -0500247 description: Bitmask of the tagged frames priorities assigned to the queue
248 allOf:
249 - if:
250 required:
251 - snps,dcb-algorithm
252 then:
253 properties:
254 snps,avb-algorithm: false
255 - if:
256 required:
257 - snps,avb-algorithm
258 then:
259 properties:
260 snps,dcb-algorithm: false
261 - if:
262 required:
263 - snps,route-avcp
264 then:
265 properties:
266 snps,route-ptp: false
267 snps,route-dcbcp: false
268 snps,route-up: false
269 snps,route-multi-broad: false
270 - if:
271 required:
272 - snps,route-ptp
273 then:
274 properties:
275 snps,route-avcp: false
276 snps,route-dcbcp: false
277 snps,route-up: false
278 snps,route-multi-broad: false
279 - if:
280 required:
281 - snps,route-dcbcp
282 then:
283 properties:
284 snps,route-avcp: false
285 snps,route-ptp: false
286 snps,route-up: false
287 snps,route-multi-broad: false
288 - if:
289 required:
290 - snps,route-up
291 then:
292 properties:
293 snps,route-avcp: false
294 snps,route-ptp: false
295 snps,route-dcbcp: false
296 snps,route-multi-broad: false
297 - if:
298 required:
299 - snps,route-multi-broad
300 then:
301 properties:
302 snps,route-avcp: false
303 snps,route-ptp: false
304 snps,route-dcbcp: false
305 snps,route-up: false
306 additionalProperties: false
307 additionalProperties: false
308
309 snps,mtl-tx-config:
310 $ref: /schemas/types.yaml#/definitions/phandle
311 description:
312 Multiple TX Queues parameters. Phandle to a node that
313 implements the 'tx-queues-config' object described in
314 this binding.
315
316 tx-queues-config:
317 type: object
318 properties:
319 snps,tx-queues-to-use:
320 $ref: /schemas/types.yaml#/definitions/uint32
321 description: number of TX queues to be used in the driver
322 snps,tx-sched-wrr:
323 type: boolean
324 description: Weighted Round Robin
325 snps,tx-sched-wfq:
326 type: boolean
327 description: Weighted Fair Queuing
328 snps,tx-sched-dwrr:
329 type: boolean
330 description: Deficit Weighted Round Robin
Tom Rini53633a82024-02-29 12:33:36 -0500331 allOf:
332 - if:
333 required:
334 - snps,tx-sched-wrr
335 then:
336 properties:
337 snps,tx-sched-wfq: false
338 snps,tx-sched-dwrr: false
Tom Rini53633a82024-02-29 12:33:36 -0500339 - if:
340 required:
341 - snps,tx-sched-wfq
342 then:
343 properties:
344 snps,tx-sched-wrr: false
345 snps,tx-sched-dwrr: false
Tom Rini53633a82024-02-29 12:33:36 -0500346 - if:
347 required:
348 - snps,tx-sched-dwrr
349 then:
350 properties:
351 snps,tx-sched-wrr: false
352 snps,tx-sched-wfq: false
Tom Rini53633a82024-02-29 12:33:36 -0500353 patternProperties:
354 "^queue[0-9]$":
355 description: Each subnode represents a queue.
356 type: object
357 properties:
358 snps,weight:
359 $ref: /schemas/types.yaml#/definitions/uint32
360 description: TX queue weight (if using a DCB weight algorithm)
361 snps,dcb-algorithm:
362 type: boolean
363 description: TX queue will be working in DCB
364 snps,avb-algorithm:
365 type: boolean
366 description:
367 TX queue will be working in AVB.
368 Queue 0 is reserved for legacy traffic and so no AVB is
369 available in this queue.
370 snps,send_slope:
371 $ref: /schemas/types.yaml#/definitions/uint32
372 description: enable Low Power Interface
373 snps,idle_slope:
374 $ref: /schemas/types.yaml#/definitions/uint32
375 description: unlock on WoL
376 snps,high_credit:
377 $ref: /schemas/types.yaml#/definitions/uint32
378 description: max write outstanding req. limit
379 snps,low_credit:
380 $ref: /schemas/types.yaml#/definitions/uint32
381 description: max read outstanding req. limit
382 snps,priority:
Tom Rini762f85b2024-07-20 11:15:10 -0600383 $ref: /schemas/types.yaml#/definitions/uint32-array
384 maxItems: 1
Tom Rini53633a82024-02-29 12:33:36 -0500385 description:
386 Bitmask of the tagged frames priorities assigned to the queue.
387 When a PFC frame is received with priorities matching the bitmask,
388 the queue is blocked from transmitting for the pause time specified
389 in the PFC frame.
390
391 snps,coe-unsupported:
392 type: boolean
393 description: TX checksum offload is unsupported by the TX queue.
394
395 allOf:
396 - if:
397 required:
398 - snps,dcb-algorithm
399 then:
400 properties:
401 snps,avb-algorithm: false
402 - if:
403 required:
404 - snps,avb-algorithm
405 then:
406 properties:
407 snps,dcb-algorithm: false
408 snps,weight: false
409 additionalProperties: false
410 additionalProperties: false
411
412 snps,reset-gpio:
413 deprecated: true
414 maxItems: 1
415 description:
416 PHY Reset GPIO
417
418 snps,reset-active-low:
419 deprecated: true
420 $ref: /schemas/types.yaml#/definitions/flag
421 description:
422 Indicates that the PHY Reset is active low
423
424 snps,reset-delays-us:
425 deprecated: true
426 description:
427 Triplet of delays. The 1st cell is reset pre-delay in micro
428 seconds. The 2nd cell is reset pulse in micro seconds. The 3rd
429 cell is reset post-delay in micro seconds.
430 minItems: 3
431 maxItems: 3
432
433 snps,aal:
434 $ref: /schemas/types.yaml#/definitions/flag
435 description:
436 Use Address-Aligned Beats
437
438 snps,fixed-burst:
439 $ref: /schemas/types.yaml#/definitions/flag
440 description:
441 Program the DMA to use the fixed burst mode
442
443 snps,mixed-burst:
444 $ref: /schemas/types.yaml#/definitions/flag
445 description:
446 Program the DMA to use the mixed burst mode
447
448 snps,force_thresh_dma_mode:
449 $ref: /schemas/types.yaml#/definitions/flag
450 description:
451 Force DMA to use the threshold mode for both tx and rx
452
453 snps,force_sf_dma_mode:
454 $ref: /schemas/types.yaml#/definitions/flag
455 description:
456 Force DMA to use the Store and Forward mode for both tx and
457 rx. This flag is ignored if force_thresh_dma_mode is set.
458
459 snps,en-tx-lpi-clockgating:
460 $ref: /schemas/types.yaml#/definitions/flag
461 description:
462 Enable gating of the MAC TX clock during TX low-power mode
463
464 snps,multicast-filter-bins:
465 $ref: /schemas/types.yaml#/definitions/uint32
466 description:
467 Number of multicast filter hash bins supported by this device
468 instance
469
470 snps,perfect-filter-entries:
471 $ref: /schemas/types.yaml#/definitions/uint32
472 description:
473 Number of perfect filter entries supported by this device
474 instance
475
476 snps,ps-speed:
477 $ref: /schemas/types.yaml#/definitions/uint32
478 description:
479 Port selection speed that can be passed to the core when PCS
480 is supported. For example, this is used in case of SGMII and
481 MAC2MAC connection.
482
483 snps,clk-csr:
484 $ref: /schemas/types.yaml#/definitions/uint32
485 description:
486 Frequency division factor for MDC clock.
487
488 mdio:
489 $ref: mdio.yaml#
490 unevaluatedProperties: false
491 description:
492 Creates and registers an MDIO bus.
493
494 properties:
495 compatible:
496 const: snps,dwmac-mdio
497
498 required:
499 - compatible
500
501 stmmac-axi-config:
502 type: object
503 unevaluatedProperties: false
504 description:
505 AXI BUS Mode parameters.
506
507 properties:
508 snps,lpi_en:
509 $ref: /schemas/types.yaml#/definitions/flag
510 description:
511 enable Low Power Interface
512
513 snps,xit_frm:
514 $ref: /schemas/types.yaml#/definitions/flag
515 description:
516 unlock on WoL
517
518 snps,wr_osr_lmt:
519 $ref: /schemas/types.yaml#/definitions/uint32
520 description:
521 max write outstanding req. limit
522
523 snps,rd_osr_lmt:
524 $ref: /schemas/types.yaml#/definitions/uint32
525 description:
526 max read outstanding req. limit
527
528 snps,kbbe:
529 $ref: /schemas/types.yaml#/definitions/uint32
530 description:
531 do not cross 1KiB boundary.
532
533 snps,blen:
534 $ref: /schemas/types.yaml#/definitions/uint32-array
535 description:
536 this is a vector of supported burst length.
537 minItems: 7
538 maxItems: 7
539
540 snps,fb:
541 $ref: /schemas/types.yaml#/definitions/flag
542 description:
543 fixed-burst
544
545 snps,mb:
546 $ref: /schemas/types.yaml#/definitions/flag
547 description:
548 mixed-burst
549
550 snps,rb:
551 $ref: /schemas/types.yaml#/definitions/flag
552 description:
553 rebuild INCRx Burst
554
555required:
556 - compatible
557 - reg
558 - interrupts
559 - interrupt-names
560 - phy-mode
561
562dependencies:
563 snps,reset-active-low: ["snps,reset-gpio"]
564 snps,reset-delays-us: ["snps,reset-gpio"]
565
566allOf:
567 - $ref: ethernet-controller.yaml#
568 - if:
569 properties:
570 compatible:
571 contains:
572 enum:
573 - allwinner,sun7i-a20-gmac
574 - allwinner,sun8i-a83t-emac
575 - allwinner,sun8i-h3-emac
576 - allwinner,sun8i-r40-gmac
577 - allwinner,sun8i-v3s-emac
578 - allwinner,sun50i-a64-emac
579 - ingenic,jz4775-mac
580 - ingenic,x1000-mac
581 - ingenic,x1600-mac
582 - ingenic,x1830-mac
583 - ingenic,x2000-mac
584 - qcom,sa8775p-ethqos
585 - qcom,sc8280xp-ethqos
586 - snps,dwmac-3.50a
587 - snps,dwmac-4.10a
588 - snps,dwmac-4.20a
589 - snps,dwmac-5.20
590 - snps,dwxgmac
591 - snps,dwxgmac-2.10
592 - st,spear600-gmac
593
594 then:
595 properties:
596 snps,pbl:
597 description:
598 Programmable Burst Length (tx and rx)
599 $ref: /schemas/types.yaml#/definitions/uint32
600 enum: [1, 2, 4, 8, 16, 32]
601
602 snps,txpbl:
603 description:
604 Tx Programmable Burst Length. If set, DMA tx will use this
605 value rather than snps,pbl.
606 $ref: /schemas/types.yaml#/definitions/uint32
607 enum: [1, 2, 4, 8, 16, 32]
608
609 snps,rxpbl:
610 description:
611 Rx Programmable Burst Length. If set, DMA rx will use this
612 value rather than snps,pbl.
613 $ref: /schemas/types.yaml#/definitions/uint32
614 enum: [1, 2, 4, 8, 16, 32]
615
616 snps,no-pbl-x8:
617 $ref: /schemas/types.yaml#/definitions/flag
618 description:
619 Don\'t multiply the pbl/txpbl/rxpbl values by 8. For core
620 rev < 3.50, don\'t multiply the values by 4.
621
622 - if:
623 properties:
624 compatible:
625 contains:
626 enum:
627 - allwinner,sun7i-a20-gmac
628 - allwinner,sun8i-a83t-emac
629 - allwinner,sun8i-h3-emac
630 - allwinner,sun8i-r40-gmac
631 - allwinner,sun8i-v3s-emac
632 - allwinner,sun50i-a64-emac
633 - loongson,ls2k-dwmac
634 - loongson,ls7a-dwmac
635 - ingenic,jz4775-mac
636 - ingenic,x1000-mac
637 - ingenic,x1600-mac
638 - ingenic,x1830-mac
639 - ingenic,x2000-mac
640 - qcom,qcs404-ethqos
641 - qcom,sa8775p-ethqos
642 - qcom,sc8280xp-ethqos
643 - qcom,sm8150-ethqos
644 - snps,dwmac-4.00
645 - snps,dwmac-4.10a
646 - snps,dwmac-4.20a
647 - snps,dwmac-5.10a
648 - snps,dwmac-5.20
649 - snps,dwxgmac
650 - snps,dwxgmac-2.10
651 - st,spear600-gmac
652
653 then:
654 properties:
655 snps,tso:
656 $ref: /schemas/types.yaml#/definitions/flag
657 description:
658 Enables the TSO feature otherwise it will be managed by
659 MAC HW capability register.
660
661additionalProperties: true
662
663examples:
664 - |
665 gmac0: ethernet@e0800000 {
666 compatible = "snps,dwxgmac-2.10", "snps,dwxgmac";
667 reg = <0xe0800000 0x8000>;
668 interrupt-parent = <&vic1>;
669 interrupts = <24 23 22>;
670 interrupt-names = "macirq", "eth_wake_irq", "eth_lpi";
671 mac-address = [000000000000]; /* Filled in by U-Boot */
672 max-frame-size = <3800>;
673 phy-mode = "gmii";
674 snps,multicast-filter-bins = <256>;
675 snps,perfect-filter-entries = <128>;
676 rx-fifo-depth = <16384>;
677 tx-fifo-depth = <16384>;
678 clocks = <&clock>;
679 clock-names = "stmmaceth";
680 snps,axi-config = <&stmmac_axi_setup>;
681 snps,mtl-rx-config = <&mtl_rx_setup>;
682 snps,mtl-tx-config = <&mtl_tx_setup>;
683
684 stmmac_axi_setup: stmmac-axi-config {
685 snps,wr_osr_lmt = <0xf>;
686 snps,rd_osr_lmt = <0xf>;
687 snps,blen = <256 128 64 32 0 0 0>;
688 };
689
690 mtl_rx_setup: rx-queues-config {
691 snps,rx-queues-to-use = <1>;
692 snps,rx-sched-sp;
693 queue0 {
694 snps,dcb-algorithm;
695 snps,map-to-dma-channel = <0x0>;
696 snps,priority = <0x0>;
697 };
698 };
699
700 mtl_tx_setup: tx-queues-config {
701 snps,tx-queues-to-use = <2>;
702 snps,tx-sched-wrr;
703 queue0 {
704 snps,weight = <0x10>;
705 snps,dcb-algorithm;
706 snps,priority = <0x0>;
707 };
708
709 queue1 {
710 snps,avb-algorithm;
711 snps,send_slope = <0x1000>;
712 snps,idle_slope = <0x1000>;
713 snps,high_credit = <0x3E800>;
714 snps,low_credit = <0xFFC18000>;
715 snps,priority = <0x1>;
716 };
717 };
718
719 mdio0 {
720 #address-cells = <1>;
721 #size-cells = <0>;
722 compatible = "snps,dwmac-mdio";
723 phy1: ethernet-phy@0 {
724 reg = <0>;
725 };
726 };
727 };
728
729# FIXME: We should set it, but it would report all the generic
730# properties as additional properties.
731# additionalProperties: false
732
733...