Reassign PIN to GPIO

Hello,
I am trying to reassign a PIN from PWM to GPIO.
I use an Aster evaluation board.

I have changed the device tree from file imx6ull-colibri-wifi-aster.dts by adding these lines at end of the file:

&iomuxc {
     pinctrl-names = "default";  
     
     imx6ull-colibri{
         pinctrl_hog_1: hoggrp-1 {
             fsl,pins = <
                 MX6UL_PAD_ENET1_TX_CLK__GPIO2_IO06    0x1b0b0
                 MX6UL_PAD_LCD_DATA07__GPIO3_IO12  0x1b0b0
		 MX6UL_PAD_NAND_CE1_B__GPIO4_IO14 0x1b0b0
		 MX6UL_PAD_NAND_DQS__GPIO4_IO16 0x1b0b0
		 MX6UL_PAD_ENET1_TX_EN__GPIO2_IO05 0x1b0b0
		 MX6UL_PAD_ENET1_RX_DATA0__GPIO2_IO00 0x1b0b0

             >;
         };
     };
 
 };

Above it I have disabled the old PIN fuctionality with this code:

/* PWM <A> */
&pwm4 {
	status = "disabled";
};

/* PWM <B> */
&pwm5 {
	status = "disabled";
};

/* PWM <C> */
&pwm6 {
	status = "disabled";
};

/* PWM <D> */
&pwm7 {
	status = "disabled";
};

I have tried to use and export the PIN SODIMM 67 (GPIO2[6]) but in does not commute as output?

Have I need to changed something else?

FULL FILE:

/*
 * Copyright 2017 Toradex AG
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 */

/dts-v1/;

#include "imx6ull-colibri-wifi.dtsi"
#include "imx6ull-colibri-aster.dtsi"

/ {
	model = "Toradex Colibri iMX6ULL 512MB on Colibri Aster";
	compatible = "toradex,colibri_imx6ull-wifi-aster", "fsl,imx6ull";

};


/* PWM <A> */
&pwm4 {
	status = "disabled";
};

/* PWM <B> */
&pwm5 {
	status = "disabled";
};

/* PWM <C> */
&pwm6 {
	status = "disabled";
};

/* PWM <D> */
&pwm7 {
	status = "disabled";
};

&ecspi1 {
	status = "okay";

	mcp258x0: mcp258x@0 {
		compatible = "microchip,mcp2515";
		/*pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_can_int>;
		reg = <0>;
		clocks = <&clk16m>;
		interrupt-parent = <&gpio2>;
		interrupts = <4 IRQ_TYPE_EDGE_FALLING>;
		spi-max-frequency = <10000000>;*/
		status = "disabled";
	};

	spidev0: spidev@0 {
		compatible = "toradex,evalspi";
		reg = <0>;
		spi-max-frequency = <10000000>;
		status = "okay";
	};
};

&iomuxc {
     pinctrl-names = "default";  
     
     imx6ull-colibri{
         pinctrl_hog_1: hoggrp-1 {
             fsl,pins = <
                 MX6UL_PAD_ENET1_TX_CLK__GPIO2_IO06    0x1b0b0
                 MX6UL_PAD_LCD_DATA07__GPIO3_IO12  0x1b0b0
		 MX6UL_PAD_NAND_CE1_B__GPIO4_IO14 0x1b0b0
		 MX6UL_PAD_NAND_DQS__GPIO4_IO16 0x1b0b0
		 MX6UL_PAD_ENET1_TX_EN__GPIO2_IO05 0x1b0b0
		 MX6UL_PAD_ENET1_RX_DATA0__GPIO2_IO00 0x1b0b0

             >;
         };
     };
 
 };

hi @MaxMax

Could you provide the version of the hardware and software of your module? Which git branch are you using to compile? What is the output of git diff?

I have tried to use and export the PIN SODIMM 67 (GPIO2[6]) but in does not commute as output?

Does the export work?

Hi @jaski.tx the export works but the commutation does not.

HW version is ASTER v1.1b
SW Version is Colibri iMX6ULL (2.8b5 | 2018-12-28 | 44.95 MB)

Which git branch are you using to compile the devicetree?
What is the output of git diff?

branch: toradex_4.9-2.3.x-imx-next.
The pin not work in INPUT

I use Colibri-iMX6ULL_Console-Image.rootfs.tar.xz
where I just changed, as I wrote above,
I replace the dts files in the image and load them with Toradex easy installer. Before I have misplaced, the pin as out seems to work, while as input no.
After exporting the pin, I configure it as an input and connect it with a pull-up resistor from 47k to + 3.3v.

  1. I read it with cat </ sys / class / gpio / gpio38 / value and responds 1 (as it should be)
  2. connect the pin to GND and read it as above and answer 0 (how it should be)
  3. detach the pin from GND I read it and always read 0 instead of 1, even measuring with a voltmeter on the pin there is 0 although there is the resistance of pullup.
    This also happens with the other pins I modified in the device tree
    Have I programmed the pins badly?
    Why does this happen?

Hi
Thanks for this Information. Did you flash the aster devicetree to the module? Could you provide your device tree?

link text

hi @MaxMax

Thanks for the files.
As you wrote, you measure 0 Volt on the pin using Multimeter and also get 0 in the Software. Thus the result in Software is equal to the measurement in Hardware. Could you flash the Bsp 2.8b5 without changes and do the following changes to the device tree and check if this works.

Please note, For using the aster device tree file, you need to change the U-Boot variable fdt_board to aster instead of eval-v3.

diff --git a/arch/arm/boot/dts/imx6ull-colibri-aster.dtsi b/arch/arm/boot/dts/imx6ull-colibri-aster.dtsi
index 589accd..9f7fc58 100644
--- a/arch/arm/boot/dts/imx6ull-colibri-aster.dtsi
+++ b/arch/arm/boot/dts/imx6ull-colibri-aster.dtsi
@@ -263,7 +263,7 @@
 
 /* PWM <D> */
 &pwm7 {
-       status = "okay";
+       status = "disabled";
 };
 
 &uart1 {
diff --git a/arch/arm/boot/dts/imx6ull-colibri.dtsi b/arch/arm/boot/dts/imx6ull-colibri.dtsi
index b78eca1..eda67ec 100644
--- a/arch/arm/boot/dts/imx6ull-colibri.dtsi
+++ b/arch/arm/boot/dts/imx6ull-colibri.dtsi
@@ -219,6 +219,7 @@
        imx6ull-colibri {
                pinctrl_hog_1: hoggrp-1 {
                        fsl,pins = <
+                               MX6UL_PAD_ENET1_TX_CLK__GPIO2_IO06   0x1b0b0 /* SODIMM 67 */
                    
                                MX6UL_PAD_UART3_RX_DATA__GPIO1_IO25     0X14 /* SODIMM 77 */
                                MX6UL_PAD_JTAG_TCK__GPIO1_IO14          0x14 /* SODIMM 99 */
                                MX6UL_PAD_NAND_CE1_B__GPIO4_IO14        0x14 /* SODIMM 133 */

Thanks and best regards, Jaski