From patchwork Wed Sep 29 22:04:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Harvey X-Patchwork-Id: 1534563 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HKVnV3Ffkz9t1C for ; Thu, 30 Sep 2021 08:06:06 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A2BD580FA0; Thu, 30 Sep 2021 00:06:01 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=gateworks.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 27C9980D28; Thu, 30 Sep 2021 00:04:49 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from finn.localdomain (finn.gateworks.com [108.161.129.64]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id A23BD81194 for ; Thu, 30 Sep 2021 00:04:29 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=gateworks.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=tharvey@gateworks.com Received: from 068-189-091-139.biz.spectrum.com ([68.189.91.139] helo=tharvey.pdc.gateworks.com) by finn.localdomain with esmtp (Exim 4.93) (envelope-from ) id 1mVhgh-0070bJ-M7; Wed, 29 Sep 2021 22:04:27 +0000 From: Tim Harvey To: u-boot@lists.denx.de, Stefano Babic , Fabio Estevam , "NXP i . MX U-Boot Team" Cc: Tim Harvey Subject: [PATCH 7/7] imx: ventana: fix USB hub reset Date: Wed, 29 Sep 2021 15:04:22 -0700 Message-Id: <20210929220422.13661-7-tharvey@gateworks.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210929220422.13661-1-tharvey@gateworks.com> References: <20210929220422.13661-1-tharvey@gateworks.com> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean 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 --- arch/arm/dts/imx6qdl-gw53xx.dtsi | 11 +++++++- arch/arm/dts/imx6qdl-gw54xx.dtsi | 11 +++++++- arch/arm/dts/imx6qdl-gw552x.dtsi | 21 ++++++++++++++- arch/arm/dts/imx6qdl-gw560x.dtsi | 3 ++- arch/arm/dts/imx6qdl-gw5904.dtsi | 11 +++++++- arch/arm/dts/imx6qdl-gw5912.dtsi | 11 +++++++- board/gateworks/gw_ventana/gw_ventana.c | 35 ------------------------- 7 files changed, 62 insertions(+), 41 deletions(-) diff --git a/arch/arm/dts/imx6qdl-gw53xx.dtsi b/arch/arm/dts/imx6qdl-gw53xx.dtsi index 904b228306..77ac103c2d 100644 --- a/arch/arm/dts/imx6qdl-gw53xx.dtsi +++ b/arch/arm/dts/imx6qdl-gw53xx.dtsi @@ -137,7 +137,8 @@ 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 { @@ -550,6 +551,8 @@ &usbh1 { vbus-supply = <®_usb_h1_vbus>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usbh1>; status = "okay"; }; @@ -720,6 +723,12 @@ >; }; + 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 diff --git a/arch/arm/dts/imx6qdl-gw54xx.dtsi b/arch/arm/dts/imx6qdl-gw54xx.dtsi index ffed4fb550..98c81e9c9b 100644 --- a/arch/arm/dts/imx6qdl-gw54xx.dtsi +++ b/arch/arm/dts/imx6qdl-gw54xx.dtsi @@ -146,7 +146,8 @@ 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 { @@ -620,6 +621,8 @@ &usbh1 { vbus-supply = <®_usb_h1_vbus>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usbh1>; status = "okay"; }; @@ -815,6 +818,12 @@ >; }; + 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 diff --git a/arch/arm/dts/imx6qdl-gw552x.dtsi b/arch/arm/dts/imx6qdl-gw552x.dtsi index f6742e5131..b853399aec 100644 --- a/arch/arm/dts/imx6qdl-gw552x.dtsi +++ b/arch/arm/dts/imx6qdl-gw552x.dtsi @@ -121,6 +121,15 @@ 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 { @@ -390,9 +399,13 @@ &uart5 { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_uart5>; - status = "okay"; }; + status = "okay"; +}; &usbh1 { + vbus-supply = <®_usb_h1_vbus>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usbh1>; status = "okay"; }; @@ -507,6 +520,12 @@ >; }; + 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 diff --git a/arch/arm/dts/imx6qdl-gw560x.dtsi b/arch/arm/dts/imx6qdl-gw560x.dtsi index 5da19756e0..1e95267c97 100644 --- a/arch/arm/dts/imx6qdl-gw560x.dtsi +++ b/arch/arm/dts/imx6qdl-gw560x.dtsi @@ -221,7 +221,8 @@ 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 { diff --git a/arch/arm/dts/imx6qdl-gw5904.dtsi b/arch/arm/dts/imx6qdl-gw5904.dtsi index b5ed2d83c1..286c7a9924 100644 --- a/arch/arm/dts/imx6qdl-gw5904.dtsi +++ b/arch/arm/dts/imx6qdl-gw5904.dtsi @@ -176,7 +176,8 @@ 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 { @@ -593,6 +594,8 @@ &usbh1 { vbus-supply = <®_usb_h1_vbus>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usbotg>; status = "okay"; }; @@ -753,6 +756,12 @@ >; }; + 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 diff --git a/arch/arm/dts/imx6qdl-gw5912.dtsi b/arch/arm/dts/imx6qdl-gw5912.dtsi index 2537288627..8fd8fdb514 100644 --- a/arch/arm/dts/imx6qdl-gw5912.dtsi +++ b/arch/arm/dts/imx6qdl-gw5912.dtsi @@ -120,7 +120,8 @@ regulator-name = "usb_vbus"; regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; - regulator-always-on; + gpio = <&gpio4 5 GPIO_ACTIVE_HIGH>; + enable-active-high; }; }; @@ -380,6 +381,8 @@ &usbh1 { vbus-supply = <®_usb_vbus>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usbh1>; status = "okay"; }; @@ -560,6 +563,12 @@ >; }; + 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 diff --git a/board/gateworks/gw_ventana/gw_ventana.c b/board/gateworks/gw_ventana/gw_ventana.c index 1c82bd5067..8cf7914670 100644 --- a/board/gateworks/gw_ventana/gw_ventana.c +++ b/board/gateworks/gw_ventana/gw_ventana.c @@ -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) {