How to correctly configure GPIO on imx6sx SABRE?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to correctly configure GPIO on imx6sx SABRE?

Jump to solution
780 Views
itsemast
Contributor II

I couldn't find any ready to be used GPIO pins on MCIMX6SX-SDB, so I decided to break out some pins from SD2 connector which I am not currently using. What changes to the device tree do I need to make in order to use SD2_CMD, SD2_CLK, SD2_DATA0, SD2_DATA1, SD2_DATA2, SD2_DATA3 as GPIO?

I have already removed these sections from imx6sx-sdb.dtsi:

&usdhc2 {
       pinctrl-names = "default";
       pinctrl-0 = <&pinctrl_usdhc2>;
       non-removable;
       no-1-8-v;
       keep-power-in-suspend;
       wakeup-source;
       status = "okay";
};
		pinctrl_usdhc2: usdhc2grp {
			fsl,pins = <
				MX6SX_PAD_SD2_CMD__USDHC2_CMD		0x17059
				MX6SX_PAD_SD2_CLK__USDHC2_CLK		0x10059
				MX6SX_PAD_SD2_DATA0__USDHC2_DATA0	0x17059
				MX6SX_PAD_SD2_DATA1__USDHC2_DATA1	0x17059
				MX6SX_PAD_SD2_DATA2__USDHC2_DATA2	0x17059
				MX6SX_PAD_SD2_DATA3__USDHC2_DATA3	0x17059
			>;
		};

I suppose now I need to add the definitions for the following pads:

  • MX6SX_PAD_SD2_CMD__GPIO6_IO_7
  • MX6SX_PAD_SD2_CLK__GPIO6_IO_6
  • MX6SX_PAD_SD2_DATA0__GPIO6_IO_8
  • MX6SX_PAD_SD2_DATA1__GPIO6_IO_9
  • MX6SX_PAD_SD2_DATA2__GPIO6_IO_10
  • MX6SX_PAD_SD2_DATA3__GPIO6_IO_11

But I'm not quite sure exactly how to do it. Could you please point me in the right direction?

Labels (3)
Tags (1)
0 Kudos
1 Solution
772 Views
igorpadykov
NXP Employee
NXP Employee

Hi Dima

 

one can try the same steps as for i.MX6UL

https://community.nxp.com/t5/i-MX-Processors/Simple-GPIO-Example-quandry/m-p/458731

 

Best regards
igor

 

View solution in original post

2 Replies
760 Views
itsemast
Contributor II

Thank you very much for your answer, in my case the configuration value of 0x80000000 was sufficient, but GPIO on IMX processors is very flexible, I might return to this thread one day.

0 Kudos
773 Views
igorpadykov
NXP Employee
NXP Employee

Hi Dima

 

one can try the same steps as for i.MX6UL

https://community.nxp.com/t5/i-MX-Processors/Simple-GPIO-Example-quandry/m-p/458731

 

Best regards
igor