Skip to contentSkip to conversation

Add network support for ServalT SoCs

PATCH New Horatiu Vultur 2 participants 6 messages Apr 8, 2019 – Apr 10, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover Add network support for ServalT SoCs

This patch series adds network support for ServalT SoCs family. There is only one pcb in this family: ServalT(pcb116).

This patch series is based on: u-boot-mips/next.

Horatiu Vultur (3):
net: Add MSCC ServalT network driver.
net: mscc: servalt: Add ethernet nodes for ServalT
configs: mscc_servalt: Add network support

 arch/mips/dts/mscc,servalt.dtsi                    |  40 ++
 arch/mips/dts/servalt_pcb116.dts                   |  25 +
 .../include/mach/servalt/servalt_devcpu_gcb.h      |   2 +
 configs/mscc_servalt_defconfig                     |   6 +-
 drivers/net/mscc_eswitch/Kconfig                   |   7 +
 drivers/net/mscc_eswitch/Makefile                  |   1 +
 drivers/net/mscc_eswitch/servalt_switch.c          | 622 +++++++++++++++++++++
 7 files changed, 702 insertions(+), 1 deletion(-)
 create mode 100644 drivers/net/mscc_eswitch/servalt_switch.c
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/3 net: Add MSCC ServalT network driver.

Add network driver for Microsemi Ethernet switch.
It is present on ServalT SoCs.

---
 .../include/mach/servalt/servalt_devcpu_gcb.h      |   2 +
 drivers/net/mscc_eswitch/Kconfig                   |   7 +
 drivers/net/mscc_eswitch/Makefile                  |   1 +
 drivers/net/mscc_eswitch/servalt_switch.c          | 622 +++++++++++++++++++++
 4 files changed, 632 insertions(+)
 create mode 100644 drivers/net/mscc_eswitch/servalt_switch.c
arch/mips/mach-mscc/include/mach/servalt/servalt_devcpu_gcb.h +2 -0
index f6e7245..493eaad 100644
@@ -17,4 +17,6 @@
 #define GPIO_GPIO_ALT(x)                                  (0x74 + 4 * (x))
 #define GPIO_GPIO_ALT1(x)                                 (0x7c + 4 * (x))
 
+#define GCB_PHY_CFG                                       0x118
+
 #endif
drivers/net/mscc_eswitch/Kconfig +7 -0
index 3f9d14b..6359d0b 100644
@@ -22,3 +22,10 @@ config MSCC_JR2_SWITCH
 	select PHYLIB
 	help
 	  This driver supports the Jaguar2 network switch device.
+
+config MSCC_SERVALT_SWITCH
+	bool "Servalt switch driver"
+	depends on DM_ETH && ARCH_MSCC
+	select PHYLIB
+	help
+	  This driver supports the Servalt network switch device.
drivers/net/mscc_eswitch/Makefile +1 -0
index 0a1b863..bffd8ec 100644
@@ -2,3 +2,4 @@
 obj-$(CONFIG_MSCC_OCELOT_SWITCH) += ocelot_switch.o mscc_miim.o mscc_xfer.o mscc_mac_table.o
 obj-$(CONFIG_MSCC_LUTON_SWITCH) += luton_switch.o mscc_miim.o mscc_xfer.o mscc_mac_table.o
 obj-$(CONFIG_MSCC_JR2_SWITCH) += jr2_switch.o mscc_xfer.o
+obj-$(CONFIG_MSCC_SERVALT_SWITCH) += servalt_switch.o mscc_xfer.o
drivers/net/mscc_eswitch/servalt_switch.c new file +622 -0

622 lines not on this page · raw message

Signature · 1 line
2.7.4
#2 lore raw

PATCH 1/3 net: Add MSCC ServalT network driver.

Am 08.04.19 um 10:31 schrieb Horatiu Vultur:

Quoted 12 lines

Add network driver for Microsemi Ethernet switch.
It is present on ServalT SoCs.

---
 .../include/mach/servalt/servalt_devcpu_gcb.h      |   2 +
 drivers/net/mscc_eswitch/Kconfig                   |   7 +
 drivers/net/mscc_eswitch/Makefile                  |   1 +
 drivers/net/mscc_eswitch/servalt_switch.c          | 622 +++++++++++++++++++++
 4 files changed, 632 insertions(+)
 create mode 100644 drivers/net/mscc_eswitch/servalt_switch.c
Signature · 1 line
- Daniel
#3 lore raw

PATCH 2/3 net: mscc: servalt: Add ethernet nodes for ServalT

In reply to Horatiu Vultur

Add ethernet nodes for ServalT SoCs family. Currently there is only one pcb(pcb116) in this family.

---
 arch/mips/dts/mscc,servalt.dtsi  | 40 ++++++++++++++++++++++++++++++++++++++++
 arch/mips/dts/servalt_pcb116.dts | 25 +++++++++++++++++++++++++
 2 files changed, 65 insertions(+)
