Not able to configure GPIO0_1 (SODIMM_206) as output on Verdin AM62

Hi,

tdx-info

Software summary
------------------------------------------------------------
Bootloader:               U-Boot
Kernel version:           6.6.84-7.2.0-devel #1 SMP PREEMPT Thu Mar 27 16:42:10 UTC 2025
Kernel command line:      root=PARTUUID=5754471f-02 ro rootwait console=tty1 console=ttyS2,115200
Distro name:              NAME="TDX Wayland with XWayland"
Distro version:           VERSION_ID=7.2.0-devel-20250603185829-build.0
Distro variant:           -
Hostname:                 verdin-am62-15387774
------------------------------------------------------------

Hardware info
------------------------------------------------------------
HW model:                 Toradex Verdin AM62 WB on Verdin Development Board
Toradex version:          0075 V1.1C
Serial number:            15387774
Processor arch:           aarch64
------------------------------------------------------------

I am trying to configure SODIMM_206 as an output. The vendor DTSI defines this pin as input in &mcu_pmx0.

&mcu_pmx0 {
	/* Verdin PCIE_1_RESET# */
	pinctrl_pcie_1_reset: mcu-gpio0-0-default-pins {
		pinctrl-single,pins = <
			AM62X_MCU_IOPAD(0x0000, PIN_INPUT, 7) /* (E8) MCU_SPI0_CS0.MCU_GPIO0_0 */ /* SODIMM 244 */
		>;
	};

	/* Verdin GPIO_1 */
	pinctrl_gpio_1: mcu-gpio0-1-default-pins {
		pinctrl-single,pins = <
			AM62X_MCU_IOPAD(0x0004, PIN_INPUT, 7) /* (B8) MCU_SPI0_CS1.MCU_GPIO0_1 */ /* SODIMM 206 */
		>;
	};

I tried creating a Device Tree overlay like this to configure it as OUTPUT

/dts-v1/; // Declares the syntax version of the DTS file.
/plugin/; // Indicates that this is a Device Tree Overlay.

// Header file with GPIO macros
#include <dt-bindings/gpio/gpio.h>

// Header file with SoC-specific pinmux macros
#include "k3-pinctrl.h"

/ {
    compatible = "toradex,verdin-am62"; // Set hardware compatibility
};

&mcu_pmx0 {
	pinctrl_gpio_1: mcu-gpio0-1-default-pins {
		pinctrl-single,pins = <
			AM62X_MCU_IOPAD(0x0004, PIN_OUTPUT, 7) 
		>;
	};
};

&mcu_gpio0 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_gpio_1>,
		    <&pinctrl_gpio_2>,
		    <&pinctrl_gpio_3>,
		    <&pinctrl_gpio_4>,
		    <&pinctrl_pcie_1_reset>;
};

But after applying the overlay, gpioinfo still shows the pin as input.

Here is the bbappend file:

FILESEXTRAPATHS:prepend := "${THISDIR}/device-tree-overlays-ti:"

CUSTOM_OVERLAYS_SOURCE = " \
    gpio-verdin-am62-overlay.dts \
"
CUSTOM_OVERLAYS_BINARY = " \
    gpio-verdin-am62-overlay.dtbo \
"

SRC_URI += " \
    file://gpio-verdin-am62-overlay.dts \
"

TEZI_EXTERNAL_KERNEL_DEVICETREE_BOOT = " \
    ${CUSTOM_OVERLAYS_BINARY} \
"

TEZI_EXTERNAL_KERNEL_DEVICETREE:append = " \
    ${CUSTOM_OVERLAYS_BINARY} \
"

do_collect_overlays:prepend() {
    for DTS in ${CUSTOM_OVERLAYS_SOURCE}; do
        cp ${WORKDIR}/${DTS} ${S}
    done
}

What is the proper way to set SODIMM206 as output? Any guidance or working examples would be greatly appreciated.

Hi, I’m the Toradex AI Assistant.

I might make mistakes or occasionally get you wrong. Our support team will step in if needed.


Configuring SODIMM 206 as Output on Verdin AM62

Your overlay approach is mostly correct, but there are a few key issues that prevent it from working properly(1). Let me guide you through the proper configuration.

Issue Analysis

The main problem is that your overlay is redefining the same pinctrl group name (pinctrl_gpio_1) that already exists in the base device tree(1). When overlays redefine existing nodes, the behavior can be unpredictable.

Corrected Device Tree Overlay

Here’s the proper way to configure SODIMM 206 as an output(1):

/dts-v1/;
/plugin/;

#include <dt-bindings/gpio/gpio.h>
#include "k3-pinctrl.h"

/ {
    compatible = "toradex,verdin-am62";
};

&mcu_pmx0 {
    pinctrl_sodimm_206_gpio_output: sodimm_206_gpio_output_grp {
        pinctrl-single,pins = <
            AM62X_MCU_IOPAD(0x0004, PIN_OUTPUT, 7) /* (B8) MCU_SPI0_CS1.MCU_GPIO0_1 */ /* SODIMM 206 */
        >;
    };
};

&mcu_gpio0 {
    pinctrl-0 = <&pinctrl_ctrl_sleep_moci>,
                <&pinctrl_gpio_2>,
                <&pinctrl_gpio_3>,
                <&pinctrl_gpio_4>,
                <&pinctrl_pcie_1_reset>,
                <&pinctrl_sodimm_206_gpio_output>;
};

(1)

Key Changes Explained

  1. Unique Group Name: Use pinctrl_sodimm_206_gpio_output instead of the existing pinctrl_gpio_1 to avoid conflicts(1)

  2. Complete Pin List: Include all existing pinctrl groups in the pinctrl-0 property, replacing the original pinctrl_gpio_1 with your new output configuration(1)

  3. PIN_OUTPUT Configuration: The PIN_OUTPUT macro correctly configures the pin for output mode(2)

