Skip to contentSkip to conversation

apalis-imx8: add USBH_EN gpio hog

PATCH Applied Andrejs Cainikovs 2 participants 3 messages Oct 20, 2023 – Dec 12, 2023

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

PATCH 1/1 apalis-imx8: add USBH_EN gpio hog

From: Andrejs Cainikovs <[email protected]>

USB host interface is not working on some Apalis Toradex carrier boards with Apalis iMX8 SoM. This is due to USBH_EN pin, which powers USB peripherals, having a strong pull-down on some boards, and a weak pull-down on the others. This USBH_EN pin is left unconfigured, which means it is in its default state at cold boot:
input with a strong pull-up. As a result, carrier boards with a weak pull-down have this signal high enough to trigger power delivery to USB peripherals, and opposite - boards with strong pull-down on USBH_EN have this signal below the threshold needed to trigger USB power delivery.
This change configures the USBH_EN pin as gpio hog, fixing this issue for all Apalis carrier boards regardless of pull-down resistor value.

Also, update apalis-imx8_defconfig via savedefconfig.

---
 arch/arm/dts/fsl-imx8qm-apalis-u-boot.dtsi | 6 ++++++
 configs/apalis-imx8_defconfig              | 3 ++-
 2 files changed, 8 insertions(+), 1 deletion(-)
arch/arm/dts/fsl-imx8qm-apalis-u-boot.dtsi +6 -0
index f2d6b183ed9..c54a59e89c5 100644
@@ -93,6 +93,12 @@
 
 &gpio4 {
 	bootph-some-ram;
+
+	usbh_en {
+		gpio-hog;
+		gpios = <4 GPIO_ACTIVE_HIGH>;
+		output-high;
+	};
 };
 
 &gpio5 {
configs/apalis-imx8_defconfig +2 -1
index b726ee351fa..340645bdded 100644
@@ -21,9 +21,9 @@ CONFIG_SYS_MEMTEST_END=0x89000000
 CONFIG_REMAKE_ELF=y
 CONFIG_FIT=y
 CONFIG_FIT_VERBOSE=y
-CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_BOOTDELAY=1
+CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_USE_PREBOOT=y
 CONFIG_PREBOOT="test -n ${fdtfile} || setenv fdtfile ${soc}-apalis${variant}-${fdt_board}.dtb"
 CONFIG_LOG=y
@@ -65,6 +65,7 @@ CONFIG_BOOTCOUNT_LIMIT=y
 CONFIG_BOOTCOUNT_ENV=y
 CONFIG_CLK_IMX8=y
 CONFIG_CPU=y
+CONFIG_GPIO_HOG=y
 CONFIG_MXC_GPIO=y
 CONFIG_DM_I2C=y
 CONFIG_SYS_I2C_IMX_LPI2C=y
Signature · 1 line
2.34.1
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 17 lines · Andrejs Cainikovs

From: Andrejs Cainikovs <[email protected]>

USB host interface is not working on some Apalis Toradex carrier boards with Apalis iMX8 SoM. This is due to USBH_EN pin, which powers USB peripherals, having a strong pull-down on some boards, and a weak pull-down on the others. This USBH_EN pin is left unconfigured, which means it is in its default state at cold boot:
input with a strong pull-up. As a result, carrier boards with a weak pull-down have this signal high enough to trigger power delivery to USB peripherals, and opposite - boards with strong pull-down on USBH_EN have this signal below the threshold needed to trigger USB power delivery.
This change configures the USBH_EN pin as gpio hog, fixing this issue for all Apalis carrier boards regardless of pull-down resistor value.

Quoted 3 lines

Also, update apalis-imx8_defconfig via savedefconfig.

reviewer Applied
#2 lore raw
In reply to Andrejs Cainikovs
Quoted 17 lines · Andrejs Cainikovs

From: Andrejs Cainikovs <[email protected]>

USB host interface is not working on some Apalis Toradex carrier boards with Apalis iMX8 SoM. This is due to USBH_EN pin, which powers USB peripherals, having a strong pull-down on some boards, and a weak pull-down on the others. This USBH_EN pin is left unconfigured, which means it is in its default state at cold boot:
input with a strong pull-up. As a result, carrier boards with a weak pull-down have this signal high enough to trigger power delivery to USB peripherals, and opposite - boards with strong pull-down on USBH_EN have this signal below the threshold needed to trigger USB power delivery.
This change configures the USBH_EN pin as gpio hog, fixing this issue for all Apalis carrier boards regardless of pull-down resistor value.

Quoted 3 lines

Also, update apalis-imx8_defconfig via savedefconfig.

Applied, thanks.