Verdin imx8mm i2c pins repurpose

Hello, so I’m trying to disable i2c2 in the verdin-imx8mm module. I thought that by simply doing this:

/dts-v1/;
/plugin/;

/ {
	compatible = "toradex,verdin-imx8mm";

	fragment@0 {
		target = <&i2c2>;
		__overlay__ {
			status = "disabled";
		};
	};
};

It should free up the GPIO, but here’s the output of some commands inside my image that show that these pins are still not freed up:

root@a1b5f757774d:/app# gpioinfo|grep SODIMM_55
        line  16:  "SODIMM_55"        "scl"  output  active-high [used open-drain]
root@a1b5f757774d:/app# gpioinfo|grep SODIMM_53
        line  17:  "SODIMM_53"        "sda"   input  active-high [used open-drain]

Furthermore

root@a1b5f757774d:/app# cat /sys/kernel/debug/pinctrl/pinctrl-handles | grep -A 10 "30a30000.i2c"
device: 30a30000.i2c current state: default
  state: default
    type: MUX_GROUP controller 30330000.pinctrl group: i2c2grp (24) function: pinctrl (0)
    type: CONFIGS_PIN controller 30330000.pinctrl pin MX8MM_IOMUXC_I2C2_SCL (135)config 00000146
    type: CONFIGS_PIN controller 30330000.pinctrl pin MX8MM_IOMUXC_I2C2_SDA (136)config 00000146
  state: gpio
    type: MUX_GROUP controller 30330000.pinctrl group: i2c2gpiogrp (25) function: pinctrl (0)
    type: CONFIGS_PIN controller 30330000.pinctrl pin MX8MM_IOMUXC_I2C2_SCL (135)config 00000146
    type: CONFIGS_PIN controller 30330000.pinctrl pin MX8MM_IOMUXC_I2C2_SDA (136)config 00000146
device: 30a40000.i2c current state: default
  state: default

I know that it has something to do with disabling the DSI interface, I don’t ever need to use the display capabilities of this module.

Any help or guidance as to how I can repurpose these pins as GPIO?

Thanks!

Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


Hello,

To configure I2C pins as GPIO on the Verdin iMX8MM, you will need to follow these steps:

  1. Create a Device Tree Overlay: This overlay should disable the I2C interface and configure the pins for GPIO use. You can find helpful discussions and examples on the Toradex community forums.

  2. Overlay Configuration: The overlay must:

    • Disable the I2C interface.
    • Set up the pin multiplexing (pinmux) settings.
    • Configure the pin control parameters.

    Here is an example structure for a device tree overlay:

    /dts-v1/;
    /plugin/;
    
    &iomuxc {
        pinctrl_gpio: gpio {
            fsl,pins = <
                MX8MM_IOMUXC_I2C2_SCL_GPIO5_IO16 0x14
                MX8MM_IOMUXC_I2C2_SDA_GPIO5_IO17 0x14
            >;
        };
    };
    
  3. Using GPIO Tools: After applying the overlay, use the libgpiod tools to interact with the GPIOs, as the sysfs interface is deprecated.

The pin control register allows you to configure pull-up/down resistors, drive strength, and other settings through the IOMUXC_SW_PAD_CTL_PAD register. For specific pinmux values and configurations, refer to the i.MX 8M Mini Reference Manual, as the exact settings will depend on your specific requirements.

If you have any further questions or need clarification on these steps, feel free to ask.

Best regards,
Toradex AI Assistant

Please, also check if these links can help you solve your problem:

Verdin imx8mm DL 1GB wb use SODIMM_20,22,24,26 as GPIO.

As AI mentioned there, it’s not enough to simply disable I2C—you also need to repurpose the pins previously used by I2C for GPIO functionality through proper pinmuxing.