From patchwork Wed May 29 16:05:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Diogo Ivo X-Patchwork-Id: 13679178 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CD83BC25B75 for ; Wed, 29 May 2024 16:06:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:MIME-Version:Message-Id:Date: Subject:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=iCKbBSSOsr2aNRpI7BfKmnEilN7NIjGi/x8mTVDgAw4=; b=TRXPizqFy1AOIr eRtAvMdjvnvsHFl9GH4EH2aej5qKzVrydw8pARkqUV8lLZRjSYRrfwA9m2H4UvxSdoF4Mz9FleUKy 4ktM8MFW8sQRlTyrfGHjef0YFxBnLfdsqaiuvSF7MCkB62RdPYIXxarLRvR6LK1yuB4+dJ4tR6ZkA Dt5CYygMvVHRPbAbGp1TuF2iS1lRWDCyHsn8f2Rwk9CfYRXQxSYqiiTgJbZMUUpNYSXRpseSvIa6c kmVZvv8IFkFF/WosSuiF5hZZqtM0Kx+3MSoQ3nlQwen96OLED8ywXBaGvYu0I6T1W3ev0pmsfFqXD 9EndtKHG5AKotEhfKs+A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sCLoB-00000004ppy-37cU; Wed, 29 May 2024 16:05:47 +0000 Received: from mta-65-228.siemens.flowmailer.net ([185.136.65.228]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sCLo5-00000004pl0-3Ocq for linux-arm-kernel@lists.infradead.org; Wed, 29 May 2024 16:05:44 +0000 Received: by mta-65-228.siemens.flowmailer.net with ESMTPSA id 20240529160533b8c4c008b4c1a428d7 for ; Wed, 29 May 2024 18:05:34 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm2; d=siemens.com; i=diogo.ivo@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc; bh=0Y8mqvn+ASO0qgqEBYkV7o/QyQw+Qg4BOBuSdQRySBU=; b=ASnKYqZXzj31Ew5QmPDwoTZ2XUPiW8iQq1pA7F+DQoOViQJ6Gje+tA1/PTnJYeCSut2YVM qxiHD1L+r8D24Lu06fGqQSwL80xB/eT8Vpe9PX87fbSVGlOJoFsFzJXKFB37bH4HtVCX46iF WpqlFu0u0FN2CH8Uzw8HQLVWLWns8=; From: Diogo Ivo Subject: [PATCH 0/3] Enable PTP timestamping/PPS for AM65x SR1.0 devices Date: Wed, 29 May 2024 17:05:09 +0100 Message-Id: <20240529-iep-v1-0-7273c07592d3@siemens.com> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIADVSV2YC/6tWKk4tykwtVrJSqFYqSi3LLM7MzwNyDHUUlJIzE vPSU3UzU4B8JSMDIxMDUyNL3czUAl2LpCSTROPkJEsDMwsloMqCotS0zAqwKdGxtbUAvyR4M1U AAAA= To: MD Danish Anwar , Roger Quadros , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Richard Cochran , Nishanth Menon , Vignesh Raghavendra , Tero Kristo , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jan Kiszka Cc: linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Diogo Ivo X-Developer-Signature: v=1; a=ed25519-sha256; t=1716998732; l=2334; i=diogo.ivo@siemens.com; s=20240529; h=from:subject:message-id; bh=gwX2kkdkZRLairWU2xTI1d16ODW2DyEZw3WNUACnlWk=; b=p8e2carzdqE3em6oz7uTTHcMm8aNDjPGFGRJ3Bo2Zb2h9cFywKIi20rkffqeBDCUVtOF9/xPQ Gc/l9HZbxmFBp2EKuJyuwknWSs6/LHkP8W2f0PQAhwd3Jkw34/pX/rx X-Developer-Key: i=diogo.ivo@siemens.com; a=ed25519; pk=BRGXhMh1q5KDlZ9y2B8SodFFY8FGupal+NMtJPwRpUQ= X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-1320519:519-21489:flowmailer X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240529_090542_705217_A25AD3F1 X-CRM114-Status: GOOD ( 17.90 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This patch series enables support for PTP in AM65x SR1.0 devices. This feature relies heavily on the Industrial Ethernet Peripheral (IEP) hardware module, which implements a hardware counter through which time is kept. This hardware block is the basis for exposing a PTP hardware clock to userspace and for issuing timestamps for incoming/outgoing packets, allowing for time synchronization. The IEP also has compare registers that fire an interrupt when the counter reaches the value stored in a compare register. This feature allows us to support PPS events in the kernel. The changes are separated into three patches: - PATCH 01/03: Register SR1.0 devices with the IEP infrastructure to expose a PHC clock to userspace, allowing time to be adjusted using standard PTP tools. The code for issuing/ collecting packet timestamps is already present in the current state of the driver, so only this needs to be done. - PATCH 02/03: Add support for IEP compare event/interrupt handling to enable PPS events. - PATCH 03/03: Add the interrupts to the IOT2050 device tree. Currently every compare event generates two interrupts, the first corresponding to the actual event and the second being a spurious but otherwise harmless interrupt. The root cause of this has been identified and has been solved in the platform's SDK. A forward port of the SDK's patches also fixes the problem in upstream but is not included here since it's upstreaming is out of the scope of this series. If someone from TI would be willing to chime in and help get the interrupt changes upstream that would be great! Signed-off-by: Diogo Ivo --- Diogo Ivo (3): net: ti: icssg-prueth: Enable PTP timestamping support for SR1.0 devices net: ti: icss-iep: Enable compare events arm64: dts: ti: iot2050: Add IEP interrupts for SR1.0 devices .../boot/dts/ti/k3-am65-iot2050-common-pg1.dtsi | 12 ++++ drivers/net/ethernet/ti/icssg/icss_iep.c | 71 ++++++++++++++++++++++ drivers/net/ethernet/ti/icssg/icssg_prueth_sr1.c | 49 ++++++++++++++- 3 files changed, 131 insertions(+), 1 deletion(-) --- base-commit: 2f0e3f6a6824dfda2759225326d9c69203c06bc8 change-id: 20240529-iep-8bb4a3cb9068 Best regards,