🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #25905

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

#25905
From: Selvamani Rajagopal via B4 Relay
Date: Wed, 02 Dec 2026 17:37
142 lines
16521 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 v13
  - No change
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: <20261202-s2500-mac-phy-support-v13-2-a2908fad2693@onsemi.com>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu.MISMATCH!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375966-linux-kernel-netdev=dewy.ru
References: <20261202-s2500-mac-phy-support-v13-0-a2908fad2693@onsemi.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu.MISMATCH!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375966-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 v13 02/15] Documentation: networking: Add
 timestamp related APIs to OA TC6 framework
Date: Wed, 02 Dec 2026 09:37:45 -0800
Organization: Usenet Network
Message-ID: <20261202-s2500-mac-phy-support-v13-2-a2908fad2693@onsemi.com>
References: <20261202-s2500-mac-phy-support-v13-0-a2908fad2693@onsemi.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
	logging-data="2021883"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:pkA8nQk5VbAshM3pbdjdcK4SQMc= sha256:gJcF64pWOw1JnWvz6s7y7sImP211Y89H4bkx5hvRyRs=
	sha1:myBg7NZWSMBKyWETG5cFgt9oBv0= sha256:JhPOONVmdtWl3r0SKE6psWTeUKlPFJGDApJqkcahBnw=
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 21A421176DC; Wed,  2 Dec 2026 20:39:02 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.401
X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, 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 PnDrm_IfX01U;
	Wed,  2 Dec 2026 20:38:59 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-375966-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 sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4])
	by mail.dewy.ru (Postfix) with ESMTPS id B814B1176D8; Wed,  2 Dec 2026 20:38:50 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sin.lore.kernel.org (Postfix) with ESMTP id A351B266D9; Wed,  2 Dec 2026 17:38:43 +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=1796233103;
	b=KFLGKVcU82CoB0yGAxNG9ubjJHtjBi0YJQb2ezQKeDKd5OMVh0fdl8SPDM8AnD2idrOq
	 BZjQgtz5XKRjWYg2REW2bhZL17DvVzCWzIH/HPQcDNFX3gYNsA//XAf/YyCoXt80D+mwA
	 4Q6nI01KiyMGlLEFn0UnJ/AaJOpqviRJBKMJCLsNNOypU+yznLJCFgrP+C9GUOSDZ5ARY
	 9yoshY5NPqK72+dsDJNdyu4Q+nq+qtCZ8tr3VYG9xJI1UHBFMvRzKP3JipDO8zxrkAODW
	 4ivhHmM3yXTxmCbcj04ejVCGpiPDdqx02+sEFjwzQBqIFRJCv0RWqtwW4uI+bKMqF7w==
X-ARC-Message-Signature: i=3; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796233103;
	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=OUww4n3CaQCI1H75z7bQkuP8DhXRHnbGjSd2cXlw6SA=;
	b=fq4po6PpM2ViEv2reJHEUTUkFwu+TMt6I0mJhAQE+/PoQRVCJYr9f1v3GQtQnJuDXfv2
	 X2NObhzXB0d49m8zcFW8ALz4c8LfNR+i72bHIdFtY9U1N+0sNMAOLUORv1E24PgKP27R3
	 VLds+g/2bIWdqzRwDOTd6yqLueX8s4mRtcwJ95mGGdlfrFTsSu+jVinn1+GssTpTfIkGk
	 Av57RbJoC9IBbNjJgZZb9E7JCA3jLidfU7kV0lBazELhlHDaMfbxIuUunxFE355zAUu9u
	 GAj/LT79rqn22SMqTo3ZFnHUYq/PByB/ljCLqzsl4hR+CvyaPX/o4PXxmJxzq1Hmg5g==
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=l73zrAKF;
	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 941B960A3803;
	Wed,  2 Dec 2026 17:38:23 +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=l73zrAKF
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=1796233092;
	b=GYOC9D7dU0njCRusBTPNDlZjuZ0SLWhlHNy81CjqsfORfi/U4xKsGAmY72Thj9BQokM8
	 N2yC3uoi72uN5if5udmlSqllim7H6emYraS113Q1fjQrCJuYYiEyITOoxWtTKK8Y9C2kH
	 qKDlqvk1o34tT2zC+HFZysMzgl1PGtSHshhSe243n1XbdEr6OA55b/jJOWm4tuHoZF2w1
	 rduTxZ5LcRAOaFEoqpqKlYReTReSPPij2BOuESO/7k3a73KmLyYZaKc5H615RhCAJHKpH
	 PZTfVurGPZpzHzIuFV49HcbPylmhfvIHX0B9hhhgfWSH6gnyoXP3LRtNTGz4tf8JGwg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796233092;
	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=OUww4n3CaQCI1H75z7bQkuP8DhXRHnbGjSd2cXlw6SA=;
	b=t4MWk8OFFVG8vUO4bn2IWycL0mkNZuq71p9I+Ls+k6h8bIksSdDhycFB/91EwtP9w69m
	 itfFlOPhm68LUqcTDURlluvnn1FY6nBrH7xfV7GNmpfktb0SzoARUzhW9xOv5jLrIaYpl
	 y1qoGqj8LMzwx72pY2L2z9PUTTYyl2/F1ixj3hNOyDLfVIkVfLKjhmBRFkX06uTX6HxqP
	 iIsu1O/9fyGKJ8gBupLtdjguZrL5G/Q1Q8aBLisOomilQW4ElC83J176wuDyYZmWsDQt8
	 KK7R8tdoqm8zByfVhEPBDc5dYesef2V25vaSsKEJk84S4ws9bsytCPYV6kP2Hv0X7og==
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=l73zrAKF;
	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 AFAF6606A330;
	Wed,  2 Dec 2026 17:38:12 +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=1796233092;
	b=rUDVUbT1ayxAkLfhiR3aEGMDqaeH35+khjd8pvJm5pdHd48Zlg0VZi+AgYvjPA+n77ta
	 SiWQCEFc2s6WjnECC51GGLydlBZYre8XDhdGYz10530SNN05bqYFBTohOtxlkN5gMCQAn
	 T0ultBNuZB9Qt75/PU51Zphc7emFPJWoXfxmIsMi3PEnHth3YlKTz7blKIVz8V2n87Vsn
	 rWs3u+c1jKFFarIClgwqQq/eemb8T/HJEgq9NLgt5+w2CTzZNJbuyiLbzPkrWRIXtrlEx
	 KSVidEgmT6BZXbGbsrio8IT/Lxsi2Lch2IA0r3JW7ZocJO2RKa51+iOzr4+fOdw0Dmw==
