xref: /linux/Documentation/devicetree/bindings/net/sff,sfp.yaml (revision 7ff7c9922859838afa8cff55d6046f698016f19a)
170991f1eSIoana Ciornei# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
270991f1eSIoana Ciornei%YAML 1.2
370991f1eSIoana Ciornei---
470991f1eSIoana Ciornei$id: "http://devicetree.org/schemas/net/sff,sfp.yaml#"
570991f1eSIoana Ciornei$schema: "http://devicetree.org/meta-schemas/core.yaml#"
670991f1eSIoana Ciornei
770991f1eSIoana Ciorneititle: Small Form Factor (SFF) Committee Small Form-factor Pluggable (SFP)
870991f1eSIoana Ciornei  Transceiver
970991f1eSIoana Ciornei
1070991f1eSIoana Ciorneimaintainers:
1170991f1eSIoana Ciornei  - Russell King <linux@armlinux.org.uk>
1270991f1eSIoana Ciornei
1370991f1eSIoana Ciorneiproperties:
1470991f1eSIoana Ciornei  compatible:
1570991f1eSIoana Ciornei    enum:
1670991f1eSIoana Ciornei      - sff,sfp  # for SFP modules
1770991f1eSIoana Ciornei      - sff,sff  # for soldered down SFF modules
1870991f1eSIoana Ciornei
1970991f1eSIoana Ciornei  i2c-bus:
2070991f1eSIoana Ciornei    $ref: /schemas/types.yaml#/definitions/phandle
2170991f1eSIoana Ciornei    description:
2270991f1eSIoana Ciornei      phandle of an I2C bus controller for the SFP two wire serial
2370991f1eSIoana Ciornei
2470991f1eSIoana Ciornei  maximum-power-milliwatt:
2570991f1eSIoana Ciornei    maxItems: 1
2670991f1eSIoana Ciornei    description:
2770991f1eSIoana Ciornei      Maximum module power consumption Specifies the maximum power consumption
2870991f1eSIoana Ciornei      allowable by a module in the slot, in milli-Watts. Presently, modules can
2970991f1eSIoana Ciornei      be up to 1W, 1.5W or 2W.
3070991f1eSIoana Ciornei
3170991f1eSIoana Ciornei  "mod-def0-gpios":
3270991f1eSIoana Ciornei    maxItems: 1
3370991f1eSIoana Ciornei    description:
3470991f1eSIoana Ciornei      GPIO phandle and a specifier of the MOD-DEF0 (AKA Mod_ABS) module
3570991f1eSIoana Ciornei      presence input gpio signal, active (module absent) high. Must not be
3670991f1eSIoana Ciornei      present for SFF modules
3770991f1eSIoana Ciornei
3870991f1eSIoana Ciornei  "los-gpios":
3970991f1eSIoana Ciornei    maxItems: 1
4070991f1eSIoana Ciornei    description:
4170991f1eSIoana Ciornei      GPIO phandle and a specifier of the Receiver Loss of Signal Indication
4270991f1eSIoana Ciornei      input gpio signal, active (signal lost) high
4370991f1eSIoana Ciornei
4470991f1eSIoana Ciornei  "tx-fault-gpios":
4570991f1eSIoana Ciornei    maxItems: 1
4670991f1eSIoana Ciornei    description:
4770991f1eSIoana Ciornei      GPIO phandle and a specifier of the Module Transmitter Fault input gpio
4870991f1eSIoana Ciornei      signal, active (fault condition) high
4970991f1eSIoana Ciornei
5070991f1eSIoana Ciornei  "tx-disable-gpios":
5170991f1eSIoana Ciornei    maxItems: 1
5270991f1eSIoana Ciornei    description:
5370991f1eSIoana Ciornei      GPIO phandle and a specifier of the Transmitter Disable output gpio
5470991f1eSIoana Ciornei      signal, active (Tx disable) high
5570991f1eSIoana Ciornei
5670991f1eSIoana Ciornei  "rate-select0-gpios":
5770991f1eSIoana Ciornei    maxItems: 1
5870991f1eSIoana Ciornei    description:
5970991f1eSIoana Ciornei      GPIO phandle and a specifier of the Rx Signaling Rate Select (AKA RS0)
6070991f1eSIoana Ciornei      output gpio signal, low - low Rx rate, high - high Rx rate Must not be
6170991f1eSIoana Ciornei      present for SFF modules
6270991f1eSIoana Ciornei
6370991f1eSIoana Ciornei  "rate-select1-gpios":
6470991f1eSIoana Ciornei    maxItems: 1
6570991f1eSIoana Ciornei    description:
6670991f1eSIoana Ciornei      GPIO phandle and a specifier of the Tx Signaling Rate Select (AKA RS1)
6770991f1eSIoana Ciornei      output gpio signal (SFP+ only), low - low Tx rate, high - high Tx rate. Must
6870991f1eSIoana Ciornei      not be present for SFF modules
6970991f1eSIoana Ciornei
7070991f1eSIoana CiorneiallOf:
7170991f1eSIoana Ciornei  - if:
7270991f1eSIoana Ciornei      properties:
7370991f1eSIoana Ciornei        compatible:
7470991f1eSIoana Ciornei          contains:
7570991f1eSIoana Ciornei            const: sff,sff
7670991f1eSIoana Ciornei    then:
7770991f1eSIoana Ciornei      properties:
7870991f1eSIoana Ciornei        mod-def0-gpios: false
7970991f1eSIoana Ciornei        rate-select0-gpios: false
8070991f1eSIoana Ciornei        rate-select1-gpios: false
8170991f1eSIoana Ciornei
8270991f1eSIoana Ciorneirequired:
8370991f1eSIoana Ciornei  - compatible
8470991f1eSIoana Ciornei  - i2c-bus
8570991f1eSIoana Ciornei
8670991f1eSIoana CiorneiadditionalProperties: false
8770991f1eSIoana Ciornei
8870991f1eSIoana Ciorneiexamples:
8970991f1eSIoana Ciornei  - | # Direct serdes to SFP connection
9070991f1eSIoana Ciornei    #include <dt-bindings/gpio/gpio.h>
9170991f1eSIoana Ciornei
92*7ff7c992SIoana Ciornei    sfp1: sfp {
9370991f1eSIoana Ciornei      compatible = "sff,sfp";
9470991f1eSIoana Ciornei      i2c-bus = <&sfp_1g_i2c>;
9570991f1eSIoana Ciornei      los-gpios = <&cpm_gpio2 22 GPIO_ACTIVE_HIGH>;
9670991f1eSIoana Ciornei      mod-def0-gpios = <&cpm_gpio2 21 GPIO_ACTIVE_LOW>;
9770991f1eSIoana Ciornei      maximum-power-milliwatt = <1000>;
9870991f1eSIoana Ciornei      pinctrl-names = "default";
9970991f1eSIoana Ciornei      pinctrl-0 = <&cpm_sfp_1g_pins &cps_sfp_1g_pins>;
10070991f1eSIoana Ciornei      tx-disable-gpios = <&cps_gpio1 24 GPIO_ACTIVE_HIGH>;
10170991f1eSIoana Ciornei      tx-fault-gpios = <&cpm_gpio2 19 GPIO_ACTIVE_HIGH>;
10270991f1eSIoana Ciornei    };
10370991f1eSIoana Ciornei
104*7ff7c992SIoana Ciornei    ethernet {
10570991f1eSIoana Ciornei      phy-names = "comphy";
10670991f1eSIoana Ciornei      phys = <&cps_comphy5 0>;
107*7ff7c992SIoana Ciornei      sfp = <&sfp1>;
10870991f1eSIoana Ciornei    };
10970991f1eSIoana Ciornei
11070991f1eSIoana Ciornei  - | # Serdes to PHY to SFP connection
11170991f1eSIoana Ciornei    #include <dt-bindings/gpio/gpio.h>
11270991f1eSIoana Ciornei    #include <dt-bindings/interrupt-controller/arm-gic.h>
11370991f1eSIoana Ciornei
114*7ff7c992SIoana Ciornei    sfp2: sfp {
11570991f1eSIoana Ciornei      compatible = "sff,sfp";
116*7ff7c992SIoana Ciornei      i2c-bus = <&sfp_i2c>;
11770991f1eSIoana Ciornei      los-gpios = <&cps_gpio1 28 GPIO_ACTIVE_HIGH>;
11870991f1eSIoana Ciornei      mod-def0-gpios = <&cps_gpio1 27 GPIO_ACTIVE_LOW>;
11970991f1eSIoana Ciornei      pinctrl-names = "default";
12070991f1eSIoana Ciornei      pinctrl-0 = <&cps_sfpp0_pins>;
12170991f1eSIoana Ciornei      tx-disable-gpios = <&cps_gpio1 29 GPIO_ACTIVE_HIGH>;
12270991f1eSIoana Ciornei      tx-fault-gpios  = <&cps_gpio1 26 GPIO_ACTIVE_HIGH>;
12370991f1eSIoana Ciornei    };
12470991f1eSIoana Ciornei
12570991f1eSIoana Ciornei    mdio {
12670991f1eSIoana Ciornei      #address-cells = <1>;
12770991f1eSIoana Ciornei      #size-cells = <0>;
12870991f1eSIoana Ciornei
129*7ff7c992SIoana Ciornei      phy: ethernet-phy@0 {
13070991f1eSIoana Ciornei        compatible = "ethernet-phy-ieee802.3-c45";
13170991f1eSIoana Ciornei        pinctrl-names = "default";
13270991f1eSIoana Ciornei        pinctrl-0 = <&cpm_phy0_pins &cps_phy0_pins>;
13370991f1eSIoana Ciornei        reg = <0>;
13470991f1eSIoana Ciornei        interrupt = <&cpm_gpio2 18 IRQ_TYPE_EDGE_FALLING>;
135*7ff7c992SIoana Ciornei        sfp = <&sfp2>;
13670991f1eSIoana Ciornei      };
13770991f1eSIoana Ciornei    };
13870991f1eSIoana Ciornei
139*7ff7c992SIoana Ciornei    ethernet {
140*7ff7c992SIoana Ciornei      phy = <&phy>;
14170991f1eSIoana Ciornei      phy-mode = "10gbase-kr";
14270991f1eSIoana Ciornei    };
143