GPIO State on Reset

I saw in the datasheet this about the reset: “After a reset, the pins can be in different modes. Most of them are configured as GPIO input with a 100k pull up resistor enabled.”

How do I reconfigure this default state? Do I use IOMUXC_SW_PAD_CTL_PAD_x? If so, how do I write to this register?

Hi @aronreman17

Thanks for writing to the Toradex Support.

The modes of the Pins after a Reset is defined by the Hardware (SoC). This cannot be changed. You can change the mode once U-Boot or Linux Kernel is booted. For U-Boot, you need to change the board specific code files and for Linux board specific device-tree files.

Please have a look at our developer article about devicetree customization.

Best regards,
Jaski

Okay thank you that makes sense. Now, I am confused about which device tree file to start with. Do I edit SoC, module, or carrier board file?

Most of module’s X1 edge connector pins connected directly to SOC (check Table 3-1 X1 Connector of Colibri iMX6 datasheet for details), So you need to edit SOC settings for such pins.

Here are the device tree files associated with the SoC level:

http://git.toradex.com/cgit/linux-toradex.git/tree/arch/arm/boot/dts/imx6qdl.dtsi?h=toradex_4.14-2.0.x-imx

http://git.toradex.com/cgit/linux-toradex.git/tree/arch/arm/boot/dts/imx6q.dtsi?h=toradex_4.14-2.0.x-imx

I did not find any entries that follow this example from the Toradex documentation:

pinctrl_additionalgpio: additionalgpios {
    fsl,pins = <
        MX6QDL_PAD_EIM_A24__GPIO5_IO04      0x1b0b0
    >;
};

So, do I need to look at a different file?

Hi @aronreman17

The branch toradex_4.14-2.0.x-imx is not the most recent and thus also not supported. You should use this one: imx6qdl.dtsi « dts « boot « arm « arch - linux-toradex.git - Linux kernel for Apalis, Colibri and Verdin modules.

Regarding your question, you should check for each Pin you want to use if it is already used somewhere else. Some SoM’s Pins have standard functions (marked in yellow in the datasheet).

For your specific pin, this pin is defined as Display output in the file arch/arm/boot/dts/imx6qdl-apalis.dtsi, so you need to disable the node where this pin is used if it is not already done. Then you can add this Pin to one of the pinctrl_apalis_gpio.. defined in device-tree files.

Best regards,
Jaski