USB_PWR_EN not enabling by default

I am using an imx6ULL CoM with a custom carrier board. I was having issues with serial USB device (GNSS receiver) not getting detected automatically. Turns out, the USB_PWR_EN does not turn on the receiver power when the CoM boots up. But, when I try to plug any other USB device (USB memory stick), it detects automatically. Only when it comes to our on-board GNSS receiver, I am having this USB_PWR_EN issue. The GNSS receiver is power through a power switch (AP22815AWT-7).

Screenshot 2022-06-30 100934

This is my device tree configuration:

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 = <3300000>;
	regulator-max-microvolt = <3300000>;
	gpio = <&gpio1 2 GPIO_ACTIVE_LOW>, <&gpio1 3 GPIO_ACTIVE_LOW>;
	vin-supply = <&reg_3v3>;
};

&usbotg2 {
	vbus-supply = <&reg_usbh_vbus>;
	status = "okay";
};

pinctrl_usbh_reg: gpio-usbh-reg {
			fsl,pins = <
				MX6UL_PAD_GPIO1_IO02__GPIO1_IO02	0x10b0 /* SODIMM 129 */
				MX6UL_PAD_GPIO1_IO03__GPIO1_IO03	0x10b0 /* SODIMM 131 */
			>;
};

Hi @SurriyaLuavan,

I have some questions to better understand your issue.

  • OEM719_PWR_EN is connected to which pin of the Colibri iMX6ULL?
  • I’ve searched the datasheet and apparently you’re using the ACTIVE HIGH mode. Am I correct?
  • Finally, could you send me your entire device tree? Is it an overlay or not?

Best regards,
Hiago.

Hi @hfranco.tx,

  • OEM719_PWR_EN - Pin 129, OEM719_PWR_FLG - Pin 131, But I am using it as GPIO pins (see dts file below), as it was done for the iris-v2 and it worked for other USB devices I used.

  • Yes, the Power switch enables at ACTIVE HIGH

  • No, we are not using overlay, we are using a custom device-tree:
    imx6ull-colibri-GRIPS-v1.dts (4.4 KB)

Hi @SurriyaLuavan,

Checking your Pin 129 and Pin 131 definitions, it appears to be something wrong with them.

If you look in the “imx6ull-colibri.dtsi” file inside arch/boot/dts/, you will see that the pin MX6UL_PAD_GPIO1_IO02__GPIO1_IO02 is already defined as gpio, so you don’t need to define it again in your device tree. I’m not sure if this could cause an error, but perhaps you could try to remove it from your device tree.

Your second pin, SODIMM 131, if you look at our Colibri iMX6ULL Datasheet, you’ll see that his ball name is SNVS_TAMPER5. So in order to change it to a GPIO, you should use something like:

&iomux_snvs {
        pinctrl-0 = <&additional_gpio>;
        additional_gpio: additional_group {
                fsl,pins = <
                        MX6ULL_PAD_SNVS_TAMPER5__GPIO5_IO05	0x10b0
                >;
        };
};

The definition of this pin is also inside the imx6ull-colibri.dtsi file.

Please, remember that all pins configurations you will find at i.MX 6ULL Applications Processor
Reference Manual from NXP. I used 0x10b0 because I copied it from your device tree, but I did not check if its correct or not in the manual.

I saw that you have some pins defined that maybe are already defined at imx6ull-colibri.dtsi aswell, so maybe you can remove them and check if it will work for you.

Best regards,
Hiago.

I tried deleting the duplicates, still the problem persists. As soon as the board powers, the line goes low.

I even modified the gpio’s to be active high, still this is how it’s outputting:

reg_usbh_vbus: regulator-usbh-vbus {
	compatible = "regulator-fixed";
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_usbh_reg>;
	regulator-name = "3V3_OEM719";
	regulator-min-microvolt = <3300000>;
	regulator-max-microvolt = <3300000>;
	gpio = <&gpio1 2 GPIO_ACTIVE_HIGH>, <&gpio1 3 GPIO_ACTIVE_HIGH>;
	vin-supply = <&reg_3v3>;
};

&usbotg2 {
	vbus-supply = <&reg_usbh_vbus>;
	status = "okay";
}

Hi @SurriyaLuavan,

Sorry for the delayed answer. Could you please share your dmesg log with me?

Best regards,
Hiago.