David Price

Problems Running IEEE-1588 Precision Timing Protocol (PTP) on i.MX-6Q in Linux

Discussion created by David Price on May 21, 2014
Latest reply on Dec 18, 2014 by MIKE PETERSEN

I am trying to get IEEE-1588 Precision Timing Protocol (PTP) to run on a new board design using the i.MX-6.  Our board is based on the i.MX-6 Rex design which is based on the SabreSD reference design.

 

The board runs the 3.0.35 Linux kernel fine from the Rex project when booted with the 2009.04 u-boot from the Rex project.  The problem is that the 3.0.35 kernel lacks the support for the Linux PTP application.  There seems to be some early sandbox support of IEEE-1588 in 3.0.35, but it is incompatible with the current PTP application.  The first official PTP kernel support appeared in the 3.8 version kernel.  I have been trying to get more recent kernels to boot, but have run into a lot of difficulty.  Later kernels also started using the device tree method of booting, and it is my understanding that later version of u-boot are needed to have flattened device tree (FTD) support.  When I try to boot 3.8 and later kernels with the 2009.04 u-boot, they hang silently.  So I thought that maybe I needed a newer version of u-boot with FTD support.  I have seen hints of that requirement on the forums.

 

When I try to compile and run the 2013.04 and 2014.04 versions of u-boot, they boot, but have problem accessing the SPI device on ECSPI3 with chip select 2.  These u-boot versions are booting from that same SPI device as set by the boot fuses; but when u-boot tries to "sf probe" the SPI for the environment variables, it fails with all ones or all zeros depending on the clock polarity setting in the ECSPI.  The chip select seems to be having an effect because if I do not select cs3, I always get zeros no matter what polarity or phase is selected.  I have checked the clock gating and pin configuration and they seem correct.  I have even used the "md" command to check the register settings.  If the ECSPI clocks are gated, the sf probe hangs u-boot, and I'm not hanging.

 

Is it possible to boot a version 3.8 or later kernel with u-boot 2009.04?  Specifically the Freescale 3.10.17 Linux kernel seems to be the best candidate for i.MX-6 support.  I tried booting this and tried passing the ftd to bootm as the third argument, but it hangs silently with no messages.  Perhaps I'm not setting up the FTD correctly.  It is hard to debug since there are no messages.

 

If u-boot 2009.04 cannot boot a later Linux kernel, is there a later version of u-boot that works correctly with SPI on SabreSD derivative designs?   We boot u-boot from SPI, and store the environment variables in the same SPI device on ECSPI3.  There is another thread on this forum that seems to imply that chip selects aren't handled correctly on ECSPI in new versions of u-boot.

 

Ultimately, we want to run the PTP Linux stack on our board with a precise pulse-per-second timing reference that comes out of the ENET_1588_EVENT0_OUT pin.  We already have a IEEE-1588 master clock running on our network, and have run the PTP stack in Linux on a PC with software timestamping, but we want to use the hardware timestamping and hardware timer/event provided by the i.MX-6.  All the work above is to achieve this goal.  We are ready to test it, but getting the correct Linux version to run has been a major headache.

Outcomes