Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753364AbdLHKfX (ORCPT ); Fri, 8 Dec 2017 05:35:23 -0500 Received: from mail-co1nam03on0044.outbound.protection.outlook.com ([104.47.40.44]:60672 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753321AbdLHKfG (ORCPT ); Fri, 8 Dec 2017 05:35:06 -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 Subject: [PATCH net-next v4 0/2] net: thunderx: add support for PTP clock Date: Fri, 8 Dec 2017 13:34:38 +0300 Message-Id: <20171208103442.19354-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: DB6PR07CA0024.eurprd07.prod.outlook.com (10.175.239.34) To BN3PR07MB2481.namprd07.prod.outlook.com (10.167.4.22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bc87dc7b-fef7-458e-1dd0-08d53e275841 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603307);SRVR:BN3PR07MB2481; X-Microsoft-Exchange-Diagnostics: 1;BN3PR07MB2481;3:m0vpuw3di58FM89sb6deDDkO5A0ERkzg8HLPh8wGxjmXS8kMBqJX6EV62X9rL2QGDjbi6IKQxl50UO6UI8HIV5CFAq4OyGX0Mz+C48QXGeKI0ZBKPTpT2c8hf3MTlSo5isIgW46xfolEVgf8ijeYy8Ai9fXyuYo4vkdml240k490C7mSG9C30vHbR7KprcLSVal1sdtAjAjknchb5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nwE8gB5Qzc/9Ex9BGHnto3zg1eCu7NYjtDKYNfOrkBeg5h8fNOK7+6FlgUmVDxacxRDzQfcJY43YJGKMjVbCkIpotfpYEjLFYAj9ByXm7I15gD+srEG4czVvXAlRMf2dH;4:uVVQ4n6FFQW6aYkNQvUTWg0+J3aXUJzy4QGRwLduwn7GSCJ/SkoUwvu1jJ+wcyLEkQYwkd88fuiduglVMyn136Jqp0LL/t4lLlrHtvRYzp2QwdTWG1K8tCtRByOVttrg3zgfCP5C5/nHAhUNtMgwOPaChUbP8K0TYSxFOr/ztDTZjPWvYLbxieqNOlp17gBtFYPjSDDzJGdnUlVhbOqM8tYsy2/pgdlIrgfEDV801YCREnB5WKLmuqqq3mQNkHV8teky5ur79phgT9o9kaYndMAAAnym2MwD9/lWzyhkcSRYe7WFXfynZ1O9wnhuRZ75 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)(10201501046)(3231022)(93006095)(93001095)(3002001)(6041248)(20161123560025)(20161123564025)(20161123562025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(6072148)(201708071742011);SRVR:BN3PR07MB2481;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:BN3PR07MB2481; X-Forefront-PRVS: 0515208626 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6069001)(366004)(376002)(346002)(199004)(189003)(50226002)(2361001)(68736007)(8676002)(105586002)(2351001)(33646002)(48376002)(305945005)(7736002)(39060400002)(1076002)(106356001)(81156014)(81166006)(6486002)(8936002)(478600001)(6116002)(3846002)(72206003)(4326008)(36756003)(25786009)(54906003)(316002)(50466002)(6506006)(6306002)(16526018)(6512007)(97736004)(966005)(16586007)(2906002)(5660300001)(66066001)(6666003)(47776003)(6916009)(51416003)(52116002)(86362001)(53936002);DIR:OUT;SFP:1101;SCL:1;SRVR:BN3PR07MB2481;H:localhost.localdomain;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BN3PR07MB2481;23:djC6zGt4lJxXhpmPXQfbtqWQwe4mSR0qf1g/T/9Ez?= =?us-ascii?Q?TyoLjqGnHJoRN80ymPHa+Iy+dI/TjOPyfe69+Qew3HzXthQViIOqt0xDJ4VG?= =?us-ascii?Q?NuEQlJBADdohhfTCOULVl6+NNyg440O8glpNWUN58jqW74BCiznsKErVbXgf?= =?us-ascii?Q?VEaGCSZVXxXt1T+K5G77+4zD5t/DewDl3XYLO9qCrFXe3jAM5QIIF9dxQgi4?= =?us-ascii?Q?YTVih2ucUZX9/sAiF4wxinwRlp/euMwPLKf5tWMKkb8hzsVaNveHINqXQEWQ?= =?us-ascii?Q?No3XvnlVnd7dGMWLT8r73MH4iKrYeE+27Cg0BzvZz62jwYZ47CzqqXYGKmif?= =?us-ascii?Q?X4Trg1+m4kMV3Afr6zOI0MvUfhjk5fHvyqtBmlZ9adASO9/htEvtea5Dl7GE?= =?us-ascii?Q?wxDPENnXjY5hnQ7Xg7xWCeDvXgeZy3bZsNMxhb+I1sHGM8j16s1kJUQQq3Qv?= =?us-ascii?Q?TGCPTYBsPFI++hgddAxEgYA/WpZvjMTIbzGbwursp6aDJbFBBc2HhCFP59+b?= =?us-ascii?Q?Xd8QrXekwBUY3P91BWvxJagNYUrBHz7bA92kfxc2Sn8ipH3jYBg8+36kzpxR?= =?us-ascii?Q?J7NsjFFZ79Xo74fns/RR/0LjIRfzE1+hu0XlGm8Wf/RROAahUZ7OFe8f5CAB?= =?us-ascii?Q?HRSRyedWGEVceTWbKhRp4xpu8KNrWCO/VhsP9YtFvX2GRd3uAswM0DxYBEap?= =?us-ascii?Q?5Z6XJfOTNh+xzNte2+KDlin3FNcRyDmNZ/1wkNbWl8cZWWAKK0Nzzcc0VhXE?= =?us-ascii?Q?wTpVEHbZPdBiH0/Me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L5ud/iPIGpI+tGfLRjm/a07GBlgdFizmrr5lfCJutTdgX+R6CQZcbtX6gXQPe5szowlWyGV3tyobdXDiLAW0=;7:j+Q58qbcdvUkGAbbJRQFKygqz0hgosNojXHmD4peFO+mMdxyHrAjOf0kY0k4c/XEZ76ckjsmU2ZfJbeq5D/RxPveZR46umT0AQDd/t0bjtDKW/158G23If+E55ORkdy/l3qPcKbBLsG1a/4/Y+QKZA2C4WCWEw1A4ZoCjt3ZYZqmJsT7tyxOBCLGqqEAYEN6inVLQv9U2VI1PfXxQuZi30H9jucf0Ga7Yh5ibPS1/T+QZUS1LgVednF3aHriKnvw SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Dec 2017 10:35:02.6070 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bc87dc7b-fef7-458e-1dd0-08d53e275841 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 Content-Length: 2465 Lines: 54 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. v4: - 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 | 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, 756 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