Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753326AbdLKOPJ (ORCPT ); Mon, 11 Dec 2017 09:15:09 -0500 Received: from mail-dm3nam03on0050.outbound.protection.outlook.com ([104.47.41.50]:16996 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752892AbdLKOPC (ORCPT ); Mon, 11 Dec 2017 09:15:02 -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 Subject: [PATCH net-next v5 0/2] net: thunderx: add support for PTP clock Date: Mon, 11 Dec 2017 17:14:29 +0300 Message-Id: <20171211141435.2915-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: VI1PR0501CA0023.eurprd05.prod.outlook.com (10.172.9.161) To BN3PR07MB2484.namprd07.prod.outlook.com (10.167.4.25) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1ae8709c-3b44-4be8-b678-08d540a190d7 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603307);SRVR:BN3PR07MB2484; X-Microsoft-Exchange-Diagnostics: 1;BN3PR07MB2484;3:5j2hmLEOTTgrH21FG+SiogxpOBoWYOmyqjehhNdvPZJyC4hnnjOx501MqMSXHWHdjrwDYUo3gKMTbAqollcPFWEOSDe6/E/hU8Ch1yhYXMWdRndTuHxS7lcjhncjvNZ9tFXZIPSK/V0/uAU+LdH3Doi4dYGKjvQ1L5eS/1Sn/hOy01Mfh6CPw/09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vl/LpKXnjxam1WimdAIFirfH2YGZor6W/LwgUT/NpuHn1CXjRxxoBFQheJORRSHj2iPxly8d7UJIceew2KPb3LoilgGWqWO/3fsPXlUsgLdhiO9KUKECj1MowwgCT8jERIcKjK9HVHsS5MJX/d/cRSr3lWH88ztwuSfWWoajDl;4:r1VGvYJglypV1whH8YvtKFbQF84Nvt6LXb3BqqUpLGiniGrr/KSJ4gdfe8GD7wcWavGvV+exYsmI/h9bYh6mPKZGTXoV0z70MwMbVU2rFFDhZN/+RUVRF6nEPJC+YZBBMu+0zYfXg1jZAYQn6Luvf46vxobhrXglRdCX8sfC6eMI0QgyygKXv1EgEYLe4BW6cMnmkNIFBsbnzdcaV5h+SnfRRu9uUd6gecJ+v2R8N9lY7xbhMyDePtx8Xmch8vVLwtgqkqEThDMF2schqn2USwWfziJqOVQfsS4459P9MMk1bpCH22QiFP6HgVsRnHm6 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(42068640409301); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040450)(2401047)(5005006)(8121501046)(93006095)(93001095)(3002001)(10201501046)(3231022)(6041248)(20161123562025)(20161123564025)(20161123560025)(20161123555025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:BN3PR07MB2484;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:BN3PR07MB2484; X-Forefront-PRVS: 0518EEFB48 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6069001)(366004)(376002)(346002)(199004)(189003)(7736002)(6116002)(2351001)(50226002)(3846002)(4326008)(966005)(33646002)(478600001)(52116002)(81166006)(81156014)(72206003)(8676002)(51416003)(6512007)(105586002)(6306002)(54906003)(2906002)(2361001)(5660300001)(53936002)(6486002)(47776003)(97736004)(66066001)(106356001)(1076002)(6506006)(39060400002)(8936002)(305945005)(86362001)(6666003)(6916009)(16586007)(59450400001)(16526018)(36756003)(48376002)(50466002)(25786009)(68736007)(316002);DIR:OUT;SFP:1101;SCL:1;SRVR:BN3PR07MB2484;H:localhost.localdomain;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BN3PR07MB2484;23:ObSHhzCG5QH8F/72YLDK7khh2nGkzSzYg5SW/OGQa?= =?us-ascii?Q?55SNPQh5Rf9yH1wqH09tQFPlbzwTfZ+3I0HdudtnR4aeu2L+xwgAwMV1H07+?= =?us-ascii?Q?+A55ueRoprsDwsm6BolqA6oEFTaF8RfJl3AoByvwvvXxa9TrXRl/ZIngnviy?= =?us-ascii?Q?o0nGxqy4jqCBPEEqcdRCuHpFx/D4yeQLIT4DzXpkc9EwBX3L9eL87UMxXZBv?= =?us-ascii?Q?SmQb2o+0nVd3YYNYxVFe0X3TmfLuwTI4aHlKXgnYJBxcXeifpCwLNT21OUSU?= =?us-ascii?Q?e+lZZChm/PeZwbiL/YmMXdp4aWQY54k+O6AeRMTnaf8U/Atu2RafpfBWE5R8?= =?us-ascii?Q?cKoAB8qLXkppXNIllOjRQAlvfbD/g4Mbq83XhoFdX4/MYR6D7y6DBtOyVU7X?= =?us-ascii?Q?kZrNAg02GAb4qW2oMmaAVjlJ4c0jchmqQbfCNVa6Vxcfavr0eEg+WJN3ulBt?= =?us-ascii?Q?iFoTJyOMjozQo9zfHs2WP1soScJ4iUUMsy+OlCr8wZkMcysljdwRLe9Wou6X?= =?us-ascii?Q?YjKvCaDMm3v/hoWyB3d6On15ZAQJGuSiKdRw8kgu0ELKZR0HTH3aRUvVJW/6?= =?us-ascii?Q?BADgPZE01KIs1ff0JI7McMMHx8Q9TP+Nngs4is6gZfL5n5PVXGpMJ/91ACIW?= =?us-ascii?Q?fGpbNDjvuMT55wc4ENoJQtLQWYDsPOdC07jMrbsd3NrfHSlVmqEJd2qSHXJH?= =?us-ascii?Q?b/oSFzg1xzGW6mZrpAe68RKbOTtlqJXtGkKGgytE3ArdVCimG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G/4jL2Oe5RQtZBzEHL8BNIZ9diwNz2Qzo7T3uo=;24:Kz5GT6MbDAO68xd+QAtuIMEfZej/pa8R0F84Ywhhm1aNqiTCM+vRuXf0Ug3kRliqMRsUxE3t1UA2YJJu/U5+Zpy1BtunGvqMOJS3jDWpUkk=;7:DXbp83t4KuoKoSnf3sntJzG8KliXzsH8WIpD8eooiFB5jeKMJa9bLE5NyevNTEpIElJObkeYDTkr1lNLWK8c+7vZhMIZthbnnGVggjukcyHNHmnKUlubjrgF/8Xxaz3eid7mblhX1cFECyFCsSRaRnH228mrrHHbyk9F9OoQpVT6EV1Jpwr0kX+N/xz/pxt3PEut2AAPkKB7iwJltWhT0m8QeAEQheFGzQDUOSqLrz9gAajTnU1U/vZQsk9Q5IDJ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Dec 2017 14:14:58.2542 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1ae8709c-3b44-4be8-b678-08d540a190d7 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR07MB2484 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2793 Lines: 60 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. v5: - 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 | 329 +++++++++++++++++++++ drivers/net/ethernet/cavium/common/cavium_ptp.h | 70 +++++ 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, 743 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