Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp737605lqb; Wed, 29 May 2024 09:06:22 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVQGAEIiTg6iKLxHRGk53lMfavd2OHq63dpcSN+zr326d5O3REN0pUP+/gAnSVS8vgRuLfMhX9S5bFO8dQWXn8usbGNt8AgX+RaJYnkWQ== X-Google-Smtp-Source: AGHT+IFAhS+m1NcC31XeYBQUgtB7kkdRy7cIIjd2m04iMlvEZUo7x6w6URWUOcD2YikBHKWr7jMp X-Received: by 2002:a17:907:7e84:b0:a62:b0e7:610b with SMTP id a640c23a62f3a-a62b0e7620bmr1063975666b.29.1716998782173; Wed, 29 May 2024 09:06:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716998782; cv=pass; d=google.com; s=arc-20160816; b=WApo/drMWYTTJ1RWcSrmttINqS+wZlRO3Q1KhNAz5kPlEW6qMuo7YO1Q9EzdwBXbbE v8o7JQLL65wIwZISaLL4agqIa4BVW28uk60fefJ1bHvaCViaKA3eIw05+K8OqCC6ce5D W0D4k20asvcaqI39bKyhIb00wG359DQtYBSq1okB5/Zf1jeBnZD/aaYU8quEhEiyMEIK 003GljGEiTwbFibKApx/RiEVu7teiLK8D8W4Hpq8Xff4lGzv93kh/9dizHU3Uq/uw7Vf DVSaJZa3U2KX6N7nnbnQaMO5729IxKa+iGgiC77mZwGzEQ8W9ZLUAk4MJGo9rMZUKidY Ux/A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=feedback-id:cc:to:content-transfer-encoding:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:message-id:date :subject:from:dkim-signature; bh=0Y8mqvn+ASO0qgqEBYkV7o/QyQw+Qg4BOBuSdQRySBU=; fh=O31swR33Q9BCrCgZsims0e0hEnEA7XKhc6flmHI4BT8=; b=PJDy4cOX1dqE2dKpxb2K1WyLhGYfzVS81W4xWivQDTtZbj1Lk+y6cDsWrGoQoFbV+I lKCSx7sbuns5/0Vl30l+/3mzmNjqmfAMITZ69dF7GpPPK9PqIs6B4sZNQZGI762Atf1L JzPusSmfdg6iY8EMutmJx1nO7/9/fzd6SbYm62w/FuF6rS5NMM0npYRZWesg33JEpnq0 Leneyry9uI3DfHqgWgBmqjqgBXEAKxSkwfwHtQ4r6UFE59A7iA7bdmJDTpyoYh1W9mvl dXl/cIpeELCrUPUumXLLE0iyL7eUy/q5ca/sKPLVr4OFUaWY0S5IUupM1JSWrz3frehq famA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@siemens.com header.s=fm2 header.b=ASnKYqZX; arc=pass (i=1 spf=pass spfdomain=rts-flowmailer.siemens.com dkim=pass dkdomain=siemens.com dmarc=pass fromdomain=siemens.com); spf=pass (google.com: domain of linux-kernel+bounces-194412-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-194412-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a626cc36bdfsi637433866b.445.2024.05.29.09.06.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 May 2024 09:06:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-194412-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@siemens.com header.s=fm2 header.b=ASnKYqZX; arc=pass (i=1 spf=pass spfdomain=rts-flowmailer.siemens.com dkim=pass dkdomain=siemens.com dmarc=pass fromdomain=siemens.com); spf=pass (google.com: domain of linux-kernel+bounces-194412-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-194412-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id B45991F2161E for ; Wed, 29 May 2024 16:06:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B64D6187339; Wed, 29 May 2024 16:05:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=siemens.com header.i=diogo.ivo@siemens.com header.b="ASnKYqZX" Received: from mta-65-225.siemens.flowmailer.net (mta-65-225.siemens.flowmailer.net [185.136.65.225]) (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 304AD1836E9 for ; Wed, 29 May 2024 16:05:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.136.65.225 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716998744; cv=none; b=ayCHpOzfbSiKo1fQjyJu3NpYrnTO7WNwEdy1lr2BQ8Te7VKTjQe93z2Cp+8zv5n+3KQx7ihLMPzyKWuLyMst4HYxpwvAkjFjzFQi7CpdgjgTkR5uOAo9ngBl4UsAAsVT6sm46Pe6pQVIS4iOXCEXKDbkUQv0md4ZezLu/Wd90z8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716998744; c=relaxed/simple; bh=gwX2kkdkZRLairWU2xTI1d16ODW2DyEZw3WNUACnlWk=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=m8bO8LtcDcMfnQMSvrKhCHvnwKC5jCkYVqBTNLVC46lDyawj2fDNDsvn6Nfz0sqd4VTrpNbSrzcdsTuS89POGWeht/je7CtuR/x9b9MAyczbC8+VQkUlhkTTz15e/8X+asnoMHPryUAFNeuaJjNCdxxJD+d8UPJqWNbfDml46Kw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=siemens.com; spf=pass smtp.mailfrom=rts-flowmailer.siemens.com; dkim=pass (1024-bit key) header.d=siemens.com header.i=diogo.ivo@siemens.com header.b=ASnKYqZX; arc=none smtp.client-ip=185.136.65.225 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=siemens.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rts-flowmailer.siemens.com Received: by mta-65-225.siemens.flowmailer.net with ESMTPSA id 20240529160533eeadbdd3344c175fd8 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> 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 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 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, -- Diogo Ivo