I.MX6ul PTP support
The i.MX6UL CPU Ethernet supports 1588 PTP (PTPv1 & PTPv2).
PTP is supported in Linux via the linuxptp project. This allows synchronizing the system clock to within ±1 us.
Note that Linux kernel version 4.9 or greater is required for PTP support with the i.MX6UL CPU. An example of setting up an ethernet interface with PTP and adjusting the clock based on that is below.
apt-get install linuxptp -y # For PTP on eth0 phc2sys -s /dev/ptp0 -w & ptp4l -2 -H -i eth0 -m -p /dev/ptp0 & # For PTP on eth1 phc2sys -s /dev/ptp1 -w & ptp4l -2 -H -i eth1 -m -p /dev/ptp1 &
If the clocks are significantly off this may take time for the clocks to converge.