From patchwork Tue Feb 28 17:02:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucas Stach X-Patchwork-Id: 13155096 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C3055C64ED6 for ; Tue, 28 Feb 2023 17:04:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=IEQYl4DpE7NvLzFO4x0lR7LhzDftJdpHGytpjmmcyzM=; b=0s87ESbN1T6CRI QDVtCSFgSpywP3QKbXqJ3Zvf3T5PfN5qp3UVjZsiJDYJoNOv/+VnqqQMQU54X1rztZ6HiSA2AOox7 YLr3jiVU4Nc+0e2LBHLMGTNnlNIaOQTiQzZNMIsZigtEt6fQB6v7Ot3NoQy2k893l3LrO0C5+e2Bq ZI1CyH49P6Ul6wLe/OAPAkDXXZlRZsq2wFGofnJ3kUFL/uNTPcPwoUjxjS0qRcNBQu8t8flUH37e5 XU76yNR+Y7ZAXDXmgthQL5/qLTdNjXFPK6lB0hLSg0OU4gNMDs2jzBImejnjHz8BTNkIeAy5H+QlQ FAVbgUFwJnVM6ZQB1NTw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pX3NY-00DpDL-Sf; Tue, 28 Feb 2023 17:03:04 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pX3NU-00DpCg-Nv for linux-arm-kernel@lists.infradead.org; Tue, 28 Feb 2023 17:03:02 +0000 Received: from dude02.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::28]) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1pX3NI-00089o-DU; Tue, 28 Feb 2023 18:02:48 +0100 From: Lucas Stach To: Shawn Guo Cc: Fabio Estevam , NXP Linux Team , Pengutronix Kernel Team , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, patchwork-lst@pengutronix.de Subject: [PATCH] arm64: dts: imx8mp-debix: add USB host support Date: Tue, 28 Feb 2023 18:02:47 +0100 Message-Id: <20230228170247.910655-1-l.stach@pengutronix.de> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a0a:edc0:0:1101:1d::28 X-SA-Exim-Mail-From: l.stach@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230228_090300_815994_DD7D4FC4 X-CRM114-Status: GOOD ( 13.15 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This adds support for the 4 USB3 host ports on the board, which are connected to the i.MX8MP SoC via a Realtek RTS5411 hub. As the schematic for the board is not available, I could not validate that this really reflects the reality, but I modeled things after the hacked in usage of the GPIOs in the downstream kernel. Signed-off-by: Lucas Stach --- .../dts/freescale/imx8mp-debix-model-a.dts | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/arch/arm64/boot/dts/freescale/imx8mp-debix-model-a.dts b/arch/arm64/boot/dts/freescale/imx8mp-debix-model-a.dts index 2876d18f2a38..94dc089e4550 100644 --- a/arch/arm64/boot/dts/freescale/imx8mp-debix-model-a.dts +++ b/arch/arm64/boot/dts/freescale/imx8mp-debix-model-a.dts @@ -43,6 +43,17 @@ reg_usdhc2_vmmc: regulator-usdhc2 { gpio = <&gpio2 19 GPIO_ACTIVE_HIGH>; enable-active-high; }; + + reg_usb_hub: regulator-usb-hub { + compatible = "regulator-fixed"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_reg_usb_hub>; + regulator-name = "USB_HUB"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + gpio = <&gpio4 26 GPIO_ACTIVE_HIGH>; + enable-active-high; + }; }; &A53_0 { @@ -254,6 +265,39 @@ &uart4 { status = "okay"; }; +&usb3_phy1 { + status = "okay"; +}; + +&usb3_1 { + status = "okay"; +}; + +&usb_dwc3_1 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usb1>; + dr_mode = "host"; + status = "okay"; + + /* 2.x hub on port 1 */ + usb_hub_2_x: hub@1 { + compatible = "usbbda,5411"; + reg = <1>; + reset-gpios = <&gpio4 25 GPIO_ACTIVE_LOW>; + vdd-supply = <®_usb_hub>; + peer-hub = <&usb_hub_3_x>; + }; + + /* 3.x hub on port 2 */ + usb_hub_3_x: hub@2 { + compatible = "usbbda,411"; + reg = <2>; + reset-gpios = <&gpio4 25 GPIO_ACTIVE_LOW>; + vdd-supply = <®_usb_hub>; + peer-hub = <&usb_hub_2_x>; + }; +}; + /* SD Card */ &usdhc2 { pinctrl-names = "default", "state_100mhz", "state_200mhz"; @@ -384,6 +428,12 @@ MX8MP_IOMUXC_SD2_RESET_B__GPIO2_IO19 0x41 >; }; + pinctrl_reg_usb_hub: regusbhubgrp { + fsl,pins = < + MX8MP_IOMUXC_SAI2_TXD0__GPIO4_IO26 0x19 + >; + }; + pinctrl_rtc_int: rtcintgrp { fsl,pins = < MX8MP_IOMUXC_SD1_STROBE__GPIO2_IO11 0x140 @@ -411,6 +461,13 @@ MX8MP_IOMUXC_UART4_TXD__UART4_DCE_TX 0x49 >; }; + pinctrl_usb1: usb1grp { + fsl,pins = < + MX8MP_IOMUXC_GPIO1_IO14__USB2_OTG_PWR 0x10 + MX8MP_IOMUXC_SAI2_TXC__GPIO4_IO25 0x19 + >; + }; + pinctrl_usdhc2: usdhc2grp { fsl,pins = < MX8MP_IOMUXC_SD2_CLK__USDHC2_CLK 0x190