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