Dear Christophe,
1.
That's a good point the Juan mentioned Kinetis - I found several threads it might make sense for you to look into (sorry, I am not a SW person, thus cannot judge how much they may help in this case):
2.
Some details of the test using 2 different Freescale's boards, which are not Vybrid-based (cannot really comment on the below text - not an IEEE 1558 expert):
"I’m not running any 1588 software stack, simply set one board up to transmit 500 back-to-back frames by preparing 500 TxBDs and the second board receive all 500 frames by preparing 500 RxBDs.
... at the end of the test, I look at the differences in deltas of consecutive timestamps in the buffer descriptors to determine latency for each pair of frames, i.e. Latency = | (Tn – Tn-1) – (Rn – Rn-1)|.
Since the transmit frames are all back-to-back, I never saw any latency in the TxBD timestamps, i.e. Tn –Tn-1 was always the same for each test. Therefore, the latency values below represent the latency in the receive time-stamping:
1. 2-nd board RMII (Tx) -> 1-st board RMII (Rx) – 80ns latency (IEEE 1588 timestamp clock source equals 50 MHz),
2. 1-st board RMII (Tx) -> 2-nd board RMII (Rx) – 80ns latency (IEEE 1588 timestamp clock source equals 50 MHz),
3. 2-nd board MII (Tx) -> 1-st board RMII (Rx) – 80ns latency (IEEE 1588 timestamp clock source equals 50 MHz),
4. 1-st board RMII (Tx) -> 2-nd board MII (Rx) – 20ns latency (IEEE 1588 timestamp clock source equals 50 MHz),
5. 1-st board RMII (Tx) -> 2-nd board MII (Rx) – 10ns latency (IEEE 1588 timestamp clock source equals 100 MHz).
These results line up with what I would expect:
- For experiments 1-3, we see the 80ns latency when using the RMII as the receiver.
- For experiments 4 and 5, we see a reduced latency when MII is used as the receiver.
It must be noted that additional latency may be seen as a result of the MAC detecting the SFD in the MII clock domain and capturing the timestamp in the IEEE 1588 clock domain.
If two these clocks are from different sources, I expect additional latency equal to the period of the IEEE1588 timestamp clock:
- For experiments 1-3, when the receiver is in RMII mode, the 50 MHz crystal on the serial board is driving the XTAL pin, is the source of the RMII clock, and used to generate the 1588 timestamp clock. So, those two clock sources are the same, so no additional latency.
- For experiments 4 and 5 when the receiver is in MII mode the PHY is driving the MII Rx clock, which is recovered from the RX data and is essentially the Tx clock from the transmitter board and the crystal on the serial board is driving the XTAL pin, which is used to generate the 1588 timestamp clock. So in this case the clock sources are different, so we expect additional latency, which we see.
... A simple message ... is there will be a possible latency of 80ns in 100Mb/s operation (and 800ns in 10 Mb/s) operation due to Rx to Tx clock synchronization.
- For RMII, the Rx clock is given to the PHY, so synchronization has to occur between the Tx and Rx clock fairly often.
- For MII, the Rx clock is driven from the PHY and can be recovered from the data, so can stay synchronized with the Tx clock."
Regards, Naoum Gitnik.