How to configure GPIO as output high when board boot up in DTS

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

How to configure GPIO as output high when board boot up in DTS

335 Views
wayne055026
Contributor I

Hello,

We are using custom designed board using i.MX6UL SoC.

If we need to set GPIO for wifi enable pin as output high to 3.3V, how should we config the detail settings in DTS?

We have enabled GPIO3_21 as below iomux and used for sd-mmc:

 

pinctrl_wifi_bt: wifi_bt_grp {
fsl,pins = <
/* wifi wakeup host */
MX6ULL_PAD_SNVS_TAMPER8__GPIO5_IO08 0x1b0b0
/* wifi enable */
MX6UL_PAD_LCD_DATA16__GPIO3_IO21  0x1b0b0
/* BT enable */
MX6UL_PAD_LCD_DATA15__GPIO3_IO20 0x1b0b0
>;
};
 

reg_sd1_vmmc: regulator-sd1 {
compatible = "regulator-gpio";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_wifi_bt>;
regulator-name = "SD1_REG";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <3300000>;
regulator-type = "voltage";
regulator-boot-on;
enable-active-high;
wlan_en = <&gpio3 21 GPIO_ACTIVE_HIGH GPIO_DIR_OUT>;
bt_en = <&gpio3 20 GPIO_ACTIVE_HIGH GPIO_DIR_OUT>;
gpios-states = <1>;
states = <1800000 0x1>, <3300000 0x0>;
};

 

&usdhc1 {
pinctrl-names = "default", "state_100mhz", "state_200mhz";
pinctrl-0 = <&pinctrl_usdhc1>;
pinctrl-1 = <&pinctrl_usdhc1_100mhz>;
pinctrl-2 = <&pinctrl_usdhc1_200mhz>;
bus-width = <4>;
keep-power-in-suspend;
enable-sdio-wakeup;
non-removable;
pm-ignore-notify;
wifi-host;
vmmc-supply = <&reg_sd1_vmmc>;
status = "okay";
};

 

Thanks & best regards,

Wayne

 

0 Kudos
2 Replies

288 Views
JorgeCas
NXP TechSupport
NXP TechSupport

Hello,

You could try to add the next property to the GPIO on your device tree:

default-state = "on";

Best regards.

0 Kudos

240 Views
wayne055026
Contributor I

Hi Jorge,

 

Thanks for your help.

However, I added below settings and it works. Thanks.

 

	wifi_pwrseq: sdio-pwrseq {
		compatible = "mmc-pwrseq-simple";
		pinctrl-names = "default";
		regulator-always-on;
		regulator-name = "+V3.3";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		pinctrl-0 = <&pinctrl_wifi_bt>;
		reset-gpios = <&gpio3 21 0>;
		enable-active-high;
	};
0 Kudos