Change Pinfunction

I would like to change my pinfunctions. Is it possilble only to change “imx6q-pinfunc.h” in /arch/arm/boot/dts or have I to change also other things?


hi @Michael_I

Which pin function do you want to change?

I would like to change following Pins to GPIO Function:

And Pin 17 as SDA (to ALT2).

Thanks a lot.

For this you have to read the following guide to change the device tree files. Usually you don’t have to touch *-pinfunc.h file, since this is defined by the Soc.

Additionally Information about Gpio numbering in Linux can be found here.

I have already read that guide, but can you send an example? I have build a new device Tree file for my evaluation board. It looks like that :

 * Copyright 2014-2016 Toradex AG
 * Copyright 2012 Freescale Semiconductor, Inc.
 * Copyright 2011 Linaro Ltd.
 * The code contained herein is licensed under the GNU General Public
 * License. You may obtain a copy of the GNU General Public License
 * Version 2 or later at the following locations:


#include <dt-bindings/input/input.h>
#include <dt-bindings/interrupt-controller/irq.h>
#include "imx6q.dtsi"
#include "imx6qdl-apalis.dtsi"
#include "imx6qdl-apalis-eval.dtsi"

/ {
	model = "Toradex Apalis iMX6Q/D Module on Apalis Evaluation Board";
	compatible = "toradex,apalis_imx6q-eval", "toradex,apalis_imx6q",

What must i add to reconfigure Port 156 and Port 157 (UART1 RX and TX) as GPIO?


hi @Michael_I

If you have a custom board, then it is a good thing to create a new file for the board.
What do you mean this port 156 (UART1 RX or 157 TX)? Are you talking about SOC Ports. You should consult the Datasheet of the Module Apalis iMX6 and check there, which SODIMM Pin you want to use for your GPIO functionality.

So if you mean the SODIMM PIN 156, 157, then you should do the following:
SODIMM 156 → SD1_DATA0 and GPIO2_IO02
SODIMM 157 → Unfortunately this SODIMM has no GPIO functionality.

So for SODIMM 156, you edit the file imx6qdl-apalis.dtsi (at module level) under the node &iomuxc you add the following:

pinctrl_additionalgpio: additionalgpios {
fsl,pins = <

Further, you should delete this pin from other functionalities (look for MX6QDL_PAD_NANDF_D2 in all the imx6 apalis device tree files) .

Once you compiled and flashed the device tree file to the module, then you can control this pin as gpio in Linux.