Commit d45fed4f authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

Merge tag 'coresight-next-v6.3' of...

Merge tag 'coresight-next-v6.3' of git://git.kernel.org/pub/scm/linux/kernel/git/coresight/linux

 into char-misc-next

Suzuki writes:

coresight: Updates for v6.3

 - Dynamic TraceID allocation scheme for CoreSight trace source. Allows systems
   with > 44 CPUs to use the ETMs. TraceID is advertised via AUX_OUTPUT_HWID
   packets in perf.data. Also allows allocating trace-ids for non-CPU bound trace
   components (e.g., Qualcomm TPDA).

- Support for Qualcomm TPDA and TPDM CoreSight devices.

- Support for Ultrasoc SMB CoreSight Sink buffer.

- Fixes for HiSilicon PTT driver

- MAINTAINERS update: Add Reviewer for HiSilicon PTT driver

- Bug fixes for CTI power management and sysfs mode

- Fix CoreSight ETM4x TRCSEQRSTEVRn access

Signed-off-by: default avatarSuzuki K Poulose <suzuki.poulose@arm.com>

* tag 'coresight-next-v6.3' of git://git.kernel.org/pub/scm/linux/kernel/git/coresight/linux: (35 commits)
  coresight: tmc: Don't enable TMC when it's not ready.
  coresight: tpda: fix return value check in tpda_probe()
  Coresight: tpda/tpdm: remove incorrect __exit annotation
  coresight: perf: Output trace id only once
  coresight: Fix uninitialised variable use in coresight_disable
  Documentation: coresight: tpdm: Add dummy comment after sysfs list
  Documentation: coresight: Extend title heading syntax in TPDM and TPDA documentation
  Documentation: trace: Add documentation for TPDM and TPDA
  dt-bindings: arm: Adds CoreSight TPDA hardware definitions
  Coresight: Add TPDA link driver
  coresight-tpdm: Add integration test support
  coresight-tpdm: Add DSB dataset support
  dt-bindings: arm: Add CoreSight TPDM hardware
  Coresight: Add coresight TPDM source driver
  coresight: core: Use IDR for non-cpu bound sources' paths.
  coresight: trace-id: Add debug & test macros to Trace ID allocation
  coresight: events: PERF_RECORD_AUX_OUTPUT_HW_ID used for Trace ID
  kernel: events: Export perf_report_aux_output_id()
  coresight: trace id: Remove legacy get trace ID function.
  coresight: etmX.X: stm: Remove trace_id() callback
  ...
parents 5e6a5178 669c4614
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -236,7 +236,7 @@ What: /sys/bus/coresight/devices/<memory_map>.[etm|ptm]/traceid
Date:		November 2014
KernelVersion:	3.19
Contact:	Mathieu Poirier <mathieu.poirier@linaro.org>
Description: 	(RW) Holds the trace ID that will appear in the trace stream
Description: 	(RO) Holds the trace ID that will appear in the trace stream
		coming from this trace entity.

What:		/sys/bus/coresight/devices/<memory_map>.[etm|ptm]/trigger_event
+13 −0
Original line number Diff line number Diff line
What:		/sys/bus/coresight/devices/<tpdm-name>/integration_test
Date:		January 2023
KernelVersion	6.2
Contact:	Jinlong Mao (QUIC) <quic_jinlmao@quicinc.com>, Tao Zhang (QUIC) <quic_taozha@quicinc.com>
Description:
		(Write) Run integration test for tpdm. Integration test
		will generate test data for tpdm. It can help to make
		sure that the trace path is enabled and the link configurations
		are fine.

		Accepts only one of the 2 values -  1 or 2.
		1 : Generate 64 bits data
		2 : Generate 32 bits data
+31 −0
Original line number Diff line number Diff line
What:		/sys/bus/coresight/devices/ultra_smb<N>/enable_sink
Date:		January 2023
KernelVersion:	6.3
Contact:	Junhao He <hejunhao3@huawei.com>
Description:	(RW) Add/remove a SMB device from a trace path. There can be
		multiple sources for a single SMB device.

What:		/sys/bus/coresight/devices/ultra_smb<N>/mgmt/buf_size
Date:		January 2023
KernelVersion:	6.3
Contact:	Junhao He <hejunhao3@huawei.com>
Description:	(RO) Shows the buffer size of each UltraSoc SMB device.

What:		/sys/bus/coresight/devices/ultra_smb<N>/mgmt/buf_status
Date:		January 2023
KernelVersion:	6.3
Contact:	Junhao He <hejunhao3@huawei.com>
Description:	(RO) Shows the value of UltraSoc SMB status register.
		BIT(0) is zero means buffer is empty.

What:		/sys/bus/coresight/devices/ultra_smb<N>/mgmt/read_pos
Date:		January 2023
KernelVersion:	6.3
Contact:	Junhao He <hejunhao3@huawei.com>
Description:	(RO) Shows the value of UltraSoc SMB Read Pointer register.

What:		/sys/bus/coresight/devices/ultra_smb<N>/mgmt/write_pos
Date:		January 2023
KernelVersion:	6.3
Contact:	Junhao He <hejunhao3@huawei.com>
Description:	(RO) Shows the value of UltraSoc SMB Write Pointer register.
+129 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0-only or BSD-2-Clause
# Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
%YAML 1.2
---
$id: http://devicetree.org/schemas/arm/qcom,coresight-tpda.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Trace, Profiling and Diagnostics Aggregator - TPDA

