sff,sfp.yaml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
  2. %YAML 1.2
  3. ---
  4. $id: http://devicetree.org/schemas/net/sff,sfp.yaml#
  5. $schema: http://devicetree.org/meta-schemas/core.yaml#
  6. title: Small Form Factor (SFF) Committee Small Form-factor Pluggable (SFP)
  7. Transceiver
  8. maintainers:
  9. - Russell King <linux@armlinux.org.uk>
  10. properties:
  11. compatible:
  12. enum:
  13. - sff,sfp # for SFP modules
  14. - sff,sff # for soldered down SFF modules
  15. i2c-bus:
  16. $ref: /schemas/types.yaml#/definitions/phandle
  17. description:
  18. phandle of an I2C bus controller for the SFP two wire serial
  19. maximum-power-milliwatt:
  20. minimum: 1000
  21. default: 1000
  22. description:
  23. Maximum module power consumption Specifies the maximum power consumption
  24. allowable by a module in the slot, in milli-Watts. Presently, modules can
  25. be up to 1W, 1.5W or 2W.
  26. mod-def0-gpios:
  27. maxItems: 1
  28. description:
  29. GPIO phandle and a specifier of the MOD-DEF0 (AKA Mod_ABS) module
  30. presence input gpio signal, active (module absent) high. Must not be
  31. present for SFF modules
  32. los-gpios:
  33. maxItems: 1
  34. description:
  35. GPIO phandle and a specifier of the Receiver Loss of Signal Indication
  36. input gpio signal, active (signal lost) high
  37. tx-fault-gpios:
  38. maxItems: 1
  39. description:
  40. GPIO phandle and a specifier of the Module Transmitter Fault input gpio
  41. signal, active (fault condition) high
  42. tx-disable-gpios:
  43. maxItems: 1
  44. description:
  45. GPIO phandle and a specifier of the Transmitter Disable output gpio
  46. signal, active (Tx disable) high
  47. rate-select0-gpios:
  48. maxItems: 1
  49. description:
  50. GPIO phandle and a specifier of the Rx Signaling Rate Select (AKA RS0)
  51. output gpio signal, low - low Rx rate, high - high Rx rate Must not be
  52. present for SFF modules
  53. rate-select1-gpios:
  54. maxItems: 1
  55. description:
  56. GPIO phandle and a specifier of the Tx Signaling Rate Select (AKA RS1)
  57. output gpio signal (SFP+ only), low - low Tx rate, high - high Tx rate. Must
  58. not be present for SFF modules
  59. allOf:
  60. - if:
  61. properties:
  62. compatible:
  63. contains:
  64. const: sff,sff
  65. then:
  66. properties:
  67. mod-def0-gpios: false
  68. rate-select0-gpios: false
  69. rate-select1-gpios: false
  70. required:
  71. - compatible
  72. - i2c-bus
  73. additionalProperties: false
  74. examples:
  75. - | # Direct serdes to SFP connection
  76. #include <dt-bindings/gpio/gpio.h>
  77. sfp1: sfp {
  78. compatible = "sff,sfp";
  79. i2c-bus = <&sfp_1g_i2c>;
  80. los-gpios = <&cpm_gpio2 22 GPIO_ACTIVE_HIGH>;
  81. mod-def0-gpios = <&cpm_gpio2 21 GPIO_ACTIVE_LOW>;
  82. maximum-power-milliwatt = <1000>;
  83. pinctrl-names = "default";
  84. pinctrl-0 = <&cpm_sfp_1g_pins &cps_sfp_1g_pins>;
  85. tx-disable-gpios = <&cps_gpio1 24 GPIO_ACTIVE_HIGH>;
  86. tx-fault-gpios = <&cpm_gpio2 19 GPIO_ACTIVE_HIGH>;
  87. };
  88. ethernet {
  89. phy-names = "comphy";
  90. phys = <&cps_comphy5 0>;
  91. sfp = <&sfp1>;
  92. };
  93. - | # Serdes to PHY to SFP connection
  94. #include <dt-bindings/gpio/gpio.h>
  95. #include <dt-bindings/interrupt-controller/arm-gic.h>
  96. sfp2: sfp {
  97. compatible = "sff,sfp";
  98. i2c-bus = <&sfp_i2c>;
  99. los-gpios = <&cps_gpio1 28 GPIO_ACTIVE_HIGH>;
  100. mod-def0-gpios = <&cps_gpio1 27 GPIO_ACTIVE_LOW>;
  101. pinctrl-names = "default";
  102. pinctrl-0 = <&cps_sfpp0_pins>;
  103. tx-disable-gpios = <&cps_gpio1 29 GPIO_ACTIVE_HIGH>;
  104. tx-fault-gpios = <&cps_gpio1 26 GPIO_ACTIVE_HIGH>;
  105. };
  106. mdio {
  107. #address-cells = <1>;
  108. #size-cells = <0>;
  109. phy: ethernet-phy@0 {
  110. compatible = "ethernet-phy-ieee802.3-c45";
  111. pinctrl-names = "default";
  112. pinctrl-0 = <&cpm_phy0_pins &cps_phy0_pins>;
  113. reg = <0>;
  114. interrupts = <18 IRQ_TYPE_EDGE_FALLING>;
  115. sfp = <&sfp2>;
  116. };
  117. };
  118. ethernet {
  119. phy = <&phy>;
  120. phy-mode = "10gbase-kr";
  121. };