Using an imx6ull SOM with an IRIS carrier board and want to redefine the SODIMM_45 to be used as a "gpio-poweroff" 3v3 signal on "Shutdown -h now"

The imx6ull ‘standard’ device tree for SODIMM-45 (gpio_129) is defined as 'Tamper[1] - low-power ‘Wakeup’.

We will not be using the imx6ull low-power mode with the IRIS Carrier Board that we are using in our application.

May I request assistance on how to change / modify the ‘device tree’ to-

  1. Remove SODIMM_45 (gpio_129) as a ‘wakeup’ signal;
  2. Redefine SODIMM_45 (gpio_129) Normally ‘Low’ to be configured as Active ‘HIGH’ configuration when using the command - ‘shutdown -h now’

regards,
John R-H
Kenautics Inc.

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

Did you like my answer?

:+1: :-1:


To achieve your goal of redefining SODIMM_45 (gpio_129) as a GPIO power-off signal on shutdown for the iMX6ULL on the Iris Carrier Board, you will need to modify the device tree. Here are the steps to do so:

  1. Remove SODIMM_45 (gpio_129) as a ‘wakeup’ signal:

    You need to locate the device tree node that configures SODIMM_45 as a wakeup signal and remove or disable it. This is typically found in the iomuxc node or a similar node in the device tree.

  2. Redefine SODIMM_45 (gpio_129) as a GPIO power-off signal:

    You will need to add a new node to configure SODIMM_45 as a GPIO power-off signal. This involves setting the pinmux and configuring the GPIO power-off driver.

Here is an example of how you can modify the device tree:

&iomuxc {
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_hog>;

    pinctrl_hog: hoggrp {
        fsl,pins = <
            MX6UL_PAD_SNVS_TAMPER1__GPIO5_IO01 0x1b0b0
        >;
    };
};

&gpio5 {
    gpio-poweroff {
        compatible = "gpio-poweroff";
        gpios = <&gpio5 1 GPIO_ACTIVE_HIGH>;
        status = "okay";
    };
};

In this example:

  • MX6UL_PAD_SNVS_TAMPER1__GPIO5_IO01 corresponds to SODIMM_45 (gpio_129).
  • The gpio-poweroff node is added under the gpio5 node, specifying the GPIO pin and its active state.

Steps to Apply the Changes:

  1. Edit the Device Tree Source (DTS) File:

    • Locate the device tree source file for your board, typically found in the arch/arm/boot/dts/ directory of the Linux kernel source.
    • Apply the changes as shown in the example above.
  2. Recompile the Device Tree Blob (DTB):

    • Recompile the device tree source file to generate the updated DTB file.
    make ARCH=arm dtbs
    
  3. Deploy the Updated DTB File:

    • Copy the updated DTB file to the boot partition of your device, replacing the existing DTB file.
  4. Reboot the Device:

    • Reboot your device to apply the changes.

Additional Notes:

  • Ensure that the GPIO pin is not being used by any other function in the device tree.
  • Verify the pinmux settings to ensure that the pin is correctly configured as a GPIO.

By following these steps, you should be able to redefine SODIMM_45 (gpio_129) as a GPIO power-off signal on shutdown for your iMX6ULL on the Iris Carrier Board.

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

Device Tree Customization/ Device Tree Overlays to Enable/multiplex GPIO.

Hi @JohnRH ,

Please note, there is no such thing as a ‘standard’ device tree. To remove SODIMM-45 as a wake-up source on the toradex_6.6-2.0.x-imx branch, you can simply delete the entire key-wakeup node.

In the pinmuxing definition like MX6UL_PAD_SNVS_TAMPER1__GPIO5_IO01, the SNVS_TAMPER1 defines the pad, and GPIO5_IO01 represents one of the possible functions of that pad (in this case, only the GPIO function is available for this pin). Therefore, in Toradex Linux, SODIMM-45 was never defined as a TAMPER pin, but rather as GPIO.

You can review other pad definitions here .

After that, you need to configure the pin MX6UL_PAD_SNVS_TAMPER1__GPIO5_IO01 as a GPIO input and associate it with a key event that triggers the shutdown. For example

gpio_keys {
compatible = “gpio-keys”;
pinctrl-names = “default”;
pinctrl-0 = <&pinctrl_snvs_gpiokeys>;
status = “okay”;

poweroff_key: button@0 {
    label = "Power Off Button";
    linux,code = <KEY_POWER>;
    gpios = <&gpio5 1 GPIO_ACTIVE_HIGH>;   /* GPIO5_IO01 */
    debounce-interval = <10>;
    linux,input-type = <1>;
};

};

Make sure the following options are enabled in your kernel configuration :

CONFIG_KEYBOARD_GPIO=y
CONFIG_KEYBOARD_GPIO_POLLED=y

When the GPIO state changes (e.g., when the button is pressed and the GPIO goes low), the gpio-keys driver will generate a KEY_POWER event. By default, Linux will interpret this as a shutdown event.
You can verify this behavior using:

cat /dev/input/eventX

If you want to configure a custom action when the GPIO state changes (e.g., triggering a shutdown), you can create a custom udev rule

.

Thank you for the guidance.

My 2nd step was that we want to have the redefined SODIMM_45 (gpio_129) and an OUTPUT gpio signal that is ‘triggered’ by the command - ‘shutdown -h now’
so as to activate ‘at the end of the SHUTDOWN sequence’ to control an external device . . .

We do not want to use SODIMM_45 (gpio_129) as a ‘shutdown INPUT signal’.

So would the following work ?

    gpio-poweroff {
            compatible = “gpio-poweroff”;
            gpio = <&gpio5 1 GPIO_ACTIVE_HIGH>;   /* GPIO5_IO01 */
            status = "okay";
   };

Yes, the gpio-poweroff node defines which GPIO pin should trigger the system to power off. When the system shuts down, the specified GPIO in the device tree will be triggered, signaling an external power management IC or control circuit to cut off the power supply. Please ensure the corresponding driver is enabled in the kernel configuration (CONFIG_GPIO_POWEROFF=y).
https://www.kernel.org/doc/Documentation/devicetree/bindings/power/reset/gpio-poweroff.txt

Thanks Alex (& ToradexAI),

We will follow the great information and provide feedback :slight_smile: