🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #22135

[PATCH net-next v12 02/15] Documentation: networking: Add timestamp related APIs to OA TC6 framework

#22135
From: Selvamani Rajagopal via B4 Relay
Date: Tue, 24 Nov 2026 22:09
140 lines
16396 bytes
From: Selvamani Rajagopal <Selvamani.Rajagopal@onsemi.com>

Add new APIs to support hardware timestamp feature as defined in
OPEN Alliance 10BASE-T1x MAC-PHY serial interface specification.

Add the newer read/write APIs that take MMS as one of its parameters
as these were not documented so far.

Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Selvamani Rajagopal <Selvamani.Rajagopal@onsemi.com>

---
changes in v12
  - Updated rx_filter behavior and return codes for oa_tc6_hwtstamp_set()
changes in v11
  - Changed the wording of timestamp support to make it more clear
changes in v10
  - Added new API oa_tc6_tx_credit_threshold_set
  - Vendor introduced APIs to vendor support patch
changes in v9
  - Added Reviewed tag
changes in v8
  - Updated 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 | 76 +++++++++++++++++++++++++++
 1 file changed, 76 insertions(+)

diff --git a/Documentation/networking/oa-tc6-framework.rst b/Documentation/networking/oa-tc6-framework.rst
index 2545ef694016..2df8455bf3ba 100644
--- a/Documentation/networking/oa-tc6-framework.rst
+++ b/Documentation/networking/oa-tc6-framework.rst
@@ -153,6 +153,13 @@ OPEN Alliance TC6 Framework
 - Forwards the received Ethernet frame from 10Base-T1x MAC-PHY to n/w
   subsystem.
 
+- If supported and enabled, timestamps are stored in the skb. Transmit
+  timestamps are requested via the TSC header field and read from
+  timestamp capture register A, B or C. If the next capture register is busy,
+  the frame is transmitted without requesting a timestamp and the TX
+  timestamp error counter is incremented. Receive timestamps are
+  prepended to the frame when the RTSA footer bit is set.
+
 Data Transaction
 ~~~~~~~~~~~~~~~~
 
@@ -496,3 +503,72 @@ 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 (PHC) with the kernel. Returns 0 immediately
+when the MAC-PHY does not support hardware timestamp. Otherwise it sets the
+name field of ptp_clock_info and registers the clock. Initialization of the
+other fields in the ptp_clock_info structure is left to the vendor as the
+PHC registers and their programming are vendor specific. 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 registering the hardware clock.
+
+.. c:function:: void oa_tc6_ptp_unregister(struct oa_tc6 *tc6)
+
+Unregisters the PTP hardware clock.
+
+.. c:function:: int oa_tc6_get_ts_info(struct oa_tc6 *tc6, \
+                                       struct kernel_ethtool_ts_info *info)
+
+Reports the hardware timestamping capabilities and PHC index in info when
+a PTP hardware clock is registered. Otherwise, info is left unchanged.
+Returns 0 (success) in both cases.
+
+.. 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 *stats)
+
+Provides hardware timestamp related traffic statistics for ethtool.
+An unexpected TX capture for a frame still being transferred counts as a
+timestamp error, not a lost timestamp. A request abandoned after its frame
+was transmitted, without a capture, counts as lost; a late TTSC event for
+that request does not count as an error.
+
+.. 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.
+
+The MAC-PHY timestamps all received frames, so any rx_filter other than
+HWTSTAMP_FILTER_NONE, or tx_type HWTSTAMP_TX_ON, results in
+HWTSTAMP_FILTER_ALL. The rx_filter field of cfg is updated with the
+filter that was programmed.
+
+Returns 0 on success, otherwise:
+
+- -EOPNOTSUPP: no PTP hardware clock is registered.
+- -EIO: the interface is down, or the framework has stopped handling
+  traffic after an error.
+- -ERANGE: tx_type or rx_filter is not supported.
+- -ETIMEDOUT: the request was not picked up within 100 ms.
+- A negative error code from the register access.
+
+.. 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
Technical Details
Message-ID: <20261124-s2500-mac-phy-support-v12-2-3575855d99f9@onsemi.com>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-370815-linux-kernel-netdev=dewy.ru
References: <20261124-s2500-mac-phy-support-v12-0-3575855d99f9@onsemi.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-370815-linux-kernel-netdev=dewy.ru
From: devnull+Selvamani.Rajagopal.onsemi.com@kernel.org (Selvamani Rajagopal via B4 Relay)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net-next v12 02/15] Documentation: networking: Add
 timestamp related APIs to OA TC6 framework
