Skip to contentSkip to conversation

ARM: dts: turris-omnia: add support for ethernet switch

PATCH Superseded Uwe Kleine-König 4 participants 8 messages Dec 22, 2016 – Jan 5, 2017 Device tree bindings

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ARM: dts: turris-omnia: add support for ethernet switch

The Turris Omnia features a Marvell MV88E7176 ethernet switch. Add it to the dts.

---
Changes since (implicit) v1:
- drop mdio bus and per port phy-handle as they match the default setup.

One thing I was surprised is that the mv88e6xxx module isn't autoloaded by udev. Is this expected?

Best regards
Uwe

 arch/arm/boot/dts/armada-385-turris-omnia.dts | 66 ++++++++++++++++++++++++++-
 1 file changed, 64 insertions(+), 2 deletions(-)
arch/arm/boot/dts/armada-385-turris-omnia.dts +64 -2
index ab49acb2d452..f8e55fa7f0fa 100644
@@ -122,7 +122,7 @@
 	pinctrl-names = "default";
 	pinctrl-0 = <&ge0_rgmii_pins>;
 	status = "okay";
-	phy-mode = "rgmii-id";
+	phy-mode = "rgmii";
 
 	fixed-link {
 		speed = <1000>;
@@ -135,7 +135,7 @@
 	pinctrl-names = "default";
 	pinctrl-0 = <&ge1_rgmii_pins>;
 	status = "okay";
-	phy-mode = "rgmii-id";
+	phy-mode = "rgmii";
 
 	fixed-link {
 		speed = <1000>;
@@ -274,6 +274,68 @@
 	};
 
 	/* Switch MV88E7176 at address 0x10 */
+	switch at 10 {
+		compatible = "marvell,mv88e6085";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		dsa,member = <0 0>;
+
+		reg = <0x10>;
+
+		ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			ports at 0 {
+				reg = <0>;
+				label = "lan0";
+			};
+
+			ports at 1 {
+				reg = <1>;
+				label = "lan1";
+			};
+
+			ports at 2 {
+				reg = <2>;
+				label = "lan2";
+			};
+
+			ports at 3 {
+				reg = <3>;
+				label = "lan3";
+			};
+
+			ports at 4 {
+				reg = <4>;
+				label = "lan4";
+			};
+
+			ports at 5 {
+				reg = <5>;
+				label = "cpu";
+				ethernet = <&eth1>;
+				phy-mode = "rgmii-id";
+
+				fixed-link {
+					speed = <1000>;
+					full-duplex;
+				};
+			};
+
+			ports at 6 {
+				reg = <6>;
+				label = "cpu";
+				ethernet = <&eth0>;
+				phy-mode = "rgmii-id";
+
+				fixed-link {
+					speed = <1000>;
+					full-duplex;
+				};
+			};
+		};
+	};
 };
 
 &pinctrl {
Signature · 1 line
2.11.0
#1 lore raw

PATCH v2 1/1 ARM: dts: turris-omnia: add support for ethernet switch

Quoted 41 lines · Uwe Kleine-K?nig

The Turris Omnia features a Marvell MV88E7176 ethernet switch. Add it to the dts.

---
Changes since (implicit) v1:
- drop mdio bus and per port phy-handle as they match the default setup.

One thing I was surprised is that the mv88e6xxx module isn't autoloaded by udev. Is this expected?

Best regards
Uwe

 arch/arm/boot/dts/armada-385-turris-omnia.dts | 66 ++++++++++++++++++++++++++-
 1 file changed, 64 insertions(+), 2 deletions(-)
arch/arm/boot/dts/armada-385-turris-omnia.dts +2 -2
index ab49acb2d452..f8e55fa7f0fa 100644
@@ -122,7 +122,7 @@
 	pinctrl-names = "default";
 	pinctrl-0 = <&ge0_rgmii_pins>;
 	status = "okay";
-	phy-mode = "rgmii-id";
+	phy-mode = "rgmii";
 
 	fixed-link {
 		speed = <1000>;
@@ -135,7 +135,7 @@
 	pinctrl-names = "default";
 	pinctrl-0 = <&ge1_rgmii_pins>;
 	status = "okay";
-	phy-mode = "rgmii-id";
+	phy-mode = "rgmii";
 
 	fixed-link {
 		speed = <1000>;

arch/arm/boot/dts/armada-385-turris-omnia.dts line 276

Quoted 3 lines
arch/arm/boot/dts/armada-385-turris-omnia.dts +0 -0
@@ -274,6 +274,68 @@
 	};
 
 	/* Switch MV88E7176 at address 0x10 */

Hi Uwe

You probably have the switch model wrong in this comment. 6176 not 7176?

Quoted 11 lines
arch/arm/boot/dts/armada-385-turris-omnia.dts +11 -0
+	switch at 10 {
+		compatible = "marvell,mv88e6085";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		dsa,member = <0 0>;
+
+		reg = <0x10>;
+
+		ports {
+			#address-cells = <1>;
+			#size-cells = <0>;

...

Quoted 13 lines
arch/arm/boot/dts/armada-385-turris-omnia.dts +13 -0
+			ports at 5 {
+				reg = <5>;
+				label = "cpu";
+				ethernet = <&eth1>;
+				phy-mode = "rgmii-id";
+
+				fixed-link {
+					speed = <1000>;
+					full-duplex;
+				};
+			};
+
+			ports at 6 {

arch/arm/boot/dts/armada-385-turris-omnia.dts line 336

Quoted 10 lines
arch/arm/boot/dts/armada-385-turris-omnia.dts +10 -0
+				reg = <6>;
+				label = "cpu";
+				ethernet = <&eth0>;
+				phy-mode = "rgmii-id";
+
+				fixed-link {
+					speed = <1000>;
+					full-duplex;
+				};
+			};

Humm, we need to be careful here. I hope multi CPU will come soon. But we have not yet defined how the binding will look. I expect it does look a lot like this, but there are probably additional properties, like linking user ports to cpu ports.

What i'm worried about is future backwards compatibility. There is a danger that this DT will trigger some of the multi CPU code, but it is missing other required properties, and so stops working.

It would be safer if you just had a comment about the second CPU port.

Thanks
Andrew

#2 lore raw

PATCH v3 1/1 ARM: dts: turris-omnia: add support for ethernet switch

The Turris Omnia features a Marvell MV88E6176 ethernet switch. Add it to the dts.

---
Changes since (implicit) v1:
- drop mdio bus and per port phy-handle as they match the default setup.

Changes since v2:
- Fix switch type in comment and commit log
- drop 2nd cpu port

 arch/arm/boot/dts/armada-385-turris-omnia.dts | 58 +++++++++++++++++++++++++--
 1 file changed, 55 insertions(+), 3 deletions(-)
arch/arm/boot/dts/armada-385-turris-omnia.dts +55 -3
index ab49acb2d452..28eede180e4f 100644
@@ -122,7 +122,7 @@
 	pinctrl-names = "default";
 	pinctrl-0 = <&ge0_rgmii_pins>;
 	status = "okay";
-	phy-mode = "rgmii-id";
+	phy-mode = "rgmii";
 
 	fixed-link {
 		speed = <1000>;
@@ -135,7 +135,7 @@
 	pinctrl-names = "default";
 	pinctrl-0 = <&ge1_rgmii_pins>;
 	status = "okay";
-	phy-mode = "rgmii-id";
+	phy-mode = "rgmii";
 
 	fixed-link {
 		speed = <1000>;
@@ -273,7 +273,59 @@
 		/* irq is connected to &pcawan pin 7 */
 	};
 
-	/* Switch MV88E7176 at address 0x10 */
+	/* Switch MV88E6176 at address 0x10 */
+	switch at 10 {
+		compatible = "marvell,mv88e6085";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		dsa,member = <0 0>;
+
+		reg = <0x10>;
+
+		ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			ports at 0 {
+				reg = <0>;
+				label = "lan0";
+			};
+
+			ports at 1 {
+				reg = <1>;
+				label = "lan1";
+			};
+
+			ports at 2 {
+				reg = <2>;
+				label = "lan2";
+			};
+
+			ports at 3 {
+				reg = <3>;
+				label = "lan3";
+			};
+
+			ports at 4 {
+				reg = <4>;
+				label = "lan4";
+			};
+
+			ports at 5 {
+				reg = <5>;
+				label = "cpu";
+				ethernet = <&eth1>;
+				phy-mode = "rgmii-id";
+
+				fixed-link {
+					speed = <1000>;
+					full-duplex;
+				};
+			};
+
+			/* port 6 is connected to eth0 */
+		};
+	};
 };
 
 &pinctrl {
Signature · 1 line
2.11.0
#4 lore raw

PATCH v3 1/1 ARM: dts: turris-omnia: add support for ethernet switch

In reply to Uwe Kleine-König

Hi Uwe,

Am 03.01.2017 um 20:35 schrieb Uwe Kleine-K?nig:

Quoted 4 lines

The Turris Omnia features a Marvell MV88E6176 ethernet switch. Add it to the dts.

It's still not working for me on next-20170104 with this v3. Are there any other patches needed?

Should all ports LAN0-LAN4 work with the commented-out second cpu node?

I've been using the WAN port (eth2) just fine. (=eth1 in OpenWrt)

With this patch, eth0 and eth1 are shown as UP by default. If however I enslave eth0 and eth1 in a br-lan bridge, as seen under OpenWrt for eth0+eth2, then eth1 is DOWN while eth0 remains UP, and br-lan remains DOWN. Same issue if I drop eth0 from the bridge - after a reboot eth1 is UP but br-lan is still DOWN.
I had to manually enable CONFIG_BRIDGE, so maybe I'm missing more kernel options? Or did you simply not try using a bridge?

Regards,
Andreas

Signature · 3 lines
SUSE Linux GmbH, Maxfeldstr. 5, 90409 N?rnberg, Germany
GF: Felix Imend?rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N?rnberg)
#5 lore raw

PATCH v3 1/1 ARM: dts: turris-omnia: add support for ethernet switch

Quoted 15 lines · Andreas F?rber

Hi Uwe,

Am 03.01.2017 um 20:35 schrieb Uwe Kleine-K?nig:

Quoted 4 lines

The Turris Omnia features a Marvell MV88E6176 ethernet switch. Add it to the dts.

It's still not working for me on next-20170104 with this v3. Are there any other patches needed?

Should all ports LAN0-LAN4 work with the commented-out second cpu node?

I've been using the WAN port (eth2) just fine. (=eth1 in OpenWrt)

Quoted 7 lines

With this patch, eth0 and eth1 are shown as UP by default. If however I enslave eth0 and eth1 in a br-lan bridge, as seen under OpenWrt for eth0+eth2, then eth1 is DOWN while eth0 remains UP, and br-lan remains DOWN. Same issue if I drop eth0 from the bridge - after a reboot eth1 is UP but br-lan is still DOWN.
I had to manually enable CONFIG_BRIDGE, so maybe I'm missing more kernel options? Or did you simply not try using a bridge?

That is not how you use DSA. It is very different to how OpenWRT swconfig works. The mainline kernel philosophy is that switch interfaces are just normal linux interfaces.

You need eth0 up, in order that the slave interfaces work. But then you can use the slave interfaces just like normal Linux interfaces. You can put an IP address on them. You can put them into a bridge, etc. But leave eth0 alone, other than having it up.

Andrew

#6 lore raw

PATCH v3 1/1 ARM: dts: turris-omnia: add support for ethernet switch

Am 04.01.2017 um 14:41 schrieb Andrew Lunn:

Quoted 9 lines · Andreas F?rber
Quoted 8 lines

Am 03.01.2017 um 20:35 schrieb Uwe Kleine-K?nig:

Quoted 4 lines

The Turris Omnia features a Marvell MV88E6176 ethernet switch. Add it to the dts.

It's still not working for me on next-20170104 with this v3. Are there any other patches needed?

[...]

Quoted 10 lines
Quoted 9 lines

I've been using the WAN port (eth2) just fine. (=eth1 in OpenWrt)

With this patch, eth0 and eth1 are shown as UP by default. If however I enslave eth0 and eth1 in a br-lan bridge, as seen under OpenWrt for eth0+eth2, then eth1 is DOWN while eth0 remains UP, and br-lan remains DOWN. Same issue if I drop eth0 from the bridge - after a reboot eth1 is UP but br-lan is still DOWN.
I had to manually enable CONFIG_BRIDGE, so maybe I'm missing more kernel options? Or did you simply not try using a bridge?

Quoted 8 lines

That is not how you use DSA. It is very different to how OpenWRT swconfig works. The mainline kernel philosophy is that switch interfaces are just normal linux interfaces.

You need eth0 up, in order that the slave interfaces work. But then you can use the slave interfaces just like normal Linux interfaces. You can put an IP address on them. You can put them into a bridge, etc. But leave eth0 alone, other than having it up.

Thanks, s/eth0/eth1/g here.

There were two hurdles, for one only eth0..eth2 were shown in our yast tool (https://bugzilla.opensuse.org/show_bug.cgi?id=1018271), and for another the interface name in manually written config files needed to be just lan0 instead of lan0 at eth1 as shown in ip a.

A br-lan bridge across lan0..lan4 works as expected. Great!

Unrelated remaining issue is still the misconfigured stdout-path.

Regards,
Andreas

Signature · 3 lines
SUSE Linux GmbH, Maxfeldstr. 5, 90409 N?rnberg, Germany
GF: Felix Imend?rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N?rnberg)
#7 lore raw

PATCH v3 1/1 ARM: dts: turris-omnia: add support for ethernet switch

In reply to Uwe Kleine-König

Hi Uwe,

Quoted 4 lines · Uwe Kleine-K?nig

The Turris Omnia features a Marvell MV88E6176 ethernet switch. Add it to the dts.

Applied on mvebu/dt with Reviewed-by flag from Andrew Lunn <[email protected]> and Tested-by flag from Andreas F?rber.

Thanks,

Gregory

Quoted 98 lines

---
Changes since (implicit) v1:
- drop mdio bus and per port phy-handle as they match the default setup.

Changes since v2:
- Fix switch type in comment and commit log
- drop 2nd cpu port

 arch/arm/boot/dts/armada-385-turris-omnia.dts | 58 +++++++++++++++++++++++++--
 1 file changed, 55 insertions(+), 3 deletions(-)
arch/arm/boot/dts/armada-385-turris-omnia.dts +55 -3
index ab49acb2d452..28eede180e4f 100644
@@ -122,7 +122,7 @@
 	pinctrl-names = "default";
 	pinctrl-0 = <&ge0_rgmii_pins>;
 	status = "okay";
-	phy-mode = "rgmii-id";
+	phy-mode = "rgmii";
 
 	fixed-link {
 		speed = <1000>;
@@ -135,7 +135,7 @@
 	pinctrl-names = "default";
 	pinctrl-0 = <&ge1_rgmii_pins>;
 	status = "okay";
-	phy-mode = "rgmii-id";
+	phy-mode = "rgmii";
 
 	fixed-link {
 		speed = <1000>;
@@ -273,7 +273,59 @@
 		/* irq is connected to &pcawan pin 7 */
 	};
 
-	/* Switch MV88E7176 at address 0x10 */
+	/* Switch MV88E6176 at address 0x10 */
+	switch at 10 {
+		compatible = "marvell,mv88e6085";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		dsa,member = <0 0>;
+
+		reg = <0x10>;
+
+		ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			ports at 0 {
+				reg = <0>;
+				label = "lan0";
+			};
+
+			ports at 1 {
+				reg = <1>;
+				label = "lan1";
+			};
+
+			ports at 2 {
+				reg = <2>;
+				label = "lan2";
+			};
+
+			ports at 3 {
+				reg = <3>;
+				label = "lan3";
+			};
+
+			ports at 4 {
+				reg = <4>;
+				label = "lan4";
+			};
+
+			ports at 5 {
+				reg = <5>;
+				label = "cpu";
+				ethernet = <&eth1>;
+				phy-mode = "rgmii-id";
+
+				fixed-link {
+					speed = <1000>;
+					full-duplex;
+				};
+			};
+
+			/* port 6 is connected to eth0 */
+		};
+	};
 };
 
 &pinctrl {
Signature · 1 line
2.11.0
Signature · 4 lines
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com