cachepc-linux

Fork of AMDESE/linux with modifications for CachePC side-channel attack
git clone https://git.sinitax.com/sinitax/cachepc-linux
Log | Files | Refs | README | LICENSE | sfeed.txt

tegra194-hte.rst (2229B)


      1.. SPDX-License-Identifier: GPL-2.0+
      2
      3HTE Kernel provider driver
      4==========================
      5
      6Description
      7-----------
      8The Nvidia tegra194 HTE provider driver implements two GTE
      9(Generic Timestamping Engine) instances: 1) GPIO GTE and 2) LIC
     10(Legacy Interrupt Controller) IRQ GTE. Both GTE instances get the
     11timestamp from the system counter TSC which has 31.25MHz clock rate, and the
     12driver converts clock tick rate to nanoseconds before storing it as timestamp
     13value.
     14
     15GPIO GTE
     16--------
     17
     18This GTE instance timestamps GPIO in real time. For that to happen GPIO
     19needs to be configured as input. The always on (AON) GPIO controller instance
     20supports timestamping GPIOs in real time and it has 39 GPIO lines. The GPIO GTE
     21and AON GPIO controller are tightly coupled as it requires very specific bits
     22to be set in GPIO config register before GPIO GTE can be used, for that GPIOLIB
     23adds two optional APIs as below. The GPIO GTE code supports both kernel
     24and userspace consumers. The kernel space consumers can directly talk to HTE
     25subsystem while userspace consumers timestamp requests go through GPIOLIB CDEV
     26framework to HTE subsystem.
     27
     28.. kernel-doc:: drivers/gpio/gpiolib.c
     29   :functions: gpiod_enable_hw_timestamp_ns gpiod_disable_hw_timestamp_ns
     30
     31For userspace consumers, GPIO_V2_LINE_FLAG_EVENT_CLOCK_HTE flag must be
     32specified during IOCTL calls. Refer to ``tools/gpio/gpio-event-mon.c``, which
     33returns the timestamp in nanoseconds.
     34
     35LIC (Legacy Interrupt Controller) IRQ GTE
     36-----------------------------------------
     37
     38This GTE instance timestamps LIC IRQ lines in real time. There are 352 IRQ
     39lines which this instance can add timestamps to in real time. The hte
     40devicetree binding described at ``Documentation/devicetree/bindings/hte/``
     41provides an example of how a consumer can request an IRQ line. Since it is a
     42one-to-one mapping with IRQ GTE provider, consumers can simply specify the IRQ
     43number that they are interested in. There is no userspace consumer support for
     44this GTE instance in the HTE framework.
     45
     46The provider source code of both IRQ and GPIO GTE instances is located at
     47``drivers/hte/hte-tegra194.c``. The test driver
     48``drivers/hte/hte-tegra194-test.c`` demonstrates HTE API usage for both IRQ
     49and GPIO GTE.