<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>i.MX ProcessorsのトピックRe: IMX93 Enabling USART flow control (DCD, DSR, DTR, RTS, CTS)</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/IMX93-Enabling-USART-flow-control-DCD-DSR-DTR-RTS-CTS/m-p/2057287#M234787</link>
    <description>&lt;P&gt;HI &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/247707"&gt;@wcastidex&lt;/a&gt;!&lt;/P&gt;
&lt;P&gt;Thank you for contacting NXP Support!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unfortunately those functions are not implemented in the driver but the kernel can manage those functions using gpios instead.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can add the next lines to your device tree:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;	dtr-gpios = &amp;lt;&amp;amp;gpio4 3 GPIO_ACTIVE_LOW&amp;gt;;
	dsr-gpios = &amp;lt;&amp;amp;gpio4 4 GPIO_ACTIVE_LOW&amp;gt;;
	dcd-gpios = &amp;lt;&amp;amp;gpio4 6 GPIO_ACTIVE_LOW&amp;gt;;

#Example&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards!&lt;/P&gt;
&lt;P&gt;Chavira&lt;/P&gt;</description>
    <pubDate>Thu, 06 Mar 2025 18:46:01 GMT</pubDate>
    <dc:creator>Chavira</dc:creator>
    <dc:date>2025-03-06T18:46:01Z</dc:date>
    <item>
      <title>IMX93 Enabling USART flow control (DCD, DSR, DTR, RTS, CTS)</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/IMX93-Enabling-USART-flow-control-DCD-DSR-DTR-RTS-CTS/m-p/2057174#M234782</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently trying to enable full hardware flow control on LPUART4 on a iMX93, I've had success enabling RTS and CTS but haven't been able to get DSR,&amp;nbsp; DCD, and DTR enabled.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My DT pins are defined as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;pinctrl_uart4: uart4grp {
fsl,pins = &amp;lt;
MX93_PAD_ENET2_RD0__LPUART4_RX 0x31e
MX93_PAD_ENET2_TD0__LPUART4_TX 0x31e
MX93_PAD_ENET2_TD1__LPUART4_RTS_B 0x31e
MX93_PAD_ENET2_RD2__LPUART4_CTS_B 0x31e
MX93_PAD_ENET2_RX_CTL__LPUART4_DSR_B 0x31e
MX93_PAD_ENET2_TX_CTL__LPUART4_DTR_B 0x31e
&amp;gt;;
};&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;and&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;lpuart4: serial@42580000 {
compatible = "fsl,imx93-lpuart", "fsl,imx8ulp-lpuart", "fsl,imx7ulp-lpuart";
reg = &amp;lt;0x42580000 0x1000&amp;gt;;
interrupts = &amp;lt;GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH&amp;gt;;
clocks = &amp;lt;&amp;amp;clk IMX93_CLK_LPUART4_GATE&amp;gt;;
clock-names = "ipg";
dmas = &amp;lt;&amp;amp;edma2 19 0 0&amp;gt;, &amp;lt;&amp;amp;edma2 20 0 1&amp;gt;;
dma-names = "tx","rx";
uart-has-rtscts;
status = "ok";
};&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;but when looking at the driver it doesnt seem to recognize RTS or DTR and I don't have a pin available for DCD.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;]# cat /proc/tty/driver/fsl-lpuart
serinfo:1.0 driver revision:
0: uart:FSL_LPUART mmio:0x44380010 irq:18 tx:12447 rx:43 RTS|CTS|DTR|DSR|CD
1: uart:FSL_LPUART mmio:0x42690010 irq:24 tx:0 rx:0 CTS|DSR|CD
2: uart:FSL_LPUART mmio:0x42570010 irq:20 tx:0 rx:0 CTS|DSR|CD
3: uart:FSL_LPUART mmio:0x42580010 irq:21 tx:0 rx:0 CTS|DSR|CD
4: uart:FSL_LPUART mmio:0x42590010 irq:22 tx:0 rx:0 CTS|DSR|CD
5: uart:FSL_LPUART mmio:0x425A0010 irq:23 tx:0 rx:0 CTS|DSR|CD
6: uart:FSL_LPUART mmio:0x44390010 irq:19 tx:0 rx:0 CTS|DSR|CD&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;I've looked through imx93-pinfunc.h for DCD but dont see an assignment, which is okay we can do it with a GPIO if needed but looking at page 4978 of IMX93RM it appears that the MODEM control register supports a DCD pin mapping.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Looking through some of the other nxp devtree files I have seen a reference to a device tree option such as rts-gpios, cts-gpios, dtr-gpios, dsr-gpios, and dcd-gpios but it appears this is assigning those pins as a gpio to be handled in software and not to the peripheral device?&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Confusingly uart0 is my debug port and it has all pins activated yet those pins aren't defined in my device tree and are not wired up on my hardware.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I've searched through kernel message log to make sure there were no pin assignment conflicts as well.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Any help is appreciated,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thank you,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Walter&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;LI-PRODUCT title="i.MX93" id="i.MX93"&gt;&lt;/LI-PRODUCT&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 06 Mar 2025 15:49:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/IMX93-Enabling-USART-flow-control-DCD-DSR-DTR-RTS-CTS/m-p/2057174#M234782</guid>
      <dc:creator>wcastidex</dc:creator>
      <dc:date>2025-03-06T15:49:37Z</dc:date>
    </item>
    <item>
      <title>Re: IMX93 Enabling USART flow control (DCD, DSR, DTR, RTS, CTS)</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/IMX93-Enabling-USART-flow-control-DCD-DSR-DTR-RTS-CTS/m-p/2057287#M234787</link>
      <description>&lt;P&gt;HI &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/247707"&gt;@wcastidex&lt;/a&gt;!&lt;/P&gt;
