From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=100.103.45.18 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== 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== 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 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) 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 Authentication-Results: smtp.kernel.org; arc=none smtp.remote-ip=100.80.115.77 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== 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== ARC-Authentication-Results: i=1; smtp.kernel.org; arc=none smtp.remote-ip=100.80.115.77 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) 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== 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) From: Selvamani Rajagopal via B4 Relay Date: Wed, 02 Dec 2026 09:37:45 -0800 Subject: [PATCH net-next v13 02/15] Documentation: networking: Add timestamp related APIs to OA TC6 framework X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Message-Id: <20261202-s2500-mac-phy-support-v13-2-a2908fad2693@onsemi.com> References: <20261202-s2500-mac-phy-support-v13-0-a2908fad2693@onsemi.com> In-Reply-To: <20261202-s2500-mac-phy-support-v13-0-a2908fad2693@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 , Willem de Bruijn , 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=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 Reply-To: Selvamani.Rajagopal@onsemi.com Content-Transfer-Encoding: 7bit From: Selvamani Rajagopal 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 Signed-off-by: Selvamani Rajagopal --- 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