Setting pin to gpio function

hi , im trying to set some pins to gpios and i cannot configure them even with the change in the dtsi file. the file lloks like this:

// SPDX-License-Identifier: (GPL-2.0 OR MIT)
/*
 * Copyright 2017 Toradex AG
 */

#include <dt-bindings/pwm/pwm.h>

/ {
	chosen {
		stdout-path = "serial0:115200n8";
	};

	gpio-keys {
		compatible = "gpio-keys";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_snvs_gpiokeys>;
		power {
			label = "Wake-Up";
			gpios = <&gpio5 1 GPIO_ACTIVE_HIGH>;
			linux,code = <KEY_WAKEUP>;
			debounce-interval = <10>;
			wakeup-source;
		};
	};

	/* fixed crystal dedicated to mcp2515 */
	clk16m: clk16m {
		compatible = "fixed-clock";
		#clock-cells = <0>;
		clock-frequency = <16000000>;
	};

	extcon_usbc_det: usbc_det {
		compatible = "linux,extcon-usb-gpio";
		debounce = <25>;
		id-gpio = <&gpio5 2 GPIO_ACTIVE_HIGH>;
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_snvs_usbc_det>;
	};

	reg_3v3: regulator-3v3 {
		compatible = "regulator-fixed";
		regulator-name = "3.3V";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
	};

	reg_5v0: regulator-5v0 {
		compatible = "regulator-fixed";
		regulator-name = "5V";
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;
	};

	reg_usbh_vbus: regulator-usbh-vbus {
		compatible = "regulator-fixed";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_usbh_reg>;
		regulator-name = "VCC_USB[1-4]";
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;
		gpio = <&gpio1 2 GPIO_ACTIVE_LOW>;
		vin-supply = <&reg_5v0>;
	};
};

&adc1 {
	status = "disable";
};

&pxp {
	status = "disable";
};

&ecspi1 {
	status = "disable";

	mcp2515: can@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>;
		vdd-supply = <&reg_3v3>;
		xceiver-supply = <&reg_5v0>;
		status = "disable";
	};

	/* To keep the CAN controller enabled by default,
	 * disable conflicting spidev.
	 */
	spidev0: spidev@0 {
		status = "disabled";
	};
};

&can1 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_flexcan1>;
	status = "disabled";
};

&can2 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_flexcan2>;
	status = "disabled";
};

&i2c1 {
	status = "okay";

	/* M41T0M6 real time clock on carrier board */
	m41t0m6: rtc@68 {
		compatible = "st,m41t0";
		reg = <0x68>;
	};
};


&atmel_mxt_ts {
        pinctrl-0 = <&pinctrl_atmel_adap>;
        interrupt-parent = <&gpio4>;
        interrupts = <16 IRQ_TYPE_EDGE_FALLING>;   /* SODIMM 28, INT */
        reset-gpios = <&gpio2 5 GPIO_ACTIVE_HIGH>; /* SODIMM 30, RST */
        status = "disabled";
};

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

/*
 * the PCAPs use SODIMM 28/30, also used for PWM<B>, PWM<C>, aka pwm5,
 * pwm6. so if you enable one of the PCAP controllers disable the pwms
 */

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

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

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

&uart1 {
	status = "okay";
};

&uart2 {
	status = "disable";
};

&uart5 {
	status = "disable";
};

&usbotg1 {
	extcon = <&extcon_usbc_det &extcon_usbc_det>;
	vbus-supply = <&reg_usbh_vbus>;
	status = "okay";
};

&usbotg2 {
	vbus-supply = <&reg_usbh_vbus>;
	status = "disable";
};

&usdhc1 {
	vmmc-supply = <&reg_3v3>;
	status = "disable";
};

