Skip to contentSkip to conversation

ARM: ARMADA XP: WRT1900AC: Add support for the Ethernet switch

PATCH New Andrew Lunn 2 participants 5 messages Feb 28, 2015 – Mar 4, 2015 Device tree bindings

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: ARMADA XP: WRT1900AC: Add support for the Ethernet switch

Add a DSA section to the DT blob representing the Ethernet switch.

---
This patch requires at runtime patches in net-next, 4c732668f98b96a0fa2645ac220fd9bbc17838c4

---
 arch/arm/boot/dts/armada-xp-linksys-mamba.dts | 45 +++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)
arch/arm/boot/dts/armada-xp-linksys-mamba.dts +45 -0
index 485a6eb86910..a2cf2154dcdb 100644
@@ -327,6 +327,51 @@
 		gpio-fan,speed-map = <0    0
 				      4500 1>;
 	};
+
+	dsa at 0 {
+		compatible = "marvell,dsa";
+		#address-cells = <2>;
+		#size-cells = <0>;
+
+		dsa,ethernet = <&eth0>;
+		dsa,mii-bus = <&mdio>;
+
+		switch at 0 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			reg = <0x0 0>;	/* MDIO address 0, switch 0 in tree */
+
+			port at 0 {
+				reg = <0>;
+				label = "lan4";
+			};
+
+			port at 1 {
+				reg = <1>;
+				label = "lan3";
+			};
+
+			port at 2 {
+				reg = <2>;
+				label = "lan2";
+			};
+
+			port at 3 {
+				reg = <3>;
+				label = "lan1";
+			};
+
+			port at 4 {
+				reg = <4>;
+				label = "internet";
+			};
+
+			port at 5 {
+				reg = <5>;
+				label = "cpu";
+			};
+		};
+	};
 };
 
 &pinctrl {
Signature · 1 line
2.1.4
#1 lore raw

PATCH 1/1 ARM: ARMADA XP: WRT1900AC: Add support for the Ethernet switch

Hi Andrew,

Quoted 6 lines · Andrew Lunn

Add a DSA section to the DT blob representing the Ethernet switch.

---
This patch requires at runtime patches in net-next, 4c732668f98b96a0fa2645ac220fd9bbc17838c4

This dts fragment looks sane. The dependencies is only at runtime so it is less annoying for bissectability. So I tend applying it, however what happens if patch 4c732668f98b96a0fa2645ac220fd9bbc17838c4 is not present. Does the kernel crash? Or does it only make the Ethernet switch not available?

Thanks,

Gregory

Quoted 61 lines
---
 arch/arm/boot/dts/armada-xp-linksys-mamba.dts | 45 +++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)
arch/arm/boot/dts/armada-xp-linksys-mamba.dts +45 -0
index 485a6eb86910..a2cf2154dcdb 100644
@@ -327,6 +327,51 @@
 		gpio-fan,speed-map = <0    0
 				      4500 1>;
 	};
+
+	dsa at 0 {
+		compatible = "marvell,dsa";
+		#address-cells = <2>;
+		#size-cells = <0>;
+
+		dsa,ethernet = <&eth0>;
+		dsa,mii-bus = <&mdio>;
+
+		switch at 0 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			reg = <0x0 0>;	/* MDIO address 0, switch 0 in tree */
+
+			port at 0 {
+				reg = <0>;
+				label = "lan4";
+			};
+
+			port at 1 {
+				reg = <1>;
+				label = "lan3";
+			};
+
+			port at 2 {
+				reg = <2>;
+				label = "lan2";
+			};
+
+			port at 3 {
+				reg = <3>;
+				label = "lan1";
+			};
+
+			port at 4 {
+				reg = <4>;
+				label = "internet";
+			};
+
+			port at 5 {
+				reg = <5>;
+				label = "cpu";
+			};
+		};
+	};
 };
 
 &pinctrl {
Signature · 4 lines
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#2 lore raw

PATCH 1/1 ARM: ARMADA XP: WRT1900AC: Add support for the Ethernet switch

Quoted 10 lines · Gregory CLEMENT

Hi Andrew,

Quoted 6 lines · Andrew Lunn

Add a DSA section to the DT blob representing the Ethernet switch.

---
This patch requires at runtime patches in net-next, 4c732668f98b96a0fa2645ac220fd9bbc17838c4

Quoted 5 lines

This dts fragment looks sane. The dependencies is only at runtime so it is less annoying for bissectability. So I tend applying it, however what happens if patch 4c732668f98b96a0fa2645ac220fd9bbc17838c4 is not present. Does the kernel crash? Or does it only make the Ethernet switch not available?

Hi Gregory

It does not crash. During probe of DSA, it fails to find the phy's attached to the switch ports. This causes the probe to fail and the switch drive gets unloaded.

Andrew

#3 lore raw

PATCH 1/1 ARM: ARMADA XP: WRT1900AC: Add support for the Ethernet switch

Quoted 17 lines · Andrew Lunn
Quoted 10 lines · Gregory CLEMENT

Hi Andrew,

Quoted 6 lines · Andrew Lunn

Add a DSA section to the DT blob representing the Ethernet switch.

---
This patch requires at runtime patches in net-next, 4c732668f98b96a0fa2645ac220fd9bbc17838c4

Quoted 5 lines

This dts fragment looks sane. The dependencies is only at runtime so it is less annoying for bissectability. So I tend applying it, however what happens if patch 4c732668f98b96a0fa2645ac220fd9bbc17838c4 is not present. Does the kernel crash? Or does it only make the Ethernet switch not available?

Quoted 5 lines

Hi Gregory

It does not crash. During probe of DSA, it fails to find the phy's attached to the switch ports. This causes the probe to fail and the switch drive gets unloaded.

Good. So it is safe to apply this patch to mvebu/dt now.

Thanks,

Gregory

Quoted 3 lines

Andrew

Signature · 4 lines
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#4 lore raw

PATCH 1/1 ARM: ARMADA XP: WRT1900AC: Add support for the Ethernet switch

Quoted 18 lines · Gregory CLEMENT
Quoted 17 lines · Andrew Lunn
Quoted 15 lines · Gregory CLEMENT

Hi Andrew,

Quoted 6 lines · Andrew Lunn

Add a DSA section to the DT blob representing the Ethernet switch.

---
This patch requires at runtime patches in net-next, 4c732668f98b96a0fa2645ac220fd9bbc17838c4

This dts fragment looks sane. The dependencies is only at runtime so it is less annoying for bissectability. So I tend applying it, however what happens if patch 4c732668f98b96a0fa2645ac220fd9bbc17838c4 is not present. Does the kernel crash? Or does it only make the Ethernet switch not available?

Quoted 8 lines
Quoted 5 lines

Hi Gregory

It does not crash. During probe of DSA, it fails to find the phy's attached to the switch ports. This causes the probe to fail and the switch drive gets unloaded.

Good. So it is safe to apply this patch to mvebu/dt now.

Now applied on mvebu/dt

Thanks,

Gregory

Quoted 7 lines
Quoted 5 lines

Andrew

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