X-ARC-Message-Signature: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256;
	c=relaxed/relaxed; t=1796233092;
	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=OUww4n3CaQCI1H75z7bQkuP8DhXRHnbGjSd2cXlw6SA=;
	b=fgtzpKjQgWs66ROlSGaEXeXPhldIwTLR8T3y/E5j7igdpzxSGmH7vTVMC0bbm4J+KDOP
	 mLcjtRAEpcTb26+z/jB+oUjzRjNLPikmrlNlxqKLYYXuP+JSVKG6/ox0JUI0XzZF0WYmn
	 B9LkIXuO1e2VD7a9Ju1v5eLjqSlpUp1WEPh68ITyNPT6Vvse3PxO3iKpup6j6UtnnL5yu
	 +2uSyOzFpwRhy/O5wE0sABVEo3QPvEjucG8QZhjrIZhKtO4yKtoiNXknxtCf/Yil7HGG1
	 nmBaOb2uKul+fMqp+Lm7HLOzBGgQLe8uyWPrCckLEdsuhBEXqt6efpPvUHhUKmsT6bg==
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 13E7D1F0089F;
	Wed,  2 Dec 2026 17:37:52 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1796233092;
	bh=OUww4n3CaQCI1H75z7bQkuP8DhXRHnbGjSd2cXlw6SA=;
	h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To;
	b=l73zrAKFh3p4q6bNjqjQiqy5XFgu8Uaxu7O+H8C7LmoetT7/YNQcCJJ5BN+SDW7We
	 boB+oyy2gK1o1e1uT5hMnLhOy82L5rstV3tzTV54VZb1fwvfY7lFKgh9hJ5VggZKgq
	 LdjXPQ1ULPoOj28M908yxA/hLWpa3fwjCsPHxDIrLD5yhHUk1fMtQ2N9XCYJ/IHpy7
	 ebbXGPj6tqsX6GR88NXvODmxID5OtxTdqaIIU0ACW1GvXVVZaBPlx4cIgXu4qYreTP
	 guo41fO9oBUT+4QaUscReHlL1jwXp19X1JoHYdfEsaNJYR4d3irw/1oYLXRNDmGftu
	 VtZxlsP2zXGYw==
X-Received: from nexus.subspace.kernel.org (localhost [IPv6:::1])
	by lkml.kernel.org (Postfix) with ESMTP id 93FD14F58D;
	Wed,  2 Dec 2026 17:37:51 +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: <20261202-s2500-mac-phy-support-v13-0-a2908fad2693@onsemi.com>
X-Cc: Selva Rajagopal <Selvamani.Rajagopal@onsemi.com>, 
 netdev@vger.kernel.org, devicetree@vger.kernel.org, 
 linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, 
 Jerry Ray <jerry.ray@microchip.com>, 
 Ciprian Regus <ciprian.regus@analog.com>
X-Mailer: b4 0.13.0
X-Developer-Signature: v=1; a=ed25519-sha256; t=1796233065; l=5864;
 i=Selvamani.Rajagopal@onsemi.com; s=20260531; h=from:subject:message-id;
 bh=wgNuPqoy3APXvdJ8OId7dtxDsRCWnTSbtvuU9uaAdsU=;
 b=8OVEb5L2Gz8W7H90Ikv+LFOEpX9fUCCoUG8EvVSk4x6smKZVQpwEAsUy9PCt7gVfopaXv2aCk
 cWDnGUqoOOdAO2NbOUzKHIBI1MDjYN1fUK1Q//PDVnKaFvqwJSmqb/d
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