Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2006180lqz; Tue, 2 Apr 2024 04:45:07 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWPd7HjK5+4hwd7D97KK7w6kwIEeKbXkldAeobogVuU5ghkmY4NdqF0vJ6Z0C2DNrtThtTI8McW/XOmcROOygr7ByU5Tx/bV0Rsd3+j6g== X-Google-Smtp-Source: AGHT+IHaiB9MV+gitKiVy61CKjbiRawHHesgV8tvbT9/Y7TjLG67OUAhh87CYSnd6fc0T2natvNe X-Received: by 2002:a17:906:f343:b0:a4e:3308:21e0 with SMTP id hg3-20020a170906f34300b00a4e330821e0mr7042056ejb.10.1712058306848; Tue, 02 Apr 2024 04:45:06 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712058306; cv=pass; d=google.com; s=arc-20160816; b=FNchpdzlqSEiKShvFQCvw1/GaUUqOcdOneJP9t8doPrHoBWTNYGOfjUQkxBZapE5xv UCwJKFC6l0JpZGCtdtnIGC7o4ZGot6ZNtrb0wXGNCVHZZnY/qRcAY3fpgm5oix4Y2Iji gvvQsvAomQ0H+zojk6HmJLHJJUVBA7C/hos3C6AA7jj5/kYKVldfEwPACmFnV3/MEg+W Y/TnfiugEpaVZadIz9XFL7f6jvusFd1Y/QO7ujCJaFZTCkL530SUsdM8wQP2tCKDvpn4 sU3puCGMTI99sh8UFHHCPuPKoDUyEsvhjQ/KDjMkTRq8vT/azvLxPfM05rdAPw6cN/66 XfSg== 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=sh3LQCdFxCykwoTOJhgerGFGuJZbahgKwqL4JpT+OdE=; fh=MC58I11Gz90KE/woPbibl3oxW17lg4REvtw9+VAA1Vs=; b=jix2QDMUvEHWEv+JfZyKX2Mn6RQL7HMBRbY4RgjEdLL+r40HOaNr9/7NR9zTaYx2IW fXOHD1pFKvnMyCYV5hTiWEwsWBXJwBVYn+25ZnLcpkTyt515mPKtDhdPmLTcOHBGPAyp 6TJ0ovMN0rBrRUvWJaFhfDBAFCORqfeuDaA+IQlXCdxmT1AyaY3X+8o8X3gcoc+9X8SN NfQklz4DYDob1vcajMTZjvzndsS0PJIkObxAMeCh5DuiS5V72hdmZX1N4RE9AnaQwolW k+NQhj6Lb4hMicO+to5xc9fsU2N3tUdspHI3VR/EBTGgfYHzO2s8oFYLi/IWCo/QWJWo tfWA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=DmdydIF8; 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-127879-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-127879-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id la20-20020a170906ad9400b00a4e85d104b4si760485ejb.366.2024.04.02.04.45.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 04:45:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-127879-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=@ti.com header.s=ti-com-17Q1 header.b=DmdydIF8; 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-127879-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-127879-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 7A8171F247BE for ; Tue, 2 Apr 2024 11:45:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8482878283; Tue, 2 Apr 2024 11:44:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="DmdydIF8" Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) (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 8FF9F69979; Tue, 2 Apr 2024 11:44:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.19.142 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712058273; cv=none; b=PMlzfrPsz5JJL0nJxXB58zPfLuPvg3OM9+wgw6kEuFfq1dpGSfPJLA3h6/hydHIvH5zeDCfCP60KXcFBPSjHjNxFwjzVW/qikauYrUa7yS3jvKD/KdVYjMTZQU2HcpdFd3G38pHg9JtRw5FpzWHqYpZ9r6eEjr3hmF5RBrgVICk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712058273; c=relaxed/simple; bh=AuMo0OYxSwQJjavMi1CoqMKsM6fTwjYKi6dyzUZOR1o=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=abhdI3hhCJWhHEl67unZ+NK8c8VAniSCVitZvAYlVuBpaoW/7tVLQMQSoOv1JCqXRLGAcvHTQKEWS4+XL2V3mN/lklWXSfLWmY+V/I/2p2dXoQPz8vDe5fkFLdvEwZjgUQWOyR6CxDWE1iXK7xw+oPOQuLfxjOdOxUFK+JmGwsM= 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=DmdydIF8; arc=none smtp.client-ip=198.47.19.142 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 fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 432Bi8BK030239; Tue, 2 Apr 2024 06:44:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1712058248; bh=sh3LQCdFxCykwoTOJhgerGFGuJZbahgKwqL4JpT+OdE=; h=From:To:CC:Subject:Date; b=DmdydIF8cScV55+QZOrt4LuXmyJG+rErqB7scCJs59XY1mP7yCMzjqPkEh1gNQu9w u1eIaP57/AevT6+helV5xcMQvuUECHKyCTAAcpT6nLUuiKCHPG/2UfOUxtK2AwdqTc O7rON0LWvKSm489oKdhTRQAcJJtw/IIcPd8MR6UQ= Received: from DLEE109.ent.ti.com (dlee109.ent.ti.com [157.170.170.41]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 432Bi8e1090261 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 2 Apr 2024 06:44:08 -0500 Received: from DLEE108.ent.ti.com (157.170.170.38) by DLEE109.ent.ti.com (157.170.170.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Tue, 2 Apr 2024 06:44:08 -0500 Received: from fllvsmtp7.itg.ti.com (10.64.40.31) by DLEE108.ent.ti.com (157.170.170.38) 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; Tue, 2 Apr 2024 06:44:08 -0500 Received: from localhost (chintan-thinkstation-p360-tower.dhcp.ti.com [172.24.227.220]) by fllvsmtp7.itg.ti.com (8.15.2/8.15.2) with ESMTP id 432Bi7lB126375; Tue, 2 Apr 2024 06:44:07 -0500 From: Chintan Vankar To: Dan Carpenter , Siddharth Vadapalli , Heiner Kallweit , Chintan Vankar , Andrew Lunn , Roger Quadros , Richard Cochran , Paolo Abeni , Jakub Kicinski , Eric Dumazet , "David S. Miller" CC: , Subject: [PATCH net-next v5 0/2] Enable RX HW timestamp for PTP packets using CPTS FIFO Date: Tue, 2 Apr 2024 17:14:03 +0530 Message-ID: <20240402114405.219100-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. Link to v4: https://lore.kernel.org/r/20240327054234.1906957-1-c-vankar@ti.com/ Changes from v4 to v5: - Added cover letter - Updated commit messages. - Combined [PATCH v4 2/3] and [PATCH v4 3/3] in v5. - Replaced "list_del_entry()" and "list_add()" functions with equivalent "list_move()" function in [PATCH v4 1/1]. This changes are done as per discussion at here: https://lore.kernel.org/all/20240327054234.1906957-1-c-vankar@ti.com/ 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 | 50 ++++++------ drivers/net/ethernet/ti/am65-cpts.c | 87 +++++++++++++++------ drivers/net/ethernet/ti/am65-cpts.h | 11 +-- 4 files changed, 105 insertions(+), 56 deletions(-) -- 2.34.1