description: |
  TPDAs are responsible for packetization and timestamping of data sets
  utilizing the MIPI STPv2 packet protocol. Pulling data sets from one or
  more attached TPDM and pushing the resultant (packetized) data out a
  master ATB interface. Performing an arbitrated ATB interleaving (funneling)
  task for free-flowing data from TPDM (i.e. CMB and DSB data set flows).

  There is no strict binding between TPDM and TPDA. TPDA can have multiple
  TPDMs connect to it. But There must be only one TPDA in the path from the
  TPDM source to TMC sink. TPDM can directly connect to TPDA's inport or
  connect to funnel which will connect to TPDA's inport.

  We can use the commands are similar to the below to validate TPDMs.
  Enable coresight sink first.

  echo 1 > /sys/bus/coresight/devices/tmc_etf0/enable_sink
  echo 1 > /sys/bus/coresight/devices/tpdm0/enable_source
  echo 1 > /sys/bus/coresight/devices/tpdm0/integration_test
  echo 2 > /sys/bus/coresight/devices/tpdm0/integration_test

  The test data will be collected in the coresight sink which is enabled.
  If rwp register of the sink is keeping updating when do integration_test
  (by cat tmc_etf0/mgmt/rwp), it means there is data generated from TPDM
  to sink.

maintainers:
  - Mao Jinlong <quic_jinlmao@quicinc.com>
  - Tao Zhang <quic_taozha@quicinc.com>

# Need a custom select here or 'arm,primecell' will match on lots of nodes
select:
  properties:
    compatible:
      contains:
        enum:
          - qcom,coresight-tpda
  required:
    - compatible

properties:
  $nodename:
    pattern: "^tpda(@[0-9a-f]+)$"
  compatible:
    items:
      - const: qcom,coresight-tpda
      - const: arm,primecell

  reg:
    minItems: 1
    maxItems: 2

  clocks:
    maxItems: 1

  clock-names:
    items:
      - const: apb_pclk

  in-ports:
    type: object
    description: |
      Input connections from TPDM to TPDA
    $ref: /schemas/graph.yaml#/properties/ports

  out-ports:
    type: object
    description: |
      Output connections from the TPDA to legacy CoreSight trace bus.
    $ref: /schemas/graph.yaml#/properties/ports

    properties:
      port:
        description:
          Output connection from the TPDA to legacy CoreSight Trace bus.
        $ref: /schemas/graph.yaml#/properties/port

required:
  - compatible
  - reg
  - clocks
  - clock-names
  - in-ports
  - out-ports

additionalProperties: false

examples:
  # minimum tpda definition.
  - |
    tpda@6004000 {
       compatible = "qcom,coresight-tpda", "arm,primecell";
       reg = <0x6004000 0x1000>;

       clocks = <&aoss_qmp>;
       clock-names = "apb_pclk";

       in-ports {
         #address-cells = <1>;
         #size-cells = <0>;

        port@0 {
          reg = <0>;
          tpda_qdss_0_in_tpdm_dcc: endpoint {
            remote-endpoint =
              <&tpdm_dcc_out_tpda_qdss_0>;
            };
        };
      };

       out-ports {
         port {
                 tpda_qdss_out_funnel_in0: endpoint {
                    remote-endpoint =
                    <&funnel_in0_in_tpda_qdss>;
                  };
          };
       };
    };

...
+93 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0-only or BSD-2-Clause
# Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
%YAML 1.2
---
$id: http://devicetree.org/schemas/arm/qcom,coresight-tpdm.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Trace, Profiling and Diagnostics Monitor - TPDM

description: |
  The TPDM or Monitor serves as data collection component for various dataset
  types specified in the QPMDA spec. It covers Implementation defined ((ImplDef),
  Basic Counts (BC), Tenure Counts (TC), Continuous Multi-Bit (CMB), and Discrete
  Single Bit (DSB). It performs data collection in the data producing clock
  domain and transfers it to the data collection time domain, generally ATB
  clock domain.

  The primary use case of the TPDM is to collect data from different data
  sources and send it to a TPDA for packetization, timestamping, and funneling.

maintainers:
  - Mao Jinlong <quic_jinlmao@quicinc.com>
  - Tao Zhang <quic_taozha@quicinc.com>

# Need a custom select here or 'arm,primecell' will match on lots of nodes
select:
  properties:
    compatible:
      contains:
        enum:
          - qcom,coresight-tpdm
  required:
    - compatible

properties:
  $nodename:
    pattern: "^tpdm(@[0-9a-f]+)$"
  compatible:
    items:
      - const: qcom,coresight-tpdm
      - const: arm,primecell

  reg:
    minItems: 1
    maxItems: 2

  clocks:
    maxItems: 1

  clock-names:
    items:
      - const: apb_pclk

  out-ports:
    description: |
      Output connections from the TPDM to coresight funnel/TPDA.
    $ref: /schemas/graph.yaml#/properties/ports

    properties:
      port:
        description: Output connection from the TPDM to coresight
            funnel/TPDA.
        $ref: /schemas/graph.yaml#/properties/port

required:
  - compatible
  - reg
  - clocks
  - clock-names

additionalProperties: false

examples:
  # minimum TPDM definition. TPDM connect to coresight TPDA.
  - |
    tpdm@684c000 {
      compatible = "qcom,coresight-tpdm", "arm,primecell";
      reg = <0x0684c000 0x1000>;

      clocks = <&aoss_qmp>;
      clock-names = "apb_pclk";

      out-ports {
        port {
          tpdm_prng_out_tpda_qdss: endpoint {
            remote-endpoint =
              <&tpda_qdss_in_tpdm_prng>;
          };
        };
      };
    };

...
Loading