AnsweredAssumed Answered

i.MX6: Using GPIO1_IO19

Question asked by Alexander Koch on Aug 3, 2015
Latest reply on Aug 4, 2015 by Biyong Sun

My intent is to configure the WDOG1 pin on the i.MX6 as GPIO output (to trigger a custom power-off circuit). The i.MX6 Reference Manual states that this is achievable by setting the Pad Mux Register (IOMUXC_SW_MUX_CTL_PAD_SD1_DATA2) MUX_MODE to ALT5, which selects the signal GPIO1_IO19.

 

In order to implement this, I have added the following lines to the iomuxc-block in the Linux Kernel device tree:

 

gpio19 {

    pinctrl_gpio19_1: gpio19grp-1 {

        fsl,pins = <

            MX6QDL_PAD_SD1_DAT2__GPIO1_IO19 0x80000000

        >;

    }; 

};

 

From userspace I am now able to configure and use the GPIO like this:

$ echo 19 > /sys/class/gpio/export

$ echo out > /sys/class/gpio/gpio19/direction

$ echo 1 > /sys/class/gpio/gpio19/active_low

$ echo 1 > /sys/class/gpio/gpio19/value

 

(unfortunately I don't have a scope so I can't verify that the output value actually changes)

 

My question now is how to do this initialization in the device tree, so that I have the GPIO properly set up on system boot without using userland scripts?

 

My understanding is that I'd have to create a "gpio19" device in the tree that makes use of the pinctrl block I have defined, but I don't know how to declare such a device. This document describes properties for such a device that I don't know which values I'd have to assign to, e.g. the interrupt number.

 

I'm using a TQMa6S board with the latest BSP 0105.

 

Thanks in advance for any feedback!

Outcomes