<?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 IEEE 1588 Timer in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/IEEE-1588-Timer/m-p/215731#M13587</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;[Because the imx6 1588 support looks similar - such issues may apply to imx6.]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We are using the IEEE 1588 timer to sync multiple i.MX28.&lt;/P&gt;&lt;P&gt;In Section 26.3.13.2.2 (Adjustable Timer Implementation) of the reference manual,&lt;/P&gt;&lt;P&gt;the operation with 125MHz from CLK_ENET_TIME is proposed as example.&lt;/P&gt;&lt;P&gt;This timer and the way it operates is somewhat perfect if the period duration of the clock can be expressed by even nanoseconds:&lt;/P&gt;&lt;P&gt;8ns - 125MHz&lt;/P&gt;&lt;P&gt;9ns - 111MHz&lt;/P&gt;&lt;P&gt;10ns - 100MHz&lt;/P&gt;&lt;P&gt;.......&lt;/P&gt;&lt;P&gt;Using 125Mhz as in the "example" gives the best resolution.&lt;/P&gt;&lt;P&gt;The problem is that I don´t know how to generate a CLK_ENET_TIME of 125Mhz.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With HW_CLKCTRL_ENET_TIME_SEL, I can choose my clocksource:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;USING 480MHz PLL:&lt;/P&gt;&lt;P&gt;If I divide 480MHz / 4, I get 120MHz, which gives 8.33ns&lt;/P&gt;&lt;P&gt;/5 gives 10.42ns&lt;/P&gt;&lt;P&gt;/6 gives 12.5ns&lt;/P&gt;&lt;P&gt;.....&lt;/P&gt;&lt;P&gt;only /12&amp;nbsp; gives an even number of 25ns.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;USING ref_xtal (24MHz):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/3 gives 8MHz/ 125ns&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;USING enet_rmii_clk_in:&lt;/P&gt;&lt;P&gt;Looking at the clock domains, enet_rmii_clk_in can be derived from CLK_ENET_OUT. To achieve that I have to enable HW_CLKCTRL_ENET_CLK_OUT_EN.&lt;/P&gt;&lt;P&gt;So there should be CLK_ENET_OUT on enet_rmii_clk_in.&lt;/P&gt;&lt;P&gt;CLK_ENET_OUT can be derived from "PLL2 50MHz" which should provide 50MHz.&lt;/P&gt;&lt;P&gt;So even by division I don´t see a way to get 125MHz for that timer.&lt;/P&gt;&lt;P&gt;The only idea was that someone mis-spelled the "PLL2 50MHz" as "PLL 250MHz" - and thought that it gives nice 125MHz if divided by two.&lt;/P&gt;&lt;P&gt;If I use this option I can have 50MHz with 20ns.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To sum it up I can use 50Mhz - 20ns (derived from 50MHz RMII clock), 40MHz - 25ns (derived from 480MHz PLL divided by 12) and 8MHz - 125ns (derived from ref_xtal / 3).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Additional Issues / Errata found with the 1588 Timer&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Capture / Readout timer&lt;/P&gt;&lt;P&gt;If the 1588 timer is operated with lower clockspeeds - (for example 40MHz) - there is a mandatory pause needed between setting the capture bit - and readout of the timer.&lt;/P&gt;&lt;P&gt;The internal transfer from timer to readout register obviously takes a minimum of 6 peripheral clock cycles - in the case of 40MHz operation this would be 150ns - more than 68 core clock cycles if running with 454MHz core clock. A value of 75cycles seems to work sufficient.&lt;/P&gt;&lt;P&gt;Using 1588 Timer with 120MHz clock, there would be the need to wait for 23cycles. This might work with less optimization and some code between capture and readout.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) Interrupts lost&lt;/P&gt;&lt;P&gt;Using the timer looping within 1e9 ns mode - and having a capture&amp;nbsp; IRQ (event input) simultaneously in the area of the wrap - the capture irq gets lost.&lt;/P&gt;&lt;P&gt;Workaround: assume that you have no capture irq simultaneously to the wrap - or use 32-bit wrap (not tested).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rgds.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: wolfgang gaerber&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 Feb 2012 15:45:31 GMT</pubDate>
    <dc:creator>wolfgang_gaerbe</dc:creator>
    <dc:date>2012-02-28T15:45:31Z</dc:date>
    <item>
      <title>IEEE 1588 Timer</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/IEEE-1588-Timer/m-p/215731#M13587</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;[Because the imx6 1588 support looks similar - such issues may apply to imx6.]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We are using the IEEE 1588 timer to sync multiple i.MX28.&lt;/P&gt;&lt;P&gt;In Section 26.3.13.2.2 (Adjustable Timer Implementation) of the reference manual,&lt;/P&gt;&lt;P&gt;the operation with 125MHz from CLK_ENET_TIME is proposed as example.&lt;/P&gt;&lt;P&gt;This timer and the way it operates is somewhat perfect if the period duration of the clock can be expressed by even nanoseconds:&lt;/P&gt;&lt;P&gt;8ns - 125MHz&lt;/P&gt;&lt;P&gt;9ns - 111MHz&lt;/P&gt;&lt;P&gt;10ns - 100MHz&lt;/P&gt;&lt;P&gt;.......&lt;/P&gt;&lt;P&gt;Using 125Mhz as in the "example" gives the best resolution.&lt;/P&gt;&lt;P&gt;The problem is that I don´t know how to generate a CLK_ENET_TIME of 125Mhz.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With HW_CLKCTRL_ENET_TIME_SEL, I can choose my clocksource:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;USING 480MHz PLL:&lt;/P&gt;&lt;P&gt;If I divide 480MHz / 4, I get 120MHz, which gives 8.33ns&lt;/P&gt;&lt;P&gt;/5 gives 10.42ns&lt;/P&gt;&lt;P&gt;/6 gives 12.5ns&lt;/P&gt;&lt;P&gt;.....&lt;/P&gt;&lt;P&gt;only /12&amp;nbsp; gives an even number of 25ns.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;USING ref_xtal (24MHz):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/3 gives 8MHz/ 125ns&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;USING enet_rmii_clk_in:&lt;/P&gt;&lt;P&gt;Looking at the clock domains, enet_rmii_clk_in can be derived from CLK_ENET_OUT. To achieve that I have to enable HW_CLKCTRL_ENET_CLK_OUT_EN.&lt;/P&gt;&lt;P&gt;So there should be CLK_ENET_OUT on enet_rmii_clk_in.&lt;/P&gt;&lt;P&gt;CLK_ENET_OUT can be derived from "PLL2 50MHz" which should provide 50MHz.&lt;/P&gt;&lt;P&gt;So even by division I don´t see a way to get 125MHz for that timer.&lt;/P&gt;&lt;P&gt;The only idea was that someone mis-spelled the "PLL2 50MHz" as "PLL 250MHz" - and thought that it gives nice 125MHz if divided by two.&lt;/P&gt;&lt;P&gt;If I use this option I can have 50MHz with 20ns.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To sum it up I can use 50Mhz - 20ns (derived from 50MHz RMII clock), 40MHz - 25ns (derived from 480MHz PLL divided by 12) and 8MHz - 125ns (derived from ref_xtal / 3).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Additional Issues / Errata found with the 1588 Timer&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Capture / Readout timer&lt;/P&gt;&lt;P&gt;If the 1588 timer is operated with lower clockspeeds - (for example 40MHz) - there is a mandatory pause needed between setting the capture bit - and readout of the timer.&lt;/P&gt;&lt;P&gt;The internal transfer from timer to readout register obviously takes a minimum of 6 peripheral clock cycles - in the case of 40MHz operation this would be 150ns - more than 68 core clock cycles if running with 454MHz core clock. A value of 75cycles seems to work sufficient.&lt;/P&gt;&lt;P&gt;Using 1588 Timer with 120MHz clock, there would be the need to wait for 23cycles. This might work with less optimization and some code between capture and readout.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) Interrupts lost&lt;/P&gt;&lt;P&gt;Using the timer looping within 1e9 ns mode - and having a capture&amp;nbsp; IRQ (event input) simultaneously in the area of the wrap - the capture irq gets lost.&lt;/P&gt;&lt;P&gt;Workaround: assume that you have no capture irq simultaneously to the wrap - or use 32-bit wrap (not tested).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rgds.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: wolfgang gaerber&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Feb 2012 15:45:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/IEEE-1588-Timer/m-p/215731#M13587</guid>
      <dc:creator>wolfgang_gaerbe</dc:creator>
      <dc:date>2012-02-28T15:45:31Z</dc:date>
    </item>
    <item>
      <title>Re: IEEE 1588 Timer</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/IEEE-1588-Timer/m-p/215732#M13588</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can someone at Freescale please respond to Wolfgang's suspicion that what he has encountered in the Mx28 would be in the Mx6 silicon as well?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Mike&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Dec 2014 17:19:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/IEEE-1588-Timer/m-p/215732#M13588</guid>
      <dc:creator>mbp</dc:creator>
      <dc:date>2014-12-18T17:19:03Z</dc:date>
    </item>
  </channel>
</rss>

