From patchwork Fri Oct 14 15:28:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arun Ramadoss X-Patchwork-Id: 132 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp249310wrs; Fri, 14 Oct 2022 08:46:03 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5eKEI8jupGaFPeXonh84pfS5pd0CtvOjSadmWcyb59Vrz+bt7yOXgxbV+iulphvT8ZI3MK X-Received: by 2002:a17:907:628f:b0:72f:58fc:3815 with SMTP id nd15-20020a170907628f00b0072f58fc3815mr4044512ejc.719.1665762363563; Fri, 14 Oct 2022 08:46:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665762363; cv=none; d=google.com; s=arc-20160816; b=ci0RuDhk0DuCfZ/tDPk3Vjsc+puN3n0Dik8jQHkEllSzjLe+pDYiAE7VeFpsZS1+YL egUsY+b7sF4c++T9A3UQ4UzHzOumpFuoZaqwJWo44H3nnXF6KPVtYWEoIOY9fKAQwqNS yTW8DY5RmQzPIwj0Xa/gFek+Ti9/mryiBNlmC0am3Gl4DpZ2a6FhycxZ82ynqHcKpAaI W07vVbIm7t3m8DFDb51Ml0++l8L1JxUrKZtDkZx1RHue9ZhERqmWU+QUoDl1O7yHmc5i RMDpV6usmZoiNmarNWgALJ59FPNl8VwL8SxYYF2XoqGWyddgrC6gK7d8lwQ8NipdspIN 7cVg== 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=M8ATqHA9aM7gC96fP80aModKh9WXotboY1TY0fPikzM=; b=nAn1KoG8WhkWbhp51igITOV2/xmN27nMYpO+icYrFZshYM63//GPwAjoiPeu/sElmu QGPWn0TXu+cLABQX+zmr2YHPl8kTMmUyvZZCwNS1GgDzt8oJo08Ga75mtly+xiNmmaQi zmwBRbsT/k0nKSsgeOCEWFibHzSSa3U5iCVYLn/0Cl4Q8sfKY5bWdMy34oxQIijMOtuc X1YfpXMfiPrSD1FVICifL4t/cJTsiuw1xSw2I0zsXpBK+38xrJUfTTPyOtuDGfApT2Qy 6pMtjBnPUkvMQUa7+g+rrXNfmsce4Tt9lP0mtqGTfUnqgotxjjQ9b+0aCHP0l4Bw7K4s iuDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=1nXXx5Ty; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qb5-20020a1709077e8500b00718c7b4cbeasi2331151ejc.991.2022.10.14.08.45.37; Fri, 14 Oct 2022 08:46:03 -0700 (PDT) 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=1nXXx5Ty; 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 S230169AbiJNP3U (ORCPT + 99 others); Fri, 14 Oct 2022 11:29:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54820 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229891AbiJNP3R (ORCPT ); Fri, 14 Oct 2022 11:29:17 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD32B1C8431; Fri, 14 Oct 2022 08:29:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1665761354; x=1697297354; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=y+jvU0ool7ikd1UH5iFyfXPR2vAzrz+slhkP53w+ofk=; b=1nXXx5Tyj8pOZRN8w+5x6Z5ArGVadfyDRX2NbxmJkcKuP2CundOZzcRT JwAQt2qUbzEsSUFmJpYgfaIrAxLeYJBsyhoGi6sw/U7bFogPOZylrLmkP WaZVjdg8FoNBU2aKIdeSiJRlJqJyeafMSqDu6fy5v30acMr8zzKBXlt8I YFNZuugi2I00rnrxy+ZfXNAu/aJghbi9OH8FZqs4hVctc3zmBcL9gX1wH Je0STBepyxb5UqZxUQVbHK4hRQsBPgApBHAwpRWHHu7KRlk5YAcgVGU/C RfR2RcbRmo38lpuK3Ai7lo47RvEAiKpgOew9H8CSEdqzwvwdmyUNSIyaz A==; X-IronPort-AV: E=Sophos;i="5.95,184,1661842800"; d="scan'208";a="178786889" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 14 Oct 2022 08:29:13 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) 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; Fri, 14 Oct 2022 08:29:12 -0700 Received: from CHE-LT-I17769U.microchip.com (10.10.115.15) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.2507.12 via Frontend Transport; Fri, 14 Oct 2022 08:29:06 -0700 From: Arun Ramadoss To: , CC: , , , , , , , , , , , , Subject: [RFC Patch net-next 0/6] net: dsa: microchip: add gPTP support for LAN937x switch Date: Fri, 14 Oct 2022 20:58:51 +0530 Message-ID: <20221014152857.32645-1-arun.ramadoss@microchip.com> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746678436271384102?= X-GMAIL-MSGID: =?utf-8?q?1746678436271384102?= The LAN937x switch has capable for supporting IEEE 1588 PTP protocol. This patch series add gPTP profile 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. But the testing is done only for lan937x switch. Arun Ramadoss (6): 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 drivers/net/dsa/microchip/Kconfig | 10 + drivers/net/dsa/microchip/Makefile | 1 + drivers/net/dsa/microchip/ksz_common.c | 43 +- drivers/net/dsa/microchip/ksz_common.h | 31 + drivers/net/dsa/microchip/ksz_ptp.c | 755 ++++++++++++++++++++++++ drivers/net/dsa/microchip/ksz_ptp.h | 84 +++ drivers/net/dsa/microchip/ksz_ptp_reg.h | 68 +++ include/linux/dsa/ksz_common.h | 53 ++ net/dsa/tag_ksz.c | 156 ++++- 9 files changed, 1192 insertions(+), 9 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: 66ae04368efbe20eb8951c9a76158f99ce672f25