iMX8MP GPIO1 SODIMM_206

Hi,

I am trying to set GPIO1 pin 206 in an overlay.

I have got the following over

/dts-v1/;
/plugin/;

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/leds/common.h>
#include "imx8mp-pinfunc.h"

/ {
    compatible = "toradex,verdin-imx8mp-wifi-dev",
                "toradex,verdin-imx8mp-wifi",
                "toradex,verdin-imx8mp",
                "fsl,imx8mp";
};

&{/} {
    leds {
        compatible = "gpio-leds";

        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_gpio1>;

        myled_sodimm_206 {
            label = "myled_sodimm_206";
            gpios = <&gpio1 0 GPIO_ACTIVE_HIGH>;
            default-state = "on";
        };
    };
};


&iomuxc {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_gpio1>, <&pinctrl_gpio2>,
			    <&pinctrl_gpio3>, <&pinctrl_gpio4>,
			    <&pinctrl_gpio7>, <&pinctrl_gpio8>,
			    <&pinctrl_gpio_hog2>, <&pinctrl_gpio_hog3>, <&pinctrl_gpio_hog4>,
			    <&pinctrl_hdmi_hog>, <&pinctrl_gpio4_io24_config>;
};

&pinctrl_gpio1 {
    fsl,pins =
        <MX8MP_IOMUXC_GPIO1_IO00__GPIO1_IO00 0x104>; // SODIMM 206 // pull-down enabled and drive strength X2
};

However, it is not working as expected. Any help would be greatly appreciated.

Thanks in advance.

Hi, I’m the Toradex AI Assistant.

I might make mistakes. Our support team will step in if needed. If I answered your question, please tick the “Solution” checkbox. For follow-up questions to me, please use @ToradexAI in your post.

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


Hello,

Thank you for sharing your device tree overlay. Let’s break down and troubleshoot your configuration for controlling GPIO1 pin 206 on the Verdin iMX8M Plus.

Key points and suggestions:

  1. SODIMM 206 Mapping
    On Verdin iMX8M Plus, SODIMM 206 is typically GPIO1_IO00. Your pin mapping:

    MX8MP_IOMUXC_GPIO1_IO00__GPIO1_IO00
    

    appears correct. To double-check, see the Verdin iMX8M Plus Pinout Designer.

  2. Overlay Structure Issues

    • The pinctrl_gpio1 node is likely not defined in the base device tree. Overlays should create uniquely-named pinctrl nodes (like pinctrl_myled) to prevent conflicts.
    • Do not assign pinctrl-0 or pinctrl-names directly under iomuxc — these belong under the device using the pin configuration (in your case, the “leds” node).
    • The way you reference pinctrl_gpio1 in both the iomuxc and the “leds” node may cause issues if the node is not defined in the base DT.
  3. Correct Overlay Example
    Here’s a tailored and recommended approach based on official guidance:

/dts-v1/;
/plugin/;

#include <dt-bindings/gpio/gpio.h>
#include "imx8mp-pinfunc.h"

/ {
    compatible = "toradex,verdin-imx8mp-wifi-dev",
                 "toradex,verdin-imx8mp-wifi",
                 "toradex,verdin-imx8mp",
                 "fsl,imx8mp";
};

&iomuxc {
    pinctrl_myled: myledgrp {
        fsl,pins = <
            MX8MP_IOMUXC_GPIO1_IO00__GPIO1_IO00 0x104
        >;
    };
};

&{/} {
    leds: myleds {
        compatible = "gpio-leds";
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_myled>;

        myled_sodimm_206 {
            label = "myled_sodimm_206";
            gpios = <&gpio1 0 GPIO_ACTIVE_HIGH>;
            default-state = "on";
        };
    };
};
  • Note the unique naming (pinctrl_myled) and referencing.
  • All pin muxing is placed inside &iomuxc and referenced by the node using it.
  1. Further Checks

    • Confirm that no other device tree fragment is already using or configuring GPIO1_IO00.
    • Verify using dmesg | grep gpio on your target hardware to see if the pin and gpio-leds device are being initialized.
    • Check pin status by exporting the GPIO and reading/writing it from sysfs or using gpiodetect and gpioset (provided by libgpiod-tools).
  2. Reload/Reboot

    • After updating the overlay, ensure you update it in the bootloader and reboot the device.

References:

If you have further issues, please specify the exact error message, boot log, or the observed symptom (e.g., LED not toggling, GPIO not exported, etc.), and I’ll be happy to assist you!

Best regards, Toradex AI Assistant.

Greetings @DAH,

Could you please elaborate on what you mean by “it is not working as expected”?

I just did a quick test and it seems to work okay on my system. I used a simplified version of your overlay:

/dts-v1/;
/plugin/;

#include "imx8mp-pinfunc.h"

/ {
    compatible = "toradex,verdin-imx8mp-wifi-dev",
                "toradex,verdin-imx8mp-wifi",
                "toradex,verdin-imx8mp",
                "fsl,imx8mp";
};

&iomuxc {
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_gpio1>, <&pinctrl_gpio2>,
                            <&pinctrl_gpio3>, <&pinctrl_gpio4>,
                            <&pinctrl_gpio7>, <&pinctrl_gpio8>,
                            <&pinctrl_gpio_hog2>, <&pinctrl_gpio_hog3>, <&pinctrl_gpio_hog4>,
                            <&pinctrl_hdmi_hog>;
};

&pinctrl_gpio1 {
    fsl,pins =
        <MX8MP_IOMUXC_GPIO1_IO00__GPIO1_IO00 0x104>; // SODIMM 206 // pull-down enabled and drive strength X2
};

I applied this and then manually connected SODIMM 206 to an LED. I can toggle the value of the pin in software and I can see the LED appropriately react to the changes.

Best Regards,
Jeremias