&iomuxc {
	imx6ull-colibri {
	pinctrl_gpiotouch: touchgpios {
		fsl,pins = <	
				MX6UL_PAD_NAND_DQS__GPIO4_IO16 0x74
				MX6UL_PAD_ENET1_TX_EN__GPIO2_IO05 0x14
				MX6UL_PAD_SNVS_TAMPER0__GPIO5_IO00    0x22ed	//128
                        	MX6UL_PAD_ENET1_TX_CLK__GPIO2_IO06	0x22ed 	//38
                       	 MX6UL_PAD_SNVS_TAMPER2__GPIO5_IO02    0x22ed	//130
                       	 MX6UL_PAD_ENET1_RX_ER__GPIO2_IO07	0x22ed	//40
                       	 MX6UL_PAD_SNVS_TAMPER4__GPIO5_IO04	0x22ed	//132
                        	MX6UL_PAD_SNVS_TAMPER5__GPIO5_IO05	0x22ed	//133
                        	MX6UL_PAD_SNVS_TAMPER6__GPIO5_IO06	0x22ed	//134
                        	MX6UL_PAD_SNVS_TAMPER7__GPIO5_IO07	0x22ed	//135
                        	MX6UL_PAD_SNVS_TAMPER8__GPIO5_IO08	0x22ed	//136
                        	MX6UL_PAD_ENET2_TX_DATA0__GPIO2_IO11	0x22ed	//43
                        	MX6UL_PAD_GPIO1_IO01__I2C2_SDA	0x22ed	//1
                        	MX6UL_PAD_GPIO1_IO02__I2C1_SCL	0x22ed	//2
                        	MX6UL_PAD_GPIO1_IO03__I2C1_SDA	0x22ed	//3
                        	MX6UL_PAD_GPIO1_IO04__ENET1_REF_CLK1	0x22ed	//4
                        	MX6UL_PAD_GPIO1_IO05__ENET2_REF_CLK2	0x22ed	 //5                   
                        	MX6UL_PAD_GPIO1_IO08__WDOG1_WDOG_B	0x22ed	//8	
                        	MX6UL_PAD_GPIO1_IO09__PWM2_OUT	0x22ed	//9
                        	MX6UL_PAD_UART2_TX_DATA__GPIO1_IO20	0x22ed	//20
                        	MX6UL_PAD_UART2_RX_DATA__GPIO1_IO21 0x22ed	//21
                        	MX6UL_PAD_UART2_CTS_B__GPIO1_IO22	0x22ed	//22
                        	MX6UL_PAD_UART2_RTS_B__GPIO1_IO23	0x22ed	//23
                        	MX6UL_PAD_UART3_TX_DATA__GPIO1_IO24	0x22ed	//24
                        	MX6UL_PAD_UART3_CTS_B__GPIO1_IO26	0x22ed	//26
                        	MX6UL_PAD_UART3_RX_DATA__GPIO1_IO25	0x22ed	//25
                        	MX6UL_PAD_UART3_RTS_B__GPIO1_IO27	0x22ed	//27
                        	MX6UL_PAD_UART4_TX_DATA__GPIO1_IO28	0x22ed 	//28
                        	MX6UL_PAD_UART4_RX_DATA__GPIO1_IO29	0x22ed	//29
                        	MX6UL_PAD_UART5_TX_DATA__GPIO1_IO30	0x22ed	//30
                        	MX6UL_PAD_UART5_RX_DATA__GPIO1_IO31 	0x22ed	//31
                        	MX6UL_PAD_ENET1_RX_DATA0__GPIO2_IO00	0x22ed	//32	
                        	MX6UL_PAD_ENET1_RX_EN__GPIO2_IO02	0x22ed	//34
                        	MX6UL_PAD_ENET1_TX_DATA1__GPIO2_IO04	0x22ed	//36
                        	MX6UL_PAD_ENET1_TX_EN__GPIO2_IO05	0x22ed	//37
                       	 MX6UL_PAD_ENET2_TX_DATA1__GPIO2_IO12 0x22ed  //44
                       	 MX6UL_PAD_ENET2_TX_EN__GPIO2_IO13	0x22ed	//45
                       	 MX6UL_PAD_ENET2_TX_CLK__GPIO2_IO14 0x22ed      // 46
                       	 MX6UL_PAD_ENET2_RX_ER__GPIO2_IO15 0x22ed	//47
                       	 MX6UL_PAD_LCD_CLK__GPIO3_IO00 0x22ed		//64
                       	 MX6UL_PAD_LCD_ENABLE__GPIO3_IO01 0x22ed		//65
                       	 MX6UL_PAD_LCD_HSYNC__GPIO3_IO02 0x22ed		//66
                        	 MX6UL_PAD_LCD_VSYNC__GPIO3_IO03 0x22ed	//67	
                        	MX6UL_PAD_LCD_RESET__GPIO3_IO04 0x22ed	//68	
				MX6UL_PAD_LCD_DATA00__GPIO3_IO05 0x22ed	//69
				MX6UL_PAD_LCD_DATA01__GPIO3_IO06 0x22ed	//70
				MX6UL_PAD_LCD_DATA02__GPIO3_IO07 0x22ed		//71
				MX6UL_PAD_LCD_DATA03__GPIO3_IO08 0x22ed		//72
				MX6UL_PAD_LCD_DATA04__GPIO3_IO09 0x22ed	//73
				MX6UL_PAD_LCD_DATA05__GPIO3_IO10 0x22ed	//74
				MX6UL_PAD_LCD_DATA06__GPIO3_IO11 0x22ed	//75
				MX6UL_PAD_LCD_DATA07__GPIO3_IO12 0x22ed	//76
				MX6UL_PAD_LCD_DATA08__GPIO3_IO13 0x22ed	//77
				MX6UL_PAD_LCD_DATA09__GPIO3_IO14 0x22ed>;		//78*
	};
	};
};

