From patchwork Fri Apr 14 00:44:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dipen Patel X-Patchwork-Id: 83157 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp44298vqo; Thu, 13 Apr 2023 17:56:08 -0700 (PDT) X-Google-Smtp-Source: AKy350ZVA2U/cNpuLNFjPvAUDpxXyMFTQKv6bEo1n6aOjCpmPNW1mXKbIB9nGmNBVLqvSkHrD6KB X-Received: by 2002:aa7:88ca:0:b0:63b:6727:eda0 with SMTP id k10-20020aa788ca000000b0063b6727eda0mr544053pff.26.1681433767766; Thu, 13 Apr 2023 17:56:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1681433767; cv=pass; d=google.com; s=arc-20160816; b=sAe2lovDVFD3b8EdXVTaqdqfR/3uijJdFrCrDgKX38R+PPohQtp0RdpJ0YJVmIYUBb i97/xVua+TnKg0CU6MWXUmsVl6zfOX/1zJ2lt6v3le0ANnfczhe++Weu7UkAMIG5A5zX vGu9JORG8eAk0iEVIeiumrZ5mGVFBbPfZ61J/D+9PMe969Gqd6AvuqLzq49BOaKr+WSo v6iwSLn6S5Wvg5fid/x6n1/bRdNGuf9apJ3qMxQZRg0R+z5VdZdMSy6OKhf/Dx5bcT/3 h8GtcnzUpfdx5Qd1aJA6XxUN9EHbk0jajZKjAIhXOggn5VE1hsEXVt95oECyjv1SMVaR 14DA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=dP5kJ/vC5AJs62jqKAJ+brtcGkn+r0lWkhnYvZGCnX4=; b=FU9xrXP92fqzzZWZmKpXcKVtfP2f7BEdN5AgKH0yZmLaoXRNHfWAYi+2lEEd1AQ6FW ym72c5DpjNUOQj0ezPlaHTrdC89x6ZrzO3LcRH9m23w/P15a2MT0f8nvHd9X6Kl6Jwk1 zxWscTLgD9kPNqGOrT8qA9Q7v7Dg9E+2AFtmTRGnoJbCkvPgpQRwZf59Og0XtzI0kSiJ LGfuYSy6KT1qJFn62y590zmm8IfVK3FVtn/qKRDGEt0t6M/3s7PmkPq0lwgpdWaw0A28 9dYDMVgBUe7JmZdtxRxmrOXYWFEdeX1eTQEcMpClL3PLArOet6r5BxJKDNQUl5FEPlU7 CJ7g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=lR2FH5au; arc=pass (i=1 spf=pass spfdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d25-20020aa797b9000000b006260645e6eesi2920165pfq.335.2023.04.13.17.55.50; Thu, 13 Apr 2023 17:56:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=lR2FH5au; arc=pass (i=1 spf=pass spfdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230019AbjDNApk (ORCPT + 99 others); Thu, 13 Apr 2023 20:45:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60812 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229773AbjDNApP (ORCPT ); Thu, 13 Apr 2023 20:45:15 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12hn2217.outbound.protection.outlook.com [52.100.167.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67F262719; Thu, 13 Apr 2023 17:45:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HdzvvdBHGuW/td+A42cyM1ENeDzTJ2L/vp+a/klReeRX7t9mjXPdEgsp20mnvXYneFD3obEp3EJZJdDYThfxlO7a+s3AX15BxWghfLMDnGDi8H+YFecQW/SMXxCWjvRJLv+R9OtLTIh5SynzWwzYOkRz2LxcJ7lGMcbDOOBfXIH1Ef9Foc1If6d67umEnnRolsTZ687d6sQfGi7A3Vhx87UQ+V+0Tna4Jb+p7me1/EzkHkLTXbzffFromkTNaIfK9oC2J4Qj3ubLN2AfKSkNBXxHpVVA63PJw9HyDtCtMn5f672ZI7s3dsi3E+U3XvLVlDhARBzP+b0dIP/pYvzh6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=dP5kJ/vC5AJs62jqKAJ+brtcGkn+r0lWkhnYvZGCnX4=; b=chvprc/kvYw8oSL6JgkqpzujGX1lJ5NKKSv9Sh+74mRwJ6OswhtLzVClGismo6tYTaBdoByxRENFSUjfKhGJEeUH2dScCXifTlfw0ICSogzlRgfSLI8R6xjW8P43y4vQFTq2UfISuF5D5bqorxEtmQsfSJDJtmu5KnoS9Ol//WpfnsGldpiy2ofKX2RBtuWO0SQXYOsaps68n7MTYjdGXWbWKNKvv7/wNQKIaCqOLH2xHyz8lKwFAu7BLQJI70JTTQZJk4wwHZTfBIARLI9zJXR6Rj9cTEJLNk5A9xmrNL7cr61G/P2IStzD+BuVSPQ379onPN9+2BHP381S8h7Umg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=gmail.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dP5kJ/vC5AJs62jqKAJ+brtcGkn+r0lWkhnYvZGCnX4=; b=lR2FH5au8tkFpVa0rqtzbfjFTEX5q+5gJ8ESh5+gCY972ULyQqmGRbLB/Ca3TKxbSzH7YtWom0VbnWEYO6ieQiiA1RricNa9ytkCFjrrvEyi81K4+Jd9TwS4Ea405KNdA8NvTJxixRKBfslv15b86c+//IyA+sVD/mF19HHn3HKSRbI64KLoDXGTKhSm4w9xf4ElUnvy5PV6dWGrggiX3D2LioXRASxZKSGLf8M6d/rjS+L1WCGNPU9ewrh1da6of6uyDUsaYfu3TjwWA86pwzAoNZL1LywumGMmkArKw52bK/yqKwRswrY/r8Tcfa0VSAxBI9HgARRhV2ngbvhoFg== Received: from BN0PR02CA0024.namprd02.prod.outlook.com (2603:10b6:408:e4::29) by SA1PR12MB6775.namprd12.prod.outlook.com (2603:10b6:806:25a::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.30; Fri, 14 Apr 2023 00:45:11 +0000 Received: from BN8NAM11FT094.eop-nam11.prod.protection.outlook.com (2603:10b6:408:e4:cafe::a5) by BN0PR02CA0024.outlook.office365.com (2603:10b6:408:e4::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.32 via Frontend Transport; Fri, 14 Apr 2023 00:45:10 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by BN8NAM11FT094.mail.protection.outlook.com (10.13.176.131) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.33 via Frontend Transport; Fri, 14 Apr 2023 00:45:10 +0000 Received: from rnnvmail204.nvidia.com (10.129.68.6) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Thu, 13 Apr 2023 17:45:01 -0700 Received: from rnnvmail204.nvidia.com (10.129.68.6) by rnnvmail204.nvidia.com (10.129.68.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Thu, 13 Apr 2023 17:45:00 -0700 Received: from dipenp.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.6) with Microsoft SMTP Server id 15.2.986.37 via Frontend Transport; Thu, 13 Apr 2023 17:45:00 -0700 From: Dipen Patel To: , , , , , , , , , , , , , CC: Dipen Patel Subject: [V6 5/9] hte: Re-phrase tegra API document Date: Thu, 13 Apr 2023 17:44:51 -0700 Message-ID: <20230414004455.19275-6-dipenp@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230414004455.19275-1-dipenp@nvidia.com> References: <20230414004455.19275-1-dipenp@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT094:EE_|SA1PR12MB6775:EE_ X-MS-Office365-Filtering-Correlation-Id: f02c7130-b1f0-4370-84b0-08db3c818098 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 61TUu064aiQEDiBqo+PpvOf9JLpvNsS4Iyioqg8S7tyKgFBnY7HPzSzks2bKrIOJMcrZcfD90Z1e6wqwPRqur5qXACxuLZ0PXLu30H2ptT6HRGzOXCt1SFr0WnhJaKJ35zaaiyu5JyVu2gpTmLWUO6rjKi2peOIwDkQMnKEKdZdJcMyS9MXIR0i061pDDcjrQUdVZ7y/H8Suq9qIB1hxAw+fV91cCIm6I7dT5+UYBEq26lZ0btJ99dFCC+bRU3oT17jmzaINDBclts95BvhcBnDFjHVEetRQOrIyBLBSBNO6tYvenTQI1OvxTmYYwUpfSng2NB3OWgyv2lKvn0q118nkiAecEv6H3YyN2nwRgjQg4j7WicN27SItSLVh72Pmdrjj+mDijfntftq+7jRaukaF0xWDPU1JazL+XhGlp9rID/kvIq2AsruwJS2hGgKIH5VabVKtXMcuA6H3c6WSiXb22CzDBLoHHkVCUXpsVtwNAhrNi8n3IqFK8Hty6NptNzaROwwu3uM4oMrkJ+GU54fMLEwF7Jji85FqgVDV298JUNipzHm09wlNdp2/C1aIVi4QzTK0udbhCBP/BKBkx6SlNzU35CwPqLJeH6qJdcYdna9J6wgrrFfk/AjqyPo/zGVSmxi7C4tn2oFGmVYPyapAkWR+Pignod5ModHaKzUJXD6i7I3YiZcUYcv5meaIuliLDIv2ynuulGCcx6eFOvbKVq35B0iv0GgIIHlH80+Wgo1pTJaWzJPMiOlpGJiQYVrpT/uOi8IgfqN7KGF2/Z1wLhtdOjKLRQKQyZqKtIyHp4hh25A1skXk91KUYxVMPnWgfQ2//wZ4w3EdvFu4DsWXmrQbB8rbsr5gTweLWSg= X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230028)(4636009)(346002)(39860400002)(136003)(396003)(376002)(451199021)(5400799015)(36840700001)(40470700004)(46966006)(6666004)(7696005)(40460700003)(4326008)(36756003)(70586007)(70206006)(110136005)(2906002)(7416002)(86362001)(356005)(7636003)(41300700001)(5660300002)(8676002)(8936002)(82740400003)(82310400005)(921005)(316002)(34020700004)(478600001)(40480700001)(1076003)(336012)(26005)(426003)(2616005)(36860700001)(107886003)(186003)(47076005)(83380400001)(83996005)(2101003)(12100799027);DIR:OUT;SFP:1501; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Apr 2023 00:45:10.6952 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f02c7130-b1f0-4370-84b0-08db3c818098 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT094.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB6775 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763111094558214249?= X-GMAIL-MSGID: =?utf-8?q?1763111094558214249?= Make Tegra194 API document generic to make it applicable for current and future tegra hte providers. Signed-off-by: Dipen Patel Reviewed-by: Bagas Sanjaya --- v5: - rename tegra194-hte.rst to tegra-hte.rst Documentation/driver-api/hte/index.rst | 2 +- .../hte/{tegra194-hte.rst => tegra-hte.rst} | 33 +++++++++---------- 2 files changed, 17 insertions(+), 18 deletions(-) rename Documentation/driver-api/hte/{tegra194-hte.rst => tegra-hte.rst} (50%) diff --git a/Documentation/driver-api/hte/index.rst b/Documentation/driver-api/hte/index.rst index 9f43301c05dc..29011de9a4b8 100644 --- a/Documentation/driver-api/hte/index.rst +++ b/Documentation/driver-api/hte/index.rst @@ -18,5 +18,5 @@ HTE Tegra Provider .. toctree:: :maxdepth: 1 - tegra194-hte + tegra-hte diff --git a/Documentation/driver-api/hte/tegra194-hte.rst b/Documentation/driver-api/hte/tegra-hte.rst similarity index 50% rename from Documentation/driver-api/hte/tegra194-hte.rst rename to Documentation/driver-api/hte/tegra-hte.rst index f2d617265546..85e654772782 100644 --- a/Documentation/driver-api/hte/tegra194-hte.rst +++ b/Documentation/driver-api/hte/tegra-hte.rst @@ -5,25 +5,25 @@ HTE Kernel provider driver Description ----------- -The Nvidia tegra194 HTE provider driver implements two GTE -(Generic Timestamping Engine) instances: 1) GPIO GTE and 2) LIC -(Legacy Interrupt Controller) IRQ GTE. Both GTE instances get the -timestamp from the system counter TSC which has 31.25MHz clock rate, and the -driver converts clock tick rate to nanoseconds before storing it as timestamp -value. +The Nvidia tegra HTE provider also known as GTE (Generic Timestamping Engine) +driver implements two GTE instances: 1) GPIO GTE and 2) LIC +(Legacy Interrupt Controller) IRQ GTE. Both GTE instances get the timestamp +from the system counter TSC which has 31.25MHz clock rate, and the driver +converts clock tick rate to nanoseconds before storing it as timestamp value. GPIO GTE -------- This GTE instance timestamps GPIO in real time. For that to happen GPIO -needs to be configured as input. The always on (AON) GPIO controller instance -supports timestamping GPIOs in real time and it has 39 GPIO lines. The GPIO GTE -and AON GPIO controller are tightly coupled as it requires very specific bits -to be set in GPIO config register before GPIO GTE can be used, for that GPIOLIB -adds two optional APIs as below. The GPIO GTE code supports both kernel -and userspace consumers. The kernel space consumers can directly talk to HTE -subsystem while userspace consumers timestamp requests go through GPIOLIB CDEV -framework to HTE subsystem. +needs to be configured as input. Only the always on (AON) GPIO controller +instance supports timestamping GPIOs in real time as it is tightly coupled with +the GPIO GTE. To support this, GPIOLIB adds two optional APIs as mentioned +below. The GPIO GTE code supports both kernel and userspace consumers. The +kernel space consumers can directly talk to HTE subsystem while userspace +consumers timestamp requests go through GPIOLIB CDEV framework to HTE +subsystem. The hte devicetree binding described at +``Documentation/devicetree/bindings/timestamp`` provides an example of how a +consumer can request an GPIO line. See gpiod_enable_hw_timestamp_ns() and gpiod_disable_hw_timestamp_ns(). @@ -34,9 +34,8 @@ returns the timestamp in nanoseconds. LIC (Legacy Interrupt Controller) IRQ GTE ----------------------------------------- -This GTE instance timestamps LIC IRQ lines in real time. There are 352 IRQ -lines which this instance can add timestamps to in real time. The hte -devicetree binding described at ``Documentation/devicetree/bindings/timestamp`` +This GTE instance timestamps LIC IRQ lines in real time. The hte devicetree +binding described at ``Documentation/devicetree/bindings/timestamp`` provides an example of how a consumer can request an IRQ line. Since it is a one-to-one mapping with IRQ GTE provider, consumers can simply specify the IRQ number that they are interested in. There is no userspace consumer support for