Skip to contentSkip to conversation

colibri-imx8x: configure module usb hub to bypass mode

PATCH In review Andrejs Cainikovs 3 participants 10 messages Dec 20, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover colibri-imx8x: configure module usb hub to bypass mode

From: Andrejs Cainikovs <[email protected]>

This series:
- Drops -u-boot.dtsi includes in apalis-imx8 and colibri-imx8x device trees. This file is included automatically since quite some time now.
- Configures Toradex Colibri iMX8X SoM USB hub to bypass mode, and brings out of the reset state.

Andrejs Cainikovs (3):
apalis-imx8: remove -u-boot.dtsi include
colibri-imx8x: remove -u-boot.dtsi include
colibri-imx8x: configure usb hub to bypass mode

 arch/arm/dts/fsl-imx8qm-apalis.dts           |  1 -
 arch/arm/dts/fsl-imx8qxp-colibri-u-boot.dtsi | 15 +++++++++++++++
 arch/arm/dts/fsl-imx8qxp-colibri.dts         |  3 ---
 configs/colibri-imx8x_defconfig              |  1 +
 4 files changed, 16 insertions(+), 4 deletions(-)
Signature · 1 line
2.34.1
#1 lore raw

PATCH 1/3 apalis-imx8: remove -u-boot.dtsi include

From: Andrejs Cainikovs <[email protected]>

This file is included automatically since quite some time now.

From documentation:

U-Boot automatically looks for and includes a file with updates to the standard devicetree for your board, searching for them in the same directory as the main file, in this order:

<orig_filename>-u-boot.dtsi
<CONFIG_SYS_SOC>-u-boot.dtsi
<CONFIG_SYS_CPU>-u-boot.dtsi
<CONFIG_SYS_VENDOR>-u-boot.dtsi
u-boot.dtsi

---
 arch/arm/dts/fsl-imx8qm-apalis.dts | 1 -
 1 file changed, 1 deletion(-)
arch/arm/dts/fsl-imx8qm-apalis.dts +0 -1
index bc7c75d3372..e089ddb8468 100644
@@ -9,7 +9,6 @@
 /memreserve/ 0x80000000 0x00020000;
 
 #include "fsl-imx8qm.dtsi"
-#include "fsl-imx8qm-apalis-u-boot.dtsi"
 
 / {
 	model = "Toradex Apalis iMX8";
Signature · 1 line
2.34.1
#2 lore raw

PATCH 2/3 colibri-imx8x: remove -u-boot.dtsi include

In reply to Andrejs Cainikovs

From: Andrejs Cainikovs <[email protected]>

This file is included automatically since quite some time now.

From documentation:

U-Boot automatically looks for and includes a file with updates to the standard devicetree for your board, searching for them in the same directory as the main file, in this order:

<orig_filename>-u-boot.dtsi
<CONFIG_SYS_SOC>-u-boot.dtsi
<CONFIG_SYS_CPU>-u-boot.dtsi
<CONFIG_SYS_VENDOR>-u-boot.dtsi
u-boot.dtsi

---
 arch/arm/dts/fsl-imx8qxp-colibri.dts | 1 -
 1 file changed, 1 deletion(-)
arch/arm/dts/fsl-imx8qxp-colibri.dts +0 -1
index df992ac6396..295090ad711 100644
@@ -6,7 +6,6 @@
 /dts-v1/;
 
 #include "fsl-imx8qxp.dtsi"
-#include "fsl-imx8qxp-colibri-u-boot.dtsi"
 
 / {
 	model = "Toradex Colibri iMX8X";
Signature · 1 line
2.34.1
#3 lore raw

PATCH 3/3 colibri-imx8x: configure usb hub to bypass mode

In reply to Andrejs Cainikovs

From: Andrejs Cainikovs <[email protected]>

This change configures Toradex Colibri iMX8X SoM USB hub to bypass mode, and brings out of the reset state.

---
 arch/arm/dts/fsl-imx8qxp-colibri-u-boot.dtsi | 15 +++++++++++++++
 arch/arm/dts/fsl-imx8qxp-colibri.dts         |  2 --
 configs/colibri-imx8x_defconfig              |  1 +
 3 files changed, 16 insertions(+), 2 deletions(-)
arch/arm/dts/fsl-imx8qxp-colibri-u-boot.dtsi +15 -0
index a6af4e5e2b7..6ab6b1f9ee6 100644
@@ -84,6 +84,21 @@
 	bootph-some-ram;
 };
 
+&gpio_expander_43 {
+	usb-bypass-n-hog {
+		gpio-hog;
+		gpios = <5 GPIO_ACTIVE_LOW>;
+		line-name = "usb-bypass-n";
+		output-high;
+	};
+	usb-reset-n-hog {
+		gpio-hog;
+		gpios = <4 GPIO_ACTIVE_LOW>;
+		line-name = "usb-reset-n";
+		output-low;
+	};
+};
+
 &gpio0 {
 	bootph-some-ram;
 };
arch/arm/dts/fsl-imx8qxp-colibri.dts +0 -2
index 295090ad711..b479921aff9 100644
@@ -319,8 +319,6 @@
 		gpio-controller;
 		#gpio-cells = <2>;
 		reg = <0x43>;
-		initial_io_dir = <0xff>;
-		initial_output = <0x05>;
 	};
 };
 
