From patchwork Fri Feb 16 17:01:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Reichel X-Patchwork-Id: 202258 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:c619:b0:108:e6aa:91d0 with SMTP id hn25csp653681dyb; Fri, 16 Feb 2024 09:08:41 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXmzzDycOI93C5CQVVpcUH/W2+qr2hwQjLz6UDgEb5jovyR7qUT1CRWTfpx4tUI5XZEXanGG5e03dQps7TcWlxFhXHtdQ== X-Google-Smtp-Source: AGHT+IH48G7Pk+RbG0nOtZK7pkl9jZ2AYHho7Yi3UPxKkIrFv/q0Js7+C33ah8hTLaw1JaWQTgBb X-Received: by 2002:a17:906:d10a:b0:a38:9e36:b45b with SMTP id b10-20020a170906d10a00b00a389e36b45bmr3877445ejz.25.1708103320973; Fri, 16 Feb 2024 09:08:40 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708103320; cv=pass; d=google.com; s=arc-20160816; b=YJgOtcOwkynCbzE6QSGz8sD121mBmYtbnTJAimSA7P7HXd1rJw4E9ZBSUjPdnB0pA7 ogEfSL76RbsbGhSi77AzayK9pr6ZDl3pZtxNjR9QvFvz/DUjSxMd8Vw3Hcol5bbHxXRB E85LXJkXnlTpt4lO7SB8t8uNN/lOcX5O7TQ5A7tQ6+jdaKBcbuR4qWTEJMNq260P+DCF cTAJ6duukdapKozFv//QnOAREF3Mcw72lEBuUkt09Uc7shUaVcu6k7AOqs0myP4wim0z sCWDDf3Kk5RZ7gFAZk+zPQWA+UIANkp69ABKbyUxwcVNk0zD7D6A3q56lbMu5q7sbs4J uijA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=AYY6rB54xZSd3yPlOsS8T0S8kBF/FnR5eoJCihTyUrU=; fh=PR8oX9iAuEV9EE88DNlIUN0LZl0FYAIumwLgJAahQOY=; b=KJakxVjTlkDTxVwy4RT7A6g+pa9rlkkYWikAyVnVVMhQaBLX0GtrYmo5urC0j3C2Ry pF8XzcC+UPMojU4Wj3AZlXd0SCTravDOz0qVsV7szWCKAZjopksv2DcgNYrU6mSr4E3u 2tVsFyfXtntJRMBYPyzhWc8lIRGcmA5+/4NcOZ3WzMnc2e63dav+HO+OFYWQrP1D6HM8 Z94XwyYH6rJBMwtMSnu8eHW6CVFEz4XK+SVVrHJQvSFXv7vatYCwVbaizfStY+QWvah+ zMzWvjDPl/HNKggDb6B8DWitWmNTClnRhfx2EXmrSVotexphNs6APmJyGTZILa9GgP+6 73kA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=fSl+Rs8U; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-69027-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69027-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id d8-20020a1709064c4800b00a3d6cc6c932si98002ejw.867.2024.02.16.09.08.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 09:08:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-69027-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=fSl+Rs8U; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-69027-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69027-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 472711F23BC4 for ; Fri, 16 Feb 2024 17:08:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ADB4E137C49; Fri, 16 Feb 2024 17:05:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="fSl+Rs8U" Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4CB1A132499; Fri, 16 Feb 2024 17:05:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708103127; cv=none; b=k84au/8na5o/Z7DCa4W50pt7rsmWpSxT8U8F6mYgWIDp0ZixPitQ52RUU2ENxJQPd0SCKl9NwqyF9zDmnzB5TQjHXajJwiKFMV30z9LdcC2bc+XsTX3kanb8N3vO6up23JLgb6zkoxpyHnUfuhg6JM3zKPGJ4n82XtarBUS7AF0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708103127; c=relaxed/simple; bh=0acUJ6uhxWQwJKn7gi4S72wsDmO2zKXXbszxoTmv7G4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PZs+v9n0u5Ttx2IFinSVv6bl44FamCCQMaXXtYwACuMKAxIdLw8YOy0cc41q3+CZBuWlbKzQxb5YmbEcU9b2IM6tUY7v32hRBpEfetObmWDAxdX/WxPGPVhzDozr0NGPJ4r2XFluo0UyoQLBveC8slkYz8p6Mgd0vslCEM5NonU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=fSl+Rs8U; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1708103118; bh=0acUJ6uhxWQwJKn7gi4S72wsDmO2zKXXbszxoTmv7G4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fSl+Rs8UwtZbetXwLzKoBc/NSLFQ5FvZKOHQ7rKmRn2MUUJ4A3CPsAciDhnEw4j0o brJS6ny3EwVfgOgSwcW5goVxQ4Chz91HMZQWWxeDj8R+ntuLj8c52hIRZRq45ky/wb ASsvCCTNlwdn9xxvMKKM/iJ2Nntz9Pogw4RSNHxRg4v+ghohvtEksBIHcxLqe+lrqz axJla6A47c9FMusCkrhWrrI2G7oQA+GO6EMB/bJH91nYYxQXSgvhDZE6p5cEiXs7dw tWWXEVZGX/GNLNPgXU9zuJpgCqTFT08P7YaqxFtNhQgySQCB52H5bcarREFsVxkWcQ b7IIj68+sYOSg== Received: from jupiter.universe (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: sre) by madrid.collaboradmins.com (Postfix) with ESMTPSA id DEECE37820C0; Fri, 16 Feb 2024 17:05:17 +0000 (UTC) Received: by jupiter.universe (Postfix, from userid 1000) id DE6484800D4; Fri, 16 Feb 2024 18:05:16 +0100 (CET) From: Sebastian Reichel To: Heiko Stuebner , Vinod Koul , Kishon Vijay Abraham I , linux-rockchip@lists.infradead.org, linux-phy@lists.infradead.org Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Frank Wang , Kever Yang , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Sebastian Reichel , kernel@collabora.com Subject: [PATCH v3 08/10] arm64: dts: rockchip: add USB3 to rk3588-evb1 Date: Fri, 16 Feb 2024 18:01:23 +0100 Message-ID: <20240216170514.75200-9-sebastian.reichel@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240216170514.75200-1-sebastian.reichel@collabora.com> References: <20240216170514.75200-1-sebastian.reichel@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791076147594946458 X-GMAIL-MSGID: 1791076147594946458 Add support for the board's USB3 connectors. It has 1x USB Type-A and 1x USB Type-C. Signed-off-by: Sebastian Reichel --- .../boot/dts/rockchip/rk3588-evb1-v10.dts | 143 ++++++++++++++++++ 1 file changed, 143 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3588-evb1-v10.dts b/arch/arm64/boot/dts/rockchip/rk3588-evb1-v10.dts index ac7c677b0fb9..0e82dbb4c5ff 100644 --- a/arch/arm64/boot/dts/rockchip/rk3588-evb1-v10.dts +++ b/arch/arm64/boot/dts/rockchip/rk3588-evb1-v10.dts @@ -9,6 +9,7 @@ #include #include #include +#include #include "rk3588.dtsi" / { @@ -224,6 +225,18 @@ vcc5v0_usb: vcc5v0-usb-regulator { regulator-max-microvolt = <5000000>; vin-supply = <&vcc5v0_usbdcin>; }; + + vbus5v0_typec: vbus5v0-typec { + compatible = "regulator-fixed"; + regulator-name = "vbus5v0_typec"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + enable-active-high; + gpio = <&gpio4 RK_PD0 GPIO_ACTIVE_HIGH>; + vin-supply = <&vcc5v0_usb>; + pinctrl-names = "default"; + pinctrl-0 = <&typec5v_pwren>; + }; }; &combphy0_ps { @@ -284,6 +297,56 @@ &gmac0_rgmii_clk &i2c2 { status = "okay"; + usbc0: usb-typec@22 { + compatible = "fcs,fusb302"; + reg = <0x22>; + interrupt-parent = <&gpio3>; + interrupts = ; + pinctrl-names = "default"; + pinctrl-0 = <&usbc0_int>; + vbus-supply = <&vbus5v0_typec>; + status = "okay"; + + usb_con: connector { + compatible = "usb-c-connector"; + label = "USB-C"; + data-role = "dual"; + power-role = "dual"; + try-power-role = "source"; + op-sink-microwatt = <1000000>; + sink-pdos = + ; + source-pdos = + ; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + usbc0_orien_sw: endpoint { + remote-endpoint = <&usbdp_phy0_orientation_switch>; + }; + }; + + port@1 { + reg = <1>; + usbc0_role_sw: endpoint { + remote-endpoint = <&dwc3_0_role_switch>; + }; + }; + + port@2 { + reg = <2>; + dp_altmode_mux: endpoint { + remote-endpoint = <&usbdp_phy0_dp_altmode_mux>; + }; + }; + }; + }; + }; + hym8563: rtc@51 { compatible = "haoyu,hym8563"; reg = <0x51>; @@ -410,6 +473,16 @@ vcc5v0_host_en: vcc5v0-host-en { rockchip,pins = <4 RK_PB0 RK_FUNC_GPIO &pcfg_pull_none>; }; }; + + usb-typec { + usbc0_int: usbc0-int { + rockchip,pins = <3 RK_PB4 RK_FUNC_GPIO &pcfg_pull_up>; + }; + + typec5v_pwren: typec5v-pwren { + rockchip,pins = <4 RK_PD0 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; }; &pwm2 { @@ -1040,6 +1113,22 @@ &sata0 { status = "okay"; }; +&u2phy0 { + status = "okay"; +}; + +&u2phy0_otg { + status = "okay"; +}; + +&u2phy1 { + status = "okay"; +}; + +&u2phy1_otg { + status = "okay"; +}; + &u2phy2 { status = "okay"; }; @@ -1078,3 +1167,57 @@ &usb_host1_ehci { &usb_host1_ohci { status = "okay"; }; + +&usbdp_phy0 { + orientation-switch; + mode-switch; + sbu1-dc-gpios = <&gpio4 RK_PA6 GPIO_ACTIVE_HIGH>; + sbu2-dc-gpios = <&gpio4 RK_PA7 GPIO_ACTIVE_HIGH>; + status = "okay"; + + port { + #address-cells = <1>; + #size-cells = <0>; + + usbdp_phy0_orientation_switch: endpoint@0 { + reg = <0>; + remote-endpoint = <&usbc0_orien_sw>; + }; + + usbdp_phy0_dp_altmode_mux: endpoint@1 { + reg = <1>; + remote-endpoint = <&dp_altmode_mux>; + }; + }; +}; + +&usbdp_phy1 { + /* + * USBDP PHY1 is wired to a female USB3 Type-A connector. Additionally + * the differential pairs 2+3 and the aux channel are wired to a RTD2166, + * which converts the DP signal into VGA. This is exposed on the + * board via a female VGA connector. + */ + rockchip,dp-lane-mux = <2 3>; + status = "okay"; +}; + +&usb_host0_xhci { + dr_mode = "otg"; + usb-role-switch; + status = "okay"; + + port { + #address-cells = <1>; + #size-cells = <0>; + dwc3_0_role_switch: endpoint@0 { + reg = <0>; + remote-endpoint = <&usbc0_role_sw>; + }; + }; +}; + +&usb_host1_xhci { + dr_mode = "host"; + status = "okay"; +};