Skip to content

Commit 29ee463

Browse files
committed
Merge tag 'for-6.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/pateldipen1984/linux
Pull hardware timestamp engine updates from Dipen Patel: "The changes for the hte subsystem include: - Add Tegra234 HTE provider and relevant DT bindings - Update MAINTAINERS file for the HTE subsystem" * tag 'for-6.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/pateldipen1984/linux: hte: tegra-194: Use proper includes hte: Use device_match_of_node() hte: tegra-194: Fix off by one in tegra_hte_map_to_line_id() hte: tegra: fix 'struct of_device_id' build error hte: Use of_property_present() for testing DT property presence gpio: tegra186: Add Tegra234 hte support hte: handle nvidia,gpio-controller property hte: Deprecate nvidia,slices property hte: Add Tegra234 provider hte: Re-phrase tegra API document arm64: tegra: Add Tegra234 GTE nodes dt-bindings: timestamp: Deprecate nvidia,slices property dt-bindings: timestamp: Add Tegra234 support MAINTAINERS: Add HTE/timestamp subsystem details
2 parents 348551d + ca3d1a4 commit 29ee463

9 files changed

Lines changed: 254 additions & 41 deletions

File tree

Documentation/devicetree/bindings/timestamp/nvidia,tegra194-hte.yaml

Lines changed: 59 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
$id: http://devicetree.org/schemas/timestamp/nvidia,tegra194-hte.yaml#
55
$schema: http://devicetree.org/meta-schemas/core.yaml#
66

7-
title: Tegra194 on chip generic hardware timestamping engine (HTE)
7+
title: Tegra on chip generic hardware timestamping engine (HTE) provider
88

99
maintainers:
1010
- Dipen Patel <dipenp@nvidia.com>
@@ -23,6 +23,8 @@ properties:
2323
enum:
2424
- nvidia,tegra194-gte-aon
2525
- nvidia,tegra194-gte-lic
26+
- nvidia,tegra234-gte-aon
27+
- nvidia,tegra234-gte-lic
2628

2729
reg:
2830
maxItems: 1
@@ -40,12 +42,20 @@ properties:
4042

4143
nvidia,slices:
4244
$ref: /schemas/types.yaml#/definitions/uint32
45+
deprecated: true
4346
description:
4447
HTE lines are arranged in 32 bit slice where each bit represents different
4548
line/signal that it can enable/configure for the timestamp. It is u32
46-
property and depends on the HTE instance in the chip. The value 3 is for
47-
GPIO GTE and 11 for IRQ GTE.
48-
enum: [3, 11]
49+
property and the value depends on the HTE instance in the chip. The AON
50+
GTE instances for both Tegra194 and Tegra234 has 3 slices. The Tegra194
51+
LIC instance has 11 slices and Tegra234 LIC has 17 slices.
52+
enum: [3, 11, 17]
53+
54+
nvidia,gpio-controller:
55+
$ref: /schemas/types.yaml#/definitions/phandle
56+
description:
57+
The phandle to AON gpio controller instance. This is required to handle
58+
namespace conversion between GPIO and GTE.
4959

5060
'#timestamp-cells':
5161
description:
@@ -59,9 +69,53 @@ required:
5969
- compatible
6070
- reg
6171
- interrupts
62-
- nvidia,slices
6372
- "#timestamp-cells"
6473

74+
allOf:
75+
- if:
76+
properties:
77+
compatible:
78+
contains:
79+
enum:
80+
- nvidia,tegra194-gte-aon
81+
- nvidia,tegra234-gte-aon
82+
then:
83+
properties:
84+
nvidia,slices:
85+
const: 3
86+
87+
- if:
88+
properties:
89+
compatible:
90+
contains:
91+
enum:
92+
- nvidia,tegra194-gte-lic
93+
then:
94+
properties:
95+
nvidia,slices:
96+
const: 11
97+
98+
- if:
99+
properties:
100+
compatible:
101+
contains:
102+
enum:
103+
- nvidia,tegra234-gte-lic
104+
then:
105+
properties:
106+
nvidia,slices:
107+
const: 17
108+
109+
- if:
110+
properties:
111+
compatible:
112+
contains:
113+
enum:
114+
- nvidia,tegra234-gte-aon
115+
then:
116+
required:
117+
- nvidia,gpio-controller
118+
65119
additionalProperties: false
66120

67121
examples:
@@ -71,7 +125,6 @@ examples:
71125
reg = <0xc1e0000 0x10000>;
72126
interrupts = <0 13 0x4>;
73127
nvidia,int-threshold = <1>;
74-
nvidia,slices = <3>;
75128
#timestamp-cells = <1>;
76129
};
77130
@@ -81,7 +134,6 @@ examples:
81134
reg = <0x3aa0000 0x10000>;
82135
interrupts = <0 11 0x4>;
83136
nvidia,int-threshold = <1>;
84-
nvidia,slices = <11>;
85137
#timestamp-cells = <1>;
86138
};
87139

Documentation/driver-api/hte/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ HTE Tegra Provider
1818
.. toctree::
1919
:maxdepth: 1
2020

21-
tegra194-hte
21+
tegra-hte
2222

Documentation/driver-api/hte/tegra194-hte.rst renamed to Documentation/driver-api/hte/tegra-hte.rst

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,25 @@ HTE Kernel provider driver
55

