arm64: dts: rockchip: Enable the USB 2.0 ports on ODROID-M1
authorAurelien Jarno <aurelien@aurel32.net>
Fri, 30 Sep 2022 05:12:42 +0000 (07:12 +0200)
committerHeiko Stuebner <heiko@sntech.de>
Mon, 17 Oct 2022 11:44:41 +0000 (13:44 +0200)
The Rockchip RK3568 has two USB OHCI/EHCI controllers connected to a PHY
providing one host-only port and one OTG port. On the ODROID-M1, they
are both used in host mode. The USB ports are powered by a DC/DC
converter providing 5V and named VCC5V0_SYS on the schematics, followed
by a power switch.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Tested-by: Dan Johansen <strit@manjaro.org>
Link: https://lore.kernel.org/r/20220930051246.391614-10-aurelien@aurel32.net
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
arch/arm64/boot/dts/rockchip/rk3568-odroid-m1.dts

index e4b7699..2e4cc20 100644 (file)
                regulator-max-microvolt = <3300000>;
                vin-supply = <&dc_12v>;
        };
+
+       vcc5v0_sys: vcc5v0-sys-regulator {
+               compatible = "regulator-fixed";
+               regulator-name = "vcc5v0_sys";
+               regulator-always-on;
+               regulator-boot-on;
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+               vin-supply = <&dc_12v>;
+       };
+
+       vcc5v0_usb_host: vcc5v0-usb-host-regulator {
+               compatible = "regulator-fixed";
+               regulator-name = "vcc5v0_usb_host";
+               enable-active-high;
+               gpio = <&gpio0 RK_PA6 GPIO_ACTIVE_HIGH>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&vcc5v0_usb_host_en_pin>;
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+               vin-supply = <&vcc5v0_sys>;
+       };
 };
 
 &cpu0 {
                        rockchip,pins = <0 RK_PB0 RK_FUNC_GPIO &pcfg_pull_none>;
                };
        };
+
+       usb {
+               vcc5v0_usb_host_en_pin: vcc5v0-usb-host-en-pin {
+                       rockchip,pins = <0 RK_PA6 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+               vcc5v0_usb_otg_en_pin: vcc5v0-usb-otg-en-pin {
+                       rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
 };
 
 &pmu_io_domains {
        status = "okay";
 };
 
+&usb_host0_ehci {
+       status = "okay";
+};
+
+&usb_host0_ohci {
+       status = "okay";
+};
+
+&usb_host1_ehci {
+       status = "okay";
+};
+
+&usb_host1_ohci {
+       status = "okay";
+};
+
+&usb2phy1 {
+       status = "okay";
+};
+
+&usb2phy1_host {
+       phy-supply = <&vcc5v0_usb_host>;
+       status = "okay";
+};
+
+&usb2phy1_otg {
+       phy-supply = <&vcc5v0_usb_host>;
+       status = "okay";
+};
+
 &vop {
        assigned-clocks = <&cru DCLK_VOP0>, <&cru DCLK_VOP1>;
        assigned-clock-parents = <&pmucru PLL_HPLL>, <&cru PLL_VPLL>;