ocp-diag-pci_lmt
ocp-diag-pci_lmt copied to clipboard
Support margin time
The following features are enhanced :
- margin time support
Per pcie spec 4.2.18.4 "Software should allow margining to run for at least 10^8 bits margined by the Receiver under test before switching to the next margin step location (unless the error limit is exceeded)." The current LMT code does not consider this and once started, the margin is finished without any waiting time. A new -m margin_time option is added to allow the lane to stay in margin for at least margin_time seconds.
- Fix incorrect margin result When a margin command is sent to the device, it is possible the device will need some time to prepare the margin, in other words, we need to check the step_margin_execution_status is 0x2 ( margin in progress ) before concluding the margin is in effect.
We run the original code on our products and find the margin results are inconsistent:
- As the step increases, the margin result experience pass, fail ,pass scenario
- we find the sample_count_bits is way small than expected ( for example 512 bits ) when error_count is 0
After the two fixes, the margin result is consistent.