linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] ARM: dts: turris-omnia: add support for ethernet switch
@ 2016-12-22  9:43 Uwe Kleine-König
  2017-01-03 15:21 ` Andrew Lunn
  0 siblings, 1 reply; 8+ messages in thread
From: Uwe Kleine-König @ 2016-12-22  9:43 UTC (permalink / raw)
  To: linux-arm-kernel

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

Signed-off-by: Uwe Kleine-K?nig <uwe@kleine-koenig.org>
---
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(-)

diff --git a/arch/arm/boot/dts/armada-385-turris-omnia.dts b/arch/arm/boot/dts/armada-385-turris-omnia.dts
index ab49acb2d452..f8e55fa7f0fa 100644
--- a/arch/arm/boot/dts/armada-385-turris-omnia.dts
+++ b/arch/arm/boot/dts/armada-385-turris-omnia.dts
@@ -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 {
-- 
2.11.0

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

* [PATCH v2] ARM: dts: turris-omnia: add support for ethernet switch
  2016-12-22  9:43 [PATCH v2] ARM: dts: turris-omnia: add support for ethernet switch Uwe Kleine-König
@ 2017-01-03 15:21 ` Andrew Lunn
  2017-01-03 19:35   ` [PATCH v3] " Uwe Kleine-König
  0 siblings, 1 reply; 8+ messages in thread
From: Andrew Lunn @ 2017-01-03 15:21 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Dec 22, 2016 at 10:43:27AM +0100, Uwe Kleine-K?nig wrote:
> The Turris Omnia features a Marvell MV88E7176 ethernet switch. Add it to
> the dts.
> 
> Signed-off-by: Uwe Kleine-K?nig <uwe@kleine-koenig.org>
> ---
> 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(-)
> 
> diff --git a/arch/arm/boot/dts/armada-385-turris-omnia.dts b/arch/arm/boot/dts/armada-385-turris-omnia.dts
> index ab49acb2d452..f8e55fa7f0fa 100644
> --- a/arch/arm/boot/dts/armada-385-turris-omnia.dts
> +++ b/arch/arm/boot/dts/armada-385-turris-omnia.dts
> @@ -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 */

Hi Uwe

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

> +	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 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;
> +				};
> +			};

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

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

* [PATCH v3] ARM: dts: turris-omnia: add support for ethernet switch
  2017-01-03 15:21 ` Andrew Lunn
@ 2017-01-03 19:35   ` Uwe Kleine-König
  2017-01-03 20:10     ` Andrew Lunn
                       ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Uwe Kleine-König @ 2017-01-03 19:35 UTC (permalink / raw)
  To: linux-arm-kernel

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

Signed-off-by: Uwe Kleine-K?nig <uwe@kleine-koenig.org>
---
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(-)