Date: Tue, 24 Nov 2026 14:09:50 -0800
Organization: Usenet Network
Message-ID: <20261124-s2500-mac-phy-support-v12-2-3575855d99f9@onsemi.com>
References: <20261124-s2500-mac-phy-support-v12-0-3575855d99f9@onsemi.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
	logging-data="50494"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:JWeG/21lRPgcZTgoxRl+aWlQ2YI= sha256:wDXdFnn9Km8HmTViVogdsU6wxsGwPHUMM7qgGKXwHrY=
	sha1:ic+WtXDMax0G08NuNwzjnyQ4Tc8= sha256:sh172K3qztslNwEnV1fIg33/+19c3SaRhyFhlL6JIWw=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 0C96D125E36; Wed, 25 Nov 2026 01:10:33 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.501
X-Spam-Status: No, score=-3.501 tagged_above=-9999 required=6.31
	tests=[DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1,
	RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001]
	autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id EBSAZNSx2CL6;
	Wed, 25 Nov 2026 01:10:25 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-370815-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
	by mail.dewy.ru (Postfix) with ESMTPS id 9F35E125E33; Wed, 25 Nov 2026 01:10:16 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sto.lore.kernel.org (Postfix) with ESMTP id D744A604E57; Tue, 24 Nov 2026 22:10:15 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=3; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1795558213;
	b=uWYp3ASUqVrKAhMdh0iAEcdypYhM8mK9l+CP9aET7YdAuJG/SbsxxQWaiSlar1K92rs6
	 4cQSyeRd1axZodGDpupr33QO/WITwEvcsHbBmhT7EyDiPJ6LMfZiQmACu6dP0uy4kEXH+
	 5u0o0wT+oGS5+/aMyrWZp9mYRDO5Wd5LMCgiZWEIpNZwyNVWpHlQz1+pq5sZt/MTMb0vM
	 JApKnx+Pk1g7bCCWS68u5xQ2xhL+Pt5kW1IEBIPXYek8up5oT6bPLALB54jwTE0D/h5Le
	 2Rni1D5fcyerAg9KhJPAeHkwz93DEQCxSm8wZ8E0mcdEpuBoqGQJ4B/E2fCLSKtGlQA==
X-ARC-Message-Signature: i=3; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795558213;
	h=X-Original-To:Received:Received:DKIM-Signature:Received:From:Date:
	 Subject:X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:Content-Type:
	 Message-Id:References:In-Reply-To:To:Cc:X-Mailer:
	 X-Developer-Signature:X-Developer-Key:X-Endpoint-Received:
	 X-Original-From:Reply-To:Content-Transfer-Encoding;
	bh=6dmOP6aQ6aqkfzJN8FKFivLq7QwU/1I8ZYZIqVNe2vE=;
	b=pisCG3WhhZiDLkzCFELgVszkYm5QTQ5syhgtlxY4F8uZ/oUWfWKfhJDvFKESlfP4AUFZ
	 d9QHivwoHoUIsmH77p8hW8lXWOWD6FObSXqxHVhCPAcE3BcuFa/TMVclMbNlp602gO9mf
	 J4tb9wW1mOX5vlxIZhX/1twdEmHCTvcpN9pH1WCw6zUmmLmAAuijjK/5vSPhRzaRZ9i3i
	 oHkFTDkQNJRvcSgbnTny3jfXmh0VbdbihuKdcZEACBmkpqBPyrte97uFw91Sz2VA2ZMk6
	 ZvE/6xCWsa3iwfoGclKmujlrz6E49MoBIEuB2lAfHht8QdMRWfPwi8uCwEMSCpxYuag==
