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