All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dipen Patel <dipenp@nvidia.com>
To: Randy Dunlap <rdunlap@infradead.org>, <thierry.reding@gmail.com>,
	<jonathanh@nvidia.com>, <linux-kernel@vger.kernel.org>,
	<linux-tegra@vger.kernel.org>, <linux-gpio@vger.kernel.org>,
	<linus.walleij@linaro.org>, <bgolaszewski@baylibre.com>,
	<warthog618@gmail.com>, <devicetree@vger.kernel.org>,
	<linux-doc@vger.kernel.org>, <robh+dt@kernel.org>
Subject: Re: [RFC v2 03/11] hte: Add tegra194 HTE kernel provider
Date: Tue, 2 Nov 2021 18:15:56 -0700	[thread overview]
Message-ID: <be583bc9-0e0f-ed94-6a29-336baaac9d39@nvidia.com> (raw)
In-Reply-To: <c86597f6-495f-5fa1-d7ff-9bd05c8d2788@infradead.org>

Hi Randy,

Thanks for the comments. I will implement changes in RFC V3.

Best Regards,

Dipen Patel

On 10/1/21 5:07 PM, Randy Dunlap wrote:
> On 9/30/21 4:26 PM, Dipen Patel wrote:
>> diff --git a/Documentation/hte/tegra194-hte.rst b/Documentation/hte/tegra194-hte.rst
>> new file mode 100644
>> index 000000000000..fb229bda2408
>> --- /dev/null
>> +++ b/Documentation/hte/tegra194-hte.rst
>> @@ -0,0 +1,56 @@
>> +HTE Kernel provider driver
>> +==========================
>> +
>> +Description
>> +-----------
>> +The Nvidia tegra194 HTE provider driver implements two GTE
>> +(Generic Timestamping Engine) instances 1) GPIO GTE and 2) LIC IRQ GTE. The
>
>                                  instances:                                ^^Drop "The"
>
>> +both GTEs instances get the timestamp from the system counter TSC which has
>
>    Both
>
>> +31.25MHz clock rate, and the driver converts clock tick rate to nano seconds
>
>                                                                    nanoseconds
>
>> +before storing it as timestamp value.
>> +
>> +GPIO GTE
>> +--------
>> +
>> +This GTE instance timestamps GPIO in real time, for that to happen GPIO
>
>                                              time. For
>
>> +needs to be configured as input and IRQ needs to ba enabled. The only always on
>
>                                                     be
>
>> +(AON) gpio controller instance supports timestamping GPIOs in realtime and it
>
>          GPIO                                                    real time {or change
>                            the instance 3 lines above to be "realtime"}
>
>> +has 39 GPIO lines. The GPIO GTE and AON GPIO controller are tightly coupled as
>> +it requires very specific bits to be set in GPIO config register before GPIO> +GTE can be used. The GPIO GTE functionality is accessed from the GPIOLIB
>> +framework for the in kernel and userspace consumers. In the later case,
>
>                      in-kernel                                 latter
>
>> +requests go through GPIOLIB CDEV framework. The below APIs are added in GPIOLIB
>> +framework to access HTE subsystem and GPIO GTE.
>> +
>> +.. kernel-doc:: drivers/gpio/gpiolib.c
>> +   :functions: gpiod_req_hw_timestamp_ns gpiod_rel_hw_timestamp_ns
>> +
>> +There is hte-tegra194-gpio-test.c, located in ``drivers/hte/`` directory, test
>> +driver which demonstrates above APIs for the Jetson AGX platform.
>> +
>> +For userspace consumers, GPIO_V2_LINE_FLAG_EVENT_CLOCK_HARDWARE flag must be
>> +specifed during IOCTL calls, refer ``tools/gpio/gpio-event-mon.c``, which
>
>    specified             calls. Refer to
>
>> +returns the timestamp in nano second.
>
>                             nanoseconds.
>
>> +
>> +LIC IRQ GTE
>> +-----------
>> +
>> +This GTE instance timestamp LIC IRQ lines in real time. There are 352 IRQ
>
>                      timestamps                 ^^^^^^^^^ {be consistent}
>   (also (repeating a prior email) define "LIC")
>
>> +lines which this instance can help timestamp realtime. The hte devicetree
>
>                              can add timestamps to in realtime.
>
>> +binding described at ``Documentation/devicetree/bindings/hte/`` gives out
>
>                                                                    provides an
>
>> +example how consumer can request IRQ line, since it is one to one mapping,
>
>    example of how a consumer can request an IRQ line. Since it is a one-to-one mapping,
>
>> +consumers can simply specify IRQ number that they are interested in. There is
>
>                         specify the IRQ number
>
>> +no userspace consumer support for this GTE instance. The sample test code
>> +hte-tegra194-irq-test.c, located in ``drivers/hte/`` directory,
>
>                                     in the
>
>> +demonstrates how to use IRQ GTE instance. The below is sample device tree
>
>                 how to use an IRQ GTE instance.
>
>> +snippet code for the test driver::
>> +
>> + tegra_hte_irq_test {
>> +        compatible = "nvidia,tegra194-hte-irq-test";
>> +        htes = <&tegra_hte_lic 0x19>;
>> +        hte-names = "hte-lic";
>> + };
>> +
>> +The provider source code of both IRQ and GPIO GTE instances is locate at
>
>                                                                   located
>
>> +``drivers/hte/hte-tegra194.c``.
>> +
>
>

  reply	other threads:[~2021-11-03  1:15 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-30 23:26 [RFC v2 00/11] Intro to Hardware timestamping engine Dipen Patel
2021-09-30 23:26 ` [RFC v2 01/11] Documentation: Add HTE subsystem guide Dipen Patel
2021-10-02  0:18   ` Randy Dunlap
2021-11-03  0:36     ` Dipen Patel
2021-09-30 23:26 ` [RFC v2 02/11] drivers: Add hardware timestamp engine (HTE) Dipen Patel
2021-10-01 23:53   ` Randy Dunlap
2021-11-03  0:37     ` Dipen Patel
2021-09-30 23:26 ` [RFC v2 03/11] hte: Add tegra194 HTE kernel provider Dipen Patel
2021-10-01 23:44   ` Randy Dunlap
2021-10-02  0:07   ` Randy Dunlap
2021-11-03  1:15     ` Dipen Patel [this message]
2021-09-30 23:26 ` [RFC v2 04/11] dt-bindings: Add HTE bindings Dipen Patel
2021-10-03 21:53   ` Linus Walleij
2021-10-08 22:11   ` Rob Herring
2021-11-03 21:43     ` Dipen Patel
2021-09-30 23:26 ` [RFC v2 05/11] hte: Add Tegra194 IRQ HTE test driver Dipen Patel
2021-09-30 23:26 ` [RFC v2 06/11] gpiolib: Add HTE support Dipen Patel
2021-10-01  9:19   ` kernel test robot
2021-10-03 22:01   ` Linus Walleij
2021-09-30 23:26 ` [RFC v2 07/11] gpio: tegra186: Add HTE in gpio-tegra186 driver Dipen Patel
2021-10-08 22:16   ` Rob Herring
2021-11-03  5:05     ` Dipen Patel
2021-09-30 23:26 ` [RFC v2 08/11] gpiolib: cdev: Add hardware timestamp clock type Dipen Patel
2021-10-03 21:59   ` Linus Walleij
2021-10-03 22:09   ` Linus Walleij
2021-09-30 23:26 ` [RFC v2 09/11] tools: gpio: Add new hardware " Dipen Patel
2021-10-03 22:02   ` Linus Walleij
2021-09-30 23:26 ` [RFC v2 10/11] hte: Add tegra GPIO HTE test driver Dipen Patel
2021-10-01 23:47   ` Randy Dunlap
2021-11-03  5:07     ` Dipen Patel
2021-09-30 23:26 ` [RFC v2 11/11] MAINTAINERS: Added HTE Subsystem Dipen Patel
2021-10-02  0:08   ` Randy Dunlap
2021-10-02  4:00     ` Joe Perches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=be583bc9-0e0f-ed94-6a29-336baaac9d39@nvidia.com \
    --to=dipenp@nvidia.com \
    --cc=bgolaszewski@baylibre.com \
    --cc=devicetree@vger.kernel.org \
    --cc=jonathanh@nvidia.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=rdunlap@infradead.org \
    --cc=robh+dt@kernel.org \
    --cc=thierry.reding@gmail.com \
    --cc=warthog618@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.