John,

I'm going through the same troubles right now on Altera's Cyclone V SOC
platform.

I've found that if no PTP clock is specified for the emac entry in your
device tree, the stmmac driver defaults to expect the emac clock (250Mhz),
but it seems Altera is feeding in the eosc1 clock (25mhz).  If you run the
testptp application, you'll see the ptp clock is running at 1/10th speed.
This is causing ptp4l to throw those 'clockcheck' warnings that you're
seeing.

See
*https://github.com/torvalds/linux/commit/bf171f01afe31f0c593deb55b96c3cb9e20cd6dd*

<https://github.com/torvalds/linux/commit/bf171f01afe31f0c593deb55b96c3cb9e20cd6dd>for
how to add the ptp clock to your device tree, allowing the driver to grab
the correct ptp clock rate.

I also backported to Altera's 4.1.22 some ptp related commits that show up
in mainline kernel 4.5, such as:
*https://github.com/torvalds/linux/commit/19d857c9038e5c07db8f8cc02b5ad0cd0098714f
<https://github.com/torvalds/linux/commit/19d857c9038e5c07db8f8cc02b5ad0cd0098714f>*

Like you noticed, I had to bump ptp4l's tx_timestamp_timeout up to 100.

Still testing, but it appears LinuxPTP H/W timestamping works after these
changes.

Regards,
Hunter



On Thu, May 18, 2017 at 9:02 AM, John Lemonovich <
john.lemonov...@foresys.com> wrote:

> Richard,
>
> That's what I was afraid of.  It seemed as though SW timestamping was
> working,  but then I had a problem with my rootfs in my Linux build, and I
> didn't go back to try it again.
>
> The Altera TSE MAC is listed as supported (whereas the ARM EMAC is not,
> specifically), would you suspect I would have more luck with that?  It's
> only listed as supporting software timestamping - not PHC.
>
> Thank you,
>
> John
>
> -----Original Message-----
> From: Richard Cochran [mailto:richardcoch...@gmail.com]
> Sent: Thursday, May 18, 2017 8:27 AM
> To: John Lemonovich <john.lemonov...@foresys.com>
> Cc: linuxptp-users@lists.sourceforge.net
> Subject: Re: [Linuxptp-users] Adding LinuxPTP to Arria 10 SoC
>
> On Wed, May 17, 2017 at 02:29:09PM -0500, John Lemonovich wrote:
> > Now I am trying with the -H option for PHC to achieve better timing
> > (hopefully).  Should it work for the EMAC with the 4.1.22-ltsi-altera
> > kernel?
>
> IIRC, last time I looked, the altera HW and drivers are hopelessly broken.
> Ditto for the similar xilinx parts.
>
> Neither have drivers in mainline Linux, IIRC.
>
> Thanks,
> Richard
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Linuxptp-users mailing list
> Linuxptp-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linuxptp-users
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users

Reply via email to