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 5B3D830F95F; Sat, 6 Jun 2026 05:42:50 +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=1780724570; cv=none; b=ucWJsuaeMCuEdCXDBJyTvxGpdOTEwGeWpTn8Resyv+Eilq+TYx85XaA5GvvW19POydV2aLS972S3Lt0g/D2FG3EmrzqJR/TsLvPuL89wjt5c/mdmOQcKC79cwoK2zXxm0+OuZAhq3O5CrBVOmzgj3/9CRBTmqGaUitfTgt9iqlw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780724570; c=relaxed/simple; bh=LwObKbMYH5trZ9xLMT05dZHy//hBzE5Yhld+T95HsCU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=MMTttzEvS/bVz+o/PNAuMA2xgloBPSPIJWKquEGOItVodhuVD4qVjiNXf89uFLxHOwWEm3S6TzDMhn9QG5VmjQbOODM1u9jlbsGHOnLYN+At9X69BOscUUyw7FZG26BAyI3ispnMRkVIuQE48FN7adWLHC807euV4rcqH49CPzU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=p53DixIh; 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="p53DixIh" Received: by smtp.kernel.org (Postfix) with ESMTPS id 3AF4BC2BCFC; Sat, 6 Jun 2026 05:42:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1780724570; bh=LwObKbMYH5trZ9xLMT05dZHy//hBzE5Yhld+T95HsCU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=p53DixIhEszCg6onyjTt0EzJ/lU/vnhSiUhDxpyYl0oAXq6qJa9APftdf56Aesh4n GgyovOcrU34yMeQBfL5jIbpo3WPFuYMhsNDUls4CeJpRKATJ1EyLCIQoxUczszkH3t 1gQ3Eyq2E92w1qj6UH27zoHnOF+/IyNSiZ3/PYRRPYhB+LQ6hJ0aaZYV+bHqse4c8C tjGYUa6IqNQgL/U6qIVnmBDejJDLbNgIyZudtbi8CcZBjP33p1X5uiWtdIzpco3X7g ekLMJ/Zl/LBnmT8S/3XT2XpAZlX+Du9CiSi7BURJXQm4IwpH/dcB+G3YgD7jT7BcMH jihxbiJrwSHnQ== 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 342A7CD8C93; Sat, 6 Jun 2026 05:42:50 +0000 (UTC) From: Selvamani Rajagopal via B4 Relay Date: Fri, 05 Jun 2026 22:42:47 -0700 Subject: [PATCH net-next v4 16/16] Documentation: networking: Add timestamp related APIs to OA TC6 framework Precedence: bulk X-Mailing-List: linux-kernel@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: <20260605-s2500-mac-phy-support-v4-16-de0fbc13c6d8@onsemi.com> References: <20260605-s2500-mac-phy-support-v4-0-de0fbc13c6d8@onsemi.com> In-Reply-To: <20260605-s2500-mac-phy-support-v4-0-de0fbc13c6d8@onsemi.com> To: Andrew Lunn , Piergiorgio Beruto , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Andrew Lunn , Parthiban Veerasooran , Selva Rajagopal , Richard Cochran , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Simon Horman , Jonathan Corbet , Shuah Khan Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-doc@vger.kernel.org, Jerry Ray , Selvamani Rajagopal X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1780724562; l=4814; i=Selvamani.Rajagopal@onsemi.com; s=20260531; h=from:subject:message-id; bh=qMIzLX0eC5ihmFdaKnhKOPCk6N1TEOL8NPk1LNjEmH4=; b=K/RVcj2az8TbAlcs1pGNk3cydG43TjXs/KRPyZsvcKVB3OaD4G9k8JQhjkhDTT5aAmn8cLobV zxHaDTIL7c0D3+u/dd3GjUT4UkNsmV0Hi2iBU3pP3IYSv9MncQfKNMF 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. Signed-off-by: Selvamani Rajagopal --- 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 fe2aabde923a..694d9485b1c5 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 ~~~~~~~~~~~~~~~~ @@ -495,3 +499,75 @@ 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_ioctl(struct oa_tc6 *tc6, struct ifreq *rq, \ + int cmd); + +ioctl interface to handle hardware timestamp and PHY related commands. + +.. 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_registers_mms(struct oa_tc6 *tc6, \ + u16 address, u16 mms, \ + u32 value[], u8 length); +Writing multiple consecutive registers starting from @address for the +given @mms memory map selector in the MAC-PHY. Maximum of 128 consecutive +registers can be written starting at @address. + +.. c:function:: int oa_tc6_write_register_mms(struct oa_tc6 *tc6, \ + u16 address, u16 mms, \ + u32 value); +Write a single register addressed by @address and @mms in the MAC-PHY. + +.. c:function:: int oa_tc6_read_registers_mms(struct oa_tc6 *tc6, \ + u16 address, u16 mms, \ + u32 value[], u8 length); +Reading multiple consecutive registers starting from @address for the +given @mms memory map selector value, in the MAC-PHY. Maximum of 128 +consecutive registers can be read starting at @address. + +.. c:function:: int oa_tc6_read_register_mms(struct oa_tc6 *tc6, \ + u16 address, u16 mms, \ + u32 *value); +Read a single register addressed by @address and @mms in the MAC-PHY. -- 2.43.0