public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Francesco Dolcini <francesco@dolcini.it>
To: Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Shawn Guo <shawnguo@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Fabio Estevam <festevam@gmail.com>
Cc: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>,
	devicetree@vger.kernel.org, imx@lists.linux.dev,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Francesco Dolcini <francesco.dolcini@toradex.com>
Subject: [PATCH v2 01/10] arm64: dts: colibri-imx8x: Add usb support
Date: Sun,  1 Sep 2024 17:57:12 +0200	[thread overview]
Message-ID: <20240901155721.7912-2-francesco@dolcini.it> (raw)
In-Reply-To: <20240901155721.7912-1-francesco@dolcini.it>

From: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>

Add USB HOST and OTG support to Colibri-iMX8X carrier boards.

Signed-off-by: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
---
v2: Fix 'id-gpios' property, s/id-gpio/id-gpios/
---
 .../dts/freescale/imx8x-colibri-aster.dtsi    | 26 +++++++++++++
 .../dts/freescale/imx8x-colibri-eval-v3.dtsi  | 26 +++++++++++++
 .../dts/freescale/imx8x-colibri-iris.dtsi     | 26 +++++++++++++
 .../boot/dts/freescale/imx8x-colibri.dtsi     | 37 +++++++++++++++++--
 4 files changed, 111 insertions(+), 4 deletions(-)

diff --git a/arch/arm64/boot/dts/freescale/imx8x-colibri-aster.dtsi b/arch/arm64/boot/dts/freescale/imx8x-colibri-aster.dtsi
index bc659066e19a..c02dfdd75b60 100644
--- a/arch/arm64/boot/dts/freescale/imx8x-colibri-aster.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8x-colibri-aster.dtsi
@@ -7,6 +7,10 @@ &colibri_gpio_keys {
 	status = "okay";
 };
 