diff --git a/arch/arm/boot/dts/armada-385-turris-omnia.dts b/arch/arm/boot/dts/armada-385-turris-omnia.dts
index ab49acb2d452..28eede180e4f 100644
--- a/arch/arm/boot/dts/armada-385-turris-omnia.dts
+++ b/arch/arm/boot/dts/armada-385-turris-omnia.dts
@@ -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 {
-- 
2.11.0

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

* [PATCH v3] ARM: dts: turris-omnia: add support for ethernet switch
  2017-01-03 19:35   ` [PATCH v3] " Uwe Kleine-König
@ 2017-01-03 20:10     ` Andrew Lunn
  2017-01-04 10:49     ` Andreas Färber
  2017-01-05 12:57     ` Gregory CLEMENT
  2 siblings, 0 replies; 8+ messages in thread
From: Andrew Lunn @ 2017-01-03 20:10 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Jan 03, 2017 at 08:35:01PM +0100, Uwe Kleine-K?nig wrote:
> The Turris Omnia features a Marvell MV88E6176 ethernet switch. Add it to
> the dts.
> 
> Signed-off-by: Uwe Kleine-K?nig <uwe@kleine-koenig.org>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

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

* [PATCH v3] ARM: dts: turris-omnia: add support for ethernet switch
  2017-01-03 19:35   ` [PATCH v3] " Uwe Kleine-König
  2017-01-03 20:10     ` Andrew Lunn
@ 2017-01-04 10:49     ` Andreas Färber
  2017-01-04 13:41       ` Andrew Lunn
  2017-01-05 12:57     ` Gregory CLEMENT
  2 siblings, 1 reply; 8+ messages in thread
From: Andreas Färber @ 2017-01-04 10:49 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Uwe,

Am 03.01.2017 um 20:35 schrieb Uwe Kleine-K?nig:
> The Turris Omnia features a Marvell MV88E6176 ethernet switch. Add it to
> the dts.
> 
> Signed-off-by: Uwe Kleine-K?nig <uwe@kleine-koenig.org>

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

-- 
SUSE Linux GmbH, Maxfeldstr. 5, 90409 N?rnberg, Germany
GF: Felix Imend?rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N?rnberg)

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

* [PATCH v3] ARM: dts: turris-omnia: add support for ethernet switch
  2017-01-04 10:49     ` Andreas Färber
@ 2017-01-04 13:41       ` Andrew Lunn
  2017-01-05 12:40         ` Andreas Färber
  0 siblings, 1 reply; 8+ messages in thread
From: Andrew Lunn @ 2017-01-04 13:41 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jan 04, 2017 at 11:49:12AM +0100, Andreas F?rber wrote:
> Hi Uwe,
> 
> Am 03.01.2017 um 20:35 schrieb Uwe Kleine-K?nig:
> > The Turris Omnia features a Marvell MV88E6176 ethernet switch. Add it to
> > the dts.
> > 
> > Signed-off-by: Uwe Kleine-K?nig <uwe@kleine-koenig.org>
> 
> 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?

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

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

* [PATCH v3] ARM: dts: turris-omnia: add support for ethernet switch
  2017-01-04 13:41       ` Andrew Lunn
@ 2017-01-05 12:40         ` Andreas Färber
  0 siblings, 0 replies; 8+ messages in thread
From: Andreas Färber @ 2017-01-05 12:40 UTC (permalink / raw)
  To: linux-arm-kernel

Am 04.01.2017 um 14:41 schrieb Andrew Lunn:
> On Wed, Jan 04, 2017 at 11:49:12AM +0100, Andreas F?rber wrote:
>> Am 03.01.2017 um 20:35 schrieb Uwe Kleine-K?nig:
>>> The Turris Omnia features a Marvell MV88E6176 ethernet switch. Add it to
>>> the dts.
>>>
>>> Signed-off-by: Uwe Kleine-K?nig <uwe@kleine-koenig.org>
>>
>> It's still not working for me on next-20170104 with this v3.
>> Are there any other patches needed?
[...]
>> 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?
> 
> 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!

Tested-by: Andreas F?rber <afaerber@suse.de>

Unrelated remaining issue is still the misconfigured stdout-path.

Regards,
Andreas

-- 
SUSE Linux GmbH, Maxfeldstr. 5, 90409 N?rnberg, Germany
GF: Felix Imend?rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N?rnberg)

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

* [PATCH v3] ARM: dts: turris-omnia: add support for ethernet switch
  2017-01-03 19:35   ` [PATCH v3] " Uwe Kleine-König
  2017-01-03 20:10     ` Andrew Lunn
  2017-01-04 10:49     ` Andreas Färber
@ 2017-01-05 12:57     ` Gregory CLEMENT
  2 siblings, 0 replies; 8+ messages in thread
From: Gregory CLEMENT @ 2017-01-05 12:57 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Uwe,
 
 On mar., janv. 03 2017, Uwe Kleine-K?nig <uwe@kleine-koenig.org> wrote:

> The Turris Omnia features a Marvell MV88E6176 ethernet switch. Add it to
> the dts.
>
> Signed-off-by: Uwe Kleine-K?nig <uwe@kleine-koenig.org>

Applied on mvebu/dt with Reviewed-by flag from Andrew Lunn
<andrew@lunn.ch> and Tested-by flag from Andreas F?rber.

Thanks,

Gregory
> ---
> 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(-)
>
> diff --git a/arch/arm/boot/dts/armada-385-turris-omnia.dts b/arch/arm/boot/dts/armada-385-turris-omnia.dts
> index ab49acb2d452..28eede180e4f 100644
> --- a/arch/arm/boot/dts/armada-385-turris-omnia.dts
> +++ b/arch/arm/boot/dts/armada-385-turris-omnia.dts
> @@ -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 {
> -- 
> 2.11.0
>

-- 
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

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

end of thread, other threads:[~2017-01-05 12:57 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-22  9:43 [PATCH v2] ARM: dts: turris-omnia: add support for ethernet switch Uwe Kleine-König
2017-01-03 15:21 ` Andrew Lunn
2017-01-03 19:35   ` [PATCH v3] " Uwe Kleine-König
2017-01-03 20:10     ` Andrew Lunn
2017-01-04 10:49     ` Andreas Färber
2017-01-04 13:41       ` Andrew Lunn
2017-01-05 12:40         ` Andreas Färber
2017-01-05 12:57     ` 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).