Skip to content

Commit c57d1a9

Browse files
jimmyhonmmind
authored andcommitted
arm64: dts: rockchip: add USB-C support to rk3588s-orangepi-5
Add support for using the Orange Pi 5 USB-C port for USB in OHCI, EHCI or XHCI mode. Displayport AltMode is not yet supported. Signed-off-by: Jimmy Hon <honyuenkwun@gmail.com> Link: https://lore.kernel.org/r/20240418035232.35344-2-honyuenkwun@gmail.com Signed-off-by: Heiko Stuebner <heiko@sntech.de>
1 parent 8beafb2 commit c57d1a9

1 file changed

Lines changed: 94 additions & 0 deletions

File tree

arch/arm64/boot/dts/rockchip/rk3588s-orangepi-5.dts

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include <dt-bindings/leds/common.h>
77
#include <dt-bindings/input/input.h>
88
#include <dt-bindings/pinctrl/rockchip.h>
9+
#include <dt-bindings/usb/pd.h>
910
#include "rk3588s.dtsi"
1011

1112
/ {
@@ -217,6 +218,56 @@
217218
pinctrl-0 = <&i2c6m3_xfer>;
218219
status = "okay";
219220

221+
usbc0: usb-typec@22 {
222+
compatible = "fcs,fusb302";
223+
reg = <0x22>;
224+
interrupt-parent = <&gpio0>;
225+
interrupts = <RK_PD3 IRQ_TYPE_LEVEL_LOW>;
226+
pinctrl-names = "default";
227+
pinctrl-0 = <&usbc0_int>;
228+
vbus-supply = <&vbus_typec>;
229+
status = "okay";
230+
231+
usb_con: connector {
232+
compatible = "usb-c-connector";
233+
label = "USB-C";
234+
data-role = "dual";
235+
op-sink-microwatt = <1000000>;
236+
power-role = "dual";
237+
sink-pdos =
238+
<PDO_FIXED(5000, 1000, PDO_FIXED_USB_COMM)>;
239+
source-pdos =
240+
<PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM)>;
241+
try-power-role = "source";
242+
243+
ports {
244+
#address-cells = <1>;
245+
#size-cells = <0>;
246+
247+
port@0 {
248+
reg = <0>;
249+
usbc0_hs: endpoint {
250+
remote-endpoint = <&usb_host0_xhci_drd_sw>;
251+
};
252+
};
253+
254+
port@1 {
255+
reg = <1>;
256+
usbc0_ss: endpoint {
257+
remote-endpoint = <&usbdp_phy0_typec_ss>;
258+
};
259+
};
260+
261+
port@2 {
262+
reg = <2>;
263+
usbc0_sbu: endpoint {
264+
remote-endpoint = <&usbdp_phy0_typec_sbu>;
265+
};
266+
};
267+
};
268+
};
269+
};
270+
220271
hym8563: rtc@51 {
221272
compatible = "haoyu,hym8563";
222273
reg = <0x51>;
@@ -630,6 +681,14 @@
630681
status = "okay";
631682
};
632683

684+
&u2phy0 {
685+
status = "okay";
686+
};
687+
688+
&u2phy0_otg {
689+
status = "okay";
690+
};
691+
633692
&u2phy2 {
634693
status = "okay";
635694
};
@@ -651,6 +710,29 @@
651710
status = "okay";
652711
};
653712

713+
&usbdp_phy0 {
714+
mode-switch;
715+
orientation-switch;
716+
sbu1-dc-gpios = <&gpio4 RK_PA5 GPIO_ACTIVE_HIGH>;
717+
sbu2-dc-gpios = <&gpio4 RK_PA7 GPIO_ACTIVE_HIGH>;
718+
status = "okay";
719+
720+
port {
721+
#address-cells = <1>;
722+
#size-cells = <0>;
723+
724+
usbdp_phy0_typec_ss: endpoint@0 {
725+
reg = <0>;
726+
remote-endpoint = <&usbc0_ss>;
727+
};
728+
729+
usbdp_phy0_typec_sbu: endpoint@1 {
730+
reg = <1>;
731+
remote-endpoint = <&usbc0_sbu>;
732+
};
733+
};
734+
};
735+
654736
&usb_host0_ehci {
655737
status = "okay";
656738
};
@@ -659,6 +741,18 @@
659741
status = "okay";
660742
};
661743

744+
&usb_host0_xhci {
745+
dr_mode = "otg";
746+
usb-role-switch;
747+
status = "okay";
748+
749+
port {
750+
usb_host0_xhci_drd_sw: endpoint {
751+
remote-endpoint = <&usbc0_hs>;
752+
};
753+
};
754+
};
755+
662756
&usb_host1_ehci {
663757
status = "okay";
664758
};

0 commit comments

Comments
 (0)