linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 00/11] Add support to configure TPDM DSB subunit
@ 2023-04-27  9:00 Tao Zhang
  2023-04-27  9:00 ` [PATCH v4 01/11] dt-bindings: arm: Add support for DSB element size Tao Zhang
                   ` (11 more replies)
  0 siblings, 12 replies; 47+ messages in thread
From: Tao Zhang @ 2023-04-27  9:00 UTC (permalink / raw)
  To: Mathieu Poirier, Suzuki K Poulose, Alexander Shishkin,
	Konrad Dybcio, Mike Leach, Rob Herring, Krzysztof Kozlowski
  Cc: Tao Zhang, Jinlong Mao, Leo Yan, Greg Kroah-Hartman, coresight,
	linux-arm-kernel, linux-kernel, devicetree, Tingwei Zhang,
	Yuanfang Zhang, Trilok Soni, Hao Zhang, linux-arm-msm, andersson

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@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/patch/20230425143542.2305069-14-james.clark@arm.com/

TPDM_DSB commit tree:
https://git.codelinaro.org/clo/linux-kernel/coresight/-/tree/tpdm-dsb-v4
https://git.codelinaro.org/clo/linux-kernel/coresight/-/commits/tpdm-dsb-v4

Changes in V4:
1. Change the range of the property "qcom,dsb-element-size", and
change the type to enumeration.
-- Suzuki K Poulose, Krzysztof Kozlowski
2. Change dsb_esize from 32 bits to 8 bits.
-- Suzuki K Poulose
3. Update the function tpda_set_element_size since James has
updated the dependency series. Meanwhile, it will send out a
warning if it detects more than one TPDM from the same TPDA
input port.
-- Suzuki K Poulose
4. Add a source_sub_type for TPDM to distinguish TPDM from
the other coresight source.
-- Suzuki K Poulose
5. Return error if the element size is not configured on
devicetree in TPDA enablement.
-- Suzuki K Poulose
6. Move memory allocation from "tpdm_init_datasets" to
"tpdm_datasets_setup". Rename "tpdm_init_datasets" as
"tpdm_reset_datasets".
-- Suzuki K Poulose
7. Replace "coresight_disable" with "coresight_disable_source"
to disable the TPDM in resetting.
-- Suzuki K Poulose
8. Make sure "drvdata" is not NULL pointer before using it.
-- Suzuki K Poulose
9. Change "set_dsb_cycacc_mode" to "set_dsb_test_mode" since
cycle accurate mode is not supported on the current targets.
It is replaced by test mode.
10. Document the value of "dsb_mode".
-- Suzuki K Poulose
11. Macros are used to replace the formulas on dsb edge control
nodes.
-- Suzuki K Poulose
12. Document the values of "dsb_trig_patt_val" and
"dsb_trig_patt_mask".
-- Suzuki K Poulose
13. Combine two pattern related loops to one. And move DSB TIER
register configurations to the new function "set_dsb_tier".
-- Suzuki K Poulose
14. Rename the property "qcom,dsb_msr_num" to "qcom,dsb-msrs-num".
-- Suzuki K Poulose, Krzysztof Kozlowski

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 (11):
  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   | 174 ++++++
 .../bindings/arm/qcom,coresight-tpdm.yaml          |  19 +
 drivers/hwtracing/coresight/coresight-core.c       |   1 +
 drivers/hwtracing/coresight/coresight-tpda.c       |  92 ++-
 drivers/hwtracing/coresight/coresight-tpda.h       |   4 +
 drivers/hwtracing/coresight/coresight-tpdm.c       | 691 ++++++++++++++++++++-
 drivers/hwtracing/coresight/coresight-tpdm.h       |  79 +++
 include/linux/coresight.h                          |   1 +
 8 files changed, 1045 insertions(+), 16 deletions(-)

-- 
2.7.4


^ permalink raw reply	[flat|nested] 47+ messages in thread

