arm64: dts: rockchip: Add USB-C Support for rk3588s-indiedroid-nova
authorChris Morgan <macromorgan@hotmail.com>
Thu, 18 Apr 2024 17:36:27 +0000 (12:36 -0500)
committerHeiko Stuebner <heiko@sntech.de>
Tue, 23 Apr 2024 15:13:16 +0000 (17:13 +0200)
Add support for the USB-C port on the Indiedroid Nova board. This
port supports USB-C DP Alt mode (not implemented yet in drivers),
but works as a USB XHCI/EHCI/OHCI port.

Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
Link: https://lore.kernel.org/r/20240418173627.1368494-1-macroalpha82@gmail.com
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
arch/arm64/boot/dts/rockchip/rk3588s-indiedroid-nova.dts

index ce8119cbb82485ac39c3b15dfae234f1666ec3c9..0acfac2313b1c5e1f3c767ccade2f731e1a4546b 100644 (file)
                pinctrl-names = "default";
                vbus-supply = <&vbus5v0_typec>;
 
-               connector {
+               usb_con: connector {
                        compatible = "usb-c-connector";
                        data-role = "dual";
                        label = "USB-C";
                        source-pdos = <PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM)>;
                        sink-pdos = <PDO_FIXED(5000, 1000, PDO_FIXED_USB_COMM)>;
                        op-sink-microwatt = <1000000>;
+
+                       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>;
+                                       };
+                               };
+                       };
                };
        };
 
        status = "okay";
 };
 
+&u2phy0 {
+       status = "okay";
+};
+
+&u2phy0_otg {
+       status = "okay";
+};
+
 &u2phy2 {
        status = "okay";
 };
        status = "okay";
 };
 
+&usb_host0_xhci {
+       usb-role-switch;
+       status = "okay";
+
+       port {
+               dwc3_0_role_switch: endpoint {
+                       remote-endpoint = <&usbc0_role_sw>;
+               };
+       };
+};
+
 &usb_host1_ehci {
        status = "okay";
 };
 &usb_host2_xhci {
        status = "okay";
 };
+
+&usbdp_phy0 {
+       orientation-switch;
+       mode-switch;
+       sbu1-dc-gpios = <&gpio4 RK_PA0 GPIO_ACTIVE_HIGH>;
+       sbu2-dc-gpios = <&gpio4 RK_PA1 GPIO_ACTIVE_HIGH>;
+       rockchip,dp-lane-mux = <2 3>;
+       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>;
+               };
+       };
+};