All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark D Rustad <mark.d.rustad@intel.com>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [PATCH V5 07/11] ixgbe: Introduce function to control MDIO speed
Date: Fri, 01 Apr 2016 12:18:30 -0700	[thread overview]
Message-ID: <20160401191830.120975.11300.stgit@mdrustad-wks.jf.intel.com> (raw)
In-Reply-To: <20160401191701.120975.34684.stgit@mdrustad-wks.jf.intel.com>

Move code that controls MDIO speed into a new function because
there will be more MACs that need the control.

Signed-off-by: Mark Rustad <mark.d.rustad@intel.com>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c |   27 +++++++++++++++++++------
 1 file changed, 21 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c
index ec06dd4f9804..8a6579feaf08 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c
@@ -2306,6 +2306,26 @@ static s32 ixgbe_init_ext_t_x550em(struct ixgbe_hw *hw)
 	return status;
 }
 
+/**
+ * ixgbe_set_mdio_speed - Set MDIO clock speed
+ * @hw: pointer to hardware structure
+ */
+static void ixgbe_set_mdio_speed(struct ixgbe_hw *hw)
+{
+	u32 hlreg0;
+
+	switch (hw->device_id) {
+	case IXGBE_DEV_ID_X550EM_X_10G_T:
+		/* Config MDIO clock speed before the first MDIO PHY access */
+		hlreg0 = IXGBE_READ_REG(hw, IXGBE_HLREG0);
+		hlreg0 &= ~IXGBE_HLREG0_MDCSPD;
+		IXGBE_WRITE_REG(hw, IXGBE_HLREG0, hlreg0);
+		break;
+	default:
+		break;
+	}
+}
+
 /**  ixgbe_reset_hw_X550em - Perform hardware reset
  **  @hw: pointer to hardware structure
  **
@@ -2319,7 +2339,6 @@ static s32 ixgbe_reset_hw_X550em(struct ixgbe_hw *hw)
 	s32 status;
 	u32 ctrl = 0;
 	u32 i;
-	u32 hlreg0;
 	bool link_up = false;
 
 	/* Call adapter stop to disable Tx/Rx and clear interrupts */
@@ -2405,11 +2424,7 @@ mac_reset_top:
 	hw->mac.num_rar_entries = 128;
 	hw->mac.ops.init_rx_addrs(hw);
 
-	if (hw->device_id == IXGBE_DEV_ID_X550EM_X_10G_T) {
-		hlreg0 = IXGBE_READ_REG(hw, IXGBE_HLREG0);
-		hlreg0 &= ~IXGBE_HLREG0_MDCSPD;
-		IXGBE_WRITE_REG(hw, IXGBE_HLREG0, hlreg0);
-	}
+	ixgbe_set_mdio_speed(hw);
 
 	if (hw->device_id == IXGBE_DEV_ID_X550EM_X_SFP)
 		ixgbe_setup_mux_ctl(hw);


  parent reply	other threads:[~2016-04-01 19:18 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-01 19:17 [Intel-wired-lan] [PATCH V5 00/11] ixgbe: Add support for x550em_a MAC Mark D Rustad
2016-04-01 19:17 ` [Intel-wired-lan] [PATCH V5 01/11] ixgbe: Add definitions for x550em_a 10G MAC Mark D Rustad
2016-04-06 16:00   ` Bowers, AndrewX
2016-04-01 19:18 ` [Intel-wired-lan] [PATCH V5 02/11] ixgbe: Use method pointer to access IOSF devices Mark D Rustad
2016-04-04 19:15   ` Bowers, AndrewX
2016-04-06 16:29   ` Bowers, AndrewX
2016-04-01 19:18 ` [Intel-wired-lan] [PATCH V5 03/11] ixgbe: Add support for x550em_a 10G MAC type Mark D Rustad
2016-04-06 16:33   ` Bowers, AndrewX
2016-04-01 19:18 ` [Intel-wired-lan] [PATCH V5 04/11] ixgbe: Use new methods for PHY access Mark D Rustad
2016-04-06 16:37   ` Bowers, AndrewX
2016-04-01 19:18 ` [Intel-wired-lan] [PATCH V5 05/11] ixgbe: Read and set instance id Mark D Rustad
2016-04-06 18:35   ` Bowers, AndrewX
2016-04-01 19:18 ` [Intel-wired-lan] [PATCH V5 06/11] ixgbe: Read and parse NW_MNG_IF_SEL register Mark D Rustad
2016-04-06 18:36   ` Bowers, AndrewX
2016-04-01 19:18 ` Mark D Rustad [this message]
2016-04-06 18:36   ` [Intel-wired-lan] [PATCH V5 07/11] ixgbe: Introduce function to control MDIO speed Bowers, AndrewX
2016-04-01 19:18 ` [Intel-wired-lan] [PATCH V5 08/11] ixgbe: Add support for SFPs with retimer Mark D Rustad
2016-04-06 18:38   ` Bowers, AndrewX
2016-04-01 19:18 ` [Intel-wired-lan] [PATCH V5 09/11] ixgbe: Add support for SGMII backplane interface Mark D Rustad
2016-04-01 19:18 ` [Intel-wired-lan] [PATCH V5 10/11] ixgbe: Add KR backplane support for x550em_a Mark D Rustad
2016-04-01 19:18 ` [Intel-wired-lan] [PATCH V5 11/11] ixgbe: Bump version number Mark D Rustad
2016-04-04 22:56   ` Bowers, AndrewX

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160401191830.120975.11300.stgit@mdrustad-wks.jf.intel.com \
    --to=mark.d.rustad@intel.com \
    --cc=intel-wired-lan@osuosl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.