end of thread, other threads:[~2023-06-06 13:06 UTC | newest]

Thread overview: 47+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-27  9:00 [PATCH v4 00/11] Add support to configure TPDM DSB subunit Tao Zhang
2023-04-27  9:00 ` [PATCH v4 01/11] dt-bindings: arm: Add support for DSB element size Tao Zhang
2023-04-27 12:59   ` Rob Herring
2023-04-27  9:00 ` [PATCH v4 02/11] coresight-tpda: Add DSB dataset support Tao Zhang
2023-05-23 10:07   ` Suzuki K Poulose
2023-05-23 14:48     ` Suzuki K Poulose
2023-05-25  7:20       ` Tao Zhang
2023-05-25  7:16     ` Tao Zhang
2023-05-25  9:08       ` Suzuki K Poulose
2023-05-26  3:22         ` Tao Zhang
2023-04-27  9:00 ` [PATCH v4 03/11] coresight-tpdm: Initialize DSB subunit configuration Tao Zhang
2023-05-23 13:42   ` Suzuki K Poulose
2023-05-25  8:12     ` Tao Zhang
2023-05-25  9:09       ` Suzuki K Poulose
2023-05-26  3:46         ` Tao Zhang
2023-04-27  9:00 ` [PATCH v4 04/11] coresight-tpdm: Add reset node to TPDM node Tao Zhang
2023-05-23 14:53   ` Suzuki K Poulose
2023-05-25  8:36     ` Tao Zhang
2023-04-27  9:00 ` [PATCH v4 05/11] coresight-tpdm: Add nodes to set trigger timestamp and type Tao Zhang
2023-06-01  9:05   ` Suzuki K Poulose
2023-06-02  2:29     ` Tao Zhang
2023-04-27  9:00 ` [PATCH v4 06/11] coresight-tpdm: Add node to set dsb programming mode Tao Zhang
2023-06-01  9:23   ` Suzuki K Poulose
2023-06-02  2:58     ` Tao Zhang
2023-06-02  8:25       ` Suzuki K Poulose
2023-06-02  8:31         ` Tao Zhang
2023-04-27  9:00 ` [PATCH v4 07/11] coresight-tpdm: Add nodes for dsb edge control Tao Zhang
2023-06-01 12:14   ` Suzuki K Poulose
2023-06-02  8:21     ` Tao Zhang
2023-06-02  8:45       ` Suzuki K Poulose
2023-06-02  9:00         ` Suzuki K Poulose
2023-06-05  9:12           ` Tao Zhang
2023-06-02 14:38         ` Tao Zhang
2023-06-02 16:05           ` Suzuki K Poulose
2023-04-27  9:00 ` [PATCH v4 08/11] coresight-tpdm: Add nodes to configure pattern match output Tao Zhang
2023-06-01 13:28   ` Suzuki K Poulose
2023-06-02  8:29     ` Tao Zhang
2023-04-27  9:00 ` [PATCH v4 09/11] coresight-tpdm: Add nodes for timestamp request Tao Zhang
2023-06-05 10:19   ` Suzuki K Poulose
2023-06-06 10:55     ` Tao Zhang
2023-04-27  9:00 ` [PATCH v4 10/11] dt-bindings: arm: Add support for DSB MSR register Tao Zhang
2023-04-27  9:00 ` [PATCH v4 11/11] coresight-tpdm: Add nodes for dsb msr support Tao Zhang
2023-06-05 10:24   ` Suzuki K Poulose
2023-06-06 12:45     ` Tao Zhang
2023-04-27 16:53 ` [PATCH v4 00/11] Add support to configure TPDM DSB subunit Suzuki K Poulose
     [not found]   ` <725b6ccd-ff70-a3d2-fe44-797c0509e643@quicinc.com>
2023-06-01  8:17     ` Tao Zhang
2023-06-01  8:36       ` Suzuki K Poulose

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).