mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chaoyi Chen <chaoyi.chen@rock-chips.com>
To: Alexey Charkov <alchark@flipper.net>
Cc: Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Heiko Stuebner <heiko@sntech.de>,
	devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] arm64: dts: rockchip: Describe the Type-C port on RK3576 EVB1
Date: Wed, 11 Nov 2026 17:31:15 +0800	[thread overview]
Message-ID: <dd59d491-82b0-4047-ae98-f8070f6be112@rock-chips.com> (raw)
In-Reply-To: <20261106-rk3576-evb1-husb311-v1-1-99c2f57ea2a5@flipper.net>

Hi Alexey,

On 11/7/2026 1:52 AM, Alexey Charkov wrote:
> RK3576 EVB1 has its USBDP PHY routed to a Type-C port with a HUSB311 CC
> controller and a fixed-voltage VBUS supply.
> 
> Describe it in the device tree, including the wiring for both the USB and
> the DP side.
> 
> This makes the data roles follow the Type-C port's negotiation, so the
> port stops being host only. It also leaves the VBUS regulator to be
> managed by TCPM instead of being hardwired via the tangentially related
> phy-supply on a USB controller. DP lanes are also muxed dynamically by
> the USBDP PHY based on the Type-C port's negotiation, so the hacky fixed
> lane muxing also goes away.
>

Have you tested this? As far as I know, dw-dp driver does not support
Type-C HPD yet.