what am i doing wrong?

thanks for your support

regards

João Coelho

Hi @jc1982as,

In order for us to help you better, could you please share more information about your problem?

  • Which module and carrier board are you using?
  • Which OS and version are you using? Torizon, BSP…
  • Could you please tell us what pins are you trying to change? What’s your objective? It’s not clear to me just seeing your device tree file.

Best regards,
Hiago.

Hello

I’m using colibri imx6ull on colibri board

Using linux 4.8

Pins:

MX6UL_PAD_GPIO1_IO08__GPIO1_IO08 0x1b0b0 //sodimm 8

MX6UL_PAD_UART2_RTS_B__GPIO1_IO23 0x1b0b0 //sodimm 23

MX6UL_PAD_UART3_RX_DATA__GPIO1_IO25 0x1b0b0 //sodimm25

MX6UL_PAD_UART3_RTS_B__GPIO1_IO27 0x1b0b0 //sodimm27

MX6UL_PAD_UART5_TX_DATA__GPIO1_IO30 0x1b0b0 //sodimm 30

MX6UL_PAD_UART5_RX_DATA__GPIO1_IO31 0x1b0b0//sodimm 31

//MX6UL_PAD_ENET2_TX_CLK__GPIO2_IO14 0x1b0b0//sodimm 46

MX6UL_PAD_SD1_CMD__GPIO2_IO16 0x1b0b0//sodimm 48

MX6UL_PAD_SD1_CLK__GPIO2_IO17 0x1b0b0//sodimm 49

MX6UL_PAD_SD1_DATA0__GPIO2_IO18 0x1b0b0//sodimm 49

MX6UL_PAD_SD1_DATA1__GPIO2_IO19 0x1b0b0//sodimm 50

MX6UL_PAD_SD1_DATA3__GPIO2_IO21 0x1b0b0//sodimm 53

MX6UL_PAD_LCD_CLK__GPIO3_IO00 0x1b0b0

MX6UL_PAD_LCD_HSYNC__GPIO3_IO02 0x1b0b0

MX6UL_PAD_LCD_VSYNC__GPIO3_IO03 0x1b0b0

