UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Explorer
Explorer
2,205 Views
Registered: ‎12-20-2017

PTP help for ZCU102

Jump to solution

I'm having some trouble getting PTP time synchronization working with my petalinux 2017.3 build on ZCU102. 

I'm running my target system as a slave, and so far my output from ptp is showing that no adjustments are being made to the target system's timekeeping.  The master offset is forever decreasing by one second, and the frequency is never being adjusted.

 

ptp4l  -i eth0 -m -s
ptp4l[13.741]: selected /dev/ptp0 as PTP clock
ptp4l[13.741]: driver changed our HWTSTAMP options
ptp4l[13.741]: tx_type 1 not 1
ptp4l[13.741]: rx_filter 1 not 12
ptp4l[13.742]: port 1: INITIALIZING to LISTENING on INITIALIZE
ptp4l[13.742]: port 0: INITIALIZING to LISTENING on INITIALIZE
ptp4l[21.640]: driver changed our HWTSTAMP options
ptp4l[21.640]: tx_type 1 not 1
ptp4l[21.640]: rx_filter 1 not 12
ptp4l[21.640]: selected best master clock 000a35.fffe.002201
ptp4l[29.520]: driver changed our HWTSTAMP options
ptp4l[29.520]: tx_type 1 not 1
ptp4l[29.520]: rx_filter 1 not 12
ptp4l[29.520]: selected best master clock 000a35.fffe.002201
ptp4l[29.688]: port 1: new foreign master 003064.fffe.1982cd-1
ptp4l[33.786]: selected best master clock 003064.fffe.1982cd
ptp4l[33.786]: port 1: LISTENING to UNCALIBRATED on RS_SLAVE
ptp4l[34.810]: master offset 651262704418 s0 freq +0 path delay 0
ptp4l[35.834]: master offset 649867375548 s0 freq +0 path delay 346072539
ptp4l[36.859]: master offset 648818118960 s0 freq +0 path delay 346072539
ptp4l[37.883]: master offset 647714697182 s0 freq +0 path delay 400129313
ptp4l[38.908]: master offset 646665287635 s0 freq +0 path delay 400129313
ptp4l[39.933]: master offset 645623541219 s0 freq +0 path delay 392486789
ptp4l[40.957]: master offset 644575797496 s0 freq +0 path delay 390867813
ptp4l[41.982]: master offset 643526460652 s0 freq +0 path delay 390867813

It's almost like timestamps aren't happening in the driver.

 

However, the driver appears to have all of the proper options:

 

# ethtool -T eth0
Time stamping parameters for eth0:
Capabilities:
hardware-transmit (SOF_TIMESTAMPING_TX_HARDWARE)
hardware-receive (SOF_TIMESTAMPING_RX_HARDWARE)
hardware-raw-clock (SOF_TIMESTAMPING_RAW_HARDWARE)
PTP Hardware Clock: 0
Hardware Transmit Timestamp Modes:
off (HWTSTAMP_TX_OFF)
on (HWTSTAMP_TX_ON)
Hardware Receive Filter Modes:
none (HWTSTAMP_FILTER_NONE)
all (HWTSTAMP_FILTER_ALL)

 

I believe I had to add ptp to the petalinux build, as it was not provided by default (though it's been a while, so I might be misremembering).  I believe I added this to the petalinux-image's *.bbappend:

 

IMAGE_INSTALL_append = " linuxptp"

 

I believe this provided me with linuxptp version 1.6, as is provided in the poky yocto release that is being used as a baseline for this version of linux.

 

I had various kernel options enabled.   From http://linuxptp.sourceforge.net/, I have 

CONFIG_NETWORK_PHY_TIMESTAMPING

CONFIG_PPS

CONFIG_PTP_1588_CLOCK

 

I've also found other variables online in various places that I felt need to be set for this board:

CONFIG_DP83640_PHY

 

I've also been told I need to enable the Common Clock, so I've done that, though there's nothing in the linuxptp documentation about that.  

CONFIG_COMMON_CLK

CONFIG_COMMON_CLK_ZYNQMP

 

This next one had to do with common clock support in ARM reference designs, but I don't know if the ultrazinq uses the SP810 system controller.  Better to be safe than sorry, right?

CONFIG_CLK_SP810

 

 

I'm really at my wits' end, as it looks like I've done what I should.  Obviously there is something I missed, but what?!

 

Any and all advice is welcome.  

Thanks.

 

 

0 Kudos
1 Solution

Accepted Solutions
Explorer
Explorer
2,093 Views
Registered: ‎12-20-2017

Re: PTP help for ZCU102

Jump to solution

I've solved my problems, so I'm sharing here what happened:

 

1) I was ignorant of how to modify the device tree to get the MAC driver to see the PTP clock.  The correct way on my platform (ZCU102) with my build system (petalinux 2017.3) is to add the following text to project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi


/include/ "system-conf.dtsi"
/ {
};
/ {
    amba {
        ethernet@ff0e0000 {
            tsu-clk = <250000000>;
        };

    };
};

 

If you are not sure about the 250000000 value (frequency of tsu-clk), I believe you can get this from Vivado under the GEM module in the block diagram.  Otherwise try this and see if it works.

 

2)  After fumbling around for a while, I thought maybe I needed to change the firmware, as recommended on some other posts.  It turns out that this actually BROKE ptp for me... that is, with the change above, PTP still fails to work with the newer firmware.

 

 

View solution in original post

0 Kudos
2 Replies
Explorer
Explorer
2,148 Views
Registered: ‎12-20-2017

Re: PTP help for ZCU102

Jump to solution

I tried adding a clock to the GEM device in vivado and pulling in the new platform definition files.  But this made PTP fail in a different way:

 

ptp4l[1683.077]: driver changed our HWTSTAMP options
ptp4l[1683.077]: tx_type 1 not 1
ptp4l[1683.077]: rx_filter 1 not 12
ptp4l[1683.077]: port 1: FAULTY to LISTENING on FAULT_CLEARED
ptp4l[1683.163]: port 1: received SYNC without timestamp
ptp4l[1684.163]: port 1: received SYNC without timestamp
ptp4l[1684.582]: port 1: new foreign master 003064.fffe.1982cd-1
ptp4l[1685.163]: port 1: received SYNC without timestamp
ptp4l[1686.164]: port 1: received SYNC without timestamp
ptp4l[1687.164]: port 1: received SYNC without timestamp
ptp4l[1688.164]: port 1: received SYNC without timestamp

 

0 Kudos
Explorer
Explorer
2,094 Views
Registered: ‎12-20-2017

Re: PTP help for ZCU102

Jump to solution

I've solved my problems, so I'm sharing here what happened:

 

1) I was ignorant of how to modify the device tree to get the MAC driver to see the PTP clock.  The correct way on my platform (ZCU102) with my build system (petalinux 2017.3) is to add the following text to project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi


/include/ "system-conf.dtsi"
/ {
};
/ {
    amba {
        ethernet@ff0e0000 {
            tsu-clk = <250000000>;
        };

    };
};

 

If you are not sure about the 250000000 value (frequency of tsu-clk), I believe you can get this from Vivado under the GEM module in the block diagram.  Otherwise try this and see if it works.

 

2)  After fumbling around for a while, I thought maybe I needed to change the firmware, as recommended on some other posts.  It turns out that this actually BROKE ptp for me... that is, with the change above, PTP still fails to work with the newer firmware.

 

 

View solution in original post

0 Kudos