From patchwork Fri Jan 6 15:28:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jon Hunter X-Patchwork-Id: 640024 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 C43A3C54EF1 for ; Fri, 6 Jan 2023 15:30:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235461AbjAFPaQ (ORCPT ); Fri, 6 Jan 2023 10:30:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235609AbjAFP31 (ORCPT ); Fri, 6 Jan 2023 10:29:27 -0500 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2058.outbound.protection.outlook.com [40.107.92.58]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 670B68CD09; Fri, 6 Jan 2023 07:29:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AlqdoTr6MDA7lAxgVwIB8QQeKiGfqD/WKvvdMGzFthrcsOBSHvGMXGXOi5LUj/BTo2f/CLdjspftBnA6KUPsdBkH+16IpICMzKkWQc10NLFU/3/GiLEUcX327XKn4oAE/+COCMAqVySKC/7RhhvJd7Iqgf2UhVOB7FuNpUGfyhdJmYZq6hdUuJapMGub545bs5RGslhL4ACp6FGitoYEr/Z7fjn3CqqmEH5+pUA46CoP/mpwUAMJtsNU5M3Z37pex9djb/TCYhnCKO6MWCPmtAGWBcDBJ2uzi5SQgaYVyBbGHwSkt7lym1Qhp44IphNcEoFNNuiB/7/PmQf5DPrjCQ== 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=8NPbsWLYuMoQBsLBf+pFVZ1787MbHXGSVh5pm8bkBLI=; b=loRIFWAzqJaLKGqYLeabcwxDI4StaTtVuBvYLODx5HqrQdf8wrwXC1gaHFzibRXeS9CIyR/UBSUAElknNZqBmfHjJx+fmP6Fa9EUp2aSn3P6mBjn0c/s/Gcvjw1l7lMm3EtiRKyggXySIoDkhde3VaxnP8aDEIkxwufGlhivFPmB/+PQA7VbVATCpTbnZsrMZPZu3BYVVEhodJb0Mn7PqjxcHV67z0cNjERF6narRFk1FC3diwBwxancD2Jv+IUutEKNBFMac7+zuzAnBnVcWIm0lXkysbMjcA2r9WuS4/7oThwWqmTcEb3UMiWwgiu0nJJn0jry5DnJ4LKyykWm/A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=linuxfoundation.org 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=8NPbsWLYuMoQBsLBf+pFVZ1787MbHXGSVh5pm8bkBLI=; b=QCfqQ2y4DgAqIbzVeqzrnuFbrqnDXbxJUPNUnJ3FX8G9RwtLkiWok+0Ufngy3uAm8UKBZRZMcUCRI7DmArYDoGFo6LC3pq9IAAopdxdPU8S8E+EMORWLOraMana/J/JDXlAkrw1uj0EZ4Y/SdQL/r6e392CZzSmp/8mwPWR9SazfIwngkbEvM3xOcxVpoAZ9j6kc4FC4oaPpHCgQr/LqlA4DRj5M/t+drSoNV19G9WcyRgq0FnlmT4fHHmnR3Yg86GPPDoWL32Cs8GgU3yfQjZWlkFCTpzIXJYXJQy2Gwfb8wtjP+9Nhb11ho3K6cE5do/qqqSoSU1A/6rNPGBog+w== Received: from MW4PR04CA0300.namprd04.prod.outlook.com (2603:10b6:303:89::35) by DS0PR12MB7606.namprd12.prod.outlook.com (2603:10b6:8:13c::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.19; Fri, 6 Jan 2023 15:29:23 +0000 Received: from CO1NAM11FT107.eop-nam11.prod.protection.outlook.com (2603:10b6:303:89:cafe::36) by MW4PR04CA0300.outlook.office365.com (2603:10b6:303:89::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.15 via Frontend Transport; Fri, 6 Jan 2023 15:29:23 +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 CO1NAM11FT107.mail.protection.outlook.com (10.13.175.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5966.18 via Frontend Transport; Fri, 6 Jan 2023 15:29:23 +0000 Received: from rnnvmail202.nvidia.com (10.129.68.7) 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.36; Fri, 6 Jan 2023 07:29:14 -0800 Received: from rnnvmail203.nvidia.com (10.129.68.9) by rnnvmail202.nvidia.com (10.129.68.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Fri, 6 Jan 2023 07:29:14 -0800 Received: from moonraker.nvidia.com (10.127.8.13) by mail.nvidia.com (10.129.68.9) with Microsoft SMTP Server id 15.2.986.36 via Frontend Transport; Fri, 6 Jan 2023 07:29:11 -0800 From: Jon Hunter To: Greg Kroah-Hartman , Rob Herring , Krzysztof Kozlowski , Thierry Reding , Vinod Koul CC: , , , , , Thierry Reding , Jon Hunter Subject: [PATCH V5 1/6] dt-bindings: usb: Add NVIDIA Tegra234 XUSB host controller binding Date: Fri, 6 Jan 2023 15:28:53 +0000 Message-ID: <20230106152858.49574-2-jonathanh@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230106152858.49574-1-jonathanh@nvidia.com> References: <20230106152858.49574-1-jonathanh@nvidia.com> MIME-Version: 1.0 X-NVConfidentiality: public X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT107:EE_|DS0PR12MB7606:EE_ X-MS-Office365-Filtering-Correlation-Id: aa2522e0-be97-459e-477e-08daeffac9b0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: R/KHQ+8xp5vn+33qk7+FrkcPH1+jMjQZzL9x/yyf0N9IAaqYsEStRSn/Ygqg+bS16XK2W/BhfjXZFMvsU9Q3khnKdTEjr/MIkPlKZwu5PYPoX4IWv09Ru1PkTLvKCL+uOnUOUC16BqRuoNsEEVadvX6/hE5ZD+hqJvVfcKd5uPveIJwaG9B0Td8rHfedor4hNrOPRQAVkJnY+JDdRKRhT0vqAxoLkCRqMgnjIOl6N/mZ/g9n4w+mR8H+/O9xP9zWQi+xkOOsGsssnqvYoD1QtRG4P61fg0XkgPnsBwnexUyPHwRz9idHKtfCnmMxjI1x+p6xH7jnSi6j4vXS/Nq9TygcBpDCo84KXM2mE1KaITnIRP6fmqtgtc14ZG3h1SLaXKQrW0YI2KvGkTv//9A6eABCWj8Y9cSamVSu9/Ix8reptTPJHV0bU8tRyR8NZ7sD6snQK8XYrndVoid/NGfFE+JTjTX46a4jO/nnwFaNHdMDpWQn1xCVvpt2pHV8x7CAPicbwNv6LytaOsQn21+sUtF0I+zgdHXbJ5doCJP1fWx1Gkwwg8q9hQVIZ6x0bThqTBThWe+PoJ73D2M7VyIW2Z7C8DXft49vWYBxZzLQo8fCx+TptxNWq+QzY2DCKTH7AhpjF1153Gh6GrA8BWLGp4naFC+8veAEQFx9m9p0bc4PbkbJRx6z2HTa3W70fOuG5aMByQrdYVrwg7YKTSZj8LeERxDr5upjdlr7be8GbVj+OO1/hkoweLQm/5sJUm4pkPPfnBI39ww7G6/gAPheUcQR8hL55C1bVCNMb0F0OelClI8EzN3U7mghdQXr77Ll 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:(13230022)(4636009)(39860400002)(396003)(136003)(346002)(376002)(451199015)(40470700004)(46966006)(36840700001)(2906002)(5660300002)(8936002)(8676002)(4326008)(41300700001)(70586007)(54906003)(70206006)(110136005)(316002)(966005)(478600001)(40480700001)(186003)(26005)(2616005)(82310400005)(7696005)(1076003)(107886003)(6666004)(336012)(426003)(47076005)(83380400001)(7636003)(356005)(82740400003)(40460700003)(86362001)(36860700001)(36756003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jan 2023 15:29:23.0044 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: aa2522e0-be97-459e-477e-08daeffac9b0 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: CO1NAM11FT107.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB7606 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org From: Wayne Chang Add device-tree binding documentation for the XUSB host controller present on Tegra234 SoC. This controller supports the USB 3.1 specification. Signed-off-by: Wayne Chang Signed-off-by: Thierry Reding Signed-off-by: Jon Hunter --- V4 -> V5: No changes V3 -> V4: minor update to the power-domain description V2 -> V3: nothing has changed V1 -> V2: address the issue on phy-names property .../bindings/usb/nvidia,tegra234-xusb.yaml | 158 ++++++++++++++++++ 1 file changed, 158 insertions(+) create mode 100644 Documentation/devicetree/bindings/usb/nvidia,tegra234-xusb.yaml diff --git a/Documentation/devicetree/bindings/usb/nvidia,tegra234-xusb.yaml b/Documentation/devicetree/bindings/usb/nvidia,tegra234-xusb.yaml new file mode 100644 index 000000000000..190a23c72963 --- /dev/null +++ b/Documentation/devicetree/bindings/usb/nvidia,tegra234-xusb.yaml @@ -0,0 +1,158 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/usb/nvidia,tegra234-xusb.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: NVIDIA Tegra234 xHCI controller + +maintainers: + - Thierry Reding + - Jon Hunter + +description: The Tegra xHCI controller supports both USB2 and USB3 interfaces + exposed by the Tegra XUSB pad controller. + +properties: + compatible: + const: nvidia,tegra234-xusb + + reg: + items: + - description: base and length of the xHCI host registers + - description: base and length of the XUSB FPCI registers + - description: base and length of the XUSB bar2 registers + + reg-names: + items: + - const: hcd + - const: fpci + - const: bar2 + + interrupts: + items: + - description: xHCI host interrupt + - description: mailbox interrupt + + clocks: + items: + - description: XUSB host clock + - description: XUSB Falcon source clock + - description: XUSB SuperSpeed clock + - description: XUSB SuperSpeed source clock + - description: XUSB HighSpeed clock source + - description: XUSB FullSpeed clock source + - description: USB PLL + - description: reference clock + - description: I/O PLL + + clock-names: + items: + - const: xusb_host + - const: xusb_falcon_src + - const: xusb_ss + - const: xusb_ss_src + - const: xusb_hs_src + - const: xusb_fs_src + - const: pll_u_480m + - const: clk_m + - const: pll_e + + interconnects: + items: + - description: read client + - description: write client + + interconnect-names: + items: + - const: dma-mem # read + - const: write + + iommus: + maxItems: 1 + + nvidia,xusb-padctl: + $ref: /schemas/types.yaml#/definitions/phandle + description: phandle to the XUSB pad controller that is used to configure + the USB pads used by the XHCI controller + + phys: + minItems: 1 + maxItems: 8 + + phy-names: + minItems: 1 + maxItems: 8 + items: + enum: + - usb2-0 + - usb2-1 + - usb2-2 + - usb2-3 + - usb3-0 + - usb3-1 + - usb3-2 + - usb3-3 + + power-domains: + items: + - description: XUSBC power domain (for Host and USB 2.0) + - description: XUSBA power domain (for SuperSpeed) + + power-domain-names: + items: + - const: xusb_host + - const: xusb_ss + + dma-coherent: + type: boolean + +allOf: + - $ref: usb-xhci.yaml + +unevaluatedProperties: false + +examples: + - | + #include + #include + #include + #include + + usb@3610000 { + compatible = "nvidia,tegra234-xusb"; + reg = <0x03610000 0x40000>, + <0x03600000 0x10000>, + <0x03650000 0x10000>; + reg-names = "hcd", "fpci", "bar2"; + + interrupts = , + ; + + clocks = <&bpmp TEGRA234_CLK_XUSB_CORE_HOST>, + <&bpmp TEGRA234_CLK_XUSB_FALCON>, + <&bpmp TEGRA234_CLK_XUSB_CORE_SS>, + <&bpmp TEGRA234_CLK_XUSB_SS>, + <&bpmp TEGRA234_CLK_CLK_M>, + <&bpmp TEGRA234_CLK_XUSB_FS>, + <&bpmp TEGRA234_CLK_UTMIP_PLL>, + <&bpmp TEGRA234_CLK_CLK_M>, + <&bpmp TEGRA234_CLK_PLLE>; + clock-names = "xusb_host", "xusb_falcon_src", + "xusb_ss", "xusb_ss_src", "xusb_hs_src", + "xusb_fs_src", "pll_u_480m", "clk_m", + "pll_e"; + interconnects = <&mc TEGRA234_MEMORY_CLIENT_XUSB_HOSTR &emc>, + <&mc TEGRA234_MEMORY_CLIENT_XUSB_HOSTW &emc>; + interconnect-names = "dma-mem", "write"; + iommus = <&smmu_niso1 TEGRA234_SID_XUSB_HOST>; + + power-domains = <&bpmp TEGRA234_POWER_DOMAIN_XUSBC>, + <&bpmp TEGRA234_POWER_DOMAIN_XUSBA>; + power-domain-names = "xusb_host", "xusb_ss"; + + nvidia,xusb-padctl = <&xusb_padctl>; + + phys = <&pad_lanes_usb2_0>; + phy-names = "usb2-0"; + }; From patchwork Fri Jan 6 15:28:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jon Hunter X-Patchwork-Id: 640022 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 0E71AC54EF1 for ; Fri, 6 Jan 2023 15:30:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235548AbjAFPaY (ORCPT ); Fri, 6 Jan 2023 10:30:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235486AbjAFP3j (ORCPT ); Fri, 6 Jan 2023 10:29:39 -0500 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2081.outbound.protection.outlook.com [40.107.237.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B15B98CD10; Fri, 6 Jan 2023 07:29:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VzlNRBz6nQ9UDGDsJbAeAUj1BtXKyC077cv5ZIpanThL2AZ3wT5f0XC/sKL8Mgl9NAUo0S9fEvGXL4DrJxwJSwmViFwvbRKAx1iM7AK8tLGS5nLzStMiAY9hj9MN3QkVXSmchlTswuN/IQ/QpSZqIinWqvIeymw6z0LTkmYNZsGR59XuL1aSe1wIRHsayo6dKOui97UjEoooC0Uo1rULMCdpmX4Gf+bKYiN3I3QalvJ4klaL1BzNZIy3Sp0h1GBHtu7rMAKa7tLNrkxoQBZ5Q0/7404ecjCVd3UywGHsexUC9wd+YFvxWvB2tJI9x45i9Gu4oLPP+adw+sCMQWodjA== 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=eM6KUc/IqbulPoLcB75niZTNeCw5/ogKpuZKNi+N4kI=; b=FxOgORJo9KHi26aytRbu5jDZZLr5vHaUc4TZbuBETw4aZZIeR3lF/Mu4rmTDaIfy402Lh598X1itbIEjIUcxZB0mCAbgizIODpa9MHamr4cUdHm0s3r8sRSJ8CgGUY/GmJpkmui1bHV+5eNYDINHJMK3P9z74PsAAgunxjpslt+oFdQW+3N5TY9jvYfopqNFOArSXrwTUlVgsWFcz8FjjEwY/8/p3xkxrIh6G2tSzXtvsJLv8LwQsRu/dKvsjfcPWDcI8bgrVjeUGV9oSe8XlK0CZSPV/zZXjJubE5/8Rn1bcwuvwvdadUr6X1AMUW10KmBzDF5AWzni+SDjSLj4mQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=linuxfoundation.org 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=eM6KUc/IqbulPoLcB75niZTNeCw5/ogKpuZKNi+N4kI=; b=RJirIii77vUd4hmpLAEM7/TP+5Cz9/QzI1CQo1eHeprRbLzNUA4F1bc2xu6+KL9h/h0B3pKSc2QosDSgZ+INJjxyqxUaXF0tKDPueI2FHEaXqwPBCPUPA8ZsduTU1qXh2W7qMQU4wrg+dR83Mg3KoYfDUddoAiVgb60Px8pacB/QagJIcwj8zlZeghHgijAvOnSLEG2cgQ0UFF1sNf/KUKGPZb1/+iJP6metFLGnmeyE13vBEW4/A/pJN75m+NZfk0RrKJmTkYs6VmEr8pseTsX8W9DzOIPvy+4RZ8r+QKb0rG9Z/VFJxk1kWs4HYM7LZvof+anmiUMq62bxGSuu2Q== Received: from BN9P220CA0014.NAMP220.PROD.OUTLOOK.COM (2603:10b6:408:13e::19) by DS7PR12MB5792.namprd12.prod.outlook.com (2603:10b6:8:77::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.19; Fri, 6 Jan 2023 15:29:34 +0000 Received: from BN8NAM11FT081.eop-nam11.prod.protection.outlook.com (2603:10b6:408:13e:cafe::89) by BN9P220CA0014.outlook.office365.com (2603:10b6:408:13e::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.15 via Frontend Transport; Fri, 6 Jan 2023 15:29:33 +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 BN8NAM11FT081.mail.protection.outlook.com (10.13.177.233) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.17 via Frontend Transport; Fri, 6 Jan 2023 15:29:33 +0000 Received: from rnnvmail202.nvidia.com (10.129.68.7) 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.36; Fri, 6 Jan 2023 07:29:20 -0800 Received: from rnnvmail203.nvidia.com (10.129.68.9) by rnnvmail202.nvidia.com (10.129.68.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Fri, 6 Jan 2023 07:29:19 -0800 Received: from moonraker.nvidia.com (10.127.8.13) by mail.nvidia.com (10.129.68.9) with Microsoft SMTP Server id 15.2.986.36 via Frontend Transport; Fri, 6 Jan 2023 07:29:17 -0800 From: Jon Hunter To: Greg Kroah-Hartman , Rob Herring , Krzysztof Kozlowski , Thierry Reding , Vinod Koul CC: , , , , , Thierry Reding , Jon Hunter Subject: [PATCH V5 3/6] arm64: tegra: Enable XUSB host function on Jetson AGX Orin Date: Fri, 6 Jan 2023 15:28:55 +0000 Message-ID: <20230106152858.49574-4-jonathanh@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230106152858.49574-1-jonathanh@nvidia.com> References: <20230106152858.49574-1-jonathanh@nvidia.com> MIME-Version: 1.0 X-NVConfidentiality: public X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT081:EE_|DS7PR12MB5792:EE_ X-MS-Office365-Filtering-Correlation-Id: fcb10b6f-bc85-4527-e714-08daeffad01a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1zjI1se6pcjrgaJSztQX9bHFrO/AsRZwAYacs8kVmLBXgWXO53TkaM4Iv3YEOcfLv8zRQLfDE3r5pyerzNag8b7VkBqZ19Lserhu7viktBrAIj6L4St9rjaK6fXfUhJcyinyVWmDd90k4+7WgnlCijgekEpsR4S3sOdgdbwOmvXQW9KfnG2nliO6TFr2SERVxdobhGFWOWlWH+xB4fotu13wyeunouptNJxASlKMsBoHUh7PEwgpNr9xxhlONFXtu7lt1H14IHYpOqTHyx6ypkgS+bIcrprhKVi0g7nrH0+dmnejWJ2gYPOTdNkHLL91lqUt7pPjoNf97uxeq3ya4q+/ExsM3HfZ+ZXzDpz51/V1PyCc9QnqQy/Mk7fswxe7nHyVyv168a1vd/EVc8QK5MmoUhuvKbkT6hu1cB9Izxhh/9j5YdUspfK4L7V8bTy3FjTemhUu+dx0zfwmfn7rN/gDEB5IyvuANdT/qTGmGQeyZP22E4gur32Q07BvQpE7h8UaNqvHp5TzrYA/B8CuzZgqjq9cgj+hbWd3rylnkIT2pHY7ZuDI7aVbLEnYBaP666sG3P+I8U158LMGMQ1WJvBtt5wf8QJ0WnTIScSgPde0HZUEkSsPKA7eexLZbhAi3V4K8n5eI40lLRjuSNmDA4xUfXZ+eABtki3dNDw8c1Q5M+BSpnAtk7s+UX2Lgf+p2EShiP8+IokfQkPBEw88Ew== 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:(13230022)(4636009)(136003)(396003)(376002)(346002)(39860400002)(451199015)(40470700004)(46966006)(36840700001)(82740400003)(7636003)(356005)(40480700001)(82310400005)(86362001)(316002)(40460700003)(54906003)(36756003)(1076003)(2616005)(7696005)(110136005)(478600001)(107886003)(6666004)(26005)(186003)(5660300002)(2906002)(83380400001)(36860700001)(70586007)(8676002)(70206006)(4326008)(41300700001)(336012)(8936002)(47076005)(426003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jan 2023 15:29:33.6601 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fcb10b6f-bc85-4527-e714-08daeffad01a 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: BN8NAM11FT081.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB5792 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org From: Wayne Chang This commit enables XUSB host and pad controller on Jetson AGX Orin. Signed-off-by: Wayne Chang Signed-off-by: Thierry Reding Signed-off-by: Jon Hunter --- V4 -> V5: No changes V3 -> V4: dropped support for the USB device and type-c connector V2 -> V3: nothing has changed but added the dependency here V1 -> V2: removed the redundant cells and status in ucsi-cc .../boot/dts/nvidia/tegra234-p3701-0000.dtsi | 48 ++++++ .../nvidia/tegra234-p3737-0000+p3701-0000.dts | 93 +++++++++++ arch/arm64/boot/dts/nvidia/tegra234.dtsi | 145 ++++++++++++++++++ 3 files changed, 286 insertions(+) diff --git a/arch/arm64/boot/dts/nvidia/tegra234-p3701-0000.dtsi b/arch/arm64/boot/dts/nvidia/tegra234-p3701-0000.dtsi index 8b86ea9cb50c..4fae2547e90e 100644 --- a/arch/arm64/boot/dts/nvidia/tegra234-p3701-0000.dtsi +++ b/arch/arm64/boot/dts/nvidia/tegra234-p3701-0000.dtsi @@ -67,6 +67,29 @@ mmc@3460000 { non-removable; }; + padctl@3520000 { + vclamp-usb-supply = <&vdd_ao_1v8>; + avdd-usb-supply = <&vdd_ao_3v3>; + + ports { + usb2-0 { + vbus-supply = <&vdd_5v0_sys>; + }; + + usb2-1 { + vbus-supply = <&vdd_5v0_sys>; + }; + + usb2-2 { + vbus-supply = <&vdd_5v0_sys>; + }; + + usb2-3 { + vbus-supply = <&vdd_5v0_sys>; + }; + }; + }; + rtc@c2a0000 { status = "okay"; }; @@ -75,4 +98,29 @@ pmc@c360000 { nvidia,invert-interrupt; }; }; + + vdd_5v0_sys: regulator-vdd-5v0-sys { + compatible = "regulator-fixed"; + regulator-name = "VIN_SYS_5V0"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + regulator-always-on; + regulator-boot-on; + }; + + vdd_ao_1v8: regulator-vdd-1v8-ao { + compatible = "regulator-fixed"; + regulator-name = "vdd-AO-1v8"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-always-on; + }; + + vdd_ao_3v3: regulator-vdd-3v3-ao { + compatible = "regulator-fixed"; + regulator-name = "vdd-AO-3v3"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + }; }; diff --git a/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts b/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts index 96aa2267b06d..32c58aa00035 100644 --- a/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts +++ b/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts @@ -2022,6 +2022,99 @@ hda@3510000 { nvidia,model = "NVIDIA Jetson AGX Orin HDA"; status = "okay"; }; + + padctl@3520000 { + status = "okay"; + + pads { + usb2 { + lanes { + usb2-0 { + status = "okay"; + }; + + usb2-1 { + status = "okay"; + }; + + usb2-2 { + status = "okay"; + }; + + usb2-3 { + status = "okay"; + }; + }; + }; + + usb3 { + lanes { + usb3-0 { + status = "okay"; + }; + + usb3-1 { + status = "okay"; + }; + + usb3-2 { + status = "okay"; + }; + }; + }; + }; + + ports { + usb2-0 { + mode = "host"; + status = "okay"; + }; + + usb2-1 { + mode = "host"; + status = "okay"; + }; + + usb2-2 { + mode = "host"; + status = "okay"; + }; + + usb2-3 { + mode = "host"; + status = "okay"; + }; + + usb3-0 { + nvidia,usb2-companion = <1>; + status = "okay"; + }; + + usb3-1 { + nvidia,usb2-companion = <0>; + status = "okay"; + }; + + usb3-2 { + nvidia,usb2-companion = <3>; + status = "okay"; + }; + }; + }; + + usb@3610000 { + status = "okay"; + + phys = <&{/bus@0/padctl@3520000/pads/usb2/lanes/usb2-0}>, + <&{/bus@0/padctl@3520000/pads/usb2/lanes/usb2-1}>, + <&{/bus@0/padctl@3520000/pads/usb2/lanes/usb2-2}>, + <&{/bus@0/padctl@3520000/pads/usb2/lanes/usb2-3}>, + <&{/bus@0/padctl@3520000/pads/usb3/lanes/usb3-0}>, + <&{/bus@0/padctl@3520000/pads/usb3/lanes/usb3-1}>, + <&{/bus@0/padctl@3520000/pads/usb3/lanes/usb3-2}>; + phy-names = "usb2-0", "usb2-1", "usb2-2", "usb2-3", + "usb3-0", "usb3-1", "usb3-2"; + }; }; chosen { diff --git a/arch/arm64/boot/dts/nvidia/tegra234.dtsi b/arch/arm64/boot/dts/nvidia/tegra234.dtsi index ec8a28a9d380..d71b0b5b931c 100644 --- a/arch/arm64/boot/dts/nvidia/tegra234.dtsi +++ b/arch/arm64/boot/dts/nvidia/tegra234.dtsi @@ -1079,6 +1079,151 @@ hda@3510000 { status = "disabled"; }; + xusb_padctl: padctl@3520000 { + compatible = "nvidia,tegra234-xusb-padctl"; + reg = <0x03520000 0x20000>, + <0x03540000 0x10000>; + reg-names = "padctl", "ao"; + interrupts = ; + + resets = <&bpmp TEGRA234_RESET_XUSB_PADCTL>; + reset-names = "padctl"; + + status = "disabled"; + + pads { + usb2 { + clocks = <&bpmp TEGRA234_CLK_USB2_TRK>; + clock-names = "trk"; + + lanes { + usb2-0 { + nvidia,function = "xusb"; + status = "disabled"; + #phy-cells = <0>; + }; + + usb2-1 { + nvidia,function = "xusb"; + status = "disabled"; + #phy-cells = <0>; + }; + + usb2-2 { + nvidia,function = "xusb"; + status = "disabled"; + #phy-cells = <0>; + }; + + usb2-3 { + nvidia,function = "xusb"; + status = "disabled"; + #phy-cells = <0>; + }; + }; + }; + + usb3 { + lanes { + usb3-0 { + nvidia,function = "xusb"; + status = "disabled"; + #phy-cells = <0>; + }; + + usb3-1 { + nvidia,function = "xusb"; + status = "disabled"; + #phy-cells = <0>; + }; + + usb3-2 { + nvidia,function = "xusb"; + status = "disabled"; + #phy-cells = <0>; + }; + + usb3-3 { + nvidia,function = "xusb"; + status = "disabled"; + #phy-cells = <0>; + }; + }; + }; + }; + + ports { + usb2-0 { + status = "disabled"; + }; + + usb2-1 { + status = "disabled"; + }; + + usb2-2 { + status = "disabled"; + }; + + usb2-3 { + status = "disabled"; + }; + + usb3-0 { + status = "disabled"; + }; + + usb3-1 { + status = "disabled"; + }; + + usb3-2 { + status = "disabled"; + }; + + usb3-3 { + status = "disabled"; + }; + }; + }; + + usb@3610000 { + compatible = "nvidia,tegra234-xusb"; + reg = <0x03610000 0x40000>, + <0x03600000 0x10000>, + <0x03650000 0x10000>; + reg-names = "hcd", "fpci", "bar2"; + + interrupts = , + ; + + clocks = <&bpmp TEGRA234_CLK_XUSB_CORE_HOST>, + <&bpmp TEGRA234_CLK_XUSB_FALCON>, + <&bpmp TEGRA234_CLK_XUSB_CORE_SS>, + <&bpmp TEGRA234_CLK_XUSB_SS>, + <&bpmp TEGRA234_CLK_CLK_M>, + <&bpmp TEGRA234_CLK_XUSB_FS>, + <&bpmp TEGRA234_CLK_UTMIP_PLL>, + <&bpmp TEGRA234_CLK_CLK_M>, + <&bpmp TEGRA234_CLK_PLLE>; + clock-names = "xusb_host", "xusb_falcon_src", + "xusb_ss", "xusb_ss_src", "xusb_hs_src", + "xusb_fs_src", "pll_u_480m", "clk_m", + "pll_e"; + interconnects = <&mc TEGRA234_MEMORY_CLIENT_XUSB_HOSTR &emc>, + <&mc TEGRA234_MEMORY_CLIENT_XUSB_HOSTW &emc>; + interconnect-names = "dma-mem", "write"; + iommus = <&smmu_niso1 TEGRA234_SID_XUSB_HOST>; + + power-domains = <&bpmp TEGRA234_POWER_DOMAIN_XUSBC>, + <&bpmp TEGRA234_POWER_DOMAIN_XUSBA>; + power-domain-names = "xusb_host", "xusb_ss"; + + nvidia,xusb-padctl = <&xusb_padctl>; + dma-coherent; + status = "disabled"; + }; + fuse@3810000 { compatible = "nvidia,tegra234-efuse"; reg = <0x03810000 0x10000>; From patchwork Fri Jan 6 15:28:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jon Hunter X-Patchwork-Id: 640023 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 3E8A2C54EF0 for ; Fri, 6 Jan 2023 15:30:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235512AbjAFPaU (ORCPT ); Fri, 6 Jan 2023 10:30:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235265AbjAFP3h (ORCPT ); Fri, 6 Jan 2023 10:29:37 -0500 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2071.outbound.protection.outlook.com [40.107.237.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1CB27831BC; Fri, 6 Jan 2023 07:29:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FEHuvb0mHxRTOc82sVmRQd8UhmadGKurw8eq7yfvqoSTpLlFaVaAYRB/pwUsk6//hwE9Ihpdtx/y5tuIQ5mPeuPwu0DKmvavJFIwqQEud/0PD6oNBkVTlPuu6iwTs2FTksHlGW2GBh/C80xDNyNFVvUYoq20Uh5jMbtxfSVVQJQFL+kjrxVnP8fvpL1mUEttO16IX5cKE1gcV1Laq0srizo9UBPqAZeauRo8udW8KYDjGWTL5LwUAuFGKtugq4eqnLx7EkK3b4cFA8a7b8Jy78gGTuh97hRRV8zlf5QeoFzVf0/UG7o2jueGIt8Mf6hgMRBXrQHJoZFfV6pAp3lerQ== 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=YE0fXBMFd+7kCX5TOCR6h9f2BUWB5Ppry3tMQJVUJyo=; b=BCj5SOAm8MEr8AISjXTAhCBzfLIk3bbitp9+rengGoWY2Zc5hpozoCpeT/vHpK1MBhruTJ3826NegfDMnO4h3S3H5LsY4TZql8jNVmmdFA4Y6ZbugVeiJJiZbzDQS/ScCmj9mBlqFhToZzIg7h1r5n/t/irBVVe8jOHU19arRNd1HC/Pe9brMoiWY75rH4KLF5moiBj7uuCeqxMjcPXBZWXDdB19NjewzjgoJyyFm3IG6Tsh/rPebBXKX+Z7nAhQ2jlmT19pTZz3Tul7KqE8XLGPpJG6/39ijfRr3ViuzjewPUEMVDmyKi7zZBYbudVTROIq2VXRfHj0uA68o/fF0g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=linuxfoundation.org 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=YE0fXBMFd+7kCX5TOCR6h9f2BUWB5Ppry3tMQJVUJyo=; b=HiWyMXZUukQRHyKrja24TTBhGMWL21hjAtHkaZIgpFGLCoVEHpnBlTEgSU0HCMgkRY5Z8L3Cy0C6SkToDq6NqLYd/7Ga5G7zZw0cZnXt2wKW6QeHYoOG6ivDCc7w0Qcxvr3c3/LPAN2c/k6WFEB3FzbutGkq/xLzJJHbydIk2ZzQJYtoFvwWphe+Bd2TXvELzflFCfhu7OfTDnxgpgV5RNAhpgt8ebobCgUehN2PDAZ3lD6R46OsrLINXcxYS/eEqaoavaEIadK86qFhwlzijBJogFgLcvDXpXgBqzzRUcKcFuUe+tj09scM3bXZEdnPZmeFVznNonaK992sBN3zhQ== Received: from MW2PR16CA0035.namprd16.prod.outlook.com (2603:10b6:907::48) by DM6PR12MB4171.namprd12.prod.outlook.com (2603:10b6:5:21f::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.19; Fri, 6 Jan 2023 15:29:34 +0000 Received: from CO1NAM11FT036.eop-nam11.prod.protection.outlook.com (2603:10b6:907:0:cafe::d0) by MW2PR16CA0035.outlook.office365.com (2603:10b6:907::48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.15 via Frontend Transport; Fri, 6 Jan 2023 15:29:33 +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 CO1NAM11FT036.mail.protection.outlook.com (10.13.174.124) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5966.17 via Frontend Transport; Fri, 6 Jan 2023 15:29:33 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) 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.36; Fri, 6 Jan 2023 07:29:26 -0800 Received: from rnnvmail203.nvidia.com (10.129.68.9) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Fri, 6 Jan 2023 07:29:25 -0800 Received: from moonraker.nvidia.com (10.127.8.13) by mail.nvidia.com (10.129.68.9) with Microsoft SMTP Server id 15.2.986.36 via Frontend Transport; Fri, 6 Jan 2023 07:29:23 -0800 From: Jon Hunter To: Greg Kroah-Hartman , Rob Herring , Krzysztof Kozlowski , Thierry Reding , Vinod Koul CC: , , , , , Sing-Han Chen , Jon Hunter Subject: [PATCH V5 5/6] phy: tegra: xusb: Add Tegra234 support Date: Fri, 6 Jan 2023 15:28:57 +0000 Message-ID: <20230106152858.49574-6-jonathanh@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230106152858.49574-1-jonathanh@nvidia.com> References: <20230106152858.49574-1-jonathanh@nvidia.com> MIME-Version: 1.0 X-NVConfidentiality: public X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT036:EE_|DM6PR12MB4171:EE_ X-MS-Office365-Filtering-Correlation-Id: 89a4516a-0baf-483c-1879-08daeffad000 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5mEaR2MjkD3zMnA7IWsOUcbi80j+Q9ojq7X7t0mMP9VXFK2bIEi45+lNVYtDUwSq3Wy22/Txy4Qr+JfCee6T2VkzunX87ghDRDoiUV3lSzY8hB0vcqNtnH9xUkRPYJPJg7Xumu8yuDG+ofR3+E0iEfELh5XrpYdDUawFLuV0tS0poi7pi4y07Ml73IQfwlZVQHs2gUzajtVctnuDNEsy5wujgbFzDtBeCP0QdVFwxbau+8W/zkukovTmDQyeDunfTb6mKDbnVKqiEWeJ/asMa3fGCCpIlqjhyQ0X8FAWbnE3mK2PzLWsUy1XrvGS32moroO28eQGi+VE6mjhau84IvOQhYgLac/RX1PKuVEAH7hRcVkFY3SXkQbgieabdmeWzGpv99yo2KwU3FKJ7zM/cAGfxy/jxdlc+5b8N4X52yWGmuYmC8V+4PL30T/J8WwoN6pfHD5o861XUiWG5/6X5RgBlbEiwomiLp5QHvDAW5NmCvp3ZQVSFYI6UoywrK0KbAjKKjoLHeeyzEn4vCiHcXfeDW0Vk6QHrn9q1+mFAREQbwttmW2dX+8OPePxULDXSljudFFicCAUMexw3fRN+0+JrjkrBXF7OOFbeQQbgOhy/rY/mpHnMUuF/jMQMrwC8GfeuWQ+Bdd4lVqJQkbv7H+/3BAK5Z/8UNL6R4mZ7Wx4qc4AyKPIMpKiTXQ9NTUH7Y+/B/zDs6GElQvniDLXuQ== 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:(13230022)(4636009)(346002)(376002)(136003)(39860400002)(396003)(451199015)(46966006)(40470700004)(36840700001)(7696005)(26005)(186003)(54906003)(316002)(7636003)(478600001)(110136005)(70206006)(8676002)(107886003)(4326008)(336012)(6666004)(2616005)(1076003)(70586007)(8936002)(47076005)(426003)(5660300002)(2906002)(83380400001)(41300700001)(356005)(36756003)(40460700003)(82740400003)(36860700001)(86362001)(82310400005)(40480700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jan 2023 15:29:33.5938 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 89a4516a-0baf-483c-1879-08daeffad000 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: CO1NAM11FT036.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4171 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org From: Sing-Han Chen Add support for the XUSB pad controller found on Tegra234 SoCs. It is mostly similar to the same IP found on Tegra194, because most of the Tegra234 XUSB PADCTL registers definition and programming sequence are the same as Tegra194, Tegra234 XUSB PADCTL can share the same driver with Tegra186 and Tegra194 XUSB PADCTL. Introduce a new feature, USB2 HW tracking, for Tegra234. The feature is to enable HW periodical PAD tracking which measure and capture the electric parameters of USB2.0 PAD. Signed-off-by: Sing-Han Chen Co-developed-by: Wayne Chang Signed-off-by: Wayne Chang Signed-off-by: Jon Hunter --- V4 -> V5: no changes V3 -> V4: fixed checkpatch warnings V2 -> V3: nothing has changed V1 -> V2: remove atomic and the helper in padctl_readl_poll func. drivers/phy/tegra/Makefile | 1 + drivers/phy/tegra/xusb-tegra186.c | 64 +++++++++++++++++++++++++++++-- drivers/phy/tegra/xusb.c | 6 +++ drivers/phy/tegra/xusb.h | 23 +++++++++++ 4 files changed, 91 insertions(+), 3 deletions(-) diff --git a/drivers/phy/tegra/Makefile b/drivers/phy/tegra/Makefile index 89b84067cb4c..eeeea72de117 100644 --- a/drivers/phy/tegra/Makefile +++ b/drivers/phy/tegra/Makefile @@ -7,4 +7,5 @@ phy-tegra-xusb-$(CONFIG_ARCH_TEGRA_132_SOC) += xusb-tegra124.o phy-tegra-xusb-$(CONFIG_ARCH_TEGRA_210_SOC) += xusb-tegra210.o phy-tegra-xusb-$(CONFIG_ARCH_TEGRA_186_SOC) += xusb-tegra186.o phy-tegra-xusb-$(CONFIG_ARCH_TEGRA_194_SOC) += xusb-tegra186.o +phy-tegra-xusb-$(CONFIG_ARCH_TEGRA_234_SOC) += xusb-tegra186.o obj-$(CONFIG_PHY_TEGRA194_P2U) += phy-tegra194-p2u.o diff --git a/drivers/phy/tegra/xusb-tegra186.c b/drivers/phy/tegra/xusb-tegra186.c index c00d14f27ab4..1aae8535f452 100644 --- a/drivers/phy/tegra/xusb-tegra186.c +++ b/drivers/phy/tegra/xusb-tegra186.c @@ -89,6 +89,11 @@ #define USB2_TRK_START_TIMER(x) (((x) & 0x7f) << 12) #define USB2_TRK_DONE_RESET_TIMER(x) (((x) & 0x7f) << 19) #define USB2_PD_TRK BIT(26) +#define USB2_TRK_COMPLETED BIT(31) + +#define XUSB_PADCTL_USB2_BIAS_PAD_CTL2 0x28c +#define USB2_TRK_HW_MODE BIT(0) +#define CYA_TRK_CODE_UPDATE_ON_IDLE BIT(31) #define XUSB_PADCTL_HSIC_PADX_CTL0(x) (0x300 + (x) * 0x20) #define HSIC_PD_TX_DATA0 BIT(1) @@ -609,9 +614,31 @@ static void tegra186_utmi_bias_pad_power_on(struct tegra_xusb_padctl *padctl) value &= ~USB2_PD_TRK; padctl_writel(padctl, value, XUSB_PADCTL_USB2_BIAS_PAD_CTL1); - udelay(100); + if (padctl->soc->poll_trk_completed) { + err = padctl_readl_poll(padctl, XUSB_PADCTL_USB2_BIAS_PAD_CTL1, + USB2_TRK_COMPLETED, USB2_TRK_COMPLETED, 100); + if (err) { + /* The failure with polling on trk complete will not + * cause the failure of powering on the bias pad. + */ + dev_warn(dev, "failed to poll USB2 trk completed: %d\n", err); + } - clk_disable_unprepare(priv->usb2_trk_clk); + value = padctl_readl(padctl, XUSB_PADCTL_USB2_BIAS_PAD_CTL1); + value |= USB2_TRK_COMPLETED; + padctl_writel(padctl, value, XUSB_PADCTL_USB2_BIAS_PAD_CTL1); + } else { + udelay(100); + } + + if (padctl->soc->trk_hw_mode) { + value = padctl_readl(padctl, XUSB_PADCTL_USB2_BIAS_PAD_CTL2); + value |= USB2_TRK_HW_MODE; + value &= ~CYA_TRK_CODE_UPDATE_ON_IDLE; + padctl_writel(padctl, value, XUSB_PADCTL_USB2_BIAS_PAD_CTL2); + } else { + clk_disable_unprepare(priv->usb2_trk_clk); + } mutex_unlock(&padctl->lock); } @@ -637,6 +664,13 @@ static void tegra186_utmi_bias_pad_power_off(struct tegra_xusb_padctl *padctl) value |= USB2_PD_TRK; padctl_writel(padctl, value, XUSB_PADCTL_USB2_BIAS_PAD_CTL1); + if (padctl->soc->trk_hw_mode) { + value = padctl_readl(padctl, XUSB_PADCTL_USB2_BIAS_PAD_CTL2); + value &= ~USB2_TRK_HW_MODE; + padctl_writel(padctl, value, XUSB_PADCTL_USB2_BIAS_PAD_CTL2); + clk_disable_unprepare(priv->usb2_trk_clk); + } + mutex_unlock(&padctl->lock); } @@ -1559,7 +1593,8 @@ const struct tegra_xusb_padctl_soc tegra186_xusb_padctl_soc = { EXPORT_SYMBOL_GPL(tegra186_xusb_padctl_soc); #endif -#if IS_ENABLED(CONFIG_ARCH_TEGRA_194_SOC) +#if IS_ENABLED(CONFIG_ARCH_TEGRA_194_SOC) || \ + IS_ENABLED(CONFIG_ARCH_TEGRA_234_SOC) static const char * const tegra194_xusb_padctl_supply_names[] = { "avdd-usb", "vclamp-usb", @@ -1615,8 +1650,31 @@ const struct tegra_xusb_padctl_soc tegra194_xusb_padctl_soc = { .supply_names = tegra194_xusb_padctl_supply_names, .num_supplies = ARRAY_SIZE(tegra194_xusb_padctl_supply_names), .supports_gen2 = true, + .poll_trk_completed = true, }; EXPORT_SYMBOL_GPL(tegra194_xusb_padctl_soc); + +const struct tegra_xusb_padctl_soc tegra234_xusb_padctl_soc = { + .num_pads = ARRAY_SIZE(tegra194_pads), + .pads = tegra194_pads, + .ports = { + .usb2 = { + .ops = &tegra186_usb2_port_ops, + .count = 4, + }, + .usb3 = { + .ops = &tegra186_usb3_port_ops, + .count = 4, + }, + }, + .ops = &tegra186_xusb_padctl_ops, + .supply_names = tegra194_xusb_padctl_supply_names, + .num_supplies = ARRAY_SIZE(tegra194_xusb_padctl_supply_names), + .supports_gen2 = true, + .poll_trk_completed = true, + .trk_hw_mode = true, +}; +EXPORT_SYMBOL_GPL(tegra234_xusb_padctl_soc); #endif MODULE_AUTHOR("JC Kuo "); diff --git a/drivers/phy/tegra/xusb.c b/drivers/phy/tegra/xusb.c index ff4b930879f3..3707a0b5c1ae 100644 --- a/drivers/phy/tegra/xusb.c +++ b/drivers/phy/tegra/xusb.c @@ -71,6 +71,12 @@ static const struct of_device_id tegra_xusb_padctl_of_match[] = { .compatible = "nvidia,tegra194-xusb-padctl", .data = &tegra194_xusb_padctl_soc, }, +#endif +#if defined(CONFIG_ARCH_TEGRA_234_SOC) + { + .compatible = "nvidia,tegra234-xusb-padctl", + .data = &tegra234_xusb_padctl_soc, + }, #endif { } }; diff --git a/drivers/phy/tegra/xusb.h b/drivers/phy/tegra/xusb.h index c384734a61c2..8bd6cd281119 100644 --- a/drivers/phy/tegra/xusb.h +++ b/drivers/phy/tegra/xusb.h @@ -8,6 +8,7 @@ #define __PHY_TEGRA_XUSB_H #include +#include #include #include @@ -431,6 +432,8 @@ struct tegra_xusb_padctl_soc { unsigned int num_supplies; bool supports_gen2; bool need_fake_usb3_port; + bool poll_trk_completed; + bool trk_hw_mode; }; struct tegra_xusb_padctl { @@ -473,6 +476,23 @@ static inline u32 padctl_readl(struct tegra_xusb_padctl *padctl, return value; } +static inline u32 padctl_readl_poll(struct tegra_xusb_padctl *padctl, + unsigned long offset, u32 val, u32 mask, + int us) +{ + u32 regval; + int err; + + err = readl_poll_timeout(padctl->regs + offset, regval, + (regval & mask) == val, 1, us); + if (err) { + dev_err(padctl->dev, "%08lx poll timeout > %08x\n", offset, + regval); + } + + return err; +} + struct tegra_xusb_lane *tegra_xusb_find_lane(struct tegra_xusb_padctl *padctl, const char *name, unsigned int index); @@ -489,5 +509,8 @@ extern const struct tegra_xusb_padctl_soc tegra186_xusb_padctl_soc; #if defined(CONFIG_ARCH_TEGRA_194_SOC) extern const struct tegra_xusb_padctl_soc tegra194_xusb_padctl_soc; #endif +#if defined(CONFIG_ARCH_TEGRA_234_SOC) +extern const struct tegra_xusb_padctl_soc tegra234_xusb_padctl_soc; +#endif #endif /* __PHY_TEGRA_XUSB_H */