Received: by 2002:a05:6500:1b41:b0:1fb:d597:ff75 with SMTP id cz1csp96271lqb; Tue, 4 Jun 2024 06:16:07 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVEEnH6FrKU+DNna9P3adzLV8vkHnHPs43Fc1m52YfamX6FuWA4i7voyxbiQ94b8mZocT1Kmn8z6dBBQPYrXDixmRKKDwDgBEsB32lJsA== X-Google-Smtp-Source: AGHT+IHDaoLrk1EKsVtcdZzArypOsrEe4kGQAB53kw5MhBVdS2nxpThK7Ybmd7oBtgK9VwXvs9wq X-Received: by 2002:a17:903:2449:b0:1f4:985a:ba83 with SMTP id d9443c01a7336-1f63707e78emr144742885ad.48.1717506967385; Tue, 04 Jun 2024 06:16:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717506967; cv=pass; d=google.com; s=arc-20160816; b=Z4v7Lvr1l1KZ2XfhD2OmAG/VK8gV19u+eylIPJRBx77UdtOtr7wis7Y5EUu7YJoovD cWoz0OZhtUy6Mote6u2fCYiQU5l9zQKgKlyDTCYIztIrAKCFtAA8fEYt46KTz1horiou wb0ZUw20clk9RpD+AYq/mFEwGCBP+Asl1RBDHj4u5UJ173Y6cTjtiOmvnZ0g8ExpZNNT Q6xYmdtibiA4YIXVvBu4jHdhbTPG2qBT2dLhZGw4V3Qyd6Pvyc3PSV9wUVv4M2xPPejO /oG9nJvxPcCB3RN7ZKQGjqeNfdtQX4230K2GITIlLRaYrvUgUr3BOq8xmnGfBziX+cmO TH7w== 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=G4cQmy7CbcUofO7XKPsbl0jSqmp8k3uPxgYXTGCvYM4=; fh=WzXaSz7O0nvKAPxuEMDfPgGNT0/QiwM+PpEHWX5gjWo=; b=u/FyPvuq9OGX6CDQkRroQ3c647B1Ah5R85/Vfrp+Psd0XC5NiQFwpApvbu+GZGY2pr /kiwND4bLNxNtIHwPpDlc3h9Iuw/lKgY8+qpCx12SEzCyQaljA0P/jgmMxrosrXFdKLN NsIWrFQdUUzZJEcAmozVuGH3azFbP2U64Qopu3NZDTaqMGXI0RB1MF5MVO1no2r3LjPc GlwL3MX1m8aYqpVCZXoN9g4515PiNQbO5p8BC600jL/YzQKr2SP0tIExHQRrI8gemMew z+QoIjKU1NqEp/nRhXws7Rc5GOOdUinKMMel5+IGy0sLRBrDnopVFsOE2nTqAXy3Wb4u xmMw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@siemens.com header.s=fm2 header.b=nuYGQBRa; 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-200679-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-200679-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d9443c01a7336-1f632426fb4si82157755ad.645.2024.06.04.06.16.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 06:16:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-200679-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@siemens.com header.s=fm2 header.b=nuYGQBRa; 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-200679-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-200679-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id E68442825D0 for ; Tue, 4 Jun 2024 13:16:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7A78F146D78; Tue, 4 Jun 2024 13:15:39 +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="nuYGQBRa" Received: from mta-64-228.siemens.flowmailer.net (mta-64-228.siemens.flowmailer.net [185.136.64.228]) (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 C5CA8146591 for ; Tue, 4 Jun 2024 13:15:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.136.64.228 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717506938; cv=none; b=JgnPYFauWUnQ7o/YfMUdKJn+cVFcIHKruOiKM1JLXUAr1Mx1GuSjeGcs1YhqZGxam6LbFso10B88/j8azlnS3nlAlPfRZO5ArAFZal/wng7wbwtzwd0LANTx0jyXvYb8yF5BwckVuu0/M/q+xXfkNVObGIn+RvejQzf4xzYxPCg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717506938; c=relaxed/simple; bh=DButXpkKLCVpKLooxjGachqXWYUOoZ1VJfazz4Gocqk=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=PZ2T9ekaJ2tEReCXIeo876xgQIleDKRgTuCbJmgqpcQLlOr2aXXD5whr+B2t/eBHd+4qyqo0RL+TJqzUfbzcl8rnnW0tO/smjBtueiGxxknDY7ovVdT1pAk3dSgRQY8X6/HfU8cBbGWHkGTGX4hA7tfUoj6bLffs7DKLggdk2cI= 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=nuYGQBRa; arc=none smtp.client-ip=185.136.64.228 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-64-228.siemens.flowmailer.net with ESMTPSA id 20240604131525ef92ae7a21cd43c559 for ; Tue, 04 Jun 2024 15:15:25 +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=G4cQmy7CbcUofO7XKPsbl0jSqmp8k3uPxgYXTGCvYM4=; b=nuYGQBRaVePixTrPNaIvgAFNdBmVzhgYSNombKiN+GoWprNPp+isfbsCOVQMk2L0KyHt3j hHR+m0LXFP/NctMLDAXSzDfNCDJDAT0A82dwKHDNXwN2gQJF49p5HzOZX1+V1SN+BhkJpgTX hVza+p4fH9HKcRItrwVwpoRcctf1c=; From: Diogo Ivo Subject: [PATCH net-next v2 0/3] Enable PTP timestamping/PPS for AM65x SR1.0 devices Date: Tue, 04 Jun 2024 14:15:09 +0100 Message-Id: <20240604-iep-v2-0-ea8e1c0a5686@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=H4sIAF0TX2YC/1WMQQ6DIBAAv2L2XBoELeqp/2g8CG7rHgQDhNgY/ l7CrcfJTOaCgJ4wwNRc4DFRIGcLiFsDZlvsBxmthUFw0fFejIzwYIPW3SKNHvljgFIeHt901ss LLEZm8YwwF7NRiM5/6z611f+dUss4U0JJw1U/ilU+A+GONtyN22HOOf8AZut60aIAAAA= 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 , Jacob Keller , Simon Horman 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=1717506924; l=2637; i=diogo.ivo@siemens.com; s=20240529; h=from:subject:message-id; bh=DButXpkKLCVpKLooxjGachqXWYUOoZ1VJfazz4Gocqk=; b=8/DOE0yNPzKrkUD8wKBATO1Fa0Ok+FuvybDpdld6vrNy0G/8Xv9uh1pFPa4UWS/eV4HcZLRgd 3To6L4eRY9cAD+CTgvsehPCW2gch0D04ka9NTPbSa9iiKPMiz6m6OpG 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 --- Changes in v2: - Collect Reviewed-by tags - PATCH 01/03: Limit line length to 80 characters - PATCH 02/03: Proceed with limited functionality if getting IRQ fails, limit line length to 80 characters - Link to v1: https://lore.kernel.org/r/20240529-iep-v1-0-7273c07592d3@siemens.com --- 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 | 74 ++++++++++++++++++++++ drivers/net/ethernet/ti/icssg/icssg_prueth_sr1.c | 51 ++++++++++++++- 3 files changed, 136 insertions(+), 1 deletion(-) --- base-commit: 2f0e3f6a6824dfda2759225326d9c69203c06bc8 change-id: 20240529-iep-8bb4a3cb9068 Best regards, -- Diogo Ivo