From patchwork Mon Nov 21 15:41:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arun Ramadoss X-Patchwork-Id: 13051310 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CAEA6C4332F for ; Mon, 21 Nov 2022 15:42:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231223AbiKUPmK (ORCPT ); Mon, 21 Nov 2022 10:42:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231241AbiKUPmJ (ORCPT ); Mon, 21 Nov 2022 10:42:09 -0500 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB61A4B986; Mon, 21 Nov 2022 07:42:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1669045323; x=1700581323; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=2/oxAXLOp39GLFi3+acpxJRqZsGAlZP5t3Ltf3CliCM=; b=LgQygZbQ0MgLSdO+awtg5xeQnaSkWnA74mu7ENK9nSgqgeLD8No4yz00 sJdozDQo97IpyydlLVeP8q2KGZ2mk2nQevkzCVaYQVOtWOPSPD6TurV+T nHqlbPI+oeQyqYRmhQ+3Pordjd8W3sJPlLlq95NqjEBfhnC3GrjEvNtQ9 qQ4EPvEfZQln1WxRi1JDdrDMAhnfFiQMjkVM2tJJJu7l04HeT4OFiYB10 TwSEAEcbrGLgfFHXvOHC4D8BUUwIJPPW5M/HexGH1nlI7q9OIlgdHFKd3 pN6Ahk+ko9DAwYUi/2unPd/lVdqVhuzF2c843g3GiY/9RqQ2iSsoXxmLN Q==; X-IronPort-AV: E=Sophos;i="5.96,181,1665471600"; d="scan'208";a="189907560" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 21 Nov 2022 08:42:02 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.12; Mon, 21 Nov 2022 08:42:02 -0700 Received: from CHE-LT-I17769U.microchip.com (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.2507.12 via Frontend Transport; Mon, 21 Nov 2022 08:41:58 -0700 From: Arun Ramadoss To: , CC: , , , , , , , , , , , , Subject: [RFC Patch net-next v2 0/8] net: dsa: microchip: add PTP support for KSZ9x and LAN937x Date: Mon, 21 Nov 2022 21:11:42 +0530 Message-ID: <20221121154150.9573-1-arun.ramadoss@microchip.com> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC The LAN937x switch has capable for supporting IEEE 1588 PTP protocol. This patch series add PTP support and tested using the ptp4l application. 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. RFC v1 -> v2 - Added the p2p1step timestamping and conditional execution of 2 step for LAN937x only. - Added the periodic output support Arun Ramadoss (7): net: dsa: microchip: adding the posix clock support net: dsa: microchip: Initial hardware time stamping support net: dsa: microchip: Manipulating absolute time using ptp hw clock net: dsa: microchip: enable the ptp interrupt for timestamping net: dsa: microchip: Adding the ptp packet reception logic net: dsa: microchip: add the transmission tstamp logic net: dsa: microchip: ptp: add periodic output signal Christian Eggers (1): net: ptp: add helper for one-step P2P clocks drivers/net/dsa/microchip/Kconfig | 12 + drivers/net/dsa/microchip/Makefile | 5 + drivers/net/dsa/microchip/ksz_common.c | 44 +- drivers/net/dsa/microchip/ksz_common.h | 48 + drivers/net/dsa/microchip/ksz_ptp.c | 1117 +++++++++++++++++++++++ drivers/net/dsa/microchip/ksz_ptp.h | 96 ++ drivers/net/dsa/microchip/ksz_ptp_reg.h | 136 +++ include/linux/dsa/ksz_common.h | 55 ++ include/linux/ptp_classify.h | 73 ++ net/dsa/tag_ksz.c | 288 +++++- 10 files changed, 1859 insertions(+), 15 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