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 D0D5745500; Wed, 26 Jun 2024 13:56:39 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E4F50432F0; Wed, 26 Jun 2024 13:55:12 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by mails.dpdk.org (Postfix) with ESMTP id 4D8FB42E95 for ; Wed, 26 Jun 2024 13:43:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1719402207; x=1750938207; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ZkXCrJTRZvbIlzmGt+HkWriVrtOjeXYrVSNg1wH0rAs=; b=g40Sm2ByfVRf+NdzjbbH9IUvf7DMmJQwpQeC3my3p7y5HohxT0bs21SS JGnnt6grRy+e8XPuN724Q2vLyFzxojJH2kTVYtSbda+LDmy2lxG1VEegC KSrInWEDk5DBedX7Ps2e3OxnpNBuQ6IceEtAtANzZS0W/hrvuMbyC8JG9 zPe55whSLsz4MoPioa+xuDuu5xzTzajPMsK2e4Fs1MRrOWWR4X5GAG/JL MjPPJgR/Rz7pBtcGuel40vAbMrAL/OyNH0i5EOChhmHR7RWJAxj8XWtZ8 StQOMs+7kannZGVxxQTKLnhoqJ+HWCgkvk5uH/+GrCoEpGhV6PmEwjLJH A==; X-CSE-ConnectionGUID: HZTeIPZ5TZKm3eB+uLUnwQ== X-CSE-MsgGUID: u8g1Zop+Rc6ZlxJKimXoTQ== X-IronPort-AV: E=McAfee;i="6700,10204,11114"; a="38979324" X-IronPort-AV: E=Sophos;i="6.08,266,1712646000"; d="scan'208";a="38979324" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jun 2024 04:43:26 -0700 X-CSE-ConnectionGUID: rkYm6T/8RBGviFG4wGxrrg== X-CSE-MsgGUID: 5pMAsn1fRQqAkGuifmk9wQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,266,1712646000"; d="scan'208";a="43873524" Received: from unknown (HELO silpixa00401119.ir.intel.com) ([10.55.129.167]) by orviesa010.jf.intel.com with ESMTP; 26 Jun 2024 04:43:26 -0700 From: Anatoly Burakov To: dev@dpdk.org Cc: Yochai Hagvi , ian.stokes@intel.com, bruce.richardson@intel.com Subject: [PATCH v4 016/103] net/ice/base: add helper function for refsync Date: Wed, 26 Jun 2024 12:41:04 +0100 Message-ID: <16d4df00f8f17cc8e299a3f3c6af265542fb0b2a.1719401847.git.anatoly.burakov@intel.com> 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: Yochai Hagvi Add a helper function to determine whether a given pin of DPLL is capable for refsync configuration. Signed-off-by: Yochai Hagvi Signed-off-by: Ian Stokes --- drivers/net/ice/base/ice_ptp_hw.c | 16 ++++++++++++++++ drivers/net/ice/base/ice_ptp_hw.h | 1 + 2 files changed, 17 insertions(+) diff --git a/drivers/net/ice/base/ice_ptp_hw.c b/drivers/net/ice/base/ice_ptp_hw.c index 3d4e02a2f6..69bef926bd 100644 --- a/drivers/net/ice/base/ice_ptp_hw.c +++ b/drivers/net/ice/base/ice_ptp_hw.c @@ -5804,3 +5804,19 @@ int ice_ptp_init_phc(struct ice_hw *hw) return status; } + +/** + * refsync_pin_id_valid + * @hw: pointer to the HW struct + * @id: pin index + * + * Checks whether DPLL's input pin can be configured to ref-sync pairing mode. + */ +bool refsync_pin_id_valid(struct ice_hw *hw, u8 id) +{ + /* refsync is allowed only on pins 1 or 5 for E810T */ + if (ice_is_e810t(hw) && id != 1 && id != 5) + return false; + + return true; +} diff --git a/drivers/net/ice/base/ice_ptp_hw.h b/drivers/net/ice/base/ice_ptp_hw.h index ed359db6ee..935c3f9648 100644 --- a/drivers/net/ice/base/ice_ptp_hw.h +++ b/drivers/net/ice/base/ice_ptp_hw.h @@ -142,6 +142,7 @@ ice_read_phy_tstamp(struct ice_hw *hw, u8 block, u8 idx, u64 *tstamp); int ice_clear_phy_tstamp(struct ice_hw *hw, u8 block, u8 idx); int ice_ptp_init_phc(struct ice_hw *hw); +bool refsync_pin_id_valid(struct ice_hw *hw, u8 id); /* E822 family functions */ int -- 2.43.0