]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
imx: ventana: fix USB hub reset
authorTim Harvey <tharvey@gateworks.com>
Wed, 29 Sep 2021 22:04:22 +0000 (15:04 -0700)
committerStefano Babic <sbabic@denx.de>
Thu, 7 Oct 2021 14:53:50 +0000 (16:53 +0200)
Remove board_ehci_hcd_init function that is not used with DM_USB
and replace its functionality with device-tree configuraton that treats
USB HUB RST# as a gpio enable for the usbh1 vbus regulator.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
arch/arm/dts/imx6qdl-gw53xx.dtsi
arch/arm/dts/imx6qdl-gw54xx.dtsi
arch/arm/dts/imx6qdl-gw552x.dtsi
arch/arm/dts/imx6qdl-gw560x.dtsi
arch/arm/dts/imx6qdl-gw5904.dtsi
arch/arm/dts/imx6qdl-gw5912.dtsi
board/gateworks/gw_ventana/gw_ventana.c

index 904b2283063187469c7c389f066fb62163de85f4..77ac103c2d9f494945a4582348e75a5c7f504453 100644 (file)
                regulator-name = "usb_h1_vbus";
                regulator-min-microvolt = <5000000>;
                regulator-max-microvolt = <5000000>;
-               regulator-always-on;
+               gpio = <&gpio1 9 GPIO_ACTIVE_HIGH>;
+               enable-active-high;
        };
 
        reg_usb_otg_vbus: regulator-usb-otg-vbus {
 
 &usbh1 {
        vbus-supply = <&reg_usb_h1_vbus>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_usbh1>;
        status = "okay";
 };
 
                >;
        };
 
+       pinctrl_usbh1: usbh1grp {
+               fsl,pins = <
+                       MX6QDL_PAD_GPIO_9__GPIO1_IO09           0x1b0b0
+               >;
+       };
+
        pinctrl_usbotg: usbotggrp {
                fsl,pins = <
                        MX6QDL_PAD_GPIO_1__USB_OTG_ID           0x17059
index ffed4fb550be9e130c2c100263db5f4d8c64ddc1..98c81e9c9b5bc27a110c4a703d57df67fd70adcf 100644 (file)
                        regulator-name = "usb_h1_vbus";
                        regulator-min-microvolt = <5000000>;
                        regulator-max-microvolt = <5000000>;
-                       regulator-always-on;
+                       gpio = <&gpio1 16 GPIO_ACTIVE_HIGH>;
+                       enable-active-high;
                };
 
                reg_usb_otg_vbus: regulator@3 {
 
 &usbh1 {
        vbus-supply = <&reg_usb_h1_vbus>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_usbh1>;
        status = "okay";
 };
 
                >;
        };
 
+       pinctrl_usbh1: usbh1grp {
+               fsl,pins = <
+                       MX6QDL_PAD_SD1_DAT0__GPIO1_IO16         0x1b0b0
+               >;
+       };
+
        pinctrl_usbotg: usbotggrp {
                fsl,pins = <
                        MX6QDL_PAD_GPIO_1__USB_OTG_ID           0x17059
index f6742e513152ac361c275f346a7b12821e1a3b34..b853399aec672ed6f8c183c9144de26ecbf167b6 100644 (file)
                regulator-min-microvolt = <5000000>;
                regulator-max-microvolt = <5000000>;
        };
+
+       reg_usb_h1_vbus: regulator-usbh1-vbus {
+               compatible = "regulator-fixed";
+               regulator-name = "usb_h1_vbus";
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+               gpio = <&gpio1 9 GPIO_ACTIVE_HIGH>;
+               enable-active-high;
+       };
 };
 
 &gpmi {
 &uart5 {
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_uart5>;
-       status = "okay"; };
+       status = "okay";
+};
 
 &usbh1 {
+       vbus-supply = <&reg_usb_h1_vbus>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_usbh1>;
        status = "okay";
 };
 
                >;
        };
 
