From patchwork Tue Feb 20 16:03:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Stein X-Patchwork-Id: 13564205 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 37006C5475B for ; Tue, 20 Feb 2024 16:04:07 +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=jaj7NnBMBzCrU9qK/xSnswvrZukjQmkBmCoFQmFyGWc=; b=vC11W5m4UW8OdM Yff22QQHGyL30veR+JK61SgAV5vRUYVX6xTNPUWhNCcwMYSVyZvsAx7Wsu1Nl3BKF9hUfCIvV4rdJ CKnn+IK95S6sso2waX4vXMyOIbwxPkem+hjD2yS7dvcWIQKEgh0WXnInI1vyVkRmyIompZHo8SVtQ pmS2y7j1+mbPbEAhKDy68ccnXzpEL4Sgg6XW3lRu4eK6qKDMFeIWcC5RF5ZhbABtrVECPuAuyCncn FRbpdLPnCZS0tT7f2UIjOOiyjsczUkBJgWqVtXIaXtLk5wAgp96yTjK+4c6d7obXLo3RWqQhT2EtR Db4dN8DQKUbfO9YwIzhQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rcSay-0000000FM7H-3WJB; Tue, 20 Feb 2024 16:03:48 +0000 Received: from mx1.tq-group.com ([93.104.207.81]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rcSav-0000000FM65-2FY6 for linux-arm-kernel@lists.infradead.org; Tue, 20 Feb 2024 16:03:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1708445025; x=1739981025; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=+mjv86uyuqBFCZgF8ms0aaYPzTllCKKiHhNHhZt8xds=; b=RQmmqRTPEP/BZK4aewfTt6GgxAWg1s+R+q+2bfB0tWXKHogu1+uWpyzQ sWOzhikKaOq3BiDcGs9+umD5b/1a8sjPV6ayZqKKrS4fc8iqWnY00tfkp eUV/6SH8vyhnWlzWonSPMso0n1mdDWlaw2nlKOLuucisWK7p+n3KwNyjY sr3A1ShqpqzfzjESuD4N6tux9L6OOa/BbCYoN0UMuAOOuYP3DhV8vcWPk 5ocIyTkCJDlu21y5JP+Lom0RLWj0wFzNn0VBC69Tdi+JK8TkudhkJ+5A3 5BIsuTNHJsdwEdXZf992yGquByTU1fQd1gVWG7Egmadc5jIaTHRp7a/rf g==; X-IronPort-AV: E=Sophos;i="6.06,174,1705359600"; d="scan'208";a="35504561" Received: from vmailcow01.tq-net.de ([10.150.86.48]) by mx1.tq-group.com with ESMTP; 20 Feb 2024 17:03:43 +0100 Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id E998816F4F8; Tue, 20 Feb 2024 17:03:38 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ew.tq-group.com; s=dkim; t=1708445019; h=from:subject:date:message-id:to:cc:mime-version: content-transfer-encoding; bh=+mjv86uyuqBFCZgF8ms0aaYPzTllCKKiHhNHhZt8xds=; b=Ed8r3oaW0WVfQ477GjZo9iNg2t7xPT9lRzfLUuNhfEmFZfuCGw8/y080lDidmWFp7b5Jpd WjagkbUSCrv8Ib7qkcwiZPDHcw+UNYCjhMEWjigkMcknV3VdqdRF5pqwchXSkbK9HA/8vJ kXDx+cxn/4rcGRrUMdXmzoZSLlu5QJ24R/4ga6sh1GVQ7nApOgUkuSGEZTLP0ED2luQ0dn 25XH3u8URJy0M8IhrLFsGm3a+lClItrS6c+8H/5XiuzjCP2Fnq6vqOOS4lmJCMm41VEEkE rA7FhWL+mdP32LYZpT3Fl96V8ZG1w7MBUCy1Ok4XghzbQwOvpvxFf992MoR4/Q== From: Alexander Stein To: Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Alexander Stein , NXP Linux Team , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux@ew.tq-group.com Subject: [PATCH 1/1] arm64: dts: imx8mn: tqma8mqnl-mba8mx: Add USB DR overlay Date: Tue, 20 Feb 2024 17:03:37 +0100 Message-Id: <20240220160338.2683715-1-alexander.stein@ew.tq-group.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Last-TLS-Session-Version: TLSv1.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240220_080346_433290_37FE83AE X-CRM114-Status: GOOD ( 14.66 ) 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 imx8mn has only one USB interface. The platform supports using as USB host (default), or switch to USB DR using this overlay. Signed-off-by: Alexander Stein --- arch/arm64/boot/dts/freescale/Makefile | 2 + .../imx8mn-tqma8mqnl-mba8mx-usbotg.dtso | 64 +++++++++++++++++++ .../dts/freescale/imx8mn-tqma8mqnl-mba8mx.dts | 5 +- arch/arm64/boot/dts/freescale/mba8mx.dtsi | 2 +- 4 files changed, 69 insertions(+), 4 deletions(-) create mode 100644 arch/arm64/boot/dts/freescale/imx8mn-tqma8mqnl-mba8mx-usbotg.dtso diff --git a/arch/arm64/boot/dts/freescale/Makefile b/arch/arm64/boot/dts/freescale/Makefile index fa0ed4f0c9b71..7c2410bad5bac 100644 --- a/arch/arm64/boot/dts/freescale/Makefile +++ b/arch/arm64/boot/dts/freescale/Makefile @@ -134,7 +134,9 @@ dtb-$(CONFIG_ARCH_MXC) += imx8mn-var-som-symphony.dtb dtb-$(CONFIG_ARCH_MXC) += imx8mn-venice-gw7902.dtb imx8mn-tqma8mqnl-mba8mx-lvds-tm070jvhg33-dtbs += imx8mn-tqma8mqnl-mba8mx.dtb imx8mn-tqma8mqnl-mba8mx-lvds-tm070jvhg33.dtbo +imx8mn-tqma8mqnl-mba8mx-usbotg-dtbs += imx8mn-tqma8mqnl-mba8mx.dtb imx8mn-tqma8mqnl-mba8mx-usbotg.dtbo dtb-$(CONFIG_ARCH_MXC) += imx8mn-tqma8mqnl-mba8mx-lvds-tm070jvhg33.dtb +dtb-$(CONFIG_ARCH_MXC) += imx8mn-tqma8mqnl-mba8mx-usbotg.dtb dtb-$(CONFIG_ARCH_MXC) += imx8mp-beacon-kit.dtb dtb-$(CONFIG_ARCH_MXC) += imx8mp-data-modul-edm-sbc.dtb diff --git a/arch/arm64/boot/dts/freescale/imx8mn-tqma8mqnl-mba8mx-usbotg.dtso b/arch/arm64/boot/dts/freescale/imx8mn-tqma8mqnl-mba8mx-usbotg.dtso new file mode 100644 index 0000000000000..96db07fc9bece --- /dev/null +++ b/arch/arm64/boot/dts/freescale/imx8mn-tqma8mqnl-mba8mx-usbotg.dtso @@ -0,0 +1,64 @@ +// SPDX-License-Identifier: (GPL-2.0-or-later OR MIT) +/* + * Copyright (c) 2022-2024 TQ-Systems GmbH , + * D-82229 Seefeld, Germany. + * Author: Alexander Stein + */ + +/dts-v1/; +/plugin/; + +#include + +#include "imx8mn-pinfunc.h" + +&{/} { + connector { + compatible = "gpio-usb-b-connector", "usb-b-connector"; + type = "micro"; + label = "X19"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usb1_connector>; + id-gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>; + + port { + usb_dr_connector: endpoint { + remote-endpoint = <&usb1_drd_sw>; + }; + }; + }; +}; + +&rst_usb_hub_hog { + output-low; +}; + +&sel_usb_hub_hog { + output-low; +}; + +&usbotg1 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usbotg>; + dr_mode = "otg"; + srp-disable; + hnp-disable; + adp-disable; + power-active-high; + /delete-property/ disable-over-current; + over-current-active-low; + usb-role-switch; + status = "okay"; + + port { + usb1_drd_sw: endpoint { + remote-endpoint = <&usb_dr_connector>; + }; + }; +}; + +&iomuxc { + pinctrl_usb1_connector: usb1-connectorgrp { + fsl,pins = ; + }; +}; diff --git a/arch/arm64/boot/dts/freescale/imx8mn-tqma8mqnl-mba8mx.dts b/arch/arm64/boot/dts/freescale/imx8mn-tqma8mqnl-mba8mx.dts index 5b682dd907578..ca388705ec396 100644 --- a/arch/arm64/boot/dts/freescale/imx8mn-tqma8mqnl-mba8mx.dts +++ b/arch/arm64/boot/dts/freescale/imx8mn-tqma8mqnl-mba8mx.dts @@ -41,7 +41,7 @@ &gpio2 { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usb0hub_sel>; - sel-usb-hub-hog { + sel_usb_hub_hog: sel-usb-hub-hog { gpio-hog; gpios = <1 GPIO_ACTIVE_HIGH>; output-high; @@ -202,8 +202,7 @@ pinctrl_usb0hub_sel: usb0hub-selgrp { pinctrl_usbotg: usbotggrp { fsl,pins = , - , - ; + ; }; pinctrl_usdhc2: usdhc2grp { diff --git a/arch/arm64/boot/dts/freescale/mba8mx.dtsi b/arch/arm64/boot/dts/freescale/mba8mx.dtsi index c82af672d1834..427467df42bfa 100644 --- a/arch/arm64/boot/dts/freescale/mba8mx.dtsi +++ b/arch/arm64/boot/dts/freescale/mba8mx.dtsi @@ -219,7 +219,7 @@ boot-cfg-oe-hog { line-name = "BOOT_CFG_OE#"; }; - rst-usb-hub-hog { + rst_usb_hub_hog: rst-usb-hub-hog { gpio-hog; gpios = <13 0>; output-high;