X-ARC-Authentication-Results: i=3; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=dl8qm5l1;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id C8439606A69A;
	Tue, 24 Nov 2026 22:10:13 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=dl8qm5l1
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1795558208;
	b=kCJDd76kEHXoms3KBkQlQkal2EA90B2aY/i19z0U01hPz8KLC07ILT7aw3eg32L2AIql
	 FUl1Ox1mbAHt8eM8fgttVZAj1La3W7H+KEmj+Rre1CmHOhZoBDvdo47YWPn/Ll4IHDFaa
	 VfRiqMdmUi5OznlTyGJKWYMhnv+C4HJY545hQECFiZxtWAvixT642RGpVjZLbqoTAV/Nv
	 pBPPPO4x3+MXVoRsLpdFgEd+D9XtGUj3AkqYyzV71IC9AfQ+hQGRj2wocp+3DkJqH0A6O
	 7Su4I6h8Z/ubY83gqzNrDL3NbuQFN6jkv1bI8FHaAGV/e4Eo23mMDX8ati4K9DcVeGQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795558208;
	h=Received:DKIM-Signature:Received:From:Date:Subject:MIME-Version:
	 Content-Type:Message-Id:References:In-Reply-To:To:Cc:X-Mailer:
	 X-Developer-Signature:X-Developer-Key:X-Endpoint-Received:
	 X-Original-From:Reply-To:Content-Transfer-Encoding;
	bh=6dmOP6aQ6aqkfzJN8FKFivLq7QwU/1I8ZYZIqVNe2vE=;
	b=XFdBbSkiyYAmFl+1qc41D/j3v32mkW8QQD7V1UuwfZwJXRhJIZf+Fe22LG8+wchb6/zu
	 gVBogT+kaUXrD98ctYYAZgvE1bhfqgjAhEsKHTu2OgFLpXzKQ9wKwZiNvCbr+H/MQKypP
	 v7UkKvgDDve3NFGW2f6YPWL2AqoptrQ37UZdC741Idlg5kQBVHgTMlWVBIPUf4FNRtYFU
	 3DBj+2yNwwRVmuSq4PIAnNDiTu4xkKe4MiaxapFRUBf4w3ILVXuRc3X3jLgzK7rbA2cjd
	 43PZ5Hq7Y5sLiE4XJ+xQfvOOaK3Vv+MAM8OIHT38liSl4tYtf6aGH1bc5xrJc4DudjQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=dl8qm5l1;
	arc=pass header.oldest-pass=0 smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id E3F9F606A329;
	Tue, 24 Nov 2026 22:10:07 +0000 (UTC)
X-Authentication-Results: smtp.kernel.org; arc=none smtp.remote-ip=100.80.115.77
X-ARC-Seal: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256; cv=none;
	t=1795558207;
	b=Na79PzDphFEKa4oOb68Qhr2YF9f7gMNISY5oVvuH8wcz6XIkkZ1UD9tXMEBjqIViED2s
	 WL9pej9Fju/LdQWcODfhDrYgtWwEq/vp0U5HLk2rbiRJiDckm9BVYBsakMTWpcrvOXRkw
	 O0ZsNhVZNlKJOfZ6TmJuboTGZVeFltxRMkT3Md37w1oUadYpcwxIkNngzrjcR67S86ZJL
	 tgwKE+36GW9HN+Wmh32UV3959lerDuspyYYETGEIYCpsj7Ck1vdzgBJ3xNNVbF9KXgCwy
	 RmFTjVCjkjyoF8MPASn0NjuuxSW0iwBc+tGiRV6NhUk8+y4RspGW34XfHuyipg5BbeQ==