+&extcon_usbc_det {
+	status = "okay";
+};
+
 /* Colibri Ethernet */
 &fec1 {
 	status = "okay";
@@ -38,6 +42,28 @@ &lpuart3 {
 	status = "okay";
 };
 
+/* USB PHY for usbotg3 */
+&usb3_phy {
+	status = "okay";
+};
+
+&usbotg1 {
+	status = "okay";
+};
+
+&usbotg3 {
+	status = "okay";
+};
+
+&usbotg3_cdns3 {
+	status = "okay";
+};
+
+/* USB PHY for usbotg1 */
+&usbphy1 {
+	status = "okay";
+};
+
 /* Colibri SDCard */
 &usdhc2 {
 	status = "okay";
diff --git a/arch/arm64/boot/dts/freescale/imx8x-colibri-eval-v3.dtsi b/arch/arm64/boot/dts/freescale/imx8x-colibri-eval-v3.dtsi
index 9af769ab8ceb..91de84772e1c 100644
--- a/arch/arm64/boot/dts/freescale/imx8x-colibri-eval-v3.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8x-colibri-eval-v3.dtsi
@@ -23,6 +23,10 @@ &colibri_gpio_keys {
 	status = "okay";
 };
 
+&extcon_usbc_det {
+	status = "okay";
+};
+
 &i2c1 {
 	status = "okay";
 
@@ -90,6 +94,28 @@ &fec1 {
 	status = "okay";
 };
 
+/* USB PHY for usbotg3 */
+&usb3_phy {
+	status = "okay";
+};
+
+&usbotg1 {
+	status = "okay";
+};
+
+&usbotg3 {
+	status = "okay";
+};
+
+&usbotg3_cdns3 {
+	status = "okay";
+};
+
+/* USB PHY for usbotg1 */
+&usbphy1 {
+	status = "okay";
+};
+
 /* Colibri SD/MMC Card */
 &usdhc2 {
 	status = "okay";
diff --git a/arch/arm64/boot/dts/freescale/imx8x-colibri-iris.dtsi b/arch/arm64/boot/dts/freescale/imx8x-colibri-iris.dtsi
index 8d06925a8ebd..a6b013cc6929 100644
--- a/arch/arm64/boot/dts/freescale/imx8x-colibri-iris.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8x-colibri-iris.dtsi
@@ -21,6 +21,10 @@ &colibri_gpio_keys {
 	status = "okay";
 };
 
+&extcon_usbc_det {
+	status = "okay";
+};
+
 /* Colibri FastEthernet */
 &fec1 {
 	status = "okay";
@@ -108,6 +112,28 @@ &lsio_pwm2 {
 	status = "okay";
 };
 
+/* USB PHY for usbotg3 */
+&usb3_phy {
+	status = "okay";
+};
+
+&usbotg1 {
+	status = "okay";
+};
+
+&usbotg3 {
+	status = "okay";
+};
+
+&usbotg3_cdns3 {
+	status = "okay";
+};
+
+/* USB PHY for usbotg1 */
+&usbphy1 {
+	status = "okay";
+};
+
 /* Colibri SD/MMC Card */
 &usdhc2 {
 	status = "okay";
diff --git a/arch/arm64/boot/dts/freescale/imx8x-colibri.dtsi b/arch/arm64/boot/dts/freescale/imx8x-colibri.dtsi
index 49d105eb4769..56de45fb05e7 100644
--- a/arch/arm64/boot/dts/freescale/imx8x-colibri.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8x-colibri.dtsi
@@ -23,12 +23,31 @@ key-wakeup {
 		};
 	};
 
+	extcon_usbc_det: usbc-det {
+		compatible = "linux,extcon-usb-gpio";
+		pinctrl-names = "default";
+		pinctrl-0 = <&pinctrl_usbc_det>;
+		id-gpios = <&lsio_gpio5 9 GPIO_ACTIVE_HIGH>;
+		status = "disabled";
+	};
+
 	reg_module_3v3: regulator-module-3v3 {
 		compatible = "regulator-fixed";
 		regulator-name = "+V3.3";
 		regulator-min-microvolt = <3300000>;
 		regulator-max-microvolt = <3300000>;
 	};
+
+	reg_usbh_vbus: regulator-usbh-vbus {
+		compatible = "regulator-fixed";
+		pinctrl-names = "default";
+		pinctrl-0 = <&pinctrl_usbh1_reg>;
+		gpio = <&lsio_gpio4 3 GPIO_ACTIVE_LOW>;
+		regulator-always-on;
+		regulator-max-microvolt = <5000000>;
+		regulator-min-microvolt = <5000000>;
+		regulator-name = "usbh_vbus";
+	};
 };
 
 /* TODO Analogue Inputs */
@@ -329,6 +348,20 @@ &lsio_pwm2 {
 
 /* TODO On-module i2s / Audio */
 
+&usbotg1 {
+	adp-disable;
+	disable-over-current;
+	extcon = <&extcon_usbc_det &extcon_usbc_det>;
+	hnp-disable;
+	power-active-high;
+	srp-disable;
+	vbus-supply = <&reg_usbh_vbus>;
+};
+
+&usbotg3_cdns3 {
+	dr_mode = "host";
+};
+
 /* On-module eMMC */
 &usdhc1 {
 	bus-width = <8>;
@@ -356,10 +389,6 @@ &usdhc2 {
 	no-1-8-v;
 };
 
-/* TODO USB Client/Host */
-
-/* TODO USB Host */
-
 /* TODO VPU Encoder/Decoder */
 
 &iomuxc {
-- 
2.39.2



  reply	other threads:[~2024-09-01 16:02 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-01 15:57 [PATCH v2 00/10] arm64: dts: colibri-imx8x: Various improvements and additions Francesco Dolcini
2024-09-01 15:57 ` Francesco Dolcini [this message]
2024-09-01 15:57 ` [PATCH v2 02/10] arm64: dts: colibri-imx8x: Add analog inputs Francesco Dolcini
2024-09-01 15:57 ` [PATCH v2 03/10] arm64: dts: colibri-imx8x: Add fxl6408 gpio expander Francesco Dolcini
2024-09-01 15:57 ` [PATCH v2 04/10] arm64: dts: colibri-imx8x: Add sound card Francesco Dolcini
2024-09-01 15:57 ` [PATCH v2 05/10] arm64: dts: colibri-imx8x: Add PMIC thermal zone Francesco Dolcini
2024-09-01 15:57 ` [PATCH v2 06/10] arm64: dts: colibri-imx8x: Add USB3803 HUB Francesco Dolcini
2024-09-01 15:57 ` [PATCH v2 07/10] arm64: dts: colibri-imx8x: Add vpu support Francesco Dolcini
2024-09-01 15:57 ` [PATCH v2 08/10] arm64: dts: colibri-imx8x: Add adma_pwm Francesco Dolcini
2024-09-01 15:57 ` [PATCH v2 09/10] arm64: dts: colibri-imx8x: Add 50mhz clock for eth Francesco Dolcini
2024-09-01 15:57 ` [PATCH v2 10/10] arm64: dts: colibri-imx8x: Cleanup comments Francesco Dolcini
2024-09-02  1:06 ` [PATCH v2 00/10] arm64: dts: colibri-imx8x: Various improvements and additions Shawn Guo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240901155721.7912-2-francesco@dolcini.it \
    --to=francesco@dolcini.it \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=emanuele.ghidoli@toradex.com \
    --cc=festevam@gmail.com \
    --cc=francesco.dolcini@toradex.com \
    --cc=imx@lists.linux.dev \
    --cc=kernel@pengutronix.de \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox