CoreSight ETM4x devices could be accessed either via MMIO (handled via
amba_driver) or CPU system instructions (handled via platform driver). But
this has the following issues :
- Each new CPU comes up with its own PID and thus we need to keep on
adding the "known" PIDs to get it working with AMBA driver. While
the ETM4 architecture (and CoreSight architecture) defines way to
identify a device as ETM4. Thus older kernels won't be able to
"discover" a newer CPU, unless we add the PIDs.
- With ACPI, the ETM4x devices have the same HID to identify the device
irrespective of the mode of access. This creates a problem where two
different drivers (both AMBA based driver and platform driver) would
hook into the "HID" and could conflict. e.g., if AMBA driver gets
hold of a non-MMIO device, the probe fails. If we have single driver
hooked into the given "HID", we could handle them seamlessly,
irrespective of the mode of access.
- CoreSight is heavily dependent on the runtime power management. With
ACPI, amba_driver doesn't get us anywhere with handling the power
and thus one need to always turn the power ON to use them. Moving to
platform driver gives us the power management for free.
Due to all of the above, we are moving the MMIO based etm4x devices to be
supported via platform driver. The series makes the existing platform
driver generic to handle both type of the access modes. Although existing
AMBA driver would still continue to support DT based etm4x MMIO devices.
The series applies on 6.3-rc4.
Changes in V2:
- Enables ACPI etm4x device support in the existing platform driver
- Dropped last two patches from the series
- Dropped redundant 'devarch' checking from is_etm4x_device()
- Renamed updated is_etm4x_device() as is_etm4x_devtype()
- Fixed arguments in fallback stub for etm4_check_arch_features()
- Tagged etm4_dev_pm_ops with etm4_platform_driver
- Updated the comment for coresight_get_enable_apb_pclk() helper
- Updated the comment for new 'pclk' element in struct etm4_drvdata
- Dropped the clock when devm_ioremap_resource() fails
- Convert IS_ERR() into a direct pointer check in etm4_remove_platform_dev()
- Dropped "arm,coresight-etm4x" compatible property from etm4_match[]
Changes in V1:
https://lore.kernel.org/all/20230317030501.1811905-1-anshuman.khandual@arm.…
Cc: Steve Clevenger <scclevenger(a)os.amperecomputing.com>
Cc: Rob Herring <robh+dt(a)kernel.org>
Cc: Frank Rowand <frowand.list(a)gmail.com>
Cc: Russell King (Oracle) <linux(a)armlinux.org.uk>
Cc: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Cc: "Rafael J. Wysocki" <rafael(a)kernel.org>
Cc: Len Brown <lenb(a)kernel.org>
Cc: Sudeep Holla <sudeep.holla(a)arm.com>
Cc: Lorenzo Pieralisi <lpieralisi(a)kernel.org>
Cc: Mathieu Poirier <mathieu.poirier(a)linaro.org>
Cc: Suzuki K Poulose <suzuki.poulose(a)arm.com>
Cc: Mike Leach <mike.leach(a)linaro.org>
Cc: Leo Yan <leo.yan(a)linaro.org>
Cc: devicetree(a)vger.kernel.org
Cc: linux-acpi(a)vger.kernel.org
Cc: coresight(a)lists.linaro.org
Cc: linux-arm-kernel(a)lists.infradead.org
Cc: linux-kernel(a)vger.kernel.org
Anshuman Khandual (4):
coresight: etm4x: Allocate and device assign 'struct etmv4_drvdata' earlier
coresight: etm4x: Drop iomem 'base' argument from etm4_probe()
coresight: etm4x: Drop pid argument from etm4_probe()
coresight: etm4x: Change etm4_platform_driver driver for MMIO devices
Suzuki Poulose (1):
coresight: etm4x: Add ACPI support in platform driver
drivers/acpi/acpi_amba.c | 1 -
.../coresight/coresight-etm4x-core.c | 114 ++++++++++++++----
drivers/hwtracing/coresight/coresight-etm4x.h | 4 +
include/linux/coresight.h | 59 +++++++++
4 files changed, 154 insertions(+), 24 deletions(-)
--
2.25.1
Changes since v2:
* Make out_conns array contiguous instead of sparse which simplifies
filling and using it. New connections are always added to the end
* Store pointers to individual connection objects so that they can be
shared between inputs and outputs
* Fix an existing bug where connection info was lost when unloading a
device
* Simplify connection fixup functions. Now the orphan mechanism is used
for inputs in the same way as outputs to guarantee that all
connections have both an input and an output set
* Use input connections to disconnect devices on unload instead of
iterating through them all
* Make refcount a property of the connection rather than use it's own
array based on the number of inputs and outputs
* Fix a bug in v2 where helpers attached to the source device weren't
disabled because coresight-etm-perf.c was making a raw call to
disable rather than using a helper.
* Change names of connection members to make direction explicit now
that the connection is shared between input and outputs
------------------
Changes since v1:
* Don't dereference handle in tmc_etr_get_buffer() when not in perf mode.
* Fix some W=1 warnings
* Add a commit to rename child/output in terms of local/remote
-------------------
Currently there is a refcount leak in CTI when using system wide mode
or tracing multithreaded applications. See the last commit for a
reproducer. This prevents the module from being unloaded.
Historically there have been a few issues and fixes attempted around
here which have resulted in some extra logic and a member to keep
track of CTI being enabled 'struct coresight_device->ect_enabled'.
The fix in commit 665c157e0204 ("coresight: cti: Fix hang in
cti_disable_hw()") was also related to CTI having its own
enable/disable path which came later than other devices.
If we make CTI a helper device and enable helper devices adjacent to
the path we get very similar enable/disable behavior to now, but with
more reuse of the existing reference counting logic in the coresight
core code. This also affects CATU which can have a little bit of
its hard coded enable/disable code removed.
Enabling CATU on the generic path does require that input connections
are tracked so that it can get its associated ETR buffer.
Applies to coresight/next (197b6b60ae7b) but also requires the
realloc_array patch here [1].
Also available in full here [2].
[1]: https://lore.kernel.org/linux-arm-kernel/20230306152723.3090195-1-james.cla…
[2]: https://gitlab.arm.com/linux-arm/linux-jc/-/tree/james-cs-cti-module-refcou…
James Clark (13):
coresight: Use enum type for cs_mode wherever possible
coresight: Change name of pdata->conns
coresight: Rename nr_outports to nr_outconns
coresight: Rename connection members to make the direction explicit
coresight: Dynamically add connections
coresight: Fix loss of connection info when a module is unloaded
coresight: Store pointers to connections rather than an array of them
coresight: Simplify connection fixup mechanism
coresight: Store in-connections as well as out-connections
coresight: Make refcount a property of the connection
coresight: Refactor out buffer allocation function for ETR
coresight: Enable and disable helper devices adjacent to the path
coresight: Fix CTI module refcount leak by making it a helper device
drivers/hwtracing/coresight/coresight-catu.c | 21 +-
drivers/hwtracing/coresight/coresight-core.c | 557 +++++++++---------
.../hwtracing/coresight/coresight-cti-core.c | 52 +-
.../hwtracing/coresight/coresight-cti-sysfs.c | 4 +-
drivers/hwtracing/coresight/coresight-cti.h | 4 +-
drivers/hwtracing/coresight/coresight-etb10.c | 13 +-
.../hwtracing/coresight/coresight-etm-perf.c | 4 +-
.../coresight/coresight-etm3x-core.c | 6 +-
.../coresight/coresight-etm4x-core.c | 6 +-
.../hwtracing/coresight/coresight-funnel.c | 26 +-
.../hwtracing/coresight/coresight-platform.c | 250 +++-----
drivers/hwtracing/coresight/coresight-priv.h | 17 +-
.../coresight/coresight-replicator.c | 23 +-
drivers/hwtracing/coresight/coresight-stm.c | 6 +-
drivers/hwtracing/coresight/coresight-sysfs.c | 17 +-
.../hwtracing/coresight/coresight-tmc-etf.c | 26 +-
.../hwtracing/coresight/coresight-tmc-etr.c | 110 ++--
drivers/hwtracing/coresight/coresight-tmc.h | 2 +
drivers/hwtracing/coresight/coresight-tpda.c | 23 +-
drivers/hwtracing/coresight/coresight-tpdm.c | 4 +-
drivers/hwtracing/coresight/coresight-tpiu.c | 7 +-
drivers/hwtracing/coresight/coresight-trbe.c | 3 +-
drivers/hwtracing/coresight/ultrasoc-smb.c | 11 +-
drivers/hwtracing/coresight/ultrasoc-smb.h | 2 +-
include/linux/coresight.h | 124 ++--
25 files changed, 669 insertions(+), 649 deletions(-)
--
2.34.1
Introduction of TPDM DSB subunit
DSB subunit is responsible for creating a dataset element, and is also
optionally responsible for packing it to fit multiple elements on a
single ATB transfer if possible in the configuration. The TPDM Core
Datapath requests timestamps be stored by the TPDA and then delivering
ATB sized data (depending on ATB width and element size, this could
be smaller or larger than a dataset element) to the ATB Mast FSM.
The DSB subunit must be configured prior to enablement. This series
adds support for TPDM to configure the configure DSB subunit.
Once this series patches are applied properly, the new tpdm nodes for
should be observed at the tpdm path /sys/bus/coresight/devices/tpdm*
which supports DSB subunit.
e.g.
/sys/devices/platform/soc(a)0/69d0000.tpdm/tpdm0#ls -l | grep dsb
-rw-r--r-- 1 root root 4096 Jan 1 00:01 dsb_edge_ctrl
-rw-r--r-- 1 root root 4096 Jan 1 00:01 dsb_edge_ctrl_mask
-rw-r--r-- 1 root root 4096 Jan 1 00:01 dsb_mode
-rw-r--r-- 1 root root 4096 Jan 1 00:01 dsb_patt_mask
-rw-r--r-- 1 root root 4096 Jan 1 00:01 dsb_patt_ts
-rw-r--r-- 1 root root 4096 Jan 1 00:01 dsb_patt_type
-rw-r--r-- 1 root root 4096 Jan 1 00:01 dsb_patt_val
-rw-r--r-- 1 root root 4096 Jan 1 00:01 dsb_trig_patt_mask
-rw-r--r-- 1 root root 4096 Jan 1 00:01 dsb_trig_patt_val
-rw-r--r-- 1 root root 4096 Jan 1 00:01 dsb_trig_ts
-rw-r--r-- 1 root root 4096 Jan 1 00:01 dsb_trig_type
We can use the commands are similar to the below to configure the
TPDMs which support DSB subunit. Enable coresight sink first.
echo 1 > /sys/bus/coresight/devices/tmc_etf0/enable_sink
echo 1 > /sys/bus/coresight/devices/tpdm0/reset
echo 0x3 0x3 0x1 > /sys/bus/coresight/devices/tpdm0/dsb_edge_ctrl_mask
echo 0x6d 0x6d 0 > /sys/bus/coresight/devices/tpdm0/dsb_edge_ctrl
echo 1 > /sys/bus/coresight/devices/tpdm0/dsb_patt_ts
echo 1 > /sys/bus/coresight/devices/tpdm0/dsb_patt_type
echo 0 > /sys/bus/coresight/devices/tpdm0/dsb_trig_ts
echo 0 0xFFFFFFFF > /sys/bus/coresight/devices/tpdm0/dsb_patt_mask
echo 0 0xFFFFFFFF > /sys/bus/coresight/devices/tpdm0/dsb_trig_patt_val
This patch series depends on patch series "[PATCH v2 0/9] coresight:
Fix CTI module refcount leak by making it a helper device"
https://patchwork.kernel.org/project/linux-arm-kernel/cover/20230310160610.…
TPDM_DSB commit tree:
https://git.codelinaro.org/clo/linux-kernel/coresight/-/tree/tpdm-dsb-v3https://git.codelinaro.org/clo/linux-kernel/coresight/-/commits/tpdm-dsb-v3
Changes in V3:
1. Move the property "qcom,dsb-element-size" to TPDM
devicetree and update the TPDM yaml file for this item.
-- Suzuki K Poulose
2. Add the error message when the DSB element size is not set to
32-bit or 64-bit. -- Suzuki K Poulose
3. Add more information to the comments of patch #3
-- Suzuki K Poulose
4. Combine the value updates to the TPDM_DSB_CR for TPDM.
-- Suzuki K Poulose
5. Remove the function "tpdm_datasets_alloc", and fold its code
to a new function "tpdm_init_datasets". It will complete the
initialization of TPDM. -- Suzuki K Poulose
6. Change the method of qualifying input values.
-- Suzuki K Poulose
7. Add the documentation of the new sysfs handles.
-- Suzuki K Poulose
8. Provide the separate handles for the "mode bits".
-- Suzuki K Poulose
Changes in V2:
1. Change the name of the property "qcom,dsb-elem-size" to
"qcom,dsb-element-size" -- Suzuki K Poulose
2. Update the TPDA yaml file for the item "qcom,dsb-elem-size".
-- Krzysztof Kozlowski
3. Add the full name of DSB in the description of the item
"qcom,dsb-elem-size". -- Rob Herring
Changes in V1:
1. Change the definition of the property "qcom,dsb-elem-size" from
"uint32-array" to "uint32-matrix". -- Krzysztof Kozlowski
2. Add the full name of DSB. -- Rob Herring
3. Deal with 2 entries in an iteration in TPDA driver. -- Suzuki K Poulose
4. Divide the function "tpdm_datasets_alloc" into two functions,
"tpdm_datasets_setup" and "tpdm_datasets_alloc".
5. Detecte the input string with the conventional semantics automatically,
and constrain the size of the input value. -- Suzuki K Poulose
6. Use the hook function "is_visible()" to hide the DSB related knobs if
the data sets are missing. -- Suzuki K Poulose
7. Use the macros "FIELD_GET" and "FIELD_PREP" to set the values.
-- Suzuki K Poulose
8. Update the definition of the macros in TPDM driver.
9. Update the comments of the values for the nodes which are for DSB
element creation and onfigure pattern match output. -- Suzuki K Poulose
10. Use API "sysfs_emit" to "replace scnprintf". -- Suzuki K Poulose
Tao Zhang (10):
dt-bindings: arm: Add support for DSB element size
coresight-tpda: Add DSB dataset support
coresight-tpdm: Initialize DSB subunit configuration
coresight-tpdm: Add reset node to TPDM node
coresight-tpdm: Add nodes to set trigger timestamp and type
coresight-tpdm: Add node to set dsb programming mode
coresight-tpdm: Add nodes for dsb edge control
coresight-tpdm: Add nodes to configure pattern match output
coresight-tpdm: Add nodes for timestamp request
dt-bindings: arm: Add support for DSB MSR register
coresight-tpdm: Add nodes for dsb msr support
.../ABI/testing/sysfs-bus-coresight-devices-tpdm | 144 +++++
.../bindings/arm/qcom,coresight-tpdm.yaml | 21 +
drivers/hwtracing/coresight/coresight-tpda.c | 58 ++
drivers/hwtracing/coresight/coresight-tpda.h | 4 +
drivers/hwtracing/coresight/coresight-tpdm.c | 694 ++++++++++++++++++++-
drivers/hwtracing/coresight/coresight-tpdm.h | 69 ++
6 files changed, 984 insertions(+), 6 deletions(-)
--
2.7.4
The original method for allocating trace source ID values to sources was
to use a fixed algorithm for CPU based sources of (cpu_num * 2 + 0x10).
The STM was allocated ID 0x1.
This mechanism is broken for systems with more than 47 cores.
The kernel related patches the provide a fixed Trace ID allocation mechanism
are now upstreamed.
This patchset updates the perf code to handle the changes to the trace ID
notification mechanism that now uses the PERF_RECORD_AUX_OUTPUT_HW_ID
packet to set Trace ID in the perf ETM decoders.
Applies and test oo perf/core
Changes since v8:
1. Fix build issues
2. Fix implicit function problem
Changes since v7:
Split from original patchset [1] to be sent separately as kernel related
patches are now upstream.
[1] https://lore.kernel.org/linux-arm-kernel/20230116124928.5440-1-mike.leach@l…
Mike Leach (3):
perf: cs-etm: Move mapping of Trace ID and cpu into helper function
perf: cs-etm: Update record event to use new Trace ID protocol
perf: cs-etm: Handle PERF_RECORD_AUX_OUTPUT_HW_ID packet
tools/include/linux/coresight-pmu.h | 47 ++-
tools/perf/arch/arm/util/cs-etm.c | 27 +-
tools/perf/util/cs-etm-base.c | 3 +-
.../perf/util/cs-etm-decoder/cs-etm-decoder.c | 7 +
tools/perf/util/cs-etm.c | 326 +++++++++++++++---
tools/perf/util/cs-etm.h | 14 +-
6 files changed, 356 insertions(+), 68 deletions(-)
--
2.17.1
The original method for allocating trace source ID values to sources was
to use a fixed algorithm for CPU based sources of (cpu_num * 2 + 0x10).
The STM was allocated ID 0x1.
This mechanism is broken for systems with more than 47 cores.
The kernel related patches the provide a fixed Trace ID allocation mechanism
are now upstreamed.
This patchset updates the perf code to handle the changes to the trace ID
notification mechanism that now uses the PERF_RECORD_AUX_OUTPUT_HW_ID
packet to set Trace ID in the perf ETM decoders.
Applies to perf/core
Changes since v7:
Split from original patchset [1] to be sent separately as kernel related
patches are now upstream.
[1] https://lore.kernel.org/linux-arm-kernel/20230116124928.5440-1-mike.leach@l…
Mike Leach (3):
perf: cs-etm: Move mapping of Trace ID and cpu into helper function
perf: cs-etm: Update record event to use new Trace ID protocol
perf: cs-etm: Handle PERF_RECORD_AUX_OUTPUT_HW_ID packet
tools/include/linux/coresight-pmu.h | 47 ++-
tools/perf/arch/arm/util/cs-etm.c | 21 +-
.../perf/util/cs-etm-decoder/cs-etm-decoder.c | 7 +
tools/perf/util/cs-etm.c | 326 +++++++++++++++---
tools/perf/util/cs-etm.h | 14 +-
5 files changed, 350 insertions(+), 65 deletions(-)
--
2.32.0
On Mon, Mar 13, 2023 at 11:15:44AM -0700, Yang Shi wrote:
[...]
> > Just a quick summary, here we have two issues:
> >
> > - With command:
> > perf record -e cs_etm/@tmc_etf63/k --kcore --per-thread \
> > -- taskset --cpu-list 1 uname",
> >
> > perf doesn't enable "text poke" attribution.
>
> No, it enables "text poke" and perf fails to decode coresight trace
> data too. It doesn't matter whether "--kcore" is after or before "-e
> cs/etm/@tmc_etf63/k".
Understand now. Thanks for correction, if so we can ignore this one.
Leo
On 30/03/2023 00:25, Yang Shi wrote:
> On Wed, Mar 29, 2023 at 9:08 AM James Clark <james.clark(a)arm.com> wrote:
>>
>>
>>
>> On 14/03/2023 00:36, Leo Yan wrote:
>>> On Mon, Mar 13, 2023 at 11:15:44AM -0700, Yang Shi wrote:
>>>
>>> [...]
>>>
>>>>> Just a quick summary, here we have two issues:
>>>>>
>>>>> - With command:
>>>>> perf record -e cs_etm/@tmc_etf63/k --kcore --per-thread \
>>>>> -- taskset --cpu-list 1 uname",
>>>>>
>>>>> perf doesn't enable "text poke" attribution.
>>>>
>>>> No, it enables "text poke" and perf fails to decode coresight trace
>>>> data too. It doesn't matter whether "--kcore" is after or before "-e
>>>> cs/etm/@tmc_etf63/k".
>>>
>>> Understand now. Thanks for correction, if so we can ignore this one.
>>>
>>> Leo
>>
>> To me it looks like it's only --per-thread and --kcore together that
>> cause the issue. I can't see if that was mentioned previously in this
>> thread.
>
> If "--pre-thread" is not passed in, perf record failed with "failed to
> mmap with 12 (Cannot allocate memory)". Sorry for not mentioning this
> in the first place. I was quite focused on --kcore and didn't realize
> they may be related.
That's unrelated. That's because you have specified a sink and without
--per-thread it tries to open the event on all cores. If the sink can't
be reached from all cores it will fail to open. You can make it work
without --per-thread if you limit it to a valid core like this, although
I don't know which ones exactly would be valid for your system:
perf record -e cs_etm/@tmc_etf63/k --kcore -C 0 \
-- taskset --cpu-list 1 uname
>
>>
>> If it is --per-thread that's causing the issue then I think I have an
>> idea why it might be. There are some assumptions and different paths
>> taken in decoding in that mode that aren't correct. It causes some other
>> issues to do with ordering and timestamps as well and I wanted to fix it
>> previously. I wouldn't say that the text-poke change has caused a
>> regression, as decoding in this mode was always a bit buggy.
>>
>> Maybe this is another reason to fix it properly.
Changes since v1:
* Don't dereference handle in tmc_etr_get_buffer() when not in perf mode.
* Fix some W=1 warnings
* Add a commit to rename child/output in terms of local/remote
-------------------
Currently there is a refcount leak in CTI when using system wide mode
or tracing multithreaded applications. See the last commit for a
reproducer. This prevents the module from being unloaded.
Historically there have been a few issues and fixes attempted around
here which have resulted in some extra logic and a member to keep
track of CTI being enabled 'struct coresight_device->ect_enabled'.
The fix in commit 665c157e0204 ("coresight: cti: Fix hang in
cti_disable_hw()") was also related to CTI having its own
enable/disable path which came later than other devices.
If we make CTI a helper device and enable helper devices adjacent to
the path we get very similar enable/disable behavior to now, but with
more reuse of the existing reference counting logic in the coresight
core code. This also affects CATU which can have a little bit of
its hard coded enable/disable code removed.
Enabling CATU on the generic path does require that input connections
are tracked so that it can get its associated ETR buffer.
Applies to coresight/next (669c4614236a7) but also requires the
realloc_array patch here [1].
Also available in full here [2].
[1]: https://lore.kernel.org/linux-arm-kernel/20230306152723.3090195-1-james.cla…
[2]: https://gitlab.arm.com/linux-arm/linux-jc/-/tree/james-cs-cti-module-refcou…
James Clark (9):
coresight: Use enum type for cs_mode wherever possible
coresight: Change name of pdata->conns
coresight: Rename nr_outports to nr_outconns
coresight: Rename connection members to allow for input connections
coresight: Dynamically add connections
coresight: Store in-connections as well as out-connections
coresight: Refactor out buffer allocation function for ETR
coresight: Enable and disable helper devices adjacent to the path
coresight: Fix CTI module refcount leak by making it a helper device
drivers/hwtracing/coresight/coresight-catu.c | 34 +-
drivers/hwtracing/coresight/coresight-core.c | 312 +++++++++++-------
.../hwtracing/coresight/coresight-cti-core.c | 56 ++--
.../hwtracing/coresight/coresight-cti-sysfs.c | 4 +-
drivers/hwtracing/coresight/coresight-cti.h | 4 +-
drivers/hwtracing/coresight/coresight-etb10.c | 3 +-
.../coresight/coresight-etm3x-core.c | 6 +-
.../coresight/coresight-etm4x-core.c | 6 +-
.../hwtracing/coresight/coresight-platform.c | 178 +++++++---
drivers/hwtracing/coresight/coresight-priv.h | 9 +-
drivers/hwtracing/coresight/coresight-stm.c | 6 +-
drivers/hwtracing/coresight/coresight-sysfs.c | 9 +-
.../hwtracing/coresight/coresight-tmc-etf.c | 2 +-
.../hwtracing/coresight/coresight-tmc-etr.c | 89 ++---
drivers/hwtracing/coresight/coresight-tmc.h | 2 +
drivers/hwtracing/coresight/coresight-tpdm.c | 4 +-
drivers/hwtracing/coresight/coresight-tpiu.c | 3 +-
drivers/hwtracing/coresight/coresight-trbe.c | 3 +-
drivers/hwtracing/coresight/ultrasoc-smb.c | 3 +-
drivers/hwtracing/coresight/ultrasoc-smb.h | 2 +-
include/linux/coresight.h | 109 +++---
21 files changed, 530 insertions(+), 314 deletions(-)
--
2.34.1
Continuous multi-bit (CMB) is responsible for collection of CMB data sets.
It monitors a bus of related signals (eg, a counter value) and an associated valid signal.
This patch series adds support to config of CMB registers.
Element Creation:
CMB_CR.mode : Continuous mode or Trace on Change mode(cmb_mode)
Pattern Match Output (usually to CTI):
CMB_XPR : Trigger pattern register value(cmb_trig_patt_val)
CMB_XPMR : Trigger pattern mask register value(cmb_trig_patt_mask)
Timestamp Request Based on Input Pattern Match:
CMB_TPR : Timestamp pattern register value(cmb_patt_val)
CMB_TPMR : Timestamp pattern mask register value(cmb_patt_mask)
CMB_TIER.patt_tsenab : Timestamps are requested upon CMB interface pattern match via
setting this bit to 1(cmb_patt_ts)
Timestamp Request Based on Input (usually from CTI):
CMB_TIER.xtrig_tsenab : Timestamps are requested upon CMB cross trigger interface
timestamp request via setting this bit to 1(cmb_trig_ts)
Mux Select Registers:
CMB_MSR : Configure Mux select registers(cmb_msr)
Once this series patches are applied properly, the new tpdm nodes should be observed at the tpdm path.
e.g.
/sys/devices/platform/soc(a)0/10c29000.tpdm/tpdm1 # ls -l | grep cmb
-rw-r--r-- 1 root 0 4096 Jan 1 00:00 cmb_mode
-rw-r--r-- 1 root 0 4096 Jan 1 00:00 cmb_msr
-rw-r--r-- 1 root 0 4096 Jan 1 00:00 cmb_patt_mask
-rw-r--r-- 1 root 0 4096 Jan 1 00:00 cmb_patt_ts
-rw-r--r-- 1 root 0 4096 Jan 1 00:22 cmb_patt_val
-rw-r--r-- 1 root 0 4096 Jan 1 00:59 cmb_trig_patt_mask
-rw-r--r-- 1 root 0 4096 Jan 1 00:57 cmb_trig_patt_val
-rw-r--r-- 1 root 0 4096 Jan 1 00:00 cmb_trig_ts
-rw-r--r-- 1 root 0 4096 Jan 1 00:58 cmb_ts_all
This patch series depends on:
[v3,0/11] Add support to configure TPDM DSB subunit
https://patchwork.kernel.org/project/linux-arm-kernel/cover/1679551448-1916…
Codelinaro link:
https://git.codelinaro.org/clo/linux-kernel/coresight/-/commits/tpdm-cmb-v1
Mao Jinlong (8):
coresight-tpdm: Add CMB dataset support
coresight-tpdm: Add support to configure CMB collection mode
coresight-tpdm: Add pattern registers support for CMB data set
coresight-tpdm: Add timestamp control register support for the CMB
coresight-tpdm: Add msr register support for CMB
dt-bindings: arm: Add support for TPDM CMB MSR register
coresight-tpda: Add support to configure CMB element size
dt-bindings: arm: Add support for TPDM CMB element size
.../testing/sysfs-bus-coresight-devices-tpdm | 63 +++
.../bindings/arm/qcom,coresight-tpdm.yaml | 26 +
drivers/hwtracing/coresight/coresight-tpda.c | 33 +-
drivers/hwtracing/coresight/coresight-tpda.h | 4 +
drivers/hwtracing/coresight/coresight-tpdm.c | 447 +++++++++++++++++-
drivers/hwtracing/coresight/coresight-tpdm.h | 60 +++
6 files changed, 626 insertions(+), 7 deletions(-)
--
2.39.0