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