devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH mvebu-dt v3 0/7] Turris Omnia device-tree changes
@ 2020-11-15 13:59 Marek Behún
  2020-11-15 13:59 ` [PATCH mvebu-dt v3 1/7] ARM: dts: turris-omnia: enable HW buffer management Marek Behún
                   ` (7 more replies)
  0 siblings, 8 replies; 13+ messages in thread
From: Marek Behún @ 2020-11-15 13:59 UTC (permalink / raw)
  To: Gregory CLEMENT
  Cc: arm, Marek Behún, linux-arm-kernel, Uwe Kleine-König,
	Jason Cooper, Andreas Färber, Andrew Lunn, Rob Herring,
	devicetree

Hi Gregory,

v3 of series with changes for Turris Omnia device tree.

Changes since v2 (mostly thanks to Andreas):
- fixed typo in 2/7
- updated comment in 4/7 (describing current SFP cage binding status)
- changed commit message in 4/7 a little bit
- changed LED_FUNCTION_DEBUG to LED_FUNCTION_INDICATOR in 5/7
- updated comment about LED controller in 5/7
- added 7/7 which removes 2 unneeded status = "okay"

Changes since v1:
- added patch which adds description for switch interrupt
- removed patch adding ethernet-phy interrupt: the PHY interrupt is
  asserted by level low, but the GPIO expander driver supports only
  edge rising/falling, and even then it may not be correct when an
  interrupt storm occurs. So keep polling the PHY
- added Andrew's Reviewed-by tags

Cc: linux-arm-kernel@lists.infradead.org
Cc: Uwe Kleine-König <uwe@kleine-koenig.org>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Gregory CLEMENT <gregory.clement@bootlin.com>
Cc: Andreas Färber <afaerber@suse.de>
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: devicetree@vger.kernel.org

Marek Behún (7):
  ARM: dts: turris-omnia: enable HW buffer management
  ARM: dts: turris-omnia: add comphy handle to eth2
  ARM: dts: turris-omnia: describe switch interrupt
  ARM: dts: turris-omnia: add SFP node
  ARM: dts: turris-omnia: add LED controller node
  ARM: dts: turris-omnia: update ethernet-phy node and handle name
  ARM: dts: turris-omnia: remove unneeded status = "okay" properties

 arch/arm/boot/dts/armada-385-turris-omnia.dts | 178 +++++++++++++++++-
 1 file changed, 170 insertions(+), 8 deletions(-)

-- 
2.26.2


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH mvebu-dt v3 1/7] ARM: dts: turris-omnia: enable HW buffer management
  2020-11-15 13:59 [PATCH mvebu-dt v3 0/7] Turris Omnia device-tree changes Marek Behún
@ 2020-11-15 13:59 ` Marek Behún
  2020-11-15 13:59 ` [PATCH mvebu-dt v3 2/7] ARM: dts: turris-omnia: add comphy handle to eth2 Marek Behún
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 13+ messages in thread
From: Marek Behún @ 2020-11-15 13:59 UTC (permalink / raw)
  To: Gregory CLEMENT
  Cc: arm, Marek Behún, linux-arm-kernel, Uwe Kleine-König,
	Jason Cooper, Andreas Färber, Andrew Lunn, Rob Herring,
	devicetree

The buffer manager is available on Turris Omnia but needs to be
described in device-tree to be used.

Signed-off-by: Marek Behún <kabel@kernel.org>
Fixes: 26ca8b52d6e1 ("ARM: dts: add support for Turris Omnia")
Cc: linux-arm-kernel@lists.infradead.org
Cc: Uwe Kleine-König <uwe@kleine-koenig.org>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Gregory CLEMENT <gregory.clement@bootlin.com>
Cc: Andreas Färber <afaerber@suse.de>
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: devicetree@vger.kernel.org
---
 arch/arm/boot/dts/armada-385-turris-omnia.dts | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/arch/arm/boot/dts/armada-385-turris-omnia.dts b/arch/arm/boot/dts/armada-385-turris-omnia.dts
index 768b6c5d2129..b6bd73d8f2ba 100644
--- a/arch/arm/boot/dts/armada-385-turris-omnia.dts
+++ b/arch/arm/boot/dts/armada-385-turris-omnia.dts
@@ -84,12 +84,23 @@ pcie@3,0 {
 	};
 };
 
+&bm {
+	status = "okay";
+};
+
+&bm_bppi {
+	status = "okay";
+};
+
 /* Connected to 88E6176 switch, port 6 */
 &eth0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&ge0_rgmii_pins>;
 	status = "okay";
 	phy-mode = "rgmii";
