···11+.. SPDX-License-Identifier: GPL-2.0+22+33+HTE Kernel provider driver44+==========================55+66+Description77+-----------88+The Nvidia tegra HTE provider also known as GTE (Generic Timestamping Engine)99+driver implements two GTE instances: 1) GPIO GTE and 2) LIC1010+(Legacy Interrupt Controller) IRQ GTE. Both GTE instances get the timestamp1111+from the system counter TSC which has 31.25MHz clock rate, and the driver1212+converts clock tick rate to nanoseconds before storing it as timestamp value.1313+1414+GPIO GTE1515+--------1616+1717+This GTE instance timestamps GPIO in real time. For that to happen GPIO1818+needs to be configured as input. Only the always on (AON) GPIO controller1919+instance supports timestamping GPIOs in real time as it is tightly coupled with2020+the GPIO GTE. To support this, GPIOLIB adds two optional APIs as mentioned2121+below. The GPIO GTE code supports both kernel and userspace consumers. The2222+kernel space consumers can directly talk to HTE subsystem while userspace2323+consumers timestamp requests go through GPIOLIB CDEV framework to HTE2424+subsystem. The hte devicetree binding described at2525+``Documentation/devicetree/bindings/timestamp`` provides an example of how a2626+consumer can request an GPIO line.2727+2828+See gpiod_enable_hw_timestamp_ns() and gpiod_disable_hw_timestamp_ns().2929+3030+For userspace consumers, GPIO_V2_LINE_FLAG_EVENT_CLOCK_HTE flag must be3131+specified during IOCTL calls. Refer to ``tools/gpio/gpio-event-mon.c``, which3232+returns the timestamp in nanoseconds.3333+3434+LIC (Legacy Interrupt Controller) IRQ GTE3535+-----------------------------------------3636+3737+This GTE instance timestamps LIC IRQ lines in real time. The hte devicetree3838+binding described at ``Documentation/devicetree/bindings/timestamp``3939+provides an example of how a consumer can request an IRQ line. Since it is a4040+one-to-one mapping with IRQ GTE provider, consumers can simply specify the IRQ4141+number that they are interested in. There is no userspace consumer support for4242+this GTE instance in the HTE framework.4343+4444+The provider source code of both IRQ and GPIO GTE instances is located at4545+``drivers/hte/hte-tegra194.c``. The test driver4646+``drivers/hte/hte-tegra194-test.c`` demonstrates HTE API usage for both IRQ4747+and GPIO GTE.
-48
Documentation/driver-api/hte/tegra194-hte.rst
···11-.. SPDX-License-Identifier: GPL-2.0+22-33-HTE Kernel provider driver44-==========================55-66-Description77------------88-The Nvidia tegra194 HTE provider driver implements two GTE99-(Generic Timestamping Engine) instances: 1) GPIO GTE and 2) LIC1010-(Legacy Interrupt Controller) IRQ GTE. Both GTE instances get the1111-timestamp from the system counter TSC which has 31.25MHz clock rate, and the1212-driver converts clock tick rate to nanoseconds before storing it as timestamp1313-value.1414-1515-GPIO GTE1616---------1717-1818-This GTE instance timestamps GPIO in real time. For that to happen GPIO1919-needs to be configured as input. The always on (AON) GPIO controller instance2020-supports timestamping GPIOs in real time and it has 39 GPIO lines. The GPIO GTE2121-and AON GPIO controller are tightly coupled as it requires very specific bits2222-to be set in GPIO config register before GPIO GTE can be used, for that GPIOLIB2323-adds two optional APIs as below. The GPIO GTE code supports both kernel2424-and userspace consumers. The kernel space consumers can directly talk to HTE2525-subsystem while userspace consumers timestamp requests go through GPIOLIB CDEV2626-framework to HTE subsystem.2727-2828-See gpiod_enable_hw_timestamp_ns() and gpiod_disable_hw_timestamp_ns().2929-3030-For userspace consumers, GPIO_V2_LINE_FLAG_EVENT_CLOCK_HTE flag must be3131-specified during IOCTL calls. Refer to ``tools/gpio/gpio-event-mon.c``, which3232-returns the timestamp in nanoseconds.3333-3434-LIC (Legacy Interrupt Controller) IRQ GTE3535------------------------------------------3636-3737-This GTE instance timestamps LIC IRQ lines in real time. There are 352 IRQ3838-lines which this instance can add timestamps to in real time. The hte3939-devicetree binding described at ``Documentation/devicetree/bindings/timestamp``4040-provides an example of how a consumer can request an IRQ line. Since it is a4141-one-to-one mapping with IRQ GTE provider, consumers can simply specify the IRQ4242-number that they are interested in. There is no userspace consumer support for4343-this GTE instance in the HTE framework.4444-4545-The provider source code of both IRQ and GPIO GTE instances is located at4646-``drivers/hte/hte-tegra194.c``. The test driver4747-``drivers/hte/hte-tegra194-test.c`` demonstrates HTE API usage for both IRQ4848-and GPIO GTE.