Skip to content

Commit e1d76de

Browse files
authored
Update TGU driver to the latest upstream version (#563)
Update TGU driver to the latest upstream version
2 parents e281393 + 18a8c76 commit e1d76de

13 files changed

Lines changed: 867 additions & 926 deletions

File tree

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
What: /sys/bus/amba/devices/<tgu-name>/enable_tgu
2+
Date: April 2026
3+
KernelVersion: 7.1
4+
Contact: Jinlong Mao <jinlong.mao@oss.qualcomm.com>, Songwei Chai <songwei.chai@oss.qualcomm.com>
5+
Description:
6+
(RW) Set/Get the enable/disable status of TGU
7+
Accepts only one of the 2 values - 0 or 1.
8+
0 : disable TGU.
9+
1 : enable TGU.
10+
11+
What: /sys/bus/amba/devices/<tgu-name>/step[0:7]_priority[0:3]/reg[0:17]
12+
Date: April 2026
13+
KernelVersion: 7.1
14+
Contact: Jinlong Mao <jinlong.mao@oss.qualcomm.com>, Songwei Chai <songwei.chai@oss.qualcomm.com>
15+
Description:
16+
(RW) Set/Get the sensed signal with specific step and priority for TGU.
17+
18+
What: /sys/bus/amba/devices/<tgu-name>/step[0:7]_condition_decode/reg[0:3]
19+
Date: April 2026
20+
KernelVersion: 7.1
21+
Contact: Jinlong Mao <jinlong.mao@oss.qualcomm.com>, Songwei Chai <songwei.chai@oss.qualcomm.com>
22+
Description:
23+
(RW) Set/Get the decode mode with specific step for TGU.
24+
25+
What: /sys/bus/amba/devices/<tgu-name>/step[0:7]_condition_select/reg[0:3]
26+
Date: April 2026
27+
KernelVersion: 7.1
28+
Contact: Jinlong Mao <jinlong.mao@oss.qualcomm.com>, Songwei Chai <songwei.chai@oss.qualcomm.com>
29+
Description:
30+
(RW) Set/Get the next action with specific step for TGU.
31+
32+
What: /sys/bus/amba/devices/<tgu-name>/step[0:7]_timer/reg[0:1]
33+
Date: April 2026
34+
KernelVersion: 7.1
35+
Contact: Jinlong Mao <jinlong.mao@oss.qualcomm.com>, Songwei Chai <songwei.chai@oss.qualcomm.com>
36+
Description:
37+
(RW) Set/Get the timer value with specific step for TGU.
38+
39+
What: /sys/bus/amba/devices/<tgu-name>/step[0:7]_counter/reg[0:1]
40+
Date: April 2026
41+
KernelVersion: 7.1
42+
Contact: Jinlong Mao <jinlong.mao@oss.qualcomm.com>, Songwei Chai <songwei.chai@oss.qualcomm.com>
43+
Description:
44+
(RW) Set/Get the counter value with specific step for TGU.
45+
46+
What: /sys/bus/amba/devices/<tgu-name>/reset_tgu
47+
Date: April 2026
48+
KernelVersion: 7.1
49+
Contact: Jinlong Mao <jinlong.mao@oss.qualcomm.com>, Songwei Chai <songwei.chai@oss.qualcomm.com>
50+
Description:
51+
(Write) Write 1 to reset the dataset for TGU.

Documentation/ABI/testing/sysfs-bus-coresight-devices-tgu

Lines changed: 0 additions & 51 deletions
This file was deleted.

Documentation/devicetree/bindings/arm/qcom,coresight-tgu.yaml renamed to Documentation/devicetree/bindings/arm/qcom,tgu.yaml

Lines changed: 7 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Copyright (c) 2025 Qualcomm Innovation Center, Inc. All rights reserved.
33
%YAML 1.2
44
---
5-
$id: http://devicetree.org/schemas/arm/qcom,coresight-tgu.yaml#
5+
$id: http://devicetree.org/schemas/arm/qcom,tgu.yaml#
66
$schema: http://devicetree.org/meta-schemas/core.yaml#
77

88
title: Trigger Generation Unit - TGU
@@ -18,27 +18,27 @@ description: |
1818
preprogrammed state/sequence and then produce a trigger or interrupt.
1919
2020
The primary use case of the TGU is to detect patterns or sequences on a
21-
given set of signals within some region to indentify the issue in time
21+
given set of signals within some region to identify the issue in time
2222
once there is abnormal behavior in the subsystem.
2323
2424
maintainers:
25-
- Mao Jinlong <quic_jinlmao@quicinc.com>
26-
- Sam Chai <quic_songchai@quicinc.com>
25+
- Mao Jinlong <jinlong.mao@oss.qualcomm.com>
26+
- Songwei Chai <songwei.chai@oss.qualcomm.com>
2727

2828
# Need a custom select here or 'arm,primecell' will match on lots of nodes
2929
select:
3030
properties:
3131
compatible:
3232
contains:
3333
enum:
34-
- qcom,coresight-tgu
34+
- qcom,tgu
3535
required:
3636
- compatible
3737

3838
properties:
3939
compatible:
4040
items:
41-
- const: qcom,coresight-tgu
41+
- const: qcom,tgu
4242
- const: arm,primecell
4343

4444
reg:
@@ -51,19 +51,6 @@ properties:
5151
items:
5252
- const: apb_pclk
5353

54-
in-ports:
55-
$ref: /schemas/graph.yaml#/properties/ports
56-
additionalProperties: false
57-
58-
properties:
59-
port:
60-
description:
61-
The port mechanism here ensures the relationship between TGU and
62-
TPDM, as TPDM is one of the inputs for TGU. It will allow TGU to
63-
function as TPDM's helper and enable TGU when the connected
64-
TPDM is enabled.
65-
$ref: /schemas/graph.yaml#/properties/port
66-
6754
required:
6855
- compatible
6956
- reg
@@ -75,18 +62,10 @@ additionalProperties: false
7562
examples:
7663
- |
7764
tgu@10b0e000 {
78-
compatible = "qcom,coresight-tgu", "arm,primecell";
65+
compatible = "qcom,tgu", "arm,primecell";
7966
reg = <0x10b0e000 0x1000>;
8067
8168
clocks = <&aoss_qmp>;
8269
clock-names = "apb_pclk";
83-
84-
in-ports {
85-
port {
86-
tgu_in_tpdm_swao: endpoint{
87-
remote-endpoint = <&tpdm_swao_out_tgu>;
88-
};
89-
};
90-
};
9170
};
9271
...

arch/arm64/configs/qcom.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ CONFIG_CORESIGHT_CORESIGHT_TNOC=m
1717
CONFIG_CORESIGHT_CTCU=m
1818
CONFIG_CORESIGHT_DUMMY=m
1919
CONFIG_CORESIGHT_SOURCE_ETM4X=m
20-
CONFIG_CORESIGHT_TGU=m
20+
CONFIG_QCOM_TGU=m
2121
CONFIG_CORESIGHT_TPDM=m
2222
CONFIG_CPU_IDLE_THERMAL=y
2323
# CONFIG_DEBUG_INFO_REDUCED is not set

drivers/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ obj-$(CONFIG_RAS) += ras/
176176
obj-$(CONFIG_USB4) += thunderbolt/
177177
obj-$(CONFIG_CORESIGHT) += hwtracing/coresight/
178178
obj-y += hwtracing/intel_th/
179+
obj-y += hwtracing/qcom/
179180
obj-$(CONFIG_STM) += hwtracing/stm/
180181
obj-$(CONFIG_HISI_PTT) += hwtracing/ptt/
181182
obj-y += android/

drivers/hwtracing/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,6 @@ source "drivers/hwtracing/intel_th/Kconfig"
77

88
source "drivers/hwtracing/ptt/Kconfig"
99

10+
source "drivers/hwtracing/qcom/Kconfig"
11+
1012
endmenu

drivers/hwtracing/coresight/Kconfig

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,6 @@ menuconfig CORESIGHT
2020
module will be called coresight.
2121

2222
if CORESIGHT
23-
config CORESIGHT_TGU
24-
tristate "CoreSight Trigger Generation Unit driver"
25-
help
26-
This driver provides support for Trigger Generation Unit that is
27-
used to detect patterns or sequences on a given set of signals.
28-
TGU is used to monitor a particular bus within a given region to
29-
detect illegal transaction sequences or slave responses. It is also
30-
used to monitor a data stream to detect protocol violations and to
31-
provide a trigger point for centering data around a specific event
32-
within the trace data buffer.
33-
3423
config CORESIGHT_LINKS_AND_SINKS
3524
tristate "CoreSight Link and Sink drivers"
3625
help

drivers/hwtracing/coresight/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ coresight-cti-y := coresight-cti-core.o coresight-cti-platform.o \
5454
coresight-cti-sysfs.o
5555
obj-$(CONFIG_ULTRASOC_SMB) += ultrasoc-smb.o
5656
obj-$(CONFIG_CORESIGHT_DUMMY) += coresight-dummy.o
57-
obj-$(CONFIG_CORESIGHT_TGU) += coresight-tgu.o
5857
obj-$(CONFIG_CORESIGHT_CTCU) += coresight-ctcu.o
5958
coresight-ctcu-y := coresight-ctcu-core.o coresight-ctcu-byte-cntr.o
6059
obj-$(CONFIG_CORESIGHT_KUNIT_TESTS) += coresight-kunit-tests.o

0 commit comments

Comments
 (0)