<?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: LX2160x ts2phc cannot synchronize time between two clock domains in Layerscape</title>
    <link>https://community.nxp.com/t5/Layerscape/LX2160x-ts2phc-cannot-synchronize-time-between-two-clock-domains/m-p/1906427#M14535</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/231343"&gt;@Lixun&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Talking to another team member, the issue is detailed in the following response:&lt;/P&gt;
&lt;P&gt;----&lt;/P&gt;
&lt;P&gt;According to your log: freq = 0, that means PTP clock will never be adjusted, that's why the clock offset value never converge, so Could you please provide me the following information:&lt;BR /&gt;1) full testing log, include the ts2phc configuration file&lt;BR /&gt;2) Any modification of the ts2phc software made by customer?&lt;BR /&gt;2) LSDK version and Linuxptp version? And It is suggested to used linuxptp software from LSDK. NXP has several patches for linuxptp and not upstreamed.&lt;/P&gt;
&lt;P&gt;----&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Sebastian&lt;/P&gt;</description>
    <pubDate>Thu, 11 Jul 2024 15:47:03 GMT</pubDate>
    <dc:creator>SebastianG</dc:creator>
    <dc:date>2024-07-11T15:47:03Z</dc:date>
    <item>
      <title>LX2160x ts2phc cannot synchronize time between two clock domains</title>
      <link>https://community.nxp.com/t5/Layerscape/LX2160x-ts2phc-cannot-synchronize-time-between-two-clock-domains/m-p/1883538#M14414</link>
      <description>&lt;P&gt;Hi，&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am using the PTP function of the LX2160 and I have successfully generated a PTP device as shown in the image below&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;EM&gt;##phc_ctl /dev/ptp0 cap&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;capabilities:&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;249999999 maximum frequency adjustment (ppb)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;2 programable alarms&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;2 external time stamp channels&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;3 programmable periodic signals&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;0 configurable input/output pins&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;has pulse per second support&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;doesn't have cross timestamping support&lt;/EM&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;EM&gt;##cat /sys/class/ptp/ptp0/clock_nam&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;DPAA2 PTP Clock&lt;/EM&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;At the same time, there is another PHC device (ptp1) on my system, which generates PPS and outputs to DPAA2 PTP CLOCK (ptp0).&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;I am using ts2phc to sync the two devices, but this seems to have some drawbacks, the output is as follows.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;EM&gt;ts2phc[4591.981]: /dev/ptp0 extts index 0 at 16741.999998770 corr 0 src 16742.1177734 diff -1230&lt;BR /&gt;ts2phc[4591.981]: /dev/ptp0 master offset -1230 s1 freq +0&lt;BR /&gt;ts2phc[4592.982]: /dev/ptp0 extts index 0 at 16742.999998660 corr 0 src 16743.1177600 diff -1340&lt;BR /&gt;ts2phc[4592.982]: /dev/ptp0 master offset -1340 s1 freq +0&lt;BR /&gt;ts2phc[4593.982]: /dev/ptp0 extts index 0 at 16743.999998660 corr 0 src 16744.1177618 diff -1340&lt;BR /&gt;ts2phc[4593.982]: /dev/ptp0 master offset -1340 s1 freq +0&lt;BR /&gt;ts2phc[4594.982]: /dev/ptp0 extts index 0 at 16744.999998660 corr 0 src 16745.1177454 diff -1340&lt;BR /&gt;ts2phc[4594.982]: /dev/ptp0 master offset -1340 s1 freq +0&lt;BR /&gt;ts2phc[4595.982]: /dev/ptp0 extts index 0 at 16745.999998740 corr 0 src 16746.1177470 diff -1260&lt;BR /&gt;ts2phc[4595.982]: /dev/ptp0 master offset -1260 s1 freq +0&lt;BR /&gt;ts2phc[4596.982]: /dev/ptp0 extts index 0 at 16746.999998660 corr 0 src 16747.1177338 diff -1340&lt;BR /&gt;ts2phc[4596.982]: /dev/ptp0 master offset -1340 s1 freq +0&lt;BR /&gt;ts2phc[4597.982]: /dev/ptp0 extts index 0 at 16747.999998660 corr 0 src 16748.1177294 diff -1340&lt;BR /&gt;ts2phc[4597.982]: /dev/ptp0 master offset -1340 s1 freq +0&lt;BR /&gt;ts2phc[4598.982]: /dev/ptp0 extts index 0 at 16748.999998670 corr 0 src 16749.1177250 diff -1330&lt;BR /&gt;ts2phc[4598.982]: /dev/ptp0 master offset -1330 s1 freq +0&lt;BR /&gt;ts2phc[4599.982]: /dev/ptp0 extts index 0 at 16749.999998660 corr 0 src 16750.1177116 diff -1340&lt;BR /&gt;ts2phc[4599.982]: /dev/ptp0 master offset -1340 s1 freq +0&lt;BR /&gt;ts2phc[4600.982]: /dev/ptp0 extts index 0 at 16750.999998740 corr 0 src 16751.1177014 diff -1260&lt;BR /&gt;ts2phc[4600.982]: /dev/ptp0 master offset -1260 s1 freq +0&lt;BR /&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I can never completely eliminate the deviation between them and enter the S2 state&lt;/STRONG&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;For comparison, I used another PHY device on the board as ptp0, which is a PHY chip with TSU functionality.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;phy-ptp0 and ptp1 can synchronize normally, as shown in the figure below.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="企业微信截图_17177571462225.png" style="width: 855px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/283065i408700C98040AF03/image-size/large?v=v2&amp;amp;px=999" role="button" title="企业微信截图_17177571462225.png" alt="企业微信截图_17177571462225.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The device tree of my DPAA2 PTP CLOCK is configured as follows&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;ptp-timer@8b95000 {&lt;BR /&gt;compatible = "fsl,dpaa2-ptp";&lt;BR /&gt;reg = &amp;lt;0x0 0x8b95000 0x0 0x100&amp;gt;;&lt;BR /&gt;clocks = &amp;lt;&amp;amp;clockgen 4 1&amp;gt;;&lt;BR /&gt;little-endian;&lt;BR /&gt;fsl,extts-fifo;&lt;BR /&gt;fsl,cksel = &amp;lt;0&amp;gt;;&lt;BR /&gt;fsl,tclk-period = &amp;lt;10&amp;gt;;&lt;BR /&gt;fsl,tmr-prsc = &amp;lt;512&amp;gt;;&lt;BR /&gt;fsl,tmr-add = &amp;lt;0xcccccccd&amp;gt;;&lt;BR /&gt;fsl,tmr-fiper1 = &amp;lt;999999990&amp;gt;;&lt;BR /&gt;fsl,tmr-fiper2 = &amp;lt;99990&amp;gt;;&lt;BR /&gt;fsl,max-adj = &amp;lt;249999999&amp;gt;;&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;May I ask what caused this situation?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN class=""&gt;Is it the configuration of the DPAA2 PTP CLOCK or the hardware connection problem?&lt;/SPAN&gt;&lt;SPAN class=""&gt;Looking forward to your reply&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jun 2024 10:51:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Layerscape/LX2160x-ts2phc-cannot-synchronize-time-between-two-clock-domains/m-p/1883538#M14414</guid>
      <dc:creator>Lixun</dc:creator>
      <dc:date>2024-06-07T10:51:52Z</dc:date>
    </item>
    <item>
      <title>Re: LX2160x ts2phc cannot synchronize time between two clock domains</title>
      <link>https://community.nxp.com/t5/Layerscape/LX2160x-ts2phc-cannot-synchronize-time-between-two-clock-domains/m-p/1888980#M14443</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/231343"&gt;@Lixun&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I'm working on your question, When I have any update I will let you know&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2024 23:21:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Layerscape/LX2160x-ts2phc-cannot-synchronize-time-between-two-clock-domains/m-p/1888980#M14443</guid>
      <dc:creator>SebastianG</dc:creator>
      <dc:date>2024-06-17T23:21:28Z</dc:date>
    </item>
    <item>
      <title>Re: LX2160x ts2phc cannot synchronize time between two clock domains</title>
      <link>https://community.nxp.com/t5/Layerscape/LX2160x-ts2phc-cannot-synchronize-time-between-two-clock-domains/m-p/1888997#M14445</link>
      <description>&lt;P&gt;Thanks for your support, I synced some of my findings. I find that ptp_qoriq_adjtime in the DPAA2 PTP driver directly reads and writes the register first. This process causes delay, which leads to this deviation. Therefore, I ported a timercounter function, which is used by other PHC drivers, to implement adjtime using timecounter_read, which seems to have solved the problem.I think this is a defect of DPAA2 PTP driver, please check it.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2024 01:11:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Layerscape/LX2160x-ts2phc-cannot-synchronize-time-between-two-clock-domains/m-p/1888997#M14445</guid>
      <dc:creator>Lixun</dc:creator>
      <dc:date>2024-06-18T01:11:26Z</dc:date>
    </item>
    <item>
      <title>Re: LX2160x ts2phc cannot synchronize time between two clock domains</title>
      <link>https://community.nxp.com/t5/Layerscape/LX2160x-ts2phc-cannot-synchronize-time-between-two-clock-domains/m-p/1906427#M14535</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/231343"&gt;@Lixun&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Talking to another team member, the issue is detailed in the following response:&lt;/P&gt;
&lt;P&gt;----&lt;/P&gt;
&lt;P&gt;According to your log: freq = 0, that means PTP clock will never be adjusted, that's why the clock offset value never converge, so Could you please provide me the following information:&lt;BR /&gt;1) full testing log, include the ts2phc configuration file&lt;BR /&gt;2) Any modification of the ts2phc software made by customer?&lt;BR /&gt;2) LSDK version and Linuxptp version? And It is suggested to used linuxptp software from LSDK. NXP has several patches for linuxptp and not upstreamed.&lt;/P&gt;
&lt;P&gt;----&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Sebastian&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2024 15:47:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Layerscape/LX2160x-ts2phc-cannot-synchronize-time-between-two-clock-domains/m-p/1906427#M14535</guid>
      <dc:creator>SebastianG</dc:creator>
      <dc:date>2024-07-11T15:47:03Z</dc:date>
    </item>
  </channel>
</rss>

