From patchwork Fri Mar 10 19:06:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dipen Patel X-Patchwork-Id: 661890 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4E200C7618A for ; Fri, 10 Mar 2023 19:06:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230479AbjCJTGw (ORCPT ); Fri, 10 Mar 2023 14:06:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230350AbjCJTGu (ORCPT ); Fri, 10 Mar 2023 14:06:50 -0500 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2052.outbound.protection.outlook.com [40.107.244.52]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 17E7A1308FB; Fri, 10 Mar 2023 11:06:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YSEJbTfEm2rsLNFqtDhiahYXKq7C9nX5AnFHC20qzJiLTvOGJ1uRpZXirmQHDJcYX7QasLUGshEEyHpJ/dVEd1IUkFYn6HZG5WTAa6ZKLBXW0xedNADethDmNb2KaLbEtYGEOXQtnZrQx411ZT79IsigE0tI/43D6c/94U3ftk+CE8XxiA3+myHzJzGTMmEf9THaRRTWisELXwjeVVjpkztcPOnPUscBNRamYpsMiw9JQ5ExSzrakVVO+GYRSIco4QrMFy0xMS3WGQWBcvVKzuY0lENFaz1Yo2BjkapZkT4hybRu7GyJ3baxDYN+vjs0+XP8NyEsNkbm0m7r+4agDA== 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=GjFx6t6ewKuT1HROZmJBJ4zFt63V8v16WCuDZSAYzhY=; b=MvUhZXpG0czXMB67hnVdqnZZuS6lUMjS5yBS8pTOneUTN1m6vAKuJDrvlsQsJBwz9ISxlpVCEqlfundpflNCqxV3pNWqH9SN99XOBh5IjvX224uZCuwDrw++98aU7cSncbf2f3z+QejNF0F4RkxZ3fXi6CO2PujoDzQ05QpaDQQ6/oJyWJe4zjRbVMQV8MLvb5fswAPSCo725v6jW7PfOr/S5PlmRILlvxjaFyL5tB02uUWhQiG78JBbfzejGu4dpyfErrr3SJ89Kmk58gQe4G/5wfEOsFmmyzJFeRmQHSOfZ3kTxAg+ec42wZMwohzb5iautoNpP9g/iKjJDVX6xQ== 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=GjFx6t6ewKuT1HROZmJBJ4zFt63V8v16WCuDZSAYzhY=; b=IjsTctKaJtkGaijfW1rZ2oZQBmy2plpy0+DpYtM11Wacktdw4g7JomygW3WLsyUr2Ap9sOdwGBYHIkB+AJm4PaR3qCxbcz4FFGquITGYk/UelqYthNFQv/ogT/gpdthj+/5u6XRcMEHrC2XklAjyrxcTHlsMfwIKCG9QebqdAtYw2p32llAcgzsV0B/JD6B7UeUOWF3ZAesDultw1Qq1XC+hl0QMO/7ovPGvX0/yUErycCkHcl8HIcea5XKm7ZlIQGCb/Ep4iLN722Tz+XkEeTh7WAS6xYi1HV7aHIftJNlHWCqJ4EvVAyw/06X47p9kjyJqphe8TmBVg6+aquBgKQ== Received: from MW4PR04CA0257.namprd04.prod.outlook.com (2603:10b6:303:88::22) by PH7PR12MB7234.namprd12.prod.outlook.com (2603:10b6:510:205::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19; Fri, 10 Mar 2023 19:06:46 +0000 Received: from CO1NAM11FT101.eop-nam11.prod.protection.outlook.com (2603:10b6:303:88:cafe::ce) by MW4PR04CA0257.outlook.office365.com (2603:10b6:303:88::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19 via Frontend Transport; Fri, 10 Mar 2023 19:06:46 +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 CO1NAM11FT101.mail.protection.outlook.com (10.13.175.164) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.20 via Frontend Transport; Fri, 10 Mar 2023 19:06:46 +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; Fri, 10 Mar 2023 11:06:39 -0800 Received: from rnnvmail205.nvidia.com (10.129.68.10) 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; Fri, 10 Mar 2023 11:06:39 -0800 Received: from dipenp.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server id 15.2.986.5 via Frontend Transport; Fri, 10 Mar 2023 11:06:38 -0800 From: Dipen Patel To: , , , , , , , , , , , , , CC: Dipen Patel Subject: [PATCH V3 2/6] dt-bindings: timestamp: Add Tegra234 support Date: Fri, 10 Mar 2023 11:06:30 -0800 Message-ID: <20230310190634.5053-3-dipenp@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230310190634.5053-1-dipenp@nvidia.com> References: <20230310190634.5053-1-dipenp@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT101:EE_|PH7PR12MB7234:EE_ X-MS-Office365-Filtering-Correlation-Id: 4a2a12d1-aa95-474c-c35d-08db219a9859 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0LuXL6QZkZGpOchzl9frMhvOSPAUEpkbe2b10/xKEzJazqDh54TNklpqBXf2soHHt1uDobqATwahPgy3rbPBzbIRLKlagC5tsjDk7MQCRtGf7Rd1m1Vd1ZIbWa0duF2HUiHR5Y64u6fEqDLHDqWXB82eaSfjbOIlyZPL/mUMtf7WD2UL/tLXIfs1z6MdHcLh/pzgsS5FYqfHw543SbpeSHI9lxwYYumqCAh2OrIpyrqP3I1VApxtdpZfW5AV6Qqn1VLI8dLrJwb0DVr1cDYr0jt22Lg0zLprdxksMQW2JQPO1VOgLPTrtZjZ8yWpG8peznwhNub/gb8X3bCtwjffZD9iWISJHfVd0i2ko/MbIXQs33K4GPNFjNa6HnUNN3YR0XBa2Iy8xpIJgo618Utwylgi1WGm41E2zWgm/Vlp9z8q00RzjW8UvlcbFwYsUZ9mO9OKXt3Mvs1cG1aGmEz5exLxuBIgrcRTR5PZU1OHEeSv+buZ5I+Ih5yThavEftzy6kEvia6kR7ZcsxOsRtneGpTpXEauMKLl7lSRtkcoTUtzXnXr5z4MyLAgnIrBoPc6Qu0GLapyTs8kaAvJisHkWQC9FSYQc7nvvHVbvgxutX7TrQ2rSuvHmzZDjJNzx6DXkmQOqYJkRZ9W7PC0pRGAhsI8Z71gxka3jbwnXK9lpf//XoDgQu9iBMkgvHSyi4dWUJyMMQbQAFDGWzcpps1KuOQ9PYUgF9ink2xWoXOgWhCiIM85q7/25nfxe/1G4DuKY682Otxz04cHwV3ryUOVdDi1IkiNenF2KJSkBScioQpJREqyD17IXrTVIJ3veiy4ZKf8pHkWmF+EaxHcqW/kpB/GFFGa+Gmp2yvjqhrR6A637gfUh0NLu3tejdrFzSRCs945V0GeU5tPd62p/PliZA== 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:(13230025)(4636009)(39860400002)(346002)(136003)(396003)(376002)(451199018)(46966006)(40470700004)(36840700001)(26005)(966005)(107886003)(1076003)(7696005)(2616005)(83380400001)(426003)(186003)(6666004)(336012)(316002)(70586007)(8676002)(70206006)(110136005)(36860700001)(8936002)(7636003)(82740400003)(41300700001)(5660300002)(4326008)(7416002)(2906002)(47076005)(921005)(356005)(82310400005)(86362001)(478600001)(40460700003)(40480700001)(36756003)(83996005)(2101003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Mar 2023 19:06:46.6663 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4a2a12d1-aa95-474c-c35d-08db219a9859 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: CO1NAM11FT101.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB7234 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Added timestamp provider support for the Tegra234 in devicetree bindings. In addition, it addresses review comments from the previous review round as follows: - Removes nvidia,slices property. This was not necessary as it is a constant value and can be hardcoded inside the driver code. - Adds nvidia,gpio-controller property. This simplifies how GTE driver retrieves GPIO controller instance, see below explanation. Without this property code would look like: if (of_device_is_compatible(dev->of_node, "nvidia,tegra194-gte-aon")) hte_dev->c = gpiochip_find("tegra194-gpio-aon", tegra_get_gpiochip_from_name); else if (of_device_is_compatible(dev->of_node, "nvidia,tegra234-gte-aon")) hte_dev->c = gpiochip_find("tegra234-gpio-aon", tegra_get_gpiochip_from_name); else return -ENODEV; This means for every future addition of the compatible string, if else condition statements have to be expanded. With the property: gpio_ctrl = of_parse_phandle(dev->of_node, "nvidia,gpio-controller", 0); .... hte_dev->c = gpiochip_find(gpio_ctrl, tegra_get_gpiochip_from_of_node); We haven't technically started making use of these bindings, so backwards-compatibility shouldn't be an issue yet. Signed-off-by: Dipen Patel --- v2: - Removed nvidia,slices property - Added nvidia,gpio-controller based on review comments from Thierry, this will help simplify the hte provider driver. v3: - Explained changes in detail in commit message - Added allOf section per review comment .../timestamp/nvidia,tegra194-hte.yaml | 31 ++++++++++++------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/Documentation/devicetree/bindings/timestamp/nvidia,tegra194-hte.yaml b/Documentation/devicetree/bindings/timestamp/nvidia,tegra194-hte.yaml index c31e207d1652..eb904ac2f331 100644 --- a/Documentation/devicetree/bindings/timestamp/nvidia,tegra194-hte.yaml +++ b/Documentation/devicetree/bindings/timestamp/nvidia,tegra194-hte.yaml @@ -4,7 +4,7 @@ $id: http://devicetree.org/schemas/timestamp/nvidia,tegra194-hte.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml# -title: Tegra194 on chip generic hardware timestamping engine (HTE) +title: Tegra on chip generic hardware timestamping engine (HTE) provider maintainers: - Dipen Patel @@ -23,6 +23,8 @@ properties: enum: - nvidia,tegra194-gte-aon - nvidia,tegra194-gte-lic + - nvidia,tegra234-gte-aon + - nvidia,tegra234-gte-lic reg: maxItems: 1 @@ -38,14 +40,11 @@ properties: minimum: 1 maximum: 256 - nvidia,slices: - $ref: /schemas/types.yaml#/definitions/uint32 + nvidia,gpio-controller: + $ref: /schemas/types.yaml#/definitions/phandle description: - HTE lines are arranged in 32 bit slice where each bit represents different - line/signal that it can enable/configure for the timestamp. It is u32 - property and depends on the HTE instance in the chip. The value 3 is for - GPIO GTE and 11 for IRQ GTE. - enum: [3, 11] + The phandle to AON gpio controller instance. This is required to handle + namespace conversion between GPIO and GTE. '#timestamp-cells': description: @@ -59,9 +58,20 @@ required: - compatible - reg - interrupts - - nvidia,slices - "#timestamp-cells" +allOf: + - if: + properties: + compatible: + contains: + enum: + - nvidia,tegra194-gte-aon + - nvidia,tegra234-gte-aon + then: + required: + - nvidia,gpio-controller + additionalProperties: false examples: @@ -71,7 +81,7 @@ examples: reg = <0xc1e0000 0x10000>; interrupts = <0 13 0x4>; nvidia,int-threshold = <1>; - nvidia,slices = <3>; + nvidia,gpio-controller = <&gpio_aon>; #timestamp-cells = <1>; }; @@ -81,7 +91,6 @@ examples: reg = <0x3aa0000 0x10000>; interrupts = <0 11 0x4>; nvidia,int-threshold = <1>; - nvidia,slices = <11>; #timestamp-cells = <1>; }; From patchwork Fri Mar 10 19:06:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dipen Patel X-Patchwork-Id: 661888 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6B034C74A44 for ; Fri, 10 Mar 2023 19:07:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231300AbjCJTHF (ORCPT ); Fri, 10 Mar 2023 14:07:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231204AbjCJTG6 (ORCPT ); Fri, 10 Mar 2023 14:06:58 -0500 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2051.outbound.protection.outlook.com [40.107.223.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2B04131330; Fri, 10 Mar 2023 11:06:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YePONIdmBl9/8Ch6EtVP3j6O42Bvz5DAXCpaZwwVA05nbEj5AkyfdbnqO8mF//CiXwjxfEkSWFd/Nm1ydjjEokxEwTZul36z/qSYBWaq4ZOLEGa6W0yX+nhHc07B4dVnY+3ezxe1RqaQM5Mb3aHDUvBjZyP2xuy1WJQroKKEt7EzU5duxIyCbpqVeiNJJ795NJVtI+XSqOWJkMeBrgnbaeaf/I+Q8CK6++bFshW2HTAfLFTpNO8fYSa0lv7oSq2g5vJPHPUHMmYvTgEiFTCDoF/GbeVOzkLdML1DUN+oFTrkrIQmkg1LDluVsPSQKdfJ9tTOr6frJKdubK8M8vjgOA== 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=GjbHZfAEXm7Tpt9u32Vn9q9T4Up+3nN7WFwlqHYtLGs=; b=L2Bj93+UQzt37gnk+FM4cmTosVWg/YBT+XaoEiyYTMZf4OpLeHemOW7hQNg5DFCXlJmKUMTwa5doQUkm8DvTu+siuA7yaW3o6Mp5N8d4RR+cqlfRVskGsz158+k35J/NWBRrqeV+8mBVXZRs5zeXC8hm5T81lGXwQofVmYee394btUU0VqR/9FoqpJ8lkVP3JCrt/FYhavSdDy7zOr4QfPuN34nPbwWk4l9m6DZXvD6NeROLEVy9OGKYjNF0E8HDKEmNxLgA7zALRn2ZcRHUYiKiiiJP4zDqD06woe6uxrZcWFhaT+DedmQ5v523c40djOGf/j2Atota1k8iWJSkYQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) 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=GjbHZfAEXm7Tpt9u32Vn9q9T4Up+3nN7WFwlqHYtLGs=; b=K4B721c7HSZUUNaSTZz4z7zvUEJdjhemmIdGP9M9SpMCjCFeehoZ7sZ/rMLuJdmtZA2EnLIs49/3rnpIbBvXdeRG/2GNmB1gaCqfE4V2yLp7g+KaVwvHsX0UmmJechWykrb1FKD5whkj508NpJd7ca8jsHHVROYt994yoB4HRYQwklL9/Vk6MfXuKDFXaXV3l5tne+DZ++vCqnTdmUv4tVG2f7kqXB745o5h3n9+00tqvaF5ixiOHqu723V5xhR7h2i/TRcGi/JW7P54jtT7ko3u25L3or09NYV+MjuotmUsfIwkB0RPgcaPiwSuJSQq71cWeQTNVLNK5o60O3X/tg== Received: from MW4PR03CA0320.namprd03.prod.outlook.com (2603:10b6:303:dd::25) by IA1PR12MB7712.namprd12.prod.outlook.com (2603:10b6:208:420::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19; Fri, 10 Mar 2023 19:06:53 +0000 Received: from CO1NAM11FT085.eop-nam11.prod.protection.outlook.com (2603:10b6:303:dd:cafe::60) by MW4PR03CA0320.outlook.office365.com (2603:10b6:303:dd::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19 via Frontend Transport; Fri, 10 Mar 2023 19:06:52 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) 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.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by CO1NAM11FT085.mail.protection.outlook.com (10.13.174.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.20 via Frontend Transport; Fri, 10 Mar 2023 19:06:52 +0000 Received: from rnnvmail205.nvidia.com (10.129.68.10) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Fri, 10 Mar 2023 11:06:40 -0800 Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail205.nvidia.com (10.129.68.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Fri, 10 Mar 2023 11:06:39 -0800 Received: from dipenp.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server id 15.2.986.5 via Frontend Transport; Fri, 10 Mar 2023 11:06:39 -0800 From: Dipen Patel To: , , , , , , , , , , , , , CC: Dipen Patel Subject: [PATCH V3 3/6] hte: Re-phrase tegra API document Date: Fri, 10 Mar 2023 11:06:31 -0800 Message-ID: <20230310190634.5053-4-dipenp@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230310190634.5053-1-dipenp@nvidia.com> References: <20230310190634.5053-1-dipenp@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT085:EE_|IA1PR12MB7712:EE_ X-MS-Office365-Filtering-Correlation-Id: 41fdef68-452e-431b-da8e-08db219a9bfe X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nAzyAvOGVjM/C+UY7DxsmvXJPiDjUuQHDJnSM7BwcT3ZxTfsGJ+oWs0lnYzoSGmoiAl1gpqRTgYr4XlU04Dp8gAaKi/vaV3/FdKLgtAZcL6L2MhNEXdusHyXY5sqdpy7W9ftkmXorrTEpmwtWujDe6+Ijg0ZvsruIQy5TUlcFgQrJqoUTCIIseTME3j+SlAHMunwk2Y8AS4zJz8IgNoScgnelWeScqbLbQK2OSSY5DzapnBP0WX85UuWnF6H+q9MubXRKaW5PFetWJveCR6Vc7ZsAJmJublXJ826lnb6qfM2nyxFHJR2QlcNYwlb4TQJY48Fjak39ZlV/Hrwy+6wYGNTbjvdbl89UzCrEk01tEXfjPJ4E+VyjYhSOd1JgBGli8JalgG5X0WNx28q1mGzxBpKFvsmuvin6kc7pB8Nz8yh1dWfuUi55+xTuiraXe/OV0gCX2IOaGZjmrW+CBYuuFwOZBq8Xdp1gwM5cyVok20KD7haQey1sSwuFJ+jZHmF/TBQB+nPDVNI8cRm2nmiq8VA9CcwPUCIkAJUOYFUz1fNizsuTBmVFnQ8qRdOx+0kgWmiTeYBvar9NAO+CXm2id6IbJvxTnQW4eHuyZMfKlLyYJHcyky8DojifWXm0YLG/VCiA+AfuCOT+PMsS/D1stZhQjp3fLYD/pr25PUQiFxQHhanEqyNf+V4n1rQDVIGy4KiMfWSPrlIskLhA0BX27x+7mMRmUS0H3RyZsldmM0RoRmybtZEahIW++0iO0ida3egfjj0o/kBruHcgO8nEv31mg6PQk4RW4Y85C8pwTigboryHyc+EPi2spYaMpnA X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230025)(4636009)(396003)(39860400002)(376002)(136003)(346002)(451199018)(40470700004)(36840700001)(46966006)(82310400005)(83380400001)(336012)(2616005)(47076005)(36860700001)(426003)(40460700003)(2906002)(86362001)(921005)(40480700001)(356005)(82740400003)(70586007)(7636003)(36756003)(70206006)(4326008)(316002)(8676002)(7416002)(5660300002)(8936002)(41300700001)(6666004)(107886003)(1076003)(186003)(110136005)(478600001)(7696005)(26005)(2101003)(83996005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Mar 2023 19:06:52.7189 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 41fdef68-452e-431b-da8e-08db219a9bfe 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.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT085.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB7712 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Make Tegra194 API document generic to make it applicable for current and future tegra hte providers. Signed-off-by: Dipen Patel --- Documentation/driver-api/hte/tegra194-hte.rst | 33 +++++++++---------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/Documentation/driver-api/hte/tegra194-hte.rst b/Documentation/driver-api/hte/tegra194-hte.rst index f2d617265546..85e654772782 100644 --- a/Documentation/driver-api/hte/tegra194-hte.rst +++ b/Documentation/driver-api/hte/tegra194-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 From patchwork Fri Mar 10 19:06:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dipen Patel X-Patchwork-Id: 661889 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4B536C7618B for ; Fri, 10 Mar 2023 19:07:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231228AbjCJTG6 (ORCPT ); Fri, 10 Mar 2023 14:06:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230437AbjCJTGy (ORCPT ); Fri, 10 Mar 2023 14:06:54 -0500 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2065.outbound.protection.outlook.com [40.107.220.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 86FC313131B; Fri, 10 Mar 2023 11:06:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y7uoKkrJuiFaC/NC0svVKUapz0bjVRSIMAZKOARVQ8PS3YGw9FcjX9ZH6fK/DrmtuLHM//Ymyw9egQhEJEtITMDGjQnK5JSi5KBtyd0NDRFZC3Yr1GN1fE9YnDjTRRd5U6UKVBL96OA5VVjOEkOpzjBaUupQBmrD7y3TV+XN2fQUx6Qu87hM/Lno0wIpqE15snf9cCM9/96lmgHSoWLDbgTxX8oFYwabYLFGMFCwi1z1LYpBSDyn3IL1sFfH4XGy10NTAu9IqtM311OFBi/ieOsiWjYD6mko245pviYh/roF5EdSLFX/ydKOUoY5VsVpJ482bm39nwEOTR/oa7kY/w== 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=lLMd7hf6vEuwQ2gOleXhlQ+951OiArMNK/PD1K057bA=; b=YdDDbZEpqjf2FqubraEHwyTv642+Aj0myKrR7/387Rj+eHsLDYy3JieKqbpuESgQDVd9NWWdSx+FuAm1o2mxHKP/ZeQMfoG4EuIBImYEqcvgc5XHbkaWInDvgnbzWY3bWlKX4Es8l0AevrIQwWbNpo95j8zU0c/X0wI+QqQoB+efiUEOZ6V0X313Tkz6Ab0y/4IkA7nssFffxer/h9KUJOrsnGoif9djFBcq7rfcM2vLKk/i5kCYR5sqtVP30nzvZlolfaVuRHMqipsLNT1i4iba8dmMvzAEFr+sKOu5TizzaKdWLsQlOaZfstiK+Cj3RN43LVuy6o8WlQyCxrW2ZQ== 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=lLMd7hf6vEuwQ2gOleXhlQ+951OiArMNK/PD1K057bA=; b=o85lAwf13fjrt8qolQdBt8biwafg4UtKCh3aMYQ9tFA0AR0RDrd5pcsQ7w511VC0X3VbLVbYE4A5Fnk9n5hOUAbwvbJv0Yhcqie9ZImSu6KsAHlkr74Q/oJRm5jinyz5NSa0b8mHRDECk+8qwf058aSLhmxoKMIdjIyc+5A3waYWmJC7UW6imbbkO5sh9XjDxPZp/N++UmGYP8o5mhi9a5fKwTACUzRTpDVgIgSYuOWfF8ptUt2Vbvm/vNJCP2YHhY5Lm+0bLCTYi15ol1m3Yom7Fd3xh5kWwGrhsKqi6aqOFHHEyPTFr+1NIo/Vqf4HSTEhV5YyZvKtReFj+Bbcpw== Received: from MW4PR04CA0244.namprd04.prod.outlook.com (2603:10b6:303:88::9) by SA0PR12MB4557.namprd12.prod.outlook.com (2603:10b6:806:9d::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19; Fri, 10 Mar 2023 19:06:50 +0000 Received: from CO1NAM11FT101.eop-nam11.prod.protection.outlook.com (2603:10b6:303:88:cafe::d) by MW4PR04CA0244.outlook.office365.com (2603:10b6:303:88::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19 via Frontend Transport; Fri, 10 Mar 2023 19:06:50 +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 CO1NAM11FT101.mail.protection.outlook.com (10.13.175.164) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.20 via Frontend Transport; Fri, 10 Mar 2023 19:06:50 +0000 Received: from rnnvmail205.nvidia.com (10.129.68.10) 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; Fri, 10 Mar 2023 11:06:41 -0800 Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail205.nvidia.com (10.129.68.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Fri, 10 Mar 2023 11:06:41 -0800 Received: from dipenp.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server id 15.2.986.5 via Frontend Transport; Fri, 10 Mar 2023 11:06:41 -0800 From: Dipen Patel To: , , , , , , , , , , , , , CC: Dipen Patel Subject: [PATCH V3 6/6] arm64: tegra: Add GTE nodes Date: Fri, 10 Mar 2023 11:06:34 -0800 Message-ID: <20230310190634.5053-7-dipenp@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230310190634.5053-1-dipenp@nvidia.com> References: <20230310190634.5053-1-dipenp@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT101:EE_|SA0PR12MB4557:EE_ X-MS-Office365-Filtering-Correlation-Id: 303dbcaa-6113-43cc-cc03-08db219a9a6f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WYq2G/lsXR/L+tfghzT/iPPSnimKqDrdHOx2bHE66HK/XA6lvoJMlmmwLBRHJwyyJp9uDCj6FdJ/E9dH5vgga3eue2GrXumP+M5a7h7Wdqi5sHE12cLpjx6V4XsYwsRN5lL+BUhztwjH3sj+eYbZTOWQxDeS43LwwaL8aB/Q3JXHepbWFW77ebKxhp/tN0NicyS12nRyf7MW6iIu8eVDlPL268EU79QBzfhCPc1O8SqwZmS9gM1kCASmOLdIKAtGB4mHGIrDu5fo1gD3P1wXbzkD1gZ7UlDB2zrxgIZYaWe5KHczudszuqo/VGC6sJwCQ5bStrmLS7HpCfFT0GMM8fbBpwXMVgp/yqJaL4MTc0btt2M+pwcIAsix286Co7GUf0wlV3YBnVAvfVzgB94IG42+wk48EXYScTJtPYbrH4yWC5iKJ6hOX3+74xGM2T4RljdVEczBw6a3NJRAUeY0D3EqFvsPvscsBv8elmcJT/JnQj47eMoTTo5wKHXvandTU9tLF2D4gMwW9bFT6uXbF9uHGUqMvLgKEIuT/LupCW3cEiPOv5Aw2lZ1gNNTKFWfjOo21M+aGUoG2QLjgzBs+8VJ6jOOycIUtNtGIvv8gAoADW4k9q5kPnx1YNnB21vQj9fC0CTb1YUER0JTyEdfTqEKjL2rDtkanXXKaughaAEV4/M4FotA/juh1Jl1A1x1TQThmFCrycajgKqYp6dIwiSrZHRcPzn117eZjl3CWcQZmWP7GnuKLx5zMHRtiV2crTCj2PCgzUbFhlq3Jv9WraKcSFXHZzCRy/eXWFCZwyFB+DKlGUa7dfPtQeleTy94 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:(13230025)(4636009)(396003)(136003)(39860400002)(346002)(376002)(451199018)(46966006)(40470700004)(36840700001)(7636003)(82740400003)(2906002)(83380400001)(82310400005)(36756003)(40460700003)(5660300002)(7416002)(40480700001)(70586007)(8936002)(70206006)(8676002)(921005)(356005)(478600001)(316002)(4326008)(36860700001)(110136005)(86362001)(7696005)(47076005)(426003)(107886003)(336012)(2616005)(26005)(186003)(1076003)(6666004)(41300700001)(2101003)(83996005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Mar 2023 19:06:50.1817 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 303dbcaa-6113-43cc-cc03-08db219a9a6f 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: CO1NAM11FT101.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB4557 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Add GTE nodes for the tegra234. Also modify AON GTE nodes for the tegra194 to remove nvidia,slice property and add nvidia,gpio-controller property to specify AON GPIO controller node so that GTE driver can do namespace conversion between GPIO lines provided by the gpiolib framework and hardware timestamping engine subsystem. Signed-off-by: Dipen Patel --- arch/arm64/boot/dts/nvidia/tegra194.dtsi | 3 +-- arch/arm64/boot/dts/nvidia/tegra234.dtsi | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/arch/arm64/boot/dts/nvidia/tegra194.dtsi b/arch/arm64/boot/dts/nvidia/tegra194.dtsi index 133dbe5b429d..7065643af275 100644 --- a/arch/arm64/boot/dts/nvidia/tegra194.dtsi +++ b/arch/arm64/boot/dts/nvidia/tegra194.dtsi @@ -1355,7 +1355,6 @@ reg = <0x0 0x3aa0000 0x0 0x10000>; interrupts = ; nvidia,int-threshold = <1>; - nvidia,slices = <11>; #timestamp-cells = <1>; status = "okay"; }; @@ -1578,7 +1577,7 @@ reg = <0x0 0xc1e0000 0x0 0x10000>; interrupts = ; nvidia,int-threshold = <1>; - nvidia,slices = <3>; + nvidia,gpio-controller = <&gpio_aon>; #timestamp-cells = <1>; status = "okay"; }; diff --git a/arch/arm64/boot/dts/nvidia/tegra234.dtsi b/arch/arm64/boot/dts/nvidia/tegra234.dtsi index 8fe8eda7654d..54790c6b6a2c 100644 --- a/arch/arm64/boot/dts/nvidia/tegra234.dtsi +++ b/arch/arm64/boot/dts/nvidia/tegra234.dtsi @@ -1156,6 +1156,14 @@ clock-names = "fuse"; }; + hte_lic: hardware-timestamp@3aa0000 { + compatible = "nvidia,tegra234-gte-lic"; + reg = <0x0 0x3aa0000 0x0 0x10000>; + interrupts = ; + nvidia,int-threshold = <1>; + #timestamp-cells = <1>; + }; + hsp_top0: hsp@3c00000 { compatible = "nvidia,tegra234-hsp", "nvidia,tegra194-hsp"; reg = <0x0 0x03c00000 0x0 0xa0000>; @@ -1673,6 +1681,15 @@ #mbox-cells = <2>; }; + hte_aon: hardware-timestamp@c1e0000 { + compatible = "nvidia,tegra234-gte-aon"; + reg = <0x0 0xc1e0000 0x0 0x10000>; + interrupts = ; + nvidia,int-threshold = <1>; + nvidia,gpio-controller = <&gpio_aon>; + #timestamp-cells = <1>; + }; + gen2_i2c: i2c@c240000 { compatible = "nvidia,tegra194-i2c"; reg = <0x0 0xc240000 0x0 0x100>;