1758d6386SMao Jinlong.. SPDX-License-Identifier: GPL-2.0
2758d6386SMao Jinlong
3*ba0f3ae6SBagas Sanjaya=================================================================
4*ba0f3ae6SBagas SanjayaThe trace performance monitoring and diagnostics aggregator(TPDA)
5*ba0f3ae6SBagas Sanjaya=================================================================
6758d6386SMao Jinlong
7758d6386SMao Jinlong    :Author:   Jinlong Mao <quic_jinlmao@quicinc.com>
8758d6386SMao Jinlong    :Date:     January 2023
9758d6386SMao Jinlong
10758d6386SMao JinlongHardware Description
11758d6386SMao Jinlong--------------------
12758d6386SMao Jinlong
13758d6386SMao JinlongTPDA - The trace performance monitoring and diagnostics aggregator or
14758d6386SMao JinlongTPDA in short serves as an arbitration and packetization engine for the
15758d6386SMao Jinlongperformance monitoring and diagnostics network specification.
16758d6386SMao JinlongThe primary use case of the TPDA is to provide packetization, funneling
17758d6386SMao Jinlongand timestamping of Monitor data.
18758d6386SMao Jinlong
19758d6386SMao Jinlong
20758d6386SMao JinlongSysfs files and directories
21758d6386SMao Jinlong---------------------------
22758d6386SMao JinlongRoot: ``/sys/bus/coresight/devices/tpda<N>``
23758d6386SMao Jinlong
24758d6386SMao JinlongConfig details
25758d6386SMao Jinlong---------------------------
26758d6386SMao Jinlong
27758d6386SMao JinlongThe tpdm and tpda nodes should be observed at the coresight path
28758d6386SMao Jinlong"/sys/bus/coresight/devices".
29758d6386SMao Jinlonge.g.
30758d6386SMao Jinlong/sys/bus/coresight/devices # ls -l | grep tpd
31758d6386SMao Jinlongtpda0 -> ../../../devices/platform/soc@0/6004000.tpda/tpda0
32758d6386SMao Jinlongtpdm0 -> ../../../devices/platform/soc@0/6c08000.mm.tpdm/tpdm0
33758d6386SMao Jinlong
34758d6386SMao JinlongWe can use the commands are similar to the below to validate TPDMs.
35758d6386SMao JinlongEnable coresight sink first. The port of tpda which is connected to
36758d6386SMao Jinlongthe tpdm will be enabled after commands below.
37758d6386SMao Jinlong
38758d6386SMao Jinlongecho 1 > /sys/bus/coresight/devices/tmc_etf0/enable_sink
39758d6386SMao Jinlongecho 1 > /sys/bus/coresight/devices/tpdm0/enable_source
40758d6386SMao Jinlongecho 1 > /sys/bus/coresight/devices/tpdm0/integration_test
41758d6386SMao Jinlongecho 2 > /sys/bus/coresight/devices/tpdm0/integration_test
42758d6386SMao Jinlong
43758d6386SMao JinlongThe test data will be collected in the coresight sink which is enabled.
44758d6386SMao JinlongIf rwp register of the sink is keeping updating when do
45758d6386SMao Jinlongintegration_test (by cat tmc_etf0/mgmt/rwp), it means there is data
46758d6386SMao Jinlonggenerated from TPDM to sink.
47758d6386SMao Jinlong
48758d6386SMao JinlongThere must be a tpda between tpdm and the sink. When there are some
49758d6386SMao Jinlongother trace event hw components in the same HW block with tpdm, tpdm
50758d6386SMao Jinlongand these hw components will connect to the coresight funnel. When
51758d6386SMao Jinlongthere is only tpdm trace hw in the HW block, tpdm will connect to
52758d6386SMao Jinlongtpda directly.
53