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