66
Description
77
-----------
8-
The 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
11-
timestamp from the system counter TSC which has 31.25MHz clock rate, and the
12-
driver converts clock tick rate to nanoseconds before storing it as timestamp
13-
value.
8+
The Nvidia tegra HTE provider also known as GTE (Generic Timestamping Engine)
9+
driver implements two GTE instances: 1) GPIO GTE and 2) LIC
10+
(Legacy Interrupt Controller) IRQ GTE. Both GTE instances get the timestamp
11+
from the system counter TSC which has 31.25MHz clock rate, and the driver
12+
converts clock tick rate to nanoseconds before storing it as timestamp value.
1413

1514
GPIO GTE
1615
--------
1716

1817
This GTE instance timestamps GPIO in real time. For that to happen GPIO
19-
needs to be configured as input. The always on (AON) GPIO controller instance
20-
supports timestamping GPIOs in real time and it has 39 GPIO lines. The GPIO GTE
21-
and AON GPIO controller are tightly coupled as it requires very specific bits
22-
to be set in GPIO config register before GPIO GTE can be used, for that GPIOLIB
23-
adds two optional APIs as below. The GPIO GTE code supports both kernel
24-
and userspace consumers. The kernel space consumers can directly talk to HTE
25-
subsystem while userspace consumers timestamp requests go through GPIOLIB CDEV
26-
framework to HTE subsystem.
18+
needs to be configured as input. Only the always on (AON) GPIO controller
19+
instance supports timestamping GPIOs in real time as it is tightly coupled with
20+
the GPIO GTE. To support this, GPIOLIB adds two optional APIs as mentioned
21+
below. The GPIO GTE code supports both kernel and userspace consumers. The
22+
kernel space consumers can directly talk to HTE subsystem while userspace
23+
consumers timestamp requests go through GPIOLIB CDEV framework to HTE
24+
subsystem. The hte devicetree binding described at
25+
``Documentation/devicetree/bindings/timestamp`` provides an example of how a
26+
consumer can request an GPIO line.
2727

2828
See gpiod_enable_hw_timestamp_ns() and gpiod_disable_hw_timestamp_ns().
2929

@@ -34,9 +34,8 @@ returns the timestamp in nanoseconds.
3434
LIC (Legacy Interrupt Controller) IRQ GTE
3535
-----------------------------------------
3636

37-
This GTE instance timestamps LIC IRQ lines in real time. There are 352 IRQ
38-
lines which this instance can add timestamps to in real time. The hte
39-
devicetree binding described at ``Documentation/devicetree/bindings/timestamp``
37+
This GTE instance timestamps LIC IRQ lines in real time. The hte devicetree
38+
binding described at ``Documentation/devicetree/bindings/timestamp``
4039
provides an example of how a consumer can request an IRQ line. Since it is a
4140
one-to-one mapping with IRQ GTE provider, consumers can simply specify the IRQ
4241
number that they are interested in. There is no userspace consumer support for

MAINTAINERS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9489,6 +9489,9 @@ F: drivers/input/touchscreen/htcpen.c
94899489

94909490
HTE SUBSYSTEM
94919491
M: Dipen Patel <dipenp@nvidia.com>
9492+
L: timestamp@lists.linux.dev
9493+
T: git git://git.kernel.org/pub/scm/linux/kernel/git/pateldipen1984/linux.git
9494+
Q: https://patchwork.kernel.org/project/timestamp/list/
94929495
S: Maintained
94939496
F: Documentation/devicetree/bindings/timestamp/
94949497
F: Documentation/driver-api/hte/

arch/arm64/boot/dts/nvidia/tegra234.dtsi

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1154,6 +1154,14 @@
11541154
clock-names = "fuse";
11551155
};
11561156

1157+
hte_lic: hardware-timestamp@3aa0000 {
1158+
compatible = "nvidia,tegra234-gte-lic";
1159+
reg = <0x0 0x3aa0000 0x0 0x10000>;
1160+
interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>;
1161+
nvidia,int-threshold = <1>;
1162+
#timestamp-cells = <1>;
1163+
};
1164+
11571165
hsp_top0: hsp@3c00000 {
11581166
compatible = "nvidia,tegra234-hsp", "nvidia,tegra194-hsp";
11591167
reg = <0x0 0x03c00000 0x0 0xa0000>;
@@ -1671,6 +1679,15 @@
16711679
#mbox-cells = <2>;
16721680
};
16731681

1682+
hte_aon: hardware-timestamp@c1e0000 {
1683+
compatible = "nvidia,tegra234-gte-aon";
1684+
reg = <0x0 0xc1e0000 0x0 0x10000>;
1685+
interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>;
1686+
nvidia,int-threshold = <1>;
1687+
nvidia,gpio-controller = <&gpio_aon>;
1688+
#timestamp-cells = <1>;
1689+
};
1690+
16741691
gen2_i2c: i2c@c240000 {
16751692
compatible = "nvidia,tegra194-i2c";
16761693
reg = <0x0 0xc240000 0x0 0x100>;

drivers/gpio/gpio-tegra186.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1134,6 +1134,7 @@ static const struct tegra_gpio_soc tegra234_aon_soc = {
11341134
.name = "tegra234-gpio-aon",
11351135
.instance = 1,
11361136
.num_irqs_per_bank = 8,
1137+
.has_gte = true,
11371138
};
11381139

11391140
#define TEGRA241_MAIN_GPIO_PORT(_name, _bank, _port, _pins) \

drivers/hte/hte-tegra194-test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include <linux/workqueue.h>
1717

1818
/*
19-
* This sample HTE GPIO test driver demonstrates HTE API usage by enabling
19+
* This sample HTE test driver demonstrates HTE API usage by enabling
2020
* hardware timestamp on gpio_in and specified LIC IRQ lines.
2121
*
2222
* Note: gpio_out and gpio_in need to be shorted externally in order for this

0 commit comments

Comments
 (0)