linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Modem control lines for RTSCTS hardware flow control via rts-gpio and cts-gpio with IMX
@ 2022-01-06 23:55 Tim Harvey
  2022-01-14  3:08 ` Tim Harvey
  0 siblings, 1 reply; 9+ messages in thread
From: Tim Harvey @ 2022-01-06 23:55 UTC (permalink / raw)
  To: linux-serial

Greetings,

I have long used modem control lines via GPIO with the IMX driver for
RS485 via rts-gpios in the scenario where an RS485 transceiver
transmit enable is connected to a GPIO representing RTS.

Therefore I 'thought' that one could use rts-gpios and cts-gpios for
hardware flow control on an IMX UART but it appears I may be wrong as
when I define those along with 'uart-has-rtscts' UART communication
ceases between the IMX and a device using hardware flow control.

As an example take the following which describes a UART with RTSCTS
flow control connected to a broadcom Bluetooth HCI radio:

The following works:
&uart4 {
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_uart4>,<&pinctrl_bten>;
        uart-has-rtscts;
        status = "okay";

        bluetooth {
                compatible = "brcm,bcm4330-bt";
                shutdown-gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>;
        };
};

&iomuxc {
        pinctrl_bten: btengrp {
                fsl,pins = <
                        MX6QDL_PAD_GPIO_2__GPIO1_IO02           0x1b0b1
                >;
        };

        pinctrl_uart4: uart4grp {
                fsl,pins = <
                        MX6QDL_PAD_CSI0_DAT12__UART4_TX_DATA    0x1b0b1
                        MX6QDL_PAD_CSI0_DAT13__UART4_RX_DATA    0x1b0b1
                        MX6QDL_PAD_CSI0_DAT16__UART4_RTS_B      0x1b0b1
                        MX6QDL_PAD_CSI0_DAT17__UART4_CTS_B      0x1b0b1
                >;
        };
};

The following where I've replaced the RTS/CTS with gpio does not work:
&uart4 {
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_uart4>,<&pinctrl_bten>;
        rts-gpios = <&gpio6 2 GPIO_ACTIVE_LOW>;
        cts-gpios = <&gpio6 3 GPIO_ACTIVE_LOW>;
        uart-has-rtscts;
        status = "okay";

        bluetooth {
                compatible = "brcm,bcm4330-bt";
                shutdown-gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>;
        };
};

&iomuxc {
        pinctrl_bten: btengrp {
                fsl,pins = <
                        MX6QDL_PAD_GPIO_2__GPIO1_IO02           0x1b0b1
                >;
        };

        pinctrl_uart4: uart4grp {
                fsl,pins = <
                        MX6QDL_PAD_CSI0_DAT12__UART4_TX_DATA    0x1b0b1
                        MX6QDL_PAD_CSI0_DAT13__UART4_RX_DATA    0x1b0b1
                        MX6QDL_PAD_CSI0_DAT16__GPIO6_IO02       0x1b0b1
                        MX6QDL_PAD_CSI0_DAT17__GPIO6_IO03       0x1b0b1
                >;
        };
};

In the above example of course I could simply use the version that
works but the reason I want to use rts-gpios and cts-gpios is that I
have cases where I don't have access to the RTS/CTS pinmux options and
thus can only use gpio's.

I'm hoping perhaps I just have something misconfigured or that perhaps
something simple is missing from drivers/tty/serial/imx.c in order to
use gpio's as hardware flow control. I've tried flipping the rts/cts
gpios and polarity in case I had something simply backwards but that
still did not work.

Any ideas or suggestions?

Best regards,

Tim

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-02-12 11:50 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-06 23:55 Modem control lines for RTSCTS hardware flow control via rts-gpio and cts-gpio with IMX Tim Harvey
2022-01-14  3:08 ` Tim Harvey
2022-01-14  6:19   ` Tomasz Moń
2022-01-24  9:52     ` Richard Genoud
2022-01-27  0:00       ` Tim Harvey
2022-02-10 21:30         ` Tim Harvey
2022-02-12 11:50           ` Sergey Organov
2022-01-24 23:56     ` Tim Harvey
2022-01-25 10:17       ` Richard Genoud

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).