]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
arm64: dts: rockchip: enable usb ports on Qnap-TS433
authorHeiko Stuebner <heiko@sntech.de>
Mon, 28 Oct 2024 19:00:20 +0000 (20:00 +0100)
committerKever Yang <kever.yang@rock-chips.com>
Fri, 8 Nov 2024 09:05:35 +0000 (17:05 +0800)
Enable usb controllers and phys and add regulator infrastructure for the
usb ports on the TS433.

Of course there are no schematics available for the device, so the
regulator information comes from the vendor-devicetree with unknown
accuracy.

Tested-by: Uwe Kleine-König <ukleinek@debian.org>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Link: https://lore.kernel.org/r/20240723195538.1133436-5-heiko@sntech.de
[ upstream commit: d992203f57c5caad0dbd4a9c669d79b315873c81 ]

(cherry picked from commit bb745ef13efb9f6589f9eda8f66664bf263a13f3)
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
dts/upstream/src/arm64/rockchip/rk3568-qnap-ts433.dts

index bc26f2e98c18531cbe8d63fe402d2f25225ce592..da735c4764f4df67fd2a594853ca24b3a959bf9a 100644 (file)
                gpios = <&gpio0 RK_PD4 GPIO_ACTIVE_HIGH>;
                vin-supply = <&dc_12v>;
        };
+
+       vcc5v0_host: regulator-vcc5v0-host {
+               compatible = "regulator-fixed";
+               enable-active-high;
+               pinctrl-names = "default";
+               pinctrl-0 = <&vcc5v0_host_en>;
+               gpio = <&gpio0 RK_PA6 GPIO_ACTIVE_HIGH>;
+               regulator-name = "vcc5v0_host";
+               regulator-always-on;
+               regulator-boot-on;
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+               vin-supply = <&vcc5v0_usb>;
+       };
+
+       vcc5v0_otg: regulator-vcc5v0-otg {
+               compatible = "regulator-fixed";
+               enable-active-high;
+               gpio = <&gpio0 RK_PA5 GPIO_ACTIVE_HIGH>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&vcc5v0_otg_en>;
+               regulator-name = "vcc5v0_otg";
+               regulator-always-on;
+               regulator-boot-on;
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+               vin-supply = <&vcc5v0_usb>;
+       };
+
+       vcc5v0_usb: regulator-vcc5v0-usb {
+               compatible = "regulator-fixed";
+               regulator-name = "vcc5v0_usb";
+               regulator-always-on;
+               regulator-boot-on;
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+               vin-supply = <&dc_12v>;
+       };
+};
+
+/* connected to usb_host0_xhci */
+&combphy0 {
+       status = "okay";
 };
 
 &gmac0 {
        status = "okay";
 };
 
+&pinctrl {
+       usb {
+               vcc5v0_host_en: vcc5v0-host-en {
+                       rockchip,pins = <0 RK_PA6 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+
+               vcc5v0_otg_en: vcc5v0-otg-en {
+                       rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
+};
+
 &sdhci {
        bus-width = <8>;
        max-frequency = <200000000>;
 &uart2 {
        status = "okay";
 };
+
+&usb2phy0 {
+       status = "okay";
+};
+
+/* connected to usb_host0_xhci */
+&usb2phy0_otg {
+       phy-supply = <&vcc5v0_otg>;
+       status = "okay";
+};
+
+&usb2phy1 {
+       status = "okay";
+};
+
+/* connected to usb_host1_ehci/ohci */
+&usb2phy1_host {
+       phy-supply = <&vcc5v0_host>;
+       status = "okay";
+};
+
+/* connected to usb_host0_ehci/ohci */
+&usb2phy1_otg {
+       phy-supply = <&vcc5v0_host>;
+       status = "okay";
+};
+
+/* right port backside */
+&usb_host0_ehci {
+       status = "okay";
+};
+
+&usb_host0_ohci {
+       status = "okay";
+};
+
+/* front port */
+&usb_host0_xhci {
+       dr_mode = "host";
+       status = "okay";
+};
+
+/* left port backside */
+&usb_host1_ehci {
+       status = "okay";
+};
+
+&usb_host1_ohci {
+       status = "okay";
+};