From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1A8B0C531DF for ; Tue, 20 Aug 2024 10:24:48 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id C3492405AE; Tue, 20 Aug 2024 10:24:47 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id Azt83Ed5Q0ta; Tue, 20 Aug 2024 10:24:46 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.34; helo=ash.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org B1E1D40551 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1724149486; bh=ebk/QM1Xgq6+6xzqYoNvs2on/Bt4S0Cq9/CBaXHPFaA=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=wW8xRGYOrDkA1k+OE7SZLBh6mkdU+UZVEGGkvFKTXBqU0xVC8m1uCk9HpYkd0EJrP YavLGPCRmpYZk8oGOOPdsYL6L7MfZ/R4CWyQZ6SDnv4TQtkq3quL4V0vQydnbNWqYv d1CQk05pxsWu7qwi83F9oaZFtVMkgLgpgkPyWORDS0XzNnUbQ5ESIEWVyBxhtp1KPW Zf5QDa/ayMXekmhvDHS5Rk9t2XQR+nLgbnFIc4dnGd2Knmbr4wzLzImRm0PFRqndS8 6E2FYgVHMlbhFY5iaMGOhbmuiXwmQOQrlYVyabDyR+o+ILDpX9W38vQ/JAt1eQJwl8 T1LQZUWJQRlKw== Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id B1E1D40551; Tue, 20 Aug 2024 10:24:46 +0000 (UTC) Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 6580A1BF328 for ; Tue, 20 Aug 2024 10:24:40 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 5EFE14094F for ; Tue, 20 Aug 2024 10:24:40 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id N0bV8l0jcsHU for ; Tue, 20 Aug 2024 10:24:39 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=198.175.65.9; helo=mgamail.intel.com; envelope-from=karol.kolacinski@intel.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp2.osuosl.org 0DD0040189 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 0DD0040189 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by smtp2.osuosl.org (Postfix) with ESMTPS id 0DD0040189 for ; Tue, 20 Aug 2024 10:24:38 +0000 (UTC) X-CSE-ConnectionGUID: 6aJYxO8VStuRVecSvHk2Qg== X-CSE-MsgGUID: /t0x2QAxTpG6NtdHVDY7aA== X-IronPort-AV: E=McAfee;i="6700,10204,11169"; a="44962829" X-IronPort-AV: E=Sophos;i="6.10,161,1719903600"; d="scan'208";a="44962829" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Aug 2024 03:24:38 -0700 X-CSE-ConnectionGUID: 2tjR2am0TZSUwtbcPkq14w== X-CSE-MsgGUID: bAGLMrF2TuSDmRtHOJSONw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,161,1719903600"; d="scan'208";a="98152840" Received: from unknown (HELO kkolacin-desk1.igk.intel.com) ([10.217.160.108]) by orviesa001.jf.intel.com with ESMTP; 20 Aug 2024 03:24:36 -0700 From: Karol Kolacinski To: intel-wired-lan@lists.osuosl.org Date: Tue, 20 Aug 2024 12:21:52 +0200 Message-ID: <20240820102402.576985-13-karol.kolacinski@intel.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240820102402.576985-8-karol.kolacinski@intel.com> References: <20240820102402.576985-8-karol.kolacinski@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724149479; x=1755685479; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=7N5eGTkDiG8Qvv/AIj8ZvUfBEc+qQ7WfM1ZJ92TKzX0=; b=nRg0hfLtgR8q44r0wJ65wVbsbw2ET4VepMjKDOdW7+4aDTf3LrAhkWCC gvFa8KCd+t0b42IS2S+ZZCMISkUvvUDd1KS6pjzhte4AeULdqVnHk6Vox kLq+o5DWYZEw3F0/z2CT//PSQSRCLEDoTVITmii1gFdi9758MAqd+9169 jG3hVo+jxUpnPF6fCt1wf3iyIuXde6A1+HnIpVCsZ/inPJaxeCXQVIo9n 9Tlo/58ccAzA8Np91zTbvqXXDpExEpuXTu4aBl8O3LTiiolPinKO03j/N x2dqLX2hr+YJx5sdYMpaswEEiIX8jae0NYS4tcJSh/4+sqeATaYPtURd8 A==; X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dmarc=pass (p=none dis=none) header.from=intel.com X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=nRg0hfLt Subject: [Intel-wired-lan] [PATCH v7 iwl-next 5/6] ice: Add timestamp ready bitmap for E830 products X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: netdev@vger.kernel.org, Karol Kolacinski , anthony.l.nguyen@intel.com, przemyslaw.kitszel@intel.com Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" E830 PHY supports timestamp ready bitmap. Enable the bitmap by refactoring tx init function. Reviewed-by: Przemek Kitszel Signed-off-by: Karol Kolacinski --- drivers/net/ethernet/intel/ice/ice_ptp.c | 56 +++++++----------------- drivers/net/ethernet/intel/ice/ice_ptp.h | 3 +- 2 files changed, 17 insertions(+), 42 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_ptp.c b/drivers/net/ethernet/intel/ice/ice_ptp.c index 861f6224540a..b438647717cc 100644 --- a/drivers/net/ethernet/intel/ice/ice_ptp.c +++ b/drivers/net/ethernet/intel/ice/ice_ptp.c @@ -942,28 +942,6 @@ ice_ptp_release_tx_tracker(struct ice_pf *pf, struct ice_ptp_tx *tx) tx->len = 0; } -/** - * ice_ptp_init_tx_eth56g - Initialize tracking for Tx timestamps - * @pf: Board private structure - * @tx: the Tx tracking structure to initialize - * @port: the port this structure tracks - * - * Initialize the Tx timestamp tracker for this port. ETH56G PHYs - * have independent memory blocks for all ports. - * - * Return: 0 for success, -ENOMEM when failed to allocate Tx tracker - */ -static int ice_ptp_init_tx_eth56g(struct ice_pf *pf, struct ice_ptp_tx *tx, - u8 port) -{ - tx->block = port; - tx->offset = 0; - tx->len = INDEX_PER_PORT_ETH56G; - tx->has_ready_bitmap = 1; - - return ice_ptp_alloc_tx_tracker(tx); -} - /** * ice_ptp_init_tx_e82x - Initialize tracking for Tx timestamps * @pf: Board private structure @@ -974,9 +952,11 @@ static int ice_ptp_init_tx_eth56g(struct ice_pf *pf, struct ice_ptp_tx *tx, * the timestamp block is shared for all ports in the same quad. To avoid * ports using the same timestamp index, logically break the block of * registers into chunks based on the port number. + * + * Return: 0 on success, -ENOMEM when out of memory */ -static int -ice_ptp_init_tx_e82x(struct ice_pf *pf, struct ice_ptp_tx *tx, u8 port) +static int ice_ptp_init_tx_e82x(struct ice_pf *pf, struct ice_ptp_tx *tx, + u8 port) { tx->block = ICE_GET_QUAD_NUM(port); tx->offset = (port % ICE_PORTS_PER_QUAD) * INDEX_PER_PORT_E82X; @@ -987,24 +967,27 @@ ice_ptp_init_tx_e82x(struct ice_pf *pf, struct ice_ptp_tx *tx, u8 port) } /** - * ice_ptp_init_tx_e810 - Initialize tracking for Tx timestamps + * ice_ptp_init_tx - Initialize tracking for Tx timestamps * @pf: Board private structure * @tx: the Tx tracking structure to initialize + * @port: the port this structure tracks * - * Initialize the Tx timestamp tracker for this PF. For E810 devices, each - * port has its own block of timestamps, independent of the other ports. + * Initialize the Tx timestamp tracker for this PF. For all PHYs except E82X, + * each port has its own block of timestamps, independent of the other ports. + * + * Return: 0 on success, -ENOMEM when out of memory */ -static int -ice_ptp_init_tx_e810(struct ice_pf *pf, struct ice_ptp_tx *tx) +static int ice_ptp_init_tx(struct ice_pf *pf, struct ice_ptp_tx *tx, u8 port) { - tx->block = pf->hw.port_info->lport; + tx->block = port; tx->offset = 0; - tx->len = INDEX_PER_PORT_E810; + tx->len = INDEX_PER_PORT; + /* The E810 PHY does not provide a timestamp ready bitmap. Instead, * verify new timestamps against cached copy of the last read * timestamp. */ - tx->has_ready_bitmap = 0; + tx->has_ready_bitmap = pf->hw.mac_type != ICE_MAC_E810; return ice_ptp_alloc_tx_tracker(tx); } @@ -3344,20 +3327,13 @@ static int ice_ptp_init_port(struct ice_pf *pf, struct ice_ptp_port *ptp_port) mutex_init(&ptp_port->ps_lock); switch (hw->mac_type) { - case ICE_MAC_E810: - case ICE_MAC_E830: - return ice_ptp_init_tx_e810(pf, &ptp_port->tx); case ICE_MAC_GENERIC: kthread_init_delayed_work(&ptp_port->ov_work, ice_ptp_wait_for_offsets); - return ice_ptp_init_tx_e82x(pf, &ptp_port->tx, ptp_port->port_num); - case ICE_MAC_GENERIC_3K_E825: - return ice_ptp_init_tx_eth56g(pf, &ptp_port->tx, - ptp_port->port_num); default: - return -ENODEV; + return ice_ptp_init_tx(pf, &ptp_port->tx, ptp_port->port_num); } } diff --git a/drivers/net/ethernet/intel/ice/ice_ptp.h b/drivers/net/ethernet/intel/ice/ice_ptp.h index 5122b3a862fb..eae15b3b0286 100644 --- a/drivers/net/ethernet/intel/ice/ice_ptp.h +++ b/drivers/net/ethernet/intel/ice/ice_ptp.h @@ -128,8 +128,7 @@ struct ice_ptp_tx { /* Quad and port information for initializing timestamp blocks */ #define INDEX_PER_QUAD 64 #define INDEX_PER_PORT_E82X 16 -#define INDEX_PER_PORT_E810 64 -#define INDEX_PER_PORT_ETH56G 64 +#define INDEX_PER_PORT 64 /** * struct ice_ptp_port - data used to initialize an external port for PTP -- 2.46.0