<?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 Re: i.MX6 SoloX Cortex-M4 clock frequency in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/i-MX6-SoloX-Cortex-M4-clock-frequency/m-p/399880#M58930</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Verdana','sans-serif';"&gt;&amp;nbsp; According to section 2.1 (Key features) of “Freescale_MQX_i.MX6SoloX_GA_Release_Notes.pdf” :&lt;BR /&gt; “&lt;BR /&gt; • Cortex-M4 core clock: 227 MHz (default)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Verdana','sans-serif';"&gt;• AHB bus clock: 132 MHz (default)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Verdana','sans-serif';"&gt;“&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 12.0pt; font-family: 'Verdana','sans-serif';"&gt;&amp;nbsp; As for GPIO module of the i.MX6 SX : the GPIO logic is the actual bottleneck of i.MX &lt;BR /&gt;series,&amp;nbsp; since its GPIO is not intended for high speed real time tasks.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Yuri&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 23 Sep 2015 05:48:27 GMT</pubDate>
    <dc:creator>Yuri</dc:creator>
    <dc:date>2015-09-23T05:48:27Z</dc:date>
    <item>
      <title>i.MX6 SoloX Cortex-M4 clock frequency</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/i-MX6-SoloX-Cortex-M4-clock-frequency/m-p/399879#M58929</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Simple question: is M4 frequency set to 227 MHz by default in u-Boot boot parameters?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wrote a simple test application with gpio output to measure M4 frequency. Applications code goes something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set_gpio&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nop; nop; nop; nop; nop; nop; nop; nop; nop; nop;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; clear_gpio&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nop; nop; nop; nop; nop; nop; nop; nop; nop; nop;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set_gpio&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nop; nop; nop; nop; nop; nop; nop; nop; nop; nop; nop; nop; nop; nop; nop; nop; nop; nop; nop; nop;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; clear_gpio&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nop; nop; nop; nop; nop; nop; nop; nop; nop; nop;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;Basically I'm measuring execution time of 10 nop instructions. The difference in execution time I'm getting is 540 ns which gives me 54 ns per instruction (should be between 4 and 5 ns).&lt;/P&gt;&lt;P&gt;Cortex-m4 generic user guide states: "NOP does nothing. NOP is not necessarily a time-consuming NOP. The processor might remove it&lt;/P&gt;&lt;P&gt;from the pipeline before it reaches the execution stage.", so I have written a similar example with "teq" (test equal) assembly instruction. Difference in execution when using teq is 1 us (which gives 100 ns per instruction).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By reading CCM registers it can be seen that M4_CLK_ROOT uses PLL3_PFD3 divided by 2 so frequency should be 227.35 MHz.&lt;/P&gt;&lt;P&gt;Register values are:&lt;/P&gt;&lt;P&gt;PLLPFD3&amp;nbsp;&amp;nbsp; addr=0x420C80f0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; value=0x5351504c&lt;/P&gt;&lt;P&gt;PLL3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; addr=0x420C8010&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; value=0x80003000&lt;/P&gt;&lt;P&gt;CHSCCDR addr=0x420C4034&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; value=0x00021148&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Test application runs from DDR from address 0x10000000. It's size is smaller than cache so I think the whole code should be loaded and executed from L1. Same results are when A9 is in u-Boot and when A9 loads and runs linux.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this application I'm using M4's SysTick with reload value 227232 (or 1 ms). I have written a handler which also toggles gpio. With this everything looks fine (measure gives exactly 1 ms period).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also I have found a function in linux kernel in location [KERNEL]/arch/arm/mach-imx/clk_imx6sx.c called imx6sx_set_m4_highfreq(bool high_freq). Does this function set M4 to higher frequency? Maybe it's not called with high_freq=1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EDIT: System boot sets PLL3 frequency to 480 MHz.&lt;/P&gt;&lt;P&gt;Are there any internal clock setup registers in M4? Maybe some divider or bypass is enabled.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EDIT2: i.MX 6SoloX Applications Processor Reference Manual on page 466 Table 13-2. Platform Clock Descriptions lists all possible M4 clock inputs:&lt;/P&gt;&lt;P&gt;sw_clk_tck&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Single Wire/ JTAG Test Clock&lt;/P&gt;&lt;P&gt;trace_clk_in&amp;nbsp;&amp;nbsp;&amp;nbsp; TPIU - Trace Port Clock&lt;/P&gt;&lt;P&gt;tcmc_hclk&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TCMC Clock&lt;/P&gt;&lt;P&gt;cm4_hclk&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Gated CPU Clock. Platform output "cm4_gate_hclk" can be used as the enable signal.&lt;/P&gt;&lt;P&gt;cm4_fclk&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Free-running CPU Clock&lt;/P&gt;&lt;P&gt;ipg_clk_nic&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Gated PL301 Clock&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where is input clock selected? Does M4_CLK_ROOT need additional configuring outside of CCM?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Sep 2015 12:24:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/i-MX6-SoloX-Cortex-M4-clock-frequency/m-p/399879#M58929</guid>
      <dc:creator>zvonimirmandi_</dc:creator>
      <dc:date>2015-09-22T12:24:30Z</dc:date>
    </item>
    <item>
      <title>Re: i.MX6 SoloX Cortex-M4 clock frequency</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/i-MX6-SoloX-Cortex-M4-clock-frequency/m-p/399880#M58930</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Verdana','sans-serif';"&gt;&amp;nbsp; According to section 2.1 (Key features) of “Freescale_MQX_i.MX6SoloX_GA_Release_Notes.pdf” :&lt;BR /&gt; “&lt;BR /&gt; • Cortex-M4 core clock: 227 MHz (default)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Verdana','sans-serif';"&gt;• AHB bus clock: 132 MHz (default)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Verdana','sans-serif';"&gt;“&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 12.0pt; font-family: 'Verdana','sans-serif';"&gt;&amp;nbsp; As for GPIO module of the i.MX6 SX : the GPIO logic is the actual bottleneck of i.MX &lt;BR /&gt;series,&amp;nbsp; since its GPIO is not intended for high speed real time tasks.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Yuri&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Sep 2015 05:48:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/i-MX6-SoloX-Cortex-M4-clock-frequency/m-p/399880#M58930</guid>
      <dc:creator>Yuri</dc:creator>
      <dc:date>2015-09-23T05:48:27Z</dc:date>
    </item>
    <item>
      <title>Re: i.MX6 SoloX Cortex-M4 clock frequency</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/i-MX6-SoloX-Cortex-M4-clock-frequency/m-p/399881#M58931</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think I found the reason of slow execution time. M4's cache is disabled even after writing to control register.&lt;/P&gt;&lt;P&gt;I'm enabling cache with this code:&lt;/P&gt;&lt;P&gt;__raw_writel(0x85000003,0xe0002000);&lt;/P&gt;&lt;P&gt;__raw_writel(0x85000003,0xe0002800);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Before writing, register values are 0x00000260 and 0x00000000, and after writing values are 0x00000261 and 0x00000000.&lt;/P&gt;&lt;P&gt;Is there some cache enable procedure that I'm unaware of?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Write value is 0x85000003 according to section 13.9.3.6.1 Cache set commands of &lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;i.MX 6SoloX Applications Processor Reference Manual:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;"&lt;/SPAN&gt;After a reset, complete an invalidate cache command before using the cache. It is possible&lt;/P&gt;&lt;P&gt;to combine the cache invalidate command with the cache enable. That is, setting CCR to&lt;/P&gt;&lt;P&gt;0x8500_0003 will invalidate the cache and enable the cache and write buffer."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cache enabling is done in main function in c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Sep 2015 12:28:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/i-MX6-SoloX-Cortex-M4-clock-frequency/m-p/399881#M58931</guid>
      <dc:creator>zvonimirmandi_</dc:creator>
      <dc:date>2015-09-23T12:28:02Z</dc:date>
    </item>
    <item>
      <title>Re: i.MX6 SoloX Cortex-M4 clock frequency</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/i-MX6-SoloX-Cortex-M4-clock-frequency/m-p/399882#M58932</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&amp;nbsp; use \FreeRTOS_BSP_1.0.1_iMX6SX\platform\drivers\src\lmem.c as an example.&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;Yuri.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Nov 2019 07:14:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/i-MX6-SoloX-Cortex-M4-clock-frequency/m-p/399882#M58932</guid>
      <dc:creator>Yuri</dc:creator>
      <dc:date>2019-11-05T07:14:26Z</dc:date>
    </item>
  </channel>
</rss>

