Skip to content

Commit 9d3de3c

Browse files
mripardrobherring
authored andcommitted
dt-bindings: net: Add YAML schemas for the generic Ethernet options
The Ethernet controllers have a good number of generic options that can be needed in a device tree. Add a YAML schemas for those. Reviewed-by: Rob Herring <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Signed-off-by: Rob Herring <[email protected]>
1 parent 5025ef8 commit 9d3de3c

File tree

3 files changed

+208
-121
lines changed

3 files changed

+208
-121
lines changed
Lines changed: 206 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,206 @@
1+
# SPDX-License-Identifier: GPL-2.0
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/net/ethernet-controller.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Ethernet Controller Generic Binding
8+
9+
maintainers:
10+
- David S. Miller <[email protected]>
11+
12+
properties:
13+
$nodename:
14+
pattern: "^ethernet(@.*)?$"
15+
16+
local-mac-address:
17+
allOf:
18+
- $ref: /schemas/types.yaml#definitions/uint8-array
19+
- items:
20+
- minItems: 6
21+
maxItems: 6
22+
description:
23+
Specifies the MAC address that was assigned to the network device.
24+
25+
mac-address:
26+
allOf:
27+
- $ref: /schemas/types.yaml#definitions/uint8-array
28+
- items:
29+
- minItems: 6
30+
maxItems: 6
31+
description:
32+
Specifies the MAC address that was last used by the boot
33+
program; should be used in cases where the MAC address assigned
34+
to the device by the boot program is different from the
35+
local-mac-address property.
36+
37+
max-frame-size:
38+
$ref: /schemas/types.yaml#definitions/uint32
39+
description:
40+
Maximum transfer unit (IEEE defined MTU), rather than the
41+
maximum frame size (there\'s contradiction in the Devicetree
42+
Specification).
43+
44+
max-speed:
45+
$ref: /schemas/types.yaml#definitions/uint32
46+
description:
47+
Specifies maximum speed in Mbit/s supported by the device.
48+
49+
nvmem-cells:
50+
maxItems: 1
51+
description:
52+
Reference to an nvmem node for the MAC address
53+
54+
nvmem-cells-names:
55+
const: mac-address
56+
57+
phy-connection-type:
58+
description:
59+
Operation mode of the PHY interface
60+
enum:
61+
# There is not a standard bus between the MAC and the PHY,
62+
# something proprietary is being used to embed the PHY in the
63+
# MAC.
64+
- internal
65+
- mii
66+
- gmii
67+
- sgmii
68+
- qsgmii
69+
- tbi
70+
- rev-mii
71+
- rmii
72+
73+
# RX and TX delays are added by the MAC when required
74+
- rgmii
75+
76+
# RGMII with internal RX and TX delays provided by the PHY,
77+
# the MAC should not add the RX or TX delays in this case
78+
- rgmii-id
79+
80+
# RGMII with internal RX delay provided by the PHY, the MAC
81+
# should not add an RX delay in this case
82+
- rgmii-rxid
83+
84+
# RGMII with internal TX delay provided by the PHY, the MAC
85+
# should not add an TX delay in this case
86+
- rgmii-txid
87+
- rtbi
88+
- smii
89+
- xgmii
90+
- trgmii
91+
- 1000base-x
92+
- 2500base-x
93+
- rxaui
94+
- xaui
95+
96+
# 10GBASE-KR, XFI, SFI
97+
- 10gbase-kr
98+
- usxgmii
99+
100+
phy-mode:
101+
$ref: "#/properties/phy-connection-type"
102+
103+
phy-handle:
104+
$ref: /schemas/types.yaml#definitions/phandle
105+
description:
106+
Specifies a reference to a node representing a PHY device.
107+
108+
phy:
109+
$ref: "#/properties/phy-handle"
110+
deprecated: true
111+
112+
phy-device:
113+
$ref: "#/properties/phy-handle"
114+
deprecated: true
115+
116+
rx-fifo-depth:
117+
$ref: /schemas/types.yaml#definitions/uint32
118+
description:
119+
The size of the controller\'s receive fifo in bytes. This is used
120+
for components that can have configurable receive fifo sizes,
121+
and is useful for determining certain configuration settings
122+
such as flow control thresholds.
123+
124+
tx-fifo-depth:
125+
$ref: /schemas/types.yaml#definitions/uint32
126+
description:
127+
The size of the controller\'s transmit fifo in bytes. This
128+
is used for components that can have configurable fifo sizes.
129+
130+
managed:
131+
allOf:
132+
- $ref: /schemas/types.yaml#definitions/string
133+
- default: auto
134+
enum:
135+
- auto
136+
- in-band-status
137+
description:
138+
Specifies the PHY management type. If auto is set and fixed-link
139+
is not specified, it uses MDIO for management.
140+
141+
fixed-link:
142+
allOf:
143+
- if:
144+
type: array
145+
then:
146+
deprecated: true
147+
minItems: 1
148+
maxItems: 1
149+
items:
150+
items:
151+
- minimum: 0
152+
maximum: 31
153+
description:
154+
Emulated PHY ID, choose any but unique to the all
155+
specified fixed-links
156+
157+
- enum: [0, 1]
158+
description:
159+
Duplex configuration. 0 for half duplex or 1 for
160+
full duplex
161+
162+
- enum: [10, 100, 1000]
163+
description:
164+
Link speed in Mbits/sec.
165+
166+
- enum: [0, 1]
167+
description:
168+
Pause configuration. 0 for no pause, 1 for pause
169+
170+
- enum: [0, 1]
171+
description:
172+
Asymmetric pause configuration. 0 for no asymmetric
173+
pause, 1 for asymmetric pause
174+
175+
176+
- if:
177+
type: object
178+
then:
179+
properties:
180+
speed:
181+
allOf:
182+
- $ref: /schemas/types.yaml#definitions/uint32
183+
- enum: [10, 100, 1000]
184+
description:
185+
Link speed.
186+
187+
full-duplex:
188+
$ref: /schemas/types.yaml#definitions/flag
189+
description:
190+
Indicates that full-duplex is used. When absent, half
191+
duplex is assumed.
192+
193+
asym-pause:
194+
$ref: /schemas/types.yaml#definitions/flag
195+
description:
196+
Indicates that asym_pause should be enabled.
197+
198+
link-gpios:
199+
maxItems: 1
200+
description:
201+
GPIO to determine if the link is up
202+
203+
required:
204+
- speed
205+
206+
...
Lines changed: 1 addition & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1 @@
1-
The following properties are common to the Ethernet controllers:
2-
3-
NOTE: All 'phy*' properties documented below are Ethernet specific. For the
4-
generic PHY 'phys' property, see
5-
Documentation/devicetree/bindings/phy/phy-bindings.txt.
6-
7-
- mac-address: array of 6 bytes, specifies the MAC address that was last used by
8-
the boot program; should be used in cases where the MAC address assigned to
9-
the device by the boot program is different from the "local-mac-address"
10-
property;
11-
- local-mac-address: array of 6 bytes, specifies the MAC address that was
12-
assigned to the network device;
13-
- nvmem-cells: phandle, reference to an nvmem node for the MAC address
14-
- nvmem-cell-names: string, should be "mac-address" if nvmem is to be used
15-
- max-speed: number, specifies maximum speed in Mbit/s supported by the device;
16-
- max-frame-size: number, maximum transfer unit (IEEE defined MTU), rather than
17-
the maximum frame size (there's contradiction in the Devicetree
18-
Specification).
19-
- phy-mode: string, operation mode of the PHY interface. This is now a de-facto
20-
standard property; supported values are:
21-
* "internal" (Internal means there is not a standard bus between the MAC and
22-
the PHY, something proprietary is being used to embed the PHY in the MAC.)
23-
* "mii"
24-
* "gmii"
25-
* "sgmii"
26-
* "qsgmii"
27-
* "tbi"
28-
* "rev-mii"
29-
* "rmii"
30-
* "rgmii" (RX and TX delays are added by the MAC when required)
31-
* "rgmii-id" (RGMII with internal RX and TX delays provided by the PHY, the
32-
MAC should not add the RX or TX delays in this case)
33-
* "rgmii-rxid" (RGMII with internal RX delay provided by the PHY, the MAC
34-
should not add an RX delay in this case)
35-
* "rgmii-txid" (RGMII with internal TX delay provided by the PHY, the MAC
36-
should not add an TX delay in this case)
37-
* "rtbi"
38-
* "smii"
39-
* "xgmii"
40-
* "trgmii"
41-
* "1000base-x",
42-
* "2500base-x",
43-
* "rxaui"
44-
* "xaui"
45-
* "10gbase-kr" (10GBASE-KR, XFI, SFI)
46-
- phy-connection-type: the same as "phy-mode" property but described in the
47-
Devicetree Specification;
48-
- phy-handle: phandle, specifies a reference to a node representing a PHY
49-
device; this property is described in the Devicetree Specification and so
50-
preferred;
51-
- phy: the same as "phy-handle" property, not recommended for new bindings.
52-
- phy-device: the same as "phy-handle" property, not recommended for new
53-
bindings.
54-
- rx-fifo-depth: the size of the controller's receive fifo in bytes. This
55-
is used for components that can have configurable receive fifo sizes,
56-
and is useful for determining certain configuration settings such as
57-
flow control thresholds.
58-
- tx-fifo-depth: the size of the controller's transmit fifo in bytes. This
59-
is used for components that can have configurable fifo sizes.
60-
- managed: string, specifies the PHY management type. Supported values are:
61-
"auto", "in-band-status". "auto" is the default, it usess MDIO for
62-
management if fixed-link is not specified.
63-
64-
Child nodes of the Ethernet controller are typically the individual PHY devices
65-
connected via the MDIO bus (sometimes the MDIO bus controller is separate).
66-
They are described in the phy.txt file in this same directory.
67-
For non-MDIO PHY management see fixed-link.txt.
1+
This file has moved to ethernet-controller.yaml.
Lines changed: 1 addition & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1 @@
1-
Fixed link Device Tree binding
2-
------------------------------
3-
4-
Some Ethernet MACs have a "fixed link", and are not connected to a
5-
normal MDIO-managed PHY device. For those situations, a Device Tree
6-
binding allows to describe a "fixed link".
7-
8-
Such a fixed link situation is described by creating a 'fixed-link'
9-
sub-node of the Ethernet MAC device node, with the following
10-
properties:
11-
12-
* 'speed' (integer, mandatory), to indicate the link speed. Accepted
13-
values are 10, 100 and 1000
14-
* 'full-duplex' (boolean, optional), to indicate that full duplex is
15-
used. When absent, half duplex is assumed.
16-
* 'pause' (boolean, optional), to indicate that pause should be
17-
enabled.
18-
* 'asym-pause' (boolean, optional), to indicate that asym_pause should
19-
be enabled.
20-
* 'link-gpios' ('gpio-list', optional), to indicate if a gpio can be read
21-
to determine if the link is up.
22-
23-
Old, deprecated 'fixed-link' binding:
24-
25-
* A 'fixed-link' property in the Ethernet MAC node, with 5 cells, of the
26-
form <a b c d e> with the following accepted values:
27-
- a: emulated PHY ID, choose any but but unique to the all specified
28-
fixed-links, from 0 to 31
29-
- b: duplex configuration: 0 for half duplex, 1 for full duplex
30-
- c: link speed in Mbits/sec, accepted values are: 10, 100 and 1000
31-
- d: pause configuration: 0 for no pause, 1 for pause
32-
- e: asymmetric pause configuration: 0 for no asymmetric pause, 1 for
33-
asymmetric pause
34-
35-
Examples:
36-
37-
ethernet@0 {
38-
...
39-
fixed-link {
40-
speed = <1000>;
41-
full-duplex;
42-
};
43-
...
44-
};
45-
46-
ethernet@1 {
47-
...
48-
fixed-link {
49-
speed = <1000>;
50-
pause;
51-
link-gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>;
52-
};
53-
...
54-
};
1+
This file has moved to ethernet-controller.yaml.

0 commit comments

Comments
 (0)