Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967849AbeAONip (ORCPT + 1 other); Mon, 15 Jan 2018 08:38:45 -0500 Received: from mail-by2nam01on0071.outbound.protection.outlook.com ([104.47.34.71]:9568 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S966629AbeAOMp0 (ORCPT ); Mon, 15 Jan 2018 07:45:26 -0500 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Aleksey.Makarov@cavium.com; From: Aleksey Makarov To: netdev@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, "Goutham, Sunil" , Radoslaw Biernacki , Aleksey Makarov , Robert Richter , David Daney , Richard Cochran , Philippe Ombredanne , Joe Perches Subject: [PATCH net-next v6 0/2] net: thunderx: add support for PTP clock Date: Mon, 15 Jan 2018 18:44:55 +0600 Message-Id: <20180115124500.14872-1-aleksey.makarov@cavium.com> X-Mailer: git-send-email 2.15.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [5.45.71.246] X-ClientProxiedBy: AM5P189CA0003.EURP189.PROD.OUTLOOK.COM (10.161.53.16) To BN3PR07MB2481.namprd07.prod.outlook.com (10.167.4.22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: af0f5211-d6af-46b5-5c0c-08d55c15d900 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(5600026)(4604075)(4534125)(4602075)(4627221)(201703031133081)(201702281549075)(2017052603307)(7153060)(7193020);SRVR:BN3PR07MB2481; X-Microsoft-Exchange-Diagnostics: 1;BN3PR07MB2481;3:asOwJEIXAm5Blm1czrLw8/ReGL9xhA5dbQSiZ/aCR3aANtCSXOqQRJTwow/mQiaxTM8Lse4hmbLNS/yg05gg80cXuV6dZwAMdABNZtMvj4fsdghUEfiB8C4f26EGw1HIrKevJeSnau43dL1QyfUx0IVCldkwAClwVwWadVHwc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7urJyugChMjwFhG7Yuhl0A4br7o2N0AQKh2L+dVZz3PRlFqlx3dCvtX+/fHjwaWDHJpooQ+Er43KhQ/LwMFole+A4Hqmgd4l8QYRLOd9D2SJN5Xqgo7lyJjSm36uZV6aWrj4WtJXwxsFrJ622SsTY0xT9VA7e1opIJbQPfq6dSbcUAq91oQzPG4hFTuaki+Wo0;4:cq5aQejiwdkh3Ur+YcYHS8Rr2sAjrbeG/tU4rge2zfb/nIl5y8fTnaTS/gbzotl/btzoBuK5KgcDjHrmlINW+vL/XqLbjn6HsPaVmYDQoI3qc/vzO2608LR3j60Uav/wvQ/NPx3Ly/htH+wtEdiVKFOr7MoaXHfeNSklThVewWFKqBUeVrxjpP7SkgzUqybfoKlCHXxAZFAubUy5bZmO0fvntg7q6nX2AmBgJSMYCZufObqjazpIpiBqu0RsTDVZPT6JSjAZE6s9FoX2FL3VlzHprAPM4xP8xillGrmh5gqq0CH1hkgnPWNqcrMNnSYm X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(42068640409301); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040470)(2401047)(8121501046)(5005006)(3002001)(3231023)(944501161)(10201501046)(93006095)(93001095)(6041268)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123558120)(6072148)(201708071742011);SRVR:BN3PR07MB2481;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:BN3PR07MB2481; X-Forefront-PRVS: 0553CBB77A X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6069001)(366004)(39380400002)(39850400004)(396003)(376002)(346002)(189003)(199004)(3846002)(6116002)(81156014)(81166006)(8936002)(50226002)(1076002)(47776003)(478600001)(66066001)(72206003)(966005)(68736007)(8676002)(2906002)(7736002)(305945005)(2361001)(2351001)(37156001)(105586002)(106356001)(71446004)(50466002)(48376002)(36756003)(51416003)(16526018)(6512007)(6306002)(16586007)(54906003)(5660300001)(86362001)(39060400002)(316002)(4326008)(53936002)(6486002)(59450400001)(25786009)(97736004)(6666003)(6506007)(6916009)(386003)(52116002);DIR:OUT;SFP:1101;SCL:1;SRVR:BN3PR07MB2481;H:localhost.localdomain;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BN3PR07MB2481;23:0QqE5EVtKJWmJ9GpqNRvMiaPBES8R+MovBBDknurE?= =?us-ascii?Q?dONgizvB9utN1YGDdRILa6Gql64Icxh2zGVbR+glpa1GdMVWz42j7HikE9mm?= =?us-ascii?Q?H2QkRCNr2R+CJWHkEnF+hpVWO9kT9v+//jFCiWqFS2nviRXOIZ/hdOJZGw+4?= =?us-ascii?Q?4cygvUrQ+9BKKPmGhf70YitDjclfrJZeF3RZaS0prJwT+jzP23czdsKcxUcY?= =?us-ascii?Q?pxCuLVVfuWw3zfxtdXgT4+Dj22FXJvBBn5AfqBcAUTG7OFgr0VktMGd8gH7F?= =?us-ascii?Q?TtKb3JFIKmUBZUYPDuQMteo+FxbWakycg4UWWFLe93fKR6Sew17jq5l/xgh7?= =?us-ascii?Q?VnWfTvYgTkG+Hk6sp1j3Tbz6wDyXGzBXoLwLnGd4l4ge1Jq5qXIl7xujICtz?= =?us-ascii?Q?Vl6bSn/BitXb7c2FTX1DtTZdhxC3xw4ijq6vosHLDN8rYxD8SpNfdXhe2cnj?= =?us-ascii?Q?AoN6PEgLXkGG2k1pqKmmnJTS8EuemcG9jxpHTdO/cOM/yNQK1+38SgogQRgU?= =?us-ascii?Q?xaNcILOsSEmzodwDrQ0ul6yRDIuTe3ltpJxrBhpq9it5LhjnvlsLXEv6kRl8?= =?us-ascii?Q?vnzzsGXAvui9anEyayHxUI+hlX1/GkyRvSzMLJ4ZBOy8haiz7NzUYtgMmNVW?= =?us-ascii?Q?drnBDV2oVOtIwaFxf09gn2t2pkSKmyk5EY6UgD5WFsX31+yLmw8jsjuCiTZj?= =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xj67eoI7MmXCI/2IwIG3chJJu8+mhxAWIChj7r2Zwoc=;5:YIlQbCJYq/HNaw4dnltC1tNCDjiB0WwqOJUSBNZ1ZnN04xxogIoMYUaOLSlci8xmyjAXwmt42wCEVj5dguHJ6Tq5+alR8kLHHcm+7wT5dtNWTyjDXqsckbHShCcEsPGjAczjxj6ytOiCSNi9fXaRT7sCc2ByUIOYH+NowHn0B6E=;24:YejSvd5DCrplebBIDWu+MII10eRQnrpELQi+7PxzsokYwGUlznSHIY09VYYdPz9OVMz0E9g0tNvR37xSDpXwfdlnb8Wu3pOyXI6FUke/fac=;7:nTYP7Ifng06Uldr6eLe2AtD4Eewzb5W1fjezSg2jQ7cM95Y57bWtBuw/x1DuvQ3EXT214SGDf30dTSLIgFBYfr0hBue6M5Xdn5JHostMEzN2Dc4oin0f4SRwuDbgvq8hNGHnC4hE4ZwRUbexrVAdW9tCK719bzTwnvazcLxm3Yd1mNIyP6iJb88HkArHBCHTt7tdRMpG4n1ZLWii4ZlQq4aIUuW9GGvRFOHCLZV1bKsL/yR/ULNUObFI4dFeobgt SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jan 2018 12:45:22.1291 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: af0f5211-d6af-46b5-5c0c-08d55c15d900 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR07MB2481 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: This series adds support for IEEE 1588 Precision Time Protocol to Cavium ethernet driver. The first patch adds support for the Precision Time Protocol Clocks and Timestamping coprocessor (PTP) found on Cavium processors. It registers a new PTP clock in the PTP core and provides functions to use the counter in BGX, TNS, GTI, and NIC blocks. The second patch introduces support for the PTP protocol to the Cavium ThunderX ethernet driver. v6: - check if ptp_clock_register() returns NULL (Richard Cochran) - fix doc comment for cavium_ptp_enable() (Richard Cochran) - fix a function call formatting; use defined constant (Richard Cochran) - add comments for `tx_ptp_skbs` and `ptp_skb` (Richard Cochran) - use adjfine() instead of adjfreq() (Richard Cochran) - add Acked-by: Philippe Ombredanne v5: https://lkml.kernel.org/r/20171211141435.2915-1-aleksey.makarov@cavium.com - fix the file headers (add SPDX tags, remove advertisment) (Philippe Ombredanne) - use "imply" instead of "select" (Richard Cochran) - add some code in cavium_ptp_get() for the case when the PTP driver has not been registered with the PTP core v4: https://lkml.kernel.org/r/20171208103442.19354-1-aleksey.makarov@cavium.com - use IS_ENABLED. This fixes compilation of the ptp as a module (David Miller) - select PTP_1588_CLOCK, not depend on it. This fixes a build warning. - change u64 to __be64. This fixes the sparse warning "warning: cast to restricted __be64" - make nicvf_config_hwtstamp() static. This fixes the sparse warning "warning: symbol 'nicvf_config_hwtstamp' was not declared. Should it be static?" v3: https://lkml.kernel.org/r/20171206133100.26436-1-aleksey.makarov@cavium.com - rebase to net-next v2: https://lkml.kernel.org/r/20171117134909.8954-1-aleksey.makarov@cavium.com - use readq()/writeq() in place of cavium_ptp_reg_read()/cavium_ptp_reg_write(), don't use readq_relaxed()/writeq_relaxed() (David Daney) v1: https://lkml.kernel.org/r/20171107190704.15458-1-aleksey.makarov@cavium.com Radoslaw Biernacki (1): net: add support for Cavium PTP coprocessor Sunil Goutham (1): net: thunderx: add timestamping support drivers/net/ethernet/cavium/Kconfig | 13 + drivers/net/ethernet/cavium/Makefile | 1 + drivers/net/ethernet/cavium/common/Makefile | 1 + drivers/net/ethernet/cavium/common/cavium_ptp.c | 353 +++++++++++++++++++++ drivers/net/ethernet/cavium/common/cavium_ptp.h | 70 ++++ drivers/net/ethernet/cavium/thunder/nic.h | 36 +++ drivers/net/ethernet/cavium/thunder/nic_main.c | 56 +++- drivers/net/ethernet/cavium/thunder/nic_reg.h | 1 + .../net/ethernet/cavium/thunder/nicvf_ethtool.c | 29 +- drivers/net/ethernet/cavium/thunder/nicvf_main.c | 169 +++++++++- drivers/net/ethernet/cavium/thunder/nicvf_queues.c | 26 ++ drivers/net/ethernet/cavium/thunder/thunder_bgx.c | 29 ++ drivers/net/ethernet/cavium/thunder/thunder_bgx.h | 4 + 13 files changed, 782 insertions(+), 6 deletions(-) create mode 100644 drivers/net/ethernet/cavium/common/Makefile create mode 100644 drivers/net/ethernet/cavium/common/cavium_ptp.c create mode 100644 drivers/net/ethernet/cavium/common/cavium_ptp.h -- 2.15.1