# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/tegra_gte/tegra-gte.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: NVIDIA Tegra T194 GTE (Generic hardware Timestamping Engine) bindings

maintainers:
  - Dipen Patel <dipenp@nvidia.com>

description: |+
  GTE is a hardware block which monitors various events for the state change and
  timestamps them using TSC counter. Tegra implements LIC GTE and AON GTE
  instances. LIC GTE is used only to monitor LIC IRQ lines and AON GTE is used
  to monitor Always On domain GPIO lines.

properties:
  compatible:
    enum:
      - nvidia,tegra194-gte-lic
      - nvidia,tegra194-gte-aon
      - nvidia,tegra234-gte-aon

  reg:
    maxItems: 1
    description: physical base address.

  interrupts:
    description:
	    interrupt number

  nvidia,int-threshold:
    $ref: /schemas/types.yaml#/definitions/uint32
    description:
      GTE device generates its interrupt based on this u32 FIFO threshold
      value. The recommended value is 1.
    minimum: 1
    maximum: 256

  nvidia,num-slices:
    $ref: /schemas/types.yaml#/definitions/uint32
    description:
      GTE lines are arranged in 32 bit slice where each bit represents different
      line/signal that it can enable/configure for the timestamp. It is u32
      property and the value depends on the GTE instance in the chip. Tegra194
      LIC instance uses 11 slices while Tegra234 instance uses 17 slices to
      represent interrupts line from LIC. The AON-GPIO GTE instances for both
      Tegra194 and Tegra234 use 3 slices for the GPIO.
    enum: [3, 11, 17]

required:
  - compatible
  - reg
  - interrupts
  - nvidia,num-slices

additionalProperties: false

examples:
  - |
    gte@3aa0000 {
        interrupts = <0x00 0x0b 0x04>;
        compatible = "nvidia,tegra194-gte-lic";
        nvidia,int-threshold = <0x01>;
        status = "okay";
        nvidia,num-slices = <0x11>;
        reg = <0x3aa0000 0x10000>;
    };

    gte@c1e0000 {
        interrupts = <0x00 0x0d 0x04>;
        compatible = "nvidia,tegra234-gte-aon";
        nvidia,int-threshold = <0x01>;
        status = "okay";
        nvidia,num-slices = <0x03>;
        reg = <0xc1e0000 0x10000>;
    };
