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