xref: /linux/Documentation/devicetree/bindings/net/ethernet-phy.yaml (revision ab93e0dd72c37d378dd936f031ffb83ff2bd87ce)
1d8704342SMaxime Ripard# SPDX-License-Identifier: GPL-2.0
2d8704342SMaxime Ripard%YAML 1.2
3d8704342SMaxime Ripard---
4d8704342SMaxime Ripard$id: http://devicetree.org/schemas/net/ethernet-phy.yaml#
5d8704342SMaxime Ripard$schema: http://devicetree.org/meta-schemas/core.yaml#
6d8704342SMaxime Ripard
7ab040c42SKrzysztof Kozlowskititle: Ethernet PHY Common Properties
8d8704342SMaxime Ripard
9d8704342SMaxime Ripardmaintainers:
10d8704342SMaxime Ripard  - Andrew Lunn <andrew@lunn.ch>
11d8704342SMaxime Ripard  - Florian Fainelli <f.fainelli@gmail.com>
12d8704342SMaxime Ripard  - Heiner Kallweit <hkallweit1@gmail.com>
13d8704342SMaxime Ripard
14d8704342SMaxime Ripard# The dt-schema tools will generate a select statement first by using
15d8704342SMaxime Ripard# the compatible, and second by using the node name if any. In our
16d8704342SMaxime Ripard# case, the node name is the one we want to match on, while the
17d8704342SMaxime Ripard# compatible is optional.
18d8704342SMaxime Ripardselect:
19d8704342SMaxime Ripard  properties:
20d8704342SMaxime Ripard    $nodename:
21d8704342SMaxime Ripard      pattern: "^ethernet-phy(@[a-f0-9]+)?$"
22d8704342SMaxime Ripard
23d8704342SMaxime Ripard  required:
24d8704342SMaxime Ripard    - $nodename
25d8704342SMaxime Ripard
26d8704342SMaxime Ripardproperties:
27d8704342SMaxime Ripard  $nodename:
28d8704342SMaxime Ripard    pattern: "^ethernet-phy(@[a-f0-9]+)?$"
29d8704342SMaxime Ripard
30d8704342SMaxime Ripard  compatible:
31d8704342SMaxime Ripard    oneOf:
32d8704342SMaxime Ripard      - const: ethernet-phy-ieee802.3-c22
33d8704342SMaxime Ripard        description: PHYs that implement IEEE802.3 clause 22
34d8704342SMaxime Ripard      - const: ethernet-phy-ieee802.3-c45
35d8704342SMaxime Ripard        description: PHYs that implement IEEE802.3 clause 45
36d8704342SMaxime Ripard      - pattern: "^ethernet-phy-id[a-f0-9]{4}\\.[a-f0-9]{4}$"
37d8704342SMaxime Ripard        description:
38d8704342SMaxime Ripard          If the PHY reports an incorrect ID (or none at all) then the
39d8704342SMaxime Ripard          compatible list may contain an entry with the correct PHY ID
40d8704342SMaxime Ripard          in the above form.
41d8704342SMaxime Ripard          The first group of digits is the 16 bit Phy Identifier 1
42d8704342SMaxime Ripard          register, this is the chip vendor OUI bits 3:18. The
43d8704342SMaxime Ripard          second group of digits is the Phy Identifier 2 register,
44d8704342SMaxime Ripard          this is the chip vendor OUI bits 19:24, followed by 10
45d8704342SMaxime Ripard          bits of a vendor specific ID.
46d8704342SMaxime Ripard      - items:
47d8704342SMaxime Ripard          - pattern: "^ethernet-phy-id[a-f0-9]{4}\\.[a-f0-9]{4}$"
48c8322754SJohan Jonker          - const: ethernet-phy-ieee802.3-c22
49c8322754SJohan Jonker      - items:
50c8322754SJohan Jonker          - pattern: "^ethernet-phy-id[a-f0-9]{4}\\.[a-f0-9]{4}$"
51d8704342SMaxime Ripard          - const: ethernet-phy-ieee802.3-c45
52d8704342SMaxime Ripard
53d8704342SMaxime Ripard  reg:
54d8704342SMaxime Ripard    minimum: 0
55d8704342SMaxime Ripard    maximum: 31
56d8704342SMaxime Ripard    description:
57d8704342SMaxime Ripard      The ID number for the PHY.
58d8704342SMaxime Ripard
59d8704342SMaxime Ripard  interrupts:
60d8704342SMaxime Ripard    maxItems: 1
61d8704342SMaxime Ripard
62d8704342SMaxime Ripard  max-speed:
63d8704342SMaxime Ripard    enum:
64d8704342SMaxime Ripard      - 10
65d8704342SMaxime Ripard      - 100
66d8704342SMaxime Ripard      - 1000
67d8704342SMaxime Ripard      - 2500
68d8704342SMaxime Ripard      - 5000
69d8704342SMaxime Ripard      - 10000
70d8704342SMaxime Ripard      - 20000
71d8704342SMaxime Ripard      - 25000
72d8704342SMaxime Ripard      - 40000
73d8704342SMaxime Ripard      - 50000
74d8704342SMaxime Ripard      - 56000
75d8704342SMaxime Ripard      - 100000
76d8704342SMaxime Ripard      - 200000
77d8704342SMaxime Ripard    description:
78d8704342SMaxime Ripard      Maximum PHY supported speed in Mbits / seconds.
79d8704342SMaxime Ripard
8049714461SAlexandru Tachici  phy-10base-t1l-2.4vpp:
8149714461SAlexandru Tachici    description: |
8249714461SAlexandru Tachici      tristate, request/disable 2.4 Vpp operating mode. The values are:
8349714461SAlexandru Tachici      0: Disable 2.4 Vpp operating mode.
8449714461SAlexandru Tachici      1: Request 2.4 Vpp operating mode from link partner.
8549714461SAlexandru Tachici      Absence of this property will leave configuration to default values.
863079bfdbSRob Herring    $ref: /schemas/types.yaml#/definitions/uint32
8749714461SAlexandru Tachici    enum: [0, 1]
8849714461SAlexandru Tachici
89d8704342SMaxime Ripard  broken-turn-around:
90d69c6dddSRob Herring    $ref: /schemas/types.yaml#/definitions/flag
91d8704342SMaxime Ripard    description:
92d8704342SMaxime Ripard      If set, indicates the PHY device does not correctly release
93f42ceca2SFlorian Fainelli      the turn around line low at end of the control phase of the
94f42ceca2SFlorian Fainelli      MDIO transaction.
95d8704342SMaxime Ripard
96775631d7SKamil Horák (2N)  brr-mode:
97775631d7SKamil Horák (2N)    $ref: /schemas/types.yaml#/definitions/flag
98775631d7SKamil Horák (2N)    description:
99775631d7SKamil Horák (2N)      If set, indicates the network cable interface is an alternative one as
100775631d7SKamil Horák (2N)      defined in the BroadR-Reach link mode specification under 1BR-100 and
101775631d7SKamil Horák (2N)      1BR-10 names. The PHY must be configured to operate in BroadR-Reach mode
102775631d7SKamil Horák (2N)      by software.
103775631d7SKamil Horák (2N)
104350b7a25SDetlev Casanova  clocks:
105350b7a25SDetlev Casanova    maxItems: 1
106350b7a25SDetlev Casanova    description:
107350b7a25SDetlev Casanova      External clock connected to the PHY. If not specified it is assumed
108350b7a25SDetlev Casanova      that the PHY uses a fixed crystal or an internal oscillator.
109350b7a25SDetlev Casanova
110d8704342SMaxime Ripard  enet-phy-lane-swap:
111d69c6dddSRob Herring    $ref: /schemas/types.yaml#/definitions/flag
112d8704342SMaxime Ripard    description:
113d8704342SMaxime Ripard      If set, indicates the PHY will swap the TX/RX lanes to
114d8704342SMaxime Ripard      compensate for the board being designed with the lanes
115d8704342SMaxime Ripard      swapped.
116d8704342SMaxime Ripard
11796db48c9SAlexander Stein  enet-phy-lane-no-swap:
11896db48c9SAlexander Stein    $ref: /schemas/types.yaml#/definitions/flag
11996db48c9SAlexander Stein    description:
12096db48c9SAlexander Stein      If set, indicates that PHY will disable swap of the
12147aab533SBjorn Helgaas      TX/RX lanes. This property allows the PHY to work correctly after
12296db48c9SAlexander Stein      e.g. wrong bootstrap configuration caused by issues in PCB
12396db48c9SAlexander Stein      layout design.
12496db48c9SAlexander Stein
125d8704342SMaxime Ripard  eee-broken-100tx:
126d69c6dddSRob Herring    $ref: /schemas/types.yaml#/definitions/flag
127d8704342SMaxime Ripard    description:
128d8704342SMaxime Ripard      Mark the corresponding energy efficient ethernet mode as
129d8704342SMaxime Ripard      broken and request the ethernet to stop advertising it.
130d8704342SMaxime Ripard
131d8704342SMaxime Ripard  eee-broken-1000t:
132d69c6dddSRob Herring    $ref: /schemas/types.yaml#/definitions/flag
133d8704342SMaxime Ripard    description:
134d8704342SMaxime Ripard      Mark the corresponding energy efficient ethernet mode as
135d8704342SMaxime Ripard      broken and request the ethernet to stop advertising it.
136d8704342SMaxime Ripard
137d8704342SMaxime Ripard  eee-broken-10gt:
138d69c6dddSRob Herring    $ref: /schemas/types.yaml#/definitions/flag
139d8704342SMaxime Ripard    description:
140d8704342SMaxime Ripard      Mark the corresponding energy efficient ethernet mode as
141d8704342SMaxime Ripard      broken and request the ethernet to stop advertising it.
142d8704342SMaxime Ripard
143d8704342SMaxime Ripard  eee-broken-1000kx:
144d69c6dddSRob Herring    $ref: /schemas/types.yaml#/definitions/flag
145d8704342SMaxime Ripard    description:
146d8704342SMaxime Ripard      Mark the corresponding energy efficient ethernet mode as
147d8704342SMaxime Ripard      broken and request the ethernet to stop advertising it.
148d8704342SMaxime Ripard
149d8704342SMaxime Ripard  eee-broken-10gkx4:
150d69c6dddSRob Herring    $ref: /schemas/types.yaml#/definitions/flag
151d8704342SMaxime Ripard    description:
152d8704342SMaxime Ripard      Mark the corresponding energy efficient ethernet mode as
153d8704342SMaxime Ripard      broken and request the ethernet to stop advertising it.
154d8704342SMaxime Ripard
155d8704342SMaxime Ripard  eee-broken-10gkr:
156d69c6dddSRob Herring    $ref: /schemas/types.yaml#/definitions/flag
157d8704342SMaxime Ripard    description:
158d8704342SMaxime Ripard      Mark the corresponding energy efficient ethernet mode as
159d8704342SMaxime Ripard      broken and request the ethernet to stop advertising it.
160d8704342SMaxime Ripard
16131a9ce20SOleksij Rempel  timing-role:
16231a9ce20SOleksij Rempel    $ref: /schemas/types.yaml#/definitions/string
16331a9ce20SOleksij Rempel    enum:
16431a9ce20SOleksij Rempel      - forced-master
16531a9ce20SOleksij Rempel      - forced-slave
16631a9ce20SOleksij Rempel      - preferred-master
16731a9ce20SOleksij Rempel      - preferred-slave
16831a9ce20SOleksij Rempel    description: |
16931a9ce20SOleksij Rempel      Specifies the timing role of the PHY in the network link. This property is
17031a9ce20SOleksij Rempel      required for setups where the role must be explicitly assigned via the
17131a9ce20SOleksij Rempel      device tree due to limitations in hardware strapping or incorrect strap
17231a9ce20SOleksij Rempel      configurations.
17331a9ce20SOleksij Rempel      It is applicable to Single Pair Ethernet (1000/100/10Base-T1) and other
17431a9ce20SOleksij Rempel      PHY types, including 1000Base-T, where it controls whether the PHY should
17531a9ce20SOleksij Rempel      be a master (clock source) or a slave (clock receiver).
17631a9ce20SOleksij Rempel
17731a9ce20SOleksij Rempel      - 'forced-master': The PHY is forced to operate as a master.
17831a9ce20SOleksij Rempel      - 'forced-slave': The PHY is forced to operate as a slave.
17931a9ce20SOleksij Rempel      - 'preferred-master': Prefer the PHY to be master but allow negotiation.
18031a9ce20SOleksij Rempel      - 'preferred-slave': Prefer the PHY to be slave but allow negotiation.
18131a9ce20SOleksij Rempel
182e9554b31SOleksij Rempel  pses:
183e9554b31SOleksij Rempel    $ref: /schemas/types.yaml#/definitions/phandle-array
184e9554b31SOleksij Rempel    maxItems: 1
185e9554b31SOleksij Rempel    description:
186e9554b31SOleksij Rempel      Specifies a reference to a node representing a Power Sourcing Equipment.
187e9554b31SOleksij Rempel
188d8704342SMaxime Ripard  phy-is-integrated:
189d69c6dddSRob Herring    $ref: /schemas/types.yaml#/definitions/flag
190d8704342SMaxime Ripard    description:
191d8704342SMaxime Ripard      If set, indicates that the PHY is integrated into the same
192d8704342SMaxime Ripard      physical package as the Ethernet MAC. If needed, muxers
193d8704342SMaxime Ripard      should be configured to ensure the integrated PHY is
194d8704342SMaxime Ripard      used. The absence of this property indicates the muxers
195d8704342SMaxime Ripard      should be configured so that the external PHY is used.
196d8704342SMaxime Ripard
197d8704342SMaxime Ripard  resets:
198d8704342SMaxime Ripard    maxItems: 1
199d8704342SMaxime Ripard
200d8704342SMaxime Ripard  reset-names:
201d8704342SMaxime Ripard    const: phy
202d8704342SMaxime Ripard
203d8704342SMaxime Ripard  reset-gpios:
204d8704342SMaxime Ripard    maxItems: 1
205d8704342SMaxime Ripard    description:
206d8704342SMaxime Ripard      The GPIO phandle and specifier for the PHY reset signal.
207d8704342SMaxime Ripard
208d8704342SMaxime Ripard  reset-assert-us:
209d8704342SMaxime Ripard    description:
210d8704342SMaxime Ripard      Delay after the reset was asserted in microseconds. If this
211d8704342SMaxime Ripard      property is missing the delay will be skipped.
212d8704342SMaxime Ripard
213d8704342SMaxime Ripard  reset-deassert-us:
214d8704342SMaxime Ripard    description:
215d8704342SMaxime Ripard      Delay after the reset was deasserted in microseconds. If
216d8704342SMaxime Ripard      this property is missing the delay will be skipped.
217d8704342SMaxime Ripard
218fb3d8bcdSRussell King  sfp:
219d69c6dddSRob Herring    $ref: /schemas/types.yaml#/definitions/phandle
220fb3d8bcdSRussell King    description:
221fb3d8bcdSRussell King      Specifies a reference to a node representing a SFP cage.
222fb3d8bcdSRussell King
2239150069bSDan Murphy  rx-internal-delay-ps:
2249150069bSDan Murphy    description: |
2259150069bSDan Murphy      RGMII Receive PHY Clock Delay defined in pico seconds.  This is used for
2269150069bSDan Murphy      PHY's that have configurable RX internal delays.  If this property is
2279150069bSDan Murphy      present then the PHY applies the RX delay.
2289150069bSDan Murphy
2299150069bSDan Murphy  tx-internal-delay-ps:
2309150069bSDan Murphy    description: |
2319150069bSDan Murphy      RGMII Transmit PHY Clock Delay defined in pico seconds.  This is used for
2329150069bSDan Murphy      PHY's that have configurable TX internal delays. If this property is
2339150069bSDan Murphy      present then the PHY applies the TX delay.
2349150069bSDan Murphy
2357fff5d95SDimitri Fedrau  tx-amplitude-100base-tx-percent:
2367fff5d95SDimitri Fedrau    description:
2377fff5d95SDimitri Fedrau      Transmit amplitude gain applied for 100BASE-TX. 100% matches 2V
2387fff5d95SDimitri Fedrau      peak-to-peak specified in ANSI X3.263. When omitted, the PHYs default
2397fff5d95SDimitri Fedrau      will be left as is.
2407fff5d95SDimitri Fedrau
241*4cb6316dSDimitri Fedrau  mac-termination-ohms:
242*4cb6316dSDimitri Fedrau    maximum: 200
243*4cb6316dSDimitri Fedrau    description:
244*4cb6316dSDimitri Fedrau      The xMII signals need series termination on the driver side to match both
245*4cb6316dSDimitri Fedrau      the output driver impedance and the line characteristic impedance, to
246*4cb6316dSDimitri Fedrau      prevent reflections and EMI problems. Select a resistance value which is
247*4cb6316dSDimitri Fedrau      supported by the builtin resistors of the PHY, otherwise the resistors may
248*4cb6316dSDimitri Fedrau      have to be placed on board. When omitted, the PHYs default will be left as
249*4cb6316dSDimitri Fedrau      is.
250*4cb6316dSDimitri Fedrau
25118a24b69SChristian Marangi  leds:
25218a24b69SChristian Marangi    type: object
25318a24b69SChristian Marangi
25418a24b69SChristian Marangi    properties:
25518a24b69SChristian Marangi      '#address-cells':
25618a24b69SChristian Marangi        const: 1
25718a24b69SChristian Marangi
25818a24b69SChristian Marangi      '#size-cells':
25918a24b69SChristian Marangi        const: 0
26018a24b69SChristian Marangi
26118a24b69SChristian Marangi    patternProperties:
26218a24b69SChristian Marangi      '^led@[a-f0-9]+$':
26318a24b69SChristian Marangi        $ref: /schemas/leds/common.yaml#
26418a24b69SChristian Marangi
26518a24b69SChristian Marangi        properties:
26618a24b69SChristian Marangi          reg:
26718a24b69SChristian Marangi            maxItems: 1
26818a24b69SChristian Marangi            description:
26918a24b69SChristian Marangi              This define the LED index in the PHY or the MAC. It's really
27018a24b69SChristian Marangi              driver dependent and required for ports that define multiple
27118a24b69SChristian Marangi              LED for the same port.
27218a24b69SChristian Marangi
27318a24b69SChristian Marangi        required:
27418a24b69SChristian Marangi          - reg
27518a24b69SChristian Marangi
27618a24b69SChristian Marangi        unevaluatedProperties: false
27718a24b69SChristian Marangi
27818a24b69SChristian Marangi    additionalProperties: false
27918a24b69SChristian Marangi
280d8704342SMaxime Ripardrequired:
281d8704342SMaxime Ripard  - reg
282d8704342SMaxime Ripard
2836a0e321eSRob HerringadditionalProperties: true
2846a0e321eSRob Herring
285d8704342SMaxime Ripardexamples:
286d8704342SMaxime Ripard  - |
28718a24b69SChristian Marangi    #include <dt-bindings/leds/common.h>
28818a24b69SChristian Marangi
289d8704342SMaxime Ripard    ethernet {
290d8704342SMaxime Ripard        #address-cells = <1>;
291d8704342SMaxime Ripard        #size-cells = <0>;
292d8704342SMaxime Ripard
293d8704342SMaxime Ripard        ethernet-phy@0 {
294d8704342SMaxime Ripard            compatible = "ethernet-phy-id0141.0e90", "ethernet-phy-ieee802.3-c45";
295d8704342SMaxime Ripard            interrupt-parent = <&PIC>;
296d8704342SMaxime Ripard            interrupts = <35 1>;
297d8704342SMaxime Ripard            reg = <0>;
298d8704342SMaxime Ripard
299d8704342SMaxime Ripard            resets = <&rst 8>;
300d8704342SMaxime Ripard            reset-names = "phy";
301d8704342SMaxime Ripard            reset-gpios = <&gpio1 4 1>;
302d8704342SMaxime Ripard            reset-assert-us = <1000>;
303d8704342SMaxime Ripard            reset-deassert-us = <2000>;
30418a24b69SChristian Marangi
30518a24b69SChristian Marangi            leds {
30618a24b69SChristian Marangi                #address-cells = <1>;
30718a24b69SChristian Marangi                #size-cells = <0>;
30818a24b69SChristian Marangi
30918a24b69SChristian Marangi                led@0 {
31018a24b69SChristian Marangi                    reg = <0>;
31118a24b69SChristian Marangi                    color = <LED_COLOR_ID_WHITE>;
31218a24b69SChristian Marangi                    function = LED_FUNCTION_LAN;
31318a24b69SChristian Marangi                    default-state = "keep";
31418a24b69SChristian Marangi                };
31518a24b69SChristian Marangi            };
316d8704342SMaxime Ripard        };
317d8704342SMaxime Ripard    };
318