+	buffer-manager = <&bm>;
+	bm,pool-long = <0>;
+	bm,pool-short = <3>;
 
 	fixed-link {
 		speed = <1000>;
@@ -103,6 +114,9 @@ &eth1 {
 	pinctrl-0 = <&ge1_rgmii_pins>;
 	status = "okay";
 	phy-mode = "rgmii";
+	buffer-manager = <&bm>;
+	bm,pool-long = <1>;
+	bm,pool-short = <3>;
 
 	fixed-link {
 		speed = <1000>;
@@ -115,6 +129,9 @@ &eth2 {
 	status = "okay";
 	phy-mode = "sgmii";
 	phy = <&phy1>;
+	buffer-manager = <&bm>;
+	bm,pool-long = <2>;
+	bm,pool-short = <3>;
 };
 
 &i2c0 {
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH mvebu-dt v3 2/7] ARM: dts: turris-omnia: add comphy handle to eth2
  2020-11-15 13:59 [PATCH mvebu-dt v3 0/7] Turris Omnia device-tree changes Marek Behún
  2020-11-15 13:59 ` [PATCH mvebu-dt v3 1/7] ARM: dts: turris-omnia: enable HW buffer management Marek Behún
@ 2020-11-15 13:59 ` Marek Behún
  2020-11-15 13:59 ` [PATCH mvebu-dt v3 3/7] ARM: dts: turris-omnia: describe switch interrupt Marek Behún
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 13+ messages in thread
From: Marek Behún @ 2020-11-15 13:59 UTC (permalink / raw)
  To: Gregory CLEMENT
  Cc: arm, Marek Behún, Andrew Lunn, Andreas Färber,
	linux-arm-kernel, Uwe Kleine-König, Jason Cooper,
	Rob Herring, devicetree

The eth2 controller on Turris Omnia is connected to SerDes. For SFP to
be able to switch between 1G and 2.5G modes the comphy link has to be
defined.

Signed-off-by: Marek Behún <kabel@kernel.org>
Fixes: f3a6a9f3704a ("ARM: dts: add description for Armada 38x ...")
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Cc: linux-arm-kernel@lists.infradead.org
Cc: Uwe Kleine-König <uwe@kleine-koenig.org>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Gregory CLEMENT <gregory.clement@bootlin.com>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: devicetree@vger.kernel.org
---
 arch/arm/boot/dts/armada-385-turris-omnia.dts | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/boot/dts/armada-385-turris-omnia.dts b/arch/arm/boot/dts/armada-385-turris-omnia.dts
index b6bd73d8f2ba..9de26c78ec4c 100644
--- a/arch/arm/boot/dts/armada-385-turris-omnia.dts
+++ b/arch/arm/boot/dts/armada-385-turris-omnia.dts
@@ -129,6 +129,7 @@ &eth2 {
 	status = "okay";
 	phy-mode = "sgmii";
 	phy = <&phy1>;
+	phys = <&comphy5 2>;
 	buffer-manager = <&bm>;
 	bm,pool-long = <2>;
 	bm,pool-short = <3>;
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH mvebu-dt v3 3/7] ARM: dts: turris-omnia: describe switch interrupt
  2020-11-15 13:59 [PATCH mvebu-dt v3 0/7] Turris Omnia device-tree changes Marek Behún
  2020-11-15 13:59 ` [PATCH mvebu-dt v3 1/7] ARM: dts: turris-omnia: enable HW buffer management Marek Behún
  2020-11-15 13:59 ` [PATCH mvebu-dt v3 2/7] ARM: dts: turris-omnia: add comphy handle to eth2 Marek Behún
@ 2020-11-15 13:59 ` Marek Behún
  2020-11-15 13:59 ` [PATCH mvebu-dt v3 4/7] ARM: dts: turris-omnia: add SFP node Marek Behún
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 13+ messages in thread
From: Marek Behún @ 2020-11-15 13:59 UTC (permalink / raw)
  To: Gregory CLEMENT
  Cc: arm, Marek Behún, linux-arm-kernel, Uwe Kleine-König,
	Jason Cooper, Andreas Färber, Andrew Lunn, Rob Herring,
	devicetree

Describe switch interrupt for Turris Omnia so that the CPU does not have
to poll the switch. We also need to to set mpp45 pin to gpio function
for this.

Signed-off-by: Marek Behún <kabel@kernel.org>
Fixes: 26ca8b52d6e1 ("ARM: dts: add support for Turris Omnia")
Cc: linux-arm-kernel@lists.infradead.org
Cc: Uwe Kleine-König <uwe@kleine-koenig.org>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Gregory CLEMENT <gregory.clement@bootlin.com>
Cc: Andreas Färber <afaerber@suse.de>
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: devicetree@vger.kernel.org
---
 arch/arm/boot/dts/armada-385-turris-omnia.dts | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/armada-385-turris-omnia.dts b/arch/arm/boot/dts/armada-385-turris-omnia.dts
index 9de26c78ec4c..7ccebf7d1757 100644
--- a/arch/arm/boot/dts/armada-385-turris-omnia.dts
+++ b/arch/arm/boot/dts/armada-385-turris-omnia.dts
@@ -260,13 +260,18 @@ phy1: phy@1 {
 
 	/* Switch MV88E6176 at address 0x10 */
 	switch@10 {
+		pinctrl-names = "default";
+		pinctrl-0 = <&swint_pins>;
 		compatible = "marvell,mv88e6085";
 		#address-cells = <1>;
 		#size-cells = <0>;
-		dsa,member = <0 0>;
 
+		dsa,member = <0 0>;
 		reg = <0x10>;
 
+		interrupt-parent = <&gpio1>;
+		interrupts = <13 IRQ_TYPE_LEVEL_LOW>;
+
 		ports {
 			#address-cells = <1>;
 			#size-cells = <0>;
@@ -319,6 +324,11 @@ pcawan_pins: pcawan-pins {
 		marvell,function = "gpio";
 	};
 
+	swint_pins: swint-pins {
+		marvell,pins = "mpp45";
+		marvell,function = "gpio";
+	};
+
 	spi0cs0_pins: spi0cs0-pins {
 		marvell,pins = "mpp25";
 		marvell,function = "spi0";
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH mvebu-dt v3 4/7] ARM: dts: turris-omnia: add SFP node
  2020-11-15 13:59 [PATCH mvebu-dt v3 0/7] Turris Omnia device-tree changes Marek Behún
                   ` (2 preceding siblings ...)
  2020-11-15 13:59 ` [PATCH mvebu-dt v3 3/7] ARM: dts: turris-omnia: describe switch interrupt Marek Behún
@ 2020-11-15 13:59 ` Marek Behún
  2020-11-16 12:24   ` [PATCH mvebu-dt v3.1 " Marek Behún
  2020-11-15 13:59 ` [PATCH mvebu-dt v3 5/7] ARM: dts: turris-omnia: add LED controller node Marek Behún
                   ` (3 subsequent siblings)
  7 siblings, 1 reply; 13+ messages in thread
From: Marek Behún @ 2020-11-15 13:59 UTC (permalink / raw)
  To: Gregory CLEMENT
  Cc: arm, Marek Behún, Andrew Lunn,
	Russell King - ARM Linux admin, linux-arm-kernel,
	Uwe Kleine-König, Jason Cooper, Andreas Färber,
	Rob Herring, devicetree

Turris Omnia has an SFP cage that, together with WAN PHY, is connected
to eth2 SerDes via a SerDes multiplexor. When a SFP module is present,
the multiplexor switches the SerDes signal from PHY to SFP.

Describe the SFP cage, but leave it disabled. Until phylink has support
for such configuration, we are leaving it to U-Boot to enable SFP and
disable WAN PHY at boot time depending on whether a SFP module is
present.

Signed-off-by: Marek Behún <kabel@kernel.org>
Fixes: 26ca8b52d6e1 ("ARM: dts: add support for Turris Omnia")
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Cc: Russell King - ARM Linux admin <linux@armlinux.org.uk>
Cc: linux-arm-kernel@lists.infradead.org
Cc: Uwe Kleine-König <uwe@kleine-koenig.org>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Gregory CLEMENT <gregory.clement@bootlin.com>
Cc: Andreas Färber <afaerber@suse.de>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: devicetree@vger.kernel.org
---
 arch/arm/boot/dts/armada-385-turris-omnia.dts | 29 ++++++++++++++++++-
 1 file changed, 28 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/armada-385-turris-omnia.dts b/arch/arm/boot/dts/armada-385-turris-omnia.dts
index 7ccebf7d1757..f7498543c9ad 100644
--- a/arch/arm/boot/dts/armada-385-turris-omnia.dts
+++ b/arch/arm/boot/dts/armada-385-turris-omnia.dts
@@ -82,6 +82,23 @@ pcie@3,0 {
 			};
 		};
 	};
+
+	sfp: sfp {
+		compatible = "sff,sfp";
+		i2c-bus = <&sfp_i2c>;
+		tx-fault-gpios = <&pcawan 0 GPIO_ACTIVE_HIGH>;
+		tx-disable-gpios = <&pcawan 1 GPIO_ACTIVE_HIGH>;
+		rate-select0-gpios = <&pcawan 2 GPIO_ACTIVE_HIGH>;
+		los-gpios = <&pcawan 3 GPIO_ACTIVE_HIGH>;
+		mod-def0-gpios = <&pcawan 4 GPIO_ACTIVE_LOW>;
+
+		/*
+		 * For now this has to be enabled at boot time by U-Boot when
+		 * a SFP module is present. Read more in the comment in the
+		 * eth2 node below.
+		 */
+		status = "disabled";
+	};
 };
 
 &bm {
@@ -126,10 +143,20 @@ fixed-link {
 
 /* WAN port */
 &eth2 {
+	/*
+	 * eth2 is connected via a multiplexor to both the SFP cage and to
+	 * ethernet-phy@1. The multiplexor switches the signal to SFP cage when
+	 * a SFP module is present, as determined by the mode-def0 GPIO.
+	 *
+	 * Until kernel supports this configuration properly, in case SFP module
+	 * is present, U-Boot has to enable the sfp node above, remove phy
+	 * handle and add managed = "in-band-status" property.
+	 */
 	status = "okay";
 	phy-mode = "sgmii";
 	phy = <&phy1>;
 	phys = <&comphy5 2>;
+	sfp = <&sfp>;
 	buffer-manager = <&bm>;
 	bm,pool-long = <2>;
 	bm,pool-short = <3>;
@@ -195,7 +222,7 @@ i2c@3 {
 			/* routed to PCIe2 connector (CN62A) */
 		};
 
-		i2c@4 {
+		sfp_i2c: i2c@4 {
 			#address-cells = <1>;
 			#size-cells = <0>;
 			reg = <4>;
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH mvebu-dt v3 5/7] ARM: dts: turris-omnia: add LED controller node
  2020-11-15 13:59 [PATCH mvebu-dt v3 0/7] Turris Omnia device-tree changes Marek Behún
                   ` (3 preceding siblings ...)
  2020-11-15 13:59 ` [PATCH mvebu-dt v3 4/7] ARM: dts: turris-omnia: add SFP node Marek Behún
@ 2020-11-15 13:59 ` Marek Behún
  2020-11-15 13:59 ` [PATCH mvebu-dt v3 6/7] ARM: dts: turris-omnia: update ethernet-phy node and handle name Marek Behún
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 13+ messages in thread
From: Marek Behún @ 2020-11-15 13:59 UTC (permalink / raw)
  To: Gregory CLEMENT
  Cc: arm, Marek Behún, linux-arm-kernel, Uwe Kleine-König,
	Jason Cooper, Andreas Färber, Rob Herring, devicetree

Linux now has incomplete support for the LED controller on Turris Omnia:
it can set brightness and colors for each LED.

The controller can also put these LEDs into HW controlled mode, in which
the LEDs are controlled by HW: for example the WAN LED is connected via
MCU to the WAN PHY LED pin.

The driver does not support these HW controlled modes yet, and on probe
puts the LEDs into SW controlled mode.

Add node describing the LED controller, but disable it for now.

Signed-off-by: Marek Behún <kabel@kernel.org>
Cc: linux-arm-kernel@lists.infradead.org
Cc: Uwe Kleine-König <uwe@kleine-koenig.org>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Gregory CLEMENT <gregory.clement@bootlin.com>
Cc: Andreas Färber <afaerber@suse.de>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: devicetree@vger.kernel.org
---
 arch/arm/boot/dts/armada-385-turris-omnia.dts | 111 +++++++++++++++++-
 1 file changed, 110 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/armada-385-turris-omnia.dts b/arch/arm/boot/dts/armada-385-turris-omnia.dts
index f7498543c9ad..c442c5151cd4 100644
--- a/arch/arm/boot/dts/armada-385-turris-omnia.dts
+++ b/arch/arm/boot/dts/armada-385-turris-omnia.dts
@@ -12,6 +12,7 @@
 
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
 #include "armada-385.dtsi"
 
 / {
@@ -180,7 +181,115 @@ i2c@0 {
 			reg = <0>;
 
 			/* STM32F0 command interface at address 0x2a */
-			/* leds device (in STM32F0) at address 0x2b */
+
+			led-controller@2b {
+				compatible = "cznic,turris-omnia-leds";
+				reg = <0x2b>;
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				/*
+				 * LEDs are controlled by MCU (STM32F0) at
+				 * address 0x2b.
+				 *
+				 * The driver does not support HW control mode
+				 * for the LEDs yet. Disable the LEDs for now.
+				 *
+				 * Also LED functions are not stable yet:
+				 * - there are 3 LEDs connected via MCU to PCIe
+				 *   ports. One of these ports supports mSATA.
+				 *   There is no mSATA nor PCIe function.
+				 *   For now we use LED_FUNCTION_WLAN, since
+				 *   in most cases users have wifi cards in
+				 *   these slots
+				 * - there are 2 LEDs dedicated for user: A and
+				 *   B. Again there is no such function defined.
+				 *   For now we use LED_FUNCTION_INDICATOR
+				 */
+				status = "disabled";
+
+				multi-led@0 {
+					reg = <0x0>;
+					color = <LED_COLOR_ID_RGB>;
+					function = LED_FUNCTION_INDICATOR;
+					function-enumerator = <2>;
+				};
+
+				multi-led@1 {
+					reg = <0x1>;
+					color = <LED_COLOR_ID_RGB>;
+					function = LED_FUNCTION_INDICATOR;
+					function-enumerator = <1>;
+				};
+
+				multi-led@2 {
+					reg = <0x2>;
+					color = <LED_COLOR_ID_RGB>;
+					function = LED_FUNCTION_WLAN;
+					function-enumerator = <3>;
+				};
+
+				multi-led@3 {
+					reg = <0x3>;
+					color = <LED_COLOR_ID_RGB>;
+					function = LED_FUNCTION_WLAN;
+					function-enumerator = <2>;
+				};
+
+				multi-led@4 {
+					reg = <0x4>;
+					color = <LED_COLOR_ID_RGB>;
+					function = LED_FUNCTION_WLAN;
+					function-enumerator = <1>;
+				};
+
+				multi-led@5 {
+					reg = <0x5>;
+					color = <LED_COLOR_ID_RGB>;
+					function = LED_FUNCTION_WAN;
+				};
+
+				multi-led@6 {
+					reg = <0x6>;
+					color = <LED_COLOR_ID_RGB>;
+					function = LED_FUNCTION_LAN;
+					function-enumerator = <4>;
+				};
+
+				multi-led@7 {
+					reg = <0x7>;
+					color = <LED_COLOR_ID_RGB>;
+					function = LED_FUNCTION_LAN;
+					function-enumerator = <3>;
+				};
+
+				multi-led@8 {
+					reg = <0x8>;
+					color = <LED_COLOR_ID_RGB>;
+					function = LED_FUNCTION_LAN;
+					function-enumerator = <2>;
+				};
+
+				multi-led@9 {
+					reg = <0x9>;
+					color = <LED_COLOR_ID_RGB>;
+					function = LED_FUNCTION_LAN;
+					function-enumerator = <1>;
+				};
+
+				multi-led@a {
+					reg = <0xa>;
+					color = <LED_COLOR_ID_RGB>;
+					function = LED_FUNCTION_LAN;
+					function-enumerator = <0>;
+				};
+
+				multi-led@b {
+					reg = <0xb>;
+					color = <LED_COLOR_ID_RGB>;
+					function = LED_FUNCTION_POWER;
+				};
+			};
 
 			eeprom@54 {
 				compatible = "atmel,24c64";
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH mvebu-dt v3 6/7] ARM: dts: turris-omnia: update ethernet-phy node and handle name
  2020-11-15 13:59 [PATCH mvebu-dt v3 0/7] Turris Omnia device-tree changes Marek Behún
                   ` (4 preceding siblings ...)
  2020-11-15 13:59 ` [PATCH mvebu-dt v3 5/7] ARM: dts: turris-omnia: add LED controller node Marek Behún
@ 2020-11-15 13:59 ` Marek Behún
  2020-11-15 13:59 ` [PATCH mvebu-dt v3 7/7] ARM: dts: turris-omnia: remove unneeded status = "okay" properties Marek Behún
  2020-11-30 10:43 ` [PATCH mvebu-dt v3 0/7] Turris Omnia device-tree changes Gregory CLEMENT
  7 siblings, 0 replies; 13+ messages in thread
From: Marek Behún @ 2020-11-15 13:59 UTC (permalink / raw)
  To: Gregory CLEMENT
  Cc: arm, Marek Behún, Andrew Lunn, linux-arm-kernel,
	Uwe Kleine-König, Jason Cooper, Andreas Färber,
	Rob Herring, devicetree

Use property name `phy-handle` instead of the deprecated `phy` to
connect eth2 to the PHY.
Rename the node from "phy@1" to "ethernet-phy@1", since "phy@1" is
incorrect according to device-tree bindings documentation.
Also remove the "ethernet-phy-id0141.0DD1" compatible string, it is not
needed. Kernel can read the PHY identifier itself.

Signed-off-by: Marek Behún <kabel@kernel.org>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Cc: linux-arm-kernel@lists.infradead.org
Cc: Uwe Kleine-König <uwe@kleine-koenig.org>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Gregory CLEMENT <gregory.clement@bootlin.com>
Cc: Andreas Färber <afaerber@suse.de>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: devicetree@vger.kernel.org
---
 arch/arm/boot/dts/armada-385-turris-omnia.dts | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boot/dts/armada-385-turris-omnia.dts b/arch/arm/boot/dts/armada-385-turris-omnia.dts
index c442c5151cd4..0002487b7b68 100644
--- a/arch/arm/boot/dts/armada-385-turris-omnia.dts
+++ b/arch/arm/boot/dts/armada-385-turris-omnia.dts
@@ -155,7 +155,7 @@ &eth2 {
 	 */
 	status = "okay";
 	phy-mode = "sgmii";
-	phy = <&phy1>;
+	phy-handle = <&phy1>;
 	phys = <&comphy5 2>;
 	sfp = <&sfp>;
 	buffer-manager = <&bm>;
@@ -386,9 +386,9 @@ &mdio {
 	pinctrl-0 = <&mdio_pins>;
 	status = "okay";
 
-	phy1: phy@1 {
+	phy1: ethernet-phy@1 {
 		status = "okay";
-		compatible = "ethernet-phy-id0141.0DD1", "ethernet-phy-ieee802.3-c22";
+		compatible = "ethernet-phy-ieee802.3-c22";
 		reg = <1>;
 
 		/* irq is connected to &pcawan pin 7 */
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH mvebu-dt v3 7/7] ARM: dts: turris-omnia: remove unneeded status = "okay" properties
  2020-11-15 13:59 [PATCH mvebu-dt v3 0/7] Turris Omnia device-tree changes Marek Behún
                   ` (5 preceding siblings ...)
  2020-11-15 13:59 ` [PATCH mvebu-dt v3 6/7] ARM: dts: turris-omnia: update ethernet-phy node and handle name Marek Behún
@ 2020-11-15 13:59 ` Marek Behún
  2020-11-30 10:43 ` [PATCH mvebu-dt v3 0/7] Turris Omnia device-tree changes Gregory CLEMENT
  7 siblings, 0 replies; 13+ messages in thread
From: Marek Behún @ 2020-11-15 13:59 UTC (permalink / raw)
  To: Gregory CLEMENT
  Cc: arm, Marek Behún, linux-arm-kernel, Uwe Kleine-König,
	Jason Cooper, Andreas Färber, Andrew Lunn, Rob Herring,
	devicetree

Only nodes which have status = "disabled" defined from included files
need status = "okay".

The ethernet-phy node and the i2cmux node do not need it, since they are
wholly defined here.

Signed-off-by: Marek Behún <kabel@kernel.org>
Cc: linux-arm-kernel@lists.infradead.org
Cc: Uwe Kleine-König <uwe@kleine-koenig.org>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Gregory CLEMENT <gregory.clement@bootlin.com>
Cc: Andreas Färber <afaerber@suse.de>
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: devicetree@vger.kernel.org
---
 arch/arm/boot/dts/armada-385-turris-omnia.dts | 2 --
 1 file changed, 2 deletions(-)

diff --git a/arch/arm/boot/dts/armada-385-turris-omnia.dts b/arch/arm/boot/dts/armada-385-turris-omnia.dts
index 0002487b7b68..78b49287634c 100644
--- a/arch/arm/boot/dts/armada-385-turris-omnia.dts
+++ b/arch/arm/boot/dts/armada-385-turris-omnia.dts
@@ -173,7 +173,6 @@ i2cmux@70 {
 		#address-cells = <1>;
 		#size-cells = <0>;
 		reg = <0x70>;
-		status = "okay";
 
 		i2c@0 {
 			#address-cells = <1>;
@@ -387,7 +386,6 @@ &mdio {
 	status = "okay";
 
 	phy1: ethernet-phy@1 {
-		status = "okay";
 		compatible = "ethernet-phy-ieee802.3-c22";
 		reg = <1>;
 
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH mvebu-dt v3.1 4/7] ARM: dts: turris-omnia: add SFP node
  2020-11-15 13:59 ` [PATCH mvebu-dt v3 4/7] ARM: dts: turris-omnia: add SFP node Marek Behún
@ 2020-11-16 12:24   ` Marek Behún
  2020-11-16 12:28     ` Marek Behún
  2020-11-16 12:34     ` Russell King - ARM Linux admin
  0 siblings, 2 replies; 13+ messages in thread
From: Marek Behún @ 2020-11-16 12:24 UTC (permalink / raw)
  To: Gregory CLEMENT
  Cc: arm, Marek Behún, Andrew Lunn,
	Russell King - ARM Linux admin, linux-arm-kernel,
	Uwe Kleine-König, Jason Cooper, Andreas Färber,
	Rob Herring, devicetree

Turris Omnia has an SFP cage that, together with WAN PHY, is connected
to eth2 SerDes via a SerDes multiplexor. When a SFP module is present,
the multiplexor switches the SerDes signal from PHY to SFP.

Describe the SFP cage, but leave it disabled. Until phylink has support
for such configuration, we are leaving it to U-Boot to enable SFP and
disable WAN PHY at boot time depending on whether a SFP module is
present.

Signed-off-by: Marek Behún <kabel@kernel.org>
Fixes: 26ca8b52d6e1 ("ARM: dts: add support for Turris Omnia")
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Cc: Russell King - ARM Linux admin <linux@armlinux.org.uk>
Cc: linux-arm-kernel@lists.infradead.org
Cc: Uwe Kleine-König <uwe@kleine-koenig.org>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Gregory CLEMENT <gregory.clement@bootlin.com>
Cc: Andreas Färber <afaerber@suse.de>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: devicetree@vger.kernel.org
---
 arch/arm/boot/dts/armada-385-turris-omnia.dts | 30 ++++++++++++++++++-
 1 file changed, 29 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/armada-385-turris-omnia.dts b/arch/arm/boot/dts/armada-385-turris-omnia.dts
index 7ccebf7d1757..aea07b352d24 100644
--- a/arch/arm/boot/dts/armada-385-turris-omnia.dts
+++ b/arch/arm/boot/dts/armada-385-turris-omnia.dts
@@ -82,6 +82,24 @@ pcie@3,0 {
 			};
 		};
 	};
+
+	sfp: sfp {
+		compatible = "sff,sfp";
+		i2c-bus = <&sfp_i2c>;
+		tx-fault-gpios = <&pcawan 0 GPIO_ACTIVE_HIGH>;
+		tx-disable-gpios = <&pcawan 1 GPIO_ACTIVE_HIGH>;
+		rate-select0-gpios = <&pcawan 2 GPIO_ACTIVE_HIGH>;
+		los-gpios = <&pcawan 3 GPIO_ACTIVE_HIGH>;
+		mod-def0-gpios = <&pcawan 4 GPIO_ACTIVE_LOW>;
+		maximum-power-milliwatt = <3000>;
+
+		/*
+		 * For now this has to be enabled at boot time by U-Boot when
+		 * a SFP module is present. Read more in the comment in the
+		 * eth2 node below.
+		 */
+		status = "disabled";
+	};
 };
 
 &bm {
@@ -126,10 +144,20 @@ fixed-link {
 
 /* WAN port */
 &eth2 {
+	/*
+	 * eth2 is connected via a multiplexor to both the SFP cage and to
+	 * ethernet-phy@1. The multiplexor switches the signal to SFP cage when
+	 * a SFP module is present, as determined by the mode-def0 GPIO.
+	 *
+	 * Until kernel supports this configuration properly, in case SFP module
+	 * is present, U-Boot has to enable the sfp node above, remove phy
+	 * handle and add managed = "in-band-status" property.
+	 */
 	status = "okay";
 	phy-mode = "sgmii";
 	phy = <&phy1>;
 	phys = <&comphy5 2>;
+	sfp = <&sfp>;
 	buffer-manager = <&bm>;
 	bm,pool-long = <2>;
 	bm,pool-short = <3>;
@@ -195,7 +223,7 @@ i2c@3 {
 			/* routed to PCIe2 connector (CN62A) */
 		};
 
-		i2c@4 {
+		sfp_i2c: i2c@4 {
 			#address-cells = <1>;
 			#size-cells = <0>;
 			reg = <4>;
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH mvebu-dt v3.1 4/7] ARM: dts: turris-omnia: add SFP node
  2020-11-16 12:24   ` [PATCH mvebu-dt v3.1 " Marek Behún
@ 2020-11-16 12:28     ` Marek Behún
  2020-11-16 12:34     ` Russell King - ARM Linux admin
  1 sibling, 0 replies; 13+ messages in thread
From: Marek Behún @ 2020-11-16 12:28 UTC (permalink / raw)
  To: Gregory CLEMENT, devicetree
  Cc: arm, Andrew Lunn, Russell King - ARM Linux admin,
	linux-arm-kernel, Uwe Kleine-König, Jason Cooper,
	Andreas Färber, Rob Herring

On Mon, 16 Nov 2020 13:24:22 +0100
Marek Behún <kabel@kernel.org> wrote:

JFI, added

> maximum-power-milliwatt = <3000>;

since HW guys just confirmed this.

Marek

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH mvebu-dt v3.1 4/7] ARM: dts: turris-omnia: add SFP node
  2020-11-16 12:24   ` [PATCH mvebu-dt v3.1 " Marek Behún
  2020-11-16 12:28     ` Marek Behún
@ 2020-11-16 12:34     ` Russell King - ARM Linux admin
  2020-11-16 12:53       ` Marek Behún
  1 sibling, 1 reply; 13+ messages in thread
From: Russell King - ARM Linux admin @ 2020-11-16 12:34 UTC (permalink / raw)
  To: Marek Behún
  Cc: Gregory CLEMENT, arm, Andrew Lunn, linux-arm-kernel,
	Uwe Kleine-König, Jason Cooper, Andreas Färber,
	Rob Herring, devicetree

On Mon, Nov 16, 2020 at 01:24:22PM +0100, Marek Behún wrote:
> Describe the SFP cage, but leave it disabled. Until phylink has support
> for such configuration, we are leaving it to U-Boot to enable SFP and
> disable WAN PHY at boot time depending on whether a SFP module is
> present.

Let's be clear: this is _not_ something I have any plans to be working
on adding; this is for others to get involved with.

I am not going to ack or review your patch to hack around this either.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH mvebu-dt v3.1 4/7] ARM: dts: turris-omnia: add SFP node
  2020-11-16 12:34     ` Russell King - ARM Linux admin
@ 2020-11-16 12:53       ` Marek Behún
  0 siblings, 0 replies; 13+ messages in thread
From: Marek Behún @ 2020-11-16 12:53 UTC (permalink / raw)
  To: Russell King - ARM Linux admin
  Cc: Gregory CLEMENT, arm, Andrew Lunn, linux-arm-kernel,
	Uwe Kleine-König, Jason Cooper, Andreas Färber,
	Rob Herring, devicetree

On Mon, 16 Nov 2020 12:34:56 +0000
Russell King - ARM Linux admin <linux@armlinux.org.uk> wrote:

> Let's be clear: this is _not_ something I have any plans to be working
> on adding; this is for others to get involved with.

Russell, I consider this self-evident.

Since Turris Omnia is currently probably the only device with such
configuration, it will be on me to add this support.

I will try to work out the correct solution and send patches for review.

For now though, lets merge this. It will simplify our (the vendor of
the device) patching on TurrisOS.

Marek

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH mvebu-dt v3 0/7] Turris Omnia device-tree changes
  2020-11-15 13:59 [PATCH mvebu-dt v3 0/7] Turris Omnia device-tree changes Marek Behún
                   ` (6 preceding siblings ...)
  2020-11-15 13:59 ` [PATCH mvebu-dt v3 7/7] ARM: dts: turris-omnia: remove unneeded status = "okay" properties Marek Behún
@ 2020-11-30 10:43 ` Gregory CLEMENT
  7 siblings, 0 replies; 13+ messages in thread
From: Gregory CLEMENT @ 2020-11-30 10:43 UTC (permalink / raw)
  To: Marek Behún
  Cc: arm, Marek Behún, linux-arm-kernel, Uwe Kleine-König,
	Jason Cooper, Andreas Färber, Andrew Lunn, Rob Herring,
	devicetree

Hello Marek,

> Hi Gregory,
>
> v3 of series with changes for Turris Omnia device tree.

I applied the full series on mvebu/dt

Thanks,

Gregory


>
> Changes since v2 (mostly thanks to Andreas):
> - fixed typo in 2/7
> - updated comment in 4/7 (describing current SFP cage binding status)
> - changed commit message in 4/7 a little bit
> - changed LED_FUNCTION_DEBUG to LED_FUNCTION_INDICATOR in 5/7
> - updated comment about LED controller in 5/7
> - added 7/7 which removes 2 unneeded status = "okay"
>
> Changes since v1:
> - added patch which adds description for switch interrupt
> - removed patch adding ethernet-phy interrupt: the PHY interrupt is
>   asserted by level low, but the GPIO expander driver supports only
>   edge rising/falling, and even then it may not be correct when an
>   interrupt storm occurs. So keep polling the PHY
> - added Andrew's Reviewed-by tags
>
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: Uwe Kleine-König <uwe@kleine-koenig.org>
> Cc: Jason Cooper <jason@lakedaemon.net>
> Cc: Gregory CLEMENT <gregory.clement@bootlin.com>
> Cc: Andreas Färber <afaerber@suse.de>
> Cc: Andrew Lunn <andrew@lunn.ch>
> Cc: Rob Herring <robh+dt@kernel.org>
> Cc: devicetree@vger.kernel.org
>
> Marek Behún (7):
>   ARM: dts: turris-omnia: enable HW buffer management
>   ARM: dts: turris-omnia: add comphy handle to eth2
>   ARM: dts: turris-omnia: describe switch interrupt
>   ARM: dts: turris-omnia: add SFP node
>   ARM: dts: turris-omnia: add LED controller node
>   ARM: dts: turris-omnia: update ethernet-phy node and handle name
>   ARM: dts: turris-omnia: remove unneeded status = "okay" properties
>
>  arch/arm/boot/dts/armada-385-turris-omnia.dts | 178 +++++++++++++++++-
>  1 file changed, 170 insertions(+), 8 deletions(-)
>
> -- 
> 2.26.2
>

-- 
Gregory Clement, Bootlin
Embedded Linux and Kernel engineering
http://bootlin.com

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2020-11-30 10:44 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-15 13:59 [PATCH mvebu-dt v3 0/7] Turris Omnia device-tree changes Marek Behún
2020-11-15 13:59 ` [PATCH mvebu-dt v3 1/7] ARM: dts: turris-omnia: enable HW buffer management Marek Behún
2020-11-15 13:59 ` [PATCH mvebu-dt v3 2/7] ARM: dts: turris-omnia: add comphy handle to eth2 Marek Behún
2020-11-15 13:59 ` [PATCH mvebu-dt v3 3/7] ARM: dts: turris-omnia: describe switch interrupt Marek Behún
2020-11-15 13:59 ` [PATCH mvebu-dt v3 4/7] ARM: dts: turris-omnia: add SFP node Marek Behún
2020-11-16 12:24   ` [PATCH mvebu-dt v3.1 " Marek Behún
2020-11-16 12:28     ` Marek Behún
2020-11-16 12:34     ` Russell King - ARM Linux admin
2020-11-16 12:53       ` Marek Behún
2020-11-15 13:59 ` [PATCH mvebu-dt v3 5/7] ARM: dts: turris-omnia: add LED controller node Marek Behún
2020-11-15 13:59 ` [PATCH mvebu-dt v3 6/7] ARM: dts: turris-omnia: update ethernet-phy node and handle name Marek Behún
2020-11-15 13:59 ` [PATCH mvebu-dt v3 7/7] ARM: dts: turris-omnia: remove unneeded status = "okay" properties Marek Behún
2020-11-30 10:43 ` [PATCH mvebu-dt v3 0/7] Turris Omnia device-tree changes Gregory CLEMENT

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).