configs/colibri-imx8x_defconfig +1 -0
index 13c16bde3d8..ce60c509582 100644
@@ -65,6 +65,7 @@ CONFIG_BOOTCOUNT_LIMIT=y
 CONFIG_BOOTCOUNT_ENV=y
 CONFIG_CLK_IMX8=y
 CONFIG_CPU=y
+CONFIG_GPIO_HOG=y
 CONFIG_FXL6408_GPIO=y
 CONFIG_MXC_GPIO=y
 CONFIG_DM_I2C=y
Signature · 1 line
2.34.1
reviewer
#4 lore raw

Re: [PATCH v1 3/3] colibri-imx8x: configure usb hub to bypass mode

Hi Andrejs,

Quoted 12 lines · Andrejs Cainikovs
arch/arm/dts/fsl-imx8qxp-colibri-u-boot.dtsi +4 -0
index a6af4e5e2b7..6ab6b1f9ee6 100644
@@ -84,6 +84,21 @@
        bootph-some-ram;
 };
 
+&gpio_expander_43 {
+       usb-bypass-n-hog {
+               gpio-hog;
+               gpios = <5 GPIO_ACTIVE_LOW>;

arch/arm/dts/fsl-imx8qxp-colibri-u-boot.dtsi line 100

Quoted 10 lines
arch/arm/dts/fsl-imx8qxp-colibri-u-boot.dtsi +10 -0
+               line-name = "usb-bypass-n";
+               output-high;
+       };
+       usb-reset-n-hog {
+               gpio-hog;
+               gpios = <4 GPIO_ACTIVE_LOW>;
+               line-name = "usb-reset-n";
+               output-low;
+       };
+};

Patch looks good from a U-Boot perspective, but just want to understand why the imx8qxp/imx8qm boards
in U-Boot use devicetrees based on downstream NXP instead of the mainline kernel dts?

Shouldn't this 'hub out of reset' be added in mainline Linux first and then just sync the dts in U-Boot?

#5 lore raw

Re: [PATCH v1 3/3] colibri-imx8x: configure usb hub to bypass mode

Hello Fabio,

Quoted 31 lines · Fabio Estevam
Quoted 12 lines · Andrejs Cainikovs
arch/arm/dts/fsl-imx8qxp-colibri-u-boot.dtsi +4 -0
index a6af4e5e2b7..6ab6b1f9ee6 100644
@@ -84,6 +84,21 @@
        bootph-some-ram;
 };
 
+&gpio_expander_43 {
+       usb-bypass-n-hog {
+               gpio-hog;
+               gpios = <5 GPIO_ACTIVE_LOW>;

arch/arm/dts/fsl-imx8qxp-colibri-u-boot.dtsi line 100

Quoted 10 lines
arch/arm/dts/fsl-imx8qxp-colibri-u-boot.dtsi +10 -0
+               line-name = "usb-bypass-n";
+               output-high;
+       };
+       usb-reset-n-hog {
+               gpio-hog;
+               gpios = <4 GPIO_ACTIVE_LOW>;
+               line-name = "usb-reset-n";
+               output-low;
+       };
+};

Patch looks good from a U-Boot perspective, but just want to understand why the imx8qxp/imx8qm boards
in U-Boot use devicetrees based on downstream NXP instead of the mainline kernel dts?

Quoted 2 lines

Shouldn't this 'hub out of reset' be added in mainline Linux first and then just sync the dts in U-Boot?

