setup gpio pin

Hello,

I want to use some GPIO’s on my ixora/apalis Target and need defined Init states for this pins.
On Apalis the used pins are in GPIO Mode (ALT5) as default.
(e.g @ MXM3-SODIMM Pin 1 → i.mx6 ball name == NAND_DATA04 in ALT5-Mode == GPIO2_IO04 ). Later i control the pins via. GPIOsysfs.

Were is the right place to configure the pins
(Device-tree / in Bootloader / as init-script via systemd ??)
or are the tri-state when the pins are not exported ?

Best Regards

Lars

Hi Lars

During and after reset the pins are as defined by the SoC datasheet.

If this initial state needs to be changed as early as possible in the boot process you can add your configuration to the bootloader board code. If you can live with the initial state a few seconds don’t change the bootloader.

Independent off what you do in the bootloader set your muxing in the device tree.
Note that in our current kernel version you cannot set a pin to output in the device tree. So we usually enable a pull up / pull down to get an initial state until a driver / user space configures the pin to output.

Exported and tri-stated/input need not have anything to do with each other.

Max