dt-bindings: Drop redundant minItems/maxItems
[linux-2.6-microblaze.git] / Documentation / devicetree / bindings / net / snps,dwmac.yaml
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
7 title: Synopsys DesignWare MAC Device Tree Bindings
8
9 maintainers:
10   - Alexandre Torgue <alexandre.torgue@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
18 select:
19   properties:
20     compatible:
21       contains:
22         enum:
23           - snps,dwmac
24           - snps,dwmac-3.50a
25           - snps,dwmac-3.610
26           - snps,dwmac-3.70a
27           - snps,dwmac-3.710
28           - snps,dwmac-4.00
29           - snps,dwmac-4.10a
30           - snps,dwmac-4.20a
31           - snps,dwxgmac
32           - snps,dwxgmac-2.10
33
34           # Deprecated
35           - st,spear600-gmac
36
37   required:
38     - compatible
39
40 properties:
41
42   # We need to include all the compatibles from schemas that will
43   # include that schemas, otherwise compatible won't validate for
44   # those.
45   compatible:
46     contains:
47       enum:
48         - allwinner,sun7i-a20-gmac
49         - allwinner,sun8i-a83t-emac
50         - allwinner,sun8i-h3-emac
51         - allwinner,sun8i-r40-emac
52         - allwinner,sun8i-v3s-emac
53         - allwinner,sun50i-a64-emac
54         - amlogic,meson6-dwmac
55         - amlogic,meson8b-dwmac
56         - amlogic,meson8m2-dwmac
57         - amlogic,meson-gxbb-dwmac
58         - amlogic,meson-axg-dwmac
59         - rockchip,px30-gmac
60         - rockchip,rk3128-gmac
61         - rockchip,rk3228-gmac
62         - rockchip,rk3288-gmac
63         - rockchip,rk3328-gmac
64         - rockchip,rk3366-gmac
65         - rockchip,rk3368-gmac
66         - rockchip,rk3399-gmac
67         - rockchip,rv1108-gmac
68         - snps,dwmac
69         - snps,dwmac-3.50a
70         - snps,dwmac-3.610
71         - snps,dwmac-3.70a
72         - snps,dwmac-3.710
73         - snps,dwmac-4.00
74         - snps,dwmac-4.10a
75         - snps,dwmac-4.20a
76         - snps,dwxgmac
77         - snps,dwxgmac-2.10
78
79   reg:
80     minItems: 1
81     maxItems: 2
82
83   interrupts:
84     minItems: 1
85     items:
86       - description: Combined signal for various interrupt events
87       - description: The interrupt to manage the remote wake-up packet detection
88       - description: The interrupt that occurs when Rx exits the LPI state
89
90   interrupt-names:
91     minItems: 1
92     items:
93       - const: macirq
94       - const: eth_wake_irq
95       - const: eth_lpi
96
97   clocks:
98     minItems: 1
99     maxItems: 8
100     additionalItems: true
101     items:
102       - description: GMAC main clock
103       - description: Peripheral registers interface clock
104       - description:
105           PTP reference clock. This clock is used for programming the
106           Timestamp Addend Register. If not passed then the system
107           clock will be used and this is fine on some platforms.
108
109   clock-names:
110     minItems: 1
111     maxItems: 8
112     additionalItems: true
113     contains:
114       enum:
115         - stmmaceth
116         - pclk
117         - ptp_ref
118
119   resets:
120     maxItems: 1
121     description:
122       MAC Reset signal.
123
124   reset-names:
125     const: stmmaceth
126
127   mac-mode:
128     $ref: ethernet-controller.yaml#/properties/phy-connection-type
129     description:
130       The property is identical to 'phy-mode', and assumes that there is mode
131       converter in-between the MAC & PHY (e.g. GMII-to-RGMII). This converter
132       can be passive (no SW requirement), and requires that the MAC operate
133       in a different mode than the PHY in order to function.
134
135   snps,axi-config:
136     $ref: /schemas/types.yaml#/definitions/phandle
137     description:
138       AXI BUS Mode parameters. Phandle to a node that can contain the
139       following properties
140         * snps,lpi_en, enable Low Power Interface
141         * snps,xit_frm, unlock on WoL
142         * snps,wr_osr_lmt, max write outstanding req. limit
143         * snps,rd_osr_lmt, max read outstanding req. limit
144         * snps,kbbe, do not cross 1KiB boundary.
145         * snps,blen, this is a vector of supported burst length.
146         * snps,fb, fixed-burst
147         * snps,mb, mixed-burst
148         * snps,rb, rebuild INCRx Burst
149
150   snps,mtl-rx-config:
151     $ref: /schemas/types.yaml#/definitions/phandle
152     description:
153       Multiple RX Queues parameters. Phandle to a node that can
154       contain the following properties
155         * snps,rx-queues-to-use, number of RX queues to be used in the
156           driver
157         * Choose one of these RX scheduling algorithms
158           * snps,rx-sched-sp, Strict priority
159           * snps,rx-sched-wsp, Weighted Strict priority
160         * For each RX queue
161           * Choose one of these modes
162             * snps,dcb-algorithm, Queue to be enabled as DCB
163             * snps,avb-algorithm, Queue to be enabled as AVB
164           * snps,map-to-dma-channel, Channel to map
165           * Specifiy specific packet routing
166             * snps,route-avcp, AV Untagged Control packets
167             * snps,route-ptp, PTP Packets
168             * snps,route-dcbcp, DCB Control Packets
169             * snps,route-up, Untagged Packets
170             * snps,route-multi-broad, Multicast & Broadcast Packets
171           * snps,priority, bitmask of the tagged frames priorities assigned to
172             the queue
173
174   snps,mtl-tx-config:
175     $ref: /schemas/types.yaml#/definitions/phandle
176     description:
177       Multiple TX Queues parameters. Phandle to a node that can
178       contain the following properties
179         * snps,tx-queues-to-use, number of TX queues to be used in the
180           driver
181         * Choose one of these TX scheduling algorithms
182           * snps,tx-sched-wrr, Weighted Round Robin
183           * snps,tx-sched-wfq, Weighted Fair Queuing
184           * snps,tx-sched-dwrr, Deficit Weighted Round Robin
185           * snps,tx-sched-sp, Strict priority
186         * For each TX queue
187           * snps,weight, TX queue weight (if using a DCB weight
188             algorithm)
189           * Choose one of these modes
190             * snps,dcb-algorithm, TX queue will be working in DCB
191             * snps,avb-algorithm, TX queue will be working in AVB
192               [Attention] Queue 0 is reserved for legacy traffic
193                           and so no AVB is available in this queue.
194           * Configure Credit Base Shaper (if AVB Mode selected)
195             * snps,send_slope, enable Low Power Interface
196             * snps,idle_slope, unlock on WoL
197             * snps,high_credit, max write outstanding req. limit
198             * snps,low_credit, max read outstanding req. limit
199           * snps,priority, bitmask of the priorities assigned to the queue.
200             When a PFC frame is received with priorities matching the bitmask,
201             the queue is blocked from transmitting for the pause time specified
202             in the PFC frame.
203
204   snps,reset-gpio:
205     deprecated: true
206     maxItems: 1
207     description:
208       PHY Reset GPIO
209
210   snps,reset-active-low:
211     deprecated: true
212     $ref: /schemas/types.yaml#/definitions/flag
213     description:
214       Indicates that the PHY Reset is active low
215
216   snps,reset-delays-us:
217     deprecated: true
218     description:
219       Triplet of delays. The 1st cell is reset pre-delay in micro
220       seconds. The 2nd cell is reset pulse in micro seconds. The 3rd
221       cell is reset post-delay in micro seconds.
222     minItems: 3
223     maxItems: 3
224
225   snps,aal:
226     $ref: /schemas/types.yaml#/definitions/flag
227     description:
228       Use Address-Aligned Beats
229
230   snps,fixed-burst:
231     $ref: /schemas/types.yaml#/definitions/flag
232     description:
233       Program the DMA to use the fixed burst mode
234
235   snps,mixed-burst:
236     $ref: /schemas/types.yaml#/definitions/flag
237     description:
238       Program the DMA to use the mixed burst mode
239
240   snps,force_thresh_dma_mode:
241     $ref: /schemas/types.yaml#/definitions/flag
242     description:
243       Force DMA to use the threshold mode for both tx and rx
244
245   snps,force_sf_dma_mode:
246     $ref: /schemas/types.yaml#/definitions/flag
247     description:
248       Force DMA to use the Store and Forward mode for both tx and
249       rx. This flag is ignored if force_thresh_dma_mode is set.
250
251   snps,en-tx-lpi-clockgating:
252     $ref: /schemas/types.yaml#/definitions/flag
253     description:
254       Enable gating of the MAC TX clock during TX low-power mode
255
256   snps,multicast-filter-bins:
257     $ref: /schemas/types.yaml#/definitions/uint32
258     description:
259       Number of multicast filter hash bins supported by this device
260       instance
261
262   snps,perfect-filter-entries:
263     $ref: /schemas/types.yaml#/definitions/uint32
264     description:
265       Number of perfect filter entries supported by this device
266       instance
267
268   snps,ps-speed:
269     $ref: /schemas/types.yaml#/definitions/uint32
270     description:
271       Port selection speed that can be passed to the core when PCS
272       is supported. For example, this is used in case of SGMII and
273       MAC2MAC connection.
274
275   mdio:
276     type: object
277     description:
278       Creates and registers an MDIO bus.
279
280     properties:
281       compatible:
282         const: snps,dwmac-mdio
283
284     required:
285       - compatible
286
287 required:
288   - compatible
289   - reg
290   - interrupts
291   - interrupt-names
292   - phy-mode
293
294 dependencies:
295   snps,reset-active-low: ["snps,reset-gpio"]
296   snps,reset-delay-us: ["snps,reset-gpio"]
297
298 allOf:
299   - $ref: "ethernet-controller.yaml#"
300   - if:
301       properties:
302         compatible:
303           contains:
304             enum:
305               - allwinner,sun7i-a20-gmac
306               - allwinner,sun8i-a83t-emac
307               - allwinner,sun8i-h3-emac
308               - allwinner,sun8i-r40-emac
309               - allwinner,sun8i-v3s-emac
310               - allwinner,sun50i-a64-emac
311               - snps,dwxgmac
312               - snps,dwxgmac-2.10
313               - st,spear600-gmac
314
315     then:
316       properties:
317         snps,pbl:
318           description:
319             Programmable Burst Length (tx and rx)
320           $ref: /schemas/types.yaml#/definitions/uint32
321           enum: [2, 4, 8]
322
323         snps,txpbl:
324           description:
325             Tx Programmable Burst Length. If set, DMA tx will use this
326             value rather than snps,pbl.
327           $ref: /schemas/types.yaml#/definitions/uint32
328           enum: [2, 4, 8]
329
330         snps,rxpbl:
331           description:
332             Rx Programmable Burst Length. If set, DMA rx will use this
333             value rather than snps,pbl.
334           $ref: /schemas/types.yaml#/definitions/uint32
335           enum: [2, 4, 8]
336
337         snps,no-pbl-x8:
338           $ref: /schemas/types.yaml#/definitions/flag
339           description:
340             Don\'t multiply the pbl/txpbl/rxpbl values by 8. For core
341             rev < 3.50, don\'t multiply the values by 4.
342
343   - if:
344       properties:
345         compatible:
346           contains:
347             enum:
348               - allwinner,sun7i-a20-gmac
349               - allwinner,sun8i-a83t-emac
350               - allwinner,sun8i-h3-emac
351               - allwinner,sun8i-r40-emac
352               - allwinner,sun8i-v3s-emac
353               - allwinner,sun50i-a64-emac
354               - snps,dwmac-4.00
355               - snps,dwmac-4.10a
356               - snps,dwmac-4.20a
357               - snps,dwxgmac
358               - snps,dwxgmac-2.10
359               - st,spear600-gmac
360
361     then:
362       properties:
363         snps,tso:
364           $ref: /schemas/types.yaml#/definitions/flag
365           description:
366             Enables the TSO feature otherwise it will be managed by
367             MAC HW capability register.
368
369 additionalProperties: true
370
371 examples:
372   - |
373     stmmac_axi_setup: stmmac-axi-config {
374         snps,wr_osr_lmt = <0xf>;
375         snps,rd_osr_lmt = <0xf>;
376         snps,blen = <256 128 64 32 0 0 0>;
377     };
378
379     mtl_rx_setup: rx-queues-config {
380         snps,rx-queues-to-use = <1>;
381         snps,rx-sched-sp;
382         queue0 {
383             snps,dcb-algorithm;
384             snps,map-to-dma-channel = <0x0>;
385             snps,priority = <0x0>;
386         };
387     };
388
389     mtl_tx_setup: tx-queues-config {
390         snps,tx-queues-to-use = <2>;
391         snps,tx-sched-wrr;
392         queue0 {
393             snps,weight = <0x10>;
394             snps,dcb-algorithm;
395             snps,priority = <0x0>;
396         };
397
398         queue1 {
399             snps,avb-algorithm;
400             snps,send_slope = <0x1000>;
401             snps,idle_slope = <0x1000>;
402             snps,high_credit = <0x3E800>;
403             snps,low_credit = <0xFFC18000>;
404             snps,priority = <0x1>;
405         };
406     };
407
408     gmac0: ethernet@e0800000 {
409         compatible = "snps,dwxgmac-2.10", "snps,dwxgmac";
410         reg = <0xe0800000 0x8000>;
411         interrupt-parent = <&vic1>;
412         interrupts = <24 23 22>;
413         interrupt-names = "macirq", "eth_wake_irq", "eth_lpi";
414         mac-address = [000000000000]; /* Filled in by U-Boot */
415         max-frame-size = <3800>;
416         phy-mode = "gmii";
417         snps,multicast-filter-bins = <256>;
418         snps,perfect-filter-entries = <128>;
419         rx-fifo-depth = <16384>;
420         tx-fifo-depth = <16384>;
421         clocks = <&clock>;
422         clock-names = "stmmaceth";
423         snps,axi-config = <&stmmac_axi_setup>;
424         snps,mtl-rx-config = <&mtl_rx_setup>;
425         snps,mtl-tx-config = <&mtl_tx_setup>;
426         mdio0 {
427             #address-cells = <1>;
428             #size-cells = <0>;
429             compatible = "snps,dwmac-mdio";
430             phy1: ethernet-phy@0 {
431                 reg = <0>;
432             };
433         };
434     };
435
436 # FIXME: We should set it, but it would report all the generic
437 # properties as additional properties.
438 # additionalProperties: false
439
440 ...