+       pinctrl_usbh1: usbh1grp {
+               fsl,pins = <
+                       MX6QDL_PAD_GPIO_9__GPIO1_IO09           0x1b0b0
+               >;
+       };
+
        pinctrl_usbotg: usbotggrp {
                fsl,pins = <
                        MX6QDL_PAD_ENET_RX_ER__USB_OTG_ID       0x13059
index 5da19756e031e6933a9ec790f2357a5d95455f18..1e95267c974ff3117836bc98f11b244cfc53b161 100644 (file)
                regulator-name = "usb_h1_vbus";
                regulator-min-microvolt = <5000000>;
                regulator-max-microvolt = <5000000>;
-               regulator-always-on;
+               gpio = <&gpio1 9 GPIO_ACTIVE_HIGH>;
+               enable-active-high;
        };
 
        reg_usb_otg_vbus: regulator-usb-otg-vbus {
index b5ed2d83c17c609d5921a48d10fbcc83990be0c0..286c7a9924c2df5ee2bfe07cde44fead4d2f8802 100644 (file)
                regulator-name = "usb_h1_vbus";
                regulator-min-microvolt = <5000000>;
                regulator-max-microvolt = <5000000>;
-               regulator-always-on;
+               gpio = <&gpio1 9 GPIO_ACTIVE_HIGH>;
+               enable-active-high;
        };
 
        reg_usb_otg_vbus: regulator-usb-otg-vbus {
 
 &usbh1 {
        vbus-supply = <&reg_usb_h1_vbus>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_usbotg>;
        status = "okay";
 };
 
                >;
        };
 
+       pinctrl_usbh1: usbh1grp {
+               fsl,pins = <
+                       MX6QDL_PAD_GPIO_9__GPIO1_IO09           0x1b0b0
+               >;
+       };
+
        pinctrl_usbotg: usbotggrp {
                fsl,pins = <
                        MX6QDL_PAD_GPIO_1__USB_OTG_ID           0x17059
index 2537288627d86f5a377a6ab58cbdc0cb17b171ff..8fd8fdb5147c94d6aa7ef44762007125327c497b 100644 (file)
                regulator-name = "usb_vbus";
                regulator-min-microvolt = <5000000>;
                regulator-max-microvolt = <5000000>;
-               regulator-always-on;
+               gpio = <&gpio4 5 GPIO_ACTIVE_HIGH>;
+               enable-active-high;
        };
 };
 
 
 &usbh1 {
        vbus-supply = <&reg_usb_vbus>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_usbh1>;
        status = "okay";
 };
 
                >;
        };
 
+       pinctrl_usbh1: usbh1grp {
+               fsl,pins = <
+                       MX6QDL_PAD_GPIO_19__GPIO4_IO05          0x1b0b0
+               >;
+       };
+
        pinctrl_usbotg: usbotggrp {
                fsl,pins = <
                        MX6QDL_PAD_GPIO_1__USB_OTG_ID           0x13059
index 1c82bd5067b88e04f5e1dd7a3be0217caa0dc91d..8cf791467024ea4698a6c5c9c9b5b7bf87a53d9f 100644 (file)
@@ -39,41 +39,6 @@ DECLARE_GLOBAL_DATA_PTR;
 struct ventana_board_info ventana_info;
 static int board_type;
 
-#ifdef CONFIG_USB_EHCI_MX6
-/* toggle USB_HUB_RST# for boards that have it; it is not defined in dt */
-int board_ehci_hcd_init(int port)
-{
-       int gpio;
-
-       /* USB HUB is always on P1 */
-       if (port == 0)
-               return 0;
-
-       /* Reset USB HUB */
-       switch (board_type) {
-       case GW53xx:
-       case GW552x:
-       case GW5906:
-               gpio = (IMX_GPIO_NR(1, 9));
-               break;
-       case GW54proto:
-       case GW54xx:
-               gpio = (IMX_GPIO_NR(1, 16));
-               break;
-       default:
-               return 0;
-       }
-
-       /* request and toggle hub rst */
-       gpio_request(gpio, "usb_hub_rst#");
-       gpio_direction_output(gpio, 0);
-       mdelay(2);
-       gpio_set_value(gpio, 1);
-
-       return 0;
-}
-#endif /* CONFIG_USB_EHCI_MX6 */
-
 /* configure eth0 PHY board-specific LED behavior */
 int board_phy_config(struct phy_device *phydev)
 {