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