Enable USB as host in imx7d module

Hi,

How can i enable USB host on imx7D module. How to configure soc pin 129 as gpio ??

I’m not able to export gpio103 , which is use for USB_POWER OR can you tell me how to set gpio103 value as 1(high) as default value from dtb or etc…

please help me on this.

Regards,
Nikunj

USB host enabled on iMX7 module by default. You can’t export gpio 103 because it used by USB driver.

Hi Alex,

Please check attached schematic of our custom board USB connection where we used the 103 pin for USB host enable. but still we can’t access USB host on our custom board so please help us to required changes in dtb or driver files to enable USB host support.

Thanks & Best Regards,

Nikunj Patel

link text

SODIMM pin 129 aka GPIO 103 being USB_HPEN won’t help you any. SODIMM pin 137 aka GPIO 206 being USBC_DET is used to determine USB device vs. host functionality.

Hi marcel,
Thanks for your reply.

SODIMM PIN 137 [GPIO206] does not connect in our board. so is there any other-way to stop the USB detection for device and host mode. we always used the USB as HOST.

Thanks & Best Regards;
Nikunj Patel

hi @nikunjp26

You can use whatever pin you like for the usb host/device detection or you can hardcode the host mode in the device tree.

extcon_usbc_det: usbc_det {
		compatible = "linux,extcon-usb-gpio";
		debounce = <25>;
		id-gpio = <&gpio7 14 GPIO_ACTIVE_HIGH>;
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_usbc_det>;
	};

Hi jaski,

In USB host, we are using the (XRP2523ISTR-F-SOT23-5) IC on our custom board which have active high Logic where Eval board have IC which is working on active low Functionality,

On Evalboard USB is working fine but on our board does not work so can you please guide us for what software changes we required to working on our board.

Please check below dts configuration for USB which we are using now.

link text

Best regards,
Nikunj

hi @jaski.tx , any update on this issue?

Did you hardcode the USB host detection? If not, which Pin are you using for the host detection?

You can look for the following node in the imx7-colibri-eval-v3.dtsi and set the gpio to GPIO_ACTIVE_HIGH instead of GPIO_ACTIVE_LOW.

reg_usbh_vbus: regulator-usbh-vbus {
		compatible = "regulator-fixed";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_usbh_reg>;
		regulator-name = "VCC_USB[1-4]";
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;
		gpio = <&gpio4 7 GPIO_ACTIVE_LOW>;
		vin-supply = <&reg_5v0>;
	};

You will also need an enable-active-high node just like e.g. found on Apalis iMX6.

Hi @marcel.tx ,

After setting the regulator-usbh-vbus node in the imx7-colibri-eval-v3.dtsi and set the gpio to GPIO_ACTIVE_HIGH and set the property enable-active-high ,
USB is detected and working OK.

Thank you for support.

Thanks and Regards,
Nikunj

You are very welcome.