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