MX6UL_PAD_LCD_RESET__GPIO3_IO04 0x1b0b0

MX6UL_PAD_LCD_DATA00__GPIO3_IO05 0x1b0b0

MX6UL_PAD_LCD_DATA01__GPIO3_IO06 0x1b0b0

MX6UL_PAD_LCD_DATA02__GPIO3_IO07 0x1b0b0

MX6UL_PAD_LCD_DATA03__GPIO3_IO08 0x1b0b0

MX6UL_PAD_LCD_DATA04__GPIO3_IO09 0x1b0b0

MX6UL_PAD_LCD_DATA05__GPIO3_IO10 0x1b0b0

MX6UL_PAD_LCD_DATA07__GPIO3_IO12 0x1b0b0

MX6UL_PAD_LCD_DATA08__GPIO3_IO13 0x1b0b0

MX6UL_PAD_LCD_DATA09__GPIO3_IO14 0x1b0b0

MX6UL_PAD_LCD_DATA11__GPIO3_IO16 0x1b0b0

MX6UL_PAD_LCD_DATA13__GPIO3_IO18 0x1b0b0

MX6UL_PAD_LCD_DATA20__GPIO3_IO25 0x1b0b0

MX6UL_PAD_LCD_DATA10__GPIO3_IO15 0x1b0b0

MX6UL_PAD_LCD_DATA12__GPIO3_IO17 0x1b0b0

MX6UL_PAD_LCD_DATA17__GPIO3_IO22 0x1b0b0

//MX6UL_PAD_LCD_DATA19__GPIO3_IO24 0x1b0b0

MX6UL_PAD_SNVS_TAMPER5__GPIO5_IO05 0x1b0b0>;

//MX6UL_PAD_SNVS_TAMPER7__GPIO5_IO07 0x1b0b0

//MX6UL_PAD_SNVS_TAMPER3__GPIO5_IO03 0x1b0b0

//MX6UL_PAD_BOOT_MODE0__GPIO5_IO10 0x1b0b0

//MX6UL_PAD_LCD_DATA16__GPIO3_IO21 0x1b0b0

//MX6UL_PAD_LCD_ENABLE__GPIO3_IO01 0x1b0b0

//MX6UL_PAD_ENET2_TX_DATA0__GPIO2_IO11 0x1b0b0

//78*

Thanks

Regards

João Coelho

Hi @jc1982as,

I can see some mistakes on your device tree file. In order to disable a device tree node, you should write "disabled", but I can see some status = "disable" in your file.
Also, I’ve noticed some brackets ({ }) that you’ve opened but didn’t close.

Please, look at these errors and let me know if this fixed your issue.

Best regards,
Hiago.

Hi @jc1982as,

Do you have any updates on that?
Were you able to solve your issue?

Best regards,
Hiago.

Hi,

Im currently setting the refered gpios, however i do no know which hexadecimal word to put in front of the gpios address to configure it has gpios, currently I’m setting them like this:

