Ethernet Controller Common Properties

Schema identifier ($id): "http://devicetree.org/schemas/net/ethernet-controller.yaml#"

Schema dialect ($schema): "http://devicetree.org/meta-schemas/core.yaml#"

Maintainers (maintainers): "David S. Miller <davem@davemloft.net>"

Properties and child nodes (properties) #

$nodename — not listed as required here #

String pattern (pattern): "^ethernet(@.*)?$"

label — not listed as required here #

Human readable label on a port of a box.

max-speed — not listed as required here #

Shared schema rule ($ref): /schemas/types.yaml#/definitions/uint32

Specifies maximum speed in Mbit/s supported by the device.

nvmem-cells — not listed as required here #

Maximum number of items (maxItems): 1

Reference to an nvmem node for the MAC address

nvmem-cell-names — not listed as required here #

Exact value (const): "mac-address"

phy-connection-type — not listed as required here #

Specifies interface type between the Ethernet device and a physical layer (PHY) device.

Allowed values (enum): "internal", "mii", "mii-lite", "gmii", "sgmii", "psgmii", "qsgmii", "qusgmii", "tbi", "rev-mii", "rmii", "rev-rmii", "moca", "rgmii", "rgmii-id", "rgmii-rxid", "rgmii-txid", "rtbi", "smii", "xgmii", "trgmii", "1000base-x", "2500base-x", "5gbase-r", "rxaui", "xaui", "10gbase-kr", "usxgmii", "10gbase-r", "25gbase-r", "10g-qxgmii"

phy-mode — not listed as required here #

Shared schema rule ($ref): #/properties/phy-connection-type

pcs-handle — not listed as required here #

Shared schema rule ($ref): /schemas/types.yaml#/definitions/phandle-array

Array item rules (items) #

Maximum number of items (maxItems): 1

Specifies a reference to a node representing a PCS PHY device on a MDIO bus to link with an external PHY (phy-handle) if exists.

pcs-handle-names — not listed as required here #

The name of each PCS in pcs-handle.

phy-handle — not listed as required here #

Shared schema rule ($ref): /schemas/types.yaml#/definitions/phandle

Specifies a reference to a node representing a PHY device.

phy — not listed as required here #

Shared schema rule ($ref): #/properties/phy-handle

Deprecated (deprecated): true

phy-device — not listed as required here #

Shared schema rule ($ref): #/properties/phy-handle

Deprecated (deprecated): true

ptp-timer — not listed as required here #

Shared schema rule ($ref): /schemas/types.yaml#/definitions/phandle

Specifies a reference to a node representing an IEEE 1588 PTP device.

rx-fifo-depth — not listed as required here #

Shared schema rule ($ref): /schemas/types.yaml#/definitions/uint32

The size of the controller\'s receive fifo in bytes. This is used for components that can have configurable receive fifo sizes, and is useful for determining certain configuration settings such as flow control thresholds.

sfp — not listed as required here #

Shared schema rule ($ref): /schemas/types.yaml#/definitions/phandle

Specifies a reference to a node representing a SFP cage.

tx-fifo-depth — not listed as required here #

Shared schema rule ($ref): /schemas/types.yaml#/definitions/uint32

The size of the controller\'s transmit fifo in bytes. This is used for components that can have configurable fifo sizes.

managed — not listed as required here #

Specifies the PHY management type. If auto is set and fixed-link is not specified, it uses MDIO for management.

Shared schema rule ($ref): /schemas/types.yaml#/definitions/string

Default value (default): "auto"

Allowed values (enum): "auto", "in-band-status"

Exactly one of these rules must match (oneOf) #

Rule 1

Shared schema rule ($ref): /schemas/types.yaml#/definitions/uint32-array

Deprecated (deprecated): true

Array item rules (items)

Item 1

Minimum value (minimum): 0

Maximum value (maximum): 31

Emulated PHY ID, choose any but unique to the all specified fixed-links

Item 2

Allowed values (enum): 0, 1

Duplex configuration. 0 for half duplex or 1 for full duplex

Item 3

Allowed values (enum): 10, 100, 1000, 2500, 10000

Link speed in Mbits/sec.

Item 4

Allowed values (enum): 0, 1

Pause configuration. 0 for no pause, 1 for pause

Item 5

Allowed values (enum): 0, 1

