Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp14583044rwb; Mon, 28 Nov 2022 02:50:53 -0800 (PST) X-Google-Smtp-Source: AA0mqf4lVnD9Q9df/ziPI4qHujQUh0Gp5xMyNypzzHyZJT0cfX5ow3W/FM+TQsQsOS9ZP9Z6NNFB X-Received: by 2002:a17:90a:fb50:b0:219:5e9:f260 with SMTP id iq16-20020a17090afb5000b0021905e9f260mr18071773pjb.16.1669632653147; Mon, 28 Nov 2022 02:50:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669632653; cv=none; d=google.com; s=arc-20160816; b=yPYS1O0RC1hAeZjcqXQtqNrs1OJXTN0/NZUggkmZke564XYlpBsH4FqmjgKyFF4T1A WDS/X3+fCqd8rCrUGPZFepmCjTV/DZjPOyHk2ALlf4JGIyfIL0KmBzlGLG6fgApzBglT qpdFr9PvCl1Gfv/0rScuB+qMAtpnrp0e5a9QJpgYr2pyQWG4etNYltOOC0urqIjtXpiH g/825ADWjVftd4P1acRexr34BpDP7qJMjNwwzzJebd7GZwPO5FF/K1jsvnFu7wDqoFbk 35shJzr/LZG9pSCFHj1AI4Kia0MKGKZoTfMOZw2Rxf7WOovzkNWX0lWSmaQDpqu90Xe+ ZhzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=Y13Z6ECNj9IS2otO4Py4KOkZMTMB58WQtTejUYiLo5I=; b=WqgEnpBaEkV8gGvrb1Sn5B7COaTXmLyaYDAMoe26n4/Tt0m8khhPmwIDonYWr+pet5 qSC6th7vki/B4LvT4O/89kmRFHxAnB2Dfo6cmti1Wie37ZJacZLOCiRWR5YrsCBww9hf CrRiLWy8tSES75AkyLwxRiAYcLbGPT6BRCSTJZ0aK5+LpTrT5tFrc/my4SjSAkAHGPFk 9dlPQWneqYXcCdiLFd8VV1TKo+KFrZ6FcxfBoPQkMlNo5P+m2oDdlNM7r3KYQFL5dtkx 1+1805zWudJT9e7zQAKsH2BYnvI+zEHw1vjUWRtH9n2V/MSylq+rU6RXCBfNx/Z0dt3e 9rxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b="Lsj/8gwl"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x14-20020a170902a38e00b0018969d51ec4si8543171pla.608.2022.11.28.02.50.42; Mon, 28 Nov 2022 02:50:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b="Lsj/8gwl"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229630AbiK1KdA (ORCPT + 84 others); Mon, 28 Nov 2022 05:33:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229568AbiK1Kc5 (ORCPT ); Mon, 28 Nov 2022 05:32:57 -0500 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C7E710C1; Mon, 28 Nov 2022 02:32:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1669631573; x=1701167573; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=RKGu8AereV3oFQUJ8+g7J+D6DU1lqTrSFzCBi04Ag68=; b=Lsj/8gwl6I3yB8KjOh5Xb9/hiUjK4WY+iWsCSkAq67v4VRK39gt8dpJA x0Qom9G3PzEcY3u8KZ8AWSwuR/ztDSouHM+fiegl8s3/obVkR9U6LKi3i k+TeyTtj0g9uvuTixaUAL1qhe4jwQx81mLiLjnf4hMxKgHpl1yZwYEkm+ 2nbcZKgKOgpLarX6Oy/Saa7sM0I4grU+PSRI+baZCSOzmE+GdrU+wr8wz 5crXkvxmnu3stNT0uAL6xugIubpKhTJUEu72Mv7P3StGt96iIAlJQ1z6I ZEnB3gV0XfIg7SPT1Qfwp2V9KbpPyct0gO1rLsyT5W5RHc5ZfrIp0i0r4 g==; X-IronPort-AV: E=Sophos;i="5.96,200,1665471600"; d="scan'208";a="188931263" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 28 Nov 2022 03:32:51 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.12; Mon, 28 Nov 2022 03:32:51 -0700 Received: from CHE-LT-I17769U.microchip.com (10.10.115.15) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2507.12 via Frontend Transport; Mon, 28 Nov 2022 03:32:45 -0700 From: Arun Ramadoss To: , CC: , , , , , , , , , , , , , Subject: [Patch net-next v1 00/12] net: dsa: microchip: add PTP support for KSZ9563/KSZ8563 and LAN937x Date: Mon, 28 Nov 2022 16:02:15 +0530 Message-ID: <20221128103227.23171-1-arun.ramadoss@microchip.com> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org KSZ9563/KSZ8563 and LAN937x switch are capable for supporting IEEE 1588 PTP protocol. LAN937x has the same PTP register set similar to KSZ9563, hence the implementation has been made common for the KSZ switches. KSZ9563 does not support two step timestamping but LAN937x supports both. Tested the 1step & 2step p2p timestamping in LAN937x and p2p1step timestamping in KSZ9563. This patch series is based on the Christian Eggers PTP support for KSZ9563. Applied the Christian patch and updated as per the latest refactoring of KSZ series code. The features added on top are PTP packet Interrupt implementation based on nested handler, LAN937x two step timestamping and programmable per_out pins. Link: https://www.spinics.net/lists/netdev/msg705531.html RFC v2 -> Patch v1 - Changed the patch author based on past patch submission - Changed the commit message prefix as net: dsa: microchip: ptp Individual patch changes are listed in correspondig commits. RFC v1 -> v2 - Added the p2p1step timestamping and conditional execution of 2 step for LAN937x only. - Added the periodic output support Arun Ramadoss (4): net: dsa: microchip: ptp: add 4 bytes in tail tag when ptp enabled net: dsa: microchip: ptp: enable interrupt for timestamping net: dsa: microchip: ptp: add 2 step timestamping for LAN937x net: dsa: microchip: ptp: add support for perout programmable pins Christian Eggers (8): net: dsa: microchip: ptp: add the posix clock support net: dsa: microchip: ptp: Initial hardware time stamping support net: dsa: microchip: ptp: Manipulating absolute time using ptp hw clock net: ptp: add helper for one-step P2P clocks net: dsa: microchip: ptp: add packet reception timestamping net: dsa: microchip: ptp: add packet transmission timestamping net: dsa: microchip: ptp: move pdelay_rsp correction field to tail tag net: dsa: microchip: ptp: add periodic output signal MAINTAINERS | 1 + drivers/net/dsa/microchip/Kconfig | 11 + drivers/net/dsa/microchip/Makefile | 5 + drivers/net/dsa/microchip/ksz_common.c | 45 +- drivers/net/dsa/microchip/ksz_common.h | 46 + drivers/net/dsa/microchip/ksz_ptp.c | 1132 +++++++++++++++++++++++ drivers/net/dsa/microchip/ksz_ptp.h | 101 ++ drivers/net/dsa/microchip/ksz_ptp_reg.h | 147 +++ include/linux/dsa/ksz_common.h | 55 ++ include/linux/ptp_classify.h | 73 ++ net/dsa/tag_ksz.c | 275 +++++- 11 files changed, 1873 insertions(+), 18 deletions(-) create mode 100644 drivers/net/dsa/microchip/ksz_ptp.c create mode 100644 drivers/net/dsa/microchip/ksz_ptp.h create mode 100644 drivers/net/dsa/microchip/ksz_ptp_reg.h create mode 100644 include/linux/dsa/ksz_common.h base-commit: a6e3d86ece0b42a571a11055ace5c3148cb7ce76 -- 2.36.1