xref: /linux/Documentation/devicetree/bindings/net/snps,dwmac.yaml (revision ef9226cd56b718c79184a3466d32984a51cb449c)
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,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
98        - starfive,jh7100-dwmac
99        - 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
111      - description: The interrupt that occurs when HW safety error triggered
112
113  interrupt-names:
114    minItems: 1
115    items:
116      - const: macirq
117      - enum: [eth_wake_irq, eth_lpi, sfty]
118      - enum: [eth_wake_irq, eth_lpi, sfty]
119      - enum: [eth_wake_irq, eth_lpi, sfty]
120
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:
150    oneOf:
151      - items:
152          - enum: [stmmaceth, ahb]
153      - items:
154          - const: stmmaceth
155          - const: ahb
156
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:
245            $ref: /schemas/types.yaml#/definitions/uint32-array
246            maxItems: 1
247            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
331      snps,tx-sched-sp:
332        type: boolean
333        description: Strict priority
334    allOf:
335      - if:
336          required:
337            - snps,tx-sched-wrr
338        then:
339          properties:
340            snps,tx-sched-wfq: false
341            snps,tx-sched-dwrr: false
342            snps,tx-sched-sp: false
343      - if:
344          required:
345            - snps,tx-sched-wfq
346        then:
347          properties:
348            snps,tx-sched-wrr: false
349            snps,tx-sched-dwrr: false
350            snps,tx-sched-sp: false
351      - if:
352          required:
353            - snps,tx-sched-dwrr
354        then:
355          properties:
356            snps,tx-sched-wrr: false
357            snps,tx-sched-wfq: false
358            snps,tx-sched-sp: false
359      - if:
360          required:
361            - snps,tx-sched-sp
362        then:
363          properties:
364            snps,tx-sched-wrr: false
365            snps,tx-sched-wfq: false
366            snps,tx-sched-dwrr: false
367    patternProperties:
368      "^queue[0-9]$":
369        description: Each subnode represents a queue.
370        type: object
371        properties:
372          snps,weight:
373            $ref: /schemas/types.yaml#/definitions/uint32
374            description: TX queue weight (if using a DCB weight algorithm)
375          snps,dcb-algorithm:
376            type: boolean
377            description: TX queue will be working in DCB
378          snps,avb-algorithm:
379            type: boolean
380            description:
381              TX queue will be working in AVB.
382              Queue 0 is reserved for legacy traffic and so no AVB is
383              available in this queue.
384          snps,send_slope:
385            $ref: /schemas/types.yaml#/definitions/uint32
386            description: enable Low Power Interface
387          snps,idle_slope:
388            $ref: /schemas/types.yaml#/definitions/uint32
389            description: unlock on WoL
390          snps,high_credit:
391            $ref: /schemas/types.yaml#/definitions/uint32
392            description: max write outstanding req. limit
393          snps,low_credit:
394            $ref: /schemas/types.yaml#/definitions/uint32
395            description: max read outstanding req. limit
396          snps,priority:
397            $ref: /schemas/types.yaml#/definitions/uint32-array
398            maxItems: 1
399            description:
400              Bitmask of the tagged frames priorities assigned to the queue.
401              When a PFC frame is received with priorities matching the bitmask,
402              the queue is blocked from transmitting for the pause time specified
403              in the PFC frame.
404
405          snps,coe-unsupported:
406            type: boolean
407            description: TX checksum offload is unsupported by the TX queue.
408
409        allOf:
410          - if:
411              required:
412                - snps,dcb-algorithm
413            then:
414              properties:
415                snps,avb-algorithm: false
416          - if:
417              required:
418                - snps,avb-algorithm
419            then:
420              properties:
421                snps,dcb-algorithm: false
422                snps,weight: false
423        additionalProperties: false
424    additionalProperties: false
425
426  snps,reset-gpio:
427    deprecated: true
428    maxItems: 1
429    description:
430      PHY Reset GPIO
431
432  snps,reset-active-low:
433    deprecated: true
434    $ref: /schemas/types.yaml#/definitions/flag
435    description:
436      Indicates that the PHY Reset is active low
437
438  snps,reset-delays-us:
439    deprecated: true
440    description:
441      Triplet of delays. The 1st cell is reset pre-delay in micro
442      seconds. The 2nd cell is reset pulse in micro seconds. The 3rd
443      cell is reset post-delay in micro seconds.
444    minItems: 3
445    maxItems: 3
446
447  snps,aal:
448    $ref: /schemas/types.yaml#/definitions/flag
449    description:
450      Use Address-Aligned Beats
451
452  snps,fixed-burst:
453    $ref: /schemas/types.yaml#/definitions/flag
454    description:
455      Program the DMA to use the fixed burst mode
456
457  snps,mixed-burst:
458    $ref: /schemas/types.yaml#/definitions/flag
459    description:
460      Program the DMA to use the mixed burst mode
461
462  snps,force_thresh_dma_mode:
463    $ref: /schemas/types.yaml#/definitions/flag
464    description:
465      Force DMA to use the threshold mode for both tx and rx
466
467  snps,force_sf_dma_mode:
468    $ref: /schemas/types.yaml#/definitions/flag
469    description:
470      Force DMA to use the Store and Forward mode for both tx and
471      rx. This flag is ignored if force_thresh_dma_mode is set.
472
473  snps,en-tx-lpi-clockgating:
474    $ref: /schemas/types.yaml#/definitions/flag
475    description:
476      Enable gating of the MAC TX clock during TX low-power mode
477
478  snps,multicast-filter-bins:
479    $ref: /schemas/types.yaml#/definitions/uint32
480    description:
481      Number of multicast filter hash bins supported by this device
482      instance
483
484  snps,perfect-filter-entries:
485    $ref: /schemas/types.yaml#/definitions/uint32
486    description:
487      Number of perfect filter entries supported by this device
488      instance
489
490  snps,ps-speed:
491    $ref: /schemas/types.yaml#/definitions/uint32
492    description:
493      Port selection speed that can be passed to the core when PCS
494      is supported. For example, this is used in case of SGMII and
495      MAC2MAC connection.
496
497  snps,clk-csr:
498    $ref: /schemas/types.yaml#/definitions/uint32
499    description:
500      Frequency division factor for MDC clock.
501
502  mdio:
503    $ref: mdio.yaml#
504    unevaluatedProperties: false
505    description:
506      Creates and registers an MDIO bus.
507
508    properties:
509      compatible:
510        const: snps,dwmac-mdio
511
512    required:
513      - compatible
514
515  stmmac-axi-config:
516    type: object
517    unevaluatedProperties: false
518    description:
519      AXI BUS Mode parameters.
520
521    properties:
522      snps,lpi_en:
523        $ref: /schemas/types.yaml#/definitions/flag
524        description:
525          enable Low Power Interface
526
527      snps,xit_frm:
528        $ref: /schemas/types.yaml#/definitions/flag
529        description:
530          unlock on WoL
531
532      snps,wr_osr_lmt:
533        $ref: /schemas/types.yaml#/definitions/uint32
534        description:
535          max write outstanding req. limit
536
537      snps,rd_osr_lmt:
538        $ref: /schemas/types.yaml#/definitions/uint32
539        description:
540          max read outstanding req. limit
541
542      snps,kbbe:
543        $ref: /schemas/types.yaml#/definitions/uint32
544        description:
545          do not cross 1KiB boundary.
546
547      snps,blen:
548        $ref: /schemas/types.yaml#/definitions/uint32-array
549        description:
550          this is a vector of supported burst length.
551        minItems: 7
552        maxItems: 7
553
554      snps,fb:
555        $ref: /schemas/types.yaml#/definitions/flag
556        description:
557          fixed-burst
558
559      snps,mb:
560        $ref: /schemas/types.yaml#/definitions/flag
561        description:
562          mixed-burst
563
564      snps,rb:
565        $ref: /schemas/types.yaml#/definitions/flag
566        description:
567          rebuild INCRx Burst
568
569required:
570  - compatible
571  - reg
572  - interrupts
573  - interrupt-names
574  - phy-mode
575
576dependencies:
577  snps,reset-active-low: ["snps,reset-gpio"]
578  snps,reset-delays-us: ["snps,reset-gpio"]
579
580allOf:
581  - $ref: ethernet-controller.yaml#
582  - if:
583      properties:
584        compatible:
585          contains:
586            enum:
587              - allwinner,sun7i-a20-gmac
588              - allwinner,sun8i-a83t-emac
589              - allwinner,sun8i-h3-emac
590              - allwinner,sun8i-r40-gmac
591              - allwinner,sun8i-v3s-emac
592              - allwinner,sun50i-a64-emac
593              - ingenic,jz4775-mac
594              - ingenic,x1000-mac
595              - ingenic,x1600-mac
596              - ingenic,x1830-mac
597              - ingenic,x2000-mac
598              - qcom,sa8775p-ethqos
599              - qcom,sc8280xp-ethqos
600              - snps,dwmac-3.50a
601              - snps,dwmac-4.10a
602              - snps,dwmac-4.20a
603              - snps,dwmac-5.20
604              - snps,dwxgmac
605              - snps,dwxgmac-2.10
606              - st,spear600-gmac
607
608    then:
609      properties:
610        snps,pbl:
611          description:
612            Programmable Burst Length (tx and rx)
613          $ref: /schemas/types.yaml#/definitions/uint32
614          enum: [1, 2, 4, 8, 16, 32]
615
616        snps,txpbl:
617          description:
618            Tx Programmable Burst Length. If set, DMA tx will use this
619            value rather than snps,pbl.
620          $ref: /schemas/types.yaml#/definitions/uint32
621          enum: [1, 2, 4, 8, 16, 32]
622
623        snps,rxpbl:
624          description:
625            Rx Programmable Burst Length. If set, DMA rx will use this
626            value rather than snps,pbl.
627          $ref: /schemas/types.yaml#/definitions/uint32
628          enum: [1, 2, 4, 8, 16, 32]
629
630        snps,no-pbl-x8:
631          $ref: /schemas/types.yaml#/definitions/flag
632          description:
633            Don\'t multiply the pbl/txpbl/rxpbl values by 8. For core
634            rev < 3.50, don\'t multiply the values by 4.
635
636  - if:
637      properties:
638        compatible:
639          contains:
640            enum:
641              - allwinner,sun7i-a20-gmac
642              - allwinner,sun8i-a83t-emac
643              - allwinner,sun8i-h3-emac
644              - allwinner,sun8i-r40-gmac
645              - allwinner,sun8i-v3s-emac
646              - allwinner,sun50i-a64-emac
647              - loongson,ls2k-dwmac
648              - loongson,ls7a-dwmac
649              - ingenic,jz4775-mac
650              - ingenic,x1000-mac
651              - ingenic,x1600-mac
652              - ingenic,x1830-mac
653              - ingenic,x2000-mac
654              - qcom,qcs404-ethqos
655              - qcom,sa8775p-ethqos
656              - qcom,sc8280xp-ethqos
657              - qcom,sm8150-ethqos
658              - snps,dwmac-4.00
659              - snps,dwmac-4.10a
660              - snps,dwmac-4.20a
661              - snps,dwmac-5.10a
662              - snps,dwmac-5.20
663              - snps,dwxgmac
664              - snps,dwxgmac-2.10
665              - st,spear600-gmac
666
667    then:
668      properties:
669        snps,tso:
670          $ref: /schemas/types.yaml#/definitions/flag
671          description:
672            Enables the TSO feature otherwise it will be managed by
673            MAC HW capability register.
674
675additionalProperties: true
676
677examples:
678  - |
679    gmac0: ethernet@e0800000 {
680        compatible = "snps,dwxgmac-2.10", "snps,dwxgmac";
681        reg = <0xe0800000 0x8000>;
682        interrupt-parent = <&vic1>;
683        interrupts = <24 23 22>;
684        interrupt-names = "macirq", "eth_wake_irq", "eth_lpi";
685        mac-address = [000000000000]; /* Filled in by U-Boot */
686        max-frame-size = <3800>;
687        phy-mode = "gmii";
688        snps,multicast-filter-bins = <256>;
689        snps,perfect-filter-entries = <128>;
690        rx-fifo-depth = <16384>;
691        tx-fifo-depth = <16384>;
692        clocks = <&clock>;
693        clock-names = "stmmaceth";
694        snps,axi-config = <&stmmac_axi_setup>;
695        snps,mtl-rx-config = <&mtl_rx_setup>;
696        snps,mtl-tx-config = <&mtl_tx_setup>;
697
698        stmmac_axi_setup: stmmac-axi-config {
699            snps,wr_osr_lmt = <0xf>;
700            snps,rd_osr_lmt = <0xf>;
701            snps,blen = <256 128 64 32 0 0 0>;
702        };
703
704        mtl_rx_setup: rx-queues-config {
705            snps,rx-queues-to-use = <1>;
706            snps,rx-sched-sp;
707            queue0 {
708                snps,dcb-algorithm;
709                snps,map-to-dma-channel = <0x0>;
710                snps,priority = <0x0>;
711            };
712        };
713
714        mtl_tx_setup: tx-queues-config {
715            snps,tx-queues-to-use = <2>;
716            snps,tx-sched-wrr;
717            queue0 {
718                snps,weight = <0x10>;
719                snps,dcb-algorithm;
720                snps,priority = <0x0>;
721            };
722
723            queue1 {
724                snps,avb-algorithm;
725                snps,send_slope = <0x1000>;
726                snps,idle_slope = <0x1000>;
727                snps,high_credit = <0x3E800>;
728                snps,low_credit = <0xFFC18000>;
729                snps,priority = <0x1>;
730            };
731        };
732
733        mdio0 {
734            #address-cells = <1>;
735            #size-cells = <0>;
736            compatible = "snps,dwmac-mdio";
737            phy1: ethernet-phy@0 {
738                reg = <0>;
739            };
740        };
741    };
742
743# FIXME: We should set it, but it would report all the generic
744# properties as additional properties.
745# additionalProperties: false
746
747...
748