arm64: dts: imx8mn: tqma8mqnl-mba8mx: Add USB DR overlay
authorAlexander Stein <alexander.stein@ew.tq-group.com>
Tue, 20 Feb 2024 16:03:37 +0000 (17:03 +0100)
committerShawn Guo <shawnguo@kernel.org>
Sun, 25 Feb 2024 12:48:21 +0000 (20:48 +0800)
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 <alexander.stein@ew.tq-group.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
arch/arm64/boot/dts/freescale/Makefile
arch/arm64/boot/dts/freescale/imx8mn-tqma8mqnl-mba8mx-usbotg.dtso [new file with mode: 0644]
arch/arm64/boot/dts/freescale/imx8mn-tqma8mqnl-mba8mx.dts
arch/arm64/boot/dts/freescale/mba8mx.dtsi

index 518149d295a1ad52b72fe9e9d52bf4be0ba0ce6b..564d990c89edf0bf2bc6d05161ffd84d9b875e63 100644 (file)
@@ -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 (file)
index 0000000..96db07f
--- /dev/null
@@ -0,0 +1,64 @@
+// SPDX-License-Identifier: (GPL-2.0-or-later OR MIT)
+/*
+ * Copyright (c) 2022-2024 TQ-Systems GmbH <linux@ew.tq-group.com>,
+ * D-82229 Seefeld, Germany.
+ * Author: Alexander Stein
+ */
+
+/dts-v1/;
+/plugin/;
+
+#include <dt-bindings/gpio/gpio.h>
+
+#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 = <MX8MN_IOMUXC_GPIO1_IO10_GPIO1_IO10          0x1c0>;
+       };
+};
index c07d59147ab55956267c2572d4a49b853c1f3990..433d8bba44255e3c87384416a1533d3f15650c9e 100644 (file)
@@ -41,7 +41,7 @@
        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;
 
        pinctrl_usbotg: usbotggrp {
                fsl,pins = <MX8MN_IOMUXC_GPIO1_IO12_USB1_OTG_PWR        0x84>,
-                          <MX8MN_IOMUXC_GPIO1_IO13_USB1_OTG_OC         0x84>,
-                          <MX8MN_IOMUXC_GPIO1_IO10_USB1_OTG_ID         0x1C4>;
+                          <MX8MN_IOMUXC_GPIO1_IO13_USB1_OTG_OC         0x84>;
        };
 
        pinctrl_usdhc2: usdhc2grp {
index c82af672d18343d73cee193476dccab37249fcf1..427467df42bfa66ba5ed7eedd11be752d3820b18 100644 (file)
                        line-name = "BOOT_CFG_OE#";
                };
 
-               rst-usb-hub-hog {
+               rst_usb_hub_hog: rst-usb-hub-hog {
                        gpio-hog;
                        gpios = <13 0>;
                        output-high;