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