ethernet-controller.yaml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355
  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. title: Ethernet Controller Common Properties
  7. maintainers:
  8. - David S. Miller <davem@davemloft.net>
  9. properties:
  10. $nodename:
  11. pattern: "^ethernet(@.*)?$"
  12. label:
  13. description: Human readable label on a port of a box.
  14. max-speed:
  15. $ref: /schemas/types.yaml#/definitions/uint32
  16. description:
  17. Specifies maximum speed in Mbit/s supported by the device.
  18. nvmem-cells:
  19. maxItems: 1
  20. description:
  21. Reference to an nvmem node for the MAC address
  22. nvmem-cell-names:
  23. const: mac-address
  24. phy-connection-type:
  25. description:
  26. Specifies interface type between the Ethernet device and a physical
  27. layer (PHY) device.
  28. enum:
  29. # There is not a standard bus between the MAC and the PHY,
  30. # something proprietary is being used to embed the PHY in the
  31. # MAC.
  32. - internal
  33. - mii
  34. - mii-lite
  35. - gmii
  36. - sgmii
  37. - psgmii
  38. - qsgmii
  39. - qusgmii
  40. - tbi
  41. - rev-mii
  42. - rmii
  43. - rev-rmii
  44. - moca
  45. # RX and TX delays are provided by the PCB. See below
  46. - rgmii
  47. # RX and TX delays are not provided by the PCB. This is the most
  48. # frequent case. See below
  49. - rgmii-id
  50. # TX delay is provided by the PCB. See below
  51. - rgmii-rxid
  52. # RX delay is provided by the PCB. See below
  53. - rgmii-txid
  54. - rtbi
  55. - smii
  56. - xgmii
  57. - trgmii
  58. - 1000base-x
  59. - 2500base-x
  60. - 5gbase-r
  61. - rxaui
  62. - xaui
  63. # 10GBASE-KR, XFI, SFI
  64. - 10gbase-kr
  65. - usxgmii
  66. - 10gbase-r
  67. - 25gbase-r
  68. - 10g-qxgmii
  69. phy-mode:
  70. $ref: "#/properties/phy-connection-type"
  71. pcs-handle:
  72. $ref: /schemas/types.yaml#/definitions/phandle-array
  73. items:
  74. maxItems: 1
  75. description:
  76. Specifies a reference to a node representing a PCS PHY device on a MDIO
  77. bus to link with an external PHY (phy-handle) if exists.
  78. pcs-handle-names:
  79. description:
  80. The name of each PCS in pcs-handle.
  81. phy-handle:
  82. $ref: /schemas/types.yaml#/definitions/phandle
  83. description:
  84. Specifies a reference to a node representing a PHY device.
  85. phy:
  86. $ref: "#/properties/phy-handle"
  87. deprecated: true
  88. phy-device:
  89. $ref: "#/properties/phy-handle"
  90. deprecated: true
  91. ptp-timer:
  92. $ref: /schemas/types.yaml#/definitions/phandle
  93. description:
  94. Specifies a reference to a node representing an IEEE 1588 PTP device.
  95. rx-fifo-depth:
  96. $ref: /schemas/types.yaml#/definitions/uint32
  97. description:
  98. The size of the controller\'s receive fifo in bytes. This is used
  99. for components that can have configurable receive fifo sizes,
  100. and is useful for determining certain configuration settings
  101. such as flow control thresholds.
  102. sfp:
  103. $ref: /schemas/types.yaml#/definitions/phandle
  104. description:
  105. Specifies a reference to a node representing a SFP cage.
  106. tx-fifo-depth:
  107. $ref: /schemas/types.yaml#/definitions/uint32
  108. description:
  109. The size of the controller\'s transmit fifo in bytes. This
  110. is used for components that can have configurable fifo sizes.
  111. managed:
  112. description:
  113. Specifies the PHY management type. If auto is set and fixed-link
  114. is not specified, it uses MDIO for management.
  115. $ref: /schemas/types.yaml#/definitions/string
  116. default: auto
  117. enum:
  118. - auto
  119. - in-band-status
  120. fixed-link:
  121. oneOf:
  122. - $ref: /schemas/types.yaml#/definitions/uint32-array
  123. deprecated: true
  124. items:
  125. - minimum: 0
  126. maximum: 31
  127. description:
  128. Emulated PHY ID, choose any but unique to the all
  129. specified fixed-links
  130. - enum: [0, 1]
  131. description:
  132. Duplex configuration. 0 for half duplex or 1 for
  133. full duplex
  134. - enum: [10, 100, 1000, 2500, 10000]
  135. description:
  136. Link speed in Mbits/sec.
  137. - enum: [0, 1]
  138. description:
  139. Pause configuration. 0 for no pause, 1 for pause
  140. - enum: [0, 1]
  141. description:
  142. Asymmetric pause configuration. 0 for no asymmetric
  143. pause, 1 for asymmetric pause
  144. - type: object
  145. additionalProperties: false
  146. properties:
  147. speed:
  148. description:
  149. Link speed.
  150. $ref: /schemas/types.yaml#/definitions/uint32
  151. enum: [10, 100, 1000, 2500, 5000, 10000]
  152. full-duplex:
  153. $ref: /schemas/types.yaml#/definitions/flag
  154. description:
  155. Indicates that full-duplex is used. When absent, half
  156. duplex is assumed.
  157. pause:
  158. $ref: /schemas/types.yaml#/definitions/flag
  159. description:
  160. Indicates that pause should be enabled.
  161. asym-pause:
  162. $ref: /schemas/types.yaml#/definitions/flag
  163. description:
  164. Indicates that asym_pause should be enabled.
  165. link-gpios:
  166. maxItems: 1
  167. description:
  168. GPIO to determine if the link is up
  169. required:
  170. - speed
  171. leds:
  172. description:
  173. Describes the LEDs associated by Ethernet Controller.
  174. These LEDs are not integrated in the PHY and PHY doesn't have any
  175. control on them. Ethernet Controller regs are used to control
  176. these defined LEDs.
  177. type: object
  178. properties:
  179. '#address-cells':
  180. const: 1
  181. '#size-cells':
  182. const: 0
  183. patternProperties:
  184. '^led@[a-f0-9]+$':
  185. $ref: /schemas/leds/common.yaml#
  186. properties:
  187. reg:
  188. maxItems: 1
  189. description:
  190. This defines the LED index in the PHY or the MAC. It's really
  191. driver dependent and required for ports that define multiple
  192. LED for the same port.
  193. required:
  194. - reg
  195. unevaluatedProperties: false
  196. additionalProperties: false
  197. dependencies:
  198. pcs-handle-names: [pcs-handle]
  199. allOf:
  200. - $ref: /schemas/net/network-class.yaml#
  201. - if:
  202. properties:
  203. phy-mode:
  204. contains:
  205. enum:
  206. - rgmii
  207. - rgmii-rxid
  208. - rgmii-txid
  209. - rgmii-id
  210. then:
  211. properties:
  212. rx-internal-delay-ps:
  213. description:
  214. RGMII Receive Clock Delay defined in pico seconds. This is used for
  215. controllers that have configurable RX internal delays. If this
  216. property is present then the MAC applies the RX delay.
  217. tx-internal-delay-ps:
  218. description:
  219. RGMII Transmit Clock Delay defined in pico seconds. This is used for
  220. controllers that have configurable TX internal delays. If this
  221. property is present then the MAC applies the TX delay.
  222. additionalProperties: true
  223. # Informative
  224. # ===========
  225. #
  226. # 'phy-modes' & 'phy-connection-type' properties 'rgmii', 'rgmii-id',
  227. # 'rgmii-rxid', and 'rgmii-txid' are frequently used wrongly by
  228. # developers. This informative section clarifies their usage.
  229. #
  230. # The RGMII specification requires a 2ns delay between the data and
  231. # clock signals on the RGMII bus. How this delay is implemented is not
  232. # specified.
  233. #
  234. # One option is to make the clock traces on the PCB longer than the
  235. # data traces. A sufficient difference in length can provide the 2ns
  236. # delay. If both the RX and TX delays are implemented in this manner,
  237. # 'rgmii' should be used, so indicating the PCB adds the delays.
  238. #
  239. # If the PCB does not add these delays via extra long traces,
  240. # 'rgmii-id' should be used. Here, 'id' refers to 'internal delay',
  241. # where either the MAC or PHY adds the delay.
  242. #
  243. # If only one of the two delays are implemented via extra long clock
  244. # lines, either 'rgmii-rxid' or 'rgmii-txid' should be used,
  245. # indicating the MAC or PHY should implement one of the delays
  246. # internally, while the PCB implements the other delay.
  247. #
  248. # Device Tree describes hardware, and in this case, it describes the
  249. # PCB between the MAC and the PHY, if the PCB implements delays or
  250. # not.
  251. #
  252. # In practice, very few PCBs make use of extra long clock lines. Hence
  253. # any RGMII phy mode other than 'rgmii-id' is probably wrong, and is
  254. # unlikely to be accepted during review without details provided in
  255. # the commit description and comments in the .dts file.
  256. #
  257. # When the PCB does not implement the delays, the MAC or PHY must. As
  258. # such, this is software configuration, and so not described in Device
  259. # Tree.
  260. #
  261. # The following describes how Linux implements the configuration of
  262. # the MAC and PHY to add these delays when the PCB does not. As stated
  263. # above, developers often get this wrong, and the aim of this section
  264. # is reduce the frequency of these errors by Linux developers. Other
  265. # users of the Device Tree may implement it differently, and still be
  266. # consistent with both the normative and informative description
  267. # above.
  268. #
  269. # By default in Linux, when using phylib/phylink, the MAC is expected
  270. # to read the 'phy-mode' from Device Tree, not implement any delays,
  271. # and pass the value to the PHY. The PHY will then implement delays as
  272. # specified by the 'phy-mode'. The PHY should always be reconfigured
  273. # to implement the needed delays, replacing any setting performed by
  274. # strapping or the bootloader, etc.
  275. #
  276. # Experience to date is that all PHYs which implement RGMII also
  277. # implement the ability to add or not add the needed delays. Hence
  278. # this default is expected to work in all cases. Ignoring this default
  279. # is likely to be questioned by Reviews, and require a strong argument
  280. # to be accepted.
  281. #
  282. # There are a small number of cases where the MAC has hard coded
  283. # delays which cannot be disabled. The 'phy-mode' only describes the
  284. # PCB. The inability to disable the delays in the MAC does not change
  285. # the meaning of 'phy-mode'. It does however mean that a 'phy-mode' of
  286. # 'rgmii' is now invalid, it cannot be supported, since both the PCB
  287. # and the MAC and PHY adding delays cannot result in a functional
  288. # link. Thus the MAC should report a fatal error for any modes which
  289. # cannot be supported. When the MAC implements the delay, it must
  290. # ensure that the PHY does not also implement the same delay. So it
  291. # must modify the phy-mode it passes to the PHY, removing the delay it
  292. # has added. Failure to remove the delay will result in a
  293. # non-functioning link.
  294. #
  295. # Sometimes there is a need to fine tune the delays. Often the MAC or
  296. # PHY can perform this fine tuning. In the MAC node, the Device Tree
  297. # properties 'rx-internal-delay-ps' and 'tx-internal-delay-ps' should
  298. # be used to indicate fine tuning performed by the MAC. The values
  299. # expected here are small. A value of 2000ps, i.e 2ns, and a phy-mode
  300. # of 'rgmii' will not be accepted by Reviewers.
  301. #
  302. # If the PHY is to perform fine tuning, the properties
  303. # 'rx-internal-delay-ps' and 'tx-internal-delay-ps' in the PHY node
  304. # should be used. When the PHY is implementing delays, e.g. 'rgmii-id'
  305. # these properties should have a value near to 2000ps. If the PCB is
  306. # implementing delays, e.g. 'rgmii', a small value can be used to fine
  307. # tune the delay added by the PCB.
  308. ...