Valid point.

In general re-using the DTS for the kernel would not work.

The bypass and reset signals are part of the USB HUB node [1], and we would need to add such a driver to U-Boot to be able to properly implement it (despite the recent plans to make SPL a full blown bootloader and U-Boot proper the operating system and kick out Linux I would not go into that direction ;-)

Given that I believe that overriding the Linux DTS to use these 2 signals are simple GPIO HOG for U-Boot is the correct approach.

Francesco

[1] Linux: Documentation/devicetree/bindings/usb/smsc,usb3503.yaml

reviewer
#6 lore raw

Re: [PATCH v1 3/3] colibri-imx8x: configure usb hub to bypass mode

Hi Francesco,

Quoted 4 lines · Francesco Dolcini

Valid point.

In general re-using the DTS for the kernel would not work.

Quoted 8 lines

The bypass and reset signals are part of the USB HUB node [1], and we would need to add such a driver to U-Boot to be able to properly implement it (despite the recent plans to make SPL a full blown bootloader and U-Boot proper the operating system and kick out Linux I would not go into that direction ;-)

Given that I believe that overriding the Linux DTS to use these 2 signals are simple GPIO HOG for U-Boot is the correct approach.

Yes, this series can go as-is.

My main concern is why U-Boot still uses the NXP-based fsl-imx8qxp-mek.dts, fsl-imx8qxp-colibri.dts variant instead of the mainline versions.

The other i.MX SoCs in U-Boot are better synced with the Linux kernel DTs.

I don't have access to i.MX8QXP/i.MX8QM boards to help on this, but for better long-term support it would be nice if someone could sync the U-Boot i.MX8QXP/i.MX8QM DTs with Linux.

#7 lore raw

Re: [PATCH v1 3/3] colibri-imx8x: configure usb hub to bypass mode

Quoted 23 lines · Fabio Estevam

Hi Francesco,

Quoted 4 lines · Francesco Dolcini

Valid point.

In general re-using the DTS for the kernel would not work.

Quoted 8 lines

The bypass and reset signals are part of the USB HUB node [1], and we would need to add such a driver to U-Boot to be able to properly implement it (despite the recent plans to make SPL a full blown bootloader and U-Boot proper the operating system and kick out Linux I would not go into that direction ;-)

Given that I believe that overriding the Linux DTS to use these 2 signals are simple GPIO HOG for U-Boot is the correct approach.

Yes, this series can go as-is.

My main concern is why U-Boot still uses the NXP-based fsl-imx8qxp-mek.dts, fsl-imx8qxp-colibri.dts variant instead of the mainline versions.

Quoted 5 lines

The other i.MX SoCs in U-Boot are better synced with the Linux kernel DTs.

I don't have access to i.MX8QXP/i.MX8QM boards to help on this, but for better long-term support it would be nice if someone could sync the U-Boot i.MX8QXP/i.MX8QM DTs with Linux.

Understood. Yes, this is some real work that someone should take up. Just doing the sync will likely break everything now.

At the moment the situation with i.MX8QXP/i.MX8QM is not as good as i.MX8M* neither in U-Boot nor in Linux :-/

Francesco

reviewer
#8 lore raw

Re: [PATCH v1 3/3] colibri-imx8x: configure usb hub to bypass mode

Quoted 2 lines · Francesco Dolcini

Understood. Yes, this is some real work that someone should take up. Just doing the sync will likely break everything now.

Exactly.

Quoted 2 lines

At the moment the situation with i.MX8QXP/i.MX8QM is not as good as i.MX8M* neither in U-Boot nor in Linux :-/

The NXP folks are on Cc here, so hopefully they could help improving this.

Thanks

reviewer
#9 lore raw
In reply to Andrejs Cainikovs
Quoted 9 lines · Andrejs Cainikovs

From: Andrejs Cainikovs <[email protected]>

This series:
- Drops -u-boot.dtsi includes in apalis-imx8 and colibri-imx8x device trees. This file is included automatically since quite some time now.
- Configures Toradex Colibri iMX8X SoM USB hub to bypass mode, and brings out of the reset state.

Quoted 4 lines

Andrejs Cainikovs (3):
apalis-imx8: remove -u-boot.dtsi include
colibri-imx8x: remove -u-boot.dtsi include
colibri-imx8x: configure usb hub to bypass mode

Applied all to u-boot-imx/next, thanks.