From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id B37695A40 for ; Fri, 5 Jun 2015 07:22:25 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP; 04 Jun 2015 22:22:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,556,1427785200"; d="scan'208";a="705714594" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by orsmga001.jf.intel.com with ESMTP; 04 Jun 2015 22:22:26 -0700 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id t555MNSP032518; Fri, 5 Jun 2015 13:22:23 +0800 Received: from shecgisg004.sh.intel.com (localhost [127.0.0.1]) by shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id t555MK0J024351; Fri, 5 Jun 2015 13:22:22 +0800 Received: (from wenzhuol@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t555MKsI024347; Fri, 5 Jun 2015 13:22:20 +0800 From: Wenzhuo Lu To: dev@dpdk.org Date: Fri, 5 Jun 2015 13:21:41 +0800 Message-Id: <1433481718-24253-10-git-send-email-wenzhuo.lu@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1433481718-24253-1-git-send-email-wenzhuo.lu@intel.com> References: <1433481718-24253-1-git-send-email-wenzhuo.lu@intel.com> Subject: [dpdk-dev] [PATCH 09/26] ixgbe/base: issue firmware command when coming up X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jun 2015 05:22:26 -0000 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 --- 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