Asymmetric pause configuration. 0 for no asymmetric pause, 1 for asymmetric pause

Rule 2

Value type (type): "object"

Properties not matched by properties or patternProperties in this schema (additionalProperties)

false

Not allowed by this rule.

Properties and child nodes (properties)

speed — required here

Link speed.

Shared schema rule ($ref): /schemas/types.yaml#/definitions/uint32

Allowed values (enum): 10, 100, 1000, 2500, 5000, 10000

full-duplex — not listed as required here

Shared schema rule ($ref): /schemas/types.yaml#/definitions/flag

Indicates that full-duplex is used. When absent, half duplex is assumed.

pause — not listed as required here

Shared schema rule ($ref): /schemas/types.yaml#/definitions/flag

Indicates that pause should be enabled.

asym-pause — not listed as required here

Shared schema rule ($ref): /schemas/types.yaml#/definitions/flag

Indicates that asym_pause should be enabled.

link-gpios — not listed as required here

Maximum number of items (maxItems): 1

GPIO to determine if the link is up

Required in this object (required): "speed"

leds — not listed as required here #

Describes the LEDs associated by Ethernet Controller. These LEDs are not integrated in the PHY and PHY doesn't have any control on them. Ethernet Controller regs are used to control these defined LEDs.

Value type (type): "object"

Properties and child nodes (properties) #

#address-cells — not listed as required here

Exact value (const): 1

#size-cells — not listed as required here

Exact value (const): 0

Properties matching a name pattern (patternProperties) #

^led@[a-f0-9]+$ — name matches this regular expression

Shared schema rule ($ref): /schemas/leds/common.yaml#

Properties and child nodes (properties)

reg — required here

Maximum number of items (maxItems): 1

This defines the LED index in the PHY or the MAC. It's really driver dependent and required for ports that define multiple LED for the same port.

Required in this object (required): "reg"

Properties not evaluated by applicable rules (unevaluatedProperties)

false

Not allowed by this rule.

Properties not matched by properties or patternProperties in this schema (additionalProperties) #

false

Not allowed by this rule.

Property dependencies (dependencies) #

pcs-handle-names — applies when this property is present #

Also requires: "pcs-handle"

All of these rules must match (allOf) #

Rule 1 #

Shared schema rule ($ref): /schemas/net/network-class.yaml#

Rule 2 #

Condition (if) #

Properties and child nodes (properties)

phy-mode — not listed as required here

Rule for matching array elements (contains)

Allowed values (enum): "rgmii", "rgmii-rxid", "rgmii-txid", "rgmii-id"

When the condition matches (then) #

Properties and child nodes (properties)

rx-internal-delay-ps — not listed as required here

RGMII Receive Clock Delay defined in pico seconds. This is used for controllers that have configurable RX internal delays. If this property is present then the MAC applies the RX delay.

tx-internal-delay-ps — not listed as required here

RGMII Transmit Clock Delay defined in pico seconds. This is used for controllers that have configurable TX internal delays. If this property is present then the MAC applies the TX delay.

Properties not matched by properties or patternProperties in this schema (additionalProperties) #

true

Allowed by this rule.

Source notes #

Annotations retained from the schema source

Line 1: SPDX-License-Identifier: GPL-2.0

Line 37: There is not a standard bus between the MAC and the PHY,

Line 38: something proprietary is being used to embed the PHY in the

Line 39: MAC.

Line 54: RX and TX delays are provided by the PCB. See below

Line 57: RX and TX delays are not provided by the PCB. This is the most

Line 58: frequent case. See below

Line 61: TX delay is provided by the PCB. See below

Line 64: RX delay is provided by the PCB. See below

Line 76: 10GBASE-KR, XFI, SFI

Line 270: Informative

Line 271: ===========

Line 272:

Line 273: 'phy-modes' & 'phy-connection-type' properties 'rgmii', 'rgmii-id',

Line 274: 'rgmii-rxid', and 'rgmii-txid' are frequently used wrongly by

Line 275: developers. This informative section clarifies their usage.

Line 276:

Line 277: The RGMII specification requires a 2ns delay between the data and

Line 278: clock signals on the RGMII bus. How this delay is implemented is not

Line 279: specified.

Line 280:

Line 281: One option is to make the clock traces on the PCB longer than the

