NOTE: This driver is now deprecated. Please refer to macb driver.

Introduction

This page gives an overview of emacps driver which is available as part of the Zynq Linux distribution. Paths, files, links and documentation on this page are given relative to the Linux kernel source tree.

Kernel Configuration Options
The following config options should be enabled in order to build the emacps driver
CONFIG_ETHERNET
CONFIG_NET_VENDOR_XILINX
CONFIG_XILINX_PS_EMAC

For enabling the IEEE1588 timestamp support in driver
CONFIG_XILINX_PS_EMAC_HWTSTAMP=y

Kernel configuration options needed for PTP support
CONFIG_PPS - Required
CONFIG_NETWORK_PHY_TIMESTAMPING - Time stamping in PHY devices
PTP_1588_CLOCK - PTP clock support
emacps.JPG

Device tree node details


For more details on phy bindings please refer "Documentation/devicetree/bindings/net/phy.txt"
ps7_ethernet_0: ethernet@e000b000 {
            #address-cells = <1>;
            #size-cells = <0>;
            clock-names = "ref_clk", "aper_clk";
            clocks = <&clkc 13>, <&clkc 30>;
            compatible = "xlnx,ps7-ethernet-1.00.a";
            enet-reset = <&ps7_gpio_0 11 0>;
            interrupt-parent = <&ps7_scugic_0>;
            interrupts = <0 22 4>;
            local-mac-address = [00 0a 35 00 00 00];
            phy-handle = <&phy0>;
            phy-mode = "rgmii-id";
            reg = <0xe000b000 0x1000>;
            xlnx,eth-mode = <0x1>;
            xlnx,has-mdio = <0x1>;
            xlnx,ptp-enet-clock = <111111115>;
            mdio {
                #address-cells = <1>;
                #size-cells = <0>;
                phy0: phy@7 {
                    compatible = "marvell,88e1116r";
                    device_type = "ethernet-phy";
                    reg = <7>;
                } ;
            } ;
        } ;

Features supported

  • IEEE 1588 time stamping
  • Support for EthTool queries
  • NAPI support
  • Power management support


Known Issues and Limitations

IEEE1588 time stamping:

Since the hardware frequency adjustment is complex,using software method to do that. In this mode, PTP packets are still time stamped by the NIC, but the clock which is controlled by PTPd is the system time. For this to work, the time stamps generated inside the NIC are transformed into system time before feeding them into the normal PTPd machinery: each time a NIC time stamp is extracted from the NIC, the NIC system time offset is measured and added to the NIC time stamp to obtain the corresponding system time stamp.

This implementation is tested using With back to back Zynq boards - PTP clock configured to freq 111 Mhz and 125 Mhz for both the boards and one with 111Mhz and the other one with 125Mhz Between Zynq and Linux host machine.

Test results show that, without traffic, the jitter ranging from +- 100ns in best case and +- 1000 to 1200ns in worst case.

Currently the driver calculates the ns_delta/addendum using the formula NS_PER_SEC/rate and update to the XEMACPS_1588_INC register. if the above formula results in fractional values, those values may not fit in to the given register fields. So, it is recommended to use frequencies which will not result in fractional values. like 100 MHz, 111 MHz, 125 Mhz, 166 Mhz.
Here NS_PER_SEC = 1000000000, rate is the ptp clock frequency.

Also the following tech tip details more setup details and PTP protocol information
IEEE1588 Tech Tip

  • NETWROK PHY TIMESTAMPING method is not evaluated on zynq using emacps driver.

Single MAC managing two PHYs:

The current driver has no support for this use case.

No interrupt support for PHY events in driver

The current implementation rely on polling method for phy events


Testing Tools

Diagnostic and Protocol Tests

PING

This utility used to test the reachability of a host on an Internet Protocol(IP) network and to measure the round trip time for messages sent from the originating host to a destination computer

How to Run
ping <Remote IP Address>

WebServer

<TBD>

Telnet

telnet <Server IP Address>

FTP & TFTP

<TBD>

Pkt Generator

Please refer the below link for how to run and various options

https://www.kernel.org/doc/Documentation/networking/pktgen.txt


Stress Test

Iperf with option -d

Run iperf in dual testing mode. This will cause the server to connect back to the client on the port specified in the -L option (or defaults to the port the client connected to the server on). This is done immediately therefore running the tests simultaneously.

./iperf_arm -c <Server IP> -d

Ping flood test
Users can send hundred or more packets per second using -f option. It prints a ‘.’ when a packet is sent, and a backspace is printed when a packet is received

ping -f localhost

Performance Tests

Netperf

More information please refer the below link
http://www.netperf.org/netperf/

How to Run
Server:
netserver

Client:
taskset 2 ./netperf -H <Server IP> -t TCP_STREAM
taskset 2 ./netperf -H <Server IP> -t UDP_STREAM

Iperf
More information please refer the below link
http://en.wikipedia.org/wiki/Iperf

How to Run
Server:

./iperf_arm -s -u
./iperf_arm -s

Client:

./iperf_arm -c <Server IP> -u -b <banwidth>

./iperf_arm -c <Server IP>


IEEE1588

Build Instructions PTPd


Build Instructions for PTPd
    • Get the source from git clone git://git.code.sf.net/p/linuxptp/code linuxptp
    • Set the CROSS_COMPILE environment variable arm tool chain
    • Install the kernel headers
    • Include the headers path in makefile
INC = -I<PATH>/include
CFLAGS = -Wall $(VER) $(incdefs) $(DEBUG) $(INC) $(EXTRA_CFLAGS)
How to Run:
Master:
./ptp4l -i eth0 -m -P &

Slave:
./ptp4l -i eth0 -s -m -P &

Build Instructions for TestPtp utility

  • Go to the Documentation\ptp folder in the Linux distribution
  • Cross compile the testptp application.

Work tobe done

  • Migrate to opensource macb driver
  • Support for single mac managing two phys