From patchwork Sun Jun 27 17:19:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 12346925 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,MIME_HEADER_CTYPE_ONLY,MIME_NO_TEXT, SPF_HELO_NONE,SPF_PASS,T_TVD_MIME_NO_HEADERS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 71BD2C48BC2 for ; Sun, 27 Jun 2021 17:20:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 50A7961477 for ; Sun, 27 Jun 2021 17:20:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231294AbhF0RWi (ORCPT ); Sun, 27 Jun 2021 13:22:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230321AbhF0RWh (ORCPT ); Sun, 27 Jun 2021 13:22:37 -0400 Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com [IPv6:2607:f8b0:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC1DDC061574 for ; Sun, 27 Jun 2021 10:20:13 -0700 (PDT) Received: by mail-pg1-x536.google.com with SMTP id u190so13232045pgd.8 for ; Sun, 27 Jun 2021 10:20:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id; bh=kNCpo62SaH6pkboUq5a1t6hUnqtM5YlcWDRo7ok1W+A=; b=NvoTjEYT9Pf9JGpXO5caS+nsOLiZs9yZjPx+LGgMUfk2ETuO0OUq0UdYtdQFzSmUq8 Qyl0Kee76iA/MG3u6YbEGzNH5xqd33dd0zu5UBGpeSxojCw7O4WLPCbXUP5KEpzBUrX2 dvLCQJ4fKhbkbvwBu2KF8uOiv0bfZDg37c2lQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=kNCpo62SaH6pkboUq5a1t6hUnqtM5YlcWDRo7ok1W+A=; b=kxjS4iD31L/nTSi+qi665UOtWyyQgK6fGzG8c/S4s4rlcyDognpzeP9ARQCbQ5tPwm 9gXAlB+R35FSf8UOhc3okrqZUPf8ZrQ5+6Sc9K4waiGeY5hYjy1OgbaFClXBjyap9UwK A234o8xfXog1ytxd6kNpnDynrukzSGW7ZqQ4Z0bWvH/7tgBfso3VYV5FR+qDZXnIim3i TncQCNyqTqTovkR7BFGyJOe0tw65DbyUtS46Ryxcb0M1vlMeMi/nc/+H/m6mmX5+Zv02 HkC0+8MnIrqWJcpmRNH897b35K1u35YytWlcUicC7RvhP7hK3jLO7LGUSTSOLZL74XgC Ce0w== X-Gm-Message-State: AOAM531vcET/yjAQAKkkjRmTAw3fm5wtf3p9SkQUvH7sygu17xxfAUTf 2JhQYCLEM3VDnPE7Gx7JWGQG2A== X-Google-Smtp-Source: ABdhPJzpQ/hzFBoGBafFK0kGNUoUr1hogrMVnW4gv/imKN4NiQuiCMKjx+2idyb7aP+VBBw9MrBrGw== X-Received: by 2002:a63:530a:: with SMTP id h10mr19598349pgb.98.1624814412363; Sun, 27 Jun 2021 10:20:12 -0700 (PDT) Received: from localhost.swdvt.lab.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id j8sm11011584pfu.60.2021.06.27.10.20.08 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 27 Jun 2021 10:20:11 -0700 (PDT) From: Michael Chan To: davem@davemloft.net Cc: netdev@vger.kernel.org, kuba@kernel.org, gospo@broadcom.com, richardcochran@gmail.com, pavan.chebbi@broadcom.com, edwin.peer@broadcom.com Subject: [PATCH net-next v2 0/7] bnxt_en: Add hardware PTP timestamping support on 575XX devices Date: Sun, 27 Jun 2021 13:19:43 -0400 Message-Id: <1624814390-1300-1-git-send-email-michael.chan@broadcom.com> X-Mailer: git-send-email 1.8.3.1 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Add PTP RX and TX hardware timestamp support on 575XX devices. These devices use the two-step method to implement the IEEE-1588 timestamping support. v2: Add spinlock to serialize access to the timecounter. Use .do_aux_work() for the periodic timer reading and to get the TX timestamp from the firmware. Propagate error code from ptp_clock_register(). Make the 64-bit timer access safe on 32-bit CPUs. Read PHC using direct register access. Michael Chan (4): bnxt_en: Update firmware interface to 1.10.2.47 bnxt_en: Get PTP hardware capability from firmware bnxt_en: Add PTP clock APIs, ioctls, and ethtool methods bnxt_en: Enable hardware PTP support Pavan Chebbi (3): bnxt_en: Get the full 48-bit hardware timestamp periodically bnxt_en: Get the RX packet timestamp bnxt_en: Transmit and retrieve packet timestamps drivers/net/ethernet/broadcom/Kconfig | 1 + drivers/net/ethernet/broadcom/bnxt/Makefile | 2 +- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 134 +++- drivers/net/ethernet/broadcom/bnxt/bnxt.h | 10 +- .../net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 34 + drivers/net/ethernet/broadcom/bnxt/bnxt_hsi.h | 667 ++++++++++++++++-- drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c | 473 +++++++++++++ drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.h | 81 +++ .../net/ethernet/broadcom/bnxt/bnxt_sriov.c | 4 +- 9 files changed, 1355 insertions(+), 51 deletions(-) create mode 100644 drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c create mode 100644 drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.h