Verification

After applying the corrected overlay, you can verify the configuration with:

gpioinfo | grep SODIMM_206

The pin should now appear as an output-capable GPIO that you can control using standard GPIO tools(2).

Alternative Approach Using LED Driver

If you need the pin to be set to a specific state at boot, you can also use the LED driver approach(2):

gpio-leds {
    compatible = "gpio-leds";
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_sodimm_206_gpio_output>;
    
    sodimm-206-led {
        gpios = <&mcu_gpio0 1 GPIO_ACTIVE_HIGH>;
        default-state = "on";
        label = "sodimm_206";
    };
};

(2)

This approach ensures the pin is configured as output and set to your desired initial state during boot.

Best regards,
Toradex AI Assistant.


Did you like my answer? :+1: :-1:

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.

Tried the following but no success

/dts-v1/; /plugin/;  #include <dt-bindings/gpio/gpio.h> #include "k3-pinctrl.h"  / {     compatible = "toradex,verdin-am62"; };  &mcu_pmx0 {     pinctrl_sodimm_206_gpio_output: sodimm_206_gpio_output_grp {         pinctrl-single,pins = <             AM62X_MCU_IOPAD(0x0004, PIN_OUTPUT, 7) /* (B8) MCU_SPI0_CS1.MCU_GPIO0_1 */ /* SODIMM 206 */         >;     }; };  &mcu_gpio0 {     pinctrl-0 = <&pinctrl_ctrl_sleep_moci>,                 <&pinctrl_gpio_2>,                 <&pinctrl_gpio_3>,                 <&pinctrl_gpio_4>,                 <&pinctrl_pcie_1_reset>,                 <&pinctrl_sodimm_206_gpio_output>; };

Output

oot@verdin-am62-15387774:~# gpioinfo | grep "SODIMM"
        line   0:       "SODIMM_244"            input active-low consumer="PCIE_1_RESET#"
        line   1:       "SODIMM_206"            input
        line   2:       "SODIMM_208"            input
        line   3:       "SODIMM_210"            input
        line   4:       "SODIMM_212"            input
        line  15:       "SODIMM_15"             input
        line  16:       "SODIMM_16"             input
        line  17:       "SODIMM_19"             input
        line  18:       "SODIMM_66"             input
        line  19:       "SODIMM_161"            input consumer="id"
        line  49:       "SODIMM_17"             input
        line  50:       "SODIMM_155"            output consumer="regulator-usb0-vbus"

Issue Analysis

The problem is that the pin direction configuration in the pinmux doesn’t directly control the GPIO direction shown by gpioinfo(1). The PIN_OUTPUT configuration in the pinmux only sets the electrical characteristics of the pin, but the GPIO direction is controlled separately by the GPIO driver(1).

Corrected Approach

Here’s the proper way to configure SODIMM 206 as an output using a device tree overlay(1):

/dts-v1/;
/plugin/;

#include <dt-bindings/gpio/gpio.h>
#include "k3-pinctrl.h"

/ {
    compatible = "toradex,verdin-am62";
};

&mcu_pmx0 {
    pinctrl_sodimm_206_gpio_output: sodimm_206_gpio_output_grp {
        pinctrl-single,pins = <
            AM62X_MCU_IOPAD(0x0004, PIN_OUTPUT, 7) /* (B8) MCU_SPI0_CS1.MCU_GPIO0_1 */ /* SODIMM 206 */
        >;
    };
};

&mcu_gpio0 {
    pinctrl-0 = <&pinctrl_ctrl_sleep_moci>,
                <&pinctrl_gpio_2>,
                <&pinctrl_gpio_3>,
                <&pinctrl_gpio_4>,
                <&pinctrl_pcie_1_reset>,
                <&pinctrl_sodimm_206_gpio_output>;
};

(1)

Alternative: Using GPIO Hog

To ensure the GPIO is configured as output at boot, you can use a GPIO hog configuration(1):

&mcu_gpio0 {
    pinctrl-0 = <&pinctrl_ctrl_sleep_moci>,
                <&pinctrl_gpio_2>,
                <&pinctrl_gpio_3>,
                <&pinctrl_gpio_4>,
                <&pinctrl_pcie_1_reset>,
                <&pinctrl_sodimm_206_gpio_output>;
    
    sodimm-206-hog {
        gpio-hog;
        gpios = <1 GPIO_ACTIVE_HIGH>;
        output-high;
        line-name = "SODIMM_206";
    };
};

(1)

Verification Steps

  1. Check if overlay is applied(2):
cat /proc/device-tree/chosen/overlays/*/name
  1. Verify pin configuration(1):
cat /sys/kernel/debug/pinctrl/*/pinmux-pins | grep 0004
  1. Test GPIO control(1):
gpioset 0 1=1  # Set SODIMM 206 high
gpioset 0 1=0  # Set SODIMM 206 low

Important Note

The gpioinfo command shows the current state and configuration, but the pin direction can be changed dynamically by applications(1). The pinmux configuration ensures the pin is electrically configured for output, while the GPIO hog ensures it’s set as output at boot time.

Best regards,
Toradex AI Assistant.


Did you like my answer? :+1: :-1:

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.

When a pin is set to GPIO mode (ALT 7), specifying a direction (PIN_INPUT or PIN_OUTPUT ) in the mux configuration has no effect. The active I/O direction is instead established at runtime by the command you use: gpioget sets the pin as an input, and gpioset configures it as an output.