04-24-2018 05:12 AM
I have a question regarding PTP, Linux kernel 3.19 together with emac ps driver on a ZYNQ 7000 board (AVNET PicoZed board "BD-Z7PZ-7Z020-G" and the ethernet phy controller "Marvell 88E1512 Phy").
Regarding to the ethernet controller specifications, L2 (MAC) hardware timestamping should be feasible. However, I run into challenges and hope that someone can help.
I am trying to get ptp4l to work with the network option "network_transport L2". It currently only works when i choose "network_transport UDPv4".
Debug output for "network_transport UDPv4" seems to be "OK" (more or less), e.g. it prints something like:
ptp4l[9382.904]: delay filtered 43676 raw 43713
ptp4l[9383.904]: port 1: delay timeout
ptp4l[9383.948]: rms 545 max 951 freq -2401 +/- 479 delay 43682 +/- 27
Only the huge rms times (~545) are disappointing and not acceptable, and therefore I thought that switching to "network_transport L2" should be much better. However, the debug output for "network_transport L2" shows only following messages continuously:
ptp4l[9563.701]: port 1: delay timeout
ptp4l[9564.493]: port 1: received SYNC without timestamp
ptp4l[9564.548]: port 1: received PDELAY_REQ without timestamp
No PTP sync happens at all. Any suggestions about that?
(Note: Full debug traces are listed in the attachments.)
ethtool shows that hardware timestamping is enabled. Therefore I think, that "network_transport L2" must be working.
> ethtool -T eth0
Time stamping parameters for eth0:
PTP Hardware Clock: 0
Hardware Transmit Timestamp Modes:
Hardware Receive Filter Modes:
The device-tree-blob dtb file entry for the network is as followed:
#address-cells = <0x1>;
#size-cells = <0x0>;
clock-names = "pclk", "hclk", "tx_clk", "ref_clk", "aper_clk";
clocks = <0x2 0x1e 0x2 0x1e 0x2 0xd 0x2 0xd 0x2 0x1e>;
compatible = "cdns,gem", "xlnx,ps7-ethernet-1.00.a";
interrupt-parent = <0x3>;
interrupts = <0x0 0x16 0x4>;
local-mac-address = [00 0a 35 00 00 00];
reg = <0xe000b000 0x1000>;
xlnx,enet-reset = <0xffffffff>;
xlnx,eth-mode = <0x1>;
xlnx,has-mdio = <0x1>;
xlnx,ptp-enet-clock = <0x69f6bcb>;
phy-handle = <0x5>;
phy-mode = "rgmii-id";
compatible = "marvell,88e1512";
device_type = "ethernet-phy";
reg = <0x0>;
linux,phandle = <0x5>;
phandle = <0x5>;
Another questions which I have:
1) I was not able to get the hardware timestamping to work with Linux 4.14. Is there any new kernel driver available which I can use?
2) Further, I was not able to get the hardware timestamping to work with the Cadence/MACB driver. ethtool never showed me hardware timestamping support (maybe this is a similar issue as in thread https://forums.xilinx.com/t5/Embedded-Linux/PTP-support-with-MACB/m-p/777166#M20409). Any new news about that?
(Note: MACB driver is loaded if i use "compatible = "cdns,gem", "xlnx,ps7-ethernet-1.00.a" within the dtb file.)
02-04-2019 12:37 AM
I am facing the same issue in Zcu102 board. Did you figure out how to get ptp4l to work? I would really appreciate your help.
Thank you and Regards,
05-10-2019 07:17 AM
For those struggling with PTP on the Zynq-7000 series, Xilinx has officially removed IEEE 1588 support from it, due to the newer macb driver not supporting accurate enough timestamps.
You have to use the deprecated emacps Ethernet driver instead. Xilinx has removed the emacps driver in the newer versions of Petalinux, but I was able to patch it back into Petalinux 2018.1 so I could use it for my PTP requirements: https://forums.xilinx.com/t5/Embedded-Linux/PetaLinux-2018-1-No-emacps-driver-for-Ethernet/m-p/855357#M25970
I'm using this driver in conjunction with the SoC-e PrecisionTimeBasic Hardware timestamping IP.
Your other option would be to migrate to ZynqMP, which does support IEEE 1588 in the macb driver. I didn't do this because we had already done significant development on the Zynq-7000 board at the time Xilinx removed the IEEE 1588 support. ZynqMP is also more expensive.