i.MX7D USB

Hello,

I’m trying to determine how I need to modify the Device Tree for embedded Linux to allow both of the USB connectors on our custom carrier board to work. We are using a Colibri i.MX7D V1.1C. When I look at the device tree files I see the following node:

 pinctrl_usbc_det: gpio_usbc_det {
      fsl,pins = <
                    MX7D_PAD_ENET1_CRS__GPIO7_IO14	0x14
      >;
 };

On our custom carrier board this detect line is not connected so I’m able to comment this out, but there are a number of other lines that we are using for USB that I’m not sure how to create new nodes for or add them to already existing nodes. Here are the lines that we are using for USB on our custom carrier board:

USB C
---------
SODIMM     145     USBC_DM
SODIMM     143     USBC_DP
SODIMM       21     USBC_OC
SODIMM       19     USBC_PWR_EN


USB H
---------
SODIMM     141     USBH_DM
SODIMM     139     USBH_DP
SODIMM     131     USBH_OC
SODIMM     129     USBH_PWR_EN

I see the following node in the device tree pinctrl_usbc1_reg: gpio_usbc_reg that a node already exists for the SODIMM 19 in the imx7-colibri.dtsi file, but it looks like I will need to add one for the SODIMM 129 power enable line for USB C since we have two separate power enable lines. I can do this as I have here:

pinctrl_usbc1_reg: gpio_usbc_reg {
     fsl,pins = <
	      MX7D_PAD_UART3_CTS_B__GPIO4_IO7	0x14 /* SODIMM 129 USBH PEN */
     >;
};

But I’m not sure where this node should be included. I see the following nodes:

reg_usbh_vbus: regulator-usbh-vbus {
		compatible = "regulator-fixed";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_usbh1_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>;
	};

and

&usbotg1 {
	// 7/17/2017 KJC - The detect line is not connected on the P1100 board.  This line can be 
	//	           used as GPIO.
	// extcon = <&extcon_usbc_det>;
	vbus-supply = <&reg_usbh_vbus>;
	status = "okay";
};

do I need to add similar nodes for the USB C power enable?

I’m just not sure where to begin modifying the device tree to make USB work properly on our custom carrier board. Is there a document somewhere that describes this?

Thank You.

Hi

It looks like you do not want to switch between the client and the host role but you always want the i.MX7 to be host.

Have you tried to add the property dr_mode

dr_mode = "host";

to the usbotg1 node.

Then you seem to use pin 19 as the USB power enable, so you likely need:

  • to make sure pin 19 is not used by something else, e.g. UART_C.
  • create a gpio pinmux for the pin
  • create a regulator controlled similar to regulator-usbh-vbus
  • add that regulator to vbus-supply of the usbotg1 node.

The overcurrent input from the USB supply high side switch is currently not evaluated in Linux.

Max