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