005-v5.11-ARM-dts-turris-omnia-add-SFP-node.patch 2.9 KB

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