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 3AF37454EF; Tue, 25 Jun 2024 13:27:08 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 029D9432E4; Tue, 25 Jun 2024 13:18:58 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) by mails.dpdk.org (Postfix) with ESMTP id A087D427DE for ; Tue, 25 Jun 2024 13:17:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1719314262; x=1750850262; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=u+Q/NR1k62CWbh+G5ju1bS+SeP/kse6UFEeoOAFiit0=; b=ORAjS0Pmkb5FTJqDhuqlfjAxJZBh2vljq6ko9F9w4/348RA2l996KlNM ZKdjjUC/3bmVgnDh+jgbIj+MTn96WpIgLaZXBv0hlVkmgSvxzVvBVJ95G rSdy4qu+vohdaxLaNjnOjYzAs/OlZpOID1IiT8JXp4hkkbmSNJrBgCrCK /yOBl/qlcPVeyBb4eiL0Z9UHHQr46jZwpge+WDCko8YlCi7oT3tG7Iy5L 5whPfSj8VhIHvchf4SUXxEvL1Kr/UJjEAI/9HinULlrgk+9JrzaOOy0D9 4Ecv4kQeholnMcotwDdU2TPK31feTW3naaYYL86S3bTXOmmxaBPiHahVh A==; X-CSE-ConnectionGUID: UwIbSwtCS2mR55QOuYFOTw== X-CSE-MsgGUID: 0fAWZ+/BTOC0tfKkV0Q+tw== X-IronPort-AV: E=McAfee;i="6700,10204,11113"; a="16080552" X-IronPort-AV: E=Sophos;i="6.08,263,1712646000"; d="scan'208";a="16080552" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jun 2024 04:17:41 -0700 X-CSE-ConnectionGUID: CEIqYw5QTKO0o0rY1KqIng== X-CSE-MsgGUID: cVxFdUtrRLO8gDv87bXG2g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,263,1712646000"; d="scan'208";a="43719653" Received: from unknown (HELO silpixa00401119.ir.intel.com) ([10.55.129.167]) by orviesa009.jf.intel.com with ESMTP; 25 Jun 2024 04:17:41 -0700 From: Anatoly Burakov To: dev@dpdk.org Cc: Paul Greenwalt , bruce.richardson@intel.com, ian.stokes@intel.com Subject: [PATCH v3 100/129] net/ice/base: add E830 PTP init Date: Tue, 25 Jun 2024 12:13:45 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: 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 From: Paul Greenwalt 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 7f360a0192..8cc1478dcc 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, @@ -4879,8 +4891,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); @@ -5396,6 +5407,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 @@ -5632,6 +5661,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; @@ -6109,6 +6140,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; } @@ -6137,6 +6169,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; } @@ -6159,6 +6193,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