> Signed-off-by: Alexey Charkov <alchark@flipper.net>
> ---
>  arch/arm64/boot/dts/rockchip/rk3576-evb1-v10.dts | 150 ++++++++++++++++++++++-
>  1 file changed, 147 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm64/boot/dts/rockchip/rk3576-evb1-v10.dts b/arch/arm64/boot/dts/rockchip/rk3576-evb1-v10.dts
> index f83d129f96f1..a9b27cdb2dfa 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3576-evb1-v10.dts
> +++ b/arch/arm64/boot/dts/rockchip/rk3576-evb1-v10.dts
> @@ -11,6 +11,7 @@
>  #include <dt-bindings/leds/common.h>
>  #include <dt-bindings/pinctrl/rockchip.h>
>  #include <dt-bindings/soc/rockchip,vop2.h>
> +#include <dt-bindings/usb/pd.h>
>  #include "rk3576.dtsi"
>  
>  / {
> @@ -334,6 +335,22 @@ &combphy1_psu {
>  	status = "okay";
>  };
>  
> +&dp {
> +	status = "okay";
> +};
> +
> +&dp0_in {
> +	dp0_in_vp1: endpoint {
> +		remote-endpoint = <&vp1_out_dp>;
> +	};
> +};
> +
> +&dp0_out {
> +	dp0_out_con: endpoint {
> +		remote-endpoint = <&usbdp_phy_dp_in>;
> +	};
> +};
> +
>  &gmac0 {
>  	clock_in_out = "output";
>  	phy-mode = "rgmii-rxid";
> @@ -772,6 +789,58 @@ regulator-state-mem {
>  &i2c2 {
>  	status = "okay";
>  
> +	usbc0: typec-portc@4e {
> +		compatible = "hynetek,husb311", "richtek,rt1711h";
> +		reg = <0x4e>;
> +		interrupt-parent = <&gpio0>;
> +		interrupts = <RK_PA5 IRQ_TYPE_LEVEL_LOW>;
> +		pinctrl-names = "default";
> +		pinctrl-0 = <&usbc0_int>;
> +		vbus-supply = <&vbus5v0_typec>;
> +
> +		connector {
> +			compatible = "usb-c-connector";
> +			label = "USB-C";
> +			data-role = "dual";
> +			power-role = "source";
> +			source-pdos = <PDO_FIXED(5000, 2000,
> +						 PDO_FIXED_USB_COMM | PDO_FIXED_DATA_SWAP)>;
> +
> +			altmodes {
> +				displayport {
> +					svid = /bits/ 16 <0xff01>;
> +					vdo = <0x00001c46>;
> +				};
> +			};
> +
> +			ports {
> +				#address-cells = <1>;
> +				#size-cells = <0>;
> +
> +				port@0 {
> +					reg = <0>;
> +					usbc0_hs: endpoint {
> +						remote-endpoint = <&usb_drd0_hs_ep>;
> +					};
> +				};
> +
> +				port@1 {
> +					reg = <1>;
> +					usbc0_ss: endpoint {
> +						remote-endpoint = <&usbdp_phy_ss_out>;
> +					};
> +				};
> +
> +				port@2 {
> +					reg = <2>;
> +					usbc0_sbu: endpoint {
> +						remote-endpoint = <&usbdp_phy_dp_out>;
> +					};
> +				};
> +			};
> +		};
> +	};
> +
>  	hym8563: rtc@51 {
>  		compatible = "haoyu,hym8563";
>  		reg = <0x51>;
> @@ -944,6 +1013,14 @@ usb_otg0_pwren: usb-otg0-pwren {
>  		usbc0_int: usbc0-int {
>  			rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>;
>  		};
> +
> +		usbc0_sbu1: usbc0-sbu1 {
> +			rockchip,pins = <2 RK_PA6 RK_FUNC_GPIO &pcfg_pull_none>;
> +		};
> +
> +		usbc0_sbu2: usbc0-sbu2 {
> +			rockchip,pins = <2 RK_PA7 RK_FUNC_GPIO &pcfg_pull_none>;
> +		};
>  	};
>  
>  	wifi {
> @@ -1008,7 +1085,6 @@ &u2phy0 {
>  };
>  
>  &u2phy0_otg {
> -	phy-supply = <&vbus5v0_typec>;
>  	status = "okay";
>  };
>  
> @@ -1051,13 +1127,74 @@ &ufshc {
>  };
>  
>  &usbdp_phy {
> -	rockchip,dp-lane-mux = <2 3>;
> +	mode-switch;
> +	orientation-switch;
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&usbc0_sbu1 &usbc0_sbu2>;
> +	sbu1-dc-gpios = <&gpio2 RK_PA6 GPIO_ACTIVE_HIGH>;
> +	sbu2-dc-gpios = <&gpio2 RK_PA7 GPIO_ACTIVE_HIGH>;
>  	status = "okay";
> +
> +	ports {
> +		#address-cells = <1>;
> +		#size-cells = <0>;
> +
> +		port@0 {
> +			reg = <0>;
> +
> +			usbdp_phy_ss_out: endpoint {
> +				remote-endpoint = <&usbc0_ss>;
> +			};
> +		};
> +
> +		port@1 {
> +			reg = <1>;
> +
> +			usbdp_phy_ss_in: endpoint {
> +				remote-endpoint = <&usb_drd0_ss_ep>;
> +			};
> +		};
> +
> +		port@2 {
> +			reg = <2>;
> +
> +			usbdp_phy_dp_in: endpoint {
> +				remote-endpoint = <&dp0_out_con>;
> +			};
> +		};
> +
> +		port@3 {
> +			reg = <3>;
> +
> +			usbdp_phy_dp_out: endpoint {
> +				remote-endpoint = <&usbc0_sbu>;
> +			};
> +		};
> +	};
>  };
>  
>  &usb_drd0_dwc3 {
> -	dr_mode = "host";
> +	usb-role-switch;
>  	status = "okay";
> +
> +	ports {
> +		#address-cells = <1>;
> +		#size-cells = <0>;
> +
> +		port@0 {
> +			reg = <0>;
> +			usb_drd0_hs_ep: endpoint {
> +				remote-endpoint = <&usbc0_hs>;
> +			};
> +		};
> +
> +		port@1 {
> +			reg = <1>;
> +			usb_drd0_ss_ep: endpoint {
> +				remote-endpoint = <&usbdp_phy_ss_in>;
> +			};
> +		};
> +	};
>  };
>  
>  &usb_drd1_dwc3 {
> @@ -1079,3 +1216,10 @@ vp0_out_hdmi: endpoint@ROCKCHIP_VOP2_EP_HDMI0 {
>  		remote-endpoint = <&hdmi_in_vp0>;
>  	};
>  };
> +
> +&vp1 {
> +	vp1_out_dp: endpoint@a {
> +		reg = <ROCKCHIP_VOP2_EP_DP0>;
> +		remote-endpoint = <&dp0_in_vp1>;
> +	};
> +};
> 
> ---
> base-commit: ddfe51b0a0f5dc9e415cc2c8ad8db17532dd426b
> change-id: 20261106-rk3576-evb1-husb311-00efcff4a808
> 
> Best regards,
> --  
> Alexey Charkov <alchark@flipper.net>

-- 
Best, 
Chaoyi

  reply	other threads:[~2026-11-11  9:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-06 17:52 Alexey Charkov
2026-11-11  9:31 ` Chaoyi Chen [this message]
2026-11-11 10:45   ` Alexey Charkov
2026-11-12  1:01     ` Chaoyi Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dd59d491-82b0-4047-ae98-f8070f6be112@rock-chips.com \
    --to=chaoyi.chen@rock-chips.com \
    --cc=alchark@flipper.net \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=heiko@sntech.de \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®