Hi Phil,

What kernel version are you running to successfully use HPS EMAC with HW
timestamping?  Instead of trying to backport the ptp changes (your commit
from Dec 2015) to the stmmac driver, I compiled and tried to run kernel
v4.5 which already has those changes (among others).  But now I'm back to
getting the clock jumped forward or running faster than expected messages,
and the master offset just increases indefinitely.  

I had changed these 2 lines of my altera-generated  DTS  per
recommendation from another user who was using 4.1.22-altera-ltsi:

clocks = <&l4_mp_clk &arria10_hps_0_eosc1>;
clock-names = "stmmaceth", "clk_ptp_ref"

I added both the latter parameters from above.  I was surprised to see the
driver chosen upon boot was as follows (previously with
4.1.22-altera-ltsi):
driver -> ../../../../bus/platform/drivers/socfpga-dwmac
of_node -> ../../../../firmware/devicetree/base/sopc@0/ethernet@0xff800000


So then I just get:

ptp4l[776.919]: clockcheck: clock jumped forward or running faster than
expected!
ptp4l[776.958]: master offset      -2640 s0 freq   +7080 path delay
-1160
ptp4l[776.958]: port 1: SLAVE to UNCALIBRATED on SYNCHRONIZATION_FAULT
ptp4l[777.919]: clockcheck: clock jumped forward or running faster than
expected!
ptp4l[777.958]: master offset     -12520 s0 freq   +7080 path delay
5040
ptp4l[778.919]: clockcheck: clock jumped forward or running faster than
expected!
ptp4l[778.958]: master offset     -22400 s0 freq   +7080 path delay
11240
ptp4l[779.919]: clockcheck: clock jumped forward or running faster than
expected!
ptp4l[779.958]: master offset     -26000 s0 freq   +7080 path delay
11240
ptp4l[780.919]: clockcheck: clock jumped forward or running faster than
expected!
ptp4l[780.958]: master offset     -29180 s0 freq   +7080 path delay
10580
ptp4l[781.919]: clockcheck: clock jumped forward or running faster than
expected!

Thank you,

John L.

-----Original Message-----
From: Phil Reid [mailto:pr...@electromag.com.au] 
Sent: Tuesday, May 23, 2017 12:54 AM
To: Baya Oussena <baya.ouss...@gmail.com>
Cc: linuxptp-users@lists.sourceforge.net
Subject: Re: [Linuxptp-users] Adding LinuxPTP to Arria 10 SoC

G'day Baya,

On 22/05/2017 15:16, Baya Oussena wrote:
> Hallo Reid,
> 
> I am about to use PTP on my Altera Cyclone V. I want to use the altera 
> 1588 solution IP core. Iam using quaturs to set my system .. Please 
> could you let me know what variable I should enable in the
configuration, also which PTP open software do you use. Will it work by
using the PTP Linux one? or is there a version for NIOS Altera.


I uses the HPS EMAC, with linuxptp 1.6
The newer quartus versions allow exporting of the ptp fpga interface even
when using the dedicated hps pins if that helps.
Not sure of anything for the NIOS or Altera softcore EMAC.



> 
> I thank you in advance for your help,
> Baya
> 
> 
> 2017-05-22 7:17 GMT+02:00 Phil Reid <pr...@electromag.com.au
<mailto:pr...@electromag.com.au>>:
> 
>     On 18/05/2017 23:29, Hunter Olson wrote:
>      > 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/bf171f01afe31f0c593deb55b96c3cb9
e20cd6dd_
>
<https://github.com/torvalds/linux/commit/bf171f01afe31f0c593deb55b96c3cb9
e20cd6dd_>
>      >
<https://github.com/torvalds/linux/commit/bf171f01afe31f0c593deb55b96c3cb9
e20cd6dd
>
<https://github.com/torvalds/linux/commit/bf171f01afe31f0c593deb55b96c3cb9
e20cd6dd>>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/19d857c9038e5c07db8f8cc02b5ad0cd
0098714f
>
<https://github.com/torvalds/linux/commit/19d857c9038e5c07db8f8cc02b5ad0cd
0098714f>
>      >
<https://github.com/torvalds/linux/commit/19d857c9038e5c07db8f8cc02b5ad0cd
0098714f
>
<https://github.com/torvalds/linux/commit/19d857c9038e5c07db8f8cc02b5ad0cd
0098714f>>_
>      >
>      > 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.
> 
>       From memory there where also issues with the ptp clk config and
resets with those older kernels.
>     Some related patches to things I had tofix to get it going..
> 
> 
>
https://github.com/torvalds/linux/commit/734e00fa02eff5003827abc06a7ebf944
9349109
>
<https://github.com/torvalds/linux/commit/734e00fa02eff5003827abc06a7ebf94
49349109>
>
https://github.com/torvalds/linux/commit/e6dbe1eb2db0d7a14991c06278dd3030c
45fb825
>
<https://github.com/torvalds/linux/commit/e6dbe1eb2db0d7a14991c06278dd3030
c45fb825>
>
https://github.com/torvalds/linux/commit/43569814fa35b2ae68f09780c4ee3d4a1
82711e9
>
<https://github.com/torvalds/linux/commit/43569814fa35b2ae68f09780c4ee3d4a
182711e9>
>
https://github.com/torvalds/linux/commit/27015f8c17578e14b3c6cc098b915b0f8
db3ac36
>     
> <https://github.com/torvalds/linux/commit/27015f8c17578e14b3c6cc098b91
> 5b0f8db3ac36>
> 
> 
>     --
>     Regards
>     Phil Reid
> 
> 
>
--------------------------------------------------------------------------
----
>     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
<mailto:Linuxptp-users@lists.sourceforge.net>
>     https://lists.sourceforge.net/lists/listinfo/linuxptp-users 
> <https://lists.sourceforge.net/lists/listinfo/linuxptp-users>
> 
> 


--
Regards
Phil Reid

ElectroMagnetic Imaging Technology Pty Ltd Development of Geophysical
Instrumentation & Software www.electromag.com.au

3 The Avenue, Midland WA 6056, AUSTRALIA
Ph: +61 8 9250 8100
Fax: +61 8 9250 7100
Email: pr...@electromag.com.au

--------------------------------------------------------------------------
----
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