devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 0/3] Add coresight slave register driver to support data filter function
@ 2024-06-18  7:27 Jie Gan
  2024-06-18  7:27 ` [PATCH v1 1/3] dt-bindings: arm: Add binding document for Coresight Slave Register device Jie Gan
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Jie Gan @ 2024-06-18  7:27 UTC (permalink / raw)
  To: Mathieu Poirier, Suzuki K Poulose, Alexander Shishkin,
	Konrad Dybcio, Mike Leach, Rob Herring, Krzysztof Kozlowski
  Cc: Jinlong Mao, Greg Kroah-Hartman, coresight, linux-arm-kernel,
	linux-kernel, devicetree, Tingwei Zhang, Yuanfang Zhang,
	Tao Zhang, Trilok Soni, Song Chai, linux-arm-msm, andersson,
	quic_yijiyang, quic_yuanjiey, quic_liuxin, quic_yanzl,
	quic_xinlon, quic_xueqnie, quic_sijiwu

The Coresight Slave Register(CSR) device hosts miscellaneous configuration
registers to control various features related to TMC ETR device.

The CSR device works as a helper device physically connected to the TMC ETR device.
---------------------------------------------------------
             |ETR0|             |ETR1|
              . \                 / .
              .  \               /  .
              .   \             /   .
              .    \           /    .
---------------------------------------------------     
ETR0ATID0-ETR0ATID3     CSR     ETR1ATID0-ETR1ATID3
---------------------------------------------------
Each ETR has four ATID registers with 128 bits long in total.
e.g. ETR0ATID0-ETR0ATID3 registers are used by ETR0 device.

Based on the trace id which is programed in CSR ATID register of
specific ETR, trace data with that trace id can get into ETR's buffer
while other trace data gets ignored. CSR may contain several ATID registers. 
Each ATID register is associated with an ETR device.

To achieve this function, the trace id is obtained and stored in the related
ETR device's driver data just before enabling the CSR. Then, the CSR
device can easily obtain the trace ID from the ETR's driver data because the
ETR's driver data is passed to the CSR's enable/disable functions.

Ensure that every source device has already allocated a trace ID in its probe
session because the sink device should always be the first device to
enable when operating coresight_enable_path function. As a helper device of the
ETR, the CSR device will program the ATID register of a specific ETR according to
the trace id to enable data filter function at a very early stage. Without the
correct trace ID, the enablement session will not work.

Each CSR's enable session will set one bit in the ATID register.
Every CSR's disbale seesion will reset all bits of the ATID register.

This patch only supports sysfs mode. I will send the perf mode part patch
once it is ready.

Looking forward to receiving comments as this is a new driver.

Thanks!

Jie Gan (3):
  dt-bindings: arm: Add binding document for Coresight Slave Register
    device.
  coresight: Add coresight slave register driver to support data filter
    function in sysfs mode
  arm64: dts: qcom: Add CSR and ETR nodes for SA8775p

 .../bindings/arm/arm,coresight-tmc.yaml       |   8 +
 .../bindings/arm/qcom,coresight-csr.yaml      |  49 +++
 arch/arm64/boot/dts/qcom/sa8775p.dtsi         | 167 ++++++++++
 drivers/hwtracing/coresight/Kconfig           |   6 +
 drivers/hwtracing/coresight/Makefile          |   1 +
 drivers/hwtracing/coresight/coresight-core.c  |   6 +-
 drivers/hwtracing/coresight/coresight-csr.c   | 315 ++++++++++++++++++
 drivers/hwtracing/coresight/coresight-csr.h   |  24 ++
 .../coresight/coresight-etm4x-core.c          |   1 +
 drivers/hwtracing/coresight/coresight-stm.c   |  50 ---
 drivers/hwtracing/coresight/coresight-sysfs.c |  45 ++-
 .../hwtracing/coresight/coresight-tmc-core.c  |   1 +
 drivers/hwtracing/coresight/coresight-tmc.h   |   2 +
 include/linux/coresight-stm.h                 |  44 +++
 14 files changed, 665 insertions(+), 54 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/arm/qcom,coresight-csr.yaml
 create mode 100644 drivers/hwtracing/coresight/coresight-csr.c
 create mode 100644 drivers/hwtracing/coresight/coresight-csr.h

-- 
2.34.1


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

end of thread, other threads:[~2024-06-21  7:36 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-18  7:27 [PATCH v1 0/3] Add coresight slave register driver to support data filter function Jie Gan
2024-06-18  7:27 ` [PATCH v1 1/3] dt-bindings: arm: Add binding document for Coresight Slave Register device Jie Gan
2024-06-18  9:56   ` Suzuki K Poulose
2024-06-19  6:07     ` JieGan
2024-06-18 11:12   ` Rob Herring (Arm)
2024-06-18  7:27 ` [PATCH v1 2/3] coresight: Add coresight slave register driver to support data filter function in sysfs mode Jie Gan
2024-06-19  7:55   ` [PATCH " Markus Elfring
2024-06-19  8:12     ` Greg Kroah-Hartman
2024-06-21  7:36   ` [PATCH v1 " kernel test robot
2024-06-18  7:27 ` [PATCH v1 3/3] arm64: dts: qcom: Add CSR and ETR nodes for SA8775p Jie Gan
2024-06-19 13:57   ` kernel test robot
2024-06-18  9:47 ` [PATCH v1 0/3] Add coresight slave register driver to support data filter function Suzuki K Poulose
2024-06-19  6:05   ` JieGan

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).