blob: b2f6083f556af0d6b789d8b340a8699152bac912 [file] [log] [blame]
Maxime Ripard7db35452019-06-27 17:31:50 +02001# 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 Device Tree Bindings
8
9maintainers:
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
18select:
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
Christophe Roullierf2253142020-04-03 16:04:14 +020030 - snps,dwmac-4.20a
Maxime Ripard7db35452019-06-27 17:31:50 +020031 - snps,dwxgmac
32 - snps,dwxgmac-2.10
33
34 # Deprecated
35 - st,spear600-gmac
36
37 required:
38 - compatible
39
40properties:
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:
Maxime Ripard4b859452019-06-27 17:31:51 +020048 - allwinner,sun7i-a20-gmac
Maxime Ripard05699292019-06-27 17:31:52 +020049 - allwinner,sun8i-a83t-emac
50 - allwinner,sun8i-h3-emac
51 - allwinner,sun8i-r40-emac
52 - allwinner,sun8i-v3s-emac
53 - allwinner,sun50i-a64-emac
Neil Armstrongd5a57e42019-08-20 09:57:42 +020054 - amlogic,meson6-dwmac
55 - amlogic,meson8b-dwmac
56 - amlogic,meson8m2-dwmac
57 - amlogic,meson-gxbb-dwmac
58 - amlogic,meson-axg-dwmac
Maxime Ripard7db35452019-06-27 17:31:50 +020059 - snps,dwmac
60 - snps,dwmac-3.50a
61 - snps,dwmac-3.610
62 - snps,dwmac-3.70a
63 - snps,dwmac-3.710
64 - snps,dwmac-4.00
65 - snps,dwmac-4.10a
Christophe Roullierf2253142020-04-03 16:04:14 +020066 - snps,dwmac-4.20a
Maxime Ripard7db35452019-06-27 17:31:50 +020067 - snps,dwxgmac
68 - snps,dwxgmac-2.10
69
70 reg:
Neil Armstrong57b77df2019-08-20 09:57:41 +020071 minItems: 1
72 maxItems: 2
Maxime Ripard7db35452019-06-27 17:31:50 +020073
74 interrupts:
75 minItems: 1
76 maxItems: 3
77 items:
78 - description: Combined signal for various interrupt events
79 - description: The interrupt to manage the remote wake-up packet detection
80 - description: The interrupt that occurs when Rx exits the LPI state
81
82 interrupt-names:
83 minItems: 1
84 maxItems: 3
85 items:
86 - const: macirq
87 - const: eth_wake_irq
88 - const: eth_lpi
89
90 clocks:
91 minItems: 1
Christophe Roullierf2253142020-04-03 16:04:14 +020092 maxItems: 5
93 additionalItems: true
Maxime Ripard7db35452019-06-27 17:31:50 +020094 items:
95 - description: GMAC main clock
96 - description: Peripheral registers interface clock
97 - description:
98 PTP reference clock. This clock is used for programming the
99 Timestamp Addend Register. If not passed then the system
100 clock will be used and this is fine on some platforms.
101
102 clock-names:
Christophe Roullierf2253142020-04-03 16:04:14 +0200103 minItems: 1
104 maxItems: 5
Maxime Ripard7db35452019-06-27 17:31:50 +0200105 additionalItems: true
106 contains:
107 enum:
108 - stmmaceth
109 - pclk
110 - ptp_ref
111
112 resets:
113 maxItems: 1
114 description:
115 MAC Reset signal.
116
117 reset-names:
118 const: stmmaceth
119
Alexandru Ardelean9c15d352019-09-06 16:02:56 +0300120 mac-mode:
Alexandru Ardelean9e5c8d32019-09-17 13:30:52 +0300121 $ref: ethernet-controller.yaml#/properties/phy-connection-type
Alexandru Ardelean9c15d352019-09-06 16:02:56 +0300122 description:
123 The property is identical to 'phy-mode', and assumes that there is mode
124 converter in-between the MAC & PHY (e.g. GMII-to-RGMII). This converter
125 can be passive (no SW requirement), and requires that the MAC operate
126 in a different mode than the PHY in order to function.
127
Maxime Ripard7db35452019-06-27 17:31:50 +0200128 snps,axi-config:
Rob Herringd69c6dd2020-12-17 16:34:29 -0600129 $ref: /schemas/types.yaml#/definitions/phandle
Maxime Ripard7db35452019-06-27 17:31:50 +0200130 description:
131 AXI BUS Mode parameters. Phandle to a node that can contain the
132 following properties
133 * snps,lpi_en, enable Low Power Interface
134 * snps,xit_frm, unlock on WoL
135 * snps,wr_osr_lmt, max write outstanding req. limit
136 * snps,rd_osr_lmt, max read outstanding req. limit
137 * snps,kbbe, do not cross 1KiB boundary.
138 * snps,blen, this is a vector of supported burst length.
139 * snps,fb, fixed-burst
140 * snps,mb, mixed-burst
141 * snps,rb, rebuild INCRx Burst
142
143 snps,mtl-rx-config:
Rob Herringd69c6dd2020-12-17 16:34:29 -0600144 $ref: /schemas/types.yaml#/definitions/phandle
Maxime Ripard7db35452019-06-27 17:31:50 +0200145 description:
146 Multiple RX Queues parameters. Phandle to a node that can
147 contain the following properties
148 * snps,rx-queues-to-use, number of RX queues to be used in the
149 driver
150 * Choose one of these RX scheduling algorithms
151 * snps,rx-sched-sp, Strict priority
152 * snps,rx-sched-wsp, Weighted Strict priority
153 * For each RX queue
154 * Choose one of these modes
155 * snps,dcb-algorithm, Queue to be enabled as DCB
156 * snps,avb-algorithm, Queue to be enabled as AVB
157 * snps,map-to-dma-channel, Channel to map
158 * Specifiy specific packet routing
159 * snps,route-avcp, AV Untagged Control packets
160 * snps,route-ptp, PTP Packets
161 * snps,route-dcbcp, DCB Control Packets
162 * snps,route-up, Untagged Packets
163 * snps,route-multi-broad, Multicast & Broadcast Packets
164 * snps,priority, RX queue priority (Range 0x0 to 0xF)
165
166 snps,mtl-tx-config:
Rob Herringd69c6dd2020-12-17 16:34:29 -0600167 $ref: /schemas/types.yaml#/definitions/phandle
Maxime Ripard7db35452019-06-27 17:31:50 +0200168 description:
169 Multiple TX Queues parameters. Phandle to a node that can
170 contain the following properties
171 * snps,tx-queues-to-use, number of TX queues to be used in the
172 driver
173 * Choose one of these TX scheduling algorithms
174 * snps,tx-sched-wrr, Weighted Round Robin
175 * snps,tx-sched-wfq, Weighted Fair Queuing
176 * snps,tx-sched-dwrr, Deficit Weighted Round Robin
177 * snps,tx-sched-sp, Strict priority
178 * For each TX queue
179 * snps,weight, TX queue weight (if using a DCB weight
180 algorithm)
181 * Choose one of these modes
182 * snps,dcb-algorithm, TX queue will be working in DCB
183 * snps,avb-algorithm, TX queue will be working in AVB
184 [Attention] Queue 0 is reserved for legacy traffic
185 and so no AVB is available in this queue.
186 * Configure Credit Base Shaper (if AVB Mode selected)
187 * snps,send_slope, enable Low Power Interface
188 * snps,idle_slope, unlock on WoL
189 * snps,high_credit, max write outstanding req. limit
190 * snps,low_credit, max read outstanding req. limit
191 * snps,priority, TX queue priority (Range 0x0 to 0xF)
192
193 snps,reset-gpio:
Maxime Ripardf80b1dfc52019-06-27 17:31:53 +0200194 deprecated: true
Maxime Ripard7db35452019-06-27 17:31:50 +0200195 maxItems: 1
196 description:
197 PHY Reset GPIO
198
199 snps,reset-active-low:
Maxime Ripardf80b1dfc52019-06-27 17:31:53 +0200200 deprecated: true
Rob Herringd69c6dd2020-12-17 16:34:29 -0600201 $ref: /schemas/types.yaml#/definitions/flag
Maxime Ripard7db35452019-06-27 17:31:50 +0200202 description:
203 Indicates that the PHY Reset is active low
204
205 snps,reset-delays-us:
Maxime Ripardf80b1dfc52019-06-27 17:31:53 +0200206 deprecated: true
Maxime Ripard7db35452019-06-27 17:31:50 +0200207 description:
208 Triplet of delays. The 1st cell is reset pre-delay in micro
209 seconds. The 2nd cell is reset pulse in micro seconds. The 3rd
210 cell is reset post-delay in micro seconds.
Rob Herringd69c6dd2020-12-17 16:34:29 -0600211 $ref: /schemas/types.yaml#/definitions/uint32-array
Rob Herring3d21a462020-04-15 19:55:49 -0500212 minItems: 3
213 maxItems: 3
Maxime Ripard7db35452019-06-27 17:31:50 +0200214
215 snps,aal:
Rob Herringd69c6dd2020-12-17 16:34:29 -0600216 $ref: /schemas/types.yaml#/definitions/flag
Maxime Ripard7db35452019-06-27 17:31:50 +0200217 description:
218 Use Address-Aligned Beats
219
220 snps,fixed-burst:
Rob Herringd69c6dd2020-12-17 16:34:29 -0600221 $ref: /schemas/types.yaml#/definitions/flag
Maxime Ripard7db35452019-06-27 17:31:50 +0200222 description:
223 Program the DMA to use the fixed burst mode
224
225 snps,mixed-burst:
Rob Herringd69c6dd2020-12-17 16:34:29 -0600226 $ref: /schemas/types.yaml#/definitions/flag
Maxime Ripard7db35452019-06-27 17:31:50 +0200227 description:
228 Program the DMA to use the mixed burst mode
229
230 snps,force_thresh_dma_mode:
Rob Herringd69c6dd2020-12-17 16:34:29 -0600231 $ref: /schemas/types.yaml#/definitions/flag
Maxime Ripard7db35452019-06-27 17:31:50 +0200232 description:
233 Force DMA to use the threshold mode for both tx and rx
234
235 snps,force_sf_dma_mode:
Rob Herringd69c6dd2020-12-17 16:34:29 -0600236 $ref: /schemas/types.yaml#/definitions/flag
Maxime Ripard7db35452019-06-27 17:31:50 +0200237 description:
238 Force DMA to use the Store and Forward mode for both tx and
239 rx. This flag is ignored if force_thresh_dma_mode is set.
240
241 snps,en-tx-lpi-clockgating:
Rob Herringd69c6dd2020-12-17 16:34:29 -0600242 $ref: /schemas/types.yaml#/definitions/flag
Maxime Ripard7db35452019-06-27 17:31:50 +0200243 description:
244 Enable gating of the MAC TX clock during TX low-power mode
245
246 snps,multicast-filter-bins:
Rob Herringd69c6dd2020-12-17 16:34:29 -0600247 $ref: /schemas/types.yaml#/definitions/uint32
Maxime Ripard7db35452019-06-27 17:31:50 +0200248 description:
249 Number of multicast filter hash bins supported by this device
250 instance
251
252 snps,perfect-filter-entries:
Rob Herringd69c6dd2020-12-17 16:34:29 -0600253 $ref: /schemas/types.yaml#/definitions/uint32
Maxime Ripard7db35452019-06-27 17:31:50 +0200254 description:
255 Number of perfect filter entries supported by this device
256 instance
257
258 snps,ps-speed:
Rob Herringd69c6dd2020-12-17 16:34:29 -0600259 $ref: /schemas/types.yaml#/definitions/uint32
Maxime Ripard7db35452019-06-27 17:31:50 +0200260 description:
261 Port selection speed that can be passed to the core when PCS
262 is supported. For example, this is used in case of SGMII and
263 MAC2MAC connection.
264
265 mdio:
266 type: object
267 description:
268 Creates and registers an MDIO bus.
269
270 properties:
271 compatible:
272 const: snps,dwmac-mdio
273
274 required:
275 - compatible
276
277required:
278 - compatible
279 - reg
280 - interrupts
281 - interrupt-names
Maxime Ripard67d0da92019-07-03 11:55:12 +0200282 - phy-mode
Maxime Ripard7db35452019-06-27 17:31:50 +0200283
284dependencies:
285 snps,reset-active-low: ["snps,reset-gpio"]
286 snps,reset-delay-us: ["snps,reset-gpio"]
287
288allOf:
289 - $ref: "ethernet-controller.yaml#"
290 - if:
291 properties:
292 compatible:
293 contains:
294 enum:
Maxime Ripard4b859452019-06-27 17:31:51 +0200295 - allwinner,sun7i-a20-gmac
Maxime Ripard05699292019-06-27 17:31:52 +0200296 - allwinner,sun8i-a83t-emac
297 - allwinner,sun8i-h3-emac
298 - allwinner,sun8i-r40-emac
299 - allwinner,sun8i-v3s-emac
300 - allwinner,sun50i-a64-emac
Maxime Ripard7db35452019-06-27 17:31:50 +0200301 - snps,dwxgmac
302 - snps,dwxgmac-2.10
303 - st,spear600-gmac
304
305 then:
306 properties:
307 snps,pbl:
Maxime Ripard7db35452019-06-27 17:31:50 +0200308 description:
309 Programmable Burst Length (tx and rx)
Rob Herringd69c6dd2020-12-17 16:34:29 -0600310 $ref: /schemas/types.yaml#/definitions/uint32
Rob Herring3d21a462020-04-15 19:55:49 -0500311 enum: [2, 4, 8]
Maxime Ripard7db35452019-06-27 17:31:50 +0200312
313 snps,txpbl:
Maxime Ripard7db35452019-06-27 17:31:50 +0200314 description:
315 Tx Programmable Burst Length. If set, DMA tx will use this
316 value rather than snps,pbl.
Rob Herringd69c6dd2020-12-17 16:34:29 -0600317 $ref: /schemas/types.yaml#/definitions/uint32
Rob Herring3d21a462020-04-15 19:55:49 -0500318 enum: [2, 4, 8]
Maxime Ripard7db35452019-06-27 17:31:50 +0200319
320 snps,rxpbl:
Maxime Ripard7db35452019-06-27 17:31:50 +0200321 description:
322 Rx Programmable Burst Length. If set, DMA rx will use this
323 value rather than snps,pbl.
Rob Herringd69c6dd2020-12-17 16:34:29 -0600324 $ref: /schemas/types.yaml#/definitions/uint32
Rob Herring3d21a462020-04-15 19:55:49 -0500325 enum: [2, 4, 8]
Maxime Ripard7db35452019-06-27 17:31:50 +0200326
327 snps,no-pbl-x8:
Rob Herringd69c6dd2020-12-17 16:34:29 -0600328 $ref: /schemas/types.yaml#/definitions/flag
Maxime Ripard7db35452019-06-27 17:31:50 +0200329 description:
330 Don\'t multiply the pbl/txpbl/rxpbl values by 8. For core
331 rev < 3.50, don\'t multiply the values by 4.
332
333 - if:
334 properties:
335 compatible:
336 contains:
337 enum:
Maxime Ripard4b859452019-06-27 17:31:51 +0200338 - allwinner,sun7i-a20-gmac
Maxime Ripard05699292019-06-27 17:31:52 +0200339 - allwinner,sun8i-a83t-emac
340 - allwinner,sun8i-h3-emac
341 - allwinner,sun8i-r40-emac
342 - allwinner,sun8i-v3s-emac
343 - allwinner,sun50i-a64-emac
Maxime Ripard7db35452019-06-27 17:31:50 +0200344 - snps,dwmac-4.00
345 - snps,dwmac-4.10a
Christophe Roullierf2253142020-04-03 16:04:14 +0200346 - snps,dwmac-4.20a
Maxime Ripard7db35452019-06-27 17:31:50 +0200347 - snps,dwxgmac
348 - snps,dwxgmac-2.10
349 - st,spear600-gmac
350
351 then:
Rob Herringdbce0b62019-12-17 10:27:12 -0600352 properties:
Maxime Ripard7db35452019-06-27 17:31:50 +0200353 snps,tso:
Rob Herringd69c6dd2020-12-17 16:34:29 -0600354 $ref: /schemas/types.yaml#/definitions/flag
Maxime Ripard7db35452019-06-27 17:31:50 +0200355 description:
356 Enables the TSO feature otherwise it will be managed by
357 MAC HW capability register.
358
Rob Herring6a0e3212020-10-05 13:38:30 -0500359additionalProperties: true
360
Maxime Ripard7db35452019-06-27 17:31:50 +0200361examples:
362 - |
363 stmmac_axi_setup: stmmac-axi-config {
364 snps,wr_osr_lmt = <0xf>;
365 snps,rd_osr_lmt = <0xf>;
366 snps,blen = <256 128 64 32 0 0 0>;
367 };
368
369 mtl_rx_setup: rx-queues-config {
370 snps,rx-queues-to-use = <1>;
371 snps,rx-sched-sp;
372 queue0 {
373 snps,dcb-algorithm;
374 snps,map-to-dma-channel = <0x0>;
375 snps,priority = <0x0>;
376 };
377 };
378
379 mtl_tx_setup: tx-queues-config {
380 snps,tx-queues-to-use = <2>;
381 snps,tx-sched-wrr;
382 queue0 {
383 snps,weight = <0x10>;
384 snps,dcb-algorithm;
385 snps,priority = <0x0>;
386 };
387
388 queue1 {
389 snps,avb-algorithm;
390 snps,send_slope = <0x1000>;
391 snps,idle_slope = <0x1000>;
392 snps,high_credit = <0x3E800>;
393 snps,low_credit = <0xFFC18000>;
394 snps,priority = <0x1>;
395 };
396 };
397
398 gmac0: ethernet@e0800000 {
399 compatible = "snps,dwxgmac-2.10", "snps,dwxgmac";
400 reg = <0xe0800000 0x8000>;
401 interrupt-parent = <&vic1>;
402 interrupts = <24 23 22>;
403 interrupt-names = "macirq", "eth_wake_irq", "eth_lpi";
404 mac-address = [000000000000]; /* Filled in by U-Boot */
405 max-frame-size = <3800>;
Maxime Ripard67d0da92019-07-03 11:55:12 +0200406 phy-mode = "gmii";
Maxime Ripard7db35452019-06-27 17:31:50 +0200407 snps,multicast-filter-bins = <256>;
408 snps,perfect-filter-entries = <128>;
409 rx-fifo-depth = <16384>;
410 tx-fifo-depth = <16384>;
411 clocks = <&clock>;
412 clock-names = "stmmaceth";
413 snps,axi-config = <&stmmac_axi_setup>;
414 snps,mtl-rx-config = <&mtl_rx_setup>;
415 snps,mtl-tx-config = <&mtl_tx_setup>;
416 mdio0 {
417 #address-cells = <1>;
418 #size-cells = <0>;
419 compatible = "snps,dwmac-mdio";
420 phy1: ethernet-phy@0 {
421 reg = <0>;
422 };
423 };
424 };
425
426# FIXME: We should set it, but it would report all the generic
427# properties as additional properties.
428# additionalProperties: false
429
430...