xref: /linux/Documentation/devicetree/bindings/net/snps,dwmac.yaml (revision 8e1bb4a41aa78d6105e59186af3dcd545fc66e70)
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,pbl:
440    description:
441      Programmable Burst Length (tx and rx)
442    $ref: /schemas/types.yaml#/definitions/uint32
443    enum: [1, 2, 4, 8, 16, 32]
444
445  snps,txpbl:
446    description:
447      Tx Programmable Burst Length. If set, DMA tx will use this
448      value rather than snps,pbl.
449    $ref: /schemas/types.yaml#/definitions/uint32
450    enum: [1, 2, 4, 8, 16, 32]
451
452  snps,rxpbl:
453    description:
454      Rx Programmable Burst Length. If set, DMA rx will use this
455      value rather than snps,pbl.
456    $ref: /schemas/types.yaml#/definitions/uint32
457    enum: [1, 2, 4, 8, 16, 32]
458
459  snps,no-pbl-x8:
460    $ref: /schemas/types.yaml#/definitions/flag
461    description:
462      Don\'t multiply the pbl/txpbl/rxpbl values by 8. For core
463      rev < 3.50, don\'t multiply the values by 4.
464
465  snps,fixed-burst:
466    $ref: /schemas/types.yaml#/definitions/flag
467    description:
468      Program the DMA to use the fixed burst mode
469
470  snps,mixed-burst:
471    $ref: /schemas/types.yaml#/definitions/flag
472    description:
473      Program the DMA to use the mixed burst mode
474
475  snps,force_thresh_dma_mode:
476    $ref: /schemas/types.yaml#/definitions/flag
477    description:
478      Force DMA to use the threshold mode for both tx and rx
479
480  snps,force_sf_dma_mode:
481    $ref: /schemas/types.yaml#/definitions/flag
482    description:
483      Force DMA to use the Store and Forward mode for both tx and
484      rx. This flag is ignored if force_thresh_dma_mode is set.
485
486  snps,en-tx-lpi-clockgating:
487    $ref: /schemas/types.yaml#/definitions/flag
488    description:
489      Enable gating of the MAC TX clock during TX low-power mode
490
491  snps,multicast-filter-bins:
492    $ref: /schemas/types.yaml#/definitions/uint32
493    description:
494      Number of multicast filter hash bins supported by this device
495      instance
496
497  snps,perfect-filter-entries:
498    $ref: /schemas/types.yaml#/definitions/uint32
499    description:
500      Number of perfect filter entries supported by this device
501      instance
502
503  snps,ps-speed:
504    $ref: /schemas/types.yaml#/definitions/uint32
505    description:
506      Port selection speed that can be passed to the core when PCS
507      is supported. For example, this is used in case of SGMII and
508      MAC2MAC connection.
509
510  snps,clk-csr:
511    $ref: /schemas/types.yaml#/definitions/uint32
512    description:
513      Frequency division factor for MDC clock.
514
515  snps,tso:
516    $ref: /schemas/types.yaml#/definitions/flag
517    description:
518      Enables the TSO feature otherwise it will be managed by MAC HW capability
519      register.
520
521  mdio:
522    $ref: mdio.yaml#
523    unevaluatedProperties: false
524    description:
525      Creates and registers an MDIO bus.
526
527    properties:
528      compatible:
529        const: snps,dwmac-mdio
530
531    required:
532      - compatible
533
534  stmmac-axi-config:
535    type: object
536    unevaluatedProperties: false
537    description:
538      AXI BUS Mode parameters.
539
540    properties:
541      snps,lpi_en:
542        $ref: /schemas/types.yaml#/definitions/flag
543        description:
544          enable Low Power Interface
545
546      snps,xit_frm:
547        $ref: /schemas/types.yaml#/definitions/flag
548        description:
549          unlock on WoL
550
551      snps,wr_osr_lmt:
552        $ref: /schemas/types.yaml#/definitions/uint32
553        description:
554          max write outstanding req. limit
555
556      snps,rd_osr_lmt:
557        $ref: /schemas/types.yaml#/definitions/uint32
558        description:
559          max read outstanding req. limit
560
561      snps,kbbe:
562        $ref: /schemas/types.yaml#/definitions/uint32
563        description:
564          do not cross 1KiB boundary.
565
566      snps,blen:
567        $ref: /schemas/types.yaml#/definitions/uint32-array
568        description:
569          this is a vector of supported burst length.
570        minItems: 7
571        maxItems: 7
572
573      snps,fb:
574        $ref: /schemas/types.yaml#/definitions/flag
575        description:
576          fixed-burst
577
578      snps,mb:
579        $ref: /schemas/types.yaml#/definitions/flag
580        description:
581          mixed-burst
582
583      snps,rb:
584        $ref: /schemas/types.yaml#/definitions/flag
585        description:
586          rebuild INCRx Burst
587
588required:
589  - compatible
590  - reg
591  - interrupts
592  - interrupt-names
593  - phy-mode
594
595dependencies:
596  snps,reset-active-low: ["snps,reset-gpio"]
597  snps,reset-delays-us: ["snps,reset-gpio"]
598
599allOf:
600  - $ref: ethernet-controller.yaml#
601  - if:
602      properties:
603        compatible:
604          not:
605            contains:
606              enum:
607                - allwinner,sun7i-a20-gmac
608                - allwinner,sun8i-a83t-emac
609                - allwinner,sun8i-h3-emac
610                - allwinner,sun8i-r40-gmac
611                - allwinner,sun8i-v3s-emac
612                - allwinner,sun50i-a64-emac
613                - loongson,ls2k-dwmac
614                - loongson,ls7a-dwmac
615                - ingenic,jz4775-mac
616                - ingenic,x1000-mac
617                - ingenic,x1600-mac
618                - ingenic,x1830-mac
619                - ingenic,x2000-mac
620                - qcom,qcs404-ethqos
621                - qcom,sa8775p-ethqos
622                - qcom,sc8280xp-ethqos
623                - qcom,sm8150-ethqos
624                - snps,dwmac-4.00
625                - snps,dwmac-4.10a
626                - snps,dwmac-4.20a
627                - snps,dwmac-5.10a
628                - snps,dwmac-5.20
629                - snps,dwxgmac
630                - snps,dwxgmac-2.10
631                - st,spear600-gmac
632
633    then:
634      properties:
635        snps,tso: false
636
637additionalProperties: true
638
639examples:
640  - |
641    gmac0: ethernet@e0800000 {
642        compatible = "snps,dwxgmac-2.10", "snps,dwxgmac";
643        reg = <0xe0800000 0x8000>;
644        interrupt-parent = <&vic1>;
645        interrupts = <24 23 22>;
646        interrupt-names = "macirq", "eth_wake_irq", "eth_lpi";
647        mac-address = [000000000000]; /* Filled in by U-Boot */
648        max-frame-size = <3800>;
649        phy-mode = "gmii";
650        snps,multicast-filter-bins = <256>;
651        snps,perfect-filter-entries = <128>;
652        rx-fifo-depth = <16384>;
653        tx-fifo-depth = <16384>;
654        clocks = <&clock>;
655        clock-names = "stmmaceth";
656        snps,axi-config = <&stmmac_axi_setup>;
657        snps,mtl-rx-config = <&mtl_rx_setup>;
658        snps,mtl-tx-config = <&mtl_tx_setup>;
659
660        stmmac_axi_setup: stmmac-axi-config {
661            snps,wr_osr_lmt = <0xf>;
662            snps,rd_osr_lmt = <0xf>;
663            snps,blen = <256 128 64 32 0 0 0>;
664        };
665
666        mtl_rx_setup: rx-queues-config {
667            snps,rx-queues-to-use = <1>;
668            snps,rx-sched-sp;
669            queue0 {
670                snps,dcb-algorithm;
671                snps,map-to-dma-channel = <0x0>;
672                snps,priority = <0x0>;
673            };
674        };
675
676        mtl_tx_setup: tx-queues-config {
677            snps,tx-queues-to-use = <2>;
678            snps,tx-sched-wrr;
679            queue0 {
680                snps,weight = <0x10>;
681                snps,dcb-algorithm;
682                snps,priority = <0x0>;
683            };
684
685            queue1 {
686                snps,avb-algorithm;
687                snps,send_slope = <0x1000>;
688                snps,idle_slope = <0x1000>;
689                snps,high_credit = <0x3E800>;
690                snps,low_credit = <0xFFC18000>;
691                snps,priority = <0x1>;
692            };
693        };
694
695        mdio0 {
696            #address-cells = <1>;
697            #size-cells = <0>;
698            compatible = "snps,dwmac-mdio";
699            phy1: ethernet-phy@0 {
700                reg = <0>;
701            };
702        };
703    };
704
705# FIXME: We should set it, but it would report all the generic
706# properties as additional properties.
707# additionalProperties: false
708
709...
710