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 D68634404F; Wed, 12 Jun 2024 17:12:16 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 392E842DB4; Wed, 12 Jun 2024 17:04:38 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) by mails.dpdk.org (Postfix) with ESMTP id 4B47742D27 for ; Wed, 12 Jun 2024 17:04:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1718204674; x=1749740674; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=SIyh5irWGXPDmgvw2LlFQiqH59n0mAzQJVUm+HjG4DU=; b=JRloVboDimVQhfhZ4sdB8r/dcdtaytttGBCSNAgLjUlaoRPST9SZnW0S SiRQ4at7OjLf8JWTQeN7C9sOOBHQYZNxZ53ljVcjvgvRe4an+tw/JzRvu xSLFtLgXn6nResXmbFUVe+0ouD8Xs4MHEvCbTlUyfBbeo5laK+1KJI3lB rQ9+vVB93Io1/TFDXZRDiDF0I8W06Vc9PhZ5c44cDkatttcI51VZKRc14 mk7ElmNr980l9+0AkRv+QZQFAkiwKbN1qrh5ElOmNR5VaHukSymih4lIL 6SqxB/kZG+yAWExjIXdLdspT/WxOkc3CRIb59/yt2itCgsuW6PNWlU3dp w==; X-CSE-ConnectionGUID: VsevEHNWRz6h49iMh8QS7Q== X-CSE-MsgGUID: dYN+VE/MRzG7eDkRb0l9GA== X-IronPort-AV: E=McAfee;i="6700,10204,11101"; a="32459469" X-IronPort-AV: E=Sophos;i="6.08,233,1712646000"; d="scan'208";a="32459469" 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:04:32 -0700 X-CSE-ConnectionGUID: fdpkU19kTX69EI907Os/sg== X-CSE-MsgGUID: /tZBiqWIToaF7jZj+ed97w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,233,1712646000"; d="scan'208";a="39925208" Received: from silpixa00401119.ir.intel.com ([10.55.129.167]) by orviesa009.jf.intel.com with ESMTP; 12 Jun 2024 08:04:31 -0700 From: Anatoly Burakov To: dev@dpdk.org Cc: Ian Stokes , bruce.richardson@intel.com, Yochai Hagvi Subject: [PATCH v2 046/148] net/ice/base: add helper function for refsync Date: Wed, 12 Jun 2024 16:00:40 +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 From: Ian Stokes 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 084532c5fc..db28aa308c 100644 --- a/drivers/net/ice/base/ice_ptp_hw.c +++ b/drivers/net/ice/base/ice_ptp_hw.c @@ -5783,3 +5783,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 d88ecbbef3..04556db7e9 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