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