drivers: ethernet: mcux: improve receive timestamp accuracy

When ENET_ENHANCEDBUFFERDESCRIPTOR_MODE enabled,
MAC will automatic capture receive nanosecond from 1588TMR
and return back to ENET_ReadFrame. It is a highest accuracy
recv timestamp_ns, we do not need manually read from 1588TMR.

By this change, receive timestamp accuracy increase
from 20us to 200ns above.

Signed-off-by: Chen Caidy <chen@caidy.cc>
This commit is contained in:
Chen Caidy 2023-07-19 03:47:03 +00:00 committed by Anas Nashif
commit 90b322761a

View file

@ -860,7 +860,7 @@ static int eth_rx(struct eth_context *context)
ptpTimeData.second--;
}
pkt->timestamp.nanosecond = ptpTimeData.nanosecond;
pkt->timestamp.nanosecond = ts;
pkt->timestamp.second = ptpTimeData.second;
} else {
/* Invalid value. */