Disable USB Detection on IMX6ULL 512MB

Hi! So i have a situation i’d like to get help with.

I’m running IMX6ULL 512MB WB with a custom board in which i’d like to use pin SODIMM 137 for GPIO function. Problem is this pin is assigned to usb detection and i cant to make it work, when i try to export the pin it gives me a message that is busy.

I’ve already read this thread and tried to implement this solution:

in my “imx6ull-colibri-eval-v3.dts” file i did this changes:

/ {
    /delete-node/ &extcon_usbc_det;		// usbc-det
};


&extcon_usbc_det {
	compatible = "linux,extcon-usb-gpio";
	debounce = <25>;
	id-gpio = < >;
	pinctrl-names = "default";
};
&usbotg1 {
	dr_mode = "host";
	/delete-property/ extcon;
};

And redefined SODIMM 137 function:

&pinctrl_gpio2 {
	fsl,pins = <
		MX6UL_PAD_CSI_DATA04__GPIO4_IO25	0x10b0 /* SODIMM 69 */
		MX6UL_PAD_CSI_MCLK__GPIO4_IO17		0x10b0 /* SODIMM 75 */
		MX6UL_PAD_CSI_DATA06__GPIO4_IO27	0x10b0 /* SODIMM 85 */
		MX6UL_PAD_CSI_PIXCLK__GPIO4_IO18	0x10b0 /* SODIMM 96 */
		MX6UL_PAD_SNVS_TAMPER2__GPIO5_IO02	0x10b0	/* SODIMM 137 */

	>;
};

I think i’m missing something here but i can’t make it work, maybe also SO is running some service at start?

Help will be aprecciated

Hi @germanmorgan,

I hope you’re doing well. I have a couple of questions regarding the changes you’re making. Could you clarify if you’re implementing these modifications using an overlay? If so, it would be extremely helpful if you could provide us with the entire overlay for reference. Also, can you please share with us which OS you are running on the module?

Regarding the removal of the detection function, it might be more effective to disable the entire node. Could you kindly consider adding the parameter status = "disabled" to the extcon_usbc_det node and then verify if there are any other outputs or issues?

Additionally, to gain a better understanding of what is utilizing the pin, could you please share the output of the following commands:

  1. cat /sys/kernel/debug/gpio
  2. dmesg | grep iomux

Best regards,
Daniel Morais

Hi Daniel, thank you for your response.
First i want to clarify i’m not using a overlay, just making this changes to the device tree and then compiling the image.
For reference, i’m running core image minimal 5.7.2-devel-20230726155409+build.

I added line “status = “disabled;”” in my DTS but nothing changed, i still can’t import gpio 130 (sodimm 137).

  1. cat /sys/kernel/debug/gpio will throw:

gpiochip3: GPIOs 96-127, parent: platform/20a8000.gpio, 20a8000.gpio:
 gpio-96  (                    )
 gpio-97  (                    )
 gpio-98  (                    )
 gpio-99  (                    )
 gpio-100 (                    )
 gpio-101 (                    )
 gpio-102 (                    )
 gpio-103 (                    )
 gpio-104 (                    )
 gpio-105 (                    )
 gpio-106 (                    )
 gpio-107 (SODIMM_59           )
 gpio-108 (                    )
 gpio-109 (                    )
 gpio-110 (SODIMM_133          )
 gpio-111 (                    )
 gpio-112 (SODIMM_28           )
 gpio-113 (SODIMM_75           )
 gpio-114 (SODIMM_96           )
 gpio-115 (                    )
 gpio-116 (                    )
 gpio-117 (                    )
 gpio-118 (                    )
 gpio-119 (                    )
 gpio-120 (                    )
 gpio-121 (SODIMM_69           )
 gpio-122 (SODIMM_98           )
 gpio-123 (SODIMM_85           )
 gpio-124 (SODIMM_65           )
gpiochip4: GPIOs 128-159, parent: platform/20ac000.gpio, 20ac000.gpio:
 gpio-128 (SODIMM_43           |cd                  ) in  hi IRQ ACTIVE LOW
 gpio-129 (SODIMM_45           |Wake-Up             ) in  lo IRQ
 gpio-130 (SODIMM_137          |id                  ) in  hi IRQ
 gpio-131 (SODIMM_95           )
 gpio-132 (SODIMM_107          )
 gpio-133 (SODIMM_131          )
 gpio-134 (                    )
 gpio-135 (                    )
 gpio-136 (                    )
 gpio-137 (                    |+V3.3_1.8_SD        ) out lo
 gpio-138 (SODIMM_105          )
 gpio-139 (                    |reset               ) out hi ACTIVE LOW
root@colibri-imx6ull-14939286:~# echo 130 > /sys/class/gpio/export
-sh: echo: write error: Device or resource busy

And
2. dmesg | grep iomux


root@colibri-imx6ull-14939286:~# dmesg | grep iomux
[    0.107657] imx6ul-pinctrl 20e0000.iomuxc: initialized IMX pinctrl driver
[    0.109354] imx6ul-pinctrl 2290000.iomuxc-snvs: initialized IMX pinctrl driver

Thank you for your time!

I was having a problem with my system and wasn’t loading new DT to the image.
I’ve sorted that out and now i’m able to use sodimm 137 as gpio.
PS:
/ {
/delete-node/ extcon_usbc_det; // usbc-det
};
To delete node used this line, without “&”.

You can close this topic, ty!

Hi @germanmorgan ,

Good to hear that you made it work!

I’ve also prepared a patch for you that has the same effect, see below:

diff --git a/arch/arm/boot/dts/imx6ull-colibri-eval-v3.dtsi b/arch/arm/boot/dts/imx6ull-colibri-eval-v3.dtsi
index 821523a12423..52ae53adc3a7 100644
--- a/arch/arm/boot/dts/imx6ull-colibri-eval-v3.dtsi
+++ b/arch/arm/boot/dts/imx6ull-colibri-eval-v3.dtsi
@@ -36,6 +36,7 @@
                id-gpio = <&gpio5 2 GPIO_ACTIVE_HIGH>;
                pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_snvs_usbc_det>;
+               status = "disabled";
        };

        reg_3v3: regulator-3v3 {
diff --git a/arch/arm/boot/dts/imx6ull-colibri.dtsi b/arch/arm/boot/dts/imx6ull-colibri.dtsi
index 06d4270e4c13..556b09274c5c 100644
--- a/arch/arm/boot/dts/imx6ull-colibri.dtsi
+++ b/arch/arm/boot/dts/imx6ull-colibri.dtsi
@@ -397,6 +397,7 @@
                                MX6UL_PAD_JTAG_TRST_B__GPIO1_IO15       0x70a0 /* SODIMM 102 */
                                MX6UL_PAD_ENET1_RX_ER__GPIO2_IO07       0x10b0 /* SODIMM 104 */
                                MX6UL_PAD_UART3_RTS_B__GPIO1_IO27       0x10b0 /* SODIMM 186 */
+                               MX6ULL_PAD_SNVS_TAMPER2__GPIO5_IO02 0x10b0 /* SODIMM 137 */
                        >;
                };

Since you had issues with loading the new device tree, in the future you can use this article and update the new device tree binary directly into the NAND volume.

If you have any more doubts, let us know!

Best regards,
Daniel Morais

1 Like

Thank you!!