arch/mips/dts/mscc,servalt.dtsi +40 -0
index 4beb7a3..45ae2de 100644
@@ -145,5 +145,45 @@
 			#gpio-cells = <2>;
 			gpio-ranges = <&sgpio 0 0 128>;
 		};
+
+		switch: switch at 1010000 {
+			compatible = "mscc,vsc7437-switch";
+			reg = <0x01030000 0x0100>,   // VTSS_TO_DEV_0
+			      <0x01040000 0x0100>,   // VTSS_TO_DEV_1
+			      <0x01f00000 0x100000>, // ANA_AC
+			      <0x01d00000 0x100000>, // ANA_CL
+			      <0x01e00000 0x100000>, // ANA_L2
+			      <0x01120000 0x10000>,  // ASM
+			      <0x01130000 0x00000>,  // LRN
+			      <0x017d0000 0x10000>,  // QFWD
+			      <0x01020000 0x20000>,  // QS
+			      <0x017e0000 0x10000>,  // QSYS
+			      <0x01b00000 0x80000>;  // REW
+			reg-names = "port0", "port1",
+				    "ana_ac", "ana_cl", "ana_l2", "asm", "lrn",
+				    "qfwd", "qs", "qsys", "rew";
+			status = "okay";
+
+			ethernet-ports {
+				#address-cells = <1>;
+				#size-cells = <0>;
+			};
+		};
+
+		mdio0: mdio at 010100c4 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "mscc,jr2-miim";
+			reg = <0x010100c4 0x24>;
+			status = "disabled";
+		};
+
+		mdio1: mdio at 010100e8 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "mscc,jr2-miim";
+			reg = <0x010100e8 0x24>;
+			status = "disabled";
+		};
 	};
 };
arch/mips/dts/servalt_pcb116.dts +25 -0
index fb33312..9d49215 100644
@@ -54,3 +54,28 @@
 	status = "okay";
 	sgpio-ports = <0x0000fe7f>;
 };
+
+&mdio0 {
+	status = "okay";
+
+	phy0: ethernet-phy at 0 {
+		reg = <0>;
+	};
+	phy1: ethernet-phy at 1 {
+		reg = <1>;
+	};
+};
+
+&switch {
+	ethernet-ports {
+
+		port0: port at 0 {
+			reg = <0>;
+			phy-handle = <&phy0>;
+		};
+		port1: port at 1 {
+			reg = <1>;
+			phy-handle = <&phy1>;
+		};
+	};
+};
Signature · 1 line
2.7.4
#4 lore raw

PATCH 3/3 configs: mscc_servalt: Add network support

In reply to Horatiu Vultur

Update default config to use network driver for ServalT SoCs.

---
 configs/mscc_servalt_defconfig | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
configs/mscc_servalt_defconfig +5 -1
index 027aaa4..33d43de 100644
@@ -24,7 +24,6 @@ CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
-# CONFIG_CMD_NET is not set
 CONFIG_CMD_MTDPARTS=y
 CONFIG_MTDIDS_DEFAULT="nor0=spi_flash"
 CONFIG_MTDPARTS_DEFAULT="mtdparts=spi_flash:1m(UBoot),256k(Env),256k(Env.bk)"
@@ -59,3 +58,8 @@ CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
 CONFIG_LZMA=y
+CONFIG_CMD_DHCP=y
+# CONFIG_NET_TFTP_VARS is not set
+# CONFIG_CMD_NFS is not set
+CONFIG_CMD_PING=y
+CONFIG_MSCC_SERVALT_SWITCH=y
Signature · 1 line
2.7.4
#5 lore raw

cover Add network support for ServalT SoCs

In reply to Horatiu Vultur

Am 08.04.19 um 10:31 schrieb Horatiu Vultur:

Quoted 10 lines

This patch series adds network support for ServalT SoCs family. There is only one pcb in this family: ServalT(pcb116).

This patch series is based on: u-boot-mips/next.

Horatiu Vultur (3):
net: Add MSCC ServalT network driver.
net: mscc: servalt: Add ethernet nodes for ServalT
configs: mscc_servalt: Add network support

Quoted 10 lines
 arch/mips/dts/mscc,servalt.dtsi                    |  40 ++
 arch/mips/dts/servalt_pcb116.dts                   |  25 +
 .../include/mach/servalt/servalt_devcpu_gcb.h      |   2 +
 configs/mscc_servalt_defconfig                     |   6 +-
 drivers/net/mscc_eswitch/Kconfig                   |   7 +
 drivers/net/mscc_eswitch/Makefile                  |   1 +
 drivers/net/mscc_eswitch/servalt_switch.c          | 622 +++++++++++++++++++++
 7 files changed, 702 insertions(+), 1 deletion(-)
 create mode 100644 drivers/net/mscc_eswitch/servalt_switch.c

series applied to u-boot-mips/next, thanks.

Signature · 1 line
- Daniel