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: 
Newbie tik0
Newbie
139 Views
Registered: ‎01-16-2019

PTP IEEE 1588 one-step on Zynq UltraScale+ MPSoC causes ptp4l to hang after sending SYNC message

We try to set up one-step-syncing on the Zynq UltraScale+ MPSoC with the Marvell Alaska 88E1512. Please see the configurations, device tree, kernel flags, etc. at the bottom! We setup ptp4l for two-step syncing as explained in [1,2] and everthing works fine even for software and hardware assisted PTP (aka ptp4l -S vs. ptp4l -H). However, whenever we run ptp4l with one-step via the following command `ptp4l -m -l7 -2 -H -E -f /etc/ptp4l.conf -i eth0` (with `phc2sys -s CLOCK_REALTIME -c eth0 -w -r -r` in the background), the program freezes after the first SYNC message (see the output below). If we apply wireshark on a remote client, we see the first announce and sync message coming over the wire as can be seen here:

ptp_ann.jpgptp_sync.jpg 

 After this, ptp4l needs to be killed with `-9` because it is completely frozen.

Do we miss something in the devicetree or in the kernelflags?
Has anyone managed to run one-step syncing on the Zynq?


[1] https://doc.opensuse.org/documentation/leap/tuning/html/book.sle.tuning/cha.tuning.ptp.html#tuning.ptp.ntp2ptp
[2] https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/deployment_guide/ch-configuring_ptp_using_ptp4l

Hardware:

  • Zynq UltraScale+ MPSoC xczu9eg-ffvb1156-1-e
  • Marvell Alaska 88E1512

Softwarestack:

Working ptp4l runs (with `phc2sys -s CLOCK_REALTIME -c eth0 -w -r -r` in the background):

  • ptp4l -m -l7 -2 -H -E -i eth0
  • ptp4l -m -l7 -2 -S -E -i eth0

Devicetree entry:

 

		ethernet@ff0e0000 {
			compatible = "cdns,zynqmp-gem", "cdns,gem";
			status = "okay";
			interrupt-parent = <0x4>;
			interrupts = <0x0 0x3f 0x4 0x0 0x3f 0x4>;
			reg = <0x0 0xff0e0000 0x0 0x1000>;
			clock-names = "pclk", "hclk", "tx_clk", "rx_clk", "tsu_clk";
			#address-cells = <0x1>;
			#size-cells = <0x0>;
			#stream-id-cells = <0x1>;
			iommus = <0x9 0x877>;
			power-domains = <0x11>;
			clocks = <0x3 0x1f 0x3 0x34 0x3 0x30 0x3 0x34 0x3 0x2c>;
			phy-mode = "rgmii-id";
			xlnx,ptp-enet-clock = <0x0>;
			local-mac-address = [00 0a 35 00 22 01];
			phy-handle = <0x12>;
			tsu-clk = <0xee6b280>;

			phy0@1 {
				device_type = "ethernet-phy";
				reg = <0x1>;
				linux,phandle = <0x12>;
				phandle = <0x12>;
			};
		};

ethtool -T eth0 output:

Time stamping parameters for eth0:
Capabilities:
	hardware-transmit     (SOF_TIMESTAMPING_TX_HARDWARE)
	software-transmit     (SOF_TIMESTAMPING_TX_SOFTWARE)
	hardware-receive      (SOF_TIMESTAMPING_RX_HARDWARE)
	software-receive      (SOF_TIMESTAMPING_RX_SOFTWARE)
	software-system-clock (SOF_TIMESTAMPING_SOFTWARE)
	hardware-raw-clock    (SOF_TIMESTAMPING_RAW_HARDWARE)
PTP Hardware Clock: 0
Hardware Transmit Timestamp Modes:
	off                   (HWTSTAMP_TX_OFF)
	on                    (HWTSTAMP_TX_ON)
	one-step-sync         (HWTSTAMP_TX_ONESTEP_SYNC)
Hardware Receive Filter Modes:
	none                  (HWTSTAMP_FILTER_NONE)
	all                   (HWTSTAMP_FILTER_ALL)

KERNELFLAGS via `zcat /proc/config.gz | grep -i "PPS\|PTP\|MACB\|TIMESTAMPING"`:

CONFIG_NET_PTP_CLASSIFY=y
CONFIG_NETWORK_PHY_TIMESTAMPING=y
CONFIG_MACB=y
CONFIG_MACB_USE_HWSTAMP=y
# CONFIG_MACB_PCI is not set
CONFIG_PPS=y
# CONFIG_PPS_DEBUG is not set
# PPS clients support
# CONFIG_PPS_CLIENT_KTIMER is not set
# CONFIG_PPS_CLIENT_LDISC is not set
# CONFIG_PPS_CLIENT_GPIO is not set
# PPS generators support
# PTP clock support
CONFIG_PTP_1588_CLOCK=y
# Enable PHYLIB and NETWORK_PHY_TIMESTAMPING to see the additional clocks.

