<?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 How do I change the IMX6 UART clock speed in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/How-do-I-change-the-IMX6-UART-clock-speed/m-p/241751#M20241</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt; I have a IMX6 quad core development board. I am running Yocto linux on it. I need a custom baud rate of 1041667 on a serial port to talk to a device. With the current UART clock speed of 80MHz, I won't be able to get that particular speed. If I can change the UART clock to 50MHz, the base baud rate will be 3125000 and with a custom divisor of 3, I will get the 1041667 baud rate. &lt;BR /&gt;I understand that the UART clock speed is derived from a main clock that is used for CPU and other subsytem.&amp;nbsp; Where do I start looking to change the clock speed for the UART?&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Siva&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 20 Sep 2013 01:58:20 GMT</pubDate>
    <dc:creator>sivaalagarsamy</dc:creator>
    <dc:date>2013-09-20T01:58:20Z</dc:date>
    <item>
      <title>How do I change the IMX6 UART clock speed</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-do-I-change-the-IMX6-UART-clock-speed/m-p/241751#M20241</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt; I have a IMX6 quad core development board. I am running Yocto linux on it. I need a custom baud rate of 1041667 on a serial port to talk to a device. With the current UART clock speed of 80MHz, I won't be able to get that particular speed. If I can change the UART clock to 50MHz, the base baud rate will be 3125000 and with a custom divisor of 3, I will get the 1041667 baud rate. &lt;BR /&gt;I understand that the UART clock speed is derived from a main clock that is used for CPU and other subsytem.&amp;nbsp; Where do I start looking to change the clock speed for the UART?&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Siva&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Sep 2013 01:58:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-do-I-change-the-IMX6-UART-clock-speed/m-p/241751#M20241</guid>
      <dc:creator>sivaalagarsamy</dc:creator>
      <dc:date>2013-09-20T01:58:20Z</dc:date>
    </item>
    <item>
      <title>Re: How do I change the IMX6 UART clock speed</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-do-I-change-the-IMX6-UART-clock-speed/m-p/241752#M20242</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To answer your question - I did some checking - I don't think the input&amp;nbsp; to the UART module clock is flexible.&amp;nbsp; Meaning, it comes from PLL3 which is used to create the 480MHz USB clock, and is divided down to 80 MHz for the input to the UART (integer divided by 6).&amp;nbsp; This is per the reference manual of the chip - look for "CCM Clock Tree".&amp;nbsp; PLL3's output is fixed at 20x the input clock to the SOC (usually 24 MHz), so this is 480 MHz.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The baud rate generator for the chip is &lt;STRONG&gt;really&lt;/STRONG&gt; flexible, though, so you really shouldn't need to change the input clock to the UART module to achieve the desired baud rate.&amp;nbsp; You should be able to get the exact rate you need using the binary rate multiplier in the UART (BRM).&amp;nbsp; That appears to have the ability to multiply/divide the reference clock using a 16-bit numerator and denominator.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Module Clock&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 80&lt;/P&gt;&lt;P&gt; Reference Clock&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 26.66666667&lt;/P&gt;&lt;P&gt; Reference Clock Divider&amp;nbsp; 3&lt;/P&gt;&lt;P&gt; UBMR&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1599&lt;/P&gt;&lt;P&gt; UBIR&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 999&lt;/P&gt;&lt;P&gt; Calculated Baud Rate&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1.041666667&lt;/P&gt;&lt;P&gt; Desired Baud Rate&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1.041666667&lt;/P&gt;&lt;P&gt; 16x desired baud rate&amp;nbsp;&amp;nbsp;&amp;nbsp; 16.66666667&lt;/P&gt;&lt;P&gt; Ratio&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1.6&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; I hope this helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Sep 2013 03:44:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-do-I-change-the-IMX6-UART-clock-speed/m-p/241752#M20242</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2013-09-20T03:44:04Z</dc:date>
    </item>
    <item>
      <title>Re: How do I change the IMX6 UART clock speed</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-do-I-change-the-IMX6-UART-clock-speed/m-p/241753#M20243</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the information. I started looking into the linux serial driver to see why the custom baud rate was not working. The driver does calculate the right numerator and denominator for a given buad rate and sets it in the UBMR and UBIR registers. The only problem I see is that the driver calls&amp;nbsp; uart_get_baud_rate function in the serial_core.c which in turn calls "tty_termios_baud_rate" in tty_ioctl.c. This function has a #ifdef BOTHER to allow custom baud rate. This BOTHER is not defined for the freescale kernel.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tty_ioctl.c: &lt;/P&gt;&lt;P&gt;&lt;A href="http://lxr.free-electrons.com/source/drivers/tty/tty_ioctl.c#L305" name="L305" style="border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: #999999; color: black;"&gt;305&lt;/A&gt; &lt;A href="http://lxr.free-electrons.com/ident?i=speed_t" style="border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: #999999; color: black;"&gt;speed_t&lt;/A&gt; &lt;A href="http://lxr.free-electrons.com/ident?i=tty_termios_baud_rate" style="border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: #999999; color: black;"&gt;tty_termios_baud_rate&lt;/A&gt;(struct &lt;A href="http://lxr.free-electrons.com/ident?i=ktermios" style="border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: #999999; color: black;"&gt;ktermios&lt;/A&gt; *&lt;A href="http://lxr.free-electrons.com/ident?i=termios" style="border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: #999999; color: black;"&gt;termios&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;&lt;A href="http://lxr.free-electrons.com/source/drivers/tty/tty_ioctl.c#L306" name="L306" style="border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: #999999; color: black;"&gt;306&lt;/A&gt; {&lt;/P&gt;&lt;P&gt;&lt;A href="http://lxr.free-electrons.com/source/drivers/tty/tty_ioctl.c#L307" name="L307" style="border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: #999999; color: black;"&gt;307&lt;/A&gt;&amp;nbsp; unsigned int cbaud;&lt;/P&gt;&lt;P&gt;&lt;A href="http://lxr.free-electrons.com/source/drivers/tty/tty_ioctl.c#L308" name="L308" style="border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: #999999; color: black;"&gt;308&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;A href="http://lxr.free-electrons.com/source/drivers/tty/tty_ioctl.c#L309" name="L309" style="border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: #999999; color: black;"&gt;309&lt;/A&gt;&amp;nbsp; cbaud = &lt;A href="http://lxr.free-electrons.com/ident?i=termios" style="border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: #999999; color: black;"&gt;termios&lt;/A&gt;-&amp;gt;c_cflag &amp;amp; &lt;A href="http://lxr.free-electrons.com/ident?i=CBAUD" style="border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: #999999; color: black;"&gt;CBAUD&lt;/A&gt;;&lt;/P&gt;&lt;P&gt;&lt;A href="http://lxr.free-electrons.com/source/drivers/tty/tty_ioctl.c#L310" name="L310" style="border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: #999999; color: black;"&gt;310&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;A href="http://lxr.free-electrons.com/source/drivers/tty/tty_ioctl.c#L311" name="L311" style="border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: #999999; color: black;"&gt;311&lt;/A&gt; #ifdef &lt;A href="http://lxr.free-electrons.com/ident?i=BOTHER" style="border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: #999999; color: black;"&gt;BOTHER&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://lxr.free-electrons.com/source/drivers/tty/tty_ioctl.c#L312" name="L312" style="border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: #999999; color: black;"&gt;312&lt;/A&gt;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;&lt;EM&gt;/* Magic token for arbitrary speed via c_ispeed/c_ospeed */&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://lxr.free-electrons.com/source/drivers/tty/tty_ioctl.c#L313" name="L313" style="border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: #999999; color: black;"&gt;313&lt;/A&gt;&amp;nbsp; if (cbaud == &lt;A href="http://lxr.free-electrons.com/ident?i=BOTHER" style="border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: #999999; color: black;"&gt;BOTHER&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;&lt;A href="http://lxr.free-electrons.com/source/drivers/tty/tty_ioctl.c#L314" name="L314" style="border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: #999999; color: black;"&gt;314&lt;/A&gt;&amp;nbsp; return &lt;A href="http://lxr.free-electrons.com/ident?i=termios" style="border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: #999999; color: black;"&gt;termios&lt;/A&gt;-&amp;gt;c_ospeed;&lt;/P&gt;&lt;P&gt;&lt;A href="http://lxr.free-electrons.com/source/drivers/tty/tty_ioctl.c#L315" name="L315" style="border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: #999999; color: black;"&gt;315&lt;/A&gt; #endif&lt;/P&gt;&lt;P&gt;&lt;A href="http://lxr.free-electrons.com/source/drivers/tty/tty_ioctl.c#L316" name="L316" style="border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: #999999; color: black;"&gt;316&lt;/A&gt;&amp;nbsp; if (cbaud &amp;amp; &lt;A href="http://lxr.free-electrons.com/ident?i=CBAUDEX" style="border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: #999999; color: black;"&gt;CBAUDEX&lt;/A&gt;) {&lt;/P&gt;&lt;P&gt;&lt;A href="http://lxr.free-electrons.com/source/drivers/tty/tty_ioctl.c#L317" name="L317" style="border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: #999999; color: black;"&gt;317&lt;/A&gt;&amp;nbsp; cbaud &amp;amp;= ~CBAUDEX;&lt;/P&gt;&lt;P&gt;&lt;A href="http://lxr.free-electrons.com/source/drivers/tty/tty_ioctl.c#L318" name="L318" style="border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: #999999; color: black;"&gt;318&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;A href="http://lxr.free-electrons.com/source/drivers/tty/tty_ioctl.c#L319" name="L319" style="border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: #999999; color: black;"&gt;319&lt;/A&gt;&amp;nbsp; if (cbaud &amp;lt; 1 || cbaud + 15 &amp;gt; &lt;A href="http://lxr.free-electrons.com/ident?i=n_baud_table" style="border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: #999999; color: black;"&gt;n_baud_table&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;&lt;A href="http://lxr.free-electrons.com/source/drivers/tty/tty_ioctl.c#L320" name="L320" style="border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: #999999; color: black;"&gt;320&lt;/A&gt;&amp;nbsp;&amp;nbsp; &lt;A href="http://lxr.free-electrons.com/ident?i=termios" style="border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: #999999; color: black;"&gt;termios&lt;/A&gt;-&amp;gt;c_cflag &amp;amp;= ~CBAUDEX;&lt;/P&gt;&lt;P&gt;&lt;A href="http://lxr.free-electrons.com/source/drivers/tty/tty_ioctl.c#L321" name="L321" style="border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: #999999; color: black;"&gt;321&lt;/A&gt;&amp;nbsp; else&lt;/P&gt;&lt;P&gt;&lt;A href="http://lxr.free-electrons.com/source/drivers/tty/tty_ioctl.c#L322" name="L322" style="border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: #999999; color: black;"&gt;322&lt;/A&gt;&amp;nbsp; cbaud += 15;&lt;/P&gt;&lt;P&gt;&lt;A href="http://lxr.free-electrons.com/source/drivers/tty/tty_ioctl.c#L323" name="L323" style="border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: #999999; color: black;"&gt;323&lt;/A&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&lt;A href="http://lxr.free-electrons.com/source/drivers/tty/tty_ioctl.c#L324" name="L324" style="border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: #999999; color: black;"&gt;324&lt;/A&gt;&amp;nbsp; return &lt;A href="http://lxr.free-electrons.com/ident?i=baud_table" style="border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: #999999; color: black;"&gt;baud_table&lt;/A&gt;[cbaud];&lt;/P&gt;&lt;P&gt;&lt;A href="http://lxr.free-electrons.com/source/drivers/tty/tty_ioctl.c#L325" name="L325" style="border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: #999999; color: black;"&gt;325&lt;/A&gt; }&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Sep 2013 12:36:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-do-I-change-the-IMX6-UART-clock-speed/m-p/241753#M20243</guid>
      <dc:creator>sivaalagarsamy</dc:creator>
      <dc:date>2013-09-21T12:36:47Z</dc:date>
    </item>
    <item>
      <title>Re: How do I change the IMX6 UART clock speed</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-do-I-change-the-IMX6-UART-clock-speed/m-p/241754#M20244</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Mr.Siva,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you please show me how we can fix this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am looking forward to your respond!&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Tan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 09 Jan 2016 10:37:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-do-I-change-the-IMX6-UART-clock-speed/m-p/241754#M20244</guid>
      <dc:creator>letan</dc:creator>
      <dc:date>2016-01-09T10:37:45Z</dc:date>
    </item>
    <item>
      <title>Re: How do I change the IMX6 UART clock speed</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-do-I-change-the-IMX6-UART-clock-speed/m-p/241755#M20245</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://github.com/AbhraneelBera/wiringBone/blob/master/library/UART.cpp" title="https://github.com/AbhraneelBera/wiringBone/blob/master/library/UART.cpp"&gt;wiringBone/UART.cpp at master · AbhraneelBera/wiringBone · GitHub&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This uses &lt;STRONG&gt;&lt;SPAN class="pl-en"&gt;termios2 &lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN class="pl-en"&gt;to set the custom baudrate&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="pl-en"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="pl-en"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jul 2016 03:32:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-do-I-change-the-IMX6-UART-clock-speed/m-p/241755#M20245</guid>
      <dc:creator>letan</dc:creator>
      <dc:date>2016-07-11T03:32:04Z</dc:date>
    </item>
  </channel>
</rss>

