From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 638BBA00C3; Mon, 15 Aug 2022 01:23:49 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 407EA42BDD; Mon, 15 Aug 2022 01:22:43 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id 2B75842BA0 for ; Mon, 15 Aug 2022 01:22:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1660519361; x=1692055361; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=qg3AI03dnIQcE4IF1lvqfWibLFzoxTCOhtNztpmUrMs=; b=E5mpV2jCjsKV0A914wQETfenorL74Dvpt0b22m7p0qAk6cdiTopXa0sE JGXaWA7gIkQy6Pj5s7oLMqpCrtrb+YS0QaxOG9ssiogXjIvkczcZJUoC8 tac6SCosDZ1ltcytOPFBsVMxInYiwOkoTKFahqI18W7Go+9AD0gl7mB6D 7nHnuRDGqWIlmJckYlYEq9op0wass1UH7OIz1xlX1zw8oopbpEIMFuxnG kGUH0FN39qwODRb55laEYkwxIhqy94sU9uzaNO5F0c+FScCzDz7NiGgN1 a0rZ5eK9qcbJu+Sssd4i8rAU9KFTEi8Uyj8ZcaEncDyNLMKi6ZSPN8fYT w==; X-IronPort-AV: E=McAfee;i="6400,9594,10439"; a="291857937" X-IronPort-AV: E=Sophos;i="5.93,237,1654585200"; d="scan'208";a="291857937" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Aug 2022 16:22:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,237,1654585200"; d="scan'208";a="635283064" Received: from dpdk-qzhan15-test02.sh.intel.com ([10.67.115.4]) by orsmga008.jf.intel.com with ESMTP; 14 Aug 2022 16:22:39 -0700 From: Qi Zhang To: qiming.yang@intel.com Cc: dev@dpdk.org, Qi Zhang , Sergey Temerkhanov Subject: [PATCH v2 16/70] net/ice/base: implement 56G PHY setup functions Date: Mon, 15 Aug 2022 03:31:12 -0400 Message-Id: <20220815073206.2917968-17-qi.z.zhang@intel.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220815073206.2917968-1-qi.z.zhang@intel.com> References: <20220815071306.2910599-1-qi.z.zhang@intel.com> <20220815073206.2917968-1-qi.z.zhang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Implement setup functions for the 56G PHY Simics model Signed-off-by: Sergey Temerkhanov Signed-off-by: Qi Zhang --- drivers/net/ice/base/ice_ptp_hw.c | 29 +++++++++++++++++++++++++++++ drivers/net/ice/base/ice_ptp_hw.h | 2 ++ 2 files changed, 31 insertions(+) diff --git a/drivers/net/ice/base/ice_ptp_hw.c b/drivers/net/ice/base/ice_ptp_hw.c index 1c5fd799f6..093331331d 100644 --- a/drivers/net/ice/base/ice_ptp_hw.c +++ b/drivers/net/ice/base/ice_ptp_hw.c @@ -1363,6 +1363,35 @@ ice_ptp_read_tx_hwtstamp_status_eth56g(struct ice_hw *hw, u32 *ts_status) return ICE_SUCCESS; } +/** + * ice_ptp_init_phy_cfg - Get the current TX timestamp status + * mask. Returns the mask of ports where TX timestamps are available + * @hw: pointer to the HW struct + */ +enum ice_status +ice_ptp_init_phy_cfg(struct ice_hw *hw) +{ + enum ice_status status; + u32 phy_rev; + + status = ice_read_phy_eth56g_raw_lp(hw, PHY_REG_REVISION, &phy_rev, + true); + if (status) + return status; + + if (phy_rev == PHY_REVISION_ETH56G) { + hw->phy_cfg = ICE_PHY_ETH56G; + return ICE_SUCCESS; + } + + if (ice_is_e810(hw)) + hw->phy_cfg = ICE_PHY_E810; + else + hw->phy_cfg = ICE_PHY_E822; + + return ICE_SUCCESS; +} + /* ---------------------------------------------------------------------------- * E822 family functions * diff --git a/drivers/net/ice/base/ice_ptp_hw.h b/drivers/net/ice/base/ice_ptp_hw.h index a030a9d4ed..1e016ef177 100644 --- a/drivers/net/ice/base/ice_ptp_hw.h +++ b/drivers/net/ice/base/ice_ptp_hw.h @@ -266,6 +266,8 @@ ice_start_phy_timer_eth56g(struct ice_hw *hw, u8 port, bool bypass); enum ice_status ice_phy_cfg_tx_offset_eth56g(struct ice_hw *hw, u8 port); enum ice_status ice_phy_cfg_rx_offset_eth56g(struct ice_hw *hw, u8 port); +enum ice_status ice_ptp_init_phy_cfg(struct ice_hw *hw); + #define PFTSYN_SEM_BYTES 4 #define ICE_PTP_CLOCK_INDEX_0 0x00 -- 2.31.1