Skip to contentSkip to conversation

arm: mvebu: turris_omnia: Enable networking via ethernet switch

PATCH In review Marek Behún 2 participants 2 messages Dec 19, 2023 – Mar 5, 2024 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm: mvebu: turris_omnia: Enable networking via ethernet switch

From: Marek Mojík <[email protected]>

The Turris Omnia contains the Marvell 88E6176 ethernet switch. Add config options and device tree to enable the support.

---
Stefan, this patch depends on
[v2] net: mv88e6xxx: fix missing SMI address initialization
https://patchwork.ozlabs.org/project/uboot/patch/62eoapvurxkedw74vpzb55q3nuqgb4cef3bl2laayx57cpjzus@vlpx57cjc4ph/

---
 .../dts/armada-385-turris-omnia-u-boot.dtsi   | 51 +++++++++++++++++++
 configs/turris_omnia_defconfig                |  2 +
 2 files changed, 53 insertions(+)
arch/arm/dts/armada-385-turris-omnia-u-boot.dtsi +51 -0
index 509d6ca69c..c63a331d69 100644
@@ -35,6 +35,57 @@
 	};
 };
 
+&mdio {
+	switch@10 {
+		mdio {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			sw_phy0: ethernet-phy@0 {
+				reg = <0x0>;
+			};
+
+			sw_phy1: ethernet-phy@1 {
+				reg = <0x1>;
+			};
+
+			sw_phy2: ethernet-phy@2 {
+				reg = <0x2>;
+			};
+
+			sw_phy3: ethernet-phy@3 {
+				reg = <0x3>;
+			};
+
+			sw_phy4: ethernet-phy@4 {
+				reg = <0x4>;
+			};
+		};
+		ports {
+			ports@0 {
+				phy-handle = <&sw_phy0>;
+				phy-mode = "internal";
+			};
+			ports@1 {
+				phy-handle = <&sw_phy1>;
+				phy-mode = "internal";
+			};
+			ports@2 {
+				phy-handle = <&sw_phy2>;
+				phy-mode = "internal";
+			};
+			ports@3 {
+				phy-handle = <&sw_phy3>;
+				phy-mode = "internal";
+			};
+			ports@4 {
+				phy-handle = <&sw_phy4>;
+				phy-mode = "internal";
+			};
+		};
+	};
+};
+
 #ifdef CONFIG_ENV_IS_IN_SPI_FLASH
 &spi0 {
 	flash@0 {
configs/turris_omnia_defconfig +2 -0
index 65d4a296e7..3aaee276ea 100644
@@ -96,7 +96,9 @@ CONFIG_SPI_FLASH_WINBOND=y
 CONFIG_SPI_FLASH_MTD=y
 CONFIG_PHY_MARVELL=y
 CONFIG_PHY_FIXED=y
+CONFIG_DM_DSA=y
 CONFIG_PHY_GIGE=y
+CONFIG_MV88E6XXX=y
 CONFIG_MVNETA=y
 CONFIG_MII=y
 CONFIG_MVMDIO=y
Signature · 1 line
2.41.0
#1 lore raw
Quoted 7 lines · Marek Behún

From: Marek Mojík <[email protected]>

The Turris Omnia contains the Marvell 88E6176 ethernet switch. Add config options and device tree to enable the support.

Applied to u-boot-marvell/master

Thanks,
Stefan

Quoted 76 lines

---
Stefan, this patch depends on
[v2] net: mv88e6xxx: fix missing SMI address initialization
https://patchwork.ozlabs.org/project/uboot/patch/62eoapvurxkedw74vpzb55q3nuqgb4cef3bl2laayx57cpjzus@vlpx57cjc4ph/

---
  .../dts/armada-385-turris-omnia-u-boot.dtsi   | 51 +++++++++++++++++++
  configs/turris_omnia_defconfig                |  2 +
  2 files changed, 53 insertions(+)
arch/arm/dts/armada-385-turris-omnia-u-boot.dtsi +51 -0
index 509d6ca69c..c63a331d69 100644
@@ -35,6 +35,57 @@
  	};
  };
 
+&mdio {
+	switch@10 {
+		mdio {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			sw_phy0: ethernet-phy@0 {
+				reg = <0x0>;
+			};
+
+			sw_phy1: ethernet-phy@1 {
+				reg = <0x1>;
+			};
+
+			sw_phy2: ethernet-phy@2 {
+				reg = <0x2>;
+			};
+
+			sw_phy3: ethernet-phy@3 {
+				reg = <0x3>;
+			};
+
+			sw_phy4: ethernet-phy@4 {
+				reg = <0x4>;
+			};
+		};
+		ports {
+			ports@0 {
+				phy-handle = <&sw_phy0>;
+				phy-mode = "internal";
+			};
+			ports@1 {
+				phy-handle = <&sw_phy1>;
+				phy-mode = "internal";
+			};
+			ports@2 {
+				phy-handle = <&sw_phy2>;
+				phy-mode = "internal";
+			};
+			ports@3 {
+				phy-handle = <&sw_phy3>;
+				phy-mode = "internal";
+			};
+			ports@4 {
+				phy-handle = <&sw_phy4>;
+				phy-mode = "internal";
+			};
+		};
+	};
+};
+
  #ifdef CONFIG_ENV_IS_IN_SPI_FLASH
  &spi0 {
  	flash@0 {
configs/turris_omnia_defconfig +0 -0
index 65d4a296e7..3aaee276ea 100644

configs/turris_omnia_defconfig CONFIG_SPI_FLASH_WINBOND=y · line 104

Quoted 9 lines
configs/turris_omnia_defconfig +2 -0
@@ -96,7 +96,9 @@ CONFIG_SPI_FLASH_WINBOND=y
  CONFIG_SPI_FLASH_MTD=y
  CONFIG_PHY_MARVELL=y
  CONFIG_PHY_FIXED=y
+CONFIG_DM_DSA=y
  CONFIG_PHY_GIGE=y
+CONFIG_MV88E6XXX=y
  CONFIG_MVNETA=y
  CONFIG_MII=y
  CONFIG_MVMDIO=y

Viele Grüße,
Stefan Roese

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]