MX6UL_PAD_GPIO1_IO08__GPIO1_IO08 0x1b0b0 //sodimm 8
MX6UL_PAD_UART2_RTS_B__GPIO1_IO23 0x1b0b0 //sodimm 23
MX6UL_PAD_UART3_RX_DATA__GPIO1_IO25 0x1b0b0 //sodimm25
MX6UL_PAD_UART3_RTS_B__GPIO1_IO27 0x1b0b0 //sodimm27
MX6UL_PAD_UART5_TX_DATA__GPIO1_IO30 0x1b0b0 //sodimm 30
MX6UL_PAD_UART5_RX_DATA__GPIO1_IO31 0x1b0b0//sodimm 31
//MX6UL_PAD_ENET2_TX_CLK__GPIO2_IO14 0x1b0b0//sodimm 46
MX6UL_PAD_SD1_CMD__GPIO2_IO16 0x1b0b0//sodimm 48
MX6UL_PAD_SD1_CLK__GPIO2_IO17 0x1b0b0//sodimm 49
MX6UL_PAD_SD1_DATA0__GPIO2_IO18 0x1b0b0//sodimm 50
MX6UL_PAD_SD1_DATA1__GPIO2_IO19 0x1b0b0//sodimm 51
MX6UL_PAD_SD1_DATA3__GPIO2_IO21 0x1b0b0//sodimm 53
MX6UL_PAD_LCD_CLK__GPIO3_IO00 0x1b0b0//64
MX6UL_PAD_LCD_HSYNC__GPIO3_IO02 0x1b0b0//66
MX6UL_PAD_LCD_VSYNC__GPIO3_IO03 0x1b0b0//67
MX6UL_PAD_LCD_RESET__GPIO3_IO04 0x1b0b0//68
MX6UL_PAD_LCD_DATA00__GPIO3_IO05 0x1b0b0//69
MX6UL_PAD_LCD_DATA01__GPIO3_IO06 0x1b0b0//70
MX6UL_PAD_LCD_DATA02__GPIO3_IO07 0x1b0b0//71
MX6UL_PAD_LCD_DATA03__GPIO3_IO08 0x1b0b0//72
MX6UL_PAD_LCD_DATA04__GPIO3_IO09 0x1b0b0//73
MX6UL_PAD_LCD_DATA05__GPIO3_IO10 0x1b0b0//74
MX6UL_PAD_LCD_DATA07__GPIO3_IO12 0x1b0b0//76
MX6UL_PAD_LCD_DATA08__GPIO3_IO13 0x1b0b0//77
MX6UL_PAD_LCD_DATA09__GPIO3_IO14 0x1b0b0//78
MX6UL_PAD_LCD_DATA11__GPIO3_IO16 0x1b0b0//80
MX6UL_PAD_LCD_DATA13__GPIO3_IO18 0x1b0b0//82
MX6UL_PAD_LCD_DATA20__GPIO3_IO25 0x1b0b0//89
MX6UL_PAD_LCD_DATA10__GPIO3_IO15 0x1b0b0//75
MX6UL_PAD_LCD_DATA12__GPIO3_IO17 0x1b0b0//81
MX6UL_PAD_LCD_DATA17__GPIO3_IO22 0x1b0b0//86
//MX6UL_PAD_LCD_DATA19__GPIO3_IO24 0x1b0b0
MX6UL_PAD_SNVS_TAMPER5__GPIO5_IO05 0x1b0b0>;//133
//MX6UL_PAD_SNVS_TAMPER7__GPIO5_IO07 0x1b0b0
//MX6UL_PAD_SNVS_TAMPER3__GPIO5_IO03 0x1b0b0
//MX6UL_PAD_BOOT_MODE0__GPIO5_IO10 0x1b0b0
//MX6UL_PAD_LCD_DATA16__GPIO3_IO21 0x1b0b0
//MX6UL_PAD_LCD_ENABLE__GPIO3_IO01 0x1b0b0
//MX6UL_PAD_ENET2_TX_DATA0__GPIO2_IO11 0x1b0b0

Thanks

Regards

João Coelho

Obter o Outlook para Androidhttps://aka.ms/AAb9ysg

Hi @jc1982as,

In order to set the right configuration for your pins, you need to take a look at the processor reference manual from NXP, you can download it here: NXP Sign In | Register
For that, you’ll need an NXP account.
Once you’ve downloaded the manual, you need to search for the control register for your pins. Let’s get your first pin, for example, MX6UL_PAD_GPIO1_IO08__GPIO1_IO08.
For this pin, you will have to take a look in section 32.6.161 called SW_PAD_CTL_PAD_GPIO1_IO08 SW PAD Control Register (IOMUXC_SW_PAD_CTL_PAD_GPIO1_IO08):

There you have the pins and the fields that you should set, according to your needs.

Let me know if you need anything else.

Best Regards,
Hiago.