<?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>topic mctrl_gpio_set empty? in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/mctrl-gpio-set-empty/m-p/1229655#M169352</link>
    <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;I'm trying to make RS-485 connection work in half-duplex mode on the i.MX8&lt;/P&gt;&lt;P&gt;Found this very similar problem here:&amp;nbsp;&lt;A href="https://community.nxp.com/t5/i-MX-Processors/Does-UART-in-RS485-mode-support-only-9-Bit-mode-for-i-MX6/m-p/699703" target="_blank" rel="noopener"&gt;https://community.nxp.com/t5/i-MX-Processors/Does-UART-in-RS485-mode-support-only-9-Bit-mode-for-i-MX6/m-p/699703&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Looks like the solution was to add the&amp;nbsp;&lt;SPAN&gt;rs485-enabled-at-boot-time property in the required uart node in the device tree. I searched in the kernel code and this is checked at the function&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;STRONG&gt;uart_get_rs485_mode&lt;/STRONG&gt;. If the property is present the&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;SER_RS485_ENABLED flag is set&lt;BR /&gt;&lt;BR /&gt;But digging deeper into the code, the function that should actually set the RTS pin to the required value is empty.&lt;BR /&gt;That function is &lt;STRONG&gt;mctrl_gpio_set&lt;/STRONG&gt; which is called by both the function&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN&gt;imx_uart_rts_active&amp;nbsp;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;and&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;imx_uart_rts_inactive&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;That can be checked &lt;A href="https://elixir.bootlin.com/linux/v5.11-rc7/source/drivers/tty/serial/serial_mctrl_gpio.h" target="_self"&gt;here&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;I didn't test in my board yet to see if just adding the&amp;nbsp;&lt;SPAN&gt;rs485-enabled-at-boot-time property enables the half-duplex comm. But I'm curious about why is that function empty in the kernel code&lt;BR /&gt;&lt;BR /&gt;Thank you so much!&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 11 Feb 2021 05:07:12 GMT</pubDate>
    <dc:creator>jose_au_zone</dc:creator>
    <dc:date>2021-02-11T05:07:12Z</dc:date>
    <item>
      <title>mctrl_gpio_set empty?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/mctrl-gpio-set-empty/m-p/1229655#M169352</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;I'm trying to make RS-485 connection work in half-duplex mode on the i.MX8&lt;/P&gt;&lt;P&gt;Found this very similar problem here:&amp;nbsp;&lt;A href="https://community.nxp.com/t5/i-MX-Processors/Does-UART-in-RS485-mode-support-only-9-Bit-mode-for-i-MX6/m-p/699703" target="_blank" rel="noopener"&gt;https://community.nxp.com/t5/i-MX-Processors/Does-UART-in-RS485-mode-support-only-9-Bit-mode-for-i-MX6/m-p/699703&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Looks like the solution was to add the&amp;nbsp;&lt;SPAN&gt;rs485-enabled-at-boot-time property in the required uart node in the device tree. I searched in the kernel code and this is checked at the function&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;STRONG&gt;uart_get_rs485_mode&lt;/STRONG&gt;. If the property is present the&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;SER_RS485_ENABLED flag is set&lt;BR /&gt;&lt;BR /&gt;But digging deeper into the code, the function that should actually set the RTS pin to the required value is empty.&lt;BR /&gt;That function is &lt;STRONG&gt;mctrl_gpio_set&lt;/STRONG&gt; which is called by both the function&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN&gt;imx_uart_rts_active&amp;nbsp;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;and&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;imx_uart_rts_inactive&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;That can be checked &lt;A href="https://elixir.bootlin.com/linux/v5.11-rc7/source/drivers/tty/serial/serial_mctrl_gpio.h" target="_self"&gt;here&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;I didn't test in my board yet to see if just adding the&amp;nbsp;&lt;SPAN&gt;rs485-enabled-at-boot-time property enables the half-duplex comm. But I'm curious about why is that function empty in the kernel code&lt;BR /&gt;&lt;BR /&gt;Thank you so much!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Feb 2021 05:07:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/mctrl-gpio-set-empty/m-p/1229655#M169352</guid>
      <dc:creator>jose_au_zone</dc:creator>
      <dc:date>2021-02-11T05:07:12Z</dc:date>
    </item>
    <item>
      <title>Re: mctrl_gpio_set empty?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/mctrl-gpio-set-empty/m-p/1229706#M169366</link>
      <description>&lt;P&gt;Hi jose_au_zone&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;seems it is used in imx.c using "SER_RS485_ENABLED",&lt;/P&gt;
&lt;P&gt;&lt;A href="https://source.codeaurora.org/external/imx/linux-imx/tree/drivers/tty/serial/imx.c?h=imx_5.4.70_2.3.0" target="_blank"&gt;https://source.codeaurora.org/external/imx/linux-imx/tree/drivers/tty/serial/imx.c?h=imx_5.4.70_2.3.0&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;if (device_property_read_bool(dev, "linux,rs485-enabled-at-boot-time"))&lt;BR /&gt;&lt;BR /&gt;rs485conf-&amp;gt;flags |= SER_RS485_ENABLED;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://source.codeaurora.org/external/imx/linux-imx/tree/drivers/tty/serial/serial_core.c?h=imx_5.4.70_2.3.0" target="_blank"&gt;https://source.codeaurora.org/external/imx/linux-imx/tree/drivers/tty/serial/serial_core.c?h=imx_5.4.70_2.3.0&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards&lt;BR /&gt;igor&lt;/P&gt;</description>
      <pubDate>Thu, 11 Feb 2021 07:29:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/mctrl-gpio-set-empty/m-p/1229706#M169366</guid>
      <dc:creator>igorpadykov</dc:creator>
      <dc:date>2021-02-11T07:29:58Z</dc:date>
    </item>
    <item>
      <title>Re: mctrl_gpio_set empty?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/mctrl-gpio-set-empty/m-p/1229963#M169398</link>
      <description>&lt;P&gt;Thanks for the reply. That I know already, but why the function that would change the RTS line to the appropriate level is empty? That's what I wanted to know&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 11 Feb 2021 15:54:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/mctrl-gpio-set-empty/m-p/1229963#M169398</guid>
      <dc:creator>jose_au_zone</dc:creator>
      <dc:date>2021-02-11T15:54:43Z</dc:date>
    </item>
    <item>
      <title>Re: mctrl_gpio_set empty?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/mctrl-gpio-set-empty/m-p/1230159#M169414</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;gt;why the function that would change the RTS line to the appropriate level is empty?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;imx_uart_start_tx() seems changes the RTS line, it is not empty :&lt;/P&gt;
&lt;P&gt;&lt;A href="https://source.codeaurora.org/external/imx/linux-imx/tree/drivers/tty/serial/imx.c?h=imx_5.4.70_2.3.0" target="_blank"&gt;https://source.codeaurora.org/external/imx/linux-imx/tree/drivers/tty/serial/imx.c?h=imx_5.4.70_2.3.0&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards&lt;BR /&gt;igor&lt;/P&gt;</description>
      <pubDate>Fri, 12 Feb 2021 03:56:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/mctrl-gpio-set-empty/m-p/1230159#M169414</guid>
      <dc:creator>igorpadykov</dc:creator>
      <dc:date>2021-02-12T03:56:24Z</dc:date>
    </item>
  </channel>
</rss>

