Linux-MIPS Archive on lore.kernel.org
 help / Atom feed
* [PATCH 0/5] MIPS: OCTEON: avoid board-specific stuff in ethernet code
@ 2019-02-04 22:41 Aaro Koskinen
  2019-02-04 22:41 ` [PATCH 1/5] MIPS: OCTEON: add fixed-link nodes to in-kernel device tree Aaro Koskinen
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Aaro Koskinen @ 2019-02-04 22:41 UTC (permalink / raw)
  To: linux-mips; +Cc: Aaro Koskinen

Hi,

A small series that deletes some board-specific Ethernet knowledge
from the generic OCTEON code and moves it into the DT.

A.

Aaro Koskinen (5):
  MIPS: OCTEON: add fixed-link nodes to in-kernel device tree
  MIPS: OCTEON: warn if deprecated link status is being used
  MIPS: OCTEON: don't lie about interface type of CN3005 board
  MIPS: OCTEON: delete board-specific link status
  MIPS: OCTEON: program rx/tx-delay always from DT

 .../boot/dts/cavium-octeon/octeon_3xxx.dts    | 14 +++
 .../mips/boot/dts/cavium-octeon/ubnt_e100.dts |  6 ++
 .../executive/cvmx-helper-board.c             | 86 ++-----------------
 .../cavium-octeon/executive/cvmx-helper.c     | 19 +---
 arch/mips/cavium-octeon/octeon-platform.c     | 64 ++++++++++++++
 .../include/asm/octeon/cvmx-helper-board.h    | 12 ---
 6 files changed, 91 insertions(+), 110 deletions(-)

-- 
2.17.0


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

* [PATCH 1/5] MIPS: OCTEON: add fixed-link nodes to in-kernel device tree
  2019-02-04 22:41 [PATCH 0/5] MIPS: OCTEON: avoid board-specific stuff in ethernet code Aaro Koskinen
@ 2019-02-04 22:41 ` Aaro Koskinen
  2019-02-04 22:41 ` [PATCH 2/5] MIPS: OCTEON: warn if deprecated link status is being used Aaro Koskinen
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Aaro Koskinen @ 2019-02-04 22:41 UTC (permalink / raw)
  To: linux-mips; +Cc: Aaro Koskinen

Currently OCTEON ethernet falls back to phyless operation on
boards where we have no known PHY address or a fixed-link node.
Add fixed-link support for boards that need it, so we can clean up
the platform code and ethernet driver from some legacy code.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
---
 .../boot/dts/cavium-octeon/octeon_3xxx.dts    |  8 +++++++
 arch/mips/cavium-octeon/octeon-platform.c     | 24 +++++++++++++++++++
 2 files changed, 32 insertions(+)

diff --git a/arch/mips/boot/dts/cavium-octeon/octeon_3xxx.dts b/arch/mips/boot/dts/cavium-octeon/octeon_3xxx.dts
index 0fa3dd1819ff..1c50cca4ea53 100644
--- a/arch/mips/boot/dts/cavium-octeon/octeon_3xxx.dts
+++ b/arch/mips/boot/dts/cavium-octeon/octeon_3xxx.dts
@@ -180,10 +180,18 @@
 				ethernet@0 {
 					phy-handle = <&phy2>;
 					cavium,alt-phy-handle = <&phy100>;
+					fixed-link {
+						speed = <1000>;
+						full-duplex;
+					};
 				};
 				ethernet@1 {
 					phy-handle = <&phy3>;
 					cavium,alt-phy-handle = <&phy101>;
+					fixed-link {
+						speed = <1000>;
+						full-duplex;
+					};
 				};
 				ethernet@2 {
 					phy-handle = <&phy4>;
diff --git a/arch/mips/cavium-octeon/octeon-platform.c b/arch/mips/cavium-octeon/octeon-platform.c
index 1f9ba60f7375..b4073750822d 100644
--- a/arch/mips/cavium-octeon/octeon-platform.c
+++ b/arch/mips/cavium-octeon/octeon-platform.c
@@ -458,6 +458,23 @@ static bool __init octeon_has_88e1145(void)
 	       !OCTEON_IS_MODEL(OCTEON_CN56XX);
 }
 
+static bool __init octeon_has_fixed_link(int ipd_port)
+{
+	switch (cvmx_sysinfo_get()->board_type) {
+	case CVMX_BOARD_TYPE_CN3005_EVB_HS5:
+	case CVMX_BOARD_TYPE_CN3010_EVB_HS5:
+	case CVMX_BOARD_TYPE_CN3020_EVB_HS5:
+	case CVMX_BOARD_TYPE_CUST_NB5:
+	case CVMX_BOARD_TYPE_EBH3100:
+		/* Port 1 on these boards is always gigabit. */
+		return ipd_port == 1;
+	case CVMX_BOARD_TYPE_BBGW_REF:
+		/* Ports 0 and 1 connect to the switch. */
+		return ipd_port == 0 || ipd_port == 1;
+	}
+	return false;
+}
+
 static void __init octeon_fdt_set_phy(int eth, int phy_addr)
 {
 	const __be32 *phy_handle;
@@ -592,6 +609,7 @@ static void __init octeon_fdt_pip_port(int iface, int i, int p, int max)
 	int eth;
 	int phy_addr;
 	int ipd_port;
+	int fixed_link;
 
 	snprintf(name_buffer, sizeof(name_buffer), "ethernet@%x", p);
 	eth = fdt_subnode_offset(initial_boot_params, iface, name_buffer);
@@ -609,6 +627,12 @@ static void __init octeon_fdt_pip_port(int iface, int i, int p, int max)
 
 	phy_addr = cvmx_helper_board_get_mii_address(ipd_port);
 	octeon_fdt_set_phy(eth, phy_addr);
+
+	fixed_link = fdt_subnode_offset(initial_boot_params, eth, "fixed-link");
+	if (fixed_link < 0)
+		WARN_ON(octeon_has_fixed_link(ipd_port));
+	else if (!octeon_has_fixed_link(ipd_port))
+		fdt_nop_node(initial_boot_params, fixed_link);
 }
 
 static void __init octeon_fdt_pip_iface(int pip, int idx)
-- 
2.17.0


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

* [PATCH 2/5] MIPS: OCTEON: warn if deprecated link status is being used
  2019-02-04 22:41 [PATCH 0/5] MIPS: OCTEON: avoid board-specific stuff in ethernet code Aaro Koskinen
  2019-02-04 22:41 ` [PATCH 1/5] MIPS: OCTEON: add fixed-link nodes to in-kernel device tree Aaro Koskinen