Line 282: data traces. A sufficient difference in length can provide the 2ns

Line 283: delay. If both the RX and TX delays are implemented in this manner,

Line 284: 'rgmii' should be used, so indicating the PCB adds the delays.

Line 285:

Line 286: If the PCB does not add these delays via extra long traces,

Line 287: 'rgmii-id' should be used. Here, 'id' refers to 'internal delay',

Line 288: where either the MAC or PHY adds the delay.

Line 289:

Line 290: If only one of the two delays are implemented via extra long clock

Line 291: lines, either 'rgmii-rxid' or 'rgmii-txid' should be used,

Line 292: indicating the MAC or PHY should implement one of the delays

Line 293: internally, while the PCB implements the other delay.

Line 294:

Line 295: Device Tree describes hardware, and in this case, it describes the

Line 296: PCB between the MAC and the PHY, if the PCB implements delays or

Line 297: not.

Line 298:

Line 299: In practice, very few PCBs make use of extra long clock lines. Hence

Line 300: any RGMII phy mode other than 'rgmii-id' is probably wrong, and is

Line 301: unlikely to be accepted during review without details provided in

Line 302: the commit description and comments in the .dts file.

Line 303:

Line 304: When the PCB does not implement the delays, the MAC or PHY must. As

Line 305: such, this is software configuration, and so not described in Device

Line 306: Tree.

Line 307:

Line 308: The following describes how Linux implements the configuration of

Line 309: the MAC and PHY to add these delays when the PCB does not. As stated

Line 310: above, developers often get this wrong, and the aim of this section

Line 311: is reduce the frequency of these errors by Linux developers. Other

Line 312: users of the Device Tree may implement it differently, and still be

Line 313: consistent with both the normative and informative description

Line 314: above.

Line 315:

Line 316: By default in Linux, when using phylib/phylink, the MAC is expected

Line 317: to read the 'phy-mode' from Device Tree, not implement any delays,

Line 318: and pass the value to the PHY. The PHY will then implement delays as

Line 319: specified by the 'phy-mode'. The PHY should always be reconfigured

Line 320: to implement the needed delays, replacing any setting performed by

Line 321: strapping or the bootloader, etc.

Line 322:

Line 323: Experience to date is that all PHYs which implement RGMII also

Line 324: implement the ability to add or not add the needed delays. Hence

Line 325: this default is expected to work in all cases. Ignoring this default

Line 326: is likely to be questioned by Reviews, and require a strong argument

Line 327: to be accepted.

Line 328:

Line 329: There are a small number of cases where the MAC has hard coded

Line 330: delays which cannot be disabled. The 'phy-mode' only describes the

Line 331: PCB. The inability to disable the delays in the MAC does not change

Line 332: the meaning of 'phy-mode'. It does however mean that a 'phy-mode' of

Line 333: 'rgmii' is now invalid, it cannot be supported, since both the PCB

Line 334: and the MAC and PHY adding delays cannot result in a functional

Line 335: link. Thus the MAC should report a fatal error for any modes which

Line 336: cannot be supported. When the MAC implements the delay, it must

Line 337: ensure that the PHY does not also implement the same delay. So it

Line 338: must modify the phy-mode it passes to the PHY, removing the delay it

Line 339: has added. Failure to remove the delay will result in a

Line 340: non-functioning link.

Line 341:

Line 342: Sometimes there is a need to fine tune the delays. Often the MAC or

Line 343: PHY can perform this fine tuning. In the MAC node, the Device Tree

Line 344: properties 'rx-internal-delay-ps' and 'tx-internal-delay-ps' should

Line 345: be used to indicate fine tuning performed by the MAC. The values

Line 346: expected here are small. A value of 2000ps, i.e 2ns, and a phy-mode

Line 347: of 'rgmii' will not be accepted by Reviewers.

Line 348:

Line 349: If the PHY is to perform fine tuning, the properties

Line 350: 'rx-internal-delay-ps' and 'tx-internal-delay-ps' in the PHY node

Line 351: should be used. When the PHY is implementing delays, e.g. 'rgmii-id'

Line 352: these properties should have a value near to 2000ps. If the PCB is

Line 353: implementing delays, e.g. 'rgmii', a small value can be used to fine

Line 354: tune the delay added by the PCB.

Edit this page