/etc/ptp4l.conf:

[global]
priority1       127
twoStepFlag       0

 

`ptp4l -m -l7 -2 -H -E -f /etc/ptp4l.conf -i eth0` output:

$ ptp4l -m -l7 -2 -H -E -f /etc/ptp4l.conf -i eth0
ptp4l[1568.689]: config item (null).assume_two_step is 0
ptp4l[1568.690]: config item (null).check_fup_sync is 0
ptp4l[1568.690]: config item (null).tx_timestamp_timeout is 1
ptp4l[1568.690]: config item (null).clock_servo is 0
ptp4l[1568.690]: config item (null).time_stamping is 1
ptp4l[1568.690]: config item (null).clock_servo is 0
ptp4l[1568.690]: config item (null).clockClass is 248
ptp4l[1568.690]: config item (null).clockAccuracy is 254
ptp4l[1568.690]: config item (null).offsetScaledLogVariance is 65535
ptp4l[1568.690]: config item (null).productDescription is ';;'
ptp4l[1568.690]: config item (null).revisionData is ';;'
ptp4l[1568.690]: config item (null).userDescription is ''
ptp4l[1568.690]: config item (null).manufacturerIdentity is '00:00:00'
ptp4l[1568.690]: config item (null).domainNumber is 0
ptp4l[1568.690]: config item (null).slaveOnly is 0
ptp4l[1568.690]: config item (null).twoStepFlag is 0
ptp4l[1568.690]: config item (null).priority1 is 127
ptp4l[1568.690]: config item (null).priority2 is 128
ptp4l[1568.691]: config item (null).gmCapable is 1
ptp4l[1568.691]: config item (null).gmCapable is 1
ptp4l[1568.691]: locked item global.time_stamping as 3
ptp4l[1568.691]: config item (null).free_running is 0
ptp4l[1568.691]: selected /dev/ptp0 as PTP clock
ptp4l[1568.691]: config item (null).uds_address is '/var/run/ptp4l'
ptp4l[1568.691]: section item /var/run/ptp4l.announceReceiptTimeout now 0
ptp4l[1568.691]: section item /var/run/ptp4l.delay_mechanism now 0
ptp4l[1568.691]: section item /var/run/ptp4l.network_transport now 0
ptp4l[1568.691]: section item /var/run/ptp4l.delay_filter_length now 1
ptp4l[1568.691]: config item (null).free_running is 0
ptp4l[1568.691]: config item (null).freq_est_interval is 1
ptp4l[1568.691]: config item (null).gmCapable is 1
ptp4l[1568.691]: config item (null).kernel_leap is 1
ptp4l[1568.691]: config item (null).timeSource is 160
ptp4l[1568.691]: config item (null).pi_proportional_const is 0.000000
ptp4l[1568.691]: config item (null).pi_integral_const is 0.000000
ptp4l[1568.691]: config item (null).pi_proportional_scale is 0.000000
ptp4l[1568.691]: config item (null).pi_proportional_exponent is -0.300000
ptp4l[1568.692]: config item (null).pi_proportional_norm_max is 0.700000
ptp4l[1568.692]: config item (null).pi_integral_scale is 0.000000
ptp4l[1568.692]: config item (null).pi_integral_exponent is 0.400000
ptp4l[1568.692]: config item (null).pi_integral_norm_max is 0.300000
ptp4l[1568.692]: config item (null).step_threshold is 0.000000
ptp4l[1568.692]: config item (null).first_step_threshold is 0.000020
ptp4l[1568.692]: config item (null).max_frequency is 900000000
ptp4l[1568.692]: config item (null).tsproc_mode is 0
ptp4l[1568.692]: config item (null).delay_filter is 1
ptp4l[1568.692]: config item (null).delay_filter_length is 10
ptp4l[1568.692]: config item (null).summary_interval is 0
ptp4l[1568.692]: config item (null).sanity_freq_limit is 200000000
ptp4l[1568.692]: PI servo: sync interval 1.000 kp 0.700 ki 0.300000
ptp4l[1568.692]: config item /var/run/ptp4l.boundary_clock_jbod is 0
ptp4l[1568.692]: config item /var/run/ptp4l.network_transport is 0
ptp4l[1568.692]: config item /var/run/ptp4l.delayAsymmetry is 0
ptp4l[1568.692]: config item /var/run/ptp4l.follow_up_info is 0
ptp4l[1568.693]: config item /var/run/ptp4l.freq_est_interval is 1
ptp4l[1568.693]: config item /var/run/ptp4l.hybrid_e2e is 0
ptp4l[1568.693]: config item /var/run/ptp4l.path_trace_enabled is 0
ptp4l[1568.693]: config item /var/run/ptp4l.ingressLatency is 0
ptp4l[1568.693]: config item /var/run/ptp4l.egressLatency is 0
ptp4l[1568.693]: config item /var/run/ptp4l.delay_mechanism is 0
ptp4l[1568.693]: config item /var/run/ptp4l.fault_badpeernet_interval is 16
ptp4l[1568.693]: config item /var/run/ptp4l.fault_reset_interval is 4
ptp4l[1568.693]: config item /var/run/ptp4l.tsproc_mode is 0
ptp4l[1568.693]: config item /var/run/ptp4l.delay_filter is 1
ptp4l[1568.693]: config item /var/run/ptp4l.delay_filter_length is 1
ptp4l[1568.693]: config item eth0.boundary_clock_jbod is 0
ptp4l[1568.693]: config item eth0.network_transport is 3
ptp4l[1568.693]: config item eth0.delayAsymmetry is 0
ptp4l[1569.027]: config item eth0.follow_up_info is 0
ptp4l[1569.027]: config item eth0.freq_est_interval is 1
ptp4l[1569.027]: config item eth0.hybrid_e2e is 0
ptp4l[1569.027]: config item eth0.path_trace_enabled is 0
ptp4l[1569.027]: config item eth0.ingressLatency is 0
ptp4l[1569.027]: config item eth0.egressLatency is 0
ptp4l[1569.027]: config item eth0.delay_mechanism is 1
ptp4l[1569.027]: config item eth0.fault_badpeernet_interval is 16
ptp4l[1569.027]: config item eth0.fault_reset_interval is 4
ptp4l[1569.027]: config item eth0.tsproc_mode is 0
ptp4l[1569.027]: config item eth0.delay_filter is 1
ptp4l[1569.027]: config item eth0.delay_filter_length is 10
ptp4l[1569.027]: config item eth0.logMinDelayReqInterval is 0
ptp4l[1569.027]: config item eth0.logAnnounceInterval is 1
ptp4l[1569.027]: config item eth0.announceReceiptTimeout is 3
ptp4l[1569.027]: config item eth0.syncReceiptTimeout is 0
ptp4l[1569.027]: config item eth0.transportSpecific is 0
ptp4l[1569.027]: config item eth0.logSyncInterval is 0
ptp4l[1569.028]: config item eth0.logMinPdelayReqInterval is 0
ptp4l[1569.028]: config item eth0.neighborPropDelayThresh is 20000000
ptp4l[1569.028]: config item eth0.min_neighbor_prop_delay is -20000000
ptp4l[1569.028]: config item eth0.ptp_dst_mac is '01:1B:19:00:00:00'
ptp4l[1569.028]: config item eth0.p2p_dst_mac is '01:80:C2:00:00:0E'
ptp4l[1569.072]: port 1: INITIALIZING to LISTENING on INITIALIZE
ptp4l[1569.072]: config item /var/run/ptp4l.logMinDelayReqInterval is 0
ptp4l[1569.072]: config item /var/run/ptp4l.logAnnounceInterval is 1
ptp4l[1569.072]: config item /var/run/ptp4l.announceReceiptTimeout is 0
ptp4l[1569.072]: config item /var/run/ptp4l.syncReceiptTimeout is 0
ptp4l[1569.072]: config item /var/run/ptp4l.transportSpecific is 0
ptp4l[1569.072]: config item /var/run/ptp4l.logSyncInterval is 0
ptp4l[1569.072]: config item /var/run/ptp4l.logMinPdelayReqInterval is 0
ptp4l[1569.072]: config item /var/run/ptp4l.neighborPropDelayThresh is 20000000
ptp4l[1569.072]: config item /var/run/ptp4l.min_neighbor_prop_delay is -20000000
ptp4l[1569.072]: config item (null).uds_address is '/var/run/ptp4l'
ptp4l[1569.072]: port 0: INITIALIZING to LISTENING on INITIALIZE
ptp4l[1569.072]: interface index 1 is up
ptp4l[1569.072]: interface index 2 is up
ptp4l[1569.073]: port 1: link up
ptp4l[1569.073]: interface index 3 is down
ptp4l[1569.178]: port 0: setting asCapable
ptp4l[1576.023]: port 1: announce timeout
ptp4l[1576.023]: port 1: LISTENING to MASTER on ANNOUNCE_RECEIPT_TIMEOUT_EXPIRES
ptp4l[1576.023]: selected best master clock 5410ec.fffe.64c4ae
ptp4l[1576.023]: assuming the grand master role
ptp4l[1576.024]: port 1: master tx announce timeout
ptp4l[1576.024]: port 1: setting asCapable
ptp4l[1577.023]: port 1: master sync timeout

 

0 Kudos