[PATCH 1/2] arm64: dts: rockchip: add USB-C PD support to LubanCat 4
Pufan Jin
cyan2254650260 at gmail.com
Tue Nov 10 11:30:27 PST 2026
The EmbedFire LubanCat 4 has a Type-C port on the front panel backed by
a Fairchild FUSB302 Type-C controller connected to I2C1 (at 0x22).
VBUS 5V power is supplied through a fixed regulator enabled by
GPIO1_C1 (active high), current-limited to 2A by an LPW5209 switch.
Add the FUSB302 node, the fixed VBUS regulator, and the USB-C connector
with dual-role power (source 5V/2A, sink 5V/1A) and dual-role data.
Wire the HighSpeed data endpoint to usb_host0_xhci and the SuperSpeed
data endpoint to usbdp_phy0. Set usb_host0_xhci to OTG mode with
usb-role-switch enabled, and add orientation-switch on usbdp_phy0.
DisplayPort alternate mode support is added in a subsequent patch.
Tested on LubanCat 4 hardware:
- fusb302 and tcpm probe cleanly;
- USB host mode verified with USB 2.0 and USB 3.0 peripherals;
- USB 2.0 devices enumerate and transfer data in both orientations;
- USB 3.0 devices enumerate at SuperSpeed (5Gbps) in normal orientation;
reverse-orientation SuperSpeed is subject to the known upstream
phy-rockchip-usbdp driver reinit limitation;
- USB device mode verified via ConfigFS CDC ACM serial gadget connected
to a host PC with successful high-speed enumeration and bidirectional
data communication;
- VBUS switch (LPW5209) enables in source mode and remains disabled in
sink mode with reverse current blocked.
Signed-off-by: Pufan Jin <cyan2254650260 at gmail.com>
---
.../boot/dts/rockchip/rk3588s-lubancat-4.dts | 115 +++++++++++++++++-
1 file changed, 114 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/rockchip/rk3588s-lubancat-4.dts b/arch/arm64/boot/dts/rockchip/rk3588s-lubancat-4.dts
index 0d28c6165..a94aaddb2 100644
--- a/arch/arm64/boot/dts/rockchip/rk3588s-lubancat-4.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3588s-lubancat-4.dts
@@ -8,9 +8,11 @@
/dts-v1/;
#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/interrupt-controller/irq.h>
#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 "rk3588s.dtsi"
/ {
@@ -116,6 +118,18 @@ vcc5v0_usb30_host: regulator-vcc5v0-usb30-host {
vin-supply = <&vcc5v0_sys>;
};
+ vbus5v0_typec: regulator-vbus5v0-typec {
+ compatible = "regulator-fixed";
+ regulator-name = "vbus5v0_typec";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ enable-active-high;
+ gpio = <&gpio1 RK_PC1 GPIO_ACTIVE_HIGH>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&typec_vbus_en>;
+ vin-supply = <&vcc5v0_sys>;
+ };
+
fan: pwm-fan {
compatible = "pwm-fan";
cooling-levels = <0 100 150 200 255>;
@@ -286,6 +300,51 @@ regulator-state-mem {
regulator-off-in-suspend;
};
};
+
+ usbc0: usb-typec at 22 {
+ compatible = "fcs,fusb302";
+ reg = <0x22>;
+ interrupt-parent = <&gpio0>;
+ interrupts = <RK_PC6 IRQ_TYPE_LEVEL_LOW>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&fusb302_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 =
+ <PDO_FIXED(5000, 1000, PDO_FIXED_USB_COMM)>;
+ source-pdos =
+ <PDO_FIXED(5000, 2000, PDO_FIXED_USB_COMM)>;
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port at 0 {
+ reg = <0>;
+
+ usbc0_hs: endpoint {
+ remote-endpoint = <&usb_host0_xhci_hs>;
+ };
+ };
+
+ port at 1 {
+ reg = <1>;
+
+ usbc0_ss: endpoint {
+ remote-endpoint = <&usbdp_phy0_ss_out>;
+ };
+ };
+ };
+ };
+ };
};
&mdio1 {
@@ -346,6 +405,16 @@ usb30_host_pwr_en: usb30-host-pwr-en {
rockchip,pins = <1 RK_PC4 RK_FUNC_GPIO &pcfg_pull_none>;
};
};
+
+ usb-typec {
+ fusb302_int: fusb302-int {
+ rockchip,pins = <0 RK_PC6 RK_FUNC_GPIO &pcfg_pull_up>;
+ };
+
+ typec_vbus_en: typec-vbus-en {
+ rockchip,pins = <1 RK_PC1 RK_FUNC_GPIO &pcfg_pull_none>;
+ };
+ };
};
&pwm0 {
@@ -748,8 +817,30 @@ &usb_host0_ohci {
};
&usb_host0_xhci {
- dr_mode = "host";
+ dr_mode = "otg";
+ usb-role-switch;
status = "okay";
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port at 0 {
+ reg = <0>;
+
+ usb_host0_xhci_hs: endpoint {
+ remote-endpoint = <&usbc0_hs>;
+ };
+ };
+
+ port at 1 {
+ reg = <1>;
+
+ usb_host0_xhci_ss: endpoint {
+ remote-endpoint = <&usbdp_phy0_ss_in>;
+ };
+ };
+ };
};
&usb_host1_ehci {
@@ -765,7 +856,29 @@ &usb_host2_xhci {
};
&usbdp_phy0 {
+ orientation-switch;
status = "okay";
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port at 0 {
+ reg = <0>;
+
+ usbdp_phy0_ss_out: endpoint {
+ remote-endpoint = <&usbc0_ss>;
+ };
+ };
+
+ port at 1 {
+ reg = <1>;
+
+ usbdp_phy0_ss_in: endpoint {
+ remote-endpoint = <&usb_host0_xhci_ss>;
+ };
+ };
+ };
};
&vop {
--
2.56.0
More information about the Linux-rockchip
mailing list