Disable RTS and CTS for UART2 and use as GPIO on Colibri iMX6

Hello,

I’m currenty using UART2, which is configured using a custom dts file.
This looks like this (a snippet from the dts file):

#include "imx6dl.dtsi"
#include "imx6qdl-colibri.dtsi"

&iomuxc {
	pinctrl-names = "default";
	pinctrl-0 = <
		&pinctrl_gpio
	>;

	gpio {
		pinctrl_gpio: gpio-custom {
			fsl,pins = <
				MX6QDL_PAD_SD4_DAT5__GPIO2_IO13  PAD_CTRL_HYS_PU /* SODIMM 34 */
			>;
		};
	};
};

&uart2 {
	status = "okay";
	/* Delete the uart-has-rtscts property so these pins can be used as IO */
	/delete-property/fsl,uart-has-rtscts;
};

With the configuration above I’m trying to disable the RTS and CTS pins of UART2 so these pins can be used as regular IO.
Unfortunately when I try this using the dts file above, the UART2 device driver handler (/dev/ttymxc1) disappears from the user-space after flashing the new image.

Does anyone know what I’m missing?

Thanks in advance!

I think I’ve found what was wrong with my dts file above.
It seems like the problem was that the RTS pin was configured multiple times (once in my own dts file as GPIO and once as RTS in one of the included files).

To fix this, I’ve overridden pinctrl-0 of the UART2 with my own configuration that only configures the RX and TX and leaves the CTS and RTS pins alone:

&uart2 {
	status = "okay";
	pinctrl-0 = <&pinctrl_uart2_custom>;
	/* Delete the uart-has-rtscts property so these pins can be used as IO */
	/delete-property/fsl,uart-has-rtscts;
};

Now when I flash the system with the updated dts file, the device handler is back in /dev/ and I can use the RTS pin as regular GPIO.

Perfect that you found the solution. Thanks for the feedback.

Hi @DemKev
Are you able to post your full dts device tree?