@ 2019-02-04 22:41 ` Aaro Koskinen
  2019-02-04 22:41 ` [PATCH 3/5] MIPS: OCTEON: don't lie about interface type of CN3005 board Aaro Koskinen
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Aaro Koskinen @ 2019-02-04 22:41 UTC (permalink / raw)
  To: linux-mips; +Cc: Aaro Koskinen

Warn if deprecated link status is being used.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
---
 arch/mips/cavium-octeon/executive/cvmx-helper-board.c | 4 ++++
 arch/mips/cavium-octeon/executive/cvmx-helper.c       | 2 ++
 2 files changed, 6 insertions(+)

diff --git a/arch/mips/cavium-octeon/executive/cvmx-helper-board.c b/arch/mips/cavium-octeon/executive/cvmx-helper-board.c
index ab8362e04461..46ea54ea73ea 100644
--- a/arch/mips/cavium-octeon/executive/cvmx-helper-board.c
+++ b/arch/mips/cavium-octeon/executive/cvmx-helper-board.c
@@ -31,6 +31,7 @@
  * network ports from the rest of the cvmx-helper files.
  */
 
+#include <linux/bug.h>
 #include <asm/octeon/octeon.h>
 #include <asm/octeon/cvmx-bootinfo.h>
 
@@ -210,6 +211,9 @@ cvmx_helper_link_info_t __cvmx_helper_board_link_get(int ipd_port)
 {
 	cvmx_helper_link_info_t result;
 
+	WARN(!octeon_is_simulation(),
+	     "Using deprecated link status - please update your DT");
+
 	/* Unless we fix it later, all links are defaulted to down */
 	result.u64 = 0;
 
diff --git a/arch/mips/cavium-octeon/executive/cvmx-helper.c b/arch/mips/cavium-octeon/executive/cvmx-helper.c
index 520c3bc66655..b695d134b60f 100644
--- a/arch/mips/cavium-octeon/executive/cvmx-helper.c
+++ b/arch/mips/cavium-octeon/executive/cvmx-helper.c
@@ -30,6 +30,7 @@
  * Helper functions for common, but complicated tasks.
  *
  */
+#include <linux/bug.h>
 #include <asm/octeon/octeon.h>
 
 #include <asm/octeon/cvmx-config.h>
@@ -1116,6 +1117,7 @@ cvmx_helper_link_info_t cvmx_helper_link_get(int ipd_port)
 		if (index == 0)
 			result = __cvmx_helper_rgmii_link_get(ipd_port);
 		else {
+			WARN(1, "Using deprecated link status - please update your DT");
 			result.s.full_duplex = 1;
 			result.s.link_up = 1;
 			result.s.speed = 1000;
-- 
2.17.0


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

* [PATCH 3/5] MIPS: OCTEON: don't lie about interface type of CN3005 board
  2019-02-04 22:41 [PATCH 0/5] MIPS: OCTEON: avoid board-specific stuff in ethernet code Aaro Koskinen
  2019-02-04 22:41 ` [PATCH 1/5] MIPS: OCTEON: add fixed-link nodes to in-kernel device tree Aaro Koskinen
  2019-02-04 22:41 ` [PATCH 2/5] MIPS: OCTEON: warn if deprecated link status is being used Aaro Koskinen
@ 2019-02-04 22:41 ` Aaro Koskinen
  2019-02-04 22:41 ` [PATCH 4/5] MIPS: OCTEON: delete board-specific link status Aaro Koskinen
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Aaro Koskinen @ 2019-02-04 22:41 UTC (permalink / raw)
  To: linux-mips; +Cc: Aaro Koskinen

The fixed-link node in the DT should now take care of the link status,
so this hack can be deleted.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
---
 arch/mips/cavium-octeon/executive/cvmx-helper.c | 16 ----------------
 1 file changed, 16 deletions(-)

diff --git a/arch/mips/cavium-octeon/executive/cvmx-helper.c b/arch/mips/cavium-octeon/executive/cvmx-helper.c
index b695d134b60f..151fd440a4b4 100644
--- a/arch/mips/cavium-octeon/executive/cvmx-helper.c
+++ b/arch/mips/cavium-octeon/executive/cvmx-helper.c
@@ -317,22 +317,6 @@ cvmx_helper_interface_mode_t cvmx_helper_interface_get_mode(int interface)
 			return CVMX_HELPER_INTERFACE_MODE_DISABLED;
 	}
 
-	if (interface == 0
-	    && cvmx_sysinfo_get()->board_type == CVMX_BOARD_TYPE_CN3005_EVB_HS5
-	    && cvmx_sysinfo_get()->board_rev_major == 1) {
-		/*
-		 * Lie about interface type of CN3005 board.  This
-		 * board has a switch on port 1 like the other
-		 * evaluation boards, but it is connected over RGMII
-		 * instead of GMII.  Report GMII mode so that the
-		 * speed is forced to 1 Gbit full duplex.  Other than
-		 * some initial configuration (which does not use the
-		 * output of this function) there is no difference in
-		 * setup between GMII and RGMII modes.
-		 */
-		return CVMX_HELPER_INTERFACE_MODE_GMII;
-	}
-
 	/* Interface 1 is always disabled on CN31XX and CN30XX */
 	if ((interface == 1)
 	    && (OCTEON_IS_MODEL(OCTEON_CN31XX) || OCTEON_IS_MODEL(OCTEON_CN30XX)
-- 
2.17.0


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

* [PATCH 4/5] MIPS: OCTEON: delete board-specific link status
  2019-02-04 22:41 [PATCH 0/5] MIPS: OCTEON: avoid board-specific stuff in ethernet code Aaro Koskinen
                   ` (2 preceding siblings ...)
  2019-02-04 22:41 ` [PATCH 3/5] MIPS: OCTEON: don't lie about interface type of CN3005 board Aaro Koskinen
@ 2019-02-04 22:41 ` Aaro Koskinen
  2019-02-04 22:41 ` [PATCH 5/5] MIPS: OCTEON: program rx/tx-delay always from DT Aaro Koskinen
  2019-02-08 18:03 ` [PATCH 0/5] MIPS: OCTEON: avoid board-specific stuff in ethernet code Paul Burton
  5 siblings, 0 replies; 7+ messages in thread
From: Aaro Koskinen @ 2019-02-04 22:41 UTC (permalink / raw)
  To: linux-mips; +Cc: Aaro Koskinen

Delete board-specific link status. This info should now come from
the DT only.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
---
 .../executive/cvmx-helper-board.c             | 43 +------------------
 1 file changed, 1 insertion(+), 42 deletions(-)

diff --git a/arch/mips/cavium-octeon/executive/cvmx-helper-board.c b/arch/mips/cavium-octeon/executive/cvmx-helper-board.c
index 46ea54ea73ea..634eae578ffe 100644
--- a/arch/mips/cavium-octeon/executive/cvmx-helper-board.c
+++ b/arch/mips/cavium-octeon/executive/cvmx-helper-board.c
@@ -217,53 +217,12 @@ cvmx_helper_link_info_t __cvmx_helper_board_link_get(int ipd_port)
 	/* Unless we fix it later, all links are defaulted to down */
 	result.u64 = 0;
 
-	/*
-	 * This switch statement should handle all ports that either don't use
-	 * Marvell PHYS, or don't support in-band status.
-	 */
-	switch (cvmx_sysinfo_get()->board_type) {
-	case CVMX_BOARD_TYPE_SIM:
+	if (octeon_is_simulation()) {
 		/* The simulator gives you a simulated 1Gbps full duplex link */
 		result.s.link_up = 1;
 		result.s.full_duplex = 1;
 		result.s.speed = 1000;
 		return result;
-	case CVMX_BOARD_TYPE_EBH3100:
-	case CVMX_BOARD_TYPE_CN3010_EVB_HS5:
-	case CVMX_BOARD_TYPE_CN3005_EVB_HS5:
-	case CVMX_BOARD_TYPE_CN3020_EVB_HS5:
-		/* Port 1 on these boards is always Gigabit */
-		if (ipd_port == 1) {
-			result.s.link_up = 1;
-			result.s.full_duplex = 1;
-			result.s.speed = 1000;
-			return result;
-		}
-		/* Fall through to the generic code below */
-		break;
-	case CVMX_BOARD_TYPE_CUST_NB5:
-		/* Port 1 on these boards is always Gigabit */
-		if (ipd_port == 1) {
-			result.s.link_up = 1;
-			result.s.full_duplex = 1;
-			result.s.speed = 1000;
-			return result;
-		}
-		break;
-	case CVMX_BOARD_TYPE_BBGW_REF:
-		/* Port 1 on these boards is always Gigabit */
-		if (ipd_port == 2) {
-			/* Port 2 is not hooked up */
-			result.u64 = 0;
-			return result;
-		} else {
-			/* Ports 0 and 1 connect to the switch */
-			result.s.link_up = 1;
-			result.s.full_duplex = 1;
-			result.s.speed = 1000;
-			return result;
-		}
-		break;
 	}
 
 	if (OCTEON_IS_MODEL(OCTEON_CN3XXX)
-- 
2.17.0


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

* [PATCH 5/5] MIPS: OCTEON: program rx/tx-delay always from DT
  2019-02-04 22:41 [PATCH 0/5] MIPS: OCTEON: avoid board-specific stuff in ethernet code Aaro Koskinen
                   ` (3 preceding siblings ...)
  2019-02-04 22:41 ` [PATCH 4/5] MIPS: OCTEON: delete board-specific link status Aaro Koskinen
@ 2019-02-04 22:41 ` Aaro Koskinen
  2019-02-08 18:03 ` [PATCH 0/5] MIPS: OCTEON: avoid board-specific stuff in ethernet code Paul Burton
  5 siblings, 0 replies; 7+ messages in thread
From: Aaro Koskinen @ 2019-02-04 22:41 UTC (permalink / raw)
  To: linux-mips; +Cc: Aaro Koskinen

Program rx/tx-delay always from DT.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
---
 .../boot/dts/cavium-octeon/octeon_3xxx.dts    |  6 +++
 .../mips/boot/dts/cavium-octeon/ubnt_e100.dts |  6 +++
 .../executive/cvmx-helper-board.c             | 39 ------------------
 .../cavium-octeon/executive/cvmx-helper.c     |  1 -
 arch/mips/cavium-octeon/octeon-platform.c     | 40 +++++++++++++++++++
 .../include/asm/octeon/cvmx-helper-board.h    | 12 ------
 6 files changed, 52 insertions(+), 52 deletions(-)

diff --git a/arch/mips/boot/dts/cavium-octeon/octeon_3xxx.dts b/arch/mips/boot/dts/cavium-octeon/octeon_3xxx.dts
index 1c50cca4ea53..dda0559cef50 100644
--- a/arch/mips/boot/dts/cavium-octeon/octeon_3xxx.dts
+++ b/arch/mips/boot/dts/cavium-octeon/octeon_3xxx.dts
@@ -180,6 +180,8 @@
 				ethernet@0 {
 					phy-handle = <&phy2>;
 					cavium,alt-phy-handle = <&phy100>;
+					rx-delay = <0>;
+					tx-delay = <0>;
 					fixed-link {
 						speed = <1000>;
 						full-duplex;
@@ -188,6 +190,8 @@
 				ethernet@1 {
 					phy-handle = <&phy3>;
 					cavium,alt-phy-handle = <&phy101>;
+					rx-delay = <0>;
+					tx-delay = <0>;
 					fixed-link {
 						speed = <1000>;
 						full-duplex;
@@ -196,6 +200,8 @@
 				ethernet@2 {
 					phy-handle = <&phy4>;
 					cavium,alt-phy-handle = <&phy102>;
+					rx-delay = <0>;
+					tx-delay = <0>;
 				};
 				ethernet@3 {
 					compatible = "cavium,octeon-3860-pip-port";
diff --git a/arch/mips/boot/dts/cavium-octeon/ubnt_e100.dts b/arch/mips/boot/dts/cavium-octeon/ubnt_e100.dts
index 243e5dc444fb..962f37fbc7db 100644
--- a/arch/mips/boot/dts/cavium-octeon/ubnt_e100.dts
+++ b/arch/mips/boot/dts/cavium-octeon/ubnt_e100.dts
@@ -33,12 +33,18 @@
 			interface@0 {
 				ethernet@0 {
 					phy-handle = <&phy7>;
+					rx-delay = <0>;
+					tx-delay = <0x10>;
 				};
 				ethernet@1 {
 					phy-handle = <&phy6>;
+					rx-delay = <0>;
+					tx-delay = <0x10>;
 				};
 				ethernet@2 {
 					phy-handle = <&phy5>;
+					rx-delay = <0>;
+					tx-delay = <0x10>;
 				};
 			};
 		};
diff --git a/arch/mips/cavium-octeon/executive/cvmx-helper-board.c b/arch/mips/cavium-octeon/executive/cvmx-helper-board.c
index 634eae578ffe..2e2d45bc850d 100644
--- a/arch/mips/cavium-octeon/executive/cvmx-helper-board.c
+++ b/arch/mips/cavium-octeon/executive/cvmx-helper-board.c
@@ -320,45 +320,6 @@ int __cvmx_helper_board_interface_probe(int interface, int supported_ports)
 	return supported_ports;
 }
 
-/**
- * Enable packet input/output from the hardware. This function is
- * called after by cvmx_helper_packet_hardware_enable() to
- * perform board specific initialization. For most boards
- * nothing is needed.
- *
- * @interface: Interface to enable
- *
- * Returns Zero on success, negative on failure
- */
-int __cvmx_helper_board_hardware_enable(int interface)
-{
-	if (cvmx_sysinfo_get()->board_type == CVMX_BOARD_TYPE_CN3005_EVB_HS5) {
-		if (interface == 0) {
-			/* Different config for switch port */
-			cvmx_write_csr(CVMX_ASXX_TX_CLK_SETX(1, interface), 0);
-			cvmx_write_csr(CVMX_ASXX_RX_CLK_SETX(1, interface), 0);
-			/*
-			 * Boards with gigabit WAN ports need a
-			 * different setting that is compatible with
-			 * 100 Mbit settings
-			 */
-			cvmx_write_csr(CVMX_ASXX_TX_CLK_SETX(0, interface),
-				       0xc);
-			cvmx_write_csr(CVMX_ASXX_RX_CLK_SETX(0, interface),
-				       0xc);
-		}
-	} else if (cvmx_sysinfo_get()->board_type ==
-			CVMX_BOARD_TYPE_UBNT_E100) {
-		cvmx_write_csr(CVMX_ASXX_RX_CLK_SETX(0, interface), 0);
-		cvmx_write_csr(CVMX_ASXX_TX_CLK_SETX(0, interface), 0x10);
-		cvmx_write_csr(CVMX_ASXX_RX_CLK_SETX(1, interface), 0);
-		cvmx_write_csr(CVMX_ASXX_TX_CLK_SETX(1, interface), 0x10);
-		cvmx_write_csr(CVMX_ASXX_RX_CLK_SETX(2, interface), 0);
-		cvmx_write_csr(CVMX_ASXX_TX_CLK_SETX(2, interface), 0x10);
-	}
-	return 0;
-}
-
 /**
  * Get the clock type used for the USB block based on board type.
  * Used by the USB code for auto configuration of clock type.
diff --git a/arch/mips/cavium-octeon/executive/cvmx-helper.c b/arch/mips/cavium-octeon/executive/cvmx-helper.c
index 151fd440a4b4..de391541d6f7 100644
--- a/arch/mips/cavium-octeon/executive/cvmx-helper.c
+++ b/arch/mips/cavium-octeon/executive/cvmx-helper.c
@@ -762,7 +762,6 @@ static int __cvmx_helper_packet_hardware_enable(int interface)
 		result = __cvmx_helper_loop_enable(interface);
 		break;
 	}
-	result |= __cvmx_helper_board_hardware_enable(interface);
 	return result;
 }
 
diff --git a/arch/mips/cavium-octeon/octeon-platform.c b/arch/mips/cavium-octeon/octeon-platform.c
index b4073750822d..51685f893eab 100644
--- a/arch/mips/cavium-octeon/octeon-platform.c
+++ b/arch/mips/cavium-octeon/octeon-platform.c
@@ -603,6 +603,45 @@ static void __init octeon_fdt_rm_ethernet(int node)
 	fdt_nop_node(initial_boot_params, node);
 }
 
+static void __init _octeon_rx_tx_delay(int eth, int rx_delay, int tx_delay)
+{
+	fdt_setprop_inplace_cell(initial_boot_params, eth, "rx-delay",
+				 rx_delay);
+	fdt_setprop_inplace_cell(initial_boot_params, eth, "tx-delay",
+				 tx_delay);
+}
+
+static void __init octeon_rx_tx_delay(int eth, int iface, int port)
+{
+	switch (cvmx_sysinfo_get()->board_type) {
+	case CVMX_BOARD_TYPE_CN3005_EVB_HS5:
+		if (iface == 0) {
+			if (port == 0) {
+				/*
+				 * Boards with gigabit WAN ports need a
+				 * different setting that is compatible with
+				 * 100 Mbit settings
+				 */
+				_octeon_rx_tx_delay(eth, 0xc, 0x0c);
+				return;
+			} else if (port == 1) {
+				/* Different config for switch port. */
+				_octeon_rx_tx_delay(eth, 0x0, 0x0);
+				return;
+			}
+		}
+		break;
+	case CVMX_BOARD_TYPE_UBNT_E100:
+		if (iface == 0 && port <= 2) {
+			_octeon_rx_tx_delay(eth, 0x0, 0x10);
+			return;
+		}
+		break;
+	}
+	fdt_nop_property(initial_boot_params, eth, "rx-delay");
+	fdt_nop_property(initial_boot_params, eth, "tx-delay");
+}
+
 static void __init octeon_fdt_pip_port(int iface, int i, int p, int max)
 {
 	char name_buffer[20];
@@ -633,6 +672,7 @@ static void __init octeon_fdt_pip_port(int iface, int i, int p, int max)
 		WARN_ON(octeon_has_fixed_link(ipd_port));
 	else if (!octeon_has_fixed_link(ipd_port))
 		fdt_nop_node(initial_boot_params, fixed_link);
+	octeon_rx_tx_delay(eth, i, p);
 }
 
 static void __init octeon_fdt_pip_iface(int pip, int idx)
diff --git a/arch/mips/include/asm/octeon/cvmx-helper-board.h b/arch/mips/include/asm/octeon/cvmx-helper-board.h
index b4d19c21b62c..d7fdcf0a0088 100644
--- a/arch/mips/include/asm/octeon/cvmx-helper-board.h
+++ b/arch/mips/include/asm/octeon/cvmx-helper-board.h
@@ -119,18 +119,6 @@ extern cvmx_helper_link_info_t __cvmx_helper_board_link_get(int ipd_port);
 extern int __cvmx_helper_board_interface_probe(int interface,
 					       int supported_ports);
 
-/**
- * Enable packet input/output from the hardware. This function is
- * called after by cvmx_helper_packet_hardware_enable() to
- * perform board specific initialization. For most boards
- * nothing is needed.
- *
- * @interface: Interface to enable
- *
- * Returns Zero on success, negative on failure
- */
-extern int __cvmx_helper_board_hardware_enable(int interface);
-
 enum cvmx_helper_board_usb_clock_types __cvmx_helper_board_usb_get_clock_type(void);
 
 #endif /* __CVMX_HELPER_BOARD_H__ */
-- 
2.17.0


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

* Re: [PATCH 0/5] MIPS: OCTEON: avoid board-specific stuff in ethernet code
  2019-02-04 22:41 [PATCH 0/5] MIPS: OCTEON: avoid board-specific stuff in ethernet code Aaro Koskinen
                   ` (4 preceding siblings ...)
  2019-02-04 22:41 ` [PATCH 5/5] MIPS: OCTEON: program rx/tx-delay always from DT Aaro Koskinen
@ 2019-02-08 18:03 ` Paul Burton
  5 siblings, 0 replies; 7+ messages in thread
From: Paul Burton @ 2019-02-08 18:03 UTC (permalink / raw)
  To: Aaro Koskinen; +Cc: linux-mips, Aaro Koskinen, linux-mips

Hello,

Aaro Koskinen wrote:
> Hi,
> 
> A small series that deletes some board-specific Ethernet knowledge
> from the generic OCTEON code and moves it into the DT.
> 
> A.
> 
> Aaro Koskinen (5):
> MIPS: OCTEON: add fixed-link nodes to in-kernel device tree
> MIPS: OCTEON: warn if deprecated link status is being used
> MIPS: OCTEON: don't lie about interface type of CN3005 board
> MIPS: OCTEON: delete board-specific link status
> MIPS: OCTEON: program rx/tx-delay always from DT
> 
> .../boot/dts/cavium-octeon/octeon_3xxx.dts    | 14 +++
> .../mips/boot/dts/cavium-octeon/ubnt_e100.dts |  6 ++
> .../executive/cvmx-helper-board.c             | 86 ++-----------------
> .../cavium-octeon/executive/cvmx-helper.c     | 19 +---
> arch/mips/cavium-octeon/octeon-platform.c     | 64 ++++++++++++++
> .../include/asm/octeon/cvmx-helper-board.h    | 12 ---
> 6 files changed, 91 insertions(+), 110 deletions(-)

Series applied to mips-next.

Thanks,
    Paul

[ This message was auto-generated; if you believe anything is incorrect
  then please email paul.burton@mips.com to report it. ]

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

end of thread, back to index

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-04 22:41 [PATCH 0/5] MIPS: OCTEON: avoid board-specific stuff in ethernet code Aaro Koskinen
2019-02-04 22:41 ` [PATCH 1/5] MIPS: OCTEON: add fixed-link nodes to in-kernel device tree Aaro Koskinen
2019-02-04 22:41 ` [PATCH 2/5] MIPS: OCTEON: warn if deprecated link status is being used Aaro Koskinen
2019-02-04 22:41 ` [PATCH 3/5] MIPS: OCTEON: don't lie about interface type of CN3005 board Aaro Koskinen
2019-02-04 22:41 ` [PATCH 4/5] MIPS: OCTEON: delete board-specific link status Aaro Koskinen
2019-02-04 22:41 ` [PATCH 5/5] MIPS: OCTEON: program rx/tx-delay always from DT Aaro Koskinen
2019-02-08 18:03 ` [PATCH 0/5] MIPS: OCTEON: avoid board-specific stuff in ethernet code Paul Burton

Linux-MIPS Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-mips/0 linux-mips/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-mips linux-mips/ https://lore.kernel.org/linux-mips \
		linux-mips@vger.kernel.org linux-mips@archiver.kernel.org
	public-inbox-index linux-mips


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-mips


AGPL code for this site: git clone https://public-inbox.org/ public-inbox