b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame^] | 1 | From add2d65962977caf23ca2fa21a2457d31b636574 Mon Sep 17 00:00:00 2001 |
| 2 | From: =?UTF-8?q?Marek=20Beh=C3=BAn?= <kabel@kernel.org> |
| 3 | Date: Mon, 16 Nov 2020 13:24:22 +0100 |
| 4 | Subject: ARM: dts: turris-omnia: add SFP node |
| 5 | MIME-Version: 1.0 |
| 6 | Content-Type: text/plain; charset=UTF-8 |
| 7 | Content-Transfer-Encoding: 8bit |
| 8 | |
| 9 | Turris Omnia has an SFP cage that, together with WAN PHY, is connected |
| 10 | to eth2 SerDes via a SerDes multiplexor. When a SFP module is present, |
| 11 | the multiplexor switches the SerDes signal from PHY to SFP. |
| 12 | |
| 13 | Describe the SFP cage, but leave it disabled. Until phylink has support |
| 14 | for such configuration, we are leaving it to U-Boot to enable SFP and |
| 15 | disable WAN PHY at boot time depending on whether a SFP module is |
| 16 | present. |
| 17 | |
| 18 | Signed-off-by: Marek Behún <kabel@kernel.org> |
| 19 | Fixes: 26ca8b52d6e1 ("ARM: dts: add support for Turris Omnia") |
| 20 | Reviewed-by: Andrew Lunn <andrew@lunn.ch> |
| 21 | Cc: Russell King - ARM Linux admin <linux@armlinux.org.uk> |
| 22 | Cc: linux-arm-kernel@lists.infradead.org |
| 23 | Cc: Uwe Kleine-König <uwe@kleine-koenig.org> |
| 24 | Cc: Jason Cooper <jason@lakedaemon.net> |
| 25 | Cc: Gregory CLEMENT <gregory.clement@bootlin.com> |
| 26 | Cc: Andreas Färber <afaerber@suse.de> |
| 27 | Cc: Rob Herring <robh+dt@kernel.org> |
| 28 | Cc: devicetree@vger.kernel.org |
| 29 | Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com> |
| 30 | --- |
| 31 | arch/arm/boot/dts/armada-385-turris-omnia.dts | 30 ++++++++++++++++++++++++++- |
| 32 | 1 file changed, 29 insertions(+), 1 deletion(-) |
| 33 | |
| 34 | --- a/arch/arm/boot/dts/armada-385-turris-omnia.dts |
| 35 | +++ b/arch/arm/boot/dts/armada-385-turris-omnia.dts |
| 36 | @@ -88,6 +88,24 @@ |
| 37 | }; |
| 38 | }; |
| 39 | }; |
| 40 | + |
| 41 | + sfp: sfp { |
| 42 | + compatible = "sff,sfp"; |
| 43 | + i2c-bus = <&sfp_i2c>; |
| 44 | + tx-fault-gpios = <&pcawan 0 GPIO_ACTIVE_HIGH>; |
| 45 | + tx-disable-gpios = <&pcawan 1 GPIO_ACTIVE_HIGH>; |
| 46 | + rate-select0-gpios = <&pcawan 2 GPIO_ACTIVE_HIGH>; |
| 47 | + los-gpios = <&pcawan 3 GPIO_ACTIVE_HIGH>; |
| 48 | + mod-def0-gpios = <&pcawan 4 GPIO_ACTIVE_LOW>; |
| 49 | + maximum-power-milliwatt = <3000>; |
| 50 | + |
| 51 | + /* |
| 52 | + * For now this has to be enabled at boot time by U-Boot when |
| 53 | + * a SFP module is present. Read more in the comment in the |
| 54 | + * eth2 node below. |
| 55 | + */ |
| 56 | + status = "disabled"; |
| 57 | + }; |
| 58 | }; |
| 59 | |
| 60 | &bm { |
| 61 | @@ -132,10 +150,20 @@ |
| 62 | |
| 63 | /* WAN port */ |
| 64 | ð2 { |
| 65 | + /* |
| 66 | + * eth2 is connected via a multiplexor to both the SFP cage and to |
| 67 | + * ethernet-phy@1. The multiplexor switches the signal to SFP cage when |
| 68 | + * a SFP module is present, as determined by the mode-def0 GPIO. |
| 69 | + * |
| 70 | + * Until kernel supports this configuration properly, in case SFP module |
| 71 | + * is present, U-Boot has to enable the sfp node above, remove phy |
| 72 | + * handle and add managed = "in-band-status" property. |
| 73 | + */ |
| 74 | status = "okay"; |
| 75 | phy-mode = "sgmii"; |
| 76 | phy = <&phy1>; |
| 77 | phys = <&comphy5 2>; |
| 78 | + sfp = <&sfp>; |
| 79 | buffer-manager = <&bm>; |
| 80 | bm,pool-long = <2>; |
| 81 | bm,pool-short = <3>; |
| 82 | @@ -201,7 +229,7 @@ |
| 83 | /* routed to PCIe2 connector (CN62A) */ |
| 84 | }; |
| 85 | |
| 86 | - i2c@4 { |
| 87 | + sfp_i2c: i2c@4 { |
| 88 | #address-cells = <1>; |
| 89 | #size-cells = <0>; |
| 90 | reg = <4>; |