From patchwork Wed Jan 11 11:04:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jon Hunter X-Patchwork-Id: 641475 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 4DD18C677F1 for ; Wed, 11 Jan 2023 11:05:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235627AbjAKLFb (ORCPT ); Wed, 11 Jan 2023 06:05:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232319AbjAKLF2 (ORCPT ); Wed, 11 Jan 2023 06:05:28 -0500 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2041.outbound.protection.outlook.com [40.107.236.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC3582AC7; Wed, 11 Jan 2023 03:05:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EQlHBY1D7bHGZeu7A7v6UO3e1dG8rZYnBp9xS2KtLXVAayjutLqFNZXsQVzgyOLovLX9cFHFgBneHtEX0qilOt8mGwEBY0e59A687VwH660qIsDeh05UEAwSyyEX23Kz0iUaXRc2H0Y0Pb5bDWjB9PMBhbfY13DAWVM6TZp6si/b3GECPQ4stZIRUPw/kT6XbeFcZkQ3SQsyiFsID5REOAD4uzsdN50hwmEdcITORTSlIA68AY274/38s53w5hr+sD50I41ck/vleAOrArJgZdJigJZiJZLrET8eKjNtRQnayc35awHnOMgBijZLlb8EjEkLvT1//+LHUNEnVEg8Sw== 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=i65sX63fIauKha/2zOZ/+gB7ntoM17Ghy7HSSUGvtMY=; b=TX4Js8BYC4ExBYkDniuhz7aI+1Kyh36z0Ully2AMvrRTee69ZE+nyY586jun36oPlZkUD5O+LW4/XVtn9xFXwch1Gta0fS4aCU8NjQ6yFdysafwKx2x5etghoJPm9MvKKP7WKbSf3X5Wy9hsbv4a/yK0n2r9a7KI7F+zqI8f9NjIxVJSKZUi2UL75W+LyUEjFO08t3OKLYb/6rwStQiyQZ8qP9JMA1KghkK4Oj6gSTo7WNKhuhuUrCu7jzSdkZcMrSICYOLoQBUmWDP0tIG/pPgdPDEZj3dxHNoYh86SHlnOklmi2pb/X5R2RIaO91rOUYHjhRXtlB5SvxjjLtNeSQ== 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=i65sX63fIauKha/2zOZ/+gB7ntoM17Ghy7HSSUGvtMY=; b=J+QQk4V/ZiMY/eEb3Rg+e4Zp49RLdcbLrfsp3FERSdlJ3O1OSdbdMFV2yNWeIzqcSwvfz+C6WJ8aEbiXHWZJiUOkLhkj/OvDOq1glLaR55uMoXHc0XNwHUGARuswiZYnFzygg9yvz0LQOoX4D+UDuE+qSt3gvx8k7MyWhYnC0W1CSDMyPt0c1S2z4psq/5bDZt8MVmU0wwL2KApbhWii8+wgPTZWgja6QoA+VTv1KMnMQYgYakr3thNVM/9BYDFHoqmjoBTX+1kIMfu7sfcng1wTyDOL5Re23rlpI93qSey6lO9UhSusHKMyye2IsDO5l/JdY8MLAVuVT3yUaykWOg== Received: from DM5PR08CA0030.namprd08.prod.outlook.com (2603:10b6:4:60::19) by DS7PR12MB8229.namprd12.prod.outlook.com (2603:10b6:8:ea::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Wed, 11 Jan 2023 11:05:23 +0000 Received: from DM6NAM11FT096.eop-nam11.prod.protection.outlook.com (2603:10b6:4:60:cafe::76) by DM5PR08CA0030.outlook.office365.com (2603:10b6:4:60::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.13 via Frontend Transport; Wed, 11 Jan 2023 11:05: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 DM6NAM11FT096.mail.protection.outlook.com (10.13.173.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.17 via Frontend Transport; Wed, 11 Jan 2023 11:05:23 +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.36; Wed, 11 Jan 2023 03:05:14 -0800 Received: from rnnvmail202.nvidia.com (10.129.68.7) 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.36; Wed, 11 Jan 2023 03:05:13 -0800 Received: from moonraker.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.7) with Microsoft SMTP Server id 15.2.986.36 via Frontend Transport; Wed, 11 Jan 2023 03:05:10 -0800 From: Jon Hunter To: Greg Kroah-Hartman , Rob Herring , Krzysztof Kozlowski , Thierry Reding , Vinod Koul CC: , , , , , Thierry Reding , Jon Hunter Subject: [PATCH V6 3/6] arm64: tegra: Enable XUSB host function on Jetson AGX Orin Date: Wed, 11 Jan 2023 11:04:47 +0000 Message-ID: <20230111110450.24617-4-jonathanh@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230111110450.24617-1-jonathanh@nvidia.com> References: <20230111110450.24617-1-jonathanh@nvidia.com> MIME-Version: 1.0 X-NVConfidentiality: public X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT096:EE_|DS7PR12MB8229:EE_ X-MS-Office365-Filtering-Correlation-Id: 99db88c0-2942-40fa-cf57-08daf3c3bcc0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hro5SYkwoy0glUdsS5Y5h6ST2ct6hMATnpI6JyM+eXWfxylV0AFuWia3uCSOKPiHTLnIsM9DGKOnzIe4AWaZfdbnfz+deOfxNXyEfUbQFSQbbfkHKWg20QXhw8E7rkTDuwYMUOZuvaHsmZFZZ26qdco60U7fQsDYmGJ25CVIFan0No0g0/fe2zbNdmh9RLeizysSlq1wnXH62pvf4DNTI941pvdvgYwa7aNMCK7+/Ga0w3vz9SMWOuqiCca4LJ79qYDiPFzSyFMe06c9Wwfw5Lk/5erOWIsyJaVj2U2JwA78MhiQm3tRu5g1g0NMlWcdBNnTzto1B8k8hHMQPgLfiMvhCK2hk27BTEV7Lh324LaDos5lAKZjGFU8B7JaNoruWkHr8Z4hCW3jUSF67sosUAnx7W52XQzmguhkj/GrK+ybOStH23G1LCKD+FJsBH0cph5C1XMgpswiZs9h01rCMW6QBPuLZtOj01kgS5/Zx3PxA8ewCyTjZtNop9UwTL67WVHi8QNo6+SiStVj0NY0oCBNA33lnFrzsUkrcnz2D61WkSQKfl+TFuO0wFaFhhhJnVE8nTcuoymUdTQFmSdoPQqyQ9w0HKD5vAKqxrQKmaaXccixowV1by2BnbFoC3lVYo726YQXUpuw7ry/fULSjEjKvIL6yp9MrN6dCdCSFUeHpHwm0KrEK945enq38zZsglva23d3EzJTPcndGiUMig== 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)(376002)(346002)(396003)(136003)(451199015)(46966006)(40470700004)(36840700001)(36860700001)(82740400003)(6666004)(107886003)(7636003)(2906002)(356005)(478600001)(2616005)(1076003)(26005)(7696005)(186003)(5660300002)(40480700001)(316002)(8936002)(83380400001)(40460700003)(82310400005)(36756003)(86362001)(426003)(47076005)(41300700001)(110136005)(8676002)(336012)(70586007)(54906003)(70206006)(4326008); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jan 2023 11:05:23.5865 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 99db88c0-2942-40fa-cf57-08daf3c3bcc0 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: DM6NAM11FT096.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB8229 Precedence: bulk List-ID: X-Mailing-List: devicetree@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 -> V6: 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>;