&lt;P&gt;Thank you for contacting NXP Support!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unfortunately those functions are not implemented in the driver but the kernel can manage those functions using gpios instead.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can add the next lines to your device tree:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;	dtr-gpios = &amp;lt;&amp;amp;gpio4 3 GPIO_ACTIVE_LOW&amp;gt;;
	dsr-gpios = &amp;lt;&amp;amp;gpio4 4 GPIO_ACTIVE_LOW&amp;gt;;
	dcd-gpios = &amp;lt;&amp;amp;gpio4 6 GPIO_ACTIVE_LOW&amp;gt;;

#Example&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards!&lt;/P&gt;
&lt;P&gt;Chavira&lt;/P&gt;</description>
      <pubDate>Thu, 06 Mar 2025 18:46:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/IMX93-Enabling-USART-flow-control-DCD-DSR-DTR-RTS-CTS/m-p/2057287#M234787</guid>
      <dc:creator>Chavira</dc:creator>
      <dc:date>2025-03-06T18:46:01Z</dc:date>
    </item>
    <item>
      <title>Re: IMX93 Enabling USART flow control (DCD, DSR, DTR, RTS, CTS)</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/IMX93-Enabling-USART-flow-control-DCD-DSR-DTR-RTS-CTS/m-p/2057372#M234788</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;gpio cts and rts can be used because the driver implements this function and calls the API provided by serial_mctrl_gpio.c, such as imx.c, another driver of imx.&lt;/P&gt;&lt;P&gt;However, fsl_lpuart.c does not see the API provided by serial_mctrl_gpio.c being called.&lt;/P&gt;&lt;P&gt;In addition, if uart-has-rtscts is not removed, even if the gpio control you mentioned is added, it will not work. Because the serial bindings have uart-has-rtscts; it means that the rts cts of the serial controller is used.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;serial.yaml&lt;/P&gt;&lt;P&gt;uart-has-rtscts:&lt;BR /&gt;$ref: /schemas/types.yaml#/definitions/flag&lt;BR /&gt;description:&lt;BR /&gt;The presence of this property indicates that the UART has dedicated lines&lt;BR /&gt;for RTS/CTS hardware flow control, and that they are available for use&lt;BR /&gt;(wired and enabled by pinmux configuration). This depends on both the&lt;BR /&gt;UART hardware and the board wiring.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;A href="https://github.com/nxp-imx/linux-imx/blob/lf-6.6.52-2.2.0/drivers/tty/serial/serial_mctrl_gpio.c" target="_blank"&gt;https://github.com/nxp-imx/linux-imx/blob/lf-6.6.52-2.2.0/drivers/tty/serial/serial_mctrl_gpio.c&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;A href="https://github.com/nxp-imx/linux-imx/tree/lf-6.6.52-2.2.0/drivers/tty/serial/fsl_lpuart.c" target="_blank"&gt;https://github.com/nxp-imx/linux-imx/tree/lf-6.6.52-2.2.0/drivers/tty/serial/fsl_lpuart.c&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/nxp-imx/linux-imx/tree/lf-6.6.52-2.2.0/drivers/tty/serial/imx.c" target="_blank"&gt;https://github.com/nxp-imx/linux-imx/tree/lf-6.6.52-2.2.0/drivers/tty/serial/imx.c&lt;/A&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;/* called with port.lock taken and irqs caller dependent */
