From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4FA2C37DEB7; Fri, 9 Oct 2026 17:12:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791565946; cv=none; b=bZ0lffbwQPExKt+hvXKiCym5qXb4GIXueftEJyKpmnoWigpMQhmhC9n6g08bMCNgsNjS9hTTvBHXqTCVEL9a7BX/SxaypOCULbG3uEUmrTUDbT3paYC/jgflo8ZUDi3Nvh3JjTB0it+EnL0Wsv7cICP9/lrj6cLJQd3qCLPUXZs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791565946; c=relaxed/simple; bh=bYaNVv1wfu+K/XTJi4v+Pezk+vx7ZqiXClmhFnMAH+E=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=XjXgxn0TqbMTbkh7axjhGj1RuLHyovLjZPYWAXJGO17YONOCtMD4Rgbg6HCiPaINeRYV/Xlv8zz3RqTgQ7qtNM+W1k1e6kWibMjtw1Ul/463JEsrWCbcP7qy65cmV0wvP6J9Ew4Px/xK4R/rSgXMGELeF/wleXB0Q2CYS38thLw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=fYDyOtq8; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="fYDyOtq8" Received: by smtp.kernel.org (Postfix) with ESMTPS id 11F53C2BCF7; Fri, 9 Oct 2026 17:12:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1791565946; bh=bYaNVv1wfu+K/XTJi4v+Pezk+vx7ZqiXClmhFnMAH+E=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=fYDyOtq86GxAkFO+YqM5NVur2YcngXB/UZvymDh1F7NJbxHh7D+nCIE0OVve4lq6u YfUabeJwfpXzhu+nm3UTCblCkQRQkVIs3zv2LvBZD4q+c3Jt7Nv+KW9TOiJvKrOaue JA5ilvnXTuBHXtU4wVsMgVfObLe4gV7MKKHtD9viuHrazF+bjlwJaEVnGEjB7Voy5T RJDudVliHz+4CcwqVa4r4UXsUm3l3gyJUIIJb2n3qdmNxl9szK37l3HAqaOzFjg5zN 4aRZjIF82cy84grCJDrp4/gG0DnMWxXk+Z+9Zh3GSJSNgEUqKJvGgk92VotUzpvpvi IPggUR28JGE9A== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id E471CCA9EC0; Fri, 9 Oct 2026 17:12:25 +0000 (UTC) From: Selvamani Rajagopal via B4 Relay Date: Fri, 09 Oct 2026 10:12:22 -0700 Subject: [PATCH net-next v9 02/11] Documentation: networking: Add timestamp related APIs to OA TC6 framework Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20261009-s2500-mac-phy-support-v9-2-dcefe1d0bf0d@onsemi.com> References: <20261009-s2500-mac-phy-support-v9-0-dcefe1d0bf0d@onsemi.com> In-Reply-To: <20261009-s2500-mac-phy-support-v9-0-dcefe1d0bf0d@onsemi.com> To: Selva Rajagopal , Andrew Lunn , "David S. Miller" , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Parthiban Veerasooran , Simon Horman , Jonathan Corbet , Shuah Khan , Randy Dunlap , Richard Cochran , Andrew Lunn , Heiner Kallweit , Russell King , Eric Dumazet , Piergiorgio Beruto , Eric Dumazet Cc: Selva Rajagopal , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, Jerry Ray , Ciprian Regus X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1791565943; l=4629; i=Selvamani.Rajagopal@onsemi.com; s=20260531; h=from:subject:message-id; bh=9o+zv+MhVib0ZyKSed2M2RcOfdUYo/DismzGgck0r9w=; b=LFzA0nm29AJXDHK28NzYlucFGaJThudqijmJBsCbtExFIXlPoqPMZSKhFg206YhfKvzpKPljX nCUUAksZbepBrezlCWzVZKAVEGxRjlDbWFi3gg03cZjEYMxPYbBDqCy X-Developer-Key: i=Selvamani.Rajagopal@onsemi.com; a=ed25519; pk=5QRdM0HS/LGWWcUZZ9hVfZ+qbPQGZCumcTXOiN7Fyug= X-Endpoint-Received: by B4 Relay for Selvamani.Rajagopal@onsemi.com/20260531 with auth_id=803 X-Original-From: Selvamani Rajagopal Reply-To: Selvamani.Rajagopal@onsemi.com From: Selvamani Rajagopal Added new APIs to support hardware timestamp feature as defined in OPEN Alliance 10BASE-T1x MAC-PHY serial interface specification. Added the newer read/write APIs that takes MMS as one of its parameters as these were not documented so far. Reviewed-by: Andrew Lunn Signed-off-by: Selvamani Rajagopal --- changes in v9 - Added Reviewed tag changes in v8 - Updated the the order of the parameters in oa_tc6_read_register_mms and oa_tc6_write_register_mms apis. - Removed the reference to ioctl changes in v7 - No change changes in v6 - No change changes in v5 - Fixed "no blank line" issues in four places changes in v4 - Added information for new APIs in OA TC6 framework changes in v3 - Added more information for documentation changes in v2 - Removed the changes to the existing API - Updated information about newly added APIs changes in v1 - Added changes to an existing API - Added documentation to new hardware timestamp related APIs --- Documentation/networking/oa-tc6-framework.rst | 59 +++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/Documentation/networking/oa-tc6-framework.rst b/Documentation/networking/oa-tc6-framework.rst index 2545ef694016..3cfe8cb7cf75 100644 --- a/Documentation/networking/oa-tc6-framework.rst +++ b/Documentation/networking/oa-tc6-framework.rst @@ -153,6 +153,10 @@ OPEN Alliance TC6 Framework - Forwards the received Ethernet frame from 10Base-T1x MAC-PHY to n/w subsystem. +- If supported by the hardware and enabled, updates hardware timestamp + in skb, when indicated by one of the three timestamp capture registers + through TSC fields of the header. + Data Transaction ~~~~~~~~~~~~~~~~ @@ -496,3 +500,58 @@ the MAC-PHY. Zero align receive frame feature can be enabled to align all receive ethernet frames data to start at the beginning of any receive data chunk payload with a start word offset (SWO) of zero. + +.. c:function:: int oa_tc6_ptp_register(struct oa_tc6 *tc6, \ + struct ptp_clock_info *info); + +Registers the PTP hardware clock related functions with the kernel. +This API simply registers. Initialization of the fields in the +ptp_clock_info structure are left to the vendor as programming hardware +timer is expected to be vendor dependent. The fields max_adj, owner, +and all the functions for the clock operations, like adjfine, gettimex64, +settime64, adjtime are expected to be initialized in the structure before +calling the registering the hardware clock. + +.. c:function:: void oa_tc6_ptp_unregister(struct oa_tc6 *tc6); + +Unregisters the PTP hardware clock related callbacks. + +.. c:function:: int oa_tc6_get_ts_info(struct oa_tc6 *tc6, \ + struct kernel_ethtool_ts_info *info); + +Provides timestamp related settings that are supported to ethtool. + +.. c:function:: void oa_tc6_hwtstamp_get(struct oa_tc6 *tc6, \ + struct kernel_hwtstamp_config *cfg); + +Returns hardware timestamp configuration. Part of net_device_ops callbacks. + +.. c:function:: void oa_tc6_get_ts_stats(struct oa_tc6 *tc6, \ + struct ethtool_ts_stats *ts_stats); + +Provides hardware timestamp related traffic statistics for ethtool. + +.. c:function:: int oa_tc6_hwtstamp_set(struct oa_tc6 *tc6, \ + struct kernel_hwtstamp_config *cfg); + +Helper to set hardware timestamp configuration. Part of net_device_ops +callbacks. + +.. c:function:: void oa_tc6_set_vend1_mms(struct oa_tc6 *tc6, int mms); + +Helper to map MDIO_MMD_VEND1 command to vendor specific Memory Map Select +(MMS) value. This function offers flexibility for vendors that may have +used any MMS value between 10 and 15 as allowed by the specification. +MDIO_MMD_VEND2 is already mapped to MMS4 in the OA TC6 frame work code. + +.. c:function:: int oa_tc6_write_register_mms(struct oa_tc6 *tc6, \ + u8 mms, u16 address, \ + u32 value); + +Write a single register addressed by @mms and @address in the MAC-PHY. + +.. c:function:: int oa_tc6_read_register_mms(struct oa_tc6 *tc6, \ + u8 mms, u16 address, \ + u32 *value); + +Read a single register addressed by @mms and @address in the MAC-PHY. -- 2.43.0