ethernet-phy.yaml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  1. # SPDX-License-Identifier: GPL-2.0
  2. %YAML 1.2
  3. ---
  4. $id: http://devicetree.org/schemas/net/ethernet-phy.yaml#
  5. $schema: http://devicetree.org/meta-schemas/core.yaml#
  6. title: Ethernet PHY Common Properties
  7. maintainers:
  8. - Andrew Lunn <andrew@lunn.ch>
  9. - Florian Fainelli <f.fainelli@gmail.com>
  10. - Heiner Kallweit <hkallweit1@gmail.com>
  11. # The dt-schema tools will generate a select statement first by using
  12. # the compatible, and second by using the node name if any. In our
  13. # case, the node name is the one we want to match on, while the
  14. # compatible is optional.
  15. select:
  16. properties:
  17. $nodename:
  18. pattern: "^ethernet-phy(@[a-f0-9]+)?$"
  19. required:
  20. - $nodename
  21. properties:
  22. $nodename:
  23. pattern: "^ethernet-phy(@[a-f0-9]+)?$"
  24. compatible:
  25. oneOf:
  26. - const: ethernet-phy-ieee802.3-c22
  27. description: PHYs that implement IEEE802.3 clause 22
  28. - const: ethernet-phy-ieee802.3-c45
  29. description: PHYs that implement IEEE802.3 clause 45
  30. - pattern: "^ethernet-phy-id[a-f0-9]{4}\\.[a-f0-9]{4}$"
  31. description:
  32. PHYs contain identification registers. These will be read to
  33. identify the PHY. If the PHY reports an incorrect ID, or the
  34. PHY requires a specific initialization sequence (like a
  35. particular order of clocks, resets, power supplies), in
  36. order to be able to read the ID registers, then the
  37. compatible list must contain an entry with the correct PHY
  38. ID in the above form.
  39. The first group of digits is the 16 bit Phy Identifier 1
  40. register, this is the chip vendor OUI bits 3:18. The
  41. second group of digits is the Phy Identifier 2 register,
  42. this is the chip vendor OUI bits 19:24, followed by 10
  43. bits of a vendor specific ID.
  44. - items:
  45. - pattern: "^ethernet-phy-id[a-f0-9]{4}\\.[a-f0-9]{4}$"
  46. - const: ethernet-phy-ieee802.3-c22
  47. - items:
  48. - pattern: "^ethernet-phy-id[a-f0-9]{4}\\.[a-f0-9]{4}$"
  49. - const: ethernet-phy-ieee802.3-c45
  50. reg:
  51. minimum: 0
  52. maximum: 31
  53. description:
  54. The ID number for the PHY.
  55. interrupts:
  56. maxItems: 1
  57. max-speed:
  58. enum:
  59. - 10
  60. - 100
  61. - 1000
  62. - 2500
  63. - 5000
  64. - 10000
  65. - 20000
  66. - 25000
  67. - 40000
  68. - 50000
  69. - 56000
  70. - 100000
  71. - 200000
  72. description:
  73. Maximum PHY supported speed in Mbits / seconds.
  74. phy-10base-t1l-2.4vpp:
  75. description: |
  76. tristate, request/disable 2.4 Vpp operating mode. The values are:
  77. 0: Disable 2.4 Vpp operating mode.
  78. 1: Request 2.4 Vpp operating mode from link partner.
  79. Absence of this property will leave configuration to default values.
  80. $ref: /schemas/types.yaml#/definitions/uint32
  81. enum: [0, 1]
  82. broken-turn-around:
  83. $ref: /schemas/types.yaml#/definitions/flag
  84. description:
  85. If set, indicates the PHY device does not correctly release
  86. the turn around line low at end of the control phase of the
  87. MDIO transaction.
  88. brr-mode:
  89. $ref: /schemas/types.yaml#/definitions/flag
  90. description:
  91. If set, indicates the network cable interface is an alternative one as
  92. defined in the BroadR-Reach link mode specification under 1BR-100 and
  93. 1BR-10 names. The PHY must be configured to operate in BroadR-Reach mode
  94. by software.
  95. clocks:
  96. maxItems: 1
  97. description:
  98. External clock connected to the PHY. If not specified it is assumed
  99. that the PHY uses a fixed crystal or an internal oscillator.
  100. enet-phy-lane-swap:
  101. $ref: /schemas/types.yaml#/definitions/flag
  102. description:
  103. If set, indicates the PHY will swap the TX/RX lanes to
  104. compensate for the board being designed with the lanes
  105. swapped.
  106. enet-phy-lane-no-swap:
  107. $ref: /schemas/types.yaml#/definitions/flag
  108. description:
  109. If set, indicates that PHY will disable swap of the
  110. TX/RX lanes. This property allows the PHY to work correctly after
  111. e.g. wrong bootstrap configuration caused by issues in PCB
  112. layout design.
  113. eee-broken-100tx:
  114. $ref: /schemas/types.yaml#/definitions/flag
  115. description:
  116. Mark the corresponding energy efficient ethernet mode as
  117. broken and request the ethernet to stop advertising it.
  118. eee-broken-1000t:
  119. $ref: /schemas/types.yaml#/definitions/flag
  120. description:
  121. Mark the corresponding energy efficient ethernet mode as
  122. broken and request the ethernet to stop advertising it.
  123. eee-broken-10gt:
  124. $ref: /schemas/types.yaml#/definitions/flag
  125. description:
  126. Mark the corresponding energy efficient ethernet mode as
  127. broken and request the ethernet to stop advertising it.
  128. eee-broken-1000kx:
  129. $ref: /schemas/types.yaml#/definitions/flag
  130. description:
  131. Mark the corresponding energy efficient ethernet mode as
  132. broken and request the ethernet to stop advertising it.
  133. eee-broken-10gkx4:
  134. $ref: /schemas/types.yaml#/definitions/flag
  135. description:
  136. Mark the corresponding energy efficient ethernet mode as
  137. broken and request the ethernet to stop advertising it.
  138. eee-broken-10gkr:
  139. $ref: /schemas/types.yaml#/definitions/flag
  140. description:
  141. Mark the corresponding energy efficient ethernet mode as
  142. broken and request the ethernet to stop advertising it.
  143. timing-role:
  144. $ref: /schemas/types.yaml#/definitions/string
  145. enum:
  146. - forced-master
  147. - forced-slave
  148. - preferred-master
  149. - preferred-slave
  150. description: |
  151. Specifies the timing role of the PHY in the network link. This property is
  152. required for setups where the role must be explicitly assigned via the
  153. device tree due to limitations in hardware strapping or incorrect strap
  154. configurations.
  155. It is applicable to Single Pair Ethernet (1000/100/10Base-T1) and other
  156. PHY types, including 1000Base-T, where it controls whether the PHY should
  157. be a master (clock source) or a slave (clock receiver).
  158. - 'forced-master': The PHY is forced to operate as a master.
  159. - 'forced-slave': The PHY is forced to operate as a slave.
  160. - 'preferred-master': Prefer the PHY to be master but allow negotiation.
  161. - 'preferred-slave': Prefer the PHY to be slave but allow negotiation.
  162. pses:
  163. $ref: /schemas/types.yaml#/definitions/phandle-array
  164. maxItems: 1
  165. description:
  166. Specifies a reference to a node representing a Power Sourcing Equipment.
  167. phy-is-integrated:
  168. $ref: /schemas/types.yaml#/definitions/flag
  169. description:
  170. If set, indicates that the PHY is integrated into the same
  171. physical package as the Ethernet MAC. If needed, muxers
  172. should be configured to ensure the integrated PHY is
  173. used. The absence of this property indicates the muxers
  174. should be configured so that the external PHY is used.
  175. resets:
  176. maxItems: 1
  177. reset-names:
  178. const: phy
  179. reset-gpios:
  180. maxItems: 1
  181. description:
  182. The GPIO phandle and specifier for the PHY reset signal.
  183. reset-assert-us:
  184. description:
  185. Delay after the reset was asserted in microseconds. If this
  186. property is missing the delay will be skipped.
  187. reset-deassert-us:
  188. description:
  189. Delay after the reset was deasserted in microseconds. If
  190. this property is missing the delay will be skipped.
  191. sfp:
  192. $ref: /schemas/types.yaml#/definitions/phandle
  193. description:
  194. Specifies a reference to a node representing a SFP cage.
  195. rx-internal-delay-ps:
  196. description: |
  197. RGMII Receive PHY Clock Delay defined in pico seconds. This is used for
  198. PHY's that have configurable RX internal delays. If this property is
  199. present then the PHY applies the RX delay.
  200. tx-internal-delay-ps:
  201. description: |
  202. RGMII Transmit PHY Clock Delay defined in pico seconds. This is used for
  203. PHY's that have configurable TX internal delays. If this property is
  204. present then the PHY applies the TX delay.
  205. tx-amplitude-100base-tx-percent:
  206. description:
  207. Transmit amplitude gain applied for 100BASE-TX. 100% matches 2V
  208. peak-to-peak specified in ANSI X3.263. When omitted, the PHYs default
  209. will be left as is.
  210. mac-termination-ohms:
  211. maximum: 200
  212. description:
  213. The xMII signals need series termination on the driver side to match both
  214. the output driver impedance and the line characteristic impedance, to
  215. prevent reflections and EMI problems. Select a resistance value which is
  216. supported by the builtin resistors of the PHY, otherwise the resistors may
  217. have to be placed on board. When omitted, the PHYs default will be left as
  218. is.
  219. leds:
  220. type: object
  221. properties:
  222. '#address-cells':
  223. const: 1
  224. '#size-cells':
  225. const: 0
  226. patternProperties:
  227. '^led@[a-f0-9]+$':
  228. $ref: /schemas/leds/common.yaml#
  229. properties:
  230. reg:
  231. maxItems: 1
  232. description:
  233. This defines the LED index in the PHY or the MAC. It's really
  234. driver dependent and required for ports that define multiple
  235. LED for the same port.
  236. required:
  237. - reg
  238. unevaluatedProperties: false
  239. additionalProperties: false
  240. mdi:
  241. type: object
  242. patternProperties:
  243. '^connector-[0-9]+$':
  244. $ref: /schemas/net/ethernet-connector.yaml#
  245. unevaluatedProperties: false
  246. additionalProperties: false
  247. required:
  248. - reg
  249. additionalProperties: true
  250. examples:
  251. - |
  252. #include <dt-bindings/leds/common.h>
  253. ethernet {
  254. #address-cells = <1>;
  255. #size-cells = <0>;
  256. ethernet-phy@0 {
  257. compatible = "ethernet-phy-id0141.0e90", "ethernet-phy-ieee802.3-c45";
  258. interrupt-parent = <&PIC>;
  259. interrupts = <35 1>;
  260. reg = <0>;
  261. resets = <&rst 8>;
  262. reset-names = "phy";
  263. reset-gpios = <&gpio1 4 1>;
  264. reset-assert-us = <1000>;
  265. reset-deassert-us = <2000>;
  266. leds {
  267. #address-cells = <1>;
  268. #size-cells = <0>;
  269. led@0 {
  270. reg = <0>;
  271. color = <LED_COLOR_ID_WHITE>;
  272. function = LED_FUNCTION_LAN;
  273. default-state = "keep";
  274. };
  275. };
  276. /* Fast Ethernet port, with only 2 pairs wired */
  277. mdi {
  278. connector-0 {
  279. pairs = <2>;
  280. media = "BaseT";
  281. };
  282. };
  283. };
  284. };