DPDK patches and discussions
 help / color / mirror / Atom feed
From: Wenzhuo Lu <wenzhuo.lu@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH 09/26] ixgbe/base: issue firmware command when coming up
Date: Fri,  5 Jun 2015 13:21:41 +0800	[thread overview]
Message-ID: <1433481718-24253-10-git-send-email-wenzhuo.lu@intel.com> (raw)
In-Reply-To: <1433481718-24253-1-git-send-email-wenzhuo.lu@intel.com>

The driver now needs to issue a firmware command to inform the
firmware that a driver is coming up. This prevents the possibility
of the firmware and the driver configuring the PHY at the same
time. Upon completion of the command, the firmware will no longer
be configuring the PHY.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
---
 drivers/net/ixgbe/base/ixgbe_type.h |  2 ++
 drivers/net/ixgbe/base/ixgbe_x550.c | 17 +++++++++++++++++
 2 files changed, 19 insertions(+)

diff --git a/drivers/net/ixgbe/base/ixgbe_type.h b/drivers/net/ixgbe/base/ixgbe_type.h
index 0e4f312..4e38f53 100644
--- a/drivers/net/ixgbe/base/ixgbe_type.h
+++ b/drivers/net/ixgbe/base/ixgbe_type.h
@@ -2798,6 +2798,7 @@ enum ixgbe_fdir_pballoc_type {
 #define IXGBE_HI_FLASH_ERASE_TIMEOUT	1000 /* Process Erase command limit */
 #define IXGBE_HI_FLASH_UPDATE_TIMEOUT	5000 /* Process Update command limit */
 #define IXGBE_HI_FLASH_APPLY_TIMEOUT	0 /* Process Apply command limit */
+#define IXGBE_HI_PHY_MGMT_REQ_TIMEOUT	2000 /* Wait up to 2 seconds */
 
 /* CEM Support */
 #define FW_CEM_HDR_LEN			0x4
@@ -2818,6 +2819,7 @@ enum ixgbe_fdir_pballoc_type {
 #define FW_MAX_READ_BUFFER_SIZE		1024
 #define FW_DISABLE_RXEN_CMD		0xDE
 #define FW_DISABLE_RXEN_LEN		0x1
+#define FW_PHY_MGMT_REQ_CMD		0x20
 /* Host Interface Command Structures */
 
 struct ixgbe_hic_hdr {
diff --git a/drivers/net/ixgbe/base/ixgbe_x550.c b/drivers/net/ixgbe/base/ixgbe_x550.c
index 4664583..0ce1c85 100644
--- a/drivers/net/ixgbe/base/ixgbe_x550.c
+++ b/drivers/net/ixgbe/base/ixgbe_x550.c
@@ -972,6 +972,7 @@ s32 ixgbe_init_phy_ops_X550em(struct ixgbe_hw *hw)
  */
 s32 ixgbe_reset_hw_X550em(struct ixgbe_hw *hw)
 {
+	struct ixgbe_hic_hdr fw_cmd;
 	ixgbe_link_speed link_speed;
 	s32 status;
 	u32 ctrl = 0;
@@ -980,6 +981,22 @@ s32 ixgbe_reset_hw_X550em(struct ixgbe_hw *hw)
 
 	DEBUGFUNC("ixgbe_reset_hw_X550em");
 
+	fw_cmd.cmd = FW_PHY_MGMT_REQ_CMD;
+	fw_cmd.buf_len = 0;
+	fw_cmd.cmd_or_resp.cmd_resv = 0;
+	fw_cmd.checksum = FW_DEFAULT_CHECKSUM;
+	status = ixgbe_host_interface_command(hw, (u32 *)&fw_cmd,
+					      sizeof(fw_cmd),
+					      IXGBE_HI_PHY_MGMT_REQ_TIMEOUT,
+					      true);
+	if (status)
+		ERROR_REPORT2(IXGBE_ERROR_CAUTION,
+			      "PHY mgmt command failed with %d\n", status);
+	else if (fw_cmd.cmd_or_resp.ret_status != FW_CEM_RESP_STATUS_SUCCESS)
+		ERROR_REPORT2(IXGBE_ERROR_CAUTION,
+			      "PHY mgmt command returned %d\n",
+			      fw_cmd.cmd_or_resp.ret_status);
+
 	/* Call adapter stop to disable Tx/Rx and clear interrupts */
 	status = hw->mac.ops.stop_adapter(hw);
 	if (status != IXGBE_SUCCESS)
-- 
1.9.3

  parent reply	other threads:[~2015-06-05  5:22 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-05  5:21 [dpdk-dev] [PATCH 00/26] update ixgbe base driver Wenzhuo Lu
2015-06-05  5:21 ` [dpdk-dev] [PATCH 01/26] ixgbe/base: update copyright and readme Wenzhuo Lu
2015-06-05  5:21 ` [dpdk-dev] [PATCH 02/26] ixgbe/base: fix code comment, double from Wenzhuo Lu
2015-06-05  5:21 ` [dpdk-dev] [PATCH 03/26] ixgbe/base: fix typo error in code comment Wenzhuo Lu
2015-06-05  5:21 ` [dpdk-dev] [PATCH 04/26] ixgbe/base: check return value after calling Wenzhuo Lu
2015-06-05  5:21 ` [dpdk-dev] [PATCH 05/26] ixgbe/base: allow tunneled UDP and TCP frames to reach their destination Wenzhuo Lu
2015-06-05  5:21 ` [dpdk-dev] [PATCH 06/26] ixgbe/base: erase ixgbe_get_hi_status Wenzhuo Lu
2015-06-05  5:21 ` [dpdk-dev] [PATCH 07/26] ixgbe/base: provide unlocked I2C methods Wenzhuo Lu
2015-06-05  5:21 ` [dpdk-dev] [PATCH 08/26] ixgbe/base: reduce I2C retry count on X550 devices Wenzhuo Lu
2015-06-05  5:21 ` Wenzhuo Lu [this message]
2015-06-05  5:21 ` [dpdk-dev] [PATCH 10/26] ixgbe/base: add logic to reset CS4227 when needed Wenzhuo Lu
2015-06-05  5:21 ` [dpdk-dev] [PATCH 11/26] ixgbe/base: restore ESDP settings after MAC reset Wenzhuo Lu
2015-06-05  5:21 ` [dpdk-dev] [PATCH 12/26] ixgbe/base: disable FEC(Forward Error Correction) to save power Wenzhuo Lu
2015-06-05  5:21 ` [dpdk-dev] [PATCH 13/26] ixgbe/base: set lan_id for non-PCIe devices Wenzhuo Lu
2015-06-05  5:21 ` [dpdk-dev] [PATCH 14/26] ixgbe/base: add SFP+ dual-speed support Wenzhuo Lu
2015-06-05  5:21 ` [dpdk-dev] [PATCH 15/26] ixgbe/base: add SW based LPLU support Wenzhuo Lu
2015-06-05  5:21 ` [dpdk-dev] [PATCH 16/26] ixgbe/base: fix flow control for KR backplane Wenzhuo Lu
2015-06-05  5:21 ` [dpdk-dev] [PATCH 17/26] ixgbe/base: new simplified x550em init flow Wenzhuo Lu
2015-06-05  5:21 ` [dpdk-dev] [PATCH 18/26] ixgbe/base: move I2C MUX function from ixgbe_x540.c to ixgbe_x550.c Wenzhuo Lu
2015-06-05  5:21 ` [dpdk-dev] [PATCH 19/26] ixgbe/base: change return value for ixgbe_setup_internal_phy_t_x550em Wenzhuo Lu
2015-06-05  5:21 ` [dpdk-dev] [PATCH 20/26] ixgbe/base: ixgbe_setup_internal_phy_x550em function clean-up Wenzhuo Lu
2015-06-05  5:21 ` [dpdk-dev] [PATCH 21/26] ixgbe/base: add x550em Auto neg Flow Control support Wenzhuo Lu
2015-06-05  5:21 ` [dpdk-dev] [PATCH 22/26] ixgbe/base: add x550em PHY interrupt and forced 1G/10G support Wenzhuo Lu
2015-06-05  5:21 ` [dpdk-dev] [PATCH 23/26] ixgbe/base: add link check support for x550em PHY Wenzhuo Lu
2015-06-05  5:21 ` [dpdk-dev] [PATCH 24/26] ixgbe/base: set lan_id before first I2C access Wenzhuo Lu
2015-06-05  5:21 ` [dpdk-dev] [PATCH 25/26] ixgbe/base: added x550em PHY reset function Wenzhuo Lu
2015-06-05  5:21 ` [dpdk-dev] [PATCH 26/26] ixgbe/base: block EEE(Energy Efficient Ethernet) setup on the interfaces that don't support EEE Wenzhuo Lu
2015-06-09  4:10 ` [dpdk-dev] [PATCH 00/26] update ixgbe base driver Zhang, Helin
2015-06-15 20:49   ` Thomas Monjalon

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=1433481718-24253-10-git-send-email-wenzhuo.lu@intel.com \
    --to=wenzhuo.lu@intel.com \
    --cc=dev@dpdk.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).