NVIDIA proposes to introduce a Linux hardware timestamping engine
According to the mailing list, NVIDIA engineers put forward a proposal to introduce a hardware timestamping engine (HTE) subsystem in the Linux kernel.
Some devices have a built-in hardware timestamping engine, which can monitor the status changes of system signals, lines, buses, etc. in real-time; when a change is detected, it can automatically store the timestamping when it occurs. Therefore, this feature may help to obtain higher accuracy in obtaining timestamping than using software counterparts (such as ktime and friends).
The proposal comes from NVIDIA’s Tegra/embedded team, not the graphics team. According to the description of the proposal, the HTE subsystem provides real-time timestamping and other functions through hardware means and centralizes HTE providers and consumers. The provider is registered in the subsystem, and the consumer is the entity of interest, including lines, GPIOs, signals, or buses. The HTE subsystem provides nanosecond timestamping. If the timestamping is not in this unit, the provider will convert it.
In fact, the upstream has already discussed this issue before. During the discussion, Linus and Kent were very in favor of extending GPIOLIB and supported GPIO drivers to increase HTE functions and discussed the possibility of adding HTE providers as irqchips. However, some people objected because HTE devices are not necessarily devices that emit events. It also discussed the possibility of HTE equipment being added as a posix clock type, such as a PTP clock. But it is also opposed because HTE equipment is not necessarily tightly integrated with the hardware clock.
Currently, this patch series implements and expands GPIOLIB and GPIO Tegra drivers, registers Tegra194 (Xavier) as a kernel provider, and has a test driver.