Skip to contentSkip to conversation

Update Ocelot network driver.

PATCH New Horatiu Vultur 1 participant 4 messages Apr 24, 2019

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

cover Update Ocelot network driver.

Update Ocelot network driver to add support for pcb120.

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

Horatiu Vultur (3):
net: mscc: ocelot: Update network driver for pcb120
board: mscc: ocelot: Update MSCC Ocelot board.
net: mscc: ocelot: Update DTS for Ocelot pcb120.

 MAINTAINERS                                        |   1 +
 arch/mips/dts/mscc,ocelot.dtsi                     | 109 ++----
 arch/mips/dts/ocelot_pcb120.dts                    |  75 ++++
 arch/mips/dts/ocelot_pcb123.dts                    |  44 ++-
 .../include/mach/ocelot/ocelot_devcpu_gcb.h        |   1 +
 board/mscc/ocelot/ocelot.c                         |  15 +
 drivers/net/mscc_eswitch/Makefile                  |   2 +-
 drivers/net/mscc_eswitch/ocelot_switch.c           | 434 ++++++++++++++++-----
 include/dt-bindings/mscc/ocelot_data.h             |  19 +
 9 files changed, 520 insertions(+), 180 deletions(-)
 create mode 100644 include/dt-bindings/mscc/ocelot_data.h
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/3 net: mscc: ocelot: Update network driver for pcb120

Update Ocelot network driver to have support also for pcb120.

---
 .../include/mach/ocelot/ocelot_devcpu_gcb.h        |   1 +
 drivers/net/mscc_eswitch/Makefile                  |   2 +-
 drivers/net/mscc_eswitch/ocelot_switch.c           | 434 ++++++++++++++++-----
 3 files changed, 338 insertions(+), 99 deletions(-)
arch/mips/mach-mscc/include/mach/ocelot/ocelot_devcpu_gcb.h +1 -0
index d3a7641..b2a4203 100644
@@ -20,4 +20,5 @@
 
 #define GPIO_ALT(x)				(0x54 + 4 * (x))
 
+#define PERF_PHY_CFG                                      0xf0
 #endif
drivers/net/mscc_eswitch/Makefile +1 -1
index 6aa59ef..9c208d1 100644
@@ -1,5 +1,5 @@
 
-obj-$(CONFIG_MSCC_OCELOT_SWITCH) += ocelot_switch.o mscc_miim.o mscc_xfer.o mscc_mac_table.o
+obj-$(CONFIG_MSCC_OCELOT_SWITCH) += ocelot_switch.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/ocelot_switch.c +336 -98

552 lines not on this page · raw message

Signature · 1 line
2.7.4
#2 lore raw

PATCH 2/3 board: mscc: ocelot: Update MSCC Ocelot board.

In reply to Horatiu Vultur

Implement method board_phy_config to configure the phy for pcb120.

---
 board/mscc/ocelot/ocelot.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
board/mscc/ocelot/ocelot.c +15 -0
index 532d06f..bcae8fa 100644
@@ -11,6 +11,7 @@
 #include <spi.h>
 #include <led.h>
 #include <wait_bit.h>
+#include <miiphy.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -42,6 +43,20 @@ void mscc_switch_reset(bool enter)
 	mscc_gpio_set_alternate(19, 0);
 }
 
+int board_phy_config(struct phy_device *phydev)
+{
+	if (gd->board_type == BOARD_TYPE_PCB123)
+		return 0;
+
+	phy_write(phydev, 0, 31, 0x10);
+	phy_write(phydev, 0, 18, 0x80F0);
+	while (phy_read(phydev, 0, 18) & 0x8000)
+		;
+	phy_write(phydev, 0, 31, 0);
+
+	return 0;
+}
+
 void board_debug_uart_init(void)
 {
 	/* too early for the pinctrl driver, so configure the UART pins here */
Signature · 1 line
2.7.4
#3 lore raw

PATCH 3/3 net: mscc: ocelot: Update DTS for Ocelot pcb120.

In reply to Horatiu Vultur

Update device tree for ocelot to add support for ocelot pcb120.

---
 MAINTAINERS                            |   1 +
 arch/mips/dts/mscc,ocelot.dtsi         | 109 +++++++++++++--------------------
 arch/mips/dts/ocelot_pcb120.dts        |  75 +++++++++++++++++++++++
 arch/mips/dts/ocelot_pcb123.dts        |  44 +++++++++----
 include/dt-bindings/mscc/ocelot_data.h |  19 ++++++
 5 files changed, 167 insertions(+), 81 deletions(-)
 create mode 100644 include/dt-bindings/mscc/ocelot_data.h
MAINTAINERS +1 -0
index c77abba..a6e40be 100644
@@ -568,6 +568,7 @@ F:	configs/mscc*
 F:	drivers/gpio/mscc_sgpio.c
 F:	drivers/spi/mscc_bb_spi.c
 F:	include/configs/vcoreiii.h
+F:	include/dt-bindings/mscc/
 F:	drivers/pinctrl/mscc/
 F:	drivers/net/mscc_eswitch/
 
arch/mips/dts/mscc,ocelot.dtsi +41 -68

134 lines not on this page · raw message

arch/mips/dts/ocelot_pcb120.dts +75 -0

84 lines not on this page · raw message

arch/mips/dts/ocelot_pcb123.dts +31 -13

51 lines not on this page · raw message

include/dt-bindings/mscc/ocelot_data.h new file +19 -0
new file mode 100644
index 0000000..7a5a1bf
@@ -0,0 +1,19 @@
+/* SPDX-License-Identifier: (GPL-2.0+ OR MIT) */
+/*
+ * Copyright (c) 2019 Microsemi Corporation
+ */
+
+#ifndef _OCELOT_DATA_H_
+#define _OCELOT_DATA_H_
+
+#define SERDES1G(x)     (x)
+#define SERDES1G_MAX    SERDES1G(7)
+#define SERDES6G(x)     (SERDES1G_MAX + 1 + (x))
+#define SERDES6G_MAX    SERDES6G(11)
+#define SERDES_MAX      (SERDES6G_MAX + 1)
+
+/* similar with phy_interface_t */
+#define PHY_MODE_SGMII  2
+#define PHY_MODE_QSGMII 4
+
+#endif
Signature · 1 line
2.7.4