How to set gpio2io04 to PAD_CTRL_HYS_PU mode in torizon

Hi
toradex engineers

This is my first time using torizon,I encountered a problem:
I want to set gpio2io4 to input pull-up mode,so i used torizon/arm32v7-debian-dev-tools,I created my-overlay.dts with the following content:

/dts-v1/;
/plugin/;
/ {
compatible = "toradex";
fragment@0 {
target = <&iomuxc>;
__overlay__ {
pinctrl_apalis_gpio1: gpio2io04grp {
fsl,pins = <
0x30c 0x6f4 0x000 0x5 0x0 0x1b0b0
>;
};

};
};
};

Then used dtconf build --no-git-repo my-overlay.dts;dtconf validate my-overlay.dts;dtconf enable my-overlay.dts;

Then i quit torizon/arm32v7-debian-dev-tools and reboot the system。

But kernel cannot start

Why does this happen?How can this be resolved?How can I set gpio2io04 as input pull-up mode through the device tree in torizon?

Thanks!

Hi @weixiaokai,

apply overlay target directly to pinctrl_apalis_gpio1 using:

/dts-v1/;
/plugin/;

/ {
	compatible = "toradex,apalis_imx6q";
	fragment@0 {
		target = <&pinctrl_apalis_gpio1>;
		__overlay__ {
			fsl,pins = <
				0x30c 0x6f4 0x000 0x5 0x0 0x1b0b0
			>;
		};
	};
};

If you define node pinctrl_apalis_gpio1: gpio2io04grp targeting &iomuxc the original phandle reference will be lost in the overlay and the system will try load a undefined reference.

If you want to create new nodes for target iomuxc with new functions or configs you need to define the

....
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_apalis_gpio1 &pinctrl_apalis_mynode ... >;
....

on the overlays too.

Best Regards,
Matheus