Geontech / meta-ha1588

Hardware Assisted 1588 Driver Layer
https://geontech.com/precision-time-protocol-v2-on-a-zynq/
4 stars 3 forks source link

HA1588

This layer includes driver(s) for integrating the HA1588 IP core with Linux via OpenEmbedded Yocto. The related project is for enabling hardware-accelerated 1588 support.

Currently the driver(s) include:

This layer has been used successfully with a Xilinx PicoZed and AXI Ethernet Subsystem 1G/2.5G produced by Vivado 2018.3.

Layer Compatibility

This layer requires Yocto core. It has been tested with the Rocko branch, but may be compatible with newer versions.

Requirements

The following section defines the requirements for the core.

Yocto

Append your kernel features with ha1588.scc:

KERNEL_FEATURES_append = " ha1588.scc"

NOTE: If you are using any other kernel than linux-yocto, append your kernel recipe with include recipes-kernel/linux/ha1588.inc.

Device Tree

The following is an example device tree segment generated by Xilinx's device-tree-xlnx and patched with the compatibility string and ha1588,period property:

rtc_0: rtc@43c10000 {
    clock-names = "S_AXI_ACLK";
    clocks = <&misc_clk_2>;
    compatible = "ha1588,rtc-1.0";
    reg = <0x43c10000 0x10000>;
    ha1588,period = <0x19 0x00000000>;
};

The important properties are the compatible string name and ha1588,period key-value pair.

The ha1588,period is the the clock period for counting time in the HA1588 IP core. It is 40 bits, nanoseconds, and set in firmware. This property is for that initial value which will be updated by the kernel driver. For example, a 40 MHz (25 ns) clock clock is:

# Python: hex(int(25 * 2**32))
25.0 ns x 2^32 = 0x1900000000