Please share any thoughts or issues you encountered.
I am in the middle of trying to get the i.MX-6Q to work as a PTP client to an existing IEEE-1588 master clock on an Ethernet IP network.
I'm using the Linux PTP application from The Linux PTP Project. This handles the IP packet requests and responses, and handles the PTP timing calculations. This is just a standard Linux application executable that is run as a daemon. It relies on the kernel to interface to the hardware specific functions to support precise packet time-stamping and timer control.
At the kernel level, I found the Linux 3.0.35 kernel had some early IEEE-1588 support code for i.MX-6, but it did not have the API needed for the PTP application. The correct API first appeared in Linux 3.8. Freescale has a 3.10.17 kernel in alpha or beta testing (available from their git repository), so after a lot of hoop jumping with u-boot and device trees, I got 3.10.17 to boot and run the PTP application on our hardware. Over a conventional ethernet switches, the timing is staying within 100 ns of the master clock, which is surprisingly good. With a switch that supports IEEE-1588 boundary clock, the timing should be even better.
I'm currently working on the ENET_1588_EVENT*_OUT configuration to bring out a hardware timing signal so that other hardware can take advantage of the precision time reference. Without that hardware signal, PTP is basically a more precise NTP to Linux. PTP sets the time and date just like NTP does.
Thanks for your response - MUCH appreciated!
I would be GREATLY appreciative if could email me or post your modifications/steps so that us "sad sacks" can prevent trudging down the same road you've manage to pave!
Is there anyway to measure the accuracy ?
This thread is pretty much closed now. I can tell you that to measure the accuracy you should use a rubidium time source and a reference such as a GNSS 1PPS from a known receiver to get a base line for timing, then use a Stanford Research or similar counter that can measure jitter and offset. You can use a fast 'scope as well, the Rb 1pps out on one trace, the match output from the iMX6 on another and use persistence to see the spread.
If you are asking "how accurate", running properly the iMX6 should be able to hold +/-75ns or better to a good ps type reference - its really dependent on your input time sync/clock source fidelity.
Thanks for your time and reply too.
Actually, I have implemented PTP code with the latest fec drivers that provide the ethernet time stamp.
Is there any tool, that I can measure PTP time, accuracy between 2 i.MX boards ?
This will help me to identify the accuracy between PTP nodes.
Can you help me on this issue.
Thanks & Regards,
I would think that you could capture the PTP packets from the stream using Wireshark or internally then decode the packet contents to obtain the time delta's. Ultimately your accuracy will be relative to the accuracy of the source OSC driving the Master clock.
Would be much appreciated to everyone here if you could post you're implementation steps.
From your post, I can understand that you have achieved 100ns with PTP (100 ns without using AVB supported bridge).
I want to know, how did you measure to say 100ns of accuracy between peer-peer ?
Had your issue got resolved? If yes, we are going to close the discussion in 3 days. If you still need help, please feel free to reply with an update to this discussion.
I have been waiting (hoping) that David would post the steps he took so we (and others) can take advantage of what he learned.
Unless you/Freescale has some documentation on PTP 1588 Client implementation I would appreciate you keeping it open.
An update from us here at Vercet.
Right now we are talking to Freescale about some undocumented features we have discovered in the IEEE1588 area of the iMX6 and its firmware/driver. This is still an open issue and it may take some time to resolve. We are working on/committed to a correctly implemented IEEE1588 solution as we are delivering a commercial product, and have indicated to Freescale that it is important the solutions being worked on get back into the community and the BSP, kernel, etc. We are also working with the Linux PTP people who are aware of what we are up to. So for now, this is very definitely an "open issue"
Just to be clear, I work with Justin on the same project using IEEE1588 PTP on iMX6. We revealed what we found to Freescale and now have their attention. They have confirmed our findings, and are determining how to proceed.
Meanwhile, I have been trying to work around some the problems so that we can make forward progress. Depending on your application and accuracy requirements, Freescale's current implementation might work for you. In their current driver implementation (in the Linux 3.10.17 release), it doesn't meet our requirements and cannot generate EVENT*_OUT correctly.
Thanks for the clarification David. I will follow the process at The Linux PTP Project. I will be porting this onto an Mx6 (Sabre-type platform) running Android. Any tips or steps or Freescale links you can suggest/recommend would be greatly appreciated! Also appreciate you (both) keeping the Community abreast of your efforts & solution.
Is there any update on the configuration of the 1588_event_out. We are trying to implement the media clock sync feature and are thinking of providing this signal as reference clock to the codec. This would help in media clock sync as the fec clocks are already in sync. But we dont know how to configure this event ,could you provide some suggestions. Does it require kernel software change or it requires hardware modification???
We (David and I) have the following brief update: (1) iMX6 1588_event_out silicon works, and we have 1588_event_out "events" working. (2) to achieve this currently if you are using the Freescale BSP and Linux there needs to be some additional firmware, and it is non-trivial. (3) we are working with Freescale to get a releasable version of the required support firmware available, but this may take some time - think three to six months from now. (4) Please carefully re- read this series of comments, and other comments in this forum under 1PPS and IEEE1588 - this will give a fuller picture of the current state of affairs. Note: IEEE1588 support that directly includes PTP will only be in kernel releases later than 3.8, and I think for the Freescale BSP it will be 3.10 and later. See the PTP project and general support notes for Linux kernel. If you need a sync that is not 1PPS but a different frequency you may need to await the updates then tweak them to achieve your goals. I hope this helps.
And to directly answer your questions:
1) Hardware - you have to have one of the1588_event_out pins available from the iMX6 to get the Event Out signal. This is specified in the iMX6 RM.
2) Firmware. Yes - somehow or another you need support for the IEEE1588 counter and the event timer/trigger functions. The firmware I refer to in previous post will do this for 1PPS and the PTP project stuff - which does not currently support 1588_event_out.
3) To implement what you are suggesting you will need to make sure you have someone familiar with kernel device level coding to adjust the code if you need anything out of the ordinary, after the firmware updates anticipated in my previous reply.
And a final closing note - The Freescale fix to the firmware should be available from them/in the BSP and the Event_Out 1PPS and IEEE1588 functionality works fine.
Is IEEE 1588 support available in Kernel 3.14.28 ? How to verify it?
It seems that hardware time stamping not supported in Kernel 3.14.28. Is it correct ?
It seems you are fine with this issue now. Should we close it or do you need leave it open for further input?
Final update from Vercet in this chain......
We have a working PTP - IEEE1588 iMX6 hardware enabled subsystem on the iMX6, including the Event Out capability. In discussions with Freescale, extensions to iMX6 firmware and driver support tracking our work will be made generally available in a few months from Freescale as part of ongoing iMX6 development and support. For planning purposes anticipate about May 2015 or so, however there is a possibility it will be out by the end of 2014.
Having now spent quite a lot of time and effort in this area of the device and firmware support for it, we would highly recommend waiting for the updates from Freescale for these additional IEEE1588 - PTP extensions to be made available, as the distance from here to there is considerable.
David and I hope this information helps anyone on the IEEE-1588 - PTP route with the iMX6.
Mike and David
Thank you for both of your great work and input. I will close this DI now. Anyone who would like to add commont can still do it in the thread.
Is the BSP release with Event Out capability for 1588 module available ? If not has Freescale has released or planned to release new hardware with 1588 Event out capability which could be used for media clock synchronisation mechanisms ??
Thanks and Regards,
?? I second Mohamed's Query. It was expected to be completed and rolled in.
Can anyone at Freescale update Status on the 1588 support?
Done, paid for by us and should be available for general consumption. Pester your Freescale rep.
I third Mohamed's Query.
Is this BSP update real or just a supposition?
Can anyone help?
Our PTP clock seems to be stuck......not counting.
The GPR1 bits are being set in init imx6q_1588_init(void) from the mach-imx6q.c file........we've added debug so we know that line of code is being executed.
Our dtsi file includes the line MX6QDL_PAD_GPIO_16__ENET_REF_CLK 0x4001b0b1
What else do I need to do?
Retrieving data ...