From patchwork Thu Jul 28 12:16:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naveen Mamindlapalli X-Patchwork-Id: 12931188 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 BBF90C3F6B0 for ; Thu, 28 Jul 2022 12:17:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237927AbiG1MRM (ORCPT ); Thu, 28 Jul 2022 08:17:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237901AbiG1MRE (ORCPT ); Thu, 28 Jul 2022 08:17:04 -0400 Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A22B6A4BD; Thu, 28 Jul 2022 05:17:02 -0700 (PDT) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 26SAkOnl005425; Thu, 28 Jul 2022 05:16:49 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=pfpt0220; bh=7Pojo1qa9T5PJ7INTlUCzJBNw4Prt1EHBia1urgk1H4=; b=jjWmYlmoCuc1qG0HvwbfldXs3CLY2GoaIEPkJoo9LW9qqPLUfXBkSUhknlCLdNrXscOi vIV0gINm6iC8sJbt5vhjdae8NEVBVZZbvyI/Q80yW0l4BFXWtCWXS7IHaVJapinlPy2r vNwK7Nsz1DD7vMFGx6fPogkoRPUvwzC20om8HufdguMR+IHk7SG6vdZv6Nh3uOtLUulw 6SBLeW/bNB1PBlrh7GIIX0O31s1//um4nVhXQ6aIqdI2r/HbSLWSczgDkslx7qhzMZZH V7OYikntVVrJqNerkw4hDsuqDJBaakiYfb8XBLZmE6QoPBYX9wRpqnbPpj+Sl+Ps3uff Rg== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3hjyn8nm2d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 28 Jul 2022 05:16:49 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 28 Jul 2022 05:16:47 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Thu, 28 Jul 2022 05:16:47 -0700 Received: from #hyd1583.marvell.com (unknown [10.29.37.44]) by maili.marvell.com (Postfix) with ESMTP id 149C53F7040; Thu, 28 Jul 2022 05:16:43 -0700 (PDT) From: Naveen Mamindlapalli To: , , , , , , CC: Naveen Mamindlapalli Subject: [net-next PATCH 0/4] Add PTP support for CN10K silicon Date: Thu, 28 Jul 2022 17:46:34 +0530 Message-ID: <20220728121638.17989-1-naveenm@marvell.com> X-Mailer: git-send-email 2.16.5 MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: C_UgjHAOdNP0YfiMf1IznZhlyLi5sj4Q X-Proofpoint-GUID: C_UgjHAOdNP0YfiMf1IznZhlyLi5sj4Q X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-07-28_05,2022-07-28_02,2022-06-22_01 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org This patchset adds PTP support for CN10K silicon, specifically to workaround few hardware issues and to add 1-step mode. Patchset overview: Patch #1 returns correct ptp timestamp in nanoseconds captured when external timestamp event occurs. Patch #2 adds 1-step mode support. Patch #3 implements software workaround to generate PPS output properly. Patch #4 provides a software workaround for the rollover register default value, which causes ptp to return the wrong timestamp. Hariprasad Kelam (1): octeontx2-pf: Add support for ptp 1-step mode on CN10K silicon Naveen Mamindlapalli (3): octeontx2-af: return correct ptp timestamp for CN10K silicon octeontx2-af: Add PTP PPS Errata workaround on CN10K silicon octeontx2-af: Initialize PTP_SEC_ROLLOVER register properly drivers/net/ethernet/marvell/octeontx2/af/mbox.h | 2 + drivers/net/ethernet/marvell/octeontx2/af/ptp.c | 106 +++++++++++++++++++- drivers/net/ethernet/marvell/octeontx2/af/ptp.h | 3 + drivers/net/ethernet/marvell/octeontx2/af/rpm.c | 19 +++- drivers/net/ethernet/marvell/octeontx2/af/rpm.h | 5 + .../net/ethernet/marvell/octeontx2/af/rvu_nix.c | 8 +- .../net/ethernet/marvell/octeontx2/af/rvu_reg.h | 1 + .../ethernet/marvell/octeontx2/nic/otx2_common.h | 13 +++ .../ethernet/marvell/octeontx2/nic/otx2_ethtool.c | 8 +- .../net/ethernet/marvell/octeontx2/nic/otx2_pf.c | 11 +++ .../net/ethernet/marvell/octeontx2/nic/otx2_ptp.c | 103 ++++++++++++++----- .../ethernet/marvell/octeontx2/nic/otx2_struct.h | 11 ++- .../net/ethernet/marvell/octeontx2/nic/otx2_txrx.c | 110 ++++++++++++++++++++- 13 files changed, 359 insertions(+), 41 deletions(-)