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