USB_H_OC/USB_H_PWR_EN pin assign for Colibri iMX6

Hello,

We check assign pin for Colibri iMx6(DL) on u-boot-toradex/linux-toradex(device-tree) source code.
On each source code, checked that those pins is defined as GPIO, not defined USB.
Is it not necessary to define USB ?

  • pin

  • SODIMM Pin129 USB_H_PWR_EN

  • SODIMM Pin131 USB_H_OC

  • u-boot

u-boot-toradex/board/toradex/colibri_imx6/colibri_imx6.c

iomux_v3_cfg_t const gpio_pads[] = { 

	MX6_PAD_EIM_D30__GPIO3_IO30	| MUX_PAD_CTRL(WEAK_PULLUP), // -> MX6QDL_PAD_EIM_D31__USB_H1_PWR ?
	/* USBC_ID */
	MX6_PAD_NANDF_D2__GPIO2_IO02	| MUX_PAD_CTRL(WEAK_PULLUP),
	/* USBC_DET */
	MX6_PAD_GPIO_17__GPIO7_IO12	| MUX_PAD_CTRL(WEAK_PULLUP),
};

iomux_v3_cfg_t const usb_pads[] = {
	/* TODO This pin has a dedicated USB power functionality, can we use it? */
	/* USB_PE */
	MX6_PAD_EIM_D31__GPIO3_IO31 | MUX_PAD_CTRL(NO_PAD_CTRL), // -> MX6QDL_PAD_EIM_D30__USB_H1_OC ?
#	define GPIO_USB_H_EN IMX_GPIO_NR(3, 31)
  • linux device tree

like u-boot source code.

Regards,

Hello

Please note the the over current input (OC) is not evaluated in the USB driver, so the pinmuxing of that pin is irrelevant. Should one want to handle OC from userspace it is more convenient to do this through the sysfs gpio subsystem than to try and find the information from the USB host’s registers.

The USB host’s power enable in the device tree is represented through the regulator framework. Using the generic regulator-fixed which can control a GPIO is much easier than to write a regulator which controlls the pin through the USB host’s interface.

So defining the pins as GPIO (and configuring the USB accordingly) is correct.

Max

Hi, Max,

Thank you very much for your help.
We understood that the reason of the GPIO setting is the software simplification of the control.

Regards,