static void imx_uart_rts_active(struct imx_port *sport, u32 *ucr2)
{
	*ucr2 &amp;amp;= ~(UCR2_CTSC | UCR2_CTS);

	mctrl_gpio_set(sport-&amp;gt;gpios, sport-&amp;gt;port.mctrl | TIOCM_RTS);
}

/* called with port.lock taken and irqs caller dependent */
static void imx_uart_rts_inactive(struct imx_port *sport, u32 *ucr2)
{
	*ucr2 &amp;amp;= ~UCR2_CTSC;
	*ucr2 |= UCR2_CTS;

	mctrl_gpio_set(sport-&amp;gt;gpios, sport-&amp;gt;port.mctrl &amp;amp; ~TIOCM_RTS);
}&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 06 Mar 2025 23:37:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/IMX93-Enabling-USART-flow-control-DCD-DSR-DTR-RTS-CTS/m-p/2057372#M234788</guid>
      <dc:creator>lapohab</dc:creator>
      <dc:date>2025-03-06T23:37:21Z</dc:date>
    </item>
    <item>
      <title>Re: IMX93 Enabling USART flow control (DCD, DSR, DTR, RTS, CTS)</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/IMX93-Enabling-USART-flow-control-DCD-DSR-DTR-RTS-CTS/m-p/2057388#M234789</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The serial port program is a standard program. Have you configured the serial port properties according to the ioctl provided by the Linux standard program?&lt;/P&gt;&lt;P&gt;Or use stty to set it?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;fcntl.h&amp;gt;
#include &amp;lt;unistd.h&amp;gt;
#include &amp;lt;sys/ioctl.h&amp;gt;
#include &amp;lt;termios.h&amp;gt;

int main() {
    int fd = open("/dev/ttyS0", O_RDWR); // Change to the correct serial port
    if (fd == -1) {
        perror("open");
        return 1;
    }

    int status;
    
    // Get current modem control lines
    ioctl(fd, TIOCMGET, &amp;amp;status);
    
    // Enable DTR (Data Terminal Ready)
    status |= TIOCM_DTR;
    
    // Apply new settings
    ioctl(fd, TIOCMSET, &amp;amp;status);

    printf("DTR enabled.\n");

    close(fd);
    return 0;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Mar 2025 00:16:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/IMX93-Enabling-USART-flow-control-DCD-DSR-DTR-RTS-CTS/m-p/2057388#M234789</guid>
      <dc:creator>matato</dc:creator>
      <dc:date>2025-03-07T00:16:53Z</dc:date>
    </item>
    <item>
      <title>Re: IMX93 Enabling USART flow control (DCD, DSR, DTR, RTS, CTS)</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/IMX93-Enabling-USART-flow-control-DCD-DSR-DTR-RTS-CTS/m-p/2059013#M234886</link>
      <description>&lt;P&gt;Hi&amp;nbsp;all!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The fsl-lpuart driver only can manage the cts and rts pins from hardware.&lt;/P&gt;
&lt;P&gt;since the other signals are not commonly used are not implemented in our driver but our hardware is capable to manage those signals.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As you mention, declaring the pins on device tree the Kernel is not solving the signals and for that case we have to do it manually in a c or python program.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards!&lt;/P&gt;
&lt;P&gt;Chavira&lt;/P&gt;</description>
      <pubDate>Mon, 10 Mar 2025 20:47:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/IMX93-Enabling-USART-flow-control-DCD-DSR-DTR-RTS-CTS/m-p/2059013#M234886</guid>
      <dc:creator>Chavira</dc:creator>
      <dc:date>2025-03-10T20:47:59Z</dc:date>
    </item>
  </channel>
</rss>

