* [PATCH] arm64: dts: imx8mp-debix: add USB host support
@ 2023-02-28 17:02 Lucas Stach
2023-03-14 3:23 ` Shawn Guo
2023-03-14 7:46 ` Shawn Guo
0 siblings, 2 replies; 3+ messages in thread
From: Lucas Stach @ 2023-02-28 17:02 UTC (permalink / raw)
To: Shawn Guo
Cc: Fabio Estevam, NXP Linux Team, Pengutronix Kernel Team,
devicetree, linux-arm-kernel, patchwork-lst
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 <l.stach@pengutronix.de>
---
.../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
--
2.30.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] arm64: dts: imx8mp-debix: add USB host support
2023-02-28 17:02 [PATCH] arm64: dts: imx8mp-debix: add USB host support Lucas Stach
@ 2023-03-14 3:23 ` Shawn Guo
2023-03-14 7:46 ` Shawn Guo
1 sibling, 0 replies; 3+ messages in thread
From: Shawn Guo @ 2023-03-14 3:23 UTC (permalink / raw)
To: Lucas Stach
Cc: Fabio Estevam, NXP Linux Team, Pengutronix Kernel Team,
devicetree, linux-arm-kernel, patchwork-lst
On Tue, Feb 28, 2023 at 06:02:47PM +0100, Lucas Stach wrote:
> 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 <l.stach@pengutronix.de>
Applied, thanks!
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] arm64: dts: imx8mp-debix: add USB host support
2023-02-28 17:02 [PATCH] arm64: dts: imx8mp-debix: add USB host support Lucas Stach
2023-03-14 3:23 ` Shawn Guo
@ 2023-03-14 7:46 ` Shawn Guo
1 sibling, 0 replies; 3+ messages in thread
From: Shawn Guo @ 2023-03-14 7:46 UTC (permalink / raw)
To: Lucas Stach
Cc: Fabio Estevam, NXP Linux Team, Pengutronix Kernel Team,
devicetree, linux-arm-kernel, patchwork-lst
On Tue, Feb 28, 2023 at 06:02:47PM +0100, Lucas Stach wrote:
> 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 <l.stach@pengutronix.de>
> ---
> .../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";
I had to fix it up by adding
#address-cells = <1>;
#size-cells = <0>;
Otherwise, DTC emits reg_format warnings.
/soc@0/usb@32f10108/usb@38200000/hub@1:reg: property has invalid length (4 bytes) (#address-cells == 2, #size-cells == 1)
/soc@0/usb@32f10108/usb@38200000/hub@2:reg: property has invalid length (4 bytes) (#address-cells == 2, #size-cells == 1)
Shawn
> +
> + /* 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
> --
> 2.30.2
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-03-14 7:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-28 17:02 [PATCH] arm64: dts: imx8mp-debix: add USB host support Lucas Stach
2023-03-14 3:23 ` Shawn Guo
2023-03-14 7:46 ` Shawn Guo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).