Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752252AbdLFNbe (ORCPT ); Wed, 6 Dec 2017 08:31:34 -0500 Received: from mail-sn1nam02on0051.outbound.protection.outlook.com ([104.47.36.51]:65456 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751474AbdLFNbc (ORCPT ); Wed, 6 Dec 2017 08:31:32 -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 Subject: [PATCH net-next v3 0/2] net: thunderx: add support for PTP clock Date: Wed, 6 Dec 2017 16:30:56 +0300 Message-Id: <20171206133100.26436-1-aleksey.makarov@cavium.com> X-Mailer: git-send-email 2.15.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [46.242.8.171] X-ClientProxiedBy: HE1P191CA0021.EURP191.PROD.OUTLOOK.COM (10.172.132.159) To BN3PR07MB2482.namprd07.prod.outlook.com (10.167.4.23) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cdb915ba-15a5-4203-465b-08d53cada884 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603286);SRVR:BN3PR07MB2482; X-Microsoft-Exchange-Diagnostics: 1;BN3PR07MB2482;3:02R1m+E4w4kKDnzHOV0aRZM/tGOXZQnsPd/vEH6vMhETQs2n0aAS7mty0hQo0wotsbLQGUx7RH4rljmI5AC7bkXKiKuvrqsNUvfKqMufEq9WmUpQWIixGflu5W8+MoJGux4V9/QfCn62jsV9OWV3d8RTrtONObNKn0VfwrhZDntgLJThpd2Cw0FL/Jen4SxlmWHBdWQCQvawTjoQDmki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UTczhM8nOhFa4wBU9HD2hRm7AGHADyvuY7OTo7YjI/XUuuRwPxTHRQCDMPUVDbBGF1Pzmt1LyV/bjmI/8FU2X86Ffxi4SKKNidXw+KzpPRzKTcgbD+s/ZiQT321PxjM5pnM8bNpWYQvf6Ixhp46nYp+2Cn;4:nDgAkL+VF/YEgXdb7yijdgDPRUiKf5NEjcGoHYAU2k2SAA/w2KoJCAPuFm2i6CPksmfEFfL+zgVnIFn2LVh5YuUy9dzaBM6rMPfzf6BThYDxphbt5yEopp/mIA/c0GbDo5BeRvOx5Kp4Xr2LbMeJYqUW+SbxBv+C7FOwTlXwYbMSaqosFIX+11zm4y6N/Ec/kERp7WbCdfuBnbPwvLgxBfAK9qWbIM3vpPQb3PHSeuzR73nDB5Kf9x5tmYeddXQ1JGspoQb4y82JhXn1hEKByBsytRZnZsTvx+Iv/J2ufTZdkzy1gXEEOpTPMFtjB3cS X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(42068640409301); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040450)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3231022)(3002001)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123562025)(20161123558100)(20161123560025)(20161123555025)(6072148)(201708071742011);SRVR:BN3PR07MB2482;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:BN3PR07MB2482; X-Forefront-PRVS: 05134F8B4F X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6069001)(376002)(346002)(366004)(189003)(199004)(25786009)(6666003)(50226002)(305945005)(6916009)(3846002)(8936002)(7736002)(478600001)(72206003)(68736007)(8676002)(81166006)(81156014)(966005)(54906003)(86362001)(36756003)(2906002)(6116002)(33646002)(1076002)(6486002)(16526018)(6512007)(107886003)(51416003)(52116002)(6506006)(106356001)(2361001)(53936002)(316002)(16586007)(105586002)(2351001)(5660300001)(48376002)(101416001)(6306002)(97736004)(50466002)(4326008)(66066001)(47776003);DIR:OUT;SFP:1101;SCL:1;SRVR:BN3PR07MB2482;H:localhost.localdomain;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BN3PR07MB2482;23:/EXdndLCNx9VoG2ypewm1QtqBFFTxeA10JgtGxCdg?= =?us-ascii?Q?dGBeZ90DeQXgJHFHPUpQ5CUhzSJ14cU8FjWoKIq3ix2o9Wg17ihny3oeh6KJ?= =?us-ascii?Q?hS9yiDOMX0zfHglhyqSmOUfBzXO2nur7KGxouFxCgIE3TYWre300zC6q0npj?= =?us-ascii?Q?PrtXF+lsabHY/gcxwuhDwEmrsidnIrfIDxic1nfsuWFvrMJ9wdaXgc7Cs9Wt?= =?us-ascii?Q?Yz4iBci6xEjQAkc3UlvUKCECXQvrnxh4GhOclXJDjeSx01EHxrHZOWTtllRn?= =?us-ascii?Q?aHvHlM2n4c6vMRGECFxGqfhWrw+KiBA2q4Qno3JS8k2ZA8wDS1qnw+ea+e0y?= =?us-ascii?Q?92/BkvvuOhwi0Q+Y389IZkOf0GB3L2AdRDW6DPjkZWMGmwt4MG1JA1Loq1tk?= =?us-ascii?Q?dhMEhfjQNZlF1nFf2t4iH9XwdsVHqScI/Hl7q6A6v1IeCYmcG1ILMmHqMXIJ?= =?us-ascii?Q?TppQN+l7HMv042EfFYzh6c7PsJWCLiz4sfJ9yk58gJHiyxH1Y+ipNRPVv3DW?= =?us-ascii?Q?XXg8hKbJN23Qy6hbe4V0Gj9wj9NEdbvpXY7ftCPwuywNg91+fvw2F8Kco955?= =?us-ascii?Q?qN+ESovw62tsEi0o/t64NeM+03s0SvkrAjx4kXxnz4+kUS5XOIaeRQHKZPh9?= =?us-ascii?Q?m4cm4Fv5/z9VqgtJrkxjYV9zIhFoj16wXknzSTsfpKTgTycK0pNjctKhX4I6?= =?us-ascii?Q?dkOrs/h0j9LmfxVf8kzmL6wNUCa21iwc+NKbwn3k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+C9aABjD3VSTPOY2ZXAamIdiX+4MwH2E=;24:X5TGjA10xwuZ8/lKv5HZcLdahTT+3CYNeuZFAaP6OPgT9VxHEMr4wqJ4t+wtUmtDNfz3DHkF5PW4EGdpghxw8dZXjrbhqBqRYmvnWgQR7ns=;7:fBnCWVeDNEuPtQYnRTdPPfg6Ybpr4CmPEX1HwZE7xJW/Ba3MMYK68x2mWYTsLW9ObGg+nR5f+SJpGLSZSEfGfYtI/1/9b7sN7dBy1DuTU+xDKARiCZOGRlvNGhaJzxdCWgcEPrYPlkJiWx2aueDxXGN9ocdSnNNtvXLCcdUG16HT4YtdHEkMYsaO4vLkUL66bs0gsiAtrybh8XTC2R2ocqTNyLg4JkVGSzvHPXhkruxs94svvRcRBHtSZ0SG0lWQ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Dec 2017 13:31:26.6317 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cdb915ba-15a5-4203-465b-08d53cada884 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR07MB2482 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1987 Lines: 46 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. v3: - 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 | 14 + drivers/net/ethernet/cavium/Makefile | 1 + drivers/net/ethernet/cavium/common/Makefile | 1 + drivers/net/ethernet/cavium/common/cavium_ptp.c | 334 +++++++++++++++++++++ drivers/net/ethernet/cavium/common/cavium_ptp.h | 78 +++++ drivers/net/ethernet/cavium/thunder/nic.h | 15 + drivers/net/ethernet/cavium/thunder/nic_main.c | 58 +++- 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 | 173 ++++++++++- 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, 757 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