This driver is experimental, and is not promised to be stable.
The API is subject to change in future releases, and is not enabled by default.
GPIO direction change falling and rising information is not reliable using GTE, but GTE monitoring LIC IRQ can convey that information correctly.
The Jetson Generic Timestamp Engine (GTE) provides hardware timestamping for state changes of specific signals, including LIC (Legacy Interrupt Controller) interrupt lines and AON (Always On) domain GPIOs. GPIOs to be monitored must be configured as input and as GPIO IRQ. The GTE kernel device driver provides various APIs for clients to register, retrieve and unregister specific signals. This guide provides the details on how to enable and use GTE kernel driver.
Once the GTE kernel driver is enabled, it creates two GTE instances and a device node:
• /sys/devices/c1e0000.gte/ (for AON GPIO monitoring)
cle0000.gte in turn creates one device node: /dev/gtechip0 (for use by a user space utility to monitor AON GPIO from user space).
The GTE kernel driver is accompanied by a kernel sample test driver which demonstrates how to monitor a LIC interrupt line and AON GPIO for state changes. When a monitored line’s state changes, the GTE hardware on Jetson timestamps the change. A client program can use the GTE kernel driver API to retrieve the timestamp for the configured signal.
The GTE kernel driver is also accompanied by a user space sample application which demonstrates how to monitor AON GPIO from user space.
Enabling the GTE Driver
To enable the GTE kernel driver, you must modify the device tree, set GTE-related configuration options for the kernel, rebuild the kernel and device tree, and reflash the rebuilt kernel and device tree to the Jetson device. The following steps accomplish these things.
Note:
For the default setup scenario, you must ensure that GPIOs 256 and 257 are not being used by any other kernel drivers or user space applications.
To enable the GTE device tree nodes
• On the host, add the following lines to tegra194-p2822-0000-a00.dtsi:
gte@3aa0000 {
status = "okay";
};
gte@c1e0000 {
status = "okay";
};
gpio@c2f0000 {
/delete-property/ use-timestamp;
};
After you modify the .dtsi file, locate the compiled device tree blob tegra194-p2888-0001-p2822-0000.dtb on the host and flash it. For instructions on how to compile and flash the device tree .dtb file, see the topic Kernel Customization.
To enable and compile the GTE kernel driver and GTE kernel test driver
1. Locate the source code for the GTE kernel device driver and its test kernel driver on the host. The source code should be in this directory:
<kernel_source>/drivers/staging/platform/tegra/
Where <kernel_source> is the directory you have chosen to hold kernel source code.
3. Ensure that the proper cross-compiler toolchain is set up. See the topic Kernel Customization for more information.
4. Set up the environment and build the kernel. See Kernel Customization for more information.
5. Copy the built files to the Jetson device.
1. Go to the host’s output directory. (See Building the NVIDIA Kernel in “Kernel Customization.”) Locate the files Image and tegra194_gte_test.ko.
2. Copy Image to /boot/Image on the Jetson device.
3. Copy tegra194_gte_test.ko to a directory of your choice on the Jetson device. This is the GTE sample kernel test driver.
6. Enter this command on the Jetson device to restart the device:
$ sudo systemctl reboot
Running Sample GTE Tests
Running tests is described for the GTE feature’s default setup. If you modify the setup, change the test procedures appropriately.
To run sample GTE tests, you must short pins 32 and 16 on the Jetson AGX Xavier carrier board’s 40‑pin header, where pin 32 is AON GPIO BB-1 configured as input, and pin 16 is AON GPIO BB-0 configured as output.
You must log in to the Jetson device as root to run any of the sample GTE tests.