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 564BF4404F; Wed, 12 Jun 2024 17:22:56 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2CEEF43257; Wed, 12 Jun 2024 17:06:41 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) by mails.dpdk.org (Postfix) with ESMTP id 9FABF43036 for ; Wed, 12 Jun 2024 17:06:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1718204799; x=1749740799; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Rag0i8VhYYtnCBmJcgBR1LabmSVMTQc0rdyZLWkR8jk=; b=lcg5m49nqzaf5imzKzaC8VkoVE0IIEem2uDwe3Mv5526WSRC23Iut5i/ ZbTFW8fcIfdNFI/c7+SebjPPsnX+7+ROJXYYfUm8YgATclKKVpLiGm+is /7fut545y4W1hKtVrOhH6uYreCmoU2ih8vPvTodeGe9zzEkmPn6QvKpKB e9ZBMWX6yjxKHucFyhw0rPhxOEgfB3HsWFG65wMXb8ZxuSj3+H9uLV5H5 niMgHi1Px4H5NJmOf8dCvQHFh/exTbvDamw/VGIXpIbC/POG85Xm36ujR wm3K22vE+eXuG1wy8pF38nAngL4lyOCZKZWO5C2mEMTlP5sBlx/xOsAj5 w==; X-CSE-ConnectionGUID: hU2QLPasQUCnTZyeyi/cUw== X-CSE-MsgGUID: 3awmxx/BTNWJohoVJHqhqA== X-IronPort-AV: E=McAfee;i="6700,10204,11101"; a="32460024" X-IronPort-AV: E=Sophos;i="6.08,233,1712646000"; d="scan'208";a="32460024" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jun 2024 08:06:38 -0700 X-CSE-ConnectionGUID: DBaxOxA3SJ2r5rzUsyaZDg== X-CSE-MsgGUID: ICNQtISZTvaZtpIAMP0HZQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,233,1712646000"; d="scan'208";a="39925916" Received: from silpixa00401119.ir.intel.com ([10.55.129.167]) by orviesa009.jf.intel.com with ESMTP; 12 Jun 2024 08:06:37 -0700 From: Anatoly Burakov To: dev@dpdk.org Cc: ian.stokes@intel.com, bruce.richardson@intel.com, Paul Greenwalt Subject: [PATCH v2 120/148] net/ice/base: add E830 PTP init Date: Wed, 12 Jun 2024 16:01:54 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: <20240430154014.1026-1-ian.stokes@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 Add E830 PTP initialization flow. TXPP requires SW and HW timer clock synchronization which is done during the PTP initialization flow. The E810 and E830 PTP initialization flows are similar. The primary difference that E810 initializes the PHY via AQCs, and E830 does not initialize the external PHY. Signed-off-by: Paul Greenwalt Signed-off-by: Anatoly Burakov --- drivers/net/ice/base/ice_ptp_hw.c | 41 +++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/drivers/net/ice/base/ice_ptp_hw.c b/drivers/net/ice/base/ice_ptp_hw.c index f287834a4d..487eb0bd92 100644 --- a/drivers/net/ice/base/ice_ptp_hw.c +++ b/drivers/net/ice/base/ice_ptp_hw.c @@ -911,6 +911,18 @@ static void ice_ptp_exec_tmr_cmd(struct ice_hw *hw) ice_flush(hw); } +/** + * ice_ptp_zero_syn_dlay - Set synchronization delay to zero + * @hw: pointer to HW struct + * + * Zero E810 and E830 specific PTP hardware clock synchronization delay. + */ +static void ice_ptp_zero_syn_dlay(struct ice_hw *hw) +{ + wr32(hw, GLTSYN_SYNC_DLAY, 0); + ice_flush(hw); +} + enum eth56g_res_type { ETH56G_PHY_REG, ETH56G_PHY_MEM, @@ -4899,8 +4911,7 @@ int ice_ptp_init_phy_e810(struct ice_hw *hw) */ static int ice_ptp_init_phc_e810(struct ice_hw *hw) { - /* Ensure synchronization delay is zero */ - wr32(hw, GLTSYN_SYNC_DLAY, 0); + ice_ptp_zero_syn_dlay(hw); /* Initialize the PHY */ return ice_ptp_init_phy_e810(hw); @@ -5400,6 +5411,24 @@ int ice_ptp_read_sdp_section_from_nvm(struct ice_hw *hw, bool *section_exist, return err; } +/* E830 functions + * + * The following functions operate on the E830 series devices. + * + */ + +/** + * ice_ptp_init_phc_e830 - Perform E830 specific PHC initialization + * @hw: pointer to HW struct + * + * Perform E830-specific PTP hardware clock initialization steps. + */ +static int ice_ptp_init_phc_e830(struct ice_hw *hw) +{ + ice_ptp_zero_syn_dlay(hw); + return 0; +} + /** * ice_ptp_write_direct_incval_e830 - Prep PHY port increment value change * @hw: pointer to HW struct @@ -5636,6 +5665,8 @@ void ice_ptp_init_phy_model(struct ice_hw *hw) if (ice_is_e810(hw)) hw->phy_model = ICE_PHY_E810; + else if (ice_is_e830(hw)) + hw->phy_model = ICE_PHY_E830; else hw->phy_model = ICE_PHY_E822; hw->phy_ports = ICE_NUM_EXTERNAL_PORTS; @@ -6113,6 +6144,7 @@ void ice_ptp_reset_ts_memory(struct ice_hw *hw) ice_ptp_reset_ts_memory_e822(hw); break; case ICE_PHY_E810: + case ICE_PHY_E830: default: return; } @@ -6141,6 +6173,8 @@ int ice_ptp_init_phc(struct ice_hw *hw) return ice_ptp_init_phc_e810(hw); case ICE_PHY_E822: return ice_ptp_init_phc_e822(hw); + case ICE_PHY_E830: + return ice_ptp_init_phc_e830(hw); default: return ICE_ERR_NOT_SUPPORTED; } @@ -6163,6 +6197,9 @@ int ice_get_phy_tx_tstamp_ready(struct ice_hw *hw, u8 block, u64 *tstamp_ready) case ICE_PHY_ETH56G: return ice_get_phy_tx_tstamp_ready_eth56g(hw, block, tstamp_ready); + case ICE_PHY_E830: + return ice_get_phy_tx_tstamp_ready_e830(hw, block, + tstamp_ready); case ICE_PHY_E810: return ice_get_phy_tx_tstamp_ready_e810(hw, block, tstamp_ready); -- 2.43.0