Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp482660lqt; Fri, 19 Apr 2024 01:27:19 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXwTLA84nIodiN2ZHKhIxHYNZL4nGzVgydmZLa7QA9NGGijN3m/wGxmjCZ9gid8TCN5p5etPEUmSzRnHeZHWxQnIExL5/D6X3PEJNabXg== X-Google-Smtp-Source: AGHT+IGUymccfFVU4xpKYbvIPhdsUbIZSjAhlAp8dPWcbp7UO0Knrl0Ir2PIEbb5ZBF4KKdpH3QX X-Received: by 2002:ac8:5a89:0:b0:436:6593:e680 with SMTP id c9-20020ac85a89000000b004366593e680mr1699498qtc.38.1713515239463; Fri, 19 Apr 2024 01:27:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713515239; cv=pass; d=google.com; s=arc-20160816; b=uoeQYfL3iEeS8VLMjIs4ZMhuRQS/nGenhRlZs51pMWtQr/b0IxYMd7niOV/9x4b9lA 9P0bKz88Eyz+XUIvEx31ljwesakpxLt+PpFueO4/EDY8z1l0zCOZdjXNotsVsngoO6pw 32vbndHhjssSV1r3zV6W8969QKayATg4JJs0MmnkFNuZJ2YAd4BqZHfWTL9zOYNxC/Ub ZpwjuN2CQgGt/HK8oDF8wxeV4780RKjsMicP2kLQxp5wZLeJmm/TkrINsgA0E/aZNyru MLbRNYp5tkmGsBNznxwnIg3/Ckbu0ZDyF2D/JzJkATGdKeZvix6UkoMBg+tzhMVnS0Fi LVKA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=2ZZ/WurYzNmG+fF4XG7e2gevauRo3lC7JLRh3tkitu4=; fh=hDv8dykGTnuRTxdTcT6clQ6egLOvT0exm5/L6JOegpg=; b=RtSiia6OjdHKUCGIJluJ/f7cJqiORd57wlTxc/g6xnYvbShs2sE20Jm/Tgg6Dgxl/g gAQVB7PTg0vqKVTemxKexd2JcOCttTmGBcqGYutpXjU0u9OlcgDzoz9H2FtpGEO+qmxF i7J4XVGhwvr8Go5vKdNBhHqVhSbGV+n9372t0N8hIS1JvetFeXMd6/gwWiXMJ8MUdAuB zpXxFNCbrlyPJgux38xVT8TsthdysI9d0XPoOtk5h9Fj+yR3eWUTJ6mY+PjzPF7cRVcf 21adLPuO8Q0hbv+NiPfJgeLvr9vad846efH5nXcJNwGvV09xMyQSpcuuXBnT/Xa90yX8 FntQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=EBOctmOK; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-151161-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151161-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id l12-20020a05622a050c00b00434ef25b15fsi3228495qtx.790.2024.04.19.01.27.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 01:27:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-151161-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=EBOctmOK; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-151161-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151161-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 3426B1C2092F for ; Fri, 19 Apr 2024 08:27:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 785DC5A4CA; Fri, 19 Apr 2024 08:27:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="EBOctmOK" Received: from lelv0143.ext.ti.com (lelv0143.ext.ti.com [198.47.23.248]) (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 3B9104AED9; Fri, 19 Apr 2024 08:27:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.23.248 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713515229; cv=none; b=XmQAlRopRD3xqKdyhmcfXupbWtgJjkWHpw0PKYOA8EZUh4jCkjitnaY//qjhNRyxL0k+2XlPJQ7d7ZTtH0JHYirVSvTkX6DJnVPgUrhtYiC8X2YeEDr+/a/rWwSyIXaot1xG6rP+JuwBG2c4bt4b01bLPB1+14QQ/JKJkHARii4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713515229; c=relaxed/simple; bh=ofgIfXEUZyXIhhEeNyNeHg/vT25Lnt/08niZkgCBmec=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=mJ7D6HotLuP9heSaY31UoYJ3h8XGMPM4kCm5NHiWPY/gkUyuPMhgp/M2v+R56I5T8S7cYAtrM1sYoXJpbjDtfrmkC4tNhRBD5dVAKIXAo2qXL9qi2Fp6spkmxG+AykQ6PXoPS7PeTlhaoGpzy3yBYx9OhxKfkXB+r8TUFWs3Ekk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com; spf=pass smtp.mailfrom=ti.com; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b=EBOctmOK; arc=none smtp.client-ip=198.47.23.248 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 43J8QoE0038515; Fri, 19 Apr 2024 03:26:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1713515210; bh=2ZZ/WurYzNmG+fF4XG7e2gevauRo3lC7JLRh3tkitu4=; h=From:To:CC:Subject:Date; b=EBOctmOKRAvqwd8H1/+IUAjwHepvT6D7Gbk8wnCDEdHXDpJbJYgrAS+y5+1i/Exu0 hkXZwShb8k6HDuArNHOG+G964/9C3qOFP+ak/A3Ns4g7gDrSKuatSZgOlaFK56NLk6 NthLmc6c7ubiVl9fTKpOiCa8g/w/tQa7VguwRj5E= Received: from DFLE103.ent.ti.com (dfle103.ent.ti.com [10.64.6.24]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 43J8Qoqo127401 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 19 Apr 2024 03:26:50 -0500 Received: from DFLE108.ent.ti.com (10.64.6.29) by DFLE103.ent.ti.com (10.64.6.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Fri, 19 Apr 2024 03:26:50 -0500 Received: from lelvsmtp5.itg.ti.com (10.180.75.250) by DFLE108.ent.ti.com (10.64.6.29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Fri, 19 Apr 2024 03:26:50 -0500 Received: from localhost (chintan-thinkstation-p360-tower.dhcp.ti.com [172.24.227.220]) by lelvsmtp5.itg.ti.com (8.15.2/8.15.2) with ESMTP id 43J8QnZv042265; Fri, 19 Apr 2024 03:26:50 -0500 From: Chintan Vankar To: Julien Panis , Arnd Bergmann , Dan Carpenter , Heiner Kallweit , Chintan Vankar , Vladimir Oltean , Andrew Lunn , Roger Quadros , Richard Cochran , Paolo Abeni , Jakub Kicinski , Eric Dumazet , "David S. Miller" , CC: , Subject: [PATCH net-next v8 0/2] Enable RX HW timestamp for PTP packets using CPTS FIFO Date: Fri, 19 Apr 2024 13:56:24 +0530 Message-ID: <20240419082626.57225-1-c-vankar@ti.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 The CPSW offers two mechanisms for communicating packet ingress timestamp information to the host. The first mechanism is via the CPTS Event FIFO which records timestamp when triggered by certain events. One such event is the reception of an Ethernet packet with a specified EtherType field. This is used to capture ingress timestamps for PTP packets. With this mechanism the host must read the timestamp (from the CPTS FIFO) separately from the packet payload which is delivered via DMA. In the second mechanism of timestamping, CPSW driver enables hardware timestamping for all received packets by setting the TSTAMP_EN bit in CPTS_CONTROL register, which directs the CPTS module to timestamp all received packets, followed by passing timestamp via DMA descriptors. This mechanism is responsible for triggering errata i2401: "CPSW: Host Timestamps Cause CPSW Port to Lock up." The errata affects all K3 SoCs. Link to errata for AM64x: https://www.ti.com/lit/er/sprz457h/sprz457h.pdf As a workaround we can use first mechanism to timestamp received packets. Series is based on linux-next tagged next-20240419. Link to v7: https://lore.kernel.org/r/20240417120913.3811519-1-c-vankar@ti.com/ Changes from v7 to v8: - Removed empty lines between trailers in [PATCH v7 2/2] as suggested by Jakub. Chintan Vankar (2): net: ethernet: ti: am65-cpts: Enable RX HW timestamp for PTP packets using CPTS FIFO net: ethernet: ti: am65-cpsw/ethtool: Enable RX HW timestamp only for PTP packets drivers/net/ethernet/ti/am65-cpsw-ethtool.c | 13 ++- drivers/net/ethernet/ti/am65-cpsw-nuss.c | 51 +++++----- drivers/net/ethernet/ti/am65-cpts.c | 107 ++++++++++++++------ drivers/net/ethernet/ti/am65-cpts.h | 11 +- 4 files changed, 118 insertions(+), 64 deletions(-) -- 2.34.1