X-ARC-Message-Signature: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256;
	c=relaxed/relaxed; t=1795558207;
	h=DKIM-Signature:Received:From:Date:Subject:MIME-Version:Content-Type:
	 Message-Id:References:In-Reply-To:To:Cc:X-Mailer:
	 X-Developer-Signature:X-Developer-Key:X-Endpoint-Received:
	 X-Original-From:Reply-To:Content-Transfer-Encoding;
	bh=6dmOP6aQ6aqkfzJN8FKFivLq7QwU/1I8ZYZIqVNe2vE=;
	b=lWujGYIn1yhzMEHXNFls0kgCnUkRP030rCaidSs1ZR23RZqLqUVwWJnz8qneSCBiOWku
	 GfCS39jquJXf0iPPHo0p4kPxMPOIBtpZrasslgnfhf4iWJm1vQAtRzv6NGEaETbXizamM
	 liNpdBuGQTcqvK3+aOkx3qf2+PTlhlgtZMmWLI/nmY62+LEMWBLJx1Z5iw7DLozun/3Zv
	 LDZ4WhHhn4ifs22fuh6f3qyWaT8Hp0DYPMLTf47u2+JgVyIqXREE0EavNUQCCdUpiDUzs
	 LGl62HN4zOLarzDR1DwiTCBSHVjD9oLf2h/w1Flb8bzacHhNbjBXieRxip+xiQP+TIw==
X-ARC-Authentication-Results: i=1; smtp.kernel.org; 
	arc=none smtp.remote-ip=100.80.115.77
X-Received: from lkml.kernel.org (nexus.subspace.kernel.org [100.80.115.77])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.kernel.org (Postfix) with ESMTPS id 32CD81F000D1;
	Tue, 24 Nov 2026 22:09:57 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1795558207;
	bh=6dmOP6aQ6aqkfzJN8FKFivLq7QwU/1I8ZYZIqVNe2vE=;
	h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To;
	b=dl8qm5l1XIEa8HMyaT8ydnMIKCBYS3umbFUPp4eZSvGLJIObId4TfWL3WGnX3LF2T
	 Pb1HhZNTstCBg7rrdRgYCsI24Y+AtT7DKB8suxle15TUpbAvK2EkU0ipVPDsIOiUQq
	 meHWI5BDw7utmQxvnx3JTzBMCUXyh19e1J/LT8BrveBYdJ6Q4ZbkDGPJ9khpReuLEd
	 e/gCn85736jIDgRnQvEhAAS+xNkkgMKwAs8DoUkn/gb1RCffFpnSoXPRFTOq7jWEFH
	 /DeDl8fFluDBtfHyEZzZ9Z90m9V+akEwY7m2SmmN5ZVJDh9YL77A1Pi3xrKK6Cvrvr
	 WNUioCtYWJxZQ==
X-Received: from nexus.subspace.kernel.org (localhost [IPv6:::1])
	by lkml.kernel.org (Postfix) with ESMTP id B758A4CBCA;
	Tue, 24 Nov 2026 22:09:56 +0000 (UTC)
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-In-Reply-To: <20261124-s2500-mac-phy-support-v12-0-3575855d99f9@onsemi.com>
X-Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, 
 devicetree@vger.kernel.org, linux-doc@vger.kernel.org, 
 Jerry Ray <jerry.ray@microchip.com>, 
 Ciprian Regus <ciprian.regus@analog.com>, 
 Selvamani Rajagopal <Selvamani.Rajagopal@onsemi.com>
X-Mailer: b4 0.13.0
X-Developer-Signature: v=1; a=ed25519-sha256; t=1795558193; l=5833;
 i=Selvamani.Rajagopal@onsemi.com; s=20260531; h=from:subject:message-id;
 bh=e1D6w+f4ICdcIKoxkxfKUPKsEbTykb38slj0b2WqgHM=;
 b=cwaJZXaWuvCMlHNJzofacuUvmYVqlMiZjvVxM2w4Wpwqigg0B58lyr+d2v3HrGMe6DjQz4HZc
 EOgLCFv9d8VCryRvyyrpk07u1SLf21JspCsyXU6OifmDB8HkCljcC5B
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 <Selvamani.Rajagopal@onsemi.com>
X-Reply-To: Selvamani.Rajagopal@onsemi.com